[pywin32-checkins] pywin32/win32/Demos/security lsaregevent.py,NONE,1.1 lsastore.py,NONE,1.1
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-10-23 01:49:45
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/security In directory sc8-pr-cvs1:/tmp/cvs-serv10198 Added Files: lsaregevent.py lsastore.py Log Message: New LSA demos/tests from Roger. --- NEW FILE: lsaregevent.py --- import win32security, win32event evt = win32event.CreateEvent(None,0,0,None) win32security.LsaRegisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) print "Waiting for you change Audit policy in Management console ..." ret_code=win32event.WaitForSingleObject(evt,1000000000) ## should come back when you change Audit policy in Management console ... print ret_code win32security.LsaUnregisterPolicyChangeNotification(win32security.PolicyNotifyAuditEventsInformation, evt) --- NEW FILE: lsastore.py --- import win32security policy_handle = win32security.GetPolicyHandle('',win32security.POLICY_ALL_ACCESS) privatedata='some sensitive data' keyname='tmp' win32security.LsaStorePrivateData(policy_handle,keyname,privatedata) retrieveddata=win32security.LsaRetrievePrivateData(policy_handle,keyname) assert retrieveddata==privatedata ## passing None deletes key win32security.LsaStorePrivateData(policy_handle,keyname,None) win32security.LsaClose(policy_handle) |