o
    IXîhˆ  ã                   @   s¸   d Z ddlmZmZ ddlZddlZddlZddlZeejejƒZ	dd„ Z
e	e
ƒZejjjZe	ejfe_eje_edkrZeedƒsIedƒ ed	ƒ e d	dejd ¡Zded< 	 	 qXdS )
aY  Script used to test os.kill on Windows, for issue #1220212

This script is started as a subprocess in test_os and is used to test the
CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
to be written into the kill target.

See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx for a
similar example in C.
é    )ÚwintypesÚWINFUNCTYPENc                 C   s,   | t jkr	 dS | t jkr	 dS tdƒ dS )z8Handle a sig event and return 0 to terminate the processzUNKNOWN EVENTr   )ÚsignalZCTRL_C_EVENTZCTRL_BREAK_EVENTÚprint)Úsig© r   úB/opt/python-3.10.19/usr/lib/python3.10/test/win_console_handler.pyÚ_ctrl_handler   s   

üÿr	   Ú__main__é   z#Unable to add SetConsoleCtrlHandleréÿÿÿÿ)Ú__doc__Zctypesr   r   r   ZmmapÚsysZBOOLZDWORDZHandlerRoutiner	   Zctrl_handlerZwindllZkernel32ZSetConsoleCtrlHandlerÚargtypesZrestypeÚ__name__r   ÚexitÚargvÚmr   r   r   r   Ú<module>   s,    



ÿõ