Skip to content

Commit

Permalink
fix api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Jan 2, 2025
1 parent 0171f0b commit 599d318
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/packet_sources/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ impl PacketSourceConf for WindowsConf {
};

if cfg!(debug_assertions) {
if result.0 <= 32 {
if result.0 as u32 <= 32 {
let err = windows::core::Error::from_win32();
log::warn!("Failed to start child process: {}", err);
}
} else if result.0 == SE_ERR_ACCESSDENIED as isize {
} else if result.0 as u32 == SE_ERR_ACCESSDENIED {
return Err(anyhow!(
"Failed to start the interception process as administrator."
));
} else if result.0 <= 32 {
} else if result.0 as u32 <= 32 {
let err = windows::core::Error::from_win32();
return Err(anyhow!("Failed to start the executable: {}", err));
}
Expand Down
6 changes: 3 additions & 3 deletions src/processes/windows_icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ unsafe fn icon_to_pixels(icon: HICON) -> PixelData {
let buf_size = width_usize.checked_mul(height_usize).unwrap();
let mut buf: Vec<u32> = Vec::with_capacity(buf_size);

let dc = GetDC(HWND(0));
assert!(dc != HDC(0));
let dc = GetDC(HWND(std::ptr::null_mut()));
assert!(dc != HDC(std::ptr::null_mut()));

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

let result = ReleaseDC(HWND(0), dc);
let result = ReleaseDC(HWND(std::ptr::null_mut()), dc);
assert!(result == 1);
DeleteObject(info.hbmColor).unwrap();

Expand Down

0 comments on commit 599d318

Please sign in to comment.