File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ doc = false
1717name = " open"
1818
1919[target .'cfg(windows)' .dependencies ]
20- winapi = { version = " 0.3 " , features = [" shellapi " ] }
20+ windows-sys = { version = " 0.36 " , features = [" Win32_UI_Shell " , " Win32_Foundation " ] }
2121
2222[target .'cfg(all(unix, not(macos)))' .dependencies ]
2323pathdiff = " 0.2.0"
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ impl IntoResult<Result> for io::Result<Output> {
156156}
157157
158158#[ cfg( windows) ]
159- impl IntoResult < Result > for winapi :: ctypes :: c_int {
159+ impl IntoResult < Result > for std :: os :: raw :: c_int {
160160 fn into_result ( self ) -> Result {
161161 match self {
162162 i if i > 32 => Ok ( ( ) ) ,
@@ -214,8 +214,8 @@ impl CommandExt for Command {
214214mod windows {
215215 use std:: { ffi:: OsStr , io, os:: windows:: ffi:: OsStrExt , ptr} ;
216216
217- use winapi :: ctypes :: c_int;
218- use winapi :: um :: shellapi :: ShellExecuteW ;
217+ use std :: os :: raw :: c_int;
218+ use windows_sys :: Win32 :: UI :: Shell :: ShellExecuteW ;
219219
220220 use crate :: { IntoResult , Result } ;
221221
@@ -238,7 +238,7 @@ mod windows {
238238 let operation: Vec < u16 > = OsStr :: new ( "open\0 " ) . encode_wide ( ) . collect ( ) ;
239239 let result = unsafe {
240240 ShellExecuteW (
241- ptr :: null_mut ( ) ,
241+ 0 ,
242242 operation. as_ptr ( ) ,
243243 path. as_ptr ( ) ,
244244 ptr:: null ( ) ,
@@ -259,7 +259,7 @@ mod windows {
259259 . collect ( ) ;
260260 let result = unsafe {
261261 ShellExecuteW (
262- ptr :: null_mut ( ) ,
262+ 0 ,
263263 operation. as_ptr ( ) ,
264264 app_name. as_ptr ( ) ,
265265 path. as_ptr ( ) ,
You can’t perform that action at this time.
0 commit comments