mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Token privilege code use W() API + use of GetNamedSecurityInfoW in security.py (fix issue #40)
This commit is contained in:
+1
-1
@@ -820,7 +820,7 @@ class SecurityDescriptor(gdef.PSECURITY_DESCRIPTOR):
|
||||
if query_sacl:
|
||||
flags |= gdef.SACL_SECURITY_INFORMATION
|
||||
|
||||
winproxy.GetNamedSecurityInfoA(
|
||||
winproxy.GetNamedSecurityInfoW(
|
||||
objname,
|
||||
objtype,
|
||||
flags,
|
||||
|
||||
@@ -115,12 +115,12 @@ class TokenPrivileges(gdef.TOKEN_PRIVILEGES):
|
||||
def _lookup_name(self, luid):
|
||||
size = gdef.DWORD(0x100)
|
||||
buff = ctypes.c_buffer(size.value)
|
||||
winproxy.LookupPrivilegeNameA(None, luid, buff, size)
|
||||
winproxy.LookupPrivilegeNameW(None, luid, buff, size)
|
||||
return buff[:size.value]
|
||||
|
||||
def _lookup_value(self, name):
|
||||
luid = gdef.LUID()
|
||||
winproxy.LookupPrivilegeValueA(None, name, ctypes.byref(luid))
|
||||
winproxy.LookupPrivilegeValueW(None, name, ctypes.byref(luid))
|
||||
return luid
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user