diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index dd64c910d4a..61ef8af2b40 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -4650,6 +4650,30 @@ todo_wine CloseHandle(file); } +static void test_GetFileAttributesExW(void) +{ + static const WCHAR path1[] = {'\\','\\','?','\\',0}; + static const WCHAR path2[] = {'\\','?','?','\\',0}; + static const WCHAR path3[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; + WIN32_FILE_ATTRIBUTE_DATA info; + BOOL ret; + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path1, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path2, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path3, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected error ERROR_FILE_NOT_FOUND, got %u\n", GetLastError()); +} + START_TEST(file) { InitFunctionPointers(); @@ -4706,4 +4730,5 @@ START_TEST(file) test_GetFinalPathNameByHandleA(); test_GetFinalPathNameByHandleW(); test_SetFileInformationByHandle(); + test_GetFileAttributesExW(); }