
    %
i                     f    d dl Z d dlZd dlZd dlZd dlZddZd Zd Zedk    r e             dS dS )    NApplicationc                    t          j        | |          }t          j        |          }d}	 t          j        |t           j        t           j        z  d          }|sn.|D ]}t          j        ||          }|j        V	 t          j
        | |j                  \  }	}
}|	 d|
 }n)# t          j        $ r t          |j                  }Y nw xY wd| }nd }|rt          d                    |j        |j                                                             |rt          |           	 t          |           # t$          $ r/ t          d           t          t'          |                     Y w xY w|t)          |          z  }_||k    rt          d|d           n#t          d	||fz             t          d
           t          j        |           d S )Nr      /zEvent associated with user z&Event record from {!r} generated at {}z3(unicode error printing message: repr() follows...)zSuccessfully read allrecordsz4Couldn't get all records - reported %d, but found %dzJ(Note that some other app may have written records while we were running!))win32evtlogOpenEventLogGetNumberOfEventLogRecordsReadEventLogEVENTLOG_BACKWARDS_READEVENTLOG_SEQUENTIAL_READwin32evtlogutilSafeFormatMessageSidwin32securityLookupAccountSiderrorstrprintformat
SourceNameTimeGeneratedFormatUnicodeErrorreprlenCloseEventLog)computerlogTypedumpEachRecordh
numRecordsnumobjectsobjectmsgdomainusertypsidDesc	user_descs                 C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\win32/Demos/eventLogDemo.pyReadLogr-      sN    733A7::J C$*/+2VV
 

  	 	% 	%F!3FGDDCz%.(5(F &*) )%FD# "(00$00GG$* . . .!&*ooGGG.C'CC		 	 %<CC)6+?+F+F+H+H   
  %)$$$%#JJJJ# % % %OPPP$s))$$$$$%% 	s7||I$L S%z9====BjRUEVV	
 	
 	
 	X	
 	
 	
 a     s$    %B&&#CC*D::5E32E3c                      t          d           t          d           t          d           t          d           t          d           t          d           d S )Nz!Writes an event to the event log.z"-w : Don't write any test records.z-r : Don't read the event logz=-c : computerName : Process the log on the specified computerz-v : Verbosez>-t : LogType - Use the specified log - default = 'Application')r        r,   usager1   A   sa    	
-...	
.///	
)***	
IJJJ	.	
JKKKKKr0   c                  :   dd l } dd l}|                      |j        dd          d          \  }}d }dx}}d}d}t          |          dk    rt	          d           t                       dS |D ]E\  }	}
|	dk    r|
}|	dk    r|
}|	dv rt                        d S |	d	k    rd}|	d
k    rd}|	dk    r|dz  }F|rt          j                    }t          j	        |t          j                  }t          j        |t          j                  d         }t          j        |dddgd|           t          j        |dt           j        ddgd|           t          j        |dt           j        ddgd|           t	          d           |rt'          |||dk               d S d S )Nr   r   z	rwh?c:t:vr   zInvalid argsz-tz-c)z-hz-?z-rz-wz-v   zThe message text for event 2zAnother inserts   Raw Data)stringsdatasidz	A warningzAn even more dire warning)	eventTyper4   r5   r6   zAn infozToo much infoz'Successfully wrote 3 records to the log)getoptsysargvr   r   r1   win32apiGetCurrentProcessr   OpenProcessTokenwin32con
TOKEN_READGetTokenInformation	TokenUserr   ReportEventr   EVENTLOG_WARNING_TYPEEVENTLOG_INFORMATION_TYPEr-   )r8   r9   optsargsr   do_readdo_writer   verboseoptvalphthmy_sids                 r,   testrO   J   s   MMMJJJsx|[99JD$HGhGG
4yy1}}nq  S$;;G$;;H,GGGFF$;;G$;;H$;;qLG 9'))+B0CDD22}7NOOPQR#35EF	
 	
 	
 	
 	#!7 "=>	
 	
 	
 	
 	#!;0	
 	
 	
 	
 	7888 0'7Q;/////0 0r0   __main__)r   r   )	r;   r>   r   r   r   r-   r1   rO   __name__r/   r0   r,   <module>rR      s                 6! 6! 6! 6!rL L L<0 <0 <0~ zDFFFFF r0   