33 #define WIN32_NO_STATUS 54 ok(
ret,
"FindCloseChangeNotification error: %d\n",
95 static const char prefix[] =
"FCN";
104 "FindFirstChangeNotification error: %d\n",
GetLastError());
110 "FindFirstChangeNotification error: %d\n",
GetLastError());
142 "FindFirstChangeNotification error: %d\n",
GetLastError());
260 static const WCHAR szBoo[] = {
'\\',
'b',
'o',
'o',0 };
261 static const WCHAR szHoo[] = {
'\\',
'h',
'o',
'o',0 };
267 win_skip(
"GetTempPathW is not implemented\n");
270 ok(
r != 0,
"temp path failed\n");
282 ok(
r ==
TRUE,
"failed to create directory\n");
294 ok(
r ==
TRUE,
"failed to create subdir\n");
303 ok(
r ==
TRUE,
"find next failed\n");
309 ok(
r ==
TRUE,
"failed to remove subdir\n");
318 ok(
r ==
TRUE,
"find next failed\n");
321 ok(
r ==
TRUE,
"find next failed\n");
324 ok(
r ==
TRUE,
"should succeed\n");
327 ok(
r ==
TRUE,
"failed to remove dir\n");
369 ok(
r ==
TRUE,
"failed to remove dir\n");
382 static const WCHAR szBoo[] = {
'\\',
'b',
'o',
'o',0 };
383 static const WCHAR szHoo[] = {
'\\',
'h',
'o',
'o',0 };
384 static const WCHAR szGa[] = {
'\\',
'h',
'o',
'o',
'\\',
'g',
'a',0 };
388 if (!pReadDirectoryChangesW)
390 win_skip(
"ReadDirectoryChangesW is not available\n");
398 win_skip(
"GetTempPathW is not implemented\n");
401 ok(
r != 0,
"temp path failed\n");
417 ok(
r ==
TRUE,
"failed to create directory\n");
422 ok(
r==
FALSE,
"should return false\n");
435 ok(
r==
FALSE,
"should return false\n");
440 ok(
r==
FALSE,
"should return false\n");
458 ok(
r==
FALSE,
"should return false\n");
462 ok(
r==
FALSE,
"should return false\n");
465 ok(
r==
TRUE,
"should return true\n");
471 ok(
r ==
TRUE,
"failed to create directory\n");
489 ok(
r==
FALSE,
"should return false\n");
493 ok(
r==
FALSE,
"should return false\n");
501 S(
U(ov)).OffsetHigh = 0;
504 ok(
r==
TRUE,
"should return true\n");
513 ok(
r ==
TRUE,
"failed to remove directory\n");
524 ok(
r ==
TRUE,
"getoverlappedresult failed\n");
525 ok( dwCount == 0x12,
"count wrong\n");
536 ok(
r==
TRUE,
"should return true\n");
539 ok(
r ==
TRUE,
"failed to create directory\n");
549 ok(
r==
TRUE,
"should return true\n");
552 ok(
r ==
TRUE,
"failed to create directory\n");
576 got_subdir_change =
TRUE;
582 if (got_subdir_change)
break;
585 ok(
r==
TRUE,
"should return true\n");
587 ok(got_subdir_change,
"didn't get subdir change\n");
590 ok(
r ==
TRUE,
"failed to remove directory\n");
595 ok(
r==
TRUE,
"should return true\n");
598 ok(
r ==
TRUE,
"failed to remove directory\n");
623 ok(
r ==
TRUE,
"failed to remove directory\n");
635 static const WCHAR szBoo[] = {
'\\',
'b',
'o',
'o',0 };
636 static const WCHAR szHoo[] = {
'\\',
'h',
'o',
'o',0 };
639 if (!pReadDirectoryChangesW)
641 win_skip(
"ReadDirectoryChangesW is not available\n");
648 win_skip(
"GetTempPathW is not implemented\n");
651 ok(
r != 0,
"temp path failed\n");
663 ok(
r ==
TRUE,
"failed to create directory\n");
682 ok(
r==
TRUE,
"should return true\n");
688 ok(
r ==
TRUE,
"failed to create directory\n");
699 S(
U(ov)).OffsetHigh = 0;
703 ok(
r==
TRUE,
"should return true\n");
709 ok(
r ==
TRUE,
"failed to remove directory\n");
723 ok(
r ==
TRUE,
"failed to remove directory\n");
734 static const WCHAR szBoo[] = {
'\\',
'b',
'o',
'o',0 };
735 static const WCHAR szHoo[] = {
'\\',
'h',
'o',
'o',0 };
736 static const WCHAR szFoo[] = {
'\\',
'f',
'o',
'o',0 };
743 win_skip(
"GetTempPathW is not implemented\n");
746 ok(
r != 0,
"temp path failed\n");
762 ok(
r ==
TRUE,
"failed to create directory\n");
775 ok(
r==
TRUE,
"should return true\n");
781 ok(
r ==
TRUE,
"failed to create directory\n");
800 ok(
r ==
TRUE,
"failed to delete file\n");
803 ok(
r ==
TRUE,
"failed to remove directory\n");
808 ok(
r ==
TRUE,
"failed to remove directory\n");
813 ok(
error == 0,
"ReadDirectoryChangesW error %d\n",
error);
814 ok(ov->
hEvent == (
void*)0xdeadbeef,
"hEvent should not have changed\n");
819 static const WCHAR szBoo[] = {
'\\',
'b',
'o',
'o',
'\\',0 };
820 static const WCHAR szDir[] = {
'd',
'i',
'r',0 };
821 static const WCHAR szFile[] = {
'f',
'i',
'l',
'e',0 };
822 static const WCHAR szBackslash[] = {
'\\',0 };
830 if (!pReadDirectoryChangesW)
832 win_skip(
"ReadDirectoryChangesW is not available\n");
840 win_skip(
"GetTempPathW is not implemented\n");
843 ok(
r != 0,
"temp path failed\n");
861 ok(
r ==
TRUE,
"failed to create directory\n");
868 memset(&ov, 0,
sizeof(ov));
869 ov.
hEvent = (
void*)0xdeadbeef;
870 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
872 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
879 ok(
r != 0,
"failed to receive file creation event\n");
887 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
889 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
893 ok(
r ==
TRUE,
"failed to create directory\n");
896 ok(
r ==
TRUE,
"failed to move file\n");
899 ok(
r != 0,
"failed to receive file move event\n");
907 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
909 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
912 ok(
r ==
TRUE,
"failed to move file\n");
915 ok(
r != 0,
"failed to receive file move event\n");
923 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
925 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
928 ok(
r ==
TRUE,
"failed to delete file\n");
931 ok(
r != 0,
"failed to receive file removal event\n");
946 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
948 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
951 ok(
r ==
TRUE,
"failed to move directory\n");
954 ok(
r != 0,
"failed to receive directory move event\n");
964 ok(fni_next->
NextEntryOffset == 0,
"there should be no more events in buffer\n");
977 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
979 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
982 ok(
r != 0,
"failed to receive directory move event\n");
987 ok(
r ==
TRUE,
"failed to create directory\n");
990 ok(
r ==
TRUE,
"failed to remove directory\n");
992 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
994 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
997 ok(
r != 0,
"failed to receive directory creation event\n");
1007 r = pReadDirectoryChangesW(hdir, fni,
sizeof(fni),
FALSE,
1009 ok(
r ==
TRUE,
"pReadDirectoryChangesW failed\n");
1012 ok(
r != 0,
"failed to receive directory removal event\n");
1015 ok(fni_next->
NextEntryOffset == 0,
"there should be no more events in buffer\n");
1029 HANDLE parent_watch, child_watch, parent_thread, child_thread;
1068 ok(
ret,
"Missed parent notification\n");
1070 ok(
ret,
"Missed child notification\n");
1081 "FindFirstChangeNotification error: %d\n",
GetLastError());
1085 "FindFirstChangeNotification error: %d\n",
GetLastError());
1100 ok(
ret,
"Missed child notification\n");
static void test_FindFirstChangeNotification(void)
#define ERROR_INVALID_PARAMETER
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static struct object_header ** handles
#define FILE_ACTION_RENAMED_OLD_NAME
static void test_readdirectorychanges(void)
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
HANDLE WINAPI FindFirstChangeNotificationW(IN LPCWSTR lpPathName, IN BOOL bWatchSubtree, IN DWORD dwNotifyFilter)
GLdouble GLdouble GLdouble r
GLuint GLuint GLsizei count
#define ERROR_INVALID_HANDLE
static HINSTANCE hkernel32
BOOL WINAPI MoveFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
DWORD WINAPI GetLastError(VOID)
#define FILE_NOTIFY_CHANGE_SIZE
#define FILE_NOTIFY_CHANGE_LAST_WRITE
static void test_readdirectorychanges_filedir(void)
#define FILE_NOTIFY_CHANGE_FILE_NAME
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
#define FILE_NOTIFY_CHANGE_DIR_NAME
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI MoveFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
#define FILE_ACTION_MODIFIED
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
#define FILE_ACTION_REMOVED
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
VOID WINAPI ExitThread(IN DWORD uExitCode)
#define ERROR_FILE_NOT_FOUND
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
#define STATUS_NOTIFY_ENUM_DIR
#define ERROR_NO_MORE_FILES
#define FILE_NOTIFY_CHANGE_CREATION
static void test_ffcn(void)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
DWORD WINAPI SleepEx(IN DWORD dwMilliseconds, IN BOOL bAlertable)
#define FILE_LIST_DIRECTORY
static LPOVERLAPPED_COMPLETION_ROUTINE
static int notified[MAX_INTERNET_STATUS]
static void test_ffcn_directory_overlap(void)
static char workdir[MAX_PATH]
#define FILE_ATTRIBUTE_READONLY
BOOL WINAPI FindNextChangeNotification(IN HANDLE hChangeHandle)
BOOL WINAPI FindCloseChangeNotification(IN HANDLE hChangeHandle)
#define INVALID_FILE_ATTRIBUTES
static void test_readdirectorychanges_null(void)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
static DWORD FinishNotificationThread(HANDLE thread)
#define FILE_ATTRIBUTE_NORMAL
#define FILE_SHARE_DELETE
static DWORD CALLBACK NotificationThread(LPVOID arg)
#define FILE_ACTION_RENAMED_NEW_NAME
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
const char * wine_dbgstr_wn(const WCHAR *str, int n)
static HANDLE StartNotificationThread(LPCSTR path, BOOL subtree, DWORD flags)
static void test_readdirectorychanges_cr(void)
static void CALLBACK readdirectorychanges_cr(DWORD error, DWORD len, LPOVERLAPPED ov)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
#define FILE_NOTIFY_CHANGE_ATTRIBUTES
#define FILE_NOTIFY_CHANGE_SECURITY
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define FILE_ACTION_ADDED
#define FILE_FLAG_BACKUP_SEMANTICS
#define ERROR_CALL_NOT_IMPLEMENTED
#define GetProcAddress(x, y)
struct _FILE_NOTIFY_INFORMATION * PFILE_NOTIFY_INFORMATION
static void test_ffcnMultipleThreads(void)
#define ERROR_PATH_NOT_FOUND
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_FLAG_OVERLAPPED
#define FILE_NOTIFY_CHANGE_LAST_ACCESS
static SERVICE_STATUS status
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
HANDLE WINAPI FindFirstChangeNotificationA(IN LPCSTR lpPathName, IN BOOL bWatchSubtree, IN DWORD dwNotifyFilter)