diff --git a/stdlib/@tests/stubtest_allowlists/win32.txt b/stdlib/@tests/stubtest_allowlists/win32.txt index 66695e1d87d3..b56fe5a2042e 100644 --- a/stdlib/@tests/stubtest_allowlists/win32.txt +++ b/stdlib/@tests/stubtest_allowlists/win32.txt @@ -1,14 +1,3 @@ -# ============================================ -# TODO: Allowlist entries that should be fixed -# ============================================ - -# Exists at runtime, but missing from stubs -_winapi.CreateFileMapping -_winapi.MapViewOfFile -_winapi.OpenFileMapping -_winapi.VirtualQuerySize - - # ============================================ # Modules that do not exist on Windows systems # ============================================ diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index d9e2c377b115..42efce9bed70 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -192,6 +192,9 @@ if sys.platform == "win32": template_file: int, /, ) -> int: ... + def CreateFileMapping( + file_handle: int, security_attributes: int, protect: int, max_size_high: int, max_size_low: int, name: str, / + ) -> int: ... def CreateJunction(src_path: str, dst_path: str, /) -> None: ... def CreateNamedPipe( name: str, @@ -235,6 +238,9 @@ if sys.platform == "win32": def GetModuleFileName(module_handle: int, /) -> str: ... def GetStdHandle(std_handle: int, /) -> int: ... def GetVersion() -> int: ... + def MapViewOfFile( + file_map: int, desired_access: int, file_offset_high: int, file_offset_low: int, number_bytes: int, / + ) -> int: ... def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ... def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ... if sys.version_info >= (3, 10): @@ -251,6 +257,7 @@ if sys.platform == "win32": named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None, / ) -> None: ... def TerminateProcess(handle: int, exit_code: int, /) -> None: ... + def VirtualQuerySize(address: int, /) -> int: ... def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = 0xFFFFFFFF, /) -> int: ... def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ... def WaitNamedPipe(name: str, timeout: int, /) -> None: ... @@ -281,6 +288,8 @@ if sys.platform == "win32": def ResetEvent(event: int) -> None: ... def SetEvent(event: int) -> None: ... + def OpenFileMapping(desired_access: int, inherit_handle: bool, name: str, /) -> int: ... + if sys.version_info >= (3, 12): def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ... def NeedCurrentDirectoryForExePath(exe_name: str, /) -> bool: ...