Skip to content

Commit f733a5f

Browse files
committed
Revert changes to WatchForGitChanges()
1 parent 9937cb3 commit f733a5f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Files.App/Helpers/Win32/Win32PInvoke.Methods.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public static extern int RmGetList(
5555
[In, Out] RM_PROCESS_INFO[] rgAffectedApps,
5656
ref uint lpdwRebootReasons
5757
);
58-
5958
[DllImport("ole32.dll")]
6059
public static extern uint CoWaitForMultipleObjects(
6160
uint dwFlags,

src/Files.App/ViewModels/ShellViewModel.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Runtime.CompilerServices;
1515
using System.Runtime.InteropServices;
1616
using Vanara.Windows.Shell;
17-
using Windows.Win32;
1817
using Windows.Foundation;
1918
using Windows.Storage;
2019
using Windows.Storage.FileProperties;
@@ -2125,7 +2124,7 @@ private void WatchForDirectoryChanges(string path, CloudDriveSyncStatus syncStat
21252124
notifyFilters |= FILE_NOTIFY_CHANGE_ATTRIBUTES;
21262125

21272126
var overlapped = new OVERLAPPED();
2128-
overlapped.hEvent = PInvoke.CreateEvent(null, false, false, null).DangerousGetHandle();
2127+
overlapped.hEvent = CreateEvent(IntPtr.Zero, false, false, null);
21292128
const uint INFINITE = 0xFFFFFFFF;
21302129

21312130
while (x.Status != AsyncStatus.Canceled)
@@ -2236,7 +2235,7 @@ private void WatchForGitChanges()
22362235
var notifyFilters = FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_CREATION;
22372236

22382237
var overlapped = new OVERLAPPED();
2239-
overlapped.hEvent = PInvoke.CreateEvent(null, false, false, null).DangerousGetHandle();
2238+
overlapped.hEvent = CreateEvent(IntPtr.Zero, false, false, null);
22402239
const uint INFINITE = 0xFFFFFFFF;
22412240

22422241
while (x.Status != AsyncStatus.Canceled)

0 commit comments

Comments
 (0)