Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Migrate from winapi to windows-rs (#3050)
Browse files Browse the repository at this point in the history
`windows-rs` is the newer, Microsoft-supported version of the API bindings; `winapi` hasn't been updated in some time. This allows us to remove some code, as `windows-rs` includes the `Sym*` functions that we had to previously defined ourselves in `dbghelp`.

Rather than port the `jobs` and `com` code I removed it, as it was unused.

The `check_hr` and `check_winapi` macros have been replaced by use of `.ok()?` on `BOOL` and `?` on `HRESULT` which now support standard error handling facilities.
  • Loading branch information
Porges authored Aug 8, 2023
1 parent 3851ab0 commit 58447f7
Show file tree
Hide file tree
Showing 40 changed files with 694 additions and 1,945 deletions.
5 changes: 3 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto
*.ps1 text=crlf
* text=auto
*.ps1 text eol=crlf
*.sh text eol=lf
13 changes: 7 additions & 6 deletions src/agent/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 3 additions & 17 deletions src/agent/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
win-util = { path = "../win-util" }

[dependencies.winapi]
version = "0.3"
features = [
"dbghelp",
"debugapi",
"handleapi",
"impl-default",
"memoryapi",
"namedpipeapi",
"processthreadsapi",
"securitybaseapi",
"shellapi",
"synchapi",
"werapi",
"winbase",
"winerror",
]
[dependencies.windows]
version = "0.48"

2 changes: 1 addition & 1 deletion src/agent/debugger/src/breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{

use anyhow::Result;
use win_util::process;
use winapi::um::winnt::HANDLE;
use windows::Win32::Foundation::HANDLE;

use crate::debugger::{BreakpointId, BreakpointType};

Expand Down
Loading

0 comments on commit 58447f7

Please sign in to comment.