11
11
12
12
#![ allow( bad_style) ]
13
13
14
- use super :: super :: { dbghelp, windows:: * } ;
14
+ use windows_sys:: {
15
+ Win32 :: Foundation :: * , Win32 :: System :: Diagnostics :: Debug :: * ,
16
+ Win32 :: System :: SystemInformation :: * , Win32 :: System :: Threading :: * ,
17
+ } ;
18
+
19
+ use super :: super :: dbghelp;
15
20
use core:: ffi:: c_void;
16
21
use core:: mem;
17
22
@@ -129,7 +134,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
129
134
match ( * dbghelp. dbghelp ( ) ) . StackWalkEx ( ) {
130
135
Some ( StackWalkEx ) => {
131
136
let mut inner: STACKFRAME_EX = mem:: zeroed ( ) ;
132
- inner. StackFrameSize = mem:: size_of :: < STACKFRAME_EX > ( ) as DWORD ;
137
+ inner. StackFrameSize = mem:: size_of :: < STACKFRAME_EX > ( ) as u32 ;
133
138
let mut frame = super :: Frame {
134
139
inner : Frame {
135
140
stack_frame : StackFrame :: New ( inner) ,
@@ -143,7 +148,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
143
148
} ;
144
149
145
150
while StackWalkEx (
146
- image as DWORD ,
151
+ image as u32 ,
147
152
process,
148
153
thread,
149
154
frame_ptr,
@@ -153,7 +158,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
153
158
Some ( get_module_base) ,
154
159
None ,
155
160
0 ,
156
- ) == TRUE
161
+ ) == 1
157
162
{
158
163
frame. inner . base_address = get_module_base ( process_handle, frame. ip ( ) as _ ) as _ ;
159
164
@@ -176,7 +181,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
176
181
} ;
177
182
178
183
while dbghelp. StackWalk64 ( ) (
179
- image as DWORD ,
184
+ image as _ ,
180
185
process,
181
186
thread,
182
187
frame_ptr,
@@ -185,7 +190,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
185
190
Some ( function_table_access) ,
186
191
Some ( get_module_base) ,
187
192
None ,
188
- ) == TRUE
193
+ ) == 1
189
194
{
190
195
frame. inner . base_address = get_module_base ( process_handle, frame. ip ( ) as _ ) as _ ;
191
196
@@ -198,7 +203,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
198
203
}
199
204
200
205
#[ cfg( target_arch = "x86" ) ]
201
- fn init_frame ( frame : & mut Frame , ctx : & CONTEXT ) -> WORD {
206
+ fn init_frame ( frame : & mut Frame , ctx : & CONTEXT ) -> u16 {
202
207
frame. addr_pc_mut ( ) . Offset = ctx. Eip as u64 ;
203
208
frame. addr_pc_mut ( ) . Mode = AddrModeFlat ;
204
209
frame. addr_stack_mut ( ) . Offset = ctx. Esp as u64 ;
@@ -210,7 +215,7 @@ fn init_frame(frame: &mut Frame, ctx: &CONTEXT) -> WORD {
210
215
}
211
216
212
217
#[ cfg( target_arch = "arm" ) ]
213
- fn init_frame ( frame : & mut Frame , ctx : & CONTEXT ) -> WORD {
218
+ fn init_frame ( frame : & mut Frame , ctx : & CONTEXT ) -> u16 {
214
219
frame. addr_pc_mut ( ) . Offset = ctx. Pc as u64 ;
215
220
frame. addr_pc_mut ( ) . Mode = AddrModeFlat ;
216
221
frame. addr_stack_mut ( ) . Offset = ctx. Sp as u64 ;
0 commit comments