Skip to content

Commit 66faaa8

Browse files
committed
Correct definition of IO_STATUS_BLOCK
1 parent 949b98c commit 66faaa8

File tree

1 file changed

+11
-5
lines changed
  • library/std/src/sys/windows

1 file changed

+11
-5
lines changed

library/std/src/sys/windows/c.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,21 @@ impl Default for OBJECT_ATTRIBUTES {
316316
}
317317
}
318318
#[repr(C)]
319-
pub struct IO_STATUS_BLOCK {
320-
pub Pointer: *mut c_void,
321-
pub Information: usize,
319+
union IO_STATUS_BLOCK_union {
320+
Status: NTSTATUS,
321+
Pointer: *mut c_void,
322322
}
323-
impl Default for IO_STATUS_BLOCK {
323+
impl Default for IO_STATUS_BLOCK_union {
324324
fn default() -> Self {
325-
Self { Pointer: ptr::null_mut(), Information: 0 }
325+
Self { Pointer: ptr::null_mut() }
326326
}
327327
}
328+
#[repr(C)]
329+
#[derive(Default)]
330+
pub struct IO_STATUS_BLOCK {
331+
u: IO_STATUS_BLOCK_union,
332+
pub Information: usize,
333+
}
328334

329335
pub type LPOVERLAPPED_COMPLETION_ROUTINE = unsafe extern "system" fn(
330336
dwErrorCode: DWORD,

0 commit comments

Comments
 (0)