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

Commit 58447f7

Browse files
authored
Migrate from winapi to windows-rs (#3050)
`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.
1 parent 3851ab0 commit 58447f7

40 files changed

+694
-1945
lines changed

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
* text=auto
2-
*.ps1 text=crlf
1+
* text=auto
2+
*.ps1 text eol=crlf
3+
*.sh text eol=lf

src/agent/Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent/debugger/Cargo.toml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ rand = "0.8"
1616
serde = { version = "1.0", features = ["derive"] }
1717
win-util = { path = "../win-util" }
1818

19-
[dependencies.winapi]
20-
version = "0.3"
21-
features = [
22-
"dbghelp",
23-
"debugapi",
24-
"handleapi",
25-
"impl-default",
26-
"memoryapi",
27-
"namedpipeapi",
28-
"processthreadsapi",
29-
"securitybaseapi",
30-
"shellapi",
31-
"synchapi",
32-
"werapi",
33-
"winbase",
34-
"winerror",
35-
]
19+
[dependencies.windows]
20+
version = "0.48"
21+

src/agent/debugger/src/breakpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88

99
use anyhow::Result;
1010
use win_util::process;
11-
use winapi::um::winnt::HANDLE;
11+
use windows::Win32::Foundation::HANDLE;
1212

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

0 commit comments

Comments
 (0)