Skip to content

Commit cbe075d

Browse files
committed
address review comments
1 parent 75c1d3c commit cbe075d

3 files changed

Lines changed: 18 additions & 37 deletions

File tree

crates/fspy_detours_sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license.workspace = true
77
rust-version.workspace = true
88

99
[build-dependencies]
10-
cc ={ workspace = true }
10+
cc = { workspace = true }
1111

1212
[dependencies]
1313
winapi = { workspace = true, features = ["minwindef", "libloaderapi", "processthreadsapi", "windef"] }

crates/fspy_detours_sys/src/generated_bindings.rs

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
use winapi::shared::minwindef::*;
2-
use winapi::um::winnt::*;
3-
use winapi::um::winnt::{INT};
4-
use winapi::um::minwinbase::*;
5-
use winapi::um::processthreadsapi::*;
6-
use winapi::shared::guiddef::*;
7-
use winapi::shared::windef::*;
1+
use winapi::{
2+
shared::{guiddef::*, minwindef::*, windef::*},
3+
um::{
4+
minwinbase::*,
5+
processthreadsapi::*,
6+
winnt::{INT, *},
7+
},
8+
};
89

910
#[repr(C)]
1011
#[derive(Debug, Copy, Clone)]
@@ -14,11 +15,7 @@ pub struct _DETOUR_TRAMPOLINE {
1415
pub type PDETOUR_TRAMPOLINE = *mut _DETOUR_TRAMPOLINE;
1516
/// Binary Typedefs.
1617
pub type PF_DETOUR_BINARY_BYWAY_CALLBACK = ::std::option::Option<
17-
unsafe extern "system" fn(
18-
pContext: PVOID,
19-
pszFile: LPCSTR,
20-
ppszOutFile: *mut LPCSTR,
21-
) -> BOOL,
18+
unsafe extern "system" fn(pContext: PVOID, pszFile: LPCSTR, ppszOutFile: *mut LPCSTR) -> BOOL,
2219
>;
2320
pub type PF_DETOUR_BINARY_FILE_CALLBACK = ::std::option::Option<
2421
unsafe extern "system" fn(
@@ -39,9 +36,8 @@ pub type PF_DETOUR_BINARY_SYMBOL_CALLBACK = ::std::option::Option<
3936
ppszOutSymbol: *mut LPCSTR,
4037
) -> BOOL,
4138
>;
42-
pub type PF_DETOUR_BINARY_COMMIT_CALLBACK = ::std::option::Option<
43-
unsafe extern "system" fn(pContext: PVOID) -> BOOL,
44-
>;
39+
pub type PF_DETOUR_BINARY_COMMIT_CALLBACK =
40+
::std::option::Option<unsafe extern "system" fn(pContext: PVOID) -> BOOL>;
4541
pub type PF_DETOUR_ENUMERATE_EXPORT_CALLBACK = ::std::option::Option<
4642
unsafe extern "system" fn(
4743
pContext: PVOID,
@@ -178,11 +174,7 @@ unsafe extern "system" {
178174
) -> BOOL;
179175
}
180176
unsafe extern "system" {
181-
pub fn DetourFindPayload(
182-
hModule: HMODULE,
183-
rguid: *const GUID,
184-
pcbData: *mut DWORD,
185-
) -> PVOID;
177+
pub fn DetourFindPayload(hModule: HMODULE, rguid: *const GUID, pcbData: *mut DWORD) -> PVOID;
186178
}
187179
unsafe extern "system" {
188180
pub fn DetourFindPayloadEx(rguid: *const GUID, pcbData: *mut DWORD) -> PVOID;
@@ -221,10 +213,7 @@ unsafe extern "system" {
221213
) -> PVOID;
222214
}
223215
unsafe extern "system" {
224-
pub fn DetourBinaryDeletePayload(
225-
pBinary: PDETOUR_BINARY,
226-
rguid: *const GUID,
227-
) -> BOOL;
216+
pub fn DetourBinaryDeletePayload(pBinary: PDETOUR_BINARY, rguid: *const GUID) -> BOOL;
228217
}
229218
unsafe extern "system" {
230219
pub fn DetourBinaryPurgePayloads(pBinary: PDETOUR_BINARY) -> BOOL;
@@ -413,11 +402,8 @@ unsafe extern "system" {
413402
) -> BOOL;
414403
}
415404
unsafe extern "system" {
416-
pub fn DetourUpdateProcessWithDll(
417-
hProcess: HANDLE,
418-
rlpDlls: *mut LPCSTR,
419-
nDlls: DWORD,
420-
) -> BOOL;
405+
pub fn DetourUpdateProcessWithDll(hProcess: HANDLE, rlpDlls: *mut LPCSTR, nDlls: DWORD)
406+
-> BOOL;
421407
}
422408
unsafe extern "system" {
423409
pub fn DetourUpdateProcessWithDllEx(
@@ -454,10 +440,5 @@ unsafe extern "system" {
454440
pub fn DetourIsHelperProcess() -> BOOL;
455441
}
456442
unsafe extern "system" {
457-
pub fn DetourFinishHelperProcess(
458-
arg1: HWND,
459-
arg2: HINSTANCE,
460-
arg3: LPSTR,
461-
arg4: INT,
462-
);
443+
pub fn DetourFinishHelperProcess(arg1: HWND, arg2: HINSTANCE, arg3: LPSTR, arg4: INT);
463444
}

crates/fspy_detours_sys/tests/bindings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn detours_bindings() {
3535
.disable_header_comment()
3636
.raw_line("use winapi::shared::minwindef::*;")
3737
.raw_line("use winapi::um::winnt::*;")
38-
.raw_line("use winapi::um::winnt::{INT};")
38+
.raw_line("use winapi::um::winnt::INT;")
3939
.raw_line("use winapi::um::minwinbase::*;")
4040
.raw_line("use winapi::um::processthreadsapi::*;")
4141
.raw_line("use winapi::shared::guiddef::*;")

0 commit comments

Comments
 (0)