diff --git a/opener/Cargo.toml b/opener/Cargo.toml index e33be09..c932e59 100644 --- a/opener/Cargo.toml +++ b/opener/Cargo.toml @@ -25,7 +25,7 @@ url = { version = "2", optional = true } [target.'cfg(windows)'.dependencies] normpath = "1" -windows-sys = { version = "0.52", features = [ +windows-sys = { version = "0.59", features = [ "Win32_Foundation", "Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", diff --git a/opener/src/windows.rs b/opener/src/windows.rs index 7d50fc1..d74a0c0 100644 --- a/opener/src/windows.rs +++ b/opener/src/windows.rs @@ -31,7 +31,7 @@ pub(crate) fn open_helper(path: &OsStr) -> Result<(), OpenError> { let operation: Vec = OsStr::new("open\0").encode_wide().collect(); let result = unsafe { ShellExecuteW( - 0, + ptr::null_mut(), operation.as_ptr(), path.as_ptr(), ptr::null(), @@ -39,7 +39,7 @@ pub(crate) fn open_helper(path: &OsStr) -> Result<(), OpenError> { SW_SHOW, ) }; - if result > 32 { + if result as usize as isize > 32 { Ok(()) } else { Err(OpenError::Io(io::Error::last_os_error()))