about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2023-08-17 15:29:29 +0100
committerChris Denton <chris@chrisdenton.dev>2023-08-28 20:12:01 +0100
commitde3726c9b32c251b3c5181e1dab64f00e68a88c1 (patch)
treee880dae661e3622038198c76f11b87cbfd5d3de0
parenteb19bd33bac3f1e5f8cec2ddcb4ad7188baaba1c (diff)
downloadrust-de3726c9b32c251b3c5181e1dab64f00e68a88c1.tar.gz
rust-de3726c9b32c251b3c5181e1dab64f00e68a88c1.zip
Add GetActiveProcessorCount and process attributes
-rw-r--r--library/std/src/sys/windows/c/windows_sys.lst2
-rw-r--r--library/std/src/sys/windows/c/windows_sys.rs5
2 files changed, 7 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/c/windows_sys.lst b/library/std/src/sys/windows/c/windows_sys.lst
index 3e5a9b74510..aabb68c5c10 100644
--- a/library/std/src/sys/windows/c/windows_sys.lst
+++ b/library/std/src/sys/windows/c/windows_sys.lst
@@ -2480,6 +2480,7 @@ Windows.Win32.System.SystemInformation.GetSystemTimeAsFileTime
 Windows.Win32.System.SystemInformation.GetWindowsDirectoryW
 Windows.Win32.System.SystemInformation.PROCESSOR_ARCHITECTURE
 Windows.Win32.System.SystemInformation.SYSTEM_INFO
+Windows.Win32.System.SystemServices.ALL_PROCESSOR_GROUPS
 Windows.Win32.System.SystemServices.DLL_PROCESS_DETACH
 Windows.Win32.System.SystemServices.DLL_THREAD_DETACH
 Windows.Win32.System.SystemServices.EXCEPTION_MAXIMUM_PARAMETERS
@@ -2512,6 +2513,7 @@ Windows.Win32.System.Threading.DeleteProcThreadAttributeList
 Windows.Win32.System.Threading.DETACHED_PROCESS
 Windows.Win32.System.Threading.ExitProcess
 Windows.Win32.System.Threading.EXTENDED_STARTUPINFO_PRESENT
+Windows.Win32.System.Threading.GetActiveProcessorCount
 Windows.Win32.System.Threading.GetCurrentProcess
 Windows.Win32.System.Threading.GetCurrentProcessId
 Windows.Win32.System.Threading.GetCurrentThread
diff --git a/library/std/src/sys/windows/c/windows_sys.rs b/library/std/src/sys/windows/c/windows_sys.rs
index c7fba5bd30b..96c7d17c3ce 100644
--- a/library/std/src/sys/windows/c/windows_sys.rs
+++ b/library/std/src/sys/windows/c/windows_sys.rs
@@ -221,6 +221,10 @@ extern "system" {
 }
 #[link(name = "kernel32")]
 extern "system" {
+    pub fn GetActiveProcessorCount(groupnumber: u16) -> u32;
+}
+#[link(name = "kernel32")]
+extern "system" {
     pub fn GetCommandLineW() -> PCWSTR;
 }
 #[link(name = "kernel32")]
@@ -844,6 +848,7 @@ impl ::core::clone::Clone for ADDRINFOA {
 pub const AF_INET: ADDRESS_FAMILY = 2u16;
 pub const AF_INET6: ADDRESS_FAMILY = 23u16;
 pub const AF_UNSPEC: ADDRESS_FAMILY = 0u16;
+pub const ALL_PROCESSOR_GROUPS: u32 = 65535u32;
 #[repr(C)]
 pub union ARM64_NT_NEON128 {
     pub Anonymous: ARM64_NT_NEON128_0,