7
7
dead_code,
8
8
clippy:: all
9
9
) ]
10
+
11
+ use zerocopy:: { FromBytes , Immutable , IntoBytes } ;
12
+
10
13
windows_targets:: link!( "dbghelp.dll" "system" fn EnumerateLoadedModulesW64 ( hprocess : HANDLE , enumloadedmodulescallback : PENUMLOADED_MODULES_CALLBACKW64 , usercontext : * const core:: ffi:: c_void) -> BOOL ) ;
11
14
windows_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 ) ;
12
15
windows_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 {
58
61
}
59
62
pub type ADDRESS_MODE = i32 ;
60
63
#[ repr( C ) ]
61
- #[ derive( Clone , Copy ) ]
64
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
62
65
pub union ARM64_NT_NEON128 {
63
66
pub Anonymous : ARM64_NT_NEON128_0 ,
64
67
pub D : [ f64 ; 2 ] ,
@@ -67,7 +70,7 @@ pub union ARM64_NT_NEON128 {
67
70
pub B : [ u8 ; 16 ] ,
68
71
}
69
72
#[ repr( C ) ]
70
- #[ derive( Clone , Copy ) ]
73
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
71
74
pub struct ARM64_NT_NEON128_0 {
72
75
pub Low : u64 ,
73
76
pub High : i64 ,
@@ -76,7 +79,7 @@ pub const AddrModeFlat: ADDRESS_MODE = 3i32;
76
79
pub type BOOL = i32 ;
77
80
#[ repr( C ) ]
78
81
#[ cfg( target_arch = "aarch64" ) ]
79
- #[ derive( Clone , Copy ) ]
82
+ #[ derive( Clone , Copy , FromBytes ) ]
80
83
pub struct CONTEXT {
81
84
pub ContextFlags : CONTEXT_FLAGS ,
82
85
pub Cpsr : u32 ,
@@ -93,14 +96,14 @@ pub struct CONTEXT {
93
96
}
94
97
#[ repr( C ) ]
95
98
#[ cfg( target_arch = "aarch64" ) ]
96
- #[ derive( Clone , Copy ) ]
99
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
97
100
pub union CONTEXT_0 {
98
101
pub Anonymous : CONTEXT_0_0 ,
99
102
pub X : [ u64 ; 31 ] ,
100
103
}
101
104
#[ repr( C ) ]
102
105
#[ cfg( target_arch = "aarch64" ) ]
103
- #[ derive( Clone , Copy ) ]
106
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
104
107
pub struct CONTEXT_0_0 {
105
108
pub X0 : u64 ,
106
109
pub X1 : u64 ,
@@ -136,7 +139,7 @@ pub struct CONTEXT_0_0 {
136
139
}
137
140
#[ repr( C ) ]
138
141
#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
139
- #[ derive( Clone , Copy ) ]
142
+ #[ derive( Clone , Copy , FromBytes ) ]
140
143
pub struct CONTEXT {
141
144
pub P1Home : u64 ,
142
145
pub P2Home : u64 ,
@@ -187,14 +190,14 @@ pub struct CONTEXT {
187
190
}
188
191
#[ repr( C ) ]
189
192
#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
190
- #[ derive( Clone , Copy ) ]
193
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
191
194
pub union CONTEXT_0 {
192
195
pub FltSave : XSAVE_FORMAT ,
193
196
pub Anonymous : CONTEXT_0_0 ,
194
197
}
195
198
#[ repr( C ) ]
196
199
#[ cfg( any( target_arch = "arm64ec" , target_arch = "x86_64" ) ) ]
197
- #[ derive( Clone , Copy ) ]
200
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
198
201
pub struct CONTEXT_0_0 {
199
202
pub Header : [ M128A ; 2 ] ,
200
203
pub Legacy : [ M128A ; 8 ] ,
@@ -217,7 +220,7 @@ pub struct CONTEXT_0_0 {
217
220
}
218
221
#[ repr( C ) ]
219
222
#[ cfg( target_arch = "x86" ) ]
220
- #[ derive( Clone , Copy ) ]
223
+ #[ derive( Clone , Copy , FromBytes ) ]
221
224
pub struct CONTEXT {
222
225
pub ContextFlags : CONTEXT_FLAGS ,
223
226
pub Dr0 : u32 ,
@@ -292,7 +295,7 @@ pub struct FLOATING_SAVE_AREA {
292
295
}
293
296
#[ repr( C ) ]
294
297
#[ cfg( target_arch = "x86" ) ]
295
- #[ derive( Clone , Copy ) ]
298
+ #[ derive( Clone , Copy , FromBytes ) ]
296
299
pub struct FLOATING_SAVE_AREA {
297
300
pub ControlWord : u32 ,
298
301
pub StatusWord : u32 ,
@@ -466,7 +469,7 @@ pub struct KNONVOLATILE_CONTEXT_POINTERS {
466
469
pub Dummy : u32 ,
467
470
}
468
471
#[ repr( C ) ]
469
- #[ derive( Clone , Copy ) ]
472
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
470
473
pub struct M128A {
471
474
pub Low : u64 ,
472
475
pub High : i64 ,
@@ -563,7 +566,7 @@ pub struct STACKFRAME_EX {
563
566
pub InlineFrameContext : u32 ,
564
567
}
565
568
#[ repr( C ) ]
566
- #[ derive( Clone , Copy ) ]
569
+ #[ derive( Clone , Copy , FromBytes , IntoBytes ) ]
567
570
pub struct SYMBOL_INFOW {
568
571
pub SizeOfStruct : u32 ,
569
572
pub TypeIndex : u32 ,
@@ -572,6 +575,7 @@ pub struct SYMBOL_INFOW {
572
575
pub Size : u32 ,
573
576
pub ModBase : u64 ,
574
577
pub Flags : SYMBOL_INFO_FLAGS ,
578
+ __padding0 : [ u8 ; 4 ] ,
575
579
pub Value : u64 ,
576
580
pub Address : u64 ,
577
581
pub Register : u32 ,
@@ -580,6 +584,7 @@ pub struct SYMBOL_INFOW {
580
584
pub NameLen : u32 ,
581
585
pub MaxNameLen : u32 ,
582
586
pub Name : [ u16 ; 1 ] ,
587
+ __padding1 : [ u8 ; 2 ] ,
583
588
}
584
589
pub type SYMBOL_INFO_FLAGS = u32 ;
585
590
pub const SYMOPT_DEFERRED_LOADS : u32 = 4u32 ;
@@ -623,7 +628,7 @@ pub type WAIT_EVENT = u32;
623
628
target_arch = "arm64ec" ,
624
629
target_arch = "x86_64"
625
630
) ) ]
626
- #[ derive( Clone , Copy ) ]
631
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
627
632
pub struct XSAVE_FORMAT {
628
633
pub ControlWord : u16 ,
629
634
pub StatusWord : u16 ,
@@ -644,7 +649,7 @@ pub struct XSAVE_FORMAT {
644
649
}
645
650
#[ repr( C ) ]
646
651
#[ cfg( target_arch = "x86" ) ]
647
- #[ derive( Clone , Copy ) ]
652
+ #[ derive( Clone , Copy , FromBytes , Immutable ) ]
648
653
pub struct XSAVE_FORMAT {
649
654
pub ControlWord : u16 ,
650
655
pub StatusWord : u16 ,
0 commit comments