Skip to content

chore: add in-house detours ffi bindings#207

Merged
branchseer merged 15 commits intomainfrom
09-28-chore_use_in-house_detours_ffi_bindings
Oct 3, 2025
Merged

chore: add in-house detours ffi bindings#207
branchseer merged 15 commits intomainfrom
09-28-chore_use_in-house_detours_ffi_bindings

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Sep 29, 2025

This PR replaces the external ms-detours crate with our own FFI bindings to Microsoft's Detours library. The implementation:

  • Adds Microsoft Detours as a git submodule
  • Creates a new fspy_detours_sys crate with raw FFI bindings
  • Compiles Detours from source using the cc crate
  • Updates all imports to use the new bindings
  • Includes a bindgen test to verify/regenerate bindings

This change improves built times and allows cross-compiling.

Copy link
Copy Markdown
Member Author

branchseer commented Sep 29, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer changed the title chore: use in-house detours ffi bindings chore: add in-house detours ffi bindings Sep 29, 2025
@branchseer branchseer force-pushed the 09-28-chore_use_in-house_detours_ffi_bindings branch from 4876d60 to 80b7f3c Compare September 29, 2025 08:32
@branchseer branchseer force-pushed the 09-28-chore_use_in-house_detours_ffi_bindings branch from c71422a to ffab252 Compare September 29, 2025 09:11
@branchseer branchseer marked this pull request as ready for review September 29, 2025 09:15
Copilot AI review requested due to automatic review settings September 29, 2025 09:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the external ms-detours crate with in-house FFI bindings to Microsoft's Detours library, improving build times and enabling cross-compilation.

  • Creates a new fspy_detours_sys crate with raw FFI bindings to Microsoft Detours
  • Adds Microsoft Detours as a git submodule and builds from source using the cc crate
  • Updates all existing imports to use the new in-house bindings instead of ms-detours

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/fspy_detours_sys/ New crate containing FFI bindings, build script, and generated bindings
crates/fspy_shared/Cargo.toml Removes ms-detours dependency and updates winapi to use workspace version
crates/fspy_preload_windows/ Updates imports from ms_detours to fspy_detours_sys and adds new dependency
crates/fspy/ Updates imports and dependency configuration for Windows
Cargo.toml Adds workspace dependencies for the new crate
.github/workflows/ Updates CI workflows to checkout git submodules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread crates/fspy_detours_sys/src/generated_bindings.rs Outdated
Comment thread crates/fspy_detours_sys/tests/bindings.rs Outdated
Comment thread crates/fspy_detours_sys/Cargo.toml Outdated
@branchseer branchseer force-pushed the 09-28-chore_use_in-house_detours_ffi_bindings branch from ffab252 to 75c1d3c Compare September 29, 2025 09:17
Copilot AI review requested due to automatic review settings September 29, 2025 09:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@branchseer branchseer force-pushed the 09-28-chore_use_in-house_detours_ffi_bindings branch from f90de79 to b8f3d04 Compare September 29, 2025 09:27
Copilot AI review requested due to automatic review settings September 29, 2025 09:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@branchseer branchseer merged commit 9e056b1 into main Oct 3, 2025
9 checks passed
Copy link
Copy Markdown
Member Author

Merge activity

@branchseer branchseer deleted the 09-28-chore_use_in-house_detours_ffi_bindings branch October 3, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants