1212using Windows . ApplicationModel . Activation ;
1313using Windows . Storage ;
1414using static Files . App . Helpers . Win32PInvoke ;
15- using Microsoft . Win32 . SafeHandles ;
1615
1716namespace Files . App
1817{
@@ -253,7 +252,7 @@ private static async void OnActivated(object? sender, AppActivationArguments arg
253252 /// </remarks>
254253 public static void RedirectActivationTo ( AppInstance keyInstance , AppActivationArguments args )
255254 {
256- SafeFileHandle eventHandle = PInvoke . CreateEvent ( null , true , false , null ) ;
255+ HANDLE eventHandle = ( HANDLE ) PInvoke . CreateEvent ( null , true , false , null ) . DangerousGetHandle ( ) ;
257256
258257 Task . Run ( ( ) =>
259258 {
@@ -265,7 +264,7 @@ public static void RedirectActivationTo(AppInstance keyInstance, AppActivationAr
265264 CWMO_DEFAULT ,
266265 INFINITE ,
267266 1 ,
268- [ eventHandle . DangerousGetHandle ( ) ] ,
267+ [ eventHandle ] ,
269268 out uint handleIndex ) ;
270269 }
271270
@@ -276,7 +275,7 @@ public static void OpenShellCommandInExplorer(string shellCommand, int pid)
276275
277276 public static void OpenFileFromTile ( string filePath )
278277 {
279- SafeFileHandle eventHandle = PInvoke . CreateEvent ( null , true , false , null ) ;
278+ HANDLE eventHandle = ( HANDLE ) PInvoke . CreateEvent ( null , true , false , null ) . DangerousGetHandle ( ) ;
280279
281280 Task . Run ( ( ) =>
282281 {
@@ -288,7 +287,7 @@ public static void OpenFileFromTile(string filePath)
288287 CWMO_DEFAULT ,
289288 INFINITE ,
290289 1 ,
291- [ eventHandle . DangerousGetHandle ( ) ] ,
290+ [ eventHandle ] ,
292291 out uint handleIndex ) ;
293292 }
294293 }
0 commit comments