OwlCyberSecurity - MANAGER
Edit File: windows_utils.cpython-38.pyc
U ����e5d�����������������������@���s����d�Z�ddlZejdkred��ddlZddlZddlZddlZddlZddl Z ddl Z dZdZej Z ejZe���Zdded �d d�ZG�dd ��d �ZG�dd��dej�ZdS�)z)Various Windows specific bits and pieces.�����NZwin32z win32 only)�pipe�Popen�PIPE� PipeHandlei� ��F)TT)�duplex� overlapped�bufsizec�������������� ���C���s$��t�jd�t���tt��d�}|�r>tj}tj tj B�}||�}}ntj}tj }d|�}}|tjO�}|d�rp|tj O�}|d�r�tj }nd}d�} } z\t�||tjd||tjtj�} t�||dtjtj|tj�} tj| dd�}|�d��| | fW�S����| dk �rt�| ��| dk �rt�| ����Y�nX�dS�)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�������NT�r���)�tempfileZmktemp�format�os�getpid�next� _mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ CreateFileZ OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)r���r���r���ZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov��r����-/usr/lib64/python3.8/asyncio/windows_utils.pyr��� ���sb������� ������������� r���c�������������������@���sb���e�Zd�ZdZdd��Zdd��Zedd���Zdd ��Ze j d �dd�Zej fd d�Zdd��Zdd��ZdS�)r���z�Wrapper for an overlapped pipe handle which is vaguely file-object like. The IOCP event loop can use these instead of socket objects. c�����������������C���s ���||�_�d�S��N��_handle��self�handler���r���r����__init__V���s����zPipeHandle.__init__c�����������������C���s2���|�j�d�k rd|�j���}nd}d|�jj��d|��d�S�)Nzhandle=�closed�<� �>)r���� __class__�__name__r���r���r���r����__repr__Y���s���� zPipeHandle.__repr__c�����������������C���s���|�j�S�r���r����r���r���r���r���r���`���s����zPipeHandle.handlec�����������������C���s���|�j�d�krtd��|�j�S�)NzI/O operation on closed pipe)r���� ValueErrorr%���r���r���r����filenod���s���� zPipeHandle.fileno)r���c����������������C���s���|�j�d�k r||�j���d�|�_�d�S�r���r���)r���r���r���r���r����closei���s���� zPipeHandle.closec�����������������C���s*���|�j�d�k r&|d|���t|�d��|�����d�S�)Nz unclosed )�source)r����ResourceWarningr(���)r���Z_warnr���r���r����__del__n���s���� zPipeHandle.__del__c�����������������C���s���|�S�r���r���r%���r���r���r���� __enter__s���s����zPipeHandle.__enter__c�����������������C���s���|������d�S�r���)r(���)r����t�v�tbr���r���r����__exit__v���s����zPipeHandle.__exit__N)r#���� __module__�__qualname__�__doc__r���r$����propertyr���r'���r���r���r(����warnings�warnr+���r,���r0���r���r���r���r���r���Q���s��� r���c�����������������������s"���e�Zd�ZdZd��fdd� Z���ZS�)r���z�Replacement for subprocess.Popen using overlapped pipe handles. The stdin, stdout, stderr are None or instances of PipeHandle. Nc�������������� ������s���|��d�rt�|��dd�dks"t�d��}�}}d��} �} }|tkrbtddd�\}} t�|tj�}n|}|tkr�tdd�\} } t�| d�}n|}|tkr�tdd�\}}t�|d�}n|tkr�|}n|}z�z t ��j|f|||d �|���W�n0���| | |fD�]}|d�k r�t� |��q���Y�n>X�| d�k �r,t| �|�_| d�k �r@t| �|�_|d�k �rTt|�|�_W�5�|tk�rlt� |��|tk�r�t� |��|tk�r�t� |��X�d�S�) NZuniversal_newlinesr���r���)FTT)r���r���)TFr���)�stdin�stdout�stderr)�get�AssertionErrorr���r����msvcrtZopen_osfhandler����O_RDONLY�STDOUTr(����superr���r���r���r���r7���r8���r9���)r����argsr7���r8���r9����kwdsZ stdin_rfdZ stdout_wfdZ stderr_wfdZstdin_whZ stdout_rhZ stderr_rhZstdin_rhZ stdout_whZ stderr_wh�h�r"���r���r���r�������sR������ zPopen.__init__)NNN)r#���r1���r2���r3���r���� __classcell__r���r���rC���r���r���}���s���r���)r3����sys�platform�ImportErrorr���� itertoolsr<���r���� subprocessr���r5����__all__ZBUFSIZEr���r>����countr���r���r���r���r���r���r���r����<module>���s$��� 1,