Skip to content

Commit 045f463

Browse files
authored
Update windows dependency (mitmproxy#213)
1 parent 5ae11e5 commit 045f463

File tree

4 files changed

+76
-12
lines changed

4 files changed

+76
-12
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ smoltcp = { git = 'https://github.com/smoltcp-rs/smoltcp', rev = 'ef67e7b46cabf4
7676
boringtun = { git = 'https://github.com/cloudflare/boringtun', rev = 'e3252d9c4f4c8fc628995330f45369effd4660a1' }
7777

7878
[target.'cfg(windows)'.dependencies.windows]
79-
version = "0.57.0"
79+
version = "0.58.0"
8080
features = [
8181
"Win32_Foundation",
8282
"Win32_Graphics_Dwm",

src/packet_sources/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ impl PacketSourceConf for WindowsConf {
7979
};
8080

8181
if cfg!(debug_assertions) {
82-
if result.0 <= 32 {
82+
if result.0 as u32 <= 32 {
8383
let err = windows::core::Error::from_win32();
8484
log::warn!("Failed to start child process: {}", err);
8585
}
86-
} else if result.0 == SE_ERR_ACCESSDENIED as isize {
86+
} else if result.0 as u32 == SE_ERR_ACCESSDENIED {
8787
return Err(anyhow!(
8888
"Failed to start the interception process as administrator."
8989
));
90-
} else if result.0 <= 32 {
90+
} else if result.0 as u32 <= 32 {
9191
let err = windows::core::Error::from_win32();
9292
return Err(anyhow!("Failed to start the executable: {}", err));
9393
}

src/processes/windows_icons.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ unsafe fn icon_to_pixels(icon: HICON) -> PixelData {
134134
let buf_size = width_usize.checked_mul(height_usize).unwrap();
135135
let mut buf: Vec<u32> = Vec::with_capacity(buf_size);
136136

137-
let dc = GetDC(HWND(0));
138-
assert!(dc != HDC(0));
137+
let dc = GetDC(HWND(std::ptr::null_mut()));
138+
assert!(dc != HDC(std::ptr::null_mut()));
139139

140140
let mut bitmap_info = BITMAPINFOHEADER {
141141
biSize: biheader_size_u32,
@@ -162,7 +162,7 @@ unsafe fn icon_to_pixels(icon: HICON) -> PixelData {
162162
assert!(result == bitmap.bmHeight);
163163
buf.set_len(buf.capacity());
164164

165-
let result = ReleaseDC(HWND(0), dc);
165+
let result = ReleaseDC(HWND(std::ptr::null_mut()), dc);
166166
assert!(result == 1);
167167
DeleteObject(info.hbmColor).unwrap();
168168

0 commit comments

Comments
 (0)