Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
16
venv/Lib/site-packages/win32/Demos/EvtSubscribe_push.py
Normal file
16
venv/Lib/site-packages/win32/Demos/EvtSubscribe_push.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
## Demonstrates a "push" subscription with a callback function
|
||||
import win32evtlog
|
||||
query_text='*[System[Provider[@Name="Microsoft-Windows-Winlogon"]]]'
|
||||
|
||||
def c(reason, context, evt):
|
||||
if reason==win32evtlog.EvtSubscribeActionError:
|
||||
print ('EvtSubscribeActionError')
|
||||
elif reason==win32evtlog.EvtSubscribeActionDeliver:
|
||||
print ('EvtSubscribeActionDeliver')
|
||||
else:
|
||||
print(('??? Unknown action ???', reason))
|
||||
context.append(win32evtlog.EvtRender(evt, win32evtlog.EvtRenderEventXml))
|
||||
return 0
|
||||
|
||||
evttext=[]
|
||||
s=win32evtlog.EvtSubscribe('System', win32evtlog.EvtSubscribeStartAtOldestRecord, Query='*', Callback=c, Context=evttext)
|
||||
Loading…
Add table
Add a link
Reference in a new issue