Skip to content

Commit 4647e2a

Browse files
authored
Import some items from winapi as they are now present (#428)
* Import some items from winapi as they are now present * Fix `SymSetOptions` signature on `dbghelp!`
1 parent e710d02 commit 4647e2a

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ default-features = false
4343
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']
4444

4545
[target.'cfg(windows)'.dependencies]
46-
winapi = { version = "0.3.3", optional = true }
46+
winapi = { version = "0.3.9", optional = true }
4747

4848
[build-dependencies]
4949
# Only needed for Android, but cannot be target dependent

src/dbghelp.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,11 @@ use core::ptr;
3434
mod dbghelp {
3535
use crate::windows::*;
3636
pub use winapi::um::dbghelp::{
37-
StackWalk64, SymCleanup, SymFromAddrW, SymFunctionTableAccess64, SymGetLineFromAddrW64,
38-
SymGetModuleBase64, SymInitializeW,
37+
StackWalk64, StackWalkEx, SymCleanup, SymFromAddrW, SymFunctionTableAccess64,
38+
SymGetLineFromAddrW64, SymGetModuleBase64, SymGetOptions, SymInitializeW, SymSetOptions,
3939
};
4040

4141
extern "system" {
42-
// Not defined in winapi yet
43-
pub fn SymGetOptions() -> u32;
44-
pub fn SymSetOptions(_: u32);
45-
46-
// This is defined in winapi, but it's incorrect (FIXME winapi-rs#768)
47-
pub fn StackWalkEx(
48-
MachineType: DWORD,
49-
hProcess: HANDLE,
50-
hThread: HANDLE,
51-
StackFrame: LPSTACKFRAME_EX,
52-
ContextRecord: PVOID,
53-
ReadMemoryRoutine: PREAD_PROCESS_MEMORY_ROUTINE64,
54-
FunctionTableAccessRoutine: PFUNCTION_TABLE_ACCESS_ROUTINE64,
55-
GetModuleBaseRoutine: PGET_MODULE_BASE_ROUTINE64,
56-
TranslateAddress: PTRANSLATE_ADDRESS_ROUTINE64,
57-
Flags: DWORD,
58-
) -> BOOL;
59-
6042
// Not defined in winapi yet
6143
pub fn SymFromInlineContextW(
6244
hProcess: HANDLE,
@@ -176,7 +158,7 @@ const SYMOPT_DEFERRED_LOADS: DWORD = 0x00000004;
176158
dbghelp! {
177159
extern "system" {
178160
fn SymGetOptions() -> DWORD;
179-
fn SymSetOptions(options: DWORD) -> ();
161+
fn SymSetOptions(options: DWORD) -> DWORD;
180162
fn SymInitializeW(
181163
handle: HANDLE,
182164
path: PCWSTR,

0 commit comments

Comments
 (0)