
    Mh                     :    d Z ddlZddlmZ defdZdeddfdZdS )zUse a Windows event to interrupt a child process like SIGINT.

The child needs to explicitly listen for this - see
ipykernel.parentpoller.ParentPollerWindows for a Python implementation.
    N)Anyreturnc                  
    G d dt           j                  }  |             }t          j        |          }t          j        |           |_        d|_        d|_        t           j        j        	                    |ddd          S )zCreate an interrupt event handle.

    The parent process should call this to create the
    interrupt event that is passed to the child process. It should store
    this handle and use it with ``send_interrupt`` to interrupt the child
    process.
    c                   B    e Zd Zdej        fdej        fdej        fgZdS )3create_interrupt_event.<locals>.SECURITY_ATTRIBUTESnLengthlpSecurityDescriptorbInheritHandleN)__name__
__module____qualname__ctypesc_intc_void_p_fields_     \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jupyter_client/win_interrupt.pySECURITY_ATTRIBUTESr      s3        %#V_5v|,
r   r   r      F )
r   	Structurepointersizeofr   r	   r
   windllkernel32CreateEventA)r   sasa_ps      r   create_interrupt_eventr    
   s    
 
 
 
 
f. 
 
 
 
			B>"D233BJBB=!..
	  r   interrupt_handlec                 N    t           j        j                            |            dS )z4Sends an interrupt event using the specified handle.N)r   r   r   SetEvent)r!   s    r   send_interruptr$   +   s"    
M##$455555r   )__doc__r   typingr   r    r$   r   r   r   <module>r'      st    
           B6S 6T 6 6 6 6 6 6r   