pywin32 TOKEN_PRIVILEGES

467 views Asked by At

So here's the problem : I'm trying to make a service that starts another exe to show GUI on the login screen of windows. And the cherry on the top : I wish to implement it in python. After some googling, I found this : Running a process at the Windows 7 Welcome Screen . So I went ahead and converted it almost entirely using pywin32, but there's a problem : I cannot make a PyTOKEN_PRIVILEGES object. Unlike other objects, there was a function to instantiate it, but this one doesn't seem to have any ?

1

There are 1 answers

1
Roger Upole On BEST ANSWER

win32security.AdjustTokenPrivileges will accept a sequence of 2-tuples for the TOKEN_PRIVILEGES arg. See win32\Demos\security\set_file_audit.py for an example. This is also documented in the help file that comes with Pywin32.