From: Alex Henrie alexhenrie24@gmail.com
The deleted urlmon and ws2_32 tests were also failing on Windows 11.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54045 --- dlls/ntdll/rtl.c | 2 -- dlls/ntdll/tests/rtl.c | 23 +++++++++++++---------- dlls/urlmon/tests/uri.c | 2 -- dlls/ws2_32/tests/protocol.c | 5 ----- 4 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 59dde6359e3..84488ea1d81 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1126,9 +1126,7 @@ static NTSTATUS ipv6_string_to_address(const WCHAR *str, BOOL ex, { if (str[1] != ':') goto error; str++; - /* Windows bug: a double colon at the beginning is treated as 4 bytes of zeros instead of 2 */ address->u.Word[0] = 0; - n_bytes = 2; }
for (;;) diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 1e5e8c2580c..92c14a54181 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -1407,9 +1407,11 @@ static const struct int terminator_offset; int ip[8]; /* win_broken: XP and Vista do not handle this correctly + shift: Windows < 11 incorrectly adds an extra two zero bytes to the beginning and cuts off + the last two bytes from the end ex_fail: Ex function does need the string to be terminated, non-Ex does not. ex_skip: test doesn't make sense for Ex (f.e. it's invalid for non-Ex but valid for Ex) */ - enum { normal_6, win_broken_6 = 1, ex_fail_6 = 2, ex_skip_6 = 4 } flags; + enum { normal_6, win_broken_6 = 1, shift_6 = 2, ex_fail_6 = 4, ex_skip_6 = 8 } flags; } ipv6_tests[] = { { "0000:0000:0000:0000:0000:0000:0000:0000", STATUS_SUCCESS, 39, @@ -1576,12 +1578,10 @@ static const struct { 0, 0, 0, 0, 0, 0, 0, 0 } }, { "::0:0:0:0:0:0", STATUS_SUCCESS, 13, { 0, 0, 0, 0, 0, 0, 0, 0 } }, - /* this one and the next one are incorrectly parsed by windows, - it adds one zero too many in front, cutting off the last digit. */ - { "::0:0:0:0:0:0:0", STATUS_SUCCESS, 13, - { 0, 0, 0, 0, 0, 0, 0, 0 }, ex_fail_6 }, - { "::0:a:b:c:d:e:f", STATUS_SUCCESS, 13, - { 0, 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00 }, ex_fail_6 }, + { "::0:0:0:0:0:0:0", STATUS_SUCCESS, 15, + { 0, 0, 0, 0, 0, 0, 0, 0 }, shift_6 }, + { "::0:a:b:c:d:e:f", STATUS_SUCCESS, 15, + { 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00, 0xf00 }, shift_6 }, { "::123.123.123.123", STATUS_SUCCESS, 17, { 0, 0, 0, 0, 0, 0, 0x7b7b, 0x7b7b } }, { "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", STATUS_SUCCESS, 39, @@ -2103,13 +2103,16 @@ static void test_RtlIpv6StringToAddress(void) } else { - ok(terminator == ipv6_tests[i].address + ipv6_tests[i].terminator_offset, + ok(terminator == ipv6_tests[i].address + ipv6_tests[i].terminator_offset || + broken((ipv6_tests[i].flags & shift_6) && terminator == strrchr(ipv6_tests[i].address, ':')), "[%s] terminator = %p, expected %p\n", ipv6_tests[i].address, terminator, ipv6_tests[i].address + ipv6_tests[i].terminator_offset); }
init_ip6(&expected_ip, ipv6_tests[i].ip); - ok(!memcmp(&ip, &expected_ip, sizeof(ip)), + ok(!memcmp(&ip, &expected_ip, sizeof(ip)) || + broken((ipv6_tests[i].flags & shift_6) && + ip.s6_words[0] == 0 && !memcmp(ip.s6_words + 1, &expected_ip, sizeof(ip) - sizeof(USHORT))), "[%s] ip = %x:%x:%x:%x:%x:%x:%x:%x, expected %x:%x:%x:%x:%x:%x:%x:%x\n", ipv6_tests[i].address, ip.s6_words[0], ip.s6_words[1], ip.s6_words[2], ip.s6_words[3], @@ -2325,7 +2328,7 @@ static void test_RtlIpv6StringToAddressEx(void) ipv6_tests[i].address, port); }
- if (ipv6_tests[i].flags & win_broken_6) + if (ipv6_tests[i].flags & (win_broken_6 | shift_6)) { ok(res == expect_ret || broken(res == STATUS_INVALID_PARAMETER), "[%s] res = 0x%08lx, expected 0x%08lx\n", ipv6_tests[i].address, res, expect_ret); diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index a3161b8e401..18ea01e64c2 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -5118,8 +5118,6 @@ static const invalid_uri invalid_uri_tests[] = { {"http://%5B1:192.0.1.0%5D%22,0,FALSE%7D, /* Not allowed to have partial IPv4 in IPv6. */ {"http://%5B::192.0%5D%22,0,FALSE%7D, - /* Can't have elision of 1 h16 at beginning of address. */ - {"http://%5B::2:3:4:5:6:7:8%5D%22,0,FALSE%7D, /* Expects a valid IP Literal. */ {"ftp://[not.valid.uri]/",0,FALSE}, /* Expects valid port for a known scheme type. */ diff --git a/dlls/ws2_32/tests/protocol.c b/dlls/ws2_32/tests/protocol.c index fac3cf57077..f543fac8e91 100644 --- a/dlls/ws2_32/tests/protocol.c +++ b/dlls/ws2_32/tests/protocol.c @@ -906,10 +906,6 @@ static void test_inet_pton(void) {"::0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}}, {"::0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}}, {"::0:0:0:0:0:0", 1, {0, 0, 0, 0, 0, 0, 0, 0}}, - /* this one and the next one are incorrectly parsed by windows, - it adds one zero too many in front, cutting off the last digit. */ - {"::0:0:0:0:0:0:0", 0, {0, 0, 0, 0, 0, 0, 0, 0}}, - {"::0:a:b:c:d:e:f", 0, {0, 0, 0, 0xa00, 0xb00, 0xc00, 0xd00, 0xe00}}, {"::123.123.123.123", 1, {0, 0, 0, 0, 0, 0, 0x7b7b, 0x7b7b}}, {"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", 1, {0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}}, {"':10.0.0.1", 0, {0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab, 0xabab}}, @@ -1464,7 +1460,6 @@ static void test_WSAStringToAddress(void) { "2001::1", { 0x120, 0, 0, 0, 0, 0, 0, 0x100 } }, { "::1]:65535", { 0, 0, 0, 0, 0, 0, 0, 0x100 }, 0, WSAEINVAL }, { "001::1", { 0x100, 0, 0, 0, 0, 0, 0, 0x100 } }, - { "::1:2:3:4:5:6:7", { 0, 0, 0x100, 0x200, 0x300, 0x400, 0x500, 0x600 }, 0, WSAEINVAL }, /* Windows bug */ { "1.2.3.4", { 0x201, 0x3, 0, 0, 0, 0, 0, 0 }, 0, WSAEINVAL }, { "1:2:3:", { 0x100, 0x200, 0x300, 0, 0, 0, 0 }, 0, WSAEINVAL }, { "", { 0, 0, 0, 0, 0, 0, 0, 0 }, 0, WSAEINVAL },