Skip to content

Commit 9616c15

Browse files
branchseerclaude
andcommitted
restore original generated_bindings.rs and fix allow_attributes in macro
- Fully restore generated_bindings.rs to match bindgen test output (previous cargo clippy --fix reformatted the prettyplease output) - Fix #[allow(unused)] in intercept_inner macro to satisfy allow_attributes and allow_attributes_without_reason lints Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0a7120a commit 9616c15

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

crates/fspy_detours_sys/src/generated_bindings.rs

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ pub struct _DETOUR_TRAMPOLINE {
1414
pub type PDETOUR_TRAMPOLINE = *mut _DETOUR_TRAMPOLINE;
1515
/// Binary Typedefs.
1616
pub type PF_DETOUR_BINARY_BYWAY_CALLBACK = ::std::option::Option<
17-
unsafe extern "system" fn(pContext: PVOID, pszFile: LPCSTR, ppszOutFile: *mut LPCSTR) -> BOOL,
17+
unsafe extern "system" fn(
18+
pContext: PVOID,
19+
pszFile: LPCSTR,
20+
ppszOutFile: *mut LPCSTR,
21+
) -> BOOL,
1822
>;
1923
pub type PF_DETOUR_BINARY_FILE_CALLBACK = ::std::option::Option<
2024
unsafe extern "system" fn(
@@ -35,8 +39,9 @@ pub type PF_DETOUR_BINARY_SYMBOL_CALLBACK = ::std::option::Option<
3539
ppszOutSymbol: *mut LPCSTR,
3640
) -> BOOL,
3741
>;
38-
pub type PF_DETOUR_BINARY_COMMIT_CALLBACK =
39-
::std::option::Option<unsafe extern "system" fn(pContext: PVOID) -> BOOL>;
42+
pub type PF_DETOUR_BINARY_COMMIT_CALLBACK = ::std::option::Option<
43+
unsafe extern "system" fn(pContext: PVOID) -> BOOL,
44+
>;
4045
pub type PF_DETOUR_ENUMERATE_EXPORT_CALLBACK = ::std::option::Option<
4146
unsafe extern "system" fn(
4247
pContext: PVOID,
@@ -173,7 +178,11 @@ unsafe extern "system" {
173178
) -> BOOL;
174179
}
175180
unsafe extern "system" {
176-
pub fn DetourFindPayload(hModule: HMODULE, rguid: *const GUID, pcbData: *mut DWORD) -> PVOID;
181+
pub fn DetourFindPayload(
182+
hModule: HMODULE,
183+
rguid: *const GUID,
184+
pcbData: *mut DWORD,
185+
) -> PVOID;
177186
}
178187
unsafe extern "system" {
179188
pub fn DetourFindPayloadEx(rguid: *const GUID, pcbData: *mut DWORD) -> PVOID;
@@ -212,7 +221,10 @@ unsafe extern "system" {
212221
) -> PVOID;
213222
}
214223
unsafe extern "system" {
215-
pub fn DetourBinaryDeletePayload(pBinary: PDETOUR_BINARY, rguid: *const GUID) -> BOOL;
224+
pub fn DetourBinaryDeletePayload(
225+
pBinary: PDETOUR_BINARY,
226+
rguid: *const GUID,
227+
) -> BOOL;
216228
}
217229
unsafe extern "system" {
218230
pub fn DetourBinaryPurgePayloads(pBinary: PDETOUR_BINARY) -> BOOL;
@@ -401,8 +413,11 @@ unsafe extern "system" {
401413
) -> BOOL;
402414
}
403415
unsafe extern "system" {
404-
pub fn DetourUpdateProcessWithDll(hProcess: HANDLE, rlpDlls: *mut LPCSTR, nDlls: DWORD)
405-
-> BOOL;
416+
pub fn DetourUpdateProcessWithDll(
417+
hProcess: HANDLE,
418+
rlpDlls: *mut LPCSTR,
419+
nDlls: DWORD,
420+
) -> BOOL;
406421
}
407422
unsafe extern "system" {
408423
pub fn DetourUpdateProcessWithDllEx(
@@ -439,5 +454,10 @@ unsafe extern "system" {
439454
pub fn DetourIsHelperProcess() -> BOOL;
440455
}
441456
unsafe extern "system" {
442-
pub fn DetourFinishHelperProcess(arg1: HWND, arg2: HINSTANCE, arg3: LPSTR, arg4: INT);
457+
pub fn DetourFinishHelperProcess(
458+
arg1: HWND,
459+
arg2: HINSTANCE,
460+
arg3: LPSTR,
461+
arg4: INT,
462+
);
443463
}

crates/fspy_preload_unix/src/macros/linux.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ macro_rules! intercept_inner {
6262
}
6363
};
6464
mod $name {
65-
#[allow(unused)]
65+
#[expect(clippy::allow_attributes, reason = "using allow because unused_imports may or may not fire depending on macro expansion")]
66+
#[allow(unused_imports, reason = "glob import brings types into scope for macro-generated code")]
6667
use super::*;
6768
pub unsafe fn original() -> $fn_sig {
6869
static LAZY: std::sync::LazyLock<$fn_sig> = std::sync::LazyLock::new(|| unsafe {

0 commit comments

Comments
 (0)