77 dead_code,
88 clippy:: all
99) ]
10+
11+ use zerocopy:: { FromBytes , Immutable , IntoBytes } ;
12+
1013windows_targets:: link!( "dbghelp.dll" "system" fn EnumerateLoadedModulesW64 ( hprocess : HANDLE , enumloadedmodulescallback : PENUMLOADED_MODULES_CALLBACKW64 , usercontext : * const core:: ffi:: c_void) -> BOOL ) ;
1114windows_targets:: link!( "dbghelp.dll" "system" fn StackWalk64 ( machinetype : u32 , hprocess : HANDLE , hthread : HANDLE , stackframe : * mut STACKFRAME64 , contextrecord : * mut core:: ffi:: c_void, readmemoryroutine : PREAD_PROCESS_MEMORY_ROUTINE64 , functiontableaccessroutine : PFUNCTION_TABLE_ACCESS_ROUTINE64 , getmodulebaseroutine : PGET_MODULE_BASE_ROUTINE64 , translateaddress : PTRANSLATE_ADDRESS_ROUTINE64 ) -> BOOL ) ;
1215windows_targets:: link!( "dbghelp.dll" "system" fn StackWalkEx ( machinetype : u32 , hprocess : HANDLE , hthread : HANDLE , stackframe : * mut STACKFRAME_EX , contextrecord : * mut core:: ffi:: c_void, readmemoryroutine : PREAD_PROCESS_MEMORY_ROUTINE64 , functiontableaccessroutine : PFUNCTION_TABLE_ACCESS_ROUTINE64 , getmodulebaseroutine : PGET_MODULE_BASE_ROUTINE64 , translateaddress : PTRANSLATE_ADDRESS_ROUTINE64 , flags : u32 ) -> BOOL ) ;
@@ -58,7 +61,7 @@ pub struct ADDRESS64 {
5861}
5962pub type ADDRESS_MODE = i32 ;
6063#[ repr( C ) ]
61- #[ derive( Clone , Copy ) ]
64+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
6265pub union ARM64_NT_NEON128 {
6366 pub Anonymous : ARM64_NT_NEON128_0 ,
6467 pub D : [ f64 ; 2 ] ,
@@ -67,7 +70,7 @@ pub union ARM64_NT_NEON128 {
6770 pub B : [ u8 ; 16 ] ,
6871}
6972#[ repr( C ) ]
70- #[ derive( Clone , Copy ) ]
73+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
7174pub struct ARM64_NT_NEON128_0 {
7275 pub Low : u64 ,
7376 pub High : i64 ,
@@ -76,7 +79,7 @@ pub const AddrModeFlat: ADDRESS_MODE = 3i32;
7679pub type BOOL = i32 ;
7780#[ repr( C ) ]
7881#[ cfg( target_arch = "aarch64" ) ]
79- #[ derive( Clone , Copy ) ]
82+ #[ derive( Clone , Copy , FromBytes ) ]
8083pub struct CONTEXT {
8184 pub ContextFlags : CONTEXT_FLAGS ,
8285 pub Cpsr : u32 ,
@@ -93,14 +96,14 @@ pub struct CONTEXT {
9396}
9497#[ repr( C ) ]
9598#[ cfg( target_arch = "aarch64" ) ]
96- #[ derive( Clone , Copy ) ]
99+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
97100pub union CONTEXT_0 {
98101 pub Anonymous : CONTEXT_0_0 ,
99102 pub X : [ u64 ; 31 ] ,
100103}
101104#[ repr( C ) ]
102105#[ cfg( target_arch = "aarch64" ) ]
103- #[ derive( Clone , Copy ) ]
106+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
104107pub struct CONTEXT_0_0 {
105108 pub X0 : u64 ,
106109 pub X1 : u64 ,
@@ -136,7 +139,7 @@ pub struct CONTEXT_0_0 {
136139}
137140#[ repr( C ) ]
138141#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
139- #[ derive( Clone , Copy ) ]
142+ #[ derive( Clone , Copy , FromBytes ) ]
140143pub struct CONTEXT {
141144 pub P1Home : u64 ,
142145 pub P2Home : u64 ,
@@ -187,14 +190,14 @@ pub struct CONTEXT {
187190}
188191#[ repr( C ) ]
189192#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
190- #[ derive( Clone , Copy ) ]
193+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
191194pub union CONTEXT_0 {
192195 pub FltSave : XSAVE_FORMAT ,
193196 pub Anonymous : CONTEXT_0_0 ,
194197}
195198#[ repr( C ) ]
196199#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
197- #[ derive( Clone , Copy ) ]
200+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
198201pub struct CONTEXT_0_0 {
199202 pub Header : [ M128A ; 2 ] ,
200203 pub Legacy : [ M128A ; 8 ] ,
@@ -217,7 +220,7 @@ pub struct CONTEXT_0_0 {
217220}
218221#[ repr( C ) ]
219222#[ cfg( target_arch = "x86" ) ]
220- #[ derive( Clone , Copy ) ]
223+ #[ derive( Clone , Copy , FromBytes ) ]
221224pub struct CONTEXT {
222225 pub ContextFlags : CONTEXT_FLAGS ,
223226 pub Dr0 : u32 ,
@@ -292,7 +295,7 @@ pub struct FLOATING_SAVE_AREA {
292295}
293296#[ repr( C ) ]
294297#[ cfg( target_arch = "x86" ) ]
295- #[ derive( Clone , Copy ) ]
298+ #[ derive( Clone , Copy , FromBytes ) ]
296299pub struct FLOATING_SAVE_AREA {
297300 pub ControlWord : u32 ,
298301 pub StatusWord : u32 ,
@@ -466,7 +469,7 @@ pub struct KNONVOLATILE_CONTEXT_POINTERS {
466469 pub Dummy : u32 ,
467470}
468471#[ repr( C ) ]
469- #[ derive( Clone , Copy ) ]
472+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
470473pub struct M128A {
471474 pub Low : u64 ,
472475 pub High : i64 ,
@@ -563,7 +566,7 @@ pub struct STACKFRAME_EX {
563566 pub InlineFrameContext : u32 ,
564567}
565568#[ repr( C ) ]
566- #[ derive( Clone , Copy ) ]
569+ #[ derive( Clone , Copy , FromBytes , IntoBytes ) ]
567570pub struct SYMBOL_INFOW {
568571 pub SizeOfStruct : u32 ,
569572 pub TypeIndex : u32 ,
@@ -572,6 +575,7 @@ pub struct SYMBOL_INFOW {
572575 pub Size : u32 ,
573576 pub ModBase : u64 ,
574577 pub Flags : SYMBOL_INFO_FLAGS ,
578+ __padding0 : [ u8 ; 4 ] ,
575579 pub Value : u64 ,
576580 pub Address : u64 ,
577581 pub Register : u32 ,
@@ -580,6 +584,7 @@ pub struct SYMBOL_INFOW {
580584 pub NameLen : u32 ,
581585 pub MaxNameLen : u32 ,
582586 pub Name : [ u16 ; 1 ] ,
587+ __padding1 : [ u8 ; 2 ] ,
583588}
584589pub type SYMBOL_INFO_FLAGS = u32 ;
585590pub const SYMOPT_DEFERRED_LOADS : u32 = 4u32 ;
@@ -623,7 +628,7 @@ pub type WAIT_EVENT = u32;
623628 target_arch = "arm64ec" ,
624629 target_arch = "x86_64"
625630) ) ]
626- #[ derive( Clone , Copy ) ]
631+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
627632pub struct XSAVE_FORMAT {
628633 pub ControlWord : u16 ,
629634 pub StatusWord : u16 ,
@@ -644,7 +649,7 @@ pub struct XSAVE_FORMAT {
644649}
645650#[ repr( C ) ]
646651#[ cfg( target_arch = "x86" ) ]
647- #[ derive( Clone , Copy ) ]
652+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
648653pub struct XSAVE_FORMAT {
649654 pub ControlWord : u16 ,
650655 pub StatusWord : u16 ,
0 commit comments