mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Aded new generated ctypes_generation
This commit is contained in:
@@ -20,13 +20,16 @@ class PSID(_INITIAL_PSID): # _INITIAL_PSID -> PVOID
|
||||
@classmethod
|
||||
def from_string(cls, strsid):
|
||||
self = cls()
|
||||
if not isinstance(strsid, bytes):
|
||||
strsid = strsid.encode("ascii")
|
||||
# Pass to ConvertStringSidToSidW ?
|
||||
windows.winproxy.ConvertStringSidToSidA(strsid, self)
|
||||
return self
|
||||
|
||||
def to_string(self):
|
||||
sid_str = LPCSTR()
|
||||
windows.winproxy.ConvertSidToStringSidA(self, sid_str)
|
||||
result = sid_str.value
|
||||
result = sid_str.value.decode("ascii") # ConvertSidToStringSidW ?
|
||||
windows.winproxy.LocalFree(sid_str)
|
||||
return result
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info.major == 3:
|
||||
if sys.version_info.major >= 3:
|
||||
long = int
|
||||
|
||||
|
||||
@@ -14,7 +14,12 @@ class Flag(long):
|
||||
def __repr__(self):
|
||||
return "{0}({1:#x})".format(self.name, self)
|
||||
|
||||
__str__ = __repr__
|
||||
# Custom __str__ removed for multiple reason
|
||||
# Main one -> it breaks the json encoding of structure with flags :)
|
||||
# Moving to a new politic -> if people want the name in a string use {x!r}
|
||||
# The __str__ of security descriptor & guid will change soon as well :)
|
||||
|
||||
# __str__ = __repr__
|
||||
|
||||
# Fix pickling with protocol 2
|
||||
def __getnewargs__(self, *args):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from winstructs import *
|
||||
from .winstructs import *
|
||||
import functools
|
||||
import ctypes
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
import ctypes
|
||||
from flag import Flag
|
||||
from .flag import Flag
|
||||
|
||||
class NtStatusException(WindowsError):
|
||||
ALL_STATUS = {}
|
||||
|
||||
+746
-641
File diff suppressed because it is too large
Load Diff
+3055
-3055
File diff suppressed because it is too large
Load Diff
+1450
-1075
File diff suppressed because it is too large
Load Diff
+4106
-3579
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user