diff --git a/stubs/pywin32/win32/win32file.pyi b/stubs/pywin32/win32/win32file.pyi index 4cb0def25531..c2f9fb84c833 100644 --- a/stubs/pywin32/win32/win32file.pyi +++ b/stubs/pywin32/win32/win32file.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, WriteableBuffer +from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer from socket import socket from typing import TypeVar, overload from typing_extensions import deprecated @@ -32,7 +32,24 @@ def SetMailslotInfo(Mailslot: int, ReadTimeout, /) -> None: ... def DefineDosDevice(flags, deviceName: str, targetPath: str, /) -> None: ... def DefineDosDeviceW(flags, deviceName: str, targetPath: str, /) -> None: ... def DeleteFile(fileName: str, /) -> None: ... -def DeviceIoControl(Device: int, IoControlCode, InBuffer, OutBuffer, Overlapped: _win32typing.PyOVERLAPPED | None = ...): ... + +@overload +def DeviceIoControl( + Device: int, IoControlCode: int, InBuffer: ReadableBuffer | None, OutBuffer: int, Overlapped: None = None +) -> bytes: ... +@overload +def DeviceIoControl( + Device: int, IoControlCode: int, InBuffer: ReadableBuffer | None, OutBuffer: int, Overlapped: _win32typing.PyOVERLAPPED +) -> memoryview: ... +@overload +def DeviceIoControl( + Device: int, + IoControlCode: int, + InBuffer: ReadableBuffer | None, + OutBuffer: WriteableBuffer, + Overlapped: _win32typing.PyOVERLAPPED | None = None, +) -> WriteableBuffer: ... + def FindClose(hFindFile, /) -> None: ... def FindCloseChangeNotification(hChangeHandle, /) -> None: ... def FindFirstChangeNotification(pathName: str, bWatchSubtree, notifyFilter, /): ... diff --git a/stubs/pywin32/win32/win32pipe.pyi b/stubs/pywin32/win32/win32pipe.pyi index 14779bdc04ff..2a6e39f38212 100644 --- a/stubs/pywin32/win32/win32pipe.pyi +++ b/stubs/pywin32/win32/win32pipe.pyi @@ -9,7 +9,7 @@ def GetNamedPipeHandleState( def SetNamedPipeHandleState( hPipe: int, Mode: int, MaxCollectionCount: None | Incomplete, CollectDataTimeout: None | Incomplete, / ) -> None: ... -def ConnectNamedPipe(hPipe: int, overlapped: _win32typing.PyOVERLAPPED | None = ..., /): ... +def ConnectNamedPipe(hPipe: int, overlapped: _win32typing.PyOVERLAPPED | None = ..., /) -> int: ... def TransactNamedPipe( pipeName, writeData: str, @@ -22,20 +22,20 @@ def CreatePipe(sa: _win32typing.PySECURITY_ATTRIBUTES, nSize: int, /) -> tuple[i def FdCreatePipe(sa: _win32typing.PySECURITY_ATTRIBUTES, nSize, mode, /) -> tuple[Incomplete, Incomplete]: ... def CreateNamedPipe( pipeName: str, - openMode, - pipeMode, - nMaxInstances, - nOutBufferSize, - nInBufferSize, - nDefaultTimeOut, + openMode: int, + pipeMode: int, + nMaxInstances: int, + nOutBufferSize: int, + nInBufferSize: int, + nDefaultTimeOut: int, sa: _win32typing.PySECURITY_ATTRIBUTES, /, ) -> int: ... def DisconnectNamedPipe(hFile: int, /) -> None: ... def GetOverlappedResult(hFile: int, overlapped: _win32typing.PyOVERLAPPED, bWait: int | bool, /) -> int: ... -def WaitNamedPipe(pipeName: str, timeout, /) -> None: ... +def WaitNamedPipe(pipeName: str, timeout: int, /) -> None: ... def GetNamedPipeInfo(hNamedPipe: int, /) -> tuple[int, int, int, int]: ... -def PeekNamedPipe(hPipe: int, size: int, /) -> tuple[str, int, Incomplete]: ... +def PeekNamedPipe(hPipe: int, size: int, /) -> tuple[bytes, int, int]: ... def GetNamedPipeClientProcessId(hPipe: int, /): ... def GetNamedPipeServerProcessId(hPipe: int, /): ... def GetNamedPipeClientSessionId(hPipe: int, /): ...