28#define BUFFER_SIZE 0x1000
72 : m_hNotifyWnd(hNotifyWnd)
74 , m_fRecursive(fSubTree)
75 , m_dir_list(pszDirectoryPath, fSubTree)
77 TRACE(
"%p, '%S'\n",
this, pszDirectoryPath);
96 ERR(
"CreateFileW failed\n");
97 delete pDirectoryWatcher;
98 pDirectoryWatcher =
NULL;
100 return pDirectoryWatcher;
138 DWORD dwEvent, cbName;
140 TRACE(
"CDirectoryWatcher::ProcessNotification: enter\n");
150 ERR(
"pInfo->FileName is longer than szName\n");
232 TRACE(
"CDirectoryWatcher::ProcessNotification: leave\n");
241 ERR(
"ERROR_INVALID_FUNCTION\n");
249 TRACE(
"ERROR_OPERATION_ABORTED\n");
264 if (dwNumberOfBytesTransfered == 0)
282 DWORD dwNumberOfBytesTransfered,
291 pDirectoryWatcher->
ReadCompletion(dwErrorCode, dwNumberOfBytesTransfered);
327 ERR(
"ReadDirectoryChangesW for '%S' failed (error: %ld)\n",
static void NotifyFileSystemChange(LONG wEventId, LPCWSTR path1, LPCWSTR path2)
static void NTAPI _RequestAllTerminationAPC(ULONG_PTR Parameter)
static DWORD GetFilterFromEvents(DWORD fEvents)
static BOOL s_fTerminateAllWatchers
static BYTE s_buffer[BUFFER_SIZE]
static void NTAPI _AddDirectoryProcAPC(ULONG_PTR Parameter)
static void CALLBACK _NotificationCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
static void NTAPI _RequestTerminationAPC(ULONG_PTR Parameter)
static DWORD ConvertActionToEvent(DWORD Action, BOOL fDir)
static HANDLE s_hThreadAPC
static unsigned __stdcall DirectoryWatcherThreadFuncAPC(void *)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
BOOL AddPath(LPCWSTR pszPath)
BOOL ContainsPath(LPCWSTR pszPath) const
BOOL DeletePath(LPCWSTR pszPath)
BOOL RenamePath(LPCWSTR pszPath1, LPCWSTR pszPath2)
static CDirectoryWatcher * Create(HWND hNotifyWnd, LPCWSTR pszDirectoryPath, BOOL fSubTree)
BOOL RequestTermination()
void ReadCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered)
static void RequestAllWatchersTermination()
CDirectoryWatcher(HWND hNotifyWnd, LPCWSTR pszDirectoryPath, BOOL fSubTree)
void ProcessNotification()
WCHAR m_szDirectoryPath[MAX_PATH]
CDirectoryList m_dir_list
BOOL WINAPI ReadDirectoryChangesW(IN HANDLE hDirectory, IN LPVOID lpBuffer OPTIONAL, IN DWORD nBufferLength, IN BOOL bWatchSubtree, IN DWORD dwNotifyFilter, OUT LPDWORD lpBytesReturned, IN LPOVERLAPPED lpOverlapped OPTIONAL, IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
#define ERROR_INVALID_FUNCTION
BOOL WINAPI CancelIo(IN HANDLE hFile)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
#define FILE_FLAG_OVERLAPPED
#define FILE_FLAG_BACKUP_SEMANTICS
static char szTempPath[MAX_PATH]
static const WCHAR path1[]
static const WCHAR path2[]
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
#define FILE_LIST_DIRECTORY
#define FILE_SHARE_DELETE
static const WCHAR szName[]
_CRTIMP uintptr_t __cdecl _beginthreadex(_In_opt_ void *_Security, _In_ unsigned _StackSize, _In_ unsigned(__stdcall *_StartAddress)(void *), _In_opt_ void *_ArgList, _In_ unsigned _InitFlag, _Out_opt_ unsigned *_ThrdAddr)
#define SHCNE_RENAMEFOLDER
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define ERROR_OPERATION_ABORTED
struct _FILE_NOTIFY_INFORMATION * PFILE_NOTIFY_INFORMATION
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define FILE_NOTIFY_CHANGE_SIZE
#define FILE_ACTION_MODIFIED
#define FILE_ACTION_RENAMED_OLD_NAME
#define FILE_ACTION_REMOVED
#define FILE_NOTIFY_CHANGE_FILE_NAME
#define FILE_ACTION_RENAMED_NEW_NAME
#define FILE_NOTIFY_CHANGE_CREATION
#define FILE_ACTION_ADDED
#define FILE_NOTIFY_CHANGE_DIR_NAME
_Inout_opt_ PVOID Parameter