28#define BUFFER_SIZE 0x1000
73 , m_fRecursive(fSubTree)
74 , m_dir_list(pszDirectoryPath, fSubTree)
76 TRACE(
"CDirectoryWatcher::CDirectoryWatcher: %p, '%S'\n",
this, pszDirectoryPath);
97 ERR(
"CreateFileW failed\n");
98 delete pDirectoryWatcher;
99 pDirectoryWatcher =
NULL;
101 return pDirectoryWatcher;
139 DWORD dwEvent, cbName;
141 TRACE(
"CDirectoryWatcher::ProcessNotification: enter\n");
151 ERR(
"pInfo->FileName is longer than szName\n");
233 TRACE(
"CDirectoryWatcher::ProcessNotification: leave\n");
242 ERR(
"ERROR_INVALID_FUNCTION\n");
250 TRACE(
"ERROR_OPERATION_ABORTED\n");
265 if (dwNumberOfBytesTransfered == 0)
283 DWORD dwNumberOfBytesTransfered,
292 pDirectoryWatcher->
ReadCompletion(dwErrorCode, dwNumberOfBytesTransfered);
328 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 *)
static TCHAR szTempPath[MAX_PATH]
#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)
BOOL RequestTermination()
void ReadCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfered)
static CDirectoryWatcher * Create(LPCWSTR pszDirectoryPath, BOOL fSubTree)
CDirectoryWatcher(LPCWSTR pszDirectoryPath, BOOL fSubTree)
static void RequestAllWatchersTermination()
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 PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
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 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
#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