[PATCH v2 0/3] MR2049: Ntdll tests
-- v2: ntdll/tests: Fix some Wow64 test failures on Windows 11. ntdll/tests: Fix path test failures on Windows 11. https://gitlab.winehq.org/wine/wine/-/merge_requests/2049
From: Hans Leidekker <hans(a)codeweavers.com> --- dlls/ntdll/tests/rtlstr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 2aebe1deda1..8988aadeac4 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -792,6 +792,7 @@ typedef struct { int res_buf_size; const char *res_buf; NTSTATUS result; + int broken_len; } ustr2astr_t; static const ustr2astr_t ustr2astr[] = { @@ -799,7 +800,7 @@ static const ustr2astr_t ustr2astr[] = { { 10, 12, 12, "------------", 12, 12, 12, "abcdef", TRUE, 6, 7, 7, "abcdef", STATUS_SUCCESS}, { 0, 2, 12, "------------", 12, 12, 12, "abcdef", TRUE, 6, 7, 7, "abcdef", STATUS_SUCCESS}, { 10, 12, 12, NULL, 12, 12, 12, "abcdef", TRUE, 6, 7, 7, "abcdef", STATUS_SUCCESS}, - { 0, 0, 12, "------------", 12, 12, 12, "abcdef", FALSE, 6, 0, 0, "", STATUS_BUFFER_OVERFLOW}, + { 0, 0, 12, "------------", 12, 12, 12, "abcdef", FALSE, 6, 0, 0, "", STATUS_BUFFER_OVERFLOW, 1}, { 0, 1, 12, "------------", 12, 12, 12, "abcdef", FALSE, 0, 1, 1, "", STATUS_BUFFER_OVERFLOW}, { 0, 2, 12, "------------", 12, 12, 12, "abcdef", FALSE, 1, 2, 2, "a", STATUS_BUFFER_OVERFLOW}, { 0, 3, 12, "------------", 12, 12, 12, "abcdef", FALSE, 2, 3, 3, "ab", STATUS_BUFFER_OVERFLOW}, @@ -849,7 +850,8 @@ static void test_RtlUnicodeStringToAnsiString(void) ok(result == ustr2astr[test_num].result, "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %lx, expected %lx\n", test_num, ustr2astr[test_num].doalloc, result, ustr2astr[test_num].result); - ok(ansi_str.Length == ustr2astr[test_num].res_Length, + ok(ansi_str.Length == ustr2astr[test_num].res_Length || + broken(ustr2astr[test_num].broken_len && !ansi_str.Length) /* win11 */, "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) ansi has Length %d, expected %d\n", test_num, ustr2astr[test_num].doalloc, ansi_str.Length, ustr2astr[test_num].res_Length); ok(ansi_str.MaximumLength == ustr2astr[test_num].res_MaximumLength, @@ -1523,6 +1525,7 @@ typedef struct { USHORT MaximumLength; const char *Buffer; NTSTATUS result; + int broken_len; } int2str_t; static const int2str_t int2str[] = { @@ -1622,11 +1625,11 @@ static const int2str_t int2str[] = { { 2, 131072, 18, 19, "100000000000000000\0----------------", STATUS_SUCCESS}, { 2, 131072, 18, 18, "100000000000000000-----------------", STATUS_SUCCESS}, {16, 0xffffffff, 8, 9, "FFFFFFFF\0--------------------------", STATUS_SUCCESS}, - {16, 0xffffffff, 8, 8, "FFFFFFFF---------------------------", STATUS_SUCCESS}, /* No \0 term */ - {16, 0xffffffff, 8, 7, "-----------------------------------", STATUS_BUFFER_OVERFLOW}, /* Too short */ + {16, 0xffffffff, 8, 8, "FFFFFFFF---------------------------", STATUS_SUCCESS, 1}, /* No \0 term */ + {16, 0xffffffff, 8, 7, "-----------------------------------", STATUS_BUFFER_OVERFLOW, 1}, /* Too short */ {16, 0xa, 1, 2, "A\0---------------------------------", STATUS_SUCCESS}, - {16, 0xa, 1, 1, "A----------------------------------", STATUS_SUCCESS}, /* No \0 term */ - {16, 0, 1, 0, "-----------------------------------", STATUS_BUFFER_OVERFLOW}, + {16, 0xa, 1, 1, "A----------------------------------", STATUS_SUCCESS, 1}, /* No \0 term */ + {16, 0, 1, 0, "-----------------------------------", STATUS_BUFFER_OVERFLOW, 1}, {20, 0xdeadbeef, 0, 9, "-----------------------------------", STATUS_INVALID_PARAMETER}, /* ill. base */ {-8, 07654321, 0, 12, "-----------------------------------", STATUS_INVALID_PARAMETER}, /* neg. base */ }; @@ -1687,7 +1690,8 @@ static void one_RtlIntegerToUnicodeString_test(int test_num, const int2str_t *in ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0, "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) assigns string \"%s\", expected: \"%s\"\n", test_num, int2str->value, int2str->base, ansi_str.Buffer, expected_ansi_str.Buffer); - ok(unicode_string.Length == expected_unicode_string.Length, + ok(unicode_string.Length == expected_unicode_string.Length || + broken(int2str->broken_len && !unicode_string.Length) /* win11 */, "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has Length %d, expected: %d\n", test_num, int2str->value, int2str->base, unicode_string.Length, expected_unicode_string.Length); ok(unicode_string.MaximumLength == expected_unicode_string.MaximumLength, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2049
From: Hans Leidekker <hans(a)codeweavers.com> --- dlls/ntdll/tests/path.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/tests/path.c b/dlls/ntdll/tests/path.c index 4732f6a6aa8..9210cfb8843 100644 --- a/dlls/ntdll/tests/path.c +++ b/dlls/ntdll/tests/path.c @@ -128,10 +128,10 @@ static void test_RtlIsDosDeviceName_U(void) { "c:\\nul\\", 0, 0 }, { "c:\\nul\\foo", 0, 0 }, { "c:\\nul::", 6, 6 }, - { "c:\\nul::::::", 6, 6 }, - { "c:prn ", 4, 6 }, - { "c:prn.......", 4, 6 }, - { "c:prn... ...", 4, 6 }, + { "c:\\nul::::::", 6, 6, TRUE }, /* fails on win11 */ + { "c:prn ", 4, 6, TRUE }, /* fails on win11 */ + { "c:prn.......", 4, 6, TRUE }, /* fails on win11 */ + { "c:prn... ...", 4, 6, TRUE }, /* fails on win11 */ { "c:NUL .... ", 4, 6 }, { "c: . . .", 0, 0 }, { "c:", 0, 0 }, @@ -140,14 +140,14 @@ static void test_RtlIsDosDeviceName_U(void) { "c:nul. . . :", 4, 6 }, { "c:nul . . :", 4, 6 }, { "c:nul0", 0, 0 }, - { "c:prn:aaa", 4, 6 }, - { "c:PRN:.txt", 4, 6 }, - { "c:aux:.txt...", 4, 6 }, - { "c:prn:.txt:", 4, 6 }, - { "c:nul:aaa", 4, 6 }, + { "c:prn:aaa", 4, 6, TRUE }, /* fails on win11 */ + { "c:PRN:.txt", 4, 6, TRUE }, /* fails on win11 */ + { "c:aux:.txt...", 4, 6, TRUE }, /* fails on win11 */ + { "c:prn:.txt:", 4, 6, TRUE }, /* fails on win11 */ + { "c:nul:aaa", 4, 6, TRUE }, /* fails on win11 */ { "con:", 0, 6 }, { "lpt1:", 0, 8 }, - { "c:com5:", 4, 8 }, + { "c:com5:", 4, 8, TRUE }, /* fails on win11 */ { "CoM4:", 0, 8 }, { "lpt9:", 0, 8 }, { "c:\\lpt0.txt", 0, 0 }, @@ -159,14 +159,14 @@ static void test_RtlIsDosDeviceName_U(void) { "\\??\\CONIN$", 8, 12, TRUE }, /* fails on win7 */ { "\\??\\CONOUT$", 8, 14, TRUE }, /* fails on win7 */ { "\\??\\CONERR$", 0, 0 }, - { "\\??\\CON", 8, 6 }, + { "\\??\\CON", 8, 6, TRUE }, /* fails on win11 */ { "c:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\nul.txt", 1000, 6 }, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\nul.txt", 1000, 6, TRUE }, /* fails on win11 */ { NULL, 0 } }; @@ -321,7 +321,8 @@ static void test_RtlGetFullPathName_U(void) { "foo/..", "C:\\windows", "windows"}, { "\\windows\\nul", "\\\\.\\nul", NULL}, { "C:\\nonexistent\\nul", "\\\\.\\nul", NULL}, - { "C:\\con\\con", "\\\\.\\con", NULL}, + { "C:\\con\\con", "\\\\.\\con", NULL, + "C:\\con\\con", "con"}, /* win11 */ { "C:NUL.", "\\\\.\\NUL", NULL}, { "C:NUL", "\\\\.\\NUL", NULL}, { "AUX", "\\\\.\\AUX", NULL}, @@ -564,7 +565,7 @@ static void test_RtlDosPathNameToNtPathName_U(void) {L"CONERR$", L"\\??\\C:\\windows\\CONERR$", 15}, }; static const WCHAR *error_paths[] = { - NULL, L"", L" ", L"C:\\nonexistent\\nul", L"C:\\con\\con" + NULL, L"", L" ", L"C:\\nonexistent\\nul" }; GetCurrentDirectoryA(sizeof(curdir), curdir); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2049
From: Hans Leidekker <hans(a)codeweavers.com> --- dlls/ntdll/tests/wow64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/wow64.c b/dlls/ntdll/tests/wow64.c index b0f5dda5804..b8f28f6215c 100644 --- a/dlls/ntdll/tests/wow64.c +++ b/dlls/ntdll/tests/wow64.c @@ -662,7 +662,8 @@ static NTSTATUS call_func64( ULONG64 func64, int nb_args, ULONG64 *args ) return func( func64, nb_args, args ); } -static ULONG64 main_module, ntdll_module, wow64_module, wow64cpu_module, wow64win_module; +static ULONG64 main_module, ntdll_module, wow64_module, wow64base_module, wow64con_module, + wow64cpu_module, wow64win_module; static void enum_modules64( void (*func)(ULONG64,const WCHAR *) ) { @@ -776,6 +777,8 @@ static void check_module( ULONG64 base, const WCHAR *name ) #define CHECK_MODULE(mod) if (!wcsicmp( name, L"" #mod ".dll" )) { mod ## _module = base; return; } CHECK_MODULE(ntdll); CHECK_MODULE(wow64); + CHECK_MODULE(wow64base); + CHECK_MODULE(wow64con); CHECK_MODULE(wow64cpu); CHECK_MODULE(wow64win); #undef CHECK_MODULE -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2049
participants (2)
-
Hans Leidekker -
Hans Leidekker (@hans)