1212using Windows . ApplicationModel . Activation ;
1313using Windows . Storage ;
1414using static Files . App . Helpers . Win32PInvoke ;
15+ using Windows . Win32 . Security ;
1516
1617namespace Files . App
1718{
@@ -252,19 +253,19 @@ private static async void OnActivated(object? sender, AppActivationArguments arg
252253 /// </remarks>
253254 public static unsafe void RedirectActivationTo ( AppInstance keyInstance , AppActivationArguments args )
254255 {
255- HANDLE eventHandle = PInvoke . CreateEvent ( bManualReset : true , bInitialState : false , lpName : null ) ;
256+ HANDLE hEventHandle = PInvoke . CreateEvent ( ( SECURITY_ATTRIBUTES * ) null , true , false , null ) ;
256257
257258 Task . Run ( ( ) =>
258259 {
259260 keyInstance . RedirectActivationToAsync ( args ) . AsTask ( ) . Wait ( ) ;
260- PInvoke . SetEvent ( eventHandle ) ;
261+ PInvoke . SetEvent ( hEventHandle ) ;
261262 } ) ;
262263
263264 _ = Win32PInvoke . CoWaitForMultipleObjects (
264265 CWMO_DEFAULT ,
265266 INFINITE ,
266267 1 ,
267- [ eventHandle ] ,
268+ [ hEventHandle ] ,
268269 out uint handleIndex ) ;
269270 }
270271
@@ -275,19 +276,19 @@ public static void OpenShellCommandInExplorer(string shellCommand, int pid)
275276
276277 public static unsafe void OpenFileFromTile ( string filePath )
277278 {
278- HANDLE eventHandle = PInvoke . CreateEvent ( bManualReset : true , bInitialState : false , lpName : null ) ;
279+ HANDLE hEventHandle = PInvoke . CreateEvent ( ( SECURITY_ATTRIBUTES * ) null , true , false , null ) ;
279280
280281 Task . Run ( ( ) =>
281282 {
282283 LaunchHelper . LaunchAppAsync ( filePath , null , null ) . Wait ( ) ;
283- PInvoke . SetEvent ( eventHandle ) ;
284+ PInvoke . SetEvent ( hEventHandle ) ;
284285 } ) ;
285286
286287 _ = CoWaitForMultipleObjects (
287288 CWMO_DEFAULT ,
288289 INFINITE ,
289290 1 ,
290- [ eventHandle ] ,
291+ [ hEventHandle ] ,
291292 out uint handleIndex ) ;
292293 }
293294 }
0 commit comments