VccsdZddlZejdkr edddlZddlZddlZddlZddlZddl Z ddl Z dZ dZ ej Z ejZejZdde d d ZGd d ZGd dejZdS)z)Various Windows specific bits and pieces.NZwin32z win32 only)pipePopenPIPE PipeHandlei F)TT)duplex overlappedbufsizec sRtjdtjt t }|r*tj}tj tj z}||}}ntj }tj }d|}}|tj z}|dr|tj z}|dr tj }nd}dx} } tj||tjd||tjtj} tj||dtjtj|tj} tj| d} | d| | fS#| tj| | tj| xYw)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)ZprefixriNTr)tempfileZmktempZformatosZgetpidZnext _mmap_counter_winapiZPIPE_ACCESS_DUPLEXZ GENERIC_READZ GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ CreateFileZ OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult CloseHandle) rrrZaddressZopenmodeZaccessZobsizeZibsizeZflags_and_attribsZh1Zh2Zovs ./usr/lib64/python3.11/asyncio/windows_utils.pyrr so188 IKKm,,..///G$-%(== '.&G 55H!}1G00!}#8NB  $ Xw0 vvw;W\KK  VQ g.C w|-- %bT : : : t$$$2v   $   # # #  $   # # # s BE77/F&cspeZdZdZdZdZedZdZe j ddZ e j fdZd 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. cs||_dSN_handleselfhandle r__init__zPipeHandle.__init__Vs  csP|j d|j}nd}d|jjd|dS)Nzhandle=Zclosedz)r __class____name__rrr__repr__zPipeHandle.__repr__Ys@ < /t|//FFF64>*66V6666rcs|jSrrr rrzPipeHandle.handle`s |rcs<|jtd|jS)NzI/O operation on closed pipe)rZ ValueErrorrrrfilenozPipeHandle.filenods# < =;<< <|r)r csF|j||jd|_dSdSrr)rr rrclosezPipeHandle.closeis3 < K % % %DLLL  rcsl|j,|d|t||dSdS)Nz unclosed )Zsource)rZResourceWarningr)rZ_warnrr__del__zPipeHandle.__del__nsG <  E&d&& E E E E JJLLLLL  rcs|Srrrr __enter__zPipeHandle.__enter__ss rcs.|dSr)r)rZtZvZtbs r__exit__zPipeHandle.__exit__vs rN)r __module__ __qualname____doc__rrZpropertyrrr r rwarningsZwarnrr!r"r rrrrQs777X $+#6     %M rrcs$eZdZdZdfd ZxZS)rzReplacement for subprocess.Popen using overlapped pipe handles. The stdin, stdout, stderr are None or instances of PipeHandle. Nc s|drJ|dddksJdx}x}}dx} x} } |tkr4tdd\} } tj| t j}n|}|tkr)td\} } tj| d}n|}|tkr)td\} }tj|d}n|tkr|}n|} tj |f|||d || t| |_ | t| |_ | t| |_ n$#| | | fD]}|tj|xYw|tkrt j||tkrt j||tkrt j|dSdS#|tkrt j||tkrt j||tkrt j|wwxYw) NZuniversal_newlinesrr)FTT)rr)TFr)stdinstdoutstderr)ZgetrrmsvcrtZopen_osfhandler ZO_RDONLYSTDOUTZsuperrrr'r(r)r r r)rZargsr'r(r)ZkwdsZ stdin_rfdZ stdout_wfdZ stderr_wfdZstdin_whZ stdout_rhZ stderr_rhZstdin_rhZ stdout_whZ stderr_whZhrs rrzPopen.__init__s88011111xx 1%%****.22 2J+///9y D= !%t!L!L!L Hh-h DDIII T> #'=#A#A#A Iy.y!< #'=#A#A#A Iy.y!<r,s'// <7$ +l # ##  0    !! \7+++++b&&&&&&&&X0%0%0%0%0%J 0%0%0%0%0%r