[PATCH 0/3] MR10189: kernel32, ntdll: Fix some test failures related to NtQueryDirectoryFile().
From: Elizabeth Figura <zfigura@codeweavers.com> This reverts commit 1660edb3e6e7d4ef70701e35385bb89b8c902076. On Windows these fields are either uninitialized (for W variants) or filled with garbage (for A variants, probably because internally Windows is calling the W variant with an uninitialized stack.) EA size isn't returned, but we have no way to reliably test that. This fixes test failures spotted by Rémi Bernon. --- dlls/kernel32/tests/file.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index aa3f25910bd..d66ab2efe66 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2740,12 +2740,8 @@ static void test_FindFirstFileA(void) int err; char buffer[5] = "C:\\"; char buffer2[100]; - FILE_FULL_EA_INFORMATION *ea_info = (void *)buffer2; - char nonexistent[MAX_PATH], temp[MAX_PATH]; - IO_STATUS_BLOCK io; + char nonexistent[MAX_PATH]; BOOL found = FALSE; - NTSTATUS status; - BOOL ret; /* try FindFirstFileA on "C:\" */ buffer[0] = get_windows_drive(); @@ -2935,33 +2931,6 @@ static void test_FindFirstFileA(void) err = GetLastError(); ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); - - /* Test a file with EA. */ - GetTempPathA(ARRAY_SIZE(temp), temp); - strcat(temp, "winetest_ea"); - handle = CreateFileA(temp, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, 0, 0); - ok(handle != INVALID_HANDLE_VALUE, "failed to create %s, error %lu\n", - debugstr_a(temp), GetLastError()); - - ea_info->NextEntryOffset = 0; - ea_info->Flags = 0; - ea_info->EaNameLength = 3; - ea_info->EaValueLength = 3; - strcpy(ea_info->EaName, "foo"); - strcpy(ea_info->EaName + 4, "bar"); - status = NtSetEaFile(handle, &io, ea_info, offsetof(FILE_FULL_EA_INFORMATION, EaName[8])); - todo_wine ok(!status, "got %#lx\n", status); - CloseHandle(handle); - - handle = FindFirstFileA(temp, &data); - ok(handle != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); - ok((data.dwFileAttributes & ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) == FILE_ATTRIBUTE_ARCHIVE, - "got attributes %#lx\n", data.dwFileAttributes); - ok(!data.dwReserved0, "got reserved0 %#lx\n", data.dwReserved0); - FindClose(handle); - - ret = DeleteFileA(temp); - ok(ret == TRUE, "got error %lu\n", GetLastError()); } static void test_FindNextFileA(void) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10189
From: Elizabeth Figura <zfigura@codeweavers.com> These are actually initialized, at least for reparse points. --- dlls/kernelbase/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 57bfe7fe871..c206e2f9cc2 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -1229,6 +1229,8 @@ HANDLE WINAPI DECLSPEC_HOTPATCH FindFirstFileExA( const char *filename, FINDEX_I dataA->ftLastWriteTime = dataW.ftLastWriteTime; dataA->nFileSizeHigh = dataW.nFileSizeHigh; dataA->nFileSizeLow = dataW.nFileSizeLow; + dataA->dwReserved0 = dataW.dwReserved0; + dataA->dwReserved1 = dataW.dwReserved1; file_name_WtoA( dataW.cFileName, -1, dataA->cFileName, sizeof(dataA->cFileName) ); file_name_WtoA( dataW.cAlternateFileName, -1, dataA->cAlternateFileName, sizeof(dataA->cAlternateFileName) ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10189
From: Elizabeth Figura <zfigura@codeweavers.com> --- dlls/ntdll/tests/directory.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c index 9aadc48a0cf..4865ec5b0d0 100644 --- a/dlls/ntdll/tests/directory.c +++ b/dlls/ntdll/tests/directory.c @@ -1504,8 +1504,8 @@ static void test_info_classes(void) memset( &io, 0xcc, sizeof(io) ); ret = NtQueryDirectoryFile( file, NULL, NULL, NULL, &io, buffer, struct_size, tests[i].class, FALSE, NULL, TRUE ); - todo_wine ok( ret == STATUS_PENDING, "got %#lx\n", ret ); - ret = WaitForSingleObject( file, 100 ); + if (ret == STATUS_PENDING) + ret = WaitForSingleObject( file, 100 ); ok( !ret, "got %#lx\n", ret ); ok( !io.Status, "got %#lx\n", io.Status ); ok( io.Information == tests[i].size + sizeof(WCHAR), @@ -1514,8 +1514,8 @@ static void test_info_classes(void) memset( &io, 0xcc, sizeof(io) ); ret = NtQueryDirectoryFile( file, NULL, NULL, NULL, &io, buffer, tests[i].size * 2 + (6 * sizeof(WCHAR)), tests[i].class, FALSE, NULL, TRUE ); - todo_wine ok( ret == STATUS_PENDING, "got %#lx\n", ret ); - ret = WaitForSingleObject( file, 100 ); + if (ret == STATUS_PENDING) + ret = WaitForSingleObject( file, 100 ); ok( !ret, "got %#lx\n", ret ); ok( !io.Status, "got %#lx\n", io.Status ); /* all classes start with the same few fields; test them here */ @@ -1532,8 +1532,8 @@ static void test_info_classes(void) ret = NtQueryDirectoryFile( file, NULL, NULL, NULL, &io, buffer, tests[i].size * 2 + (6 * sizeof(WCHAR)), tests[i].class, FALSE, NULL, FALSE ); - todo_wine ok( ret == STATUS_PENDING, "got %#lx\n", ret ); - ret = WaitForSingleObject( file, 100 ); + if (ret == STATUS_PENDING) + ret = WaitForSingleObject( file, 100 ); ok( !ret, "got %#lx\n", ret ); ok( !io.Status, "got %#lx\n", io.Status ); @@ -1634,8 +1634,8 @@ static void test_info_classes(void) ret = NtQueryDirectoryFile( file, NULL, NULL, NULL, &io, buffer, tests[i].size * 2 + (6 * sizeof(WCHAR)), tests[i].class, FALSE, NULL, FALSE ); - todo_wine ok( ret == STATUS_PENDING, "got %#lx\n", ret ); - ret = WaitForSingleObject( file, 100 ); + if (ret == STATUS_PENDING) + ret = WaitForSingleObject( file, 100 ); ok( !ret, "got %#lx\n", ret ); ok( !io.Status, "got %#lx\n", io.Status ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10189
participants (2)
-
Elizabeth Figura -
Elizabeth Figura (@zfigura)