-- v2: ntdll: Skip FileRenameInformationEx tests on older Windows versions. ntdll: Skip FileRenameInformationEx tests on older Windows versions.
From: Joel Holdsworth joel@airwebreathe.org.uk
Test failures were introduced in 67479f8c2fc03c2043b8414bc063e671e36fdbda, and affect Windows 10 1607 and older.
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=55631 Signed-off-by: Joel Holdsworth joel@airwebreathe.org.uk --- dlls/ntdll/tests/file.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index fc7a6e82059..6822f95c3de 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1527,6 +1527,24 @@ static void test_file_rename_information(FILE_INFORMATION_CLASS class)
GetTempPathW( MAX_PATH, tmp_path );
+ /* check if class is implemented */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + memset( &fri, 0x11, sizeof(fri) ); + res = pNtQueryInformationFile( handle, &io, &fri, sizeof(fri), class ); + + CloseHandle( handle ); + delete_object( oldpath ); + + if (class == FileRenameInformationEx && (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_INFO_CLASS)) + { + todo_wine win_skip( "FileRenameInformationEx not supported\n" ); + return; + } + /* oldpath is a file, newpath doesn't exist */ res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); ok( res != 0, "failed to create temp file\n" );
From: Joel Holdsworth joel@airwebreathe.org.uk
Test failures were introduced in 67479f8c2fc03c2043b8414bc063e671e36fdbda, and affect Windows 10 1607 and older.
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=55631 Signed-off-by: Joel Holdsworth joel@airwebreathe.org.uk --- dlls/ntdll/tests/file.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 6822f95c3de..78474662ebb 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -2244,6 +2244,24 @@ static void test_file_link_information(FILE_INFORMATION_CLASS class)
GetTempPathW( MAX_PATH, tmp_path );
+ /* check if class is implemented */ + res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); + ok( res != 0, "failed to create temp file\n" ); + handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" ); + + memset( &fli, 0x11, sizeof(fli) ); + res = pNtQueryInformationFile( handle, &io, &fli, sizeof(fli), class ); + + CloseHandle( handle ); + delete_object( oldpath ); + + if (class == FileLinkInformationEx && (res == STATUS_NOT_IMPLEMENTED || res == STATUS_INVALID_INFO_CLASS)) + { + todo_wine win_skip( "FileLinkInformationEx not supported\n" ); + return; + } + /* oldpath is a file, newpath doesn't exist */ res = GetTempFileNameW( tmp_path, fooW, 0, oldpath ); ok( res != 0, "failed to create temp file\n" );
On Mon Sep 25 10:53:39 2023 +0000, Alexandre Julliard wrote:
If the Ex class is not supported you should skip the whole thing, there's no point in running the tests.
Fair point. Submitted a solution that probes the API with a introductory test dest similar to `test_file_id_information`
Alexandre Julliard (@julliard) commented about dlls/ntdll/tests/file.c:
GetTempPathW( MAX_PATH, tmp_path );
- /* check if class is implemented */
- res = GetTempFileNameW( tmp_path, fooW, 0, oldpath );
- ok( res != 0, "failed to create temp file\n" );
- handle = CreateFileW( oldpath, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 );
- ok( handle != INVALID_HANDLE_VALUE, "CreateFileW failed\n" );
- memset( &fri, 0x11, sizeof(fri) );
- res = pNtQueryInformationFile( handle, &io, &fri, sizeof(fri), class );
Using the pointer itself as storage doesn't make much sense. Also it's not clear what querying it is supposed to do.
I'd suggest to simply check for invalid class failure on the first real test instead of adding some strange pre-check.