1 use std::fmt; 2 use std::ops::{Deref, DerefMut}; 3 4 use ntapi::ntioapi::IO_STATUS_BLOCK; 5 6 pub struct IoStatusBlock(IO_STATUS_BLOCK); 7 8 cfg_io_source! { 9 use ntapi::ntioapi::IO_STATUS_BLOCK_u; 10 11 impl IoStatusBlock { 12 pub fn zeroed() -> Self { 13 Self(IO_STATUS_BLOCK { 14 u: IO_STATUS_BLOCK_u { Status: 0 }, 15 Information: 0, 16 }) 17 } 18 } 19 } 20 21 unsafe impl Send for IoStatusBlock {} 22 23 impl Deref for IoStatusBlock { 24 type Target = IO_STATUS_BLOCK; deref(&self) -> &Self::Target25 fn deref(&self) -> &Self::Target { 26 &self.0 27 } 28 } 29 30 impl DerefMut for IoStatusBlock { deref_mut(&mut self) -> &mut Self::Target31 fn deref_mut(&mut self) -> &mut Self::Target { 32 &mut self.0 33 } 34 } 35 36 impl fmt::Debug for IoStatusBlock { fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result37 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 38 f.debug_struct("IoStatusBlock").finish() 39 } 40 } 41