diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index 306d778f56f7..ce023959a4ce 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -881,6 +881,78 @@ class CryptBitBlob(TypedDict): Data: ReadableBuffer UnusedBits: int +@type_check_only +class IOInfo(TypedDict): + ReadOperationCount: int + WriteOperationCount: int + OtherOperationCount: int + ReadTransferCount: int + WriteTransferCount: int + OtherTransferCount: int + +@type_check_only +class JobObjectBasicAccountingInformation(TypedDict): + TotalUserTime: int + TotalKernelTime: int + ThisPeriodTotalUserTime: int + ThisPeriodTotalKernelTime: int + TotalPageFaultCount: int + TotalProcesses: int + ActiveProcesses: int + TotalTerminatedProcesses: int + +@type_check_only +class JobObjectBasicLimitInformation(TypedDict): + PerProcessUserTimeLimit: int + PerJobUserTimeLimit: int + LimitFlags: int + MinimumWorkingSetSize: int + MaximumWorkingSetSize: int + ActiveProcessLimit: int + Affinity: int + PriorityClass: int + SchedulingClass: int + +@type_check_only +class InformationJob(TypedDict, total=False): + TotalUserTime: int + TotalKernelTime: int + ThisPeriodTotalUserTime: int + ThisPeriodTotalKernelTime: int + TotalPageFaultCount: int + TotalProcesses: int + ActiveProcesses: int + TotalTerminatedProcesses: int + PerProcessUserTimeLimit: int + PerJobUserTimeLimit: int + LimitFlags: int + MinimumWorkingSetSize: int + MaximumWorkingSetSize: int + ActiveProcessLimit: int + Affinity: int + PriorityClass: int + SchedulingClass: int + BasicInfo: JobObjectBasicAccountingInformation + IoInfo: IOInfo + BasicLimitInformation: JobObjectBasicLimitInformation + ProcessMemoryLimit: int + JobMemoryLimit: int + PeakProcessMemoryUsed: int + PeakJobMemoryUsed: int + EndOfJobTimeAction: int + UIRestrictionsClass: int + MemberLevel: int + +@type_check_only +class ProfileInfo(TypedDict): + UserName: str + Flags: NotRequired[int] + ProfilePath: NotRequired[str | None] + DefaultPath: NotRequired[str | None] + ServerName: NotRequired[str | None] + PolicyPath: NotRequired[str | None] + Profile: NotRequired[int | PyHANDLE | None] + @final class PyConsoleScreenBuffer: def __new__(self, Handle) -> Self: ... @@ -919,6 +991,12 @@ class PyConsoleScreenBuffer: def Close(self) -> None: ... def Detach(self) -> int: ... +@type_check_only +class ConsoleSelectionInfo(TypedDict): + Flags: int + SelectionAnchor: PyCOORD + Selection: PySMALL_RECT + @disjoint_base class PyCredHandle: def Detach(self): ... @@ -2679,21 +2757,22 @@ class SERVICE_STATUS: class TRACKMOUSEEVENT: ... class WIN32_FIND_DATA: ... -class connection: - def setautocommit(self, c, /) -> None: ... +class odbcconn: + error: Incomplete + def setautocommit(self, c: bool | Literal[0, 1], /) -> None: ... def commit(self) -> None: ... def rollback(self) -> None: ... - def cursor(self) -> None: ... + def cursor(self) -> odbccur: ... def close(self) -> None: ... -class cursor: - def close(self) -> None: ... - def execute(self, sql: str, arg, /): ... - def fetchone(self): ... - def fetchmany(self) -> list[Incomplete]: ... - def fetchall(self) -> list[Incomplete]: ... - def setinputsizes(self) -> None: ... - def setoutputsize(self) -> None: ... +class odbccur: + def close(self, *args: Unused) -> None: ... + def execute(self, sql: str, arg, /) -> int | None: ... + def fetchone(self, *args: Unused) -> tuple[Incomplete, ...] | None: ... + def fetchmany(self, rows: int = 1) -> list[tuple[Incomplete, ...]]: ... + def fetchall(self, *args: Unused) -> list[tuple[Incomplete, ...]]: ... + def setinputsizes(self, *args: Unused) -> None: ... + def setoutputsize(self, size: int) -> None: ... class COMPONENT: @property diff --git a/stubs/pywin32/win32/mmapfile.pyi b/stubs/pywin32/win32/mmapfile.pyi index 8d943c3722e5..9acc4bf1479b 100644 --- a/stubs/pywin32/win32/mmapfile.pyi +++ b/stubs/pywin32/win32/mmapfile.pyi @@ -2,5 +2,5 @@ import _win32typing from win32.lib.pywintypes import error as error def mmapfile( - File, Name, MaximumSize: int = ..., FileOffset: int = ..., NumberOfBytesToMap: int = ... + File: str | None, Name: str | None, MaximumSize: int = 0, FileOffset: int = 0, NumberOfBytesToMap: int | None = None ) -> _win32typing.Pymmapfile: ... diff --git a/stubs/pywin32/win32/odbc.pyi b/stubs/pywin32/win32/odbc.pyi index 0a0b7f54047c..cbc4d5cc4411 100644 --- a/stubs/pywin32/win32/odbc.pyi +++ b/stubs/pywin32/win32/odbc.pyi @@ -1,32 +1,31 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal +from typing import ClassVar, Final import _win32typing -def odbc(connectionString: str, /) -> _win32typing.connection: ... -def SQLDataSources(direction, /) -> tuple[Incomplete, Incomplete]: ... +def odbc(connectionString: str, /) -> _win32typing.odbcconn: ... +def SQLDataSources(direction: int, /) -> tuple[str, str] | None: ... -DATE: str -NUMBER: str -RAW: str -SQL_FETCH_ABSOLUTE: int -SQL_FETCH_FIRST: int -SQL_FETCH_FIRST_SYSTEM: int -SQL_FETCH_FIRST_USER: int -SQL_FETCH_LAST: int -SQL_FETCH_NEXT: int -SQL_FETCH_PRIOR: int -SQL_FETCH_RELATIVE: int -STRING: str -TYPES: tuple[Literal["STRING"], Literal["RAW"], Literal["NUMBER"], Literal["DATE"]] +STRING: Final = "STRING" +RAW: Final = "RAW" +NUMBER: Final = "NUMBER" +DATE: Final = "DATE" +TYPES: Final = ("STRING", "RAW", "NUMBER", "DATE") +SQL_FETCH_NEXT: Final[int] +SQL_FETCH_FIRST: Final[int] +SQL_FETCH_LAST: Final[int] +SQL_FETCH_PRIOR: Final[int] +SQL_FETCH_ABSOLUTE: Final[int] +SQL_FETCH_RELATIVE: Final[int] +SQL_FETCH_FIRST_USER: Final[int] +SQL_FETCH_FIRST_SYSTEM: Final[int] class error(Exception): __name__: ClassVar[str] = "odbcError" # These all pretend to come from a module called "dbi", but that module doesn't exist -class dataError(Exception): ... -class integrityError(Exception): ... -class internalError(Exception): ... class noError(Exception): ... class opError(Exception): ... class progError(Exception): ... +class integrityError(Exception): ... +class dataError(Exception): ... +class internalError(Exception): ... diff --git a/stubs/pywin32/win32/perfmon.pyi b/stubs/pywin32/win32/perfmon.pyi index a7ea4e3d2081..e35da267c863 100644 --- a/stubs/pywin32/win32/perfmon.pyi +++ b/stubs/pywin32/win32/perfmon.pyi @@ -1,13 +1,16 @@ +from collections.abc import Sequence +from typing import Literal + import _win32typing -def LoadPerfCounterTextStrings(commandLine: str, /) -> None: ... -def UnloadPerfCounterTextStrings(commandLine: str, /) -> None: ... -def CounterDefinition() -> _win32typing.PyPERF_COUNTER_DEFINITION: ... -def ObjectType() -> _win32typing.PyPERF_OBJECT_TYPE: ... +def LoadPerfCounterTextStrings(cmdLine: str, bQuiet: bool | Literal[0, 1] = True, /) -> None: ... +def UnloadPerfCounterTextStrings(cmdLine: str, bQuiet: bool | Literal[0, 1] = True, /) -> None: ... +def CounterDefinition(titleIndex: int, /) -> _win32typing.PyPERF_COUNTER_DEFINITION: ... +def ObjectType(obCounters, /) -> _win32typing.PyPERF_OBJECT_TYPE: ... def PerfMonManager( serviceName: str, - seqPerfObTypes: list[_win32typing.PyPERF_OBJECT_TYPE], - mappingName: str | None = ..., - eventSourceName: str | None = ..., + seqPerfObTypes: Sequence[_win32typing.PyPERF_OBJECT_TYPE], # must have only 1 item + mappingName: str | None = None, + eventSourceName: str | None = None, /, ) -> _win32typing.PyPerfMonManager: ... diff --git a/stubs/pywin32/win32/servicemanager.pyi b/stubs/pywin32/win32/servicemanager.pyi index 6acc15a79403..e085d631c5cd 100644 --- a/stubs/pywin32/win32/servicemanager.pyi +++ b/stubs/pywin32/win32/servicemanager.pyi @@ -1,34 +1,38 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused +from collections.abc import Callable, Sequence +from typing import Final, Literal -def CoInitializeEx() -> None: ... +def CoInitializeEx(flags: int, /) -> int: ... def CoUninitialize() -> None: ... -def RegisterServiceCtrlHandler(serviceName: str, callback, extra_args: bool = ..., /): ... -def LogMsg(errorType: int, eventId: int, inserts: tuple[str, str] | None = ..., /) -> None: ... +def RegisterServiceCtrlHandler( + serviceName: str, callback: Callable[..., Incomplete], extra_args: bool | Literal[0, 1] = False, / +) -> int | None: ... +def LogMsg(errorType: int, eventId: int, inserts: Sequence[str] | None = None, /) -> None: ... def LogInfoMsg(msg: str, /) -> None: ... def LogErrorMsg(msg: str, /) -> None: ... def LogWarningMsg(msg: str, /) -> None: ... -def PumpWaitingMessages(firstMessage: int = ..., lastMessage: int = ..., /) -> int: ... -def Debugging(newVal: int = ..., /): ... -def Initialize(eventSourceName: str | None = ..., eventSourceFile: str | None = ..., /) -> None: ... +def PumpWaitingMessages(*args: Unused) -> int: ... +def Debugging(newVal: int = -1, /) -> bool: ... +def StartServiceCtrlDispatcher() -> None: ... +def Initialize(eventSourceName: str | None = None, eventSourceFile: str | None = None, /) -> None: ... def Finalize() -> None: ... -def PrepareToHostSingle(klass: Incomplete | None = ..., /) -> None: ... +def PrepareToHostSingle(klass=None, /) -> None: ... def PrepareToHostMultiple(service_name: str, klass, /) -> None: ... -def RunningAsService(): ... -def SetEventSourceName(sourceName: str, registerNow: bool = ..., /) -> None: ... -def StartServiceCtrlDispatcher(): ... +def RunningAsService() -> bool: ... +def SetEventSourceName(sourceName: str, registerNow: bool | Literal[0, 1] = False, /) -> None: ... -COINIT_APARTMENTTHREADED: int -COINIT_DISABLE_OLE1DDE: int -COINIT_MULTITHREADED: int -COINIT_SPEED_OVER_MEMORY: int -EVENTLOG_AUDIT_FAILURE: int -EVENTLOG_AUDIT_SUCCESS: int -EVENTLOG_ERROR_TYPE: int -EVENTLOG_INFORMATION_TYPE: int -EVENTLOG_WARNING_TYPE: int -PYS_SERVICE_STARTED: int -PYS_SERVICE_STARTING: int -PYS_SERVICE_STOPPED: int -PYS_SERVICE_STOPPING: int +COINIT_MULTITHREADED: Final = 0x0 +COINIT_APARTMENTTHREADED: Final = 0x2 +COINIT_DISABLE_OLE1DDE: Final = 0x4 +COINIT_SPEED_OVER_MEMORY: Final = 0x8 +PYS_SERVICE_STARTING: Final[int] +PYS_SERVICE_STARTED: Final[int] +PYS_SERVICE_STOPPING: Final[int] +PYS_SERVICE_STOPPED: Final[int] +EVENTLOG_ERROR_TYPE: Final = 0x0001 +EVENTLOG_INFORMATION_TYPE: Final = 0x0004 +EVENTLOG_WARNING_TYPE: Final = 0x0002 +EVENTLOG_AUDIT_SUCCESS: Final = 0x0008 +EVENTLOG_AUDIT_FAILURE: Final = 0x0010 class startup_error(Exception): ... diff --git a/stubs/pywin32/win32/timer.pyi b/stubs/pywin32/win32/timer.pyi index ad8a7bcbe0b9..046655266837 100644 --- a/stubs/pywin32/win32/timer.pyi +++ b/stubs/pywin32/win32/timer.pyi @@ -1,6 +1,10 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from typing import Final + from win32.lib.pywintypes import error as error -def set_timer(Elapse, TimerFunc, /): ... -def kill_timer(timer_id, /): ... +def set_timer(Elapse: int, TimerFunc: Callable[..., Incomplete], /) -> int: ... +def kill_timer(timer_id: int, /) -> bool: ... -__version__: bytes +__version__: Final[bytes] diff --git a/stubs/pywin32/win32/win32clipboard.pyi b/stubs/pywin32/win32/win32clipboard.pyi index 27ed86573bbe..e287fb8d7a84 100644 --- a/stubs/pywin32/win32/win32clipboard.pyi +++ b/stubs/pywin32/win32/win32clipboard.pyi @@ -1,48 +1,53 @@ -from typing import Any, Final +from _typeshed import ReadableBuffer +from collections.abc import Iterable +from typing import Any, Final, Literal +import _win32typing from win32.lib.pywintypes import error as error -def ChangeClipboardChain(hWndRemove: int, hWndNewNext: int, /): ... -def CloseClipboard(): ... -def CountClipboardFormats(): ... -def EmptyClipboard(): ... -def EnumClipboardFormats(_format: int = ..., /): ... -def GetClipboardData(_format, /) -> Any: ... # str or bytes depending on the dib format -def GetClipboardDataHandle(_format, /): ... -def GetClipboardFormatName(_format, /) -> str: ... -def GetClipboardOwner(): ... -def GetClipboardSequenceNumber(): ... -def GetClipboardViewer(): ... -def GetGlobalMemory(hglobal: int, /) -> str: ... -def GetOpenClipboardWindow(): ... -def GetPriorityClipboardFormat(formats, /): ... -def IsClipboardFormatAvailable(format: int, /) -> int: ... -def OpenClipboard(hWnd: int | None = ..., /): ... -def RegisterClipboardFormat(name: str, /): ... -def SetClipboardData(_format, hMem, /): ... -def SetClipboardText(text, _format, /): ... -def SetClipboardViewer(hWndNewViewer: int, /) -> int: ... +def ChangeClipboardChain( + hWndRemove: int | _win32typing.PyHANDLE | None, hWndNewNext: int | _win32typing.PyHANDLE | None, / +) -> Literal[0, 1]: ... +def CloseClipboard() -> None: ... +def CountClipboardFormats() -> int: ... +def EmptyClipboard() -> None: ... +def EnumClipboardFormats(format: int = 0, /) -> int: ... +def GetClipboardData(format: int = 13, /) -> Any: ... # int, tuple, str or bytes depending on the dib format +def GetClipboardDataHandle(format: int = 1, /) -> int: ... +def GetClipboardFormatName(format: int, /) -> str: ... +def GetClipboardOwner() -> int: ... +def GetClipboardSequenceNumber() -> int: ... +def GetClipboardViewer() -> int: ... +def GetGlobalMemory(hglobal: int | _win32typing.PyHANDLE | None, /) -> bytes: ... +def GetOpenClipboardWindow() -> int: ... +def GetPriorityClipboardFormat(formats: Iterable[int], /) -> int: ... +def IsClipboardFormatAvailable(format: int, /) -> Literal[0, 1]: ... +def OpenClipboard(hWnd: int | _win32typing.PyHANDLE | None = None, /) -> None: ... +def RegisterClipboardFormat(name: str, /) -> int: ... +def SetClipboardData(format: int, hMem: int | _win32typing.PyHANDLE | str | ReadableBuffer | None, /) -> int: ... +def SetClipboardText(text: str | bytes, format: int = 1, /) -> int: ... +def SetClipboardViewer(hWndNewViewer: int | _win32typing.PyHANDLE | None, /) -> int | None: ... -CF_BITMAP: Final[int] -CF_DIB: Final[int] -CF_DIBV5: Final[int] -CF_DIF: Final[int] -CF_DSPBITMAP: Final[int] -CF_DSPENHMETAFILE: Final[int] -CF_DSPMETAFILEPICT: Final[int] -CF_DSPTEXT: Final[int] -CF_ENHMETAFILE: Final[int] -CF_HDROP: Final[int] -CF_LOCALE: Final[int] -CF_MAX: Final[int] -CF_METAFILEPICT: Final[int] -CF_OEMTEXT: Final[int] -CF_OWNERDISPLAY: Final[int] -CF_PALETTE: Final[int] -CF_PENDATA: Final[int] -CF_RIFF: Final[int] -CF_SYLK: Final[int] -CF_TEXT: Final[int] -CF_TIFF: Final[int] -CF_UNICODETEXT: Final[int] -CF_WAVE: Final[int] +CF_TEXT: Final = 1 +CF_BITMAP: Final = 2 +CF_METAFILEPICT: Final = 3 +CF_SYLK: Final = 4 +CF_DIF: Final = 5 +CF_TIFF: Final = 6 +CF_OEMTEXT: Final = 7 +CF_DIB: Final = 8 +CF_PALETTE: Final = 9 +CF_PENDATA: Final = 10 +CF_RIFF: Final = 11 +CF_WAVE: Final = 12 +CF_UNICODETEXT: Final = 13 +CF_ENHMETAFILE: Final = 14 +CF_HDROP: Final = 15 +CF_LOCALE: Final = 16 +CF_DIBV5: Final = 17 +CF_MAX: Final = 18 +CF_OWNERDISPLAY: Final = 0x0080 +CF_DSPTEXT: Final = 0x0081 +CF_DSPBITMAP: Final = 0x0082 +CF_DSPMETAFILEPICT: Final = 0x0083 +CF_DSPENHMETAFILE: Final = 0x008E diff --git a/stubs/pywin32/win32/win32console.pyi b/stubs/pywin32/win32/win32console.pyi index e007253a2637..506fc3a30d41 100644 --- a/stubs/pywin32/win32/win32console.pyi +++ b/stubs/pywin32/win32/win32console.pyi @@ -1,4 +1,4 @@ -from typing import Literal, overload +from typing import Final, Literal, overload from typing_extensions import Never import _win32typing @@ -6,77 +6,81 @@ from win32.lib.pywintypes import error as error def GetConsoleProcessList() -> tuple[int, ...]: ... def CreateConsoleScreenBuffer( - DesiredAccess=..., ShareMode=..., SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., Flags=... + DesiredAccess: int = ..., + ShareMode: int = ..., + SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = None, + Flags: int = ..., ) -> _win32typing.PyConsoleScreenBuffer: ... -def GetConsoleDisplayMode(): ... -def AttachConsole(ProcessId) -> None: ... +def GetConsoleDisplayMode() -> int: ... +def AttachConsole(ProcessId: int) -> None: ... def AllocConsole() -> None: ... def FreeConsole() -> None: ... -def GetConsoleCP(): ... -def GetConsoleOutputCP(): ... -def SetConsoleCP(CodePageId) -> None: ... -def SetConsoleOutputCP(CodePageID) -> None: ... -def GetConsoleSelectionInfo(): ... -def AddConsoleAlias(Source, Target, ExeName) -> None: ... +def GetConsoleCP() -> int: ... +def GetConsoleOutputCP() -> int: ... +def SetConsoleCP(CodePageID: int) -> None: ... +def SetConsoleOutputCP(CodePageID: int) -> None: ... +def GetConsoleSelectionInfo() -> _win32typing.ConsoleSelectionInfo: ... +def AddConsoleAlias(Source: str, Target: str | None, ExeName: str) -> None: ... def GetConsoleAliases(ExeName: str) -> str: ... -def GetConsoleAliasExes(): ... -def GetConsoleWindow(): ... -def GetNumberOfConsoleFonts(): ... +def GetConsoleAliasExes() -> str: ... +def GetConsoleWindow() -> int: ... +def GetNumberOfConsoleFonts() -> int: ... def SetConsoleTitle(ConsoleTitle: str) -> None: ... -def GetConsoleTitle(): ... +def GetConsoleTitle() -> str: ... @overload def GenerateConsoleCtrlEvent(CtrlEvent: Literal[1], ProcessGroupId: Literal[0] = 0) -> Never: ... @overload def GenerateConsoleCtrlEvent(CtrlEvent: Literal[0, 1], ProcessGroupId: int) -> None: ... -def GetStdHandle(StdHandle: int) -> _win32typing.PyConsoleScreenBuffer: ... +def GetStdHandle(StdHandle: int) -> _win32typing.PyConsoleScreenBuffer | None: ... -ATTACH_PARENT_PROCESS: int -BACKGROUND_BLUE: int -BACKGROUND_GREEN: int -BACKGROUND_INTENSITY: int -BACKGROUND_RED: int -COMMON_LVB_GRID_HORIZONTAL: int -COMMON_LVB_GRID_LVERTICAL: int -COMMON_LVB_GRID_RVERTICAL: int -COMMON_LVB_LEADING_BYTE: int -COMMON_LVB_REVERSE_VIDEO: int -COMMON_LVB_TRAILING_BYTE: int -COMMON_LVB_UNDERSCORE: int -CONSOLE_FULLSCREEN: int -CONSOLE_FULLSCREEN_HARDWARE: int -CONSOLE_FULLSCREEN_MODE: int -CONSOLE_MOUSE_DOWN: int -CONSOLE_MOUSE_SELECTION: int -CONSOLE_NO_SELECTION: int -CONSOLE_SELECTION_IN_PROGRESS: int -CONSOLE_SELECTION_NOT_EMPTY: int -CONSOLE_TEXTMODE_BUFFER: int -CONSOLE_WINDOWED_MODE: int -CTRL_BREAK_EVENT: int -CTRL_C_EVENT: int -ENABLE_ECHO_INPUT: int -ENABLE_LINE_INPUT: int -ENABLE_MOUSE_INPUT: int -ENABLE_PROCESSED_INPUT: int -ENABLE_PROCESSED_OUTPUT: int -ENABLE_WINDOW_INPUT: int -ENABLE_WRAP_AT_EOL_OUTPUT: int -FOCUS_EVENT: int -FOREGROUND_BLUE: int -FOREGROUND_GREEN: int -FOREGROUND_INTENSITY: int -FOREGROUND_RED: int -KEY_EVENT: int -LOCALE_USER_DEFAULT: int -MENU_EVENT: int -MOUSE_EVENT: int -PyCOORDType = _win32typing.PyCOORD PyConsoleScreenBufferType = _win32typing.PyConsoleScreenBuffer -PyINPUT_RECORDType = _win32typing.PyINPUT_RECORD PySMALL_RECTType = _win32typing.PySMALL_RECT -STD_ERROR_HANDLE: int -STD_INPUT_HANDLE: int -STD_OUTPUT_HANDLE: int -WINDOW_BUFFER_SIZE_EVENT: int +PyCOORDType = _win32typing.PyCOORD +PyINPUT_RECORDType = _win32typing.PyINPUT_RECORD + +CONSOLE_TEXTMODE_BUFFER: Final[int] +CONSOLE_FULLSCREEN: Final[int] +CONSOLE_FULLSCREEN_HARDWARE: Final[int] +ATTACH_PARENT_PROCESS: Final[int] +ENABLE_LINE_INPUT: Final = 0x0002 +ENABLE_ECHO_INPUT: Final = 0x0004 +ENABLE_PROCESSED_INPUT: Final = 0x0001 +ENABLE_WINDOW_INPUT: Final = 0x0008 +ENABLE_MOUSE_INPUT: Final = 0x0010 +ENABLE_PROCESSED_OUTPUT: Final = 0x0001 +ENABLE_WRAP_AT_EOL_OUTPUT: Final = 0x0002 +FOREGROUND_BLUE: Final = 0x0001 +FOREGROUND_GREEN: Final = 0x0002 +FOREGROUND_RED: Final = 0x0004 +FOREGROUND_INTENSITY: Final = 0x0008 +BACKGROUND_BLUE: Final = 0x0010 +BACKGROUND_GREEN: Final = 0x0020 +BACKGROUND_RED: Final = 0x0040 +BACKGROUND_INTENSITY: Final = 0x0080 +COMMON_LVB_LEADING_BYTE: Final = 0x0100 +COMMON_LVB_TRAILING_BYTE: Final = 0x0200 +COMMON_LVB_GRID_HORIZONTAL: Final = 0x0400 +COMMON_LVB_GRID_LVERTICAL: Final = 0x0800 +COMMON_LVB_GRID_RVERTICAL: Final = 0x1000 +COMMON_LVB_REVERSE_VIDEO: Final = 0x4000 +COMMON_LVB_UNDERSCORE: Final = 0x8000 +CONSOLE_NO_SELECTION: Final = 0x0000 +CONSOLE_SELECTION_IN_PROGRESS: Final = 0x0001 +CONSOLE_SELECTION_NOT_EMPTY: Final = 0x0002 +CONSOLE_MOUSE_SELECTION: Final = 0x0004 +CONSOLE_MOUSE_DOWN: Final = 0x0008 +LOCALE_USER_DEFAULT: Final = 0x0400 +KEY_EVENT: Final = 0x0001 +MOUSE_EVENT: Final = 0x0002 +WINDOW_BUFFER_SIZE_EVENT: Final = 0x0004 +MENU_EVENT: Final = 0x0008 +FOCUS_EVENT: Final = 0x0010 +CTRL_C_EVENT: Final = 0 +CTRL_BREAK_EVENT: Final = 1 +STD_INPUT_HANDLE: Final[int] +STD_OUTPUT_HANDLE: Final[int] +STD_ERROR_HANDLE: Final[int] +CONSOLE_FULLSCREEN_MODE: Final = 1 +CONSOLE_WINDOWED_MODE: Final = 2 diff --git a/stubs/pywin32/win32/win32help.pyi b/stubs/pywin32/win32/win32help.pyi index 811f588e67c2..01fabc0841c4 100644 --- a/stubs/pywin32/win32/win32help.pyi +++ b/stubs/pywin32/win32/win32help.pyi @@ -1,6 +1,11 @@ +from _typeshed import ReadableBuffer +from typing import Final, Literal + import _win32typing -def WinHelp(hwnd: int, hlpFile: str, cmd, data: str | None = ..., /) -> None: ... +def WinHelp( + hwnd: int | _win32typing.PyHANDLE | None, hlpFile: str, cmd: int, data: int | ReadableBuffer | None = None, / +) -> None: ... def HH_AKLINK() -> _win32typing.PyHH_AKLINK: ... def HH_FTS_QUERY() -> _win32typing.PyHH_FTS_QUERY: ... def HH_POPUP() -> _win32typing.PyHH_POPUP: ... @@ -8,173 +13,188 @@ def HH_WINTYPE() -> _win32typing.PyHH_WINTYPE: ... def NMHDR() -> _win32typing.PyNMHDR: ... def HHN_NOTIFY() -> _win32typing.PyHHN_NOTIFY: ... def HHNTRACK() -> _win32typing.PyHHNTRACK: ... -def HtmlHelp(hwnd: int, file: str, cmd, data: str | tuple[int] | int = ..., /): ... +def HtmlHelp( + hwnd: int | _win32typing.PyHANDLE | None, + file: str | None, + cmd: int, + data: ( + str + | int + | tuple[int, ...] + | _win32typing.PyHH_AKLINK + | _win32typing.PyHH_FTS_QUERY + | _win32typing.PyHH_POPUP + | _win32typing.PyHH_WINTYPE + | None + ) = None, + /, +): ... -debug: int -HH_ALINK_LOOKUP: int -HH_CLOSE_ALL: int -HH_DISPLAY_INDEX: int -HH_DISPLAY_SEARCH: int -HH_DISPLAY_TEXT_POPUP: int -HH_DISPLAY_TOC: int -HH_DISPLAY_TOPIC: int -HH_ENUM_CATEGORY: int -HH_ENUM_CATEGORY_IT: int -HH_ENUM_INFO_TYPE: int -HH_FTS_DEFAULT_PROXIMITY: int -HH_GET_LAST_ERROR: int -HH_GET_WIN_HANDLE: int -HH_GET_WIN_TYPE: int -HH_GPROPID_CONTENT_LANGUAGE: int -HH_GPROPID_CURRENT_SUBSET: int -HH_GPROPID_SINGLETHREAD: int -HH_GPROPID_TOOLBAR_MARGIN: int -HH_GPROPID_UI_LANGUAGE: int -HH_HELP_CONTEXT: int -HH_HELP_FINDER: int -HH_INITIALIZE: int -HH_KEYWORD_LOOKUP: int -HH_MAX_TABS_CUSTOM: int -HH_PRETRANSLATEMESSAGE: int -HH_RESERVED1: int -HH_RESERVED2: int -HH_RESERVED3: int -HH_RESET_IT_FILTER: int -HH_SET_EXCLUSIVE_FILTER: int -HH_SET_GLOBAL_PROPERTY: int -HH_SET_INCLUSIVE_FILTER: int -HH_SET_INFO_TYPE: int -HH_SET_WIN_TYPE: int -HH_SYNC: int -HH_TAB_AUTHOR: int -HH_TAB_CONTENTS: int -HH_TAB_CUSTOM_FIRST: int -HH_TAB_CUSTOM_LAST: int -HH_TAB_FAVORITES: int -HH_TAB_HISTORY: int -HH_TAB_INDEX: int -HH_TAB_SEARCH: int -HH_TP_HELP_CONTEXTMENU: int -HH_TP_HELP_WM_HELP: int -HH_UNINITIALIZE: int -HHACT_BACK: int -HHACT_CONTRACT: int -HHACT_CUSTOMIZE: int -HHACT_EXPAND: int -HHACT_FORWARD: int -HHACT_HIGHLIGHT: int -HHACT_HOME: int -HHACT_JUMP1: int -HHACT_JUMP2: int -HHACT_LAST_ENUM: int -HHACT_NOTES: int -HHACT_OPTIONS: int -HHACT_PRINT: int -HHACT_REFRESH: int -HHACT_STOP: int -HHACT_SYNC: int -HHACT_TAB_CONTENTS: int -HHACT_TAB_FAVORITES: int -HHACT_TAB_HISTORY: int -HHACT_TAB_INDEX: int -HHACT_TAB_SEARCH: int -HHACT_TOC_NEXT: int -HHACT_TOC_PREV: int -HHACT_ZOOM: int -HHN_FIRST: int -HHN_LAST: int -HHN_NAVCOMPLETE: int -HHN_TRACK: int -HHN_WINDOW_CREATE: int -HHWIN_BUTTON_BACK: int -HHWIN_BUTTON_BROWSE_BCK: int -HHWIN_BUTTON_BROWSE_FWD: int -HHWIN_BUTTON_CONTENTS: int -HHWIN_BUTTON_EXPAND: int -HHWIN_BUTTON_FAVORITES: int -HHWIN_BUTTON_FORWARD: int -HHWIN_BUTTON_HISTORY: int -HHWIN_BUTTON_HOME: int -HHWIN_BUTTON_INDEX: int -HHWIN_BUTTON_JUMP1: int -HHWIN_BUTTON_JUMP2: int -HHWIN_BUTTON_NOTES: int -HHWIN_BUTTON_OPTIONS: int -HHWIN_BUTTON_PRINT: int -HHWIN_BUTTON_REFRESH: int -HHWIN_BUTTON_SEARCH: int -HHWIN_BUTTON_STOP: int -HHWIN_BUTTON_SYNC: int -HHWIN_BUTTON_TOC_NEXT: int -HHWIN_BUTTON_TOC_PREV: int -HHWIN_BUTTON_ZOOM: int -HHWIN_DEF_BUTTONS: int -HHWIN_NAVTAB_BOTTOM: int -HHWIN_NAVTAB_LEFT: int -HHWIN_NAVTAB_TOP: int -HHWIN_PARAM_CUR_TAB: int -HHWIN_PARAM_EXPANSION: int -HHWIN_PARAM_EXSTYLES: int -HHWIN_PARAM_HISTORY_COUNT: int -HHWIN_PARAM_INFOTYPES: int -HHWIN_PARAM_NAV_WIDTH: int -HHWIN_PARAM_PROPERTIES: int -HHWIN_PARAM_RECT: int -HHWIN_PARAM_SHOWSTATE: int -HHWIN_PARAM_STYLES: int -HHWIN_PARAM_TABORDER: int -HHWIN_PARAM_TABPOS: int -HHWIN_PARAM_TB_FLAGS: int -HHWIN_PROP_AUTO_SYNC: int -HHWIN_PROP_CHANGE_TITLE: int -HHWIN_PROP_MENU: int -HHWIN_PROP_NAV_ONLY_WIN: int -HHWIN_PROP_NO_TOOLBAR: int -HHWIN_PROP_NODEF_EXSTYLES: int -HHWIN_PROP_NODEF_STYLES: int -HHWIN_PROP_NOTB_TEXT: int -HHWIN_PROP_NOTITLEBAR: int -HHWIN_PROP_ONTOP: int -HHWIN_PROP_POST_QUIT: int -HHWIN_PROP_TAB_ADVSEARCH: int -HHWIN_PROP_TAB_AUTOHIDESHOW: int -HHWIN_PROP_TAB_CUSTOM1: int -HHWIN_PROP_TAB_CUSTOM2: int -HHWIN_PROP_TAB_CUSTOM3: int -HHWIN_PROP_TAB_CUSTOM4: int -HHWIN_PROP_TAB_CUSTOM5: int -HHWIN_PROP_TAB_CUSTOM6: int -HHWIN_PROP_TAB_CUSTOM7: int -HHWIN_PROP_TAB_CUSTOM8: int -HHWIN_PROP_TAB_CUSTOM9: int -HHWIN_PROP_TAB_FAVORITES: int -HHWIN_PROP_TAB_HISTORY: int -HHWIN_PROP_TAB_SEARCH: int -HHWIN_PROP_TRACKING: int -HHWIN_PROP_TRI_PANE: int -HHWIN_PROP_USER_POS: int -HHWIN_TB_MARGIN: int -IDTB_BACK: int -IDTB_BROWSE_BACK: int -IDTB_BROWSE_FWD: int -IDTB_CONTENTS: int -IDTB_CONTRACT: int -IDTB_CUSTOMIZE: int -IDTB_EXPAND: int -IDTB_FAVORITES: int -IDTB_FORWARD: int -IDTB_HISTORY: int -IDTB_HOME: int -IDTB_INDEX: int -IDTB_JUMP1: int -IDTB_JUMP2: int -IDTB_NOTES: int -IDTB_OPTIONS: int -IDTB_PRINT: int -IDTB_REFRESH: int -IDTB_SEARCH: int -IDTB_STOP: int -IDTB_SYNC: int -IDTB_TOC_NEXT: int -IDTB_TOC_PREV: int -IDTB_ZOOM: int +debug: Final[Literal[0, 1]] +HH_DISPLAY_TOPIC: Final[int] +HH_HELP_FINDER: Final[int] +HH_DISPLAY_TOC: Final[int] +HH_DISPLAY_INDEX: Final[int] +HH_DISPLAY_SEARCH: Final[int] +HH_SET_WIN_TYPE: Final[int] +HH_GET_WIN_TYPE: Final[int] +HH_GET_WIN_HANDLE: Final[int] +HH_ENUM_INFO_TYPE: Final[int] +HH_SET_INFO_TYPE: Final[int] +HH_SYNC: Final[int] +HH_RESERVED1: Final[int] +HH_RESERVED2: Final[int] +HH_RESERVED3: Final[int] +HH_KEYWORD_LOOKUP: Final[int] +HH_DISPLAY_TEXT_POPUP: Final[int] +HH_HELP_CONTEXT: Final[int] +HH_TP_HELP_CONTEXTMENU: Final[int] +HH_TP_HELP_WM_HELP: Final[int] +HH_CLOSE_ALL: Final[int] +HH_ALINK_LOOKUP: Final[int] +HH_GET_LAST_ERROR: Final[int] +HH_ENUM_CATEGORY: Final[int] +HH_ENUM_CATEGORY_IT: Final[int] +HH_RESET_IT_FILTER: Final[int] +HH_SET_INCLUSIVE_FILTER: Final[int] +HH_SET_EXCLUSIVE_FILTER: Final[int] +HH_INITIALIZE: Final[int] +HH_UNINITIALIZE: Final[int] +HH_PRETRANSLATEMESSAGE: Final[int] +HH_SET_GLOBAL_PROPERTY: Final[int] +HHWIN_PROP_TAB_AUTOHIDESHOW: Final[int] +HHWIN_PROP_ONTOP: Final[int] +HHWIN_PROP_NOTITLEBAR: Final[int] +HHWIN_PROP_NODEF_STYLES: Final[int] +HHWIN_PROP_NODEF_EXSTYLES: Final[int] +HHWIN_PROP_TRI_PANE: Final[int] +HHWIN_PROP_NOTB_TEXT: Final[int] +HHWIN_PROP_POST_QUIT: Final[int] +HHWIN_PROP_AUTO_SYNC: Final[int] +HHWIN_PROP_TRACKING: Final[int] +HHWIN_PROP_TAB_SEARCH: Final[int] +HHWIN_PROP_TAB_HISTORY: Final[int] +HHWIN_PROP_TAB_FAVORITES: Final[int] +HHWIN_PROP_CHANGE_TITLE: Final[int] +HHWIN_PROP_NAV_ONLY_WIN: Final[int] +HHWIN_PROP_NO_TOOLBAR: Final[int] +HHWIN_PROP_MENU: Final[int] +HHWIN_PROP_TAB_ADVSEARCH: Final[int] +HHWIN_PROP_USER_POS: Final[int] +HHWIN_PROP_TAB_CUSTOM1: Final[int] +HHWIN_PROP_TAB_CUSTOM2: Final[int] +HHWIN_PROP_TAB_CUSTOM3: Final[int] +HHWIN_PROP_TAB_CUSTOM4: Final[int] +HHWIN_PROP_TAB_CUSTOM5: Final[int] +HHWIN_PROP_TAB_CUSTOM6: Final[int] +HHWIN_PROP_TAB_CUSTOM7: Final[int] +HHWIN_PROP_TAB_CUSTOM8: Final[int] +HHWIN_PROP_TAB_CUSTOM9: Final[int] +HHWIN_TB_MARGIN: Final[int] +HHWIN_PARAM_PROPERTIES: Final[int] +HHWIN_PARAM_STYLES: Final[int] +HHWIN_PARAM_EXSTYLES: Final[int] +HHWIN_PARAM_RECT: Final[int] +HHWIN_PARAM_NAV_WIDTH: Final[int] +HHWIN_PARAM_SHOWSTATE: Final[int] +HHWIN_PARAM_INFOTYPES: Final[int] +HHWIN_PARAM_TB_FLAGS: Final[int] +HHWIN_PARAM_EXPANSION: Final[int] +HHWIN_PARAM_TABPOS: Final[int] +HHWIN_PARAM_TABORDER: Final[int] +HHWIN_PARAM_HISTORY_COUNT: Final[int] +HHWIN_PARAM_CUR_TAB: Final[int] +HHWIN_BUTTON_EXPAND: Final[int] +HHWIN_BUTTON_BACK: Final[int] +HHWIN_BUTTON_FORWARD: Final[int] +HHWIN_BUTTON_STOP: Final[int] +HHWIN_BUTTON_REFRESH: Final[int] +HHWIN_BUTTON_HOME: Final[int] +HHWIN_BUTTON_BROWSE_FWD: Final[int] +HHWIN_BUTTON_BROWSE_BCK: Final[int] +HHWIN_BUTTON_NOTES: Final[int] +HHWIN_BUTTON_CONTENTS: Final[int] +HHWIN_BUTTON_SYNC: Final[int] +HHWIN_BUTTON_OPTIONS: Final[int] +HHWIN_BUTTON_PRINT: Final[int] +HHWIN_BUTTON_INDEX: Final[int] +HHWIN_BUTTON_SEARCH: Final[int] +HHWIN_BUTTON_HISTORY: Final[int] +HHWIN_BUTTON_FAVORITES: Final[int] +HHWIN_BUTTON_JUMP1: Final[int] +HHWIN_BUTTON_JUMP2: Final[int] +HHWIN_BUTTON_ZOOM: Final[int] +HHWIN_BUTTON_TOC_NEXT: Final[int] +HHWIN_BUTTON_TOC_PREV: Final[int] +HHWIN_DEF_BUTTONS: Final[int] +IDTB_EXPAND: Final[int] +IDTB_CONTRACT: Final[int] +IDTB_STOP: Final[int] +IDTB_REFRESH: Final[int] +IDTB_BACK: Final[int] +IDTB_HOME: Final[int] +IDTB_SYNC: Final[int] +IDTB_PRINT: Final[int] +IDTB_OPTIONS: Final[int] +IDTB_FORWARD: Final[int] +IDTB_NOTES: Final[int] +IDTB_BROWSE_FWD: Final[int] +IDTB_BROWSE_BACK: Final[int] +IDTB_CONTENTS: Final[int] +IDTB_INDEX: Final[int] +IDTB_SEARCH: Final[int] +IDTB_HISTORY: Final[int] +IDTB_FAVORITES: Final[int] +IDTB_JUMP1: Final[int] +IDTB_JUMP2: Final[int] +IDTB_CUSTOMIZE: Final[int] +IDTB_ZOOM: Final[int] +IDTB_TOC_NEXT: Final[int] +IDTB_TOC_PREV: Final[int] +HHN_FIRST: Final[int] +HHN_LAST: Final[int] +HHN_NAVCOMPLETE: Final[int] +HHN_TRACK: Final[int] +HHN_WINDOW_CREATE: Final[int] +HHWIN_NAVTAB_TOP: Final[int] +HHWIN_NAVTAB_LEFT: Final[int] +HHWIN_NAVTAB_BOTTOM: Final[int] +HH_TAB_CONTENTS: Final[int] +HH_TAB_INDEX: Final[int] +HH_TAB_SEARCH: Final[int] +HH_TAB_FAVORITES: Final[int] +HH_TAB_HISTORY: Final[int] +HH_TAB_AUTHOR: Final[int] +HH_TAB_CUSTOM_FIRST: Final[int] +HH_TAB_CUSTOM_LAST: Final[int] +HH_MAX_TABS_CUSTOM: Final[int] +HH_FTS_DEFAULT_PROXIMITY: Final[int] +HHACT_TAB_CONTENTS: Final[int] +HHACT_TAB_INDEX: Final[int] +HHACT_TAB_SEARCH: Final[int] +HHACT_TAB_HISTORY: Final[int] +HHACT_TAB_FAVORITES: Final[int] +HHACT_EXPAND: Final[int] +HHACT_CONTRACT: Final[int] +HHACT_BACK: Final[int] +HHACT_FORWARD: Final[int] +HHACT_STOP: Final[int] +HHACT_REFRESH: Final[int] +HHACT_HOME: Final[int] +HHACT_SYNC: Final[int] +HHACT_OPTIONS: Final[int] +HHACT_PRINT: Final[int] +HHACT_HIGHLIGHT: Final[int] +HHACT_CUSTOMIZE: Final[int] +HHACT_JUMP1: Final[int] +HHACT_JUMP2: Final[int] +HHACT_ZOOM: Final[int] +HHACT_TOC_NEXT: Final[int] +HHACT_TOC_PREV: Final[int] +HHACT_NOTES: Final[int] +HHACT_LAST_ENUM: Final[int] +HH_GPROPID_SINGLETHREAD: Final[int] +HH_GPROPID_TOOLBAR_MARGIN: Final[int] +HH_GPROPID_UI_LANGUAGE: Final[int] +HH_GPROPID_CURRENT_SUBSET: Final[int] +HH_GPROPID_CONTENT_LANGUAGE: Final[int] diff --git a/stubs/pywin32/win32/win32job.pyi b/stubs/pywin32/win32/win32job.pyi index 7b3ded8d35f4..ad1dadeba95b 100644 --- a/stubs/pywin32/win32/win32job.pyi +++ b/stubs/pywin32/win32/win32job.pyi @@ -1,74 +1,85 @@ +from _typeshed import Incomplete +from typing import Final, Literal + import _win32typing from win32.lib.pywintypes import error as error -def AssignProcessToJobObject(hJob: int, hProcess: int, /) -> None: ... -def CreateJobObject(jobAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, name: str, /) -> None: ... -def OpenJobObject(desiredAccess, inheritHandles, name, /) -> None: ... -def TerminateJobObject(hJob: int, exitCode, /) -> None: ... -def UserHandleGrantAccess(hUserHandle: int, hJob: int, grant, /) -> None: ... -def IsProcessInJob(hProcess: int, hJob: int, /): ... -def QueryInformationJobObject(Job: int, JobObjectInfoClass, /): ... -def SetInformationJobObject(Job: int, JobObjectInfoClass, JobObjectInfo, /) -> None: ... +def AssignProcessToJobObject( + hJob: int | _win32typing.PyHANDLE | None, hProcess: int | _win32typing.PyHANDLE | None, / +) -> None: ... +def CreateJobObject(jobAttributes: _win32typing.PySECURITY_ATTRIBUTES | None, name: str, /) -> _win32typing.PyHANDLE: ... +def OpenJobObject(desiredAccess: int, inheritHandles: bool | Literal[0, 1], name: str, /) -> _win32typing.PyHANDLE: ... +def TerminateJobObject(hJob: int | _win32typing.PyHANDLE | None, exitCode: int, /) -> None: ... +def UserHandleGrantAccess( + hUserHandle: int | _win32typing.PyHANDLE | None, hJob: int | _win32typing.PyHANDLE | None, grant: bool | Literal[0, 1], / +) -> None: ... +def IsProcessInJob(hProcess: int | _win32typing.PyHANDLE | None, hJob: int | _win32typing.PyHANDLE | None, /) -> bool: ... +def QueryInformationJobObject( + Job: int | _win32typing.PyHANDLE | None, JobObjectInfoClass: int, / +) -> _win32typing.InformationJob: ... +def SetInformationJobObject( + Job: int | _win32typing.PyHANDLE | None, JobObjectInfoClass: int, JobObjectInfo: dict[str, Incomplete], / +) -> None: ... -JOB_OBJECT_ALL_ACCESS: int -JOB_OBJECT_ASSIGN_PROCESS: int -JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: int -JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: int -JOB_OBJECT_LIMIT_ACTIVE_PROCESS: int -JOB_OBJECT_LIMIT_AFFINITY: int -JOB_OBJECT_LIMIT_BREAKAWAY_OK: int -JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: int -JOB_OBJECT_LIMIT_JOB_MEMORY: int -JOB_OBJECT_LIMIT_JOB_TIME: int -JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: int -JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: int -JOB_OBJECT_LIMIT_PRIORITY_CLASS: int -JOB_OBJECT_LIMIT_PROCESS_MEMORY: int -JOB_OBJECT_LIMIT_PROCESS_TIME: int -JOB_OBJECT_LIMIT_SCHEDULING_CLASS: int -JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: int -JOB_OBJECT_LIMIT_VALID_FLAGS: int -JOB_OBJECT_LIMIT_WORKINGSET: int -JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: int -JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: int -JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: int -JOB_OBJECT_MSG_END_OF_JOB_TIME: int -JOB_OBJECT_MSG_END_OF_PROCESS_TIME: int -JOB_OBJECT_MSG_EXIT_PROCESS: int -JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: int -JOB_OBJECT_MSG_NEW_PROCESS: int -JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: int -JOB_OBJECT_POST_AT_END_OF_JOB: int -JOB_OBJECT_QUERY: int -JOB_OBJECT_SECURITY_FILTER_TOKENS: int -JOB_OBJECT_SECURITY_NO_ADMIN: int -JOB_OBJECT_SECURITY_ONLY_TOKEN: int -JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: int -JOB_OBJECT_SECURITY_VALID_FLAGS: int -JOB_OBJECT_SET_ATTRIBUTES: int -JOB_OBJECT_SET_SECURITY_ATTRIBUTES: int -JOB_OBJECT_TERMINATE: int -JOB_OBJECT_TERMINATE_AT_END_OF_JOB: int -JOB_OBJECT_UI_VALID_FLAGS: int -JOB_OBJECT_UILIMIT_ALL: int -JOB_OBJECT_UILIMIT_DESKTOP: int -JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: int -JOB_OBJECT_UILIMIT_EXITWINDOWS: int -JOB_OBJECT_UILIMIT_GLOBALATOMS: int -JOB_OBJECT_UILIMIT_HANDLES: int -JOB_OBJECT_UILIMIT_NONE: int -JOB_OBJECT_UILIMIT_READCLIPBOARD: int -JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: int -JOB_OBJECT_UILIMIT_WRITECLIPBOARD: int -JobObjectAssociateCompletionPortInformation: int -JobObjectBasicAccountingInformation: int -JobObjectBasicAndIoAccountingInformation: int -JobObjectBasicLimitInformation: int -JobObjectBasicUIRestrictions: int -JobObjectEndOfJobTimeInformation: int -JobObjectExtendedLimitInformation: int -JobObjectJobSetInformation: int -JobObjectSecurityLimitInformation: int -MaxJobObjectInfoClass: int -JobObjectBasicProcessIdList: int -UNICODE: int +JOB_OBJECT_ASSIGN_PROCESS: Final = 0x0001 +JOB_OBJECT_SET_ATTRIBUTES: Final = 0x0002 +JOB_OBJECT_QUERY: Final = 0x0004 +JOB_OBJECT_TERMINATE: Final = 0x0008 +JOB_OBJECT_SET_SECURITY_ATTRIBUTES: Final = 0x0010 +JOB_OBJECT_ALL_ACCESS: Final[int] +JOB_OBJECT_TERMINATE_AT_END_OF_JOB: Final = 0 +JOB_OBJECT_POST_AT_END_OF_JOB: Final = 1 +JOB_OBJECT_MSG_END_OF_JOB_TIME: Final[int] +JOB_OBJECT_MSG_END_OF_PROCESS_TIME: Final[int] +JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: Final[int] +JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: Final[int] +JOB_OBJECT_MSG_NEW_PROCESS: Final[int] +JOB_OBJECT_MSG_EXIT_PROCESS: Final[int] +JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: Final[int] +JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: Final[int] +JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: Final[int] +JOB_OBJECT_LIMIT_WORKINGSET: Final = 0x00000001 +JOB_OBJECT_LIMIT_PROCESS_TIME: Final = 0x00000002 +JOB_OBJECT_LIMIT_JOB_TIME: Final = 0x00000004 +JOB_OBJECT_LIMIT_ACTIVE_PROCESS: Final = 0x00000008 +JOB_OBJECT_LIMIT_AFFINITY: Final = 0x00000010 +JOB_OBJECT_LIMIT_PRIORITY_CLASS: Final = 0x00000020 +JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: Final = 0x00000040 +JOB_OBJECT_LIMIT_SCHEDULING_CLASS: Final = 0x00000080 +JOB_OBJECT_LIMIT_PROCESS_MEMORY: Final = 0x00000100 +JOB_OBJECT_LIMIT_JOB_MEMORY: Final = 0x00000200 +JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: Final = 0x00000400 +JOB_OBJECT_LIMIT_BREAKAWAY_OK: Final = 0x00000800 +JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: Final = 0x00001000 +JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: Final = 0x00002000 +JOB_OBJECT_LIMIT_VALID_FLAGS: Final[int] +JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: Final[int] +JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: Final[int] +JOB_OBJECT_UILIMIT_NONE: Final[int] +JOB_OBJECT_UILIMIT_HANDLES: Final = 0x00000001 +JOB_OBJECT_UILIMIT_READCLIPBOARD: Final = 0x00000002 +JOB_OBJECT_UILIMIT_WRITECLIPBOARD: Final = 0x00000004 +JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: Final = 0x00000008 +JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: Final = 0x00000010 +JOB_OBJECT_UILIMIT_GLOBALATOMS: Final = 0x00000020 +JOB_OBJECT_UILIMIT_DESKTOP: Final = 0x00000040 +JOB_OBJECT_UILIMIT_EXITWINDOWS: Final = 0x00000080 +JOB_OBJECT_UILIMIT_ALL: Final[int] +JOB_OBJECT_UI_VALID_FLAGS: Final[int] +JOB_OBJECT_SECURITY_NO_ADMIN: Final = 0x00000001 +JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: Final = 0x00000002 +JOB_OBJECT_SECURITY_ONLY_TOKEN: Final = 0x00000004 +JOB_OBJECT_SECURITY_FILTER_TOKENS: Final = 0x00000008 +JOB_OBJECT_SECURITY_VALID_FLAGS: Final[int] +JobObjectBasicAccountingInformation: Final = 1 +JobObjectBasicLimitInformation: Final = 2 +JobObjectBasicProcessIdList: Final = 3 +JobObjectBasicUIRestrictions: Final = 4 +JobObjectSecurityLimitInformation: Final = 5 +JobObjectEndOfJobTimeInformation: Final = 6 +JobObjectAssociateCompletionPortInformation: Final[int] +JobObjectBasicAndIoAccountingInformation: Final = 8 +JobObjectExtendedLimitInformation: Final = 9 +JobObjectJobSetInformation: Final[int] +MaxJobObjectInfoClass: Final[int] +UNICODE: Final = 1 diff --git a/stubs/pywin32/win32/win32lz.pyi b/stubs/pywin32/win32/win32lz.pyi index 711744c480b1..7b53dab6de64 100644 --- a/stubs/pywin32/win32/win32lz.pyi +++ b/stubs/pywin32/win32/win32lz.pyi @@ -1,9 +1,7 @@ -from _typeshed import Incomplete - from win32.lib.pywintypes import error as error -def GetExpandedName(Source, /) -> str: ... -def Close(handle, /) -> None: ... -def Copy(hSrc, hDest, /): ... -def Init(handle, /) -> None: ... -def OpenFile(fileName: str, action, /) -> tuple[Incomplete, Incomplete]: ... +def GetExpandedName(Source: str, /) -> str: ... +def Close(handle: int, /) -> None: ... +def Copy(hSrc: int, hDest: int, /) -> int: ... +def Init(handle: int, /) -> int: ... +def OpenFile(fileName: str, action: int, /) -> tuple[int, tuple[int, int, int, int, str | None]]: ... diff --git a/stubs/pywin32/win32/win32profile.pyi b/stubs/pywin32/win32/win32profile.pyi index 155a77cbdda2..e91daa947b9c 100644 --- a/stubs/pywin32/win32/win32profile.pyi +++ b/stubs/pywin32/win32/win32profile.pyi @@ -1,19 +1,21 @@ +from typing import Final, Literal + import _win32typing -def CreateEnvironmentBlock(Token: int, Inherit): ... -def DeleteProfile(SidString: str, ProfilePath: str | None = ..., ComputerName: str | None = ...) -> None: ... -def ExpandEnvironmentStringsForUser(Token: int, Src: str) -> str: ... +def CreateEnvironmentBlock(Token: int | _win32typing.PyHANDLE | None, Inherit: bool | Literal[0, 1]) -> dict[str, str] | None: ... +def DeleteProfile(SidString: str, ProfilePath: str | None = None, ComputerName: str | None = None) -> None: ... +def ExpandEnvironmentStringsForUser(Token: int | _win32typing.PyHANDLE | None, Src: str) -> str: ... def GetAllUsersProfileDirectory() -> str: ... def GetDefaultUserProfileDirectory() -> str: ... -def GetEnvironmentStrings(): ... +def GetEnvironmentStrings() -> dict[str, str] | None: ... def GetProfilesDirectory() -> str: ... -def GetProfileType(): ... -def GetUserProfileDirectory(Token: int) -> str: ... -def LoadUserProfile(hToken: int, ProfileInfo: _win32typing.PyPROFILEINFO) -> _win32typing.PyHKEY: ... -def UnloadUserProfile(Token: int, Profile: _win32typing.PyHKEY) -> None: ... +def GetProfileType() -> int: ... +def GetUserProfileDirectory(Token: int | _win32typing.PyHANDLE | None) -> str: ... +def LoadUserProfile(hToken: int | _win32typing.PyHANDLE | None, ProfileInfo: _win32typing.ProfileInfo) -> _win32typing.PyHKEY: ... +def UnloadUserProfile(Token: int | _win32typing.PyHANDLE | None, Profile: int | _win32typing.PyHANDLE | None) -> None: ... -PI_APPLYPOLICY: int -PI_NOUI: int -PT_MANDATORY: int -PT_ROAMING: int -PT_TEMPORARY: int +PI_NOUI: Final[int] +PI_APPLYPOLICY: Final[int] +PT_MANDATORY: Final[int] +PT_ROAMING: Final[int] +PT_TEMPORARY: Final[int] diff --git a/stubs/pywin32/win32/win32transaction.pyi b/stubs/pywin32/win32/win32transaction.pyi index 26d5077d5a55..1e3639d6fae1 100644 --- a/stubs/pywin32/win32/win32transaction.pyi +++ b/stubs/pywin32/win32/win32transaction.pyi @@ -2,17 +2,17 @@ import _win32typing from win32.lib.pywintypes import error as error def CreateTransaction( - TransactionAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., - UOW: _win32typing.PyIID | None = ..., - CreateOptions: int = ..., - IsolationLevel: int = ..., - IsolationFlags: int = ..., - Timeout: int = ..., - Description: str | None = ..., -) -> int: ... -def RollbackTransaction(TransactionHandle: int) -> None: ... -def RollbackTransactionAsync(TransactionHandle: int) -> None: ... -def CommitTransaction(TransactionHandle: int) -> None: ... -def CommitTransactionAsync(TransactionHandle: int) -> None: ... -def GetTransactionId(TransactionHandle: int) -> _win32typing.PyIID: ... -def OpenTransaction(DesiredAccess, TransactionId: _win32typing.PyIID) -> int: ... + TransactionAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = None, + UOW: None = None, + CreateOptions: int = 0, + IsolationLevel: int = 0, + IsolationFlags: int = 0, + Timeout: int = 0, + Description: str | None = None, +) -> _win32typing.PyHANDLE: ... +def RollbackTransaction(TransactionHandle: int | _win32typing.PyHANDLE | None) -> None: ... +def RollbackTransactionAsync(TransactionHandle: int | _win32typing.PyHANDLE | None) -> None: ... +def CommitTransaction(TransactionHandle: int | _win32typing.PyHANDLE | None) -> None: ... +def CommitTransactionAsync(TransactionHandle: int | _win32typing.PyHANDLE | None) -> None: ... +def GetTransactionId(TransactionHandle: int | _win32typing.PyHANDLE | None) -> _win32typing.PyIID: ... +def OpenTransaction(DesiredAccess: int, TransactionId: str | _win32typing.PyIID) -> _win32typing.PyHANDLE: ... diff --git a/stubs/pywin32/win32/win32wnet.pyi b/stubs/pywin32/win32/win32wnet.pyi index 6fd4e9b0e432..7c741a96273b 100644 --- a/stubs/pywin32/win32/win32wnet.pyi +++ b/stubs/pywin32/win32/win32wnet.pyi @@ -1,33 +1,49 @@ -from _typeshed import Incomplete +from typing import Literal, overload import _win32typing from win32.lib.pywintypes import error as error -def NCBBuffer(size, /): ... -def Netbios(ncb: _win32typing.NCB, /): ... +def NCBBuffer(size: int, /) -> memoryview: ... +def Netbios(ncb: _win32typing.PyNCB, /) -> int: ... + +@overload def WNetAddConnection2( - NetResource: _win32typing.PyNETRESOURCE, - Password: Incomplete | None = ..., - UserName: Incomplete | None = ..., - Flags: int = ..., + Type: int, + LocalName: str | None, + RemoteName: str, + bProviderName: str | None = None, + UserName: str | None = None, + Password: str | None = None, + Flags: int = 0, + /, +) -> None: ... +@overload +def WNetAddConnection2( + NetResource: _win32typing.PyNETRESOURCE, Password: str | None = None, UserName: str | None = None, Flags: int = 0 ) -> None: ... + def WNetAddConnection3( - HwndOwner: int | _win32typing.PyHANDLE, + HwndOwner: int | _win32typing.PyHANDLE | None, NetResource: _win32typing.PyNETRESOURCE, - Password: Incomplete | None = ..., - UserName: Incomplete | None = ..., - Flags: int = ..., + Password: str | None = None, + UserName: str | None = None, + Flags: int = 0, ) -> None: ... -def WNetCancelConnection2(name: str, flags, force, /) -> None: ... -def WNetOpenEnum(scope, _type, usage, resource: _win32typing.PyNETRESOURCE, /) -> _win32typing.PyHANDLE: ... +def WNetCancelConnection2(name: str, flags: int, force: int, /) -> None: ... +def WNetOpenEnum(scope: int, type: int, usage: int, resource: _win32typing.PyNETRESOURCE | None, /) -> _win32typing.PyHANDLE: ... def WNetCloseEnum(handle: _win32typing.PyHANDLE, /) -> None: ... -def WNetEnumResource(handle: _win32typing.PyHANDLE, maxExtries: int = ..., /) -> list[_win32typing.PyNETRESOURCE]: ... -def WNetGetUser(connection: str | None = ..., /) -> str: ... -def WNetGetUniversalName(localPath: str, infoLevel, /) -> str: ... -def WNetGetResourceInformation(NetResource: _win32typing.PyNETRESOURCE, /) -> tuple[_win32typing.PyNETRESOURCE, Incomplete]: ... -def WNetGetLastError() -> tuple[Incomplete, Incomplete, Incomplete]: ... +def WNetEnumResource(handle: int | _win32typing.PyHANDLE | None, maxExtries: int = 64, /) -> list[_win32typing.PyNETRESOURCE]: ... +def WNetGetUser(connection: str | None = None, /) -> str: ... + +@overload +def WNetGetUniversalName(localPath: str, infoLevel: Literal[1] = 1, /) -> str: ... +@overload +def WNetGetUniversalName(localPath: str, infoLevel: Literal[2], /) -> tuple[str, str, str]: ... + +def WNetGetResourceInformation(NetResource: _win32typing.PyNETRESOURCE, /) -> tuple[_win32typing.PyNETRESOURCE, str]: ... +def WNetGetLastError() -> tuple[int, str, str]: ... def WNetGetResourceParent(NetResource: _win32typing.PyNETRESOURCE, /) -> _win32typing.PyNETRESOURCE: ... -def WNetGetConnection(connection: str | None = ..., /) -> str: ... +def WNetGetConnection(connection: str | None = None, /) -> str: ... NETRESOURCE = _win32typing.PyNETRESOURCE NCB = _win32typing.PyNCB