From b57e45907db55a52c55cad6830827c32540a3bc0 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Thu, 15 Aug 2024 15:45:48 +0300 Subject: [PATCH] fix: fix compilation --- crates/nsis-process/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nsis-process/src/lib.rs b/crates/nsis-process/src/lib.rs index 6293519..52e5a8e 100644 --- a/crates/nsis-process/src/lib.rs +++ b/crates/nsis-process/src/lib.rs @@ -161,7 +161,7 @@ unsafe fn get_sid(pid: u32) -> Option<*mut c_void> { return None; } - let mut token_handle = OwnedHandle::new(HANDLE::default()); + let mut token_handle = OwnedHandle::new(ptr::null_mut()); if OpenProcessToken(*handle, TOKEN_QUERY, &mut *token_handle) == FALSE { return None; } @@ -226,7 +226,7 @@ fn get_processes(name: &str) -> Vec { /// Ported from https://devblogs.microsoft.com/oldnewthing/20190425-00/?p=102443 unsafe fn run_as_user(program: &str, arguments: &str) -> bool { let hwnd = GetShellWindow(); - if hwnd == 0 { + if hwnd.is_null() { return false; } @@ -309,7 +309,7 @@ impl OwnedHandle { } fn is_invalid(&self) -> bool { - self.0 == 0 + self.0.is_null() } }