mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
19 lines
517 B
Python
19 lines
517 B
Python
from windows.generated_def import PSID
|
|
from windows import winproxy
|
|
|
|
class EPSID(PSID):
|
|
def __repr__(self):
|
|
return '<Sid "{0}" at {1:#8x}>'.format(str(self), id(self))
|
|
|
|
def __str__(self):
|
|
sid_str = LPCSTR()
|
|
winproxy.ConvertSidToStringSidA(self, sid_str)
|
|
result = sid_str.value
|
|
winproxy.LocalFree(sid_str)
|
|
return result
|
|
|
|
@classmethod
|
|
def from_string(cls, sidstr):
|
|
self = cls()
|
|
winproxy.ConvertStringSidToSidA(sidstr, self)
|
|
return self |