about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2022-03-28 08:42:59 +0100
committerChris Denton <christophersdenton@gmail.com>2022-04-05 08:11:15 +0100
commit66faaa817ac28a64c05964cd0aa4999d793a1d1c (patch)
tree579dac0843bc42c24f16bdc8c6d3d0fb62dbd8e5
parent949b98cab8a186b98bf87e64374b8d0848c55271 (diff)
downloadrust-66faaa817ac28a64c05964cd0aa4999d793a1d1c.tar.gz
rust-66faaa817ac28a64c05964cd0aa4999d793a1d1c.zip
Correct definition of `IO_STATUS_BLOCK`
-rw-r--r--library/std/src/sys/windows/c.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/library/std/src/sys/windows/c.rs b/library/std/src/sys/windows/c.rs
index 0ecc2a5cfda..9e72db42dce 100644
--- a/library/std/src/sys/windows/c.rs
+++ b/library/std/src/sys/windows/c.rs
@@ -316,15 +316,21 @@ impl Default for OBJECT_ATTRIBUTES {
     }
 }
 #[repr(C)]
-pub struct IO_STATUS_BLOCK {
-    pub Pointer: *mut c_void,
-    pub Information: usize,
+union IO_STATUS_BLOCK_union {
+    Status: NTSTATUS,
+    Pointer: *mut c_void,
 }
-impl Default for IO_STATUS_BLOCK {
+impl Default for IO_STATUS_BLOCK_union {
     fn default() -> Self {
-        Self { Pointer: ptr::null_mut(), Information: 0 }
+        Self { Pointer: ptr::null_mut() }
     }
 }
+#[repr(C)]
+#[derive(Default)]
+pub struct IO_STATUS_BLOCK {
+    u: IO_STATUS_BLOCK_union,
+    pub Information: usize,
+}
 
 pub type LPOVERLAPPED_COMPLETION_ROUTINE = unsafe extern "system" fn(
     dwErrorCode: DWORD,