Wc*dZddlZejdkr edddlZddlZddlZddlZddlZddl Z ddl Z dZ dZ ejZ ejZejZdde d d ZGd d ZGd dej&ZdS)z)Various Windows specific bits and pieces.Nwin32z win32 only)pipePopenPIPE PipeHandlei F)TT)duplex overlappedbufsizec tjdjtjt t }|r9tj}tjtjz}||}}n&tj}tj}d|}}|tjz}|dr|tjz}|drtj}nd}dx} } tj||tjd||tj tj"} tj$||dtj"tj&|tj"} tj(| d} | j+d| | fS#| tj,| | tj,| xYw)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)prefixrNTr )tempfilemktempformatosgetpidnext _mmap_counter_winapiPIPE_ACCESS_DUPLEX GENERIC_READ GENERIC_WRITEPIPE_ACCESS_INBOUNDFILE_FLAG_FIRST_PIPE_INSTANCEFILE_FLAG_OVERLAPPEDCreateNamedPipe PIPE_WAITNMPWAIT_WAIT_FOREVERNULL CreateFile OPEN_EXISTINGConnectNamedPipeGetOverlappedResult CloseHandle) rr r addressopenmodeaccessobsizeibsizeflags_and_attribsh1h2ovs ./usr/lib64/python3.12/asyncio/windows_utils.pyrr soo188 IIKm,.//Gv--%%(=(== '..&&G 555H!}}G000!}}#88NB  $ $ Xw00 vvw;;W\\K   VQ g.C.C w||- % %bT : : t$$2v  >    # # >    # # s CG5G9ceZdZdZdZdZedZdZe jddZ e jfdZd Zd Zd S) rzWrapper for an overlapped pipe handle which is vaguely file-object like. The IOCP event loop can use these instead of socket objects. c||_dSN_handleselfhandles r/__init__zPipeHandle.__init__Vs  cx|jd|j}nd}d|jjd|dS)Nzhandle=closed< >)r4 __class____name__r5s r/__repr__zPipeHandle.__repr__YsG << #/t||//FFF64>>**66V6666r9c|jSr2r3r6s r/r7zPipeHandle.handle`s ||r9cL|j td|jS)NzI/O operation on closed pipe)r4 ValueErrorrCs r/filenozPipeHandle.filenods" << ;< <||r9)r%cV|j||jd|_dSdSr2r3)r6r%s r/closezPipeHandle.closeis0 << # K % %DLLL $ #r9cl|j'|d|t||jdSdS)Nz unclosed )source)r4ResourceWarningrH)r6_warns r/__del__zPipeHandle.__del__ns@ << # E&d&& E E E JJLLLL $ #r9c|Sr2rCs r/ __enter__zPipeHandle.__enter__ss r9c(|jdSr2)rH)r6tvtbs r/__exit__zPipeHandle.__exit__vs r9N)r@ __module__ __qualname____doc__r8rApropertyr7rFrr%rHwarningswarnrMrPrUrOr9r/rrQs777 $+#6#6     %MM r9rc$eZdZdZdfd ZxZS)rzReplacement for subprocess.Popen using overlapped pipe handles. The stdin, stdout, stderr are None or instances of PipeHandle. Nc \dx}x}}dx} x} } |tkr:tdd\} } tj| tj }n|}|tkr*td\} } tj| d}n|}|tkr*td\} }tj|d}n|t kr|}n|} tj|f|||d|| t| |_ | t| |_ | t| |_ |tkrt j||tkrt j||tkrt j|dSdS#| | | fD]}|tj|xYw#|tkrt j||tkrt j||tkrt j|wxYw)N)FTT)r r)TFrr)stdinstdoutstderr)rrmsvcrtopen_osfhandlerO_RDONLYSTDOUTsuperr8rr^r_r`rr%rH)r6argsr^r_r`kwds stdin_rfd stdout_wfd stderr_wfdstdin_wh stdout_rh stderr_rhstdin_rh stdout_wh stderr_whhr?s r/r8zPopen.__init__s=/32 2J+///9y D==!%t!L!L Hh--h DIII T>>#'=#A#A Iy..y!>#'=#A#A Iy..y!r{s!// <<7 +l ##  0     ! \7+++++b&&&&&&&X0%0%0%0%0%J  0%0%0%0%r9