Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
March 2022
- 80 participants
- 950 discussions
23 Mar '22
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtlstr.c | 265 +++++++++++++++++++++++----------------------
1 file changed, 133 insertions(+), 132 deletions(-)
diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c
index 9f7e5df9f67..09a3333dad6 100644
--- a/dlls/ntdll/tests/rtlstr.c
+++ b/dlls/ntdll/tests/rtlstr.c
@@ -21,6 +21,7 @@
* We use function pointers here as there is no import library for NTDLL on
* windows.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h>
@@ -220,7 +221,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, teststring);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected 0\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
result);
ok(uni.Length == 32,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
@@ -251,7 +252,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, teststring2);
ok(result == STATUS_NAME_TOO_LONG,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected %x\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected %lx\n",
result, STATUS_NAME_TOO_LONG);
ok(uni.Length == 12345 ||
uni.Length == 0, /* win2k3 */
@@ -287,7 +288,7 @@ static void test_RtlInitUnicodeStringEx(void)
uni.Buffer = (void *) 0xdeadbeef;
result = pRtlInitUnicodeStringEx(&uni, 0);
ok(result == STATUS_SUCCESS,
- "pRtlInitUnicodeStringEx(&uni, 0) returns %x, expected 0\n",
+ "pRtlInitUnicodeStringEx(&uni, 0) returns %lx, expected 0\n",
result);
ok(uni.Length == 0,
"pRtlInitUnicodeStringEx(&uni, 0) sets Length to %u, expected %u\n",
@@ -470,7 +471,7 @@ static void test_RtlDuplicateUnicodeString(void)
dest_ansi_buf[dest_ansi_str.Length] = '\0';
dest_ansi_str.Buffer = dest_ansi_buf;
ok(result == dupl_ustr[test_num].result,
- "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has result %x, expected %x\n",
+ "(test %d): RtlDuplicateUnicodeString(%d, source, dest) has result %lx, expected %lx\n",
test_num, dupl_ustr[test_num].add_nul, result, dupl_ustr[test_num].result);
ok(dest_str.Length == dupl_ustr[test_num].res_Length,
"(test %d): RtlDuplicateUnicodeString(%d, source, dest) destination has Length %d, expected %d\n",
@@ -828,7 +829,7 @@ static void test_RtlUnicodeStringToAnsiString(void)
}
result = pRtlUnicodeStringToAnsiString(&ansi_str, &uni_str, ustr2astr[test_num].doalloc);
ok(result == ustr2astr[test_num].result,
- "(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) has result %x, expected %x\n",
+ "(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,
"(test %d): RtlUnicodeStringToAnsiString(ansi, uni, %d) ansi has Length %d, expected %d\n",
@@ -890,7 +891,7 @@ static void test_RtlAppendAsciizToString(void)
}
result = pRtlAppendAsciizToString(&dest_str, app_asc2str[test_num].src);
ok(result == app_asc2str[test_num].result,
- "(test %d): RtlAppendAsciizToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendAsciizToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_asc2str[test_num].result);
ok(dest_str.Length == app_asc2str[test_num].res_Length,
"(test %d): RtlAppendAsciizToString(dest, src) dest has Length %d, expected %d\n",
@@ -970,7 +971,7 @@ static void test_RtlAppendStringToString(void)
}
result = pRtlAppendStringToString(&dest_str, &src_str);
ok(result == app_str2str[test_num].result,
- "(test %d): RtlAppendStringToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_str2str[test_num].result);
ok(dest_str.Length == app_str2str[test_num].res_Length,
"(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
@@ -1041,7 +1042,7 @@ static void test_RtlAppendUnicodeToString(void)
}
result = pRtlAppendUnicodeToString(&dest_str, (LPCWSTR) app_uni2str[test_num].src);
ok(result == app_uni2str[test_num].result,
- "(test %d): RtlAppendUnicodeToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendUnicodeToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_uni2str[test_num].result);
ok(dest_str.Length == app_uni2str[test_num].res_Length,
"(test %d): RtlAppendUnicodeToString(dest, src) dest has Length %d, expected %d\n",
@@ -1125,7 +1126,7 @@ static void test_RtlAppendUnicodeStringToString(void)
}
result = pRtlAppendUnicodeStringToString(&dest_str, &src_str);
ok(result == app_ustr2str[test_num].result,
- "(test %d): RtlAppendStringToString(dest, src) has result %x, expected %x\n",
+ "(test %d): RtlAppendStringToString(dest, src) has result %lx, expected %lx\n",
test_num, result, app_ustr2str[test_num].result);
ok(dest_str.Length == app_ustr2str[test_num].res_Length,
"(test %d): RtlAppendStringToString(dest, src) dest has Length %d, expected %d\n",
@@ -1249,7 +1250,7 @@ static void test_RtlFindCharInUnicodeString(void)
pos = 12345;
result = pRtlFindCharInUnicodeString(find_ch_in_ustr[test_num].flags, &main_str, &search_chars, &pos);
ok(result == find_ch_in_ustr[test_num].result,
- "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) has result %x, expected %x\n",
+ "(test %d): RtlFindCharInUnicodeString(%d, %s, %s, [out]) has result %lx, expected %lx\n",
test_num, find_ch_in_ustr[test_num].flags,
find_ch_in_ustr[test_num].main_str, find_ch_in_ustr[test_num].search_chars,
result, find_ch_in_ustr[test_num].result);
@@ -1400,7 +1401,7 @@ static void test_RtlUnicodeStringToInteger(void)
result = pRtlUnicodeStringToInteger(&uni, str2int[test_num].base, &value);
ok(result == str2int[test_num].result ||
(str2int[test_num].alternative && result == str2int[test_num].alternative),
- "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) has result %x, expected: %x (%x)\n",
+ "(test %d): RtlUnicodeStringToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
test_num, str2int[test_num].str, str2int[test_num].base, result,
str2int[test_num].result, str2int[test_num].alternative);
if (result == STATUS_SUCCESS)
@@ -1419,17 +1420,17 @@ static void test_RtlUnicodeStringToInteger(void)
pRtlInitUnicodeString(&uni, wstr);
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlUnicodeStringToInteger(\"%s\", %d, NULL) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"%s\", %d, NULL) has result %lx\n",
str2int[1].str, str2int[1].base, result);
result = pRtlUnicodeStringToInteger(&uni, 20, NULL);
ok(result == STATUS_INVALID_PARAMETER || result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlUnicodeStringToInteger(\"%s\", 20, NULL) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"%s\", 20, NULL) has result %lx\n",
str2int[1].str, result);
uni.Length = 10; /* Make Length shorter (5 WCHARS instead of 7) */
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS,
- "call failed: RtlUnicodeStringToInteger(\"12345\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"12345\", %d, [out]) has result %lx\n",
str2int[1].base, result);
ok(value == 12345,
"didn't return expected value (test a): expected: %d, got: %d\n",
@@ -1438,7 +1439,7 @@ static void test_RtlUnicodeStringToInteger(void)
uni.Length = 5; /* Use odd Length (2.5 WCHARS) */
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS || result == STATUS_INVALID_PARAMETER /* vista */,
- "call failed: RtlUnicodeStringToInteger(\"12\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"12\", %d, [out]) has result %lx\n",
str2int[1].base, result);
if (result == STATUS_SUCCESS)
ok(value == 12, "didn't return expected value (test b): expected: %d, got: %d\n", 12, value);
@@ -1446,7 +1447,7 @@ static void test_RtlUnicodeStringToInteger(void)
uni.Length = 2;
result = pRtlUnicodeStringToInteger(&uni, str2int[1].base, &value);
ok(result == STATUS_SUCCESS,
- "call failed: RtlUnicodeStringToInteger(\"1\", %d, [out]) has result %x\n",
+ "call failed: RtlUnicodeStringToInteger(\"1\", %d, [out]) has result %lx\n",
str2int[1].base, result);
ok(value == 1,
"didn't return expected value (test c): expected: %d, got: %d\n",
@@ -1469,7 +1470,7 @@ static void test_RtlCharToInteger(void)
result = pRtlCharToInteger(str2int[test_num].str, str2int[test_num].base, &value);
ok(result == str2int[test_num].result ||
(str2int[test_num].alternative && result == str2int[test_num].alternative),
- "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) has result %x, expected: %x (%x)\n",
+ "(test %d): call failed: RtlCharToInteger(\"%s\", %d, [out]) has result %lx, expected: %lx (%lx)\n",
test_num, str2int[test_num].str, str2int[test_num].base, result,
str2int[test_num].result, str2int[test_num].alternative);
if (result == STATUS_SUCCESS)
@@ -1485,12 +1486,12 @@ static void test_RtlCharToInteger(void)
result = pRtlCharToInteger(str2int[1].str, str2int[1].base, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "call failed: RtlCharToInteger(\"%s\", %d, NULL) has result %x\n",
+ "call failed: RtlCharToInteger(\"%s\", %d, NULL) has result %lx\n",
str2int[1].str, str2int[1].base, result);
result = pRtlCharToInteger(str2int[1].str, 20, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "call failed: RtlCharToInteger(\"%s\", 20, NULL) has result %x\n",
+ "call failed: RtlCharToInteger(\"%s\", 20, NULL) has result %lx\n",
str2int[1].str, result);
}
@@ -1657,22 +1658,22 @@ static void one_RtlIntegerToUnicodeString_test(int test_num, const int2str_t *in
}
} else {
ok(result == int2str->result,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) has result %x, expected: %x\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) has result %lx, expected: %lx\n",
test_num, int2str->value, int2str->base, result, int2str->result);
if (result == STATUS_SUCCESS) {
ok(unicode_string.Buffer[unicode_string.Length/sizeof(WCHAR)] == '\0',
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string \"%s\" is not NULL terminated\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string \"%s\" is not NULL terminated\n",
test_num, int2str->value, int2str->base, ansi_str.Buffer);
}
}
ok(memcmp(unicode_string.Buffer, expected_unicode_string.Buffer, STRI_BUFFER_LENGTH * sizeof(WCHAR)) == 0,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
+ "(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,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string has Length %d, expected: %d\n",
+ "(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,
- "(test %d): RtlIntegerToUnicodeString(%u, %d, [out]) string has MaximumLength %d, expected: %d\n",
+ "(test %d): RtlIntegerToUnicodeString(%lu, %d, [out]) string has MaximumLength %d, expected: %d\n",
test_num, int2str->value, int2str->base, unicode_string.MaximumLength, expected_unicode_string.MaximumLength);
pRtlFreeAnsiString(&expected_ansi_str);
pRtlFreeAnsiString(&ansi_str);
@@ -1697,10 +1698,10 @@ static void one_RtlIntegerToChar_test(int test_num, const int2str_t *int2str)
dest_str[STRI_BUFFER_LENGTH] = '\0';
result = pRtlIntegerToChar(int2str->value, int2str->base, int2str->MaximumLength, dest_str);
ok(result == int2str->result,
- "(test %d): RtlIntegerToChar(%u, %d, %d, [out]) has result %x, expected: %x\n",
+ "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) has result %lx, expected: %lx\n",
test_num, int2str->value, int2str->base, int2str->MaximumLength, result, int2str->result);
ok(memcmp(dest_str, int2str->Buffer, STRI_BUFFER_LENGTH) == 0,
- "(test %d): RtlIntegerToChar(%u, %d, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
+ "(test %d): RtlIntegerToChar(%lu, %d, %d, [out]) assigns string \"%s\", expected: \"%s\"\n",
test_num, int2str->value, int2str->base, int2str->MaximumLength, dest_str, int2str->Buffer);
}
@@ -1715,22 +1716,22 @@ static void test_RtlIntegerToChar(void)
result = pRtlIntegerToChar(int2str[0].value, 20, int2str[0].MaximumLength, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "(test a): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test a): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, 20, int2str[0].MaximumLength, result, STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, 20, 0, NULL);
ok(result == STATUS_INVALID_PARAMETER,
- "(test b): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test b): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, 20, 0, result, STATUS_INVALID_PARAMETER);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base, 0, NULL);
ok(result == STATUS_BUFFER_OVERFLOW,
- "(test c): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test c): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, int2str[0].base, 0, result, STATUS_BUFFER_OVERFLOW);
result = pRtlIntegerToChar(int2str[0].value, int2str[0].base, int2str[0].MaximumLength, NULL);
ok(result == STATUS_ACCESS_VIOLATION,
- "(test d): RtlIntegerToChar(%u, %d, %d, NULL) has result %x, expected: %x\n",
+ "(test d): RtlIntegerToChar(%lu, %d, %d, NULL) has result %lx, expected: %lx\n",
int2str[0].value, int2str[0].base, int2str[0].MaximumLength, result, STATUS_ACCESS_VIOLATION);
}
@@ -1883,17 +1884,17 @@ static void test_RtlCompareUnicodeString(void)
for (ch2 = 0; ch2 < 1024; ch2++)
{
LONG res = pRtlCompareUnicodeString( &str1, &str2, FALSE );
- ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ ok( res == (ch1 - ch2), "wrong result %ld %04x %04x\n", res, ch1, ch2 );
res = pRtlCompareUnicodeString( &str1, &str2, TRUE );
ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
- "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ "wrong result %ld %04x %04x\n", res, ch1, ch2 );
if (pRtlCompareUnicodeStrings)
{
res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, FALSE );
- ok( res == (ch1 - ch2), "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ ok( res == (ch1 - ch2), "wrong result %ld %04x %04x\n", res, ch1, ch2 );
res = pRtlCompareUnicodeStrings( &ch1, 1, &ch2, 1, TRUE );
ok( res == (pRtlUpcaseUnicodeChar(ch1) - pRtlUpcaseUnicodeChar(ch2)),
- "wrong result %d %04x %04x\n", res, ch1, ch2 );
+ "wrong result %ld %04x %04x\n", res, ch1, ch2 );
}
}
}
@@ -1924,7 +1925,7 @@ static void test_RtlGUIDFromString(void)
str.Buffer = (LPWSTR)szGuid;
ret = pRtlGUIDFromString(&str, &guid);
- ok(ret == 0, "expected ret=0, got 0x%0x\n", ret);
+ ok(ret == 0, "expected ret=0, got 0x%0lx\n", ret);
ok(IsEqualGUID(&guid, &IID_Endianness), "Endianness broken\n");
str.Length = str.MaximumLength = sizeof(szGuid2) - sizeof(WCHAR);
@@ -1949,7 +1950,7 @@ static void test_RtlStringFromGUID(void)
str.Buffer = NULL;
ret = pRtlStringFromGUID(&IID_Endianness, &str);
- ok(ret == 0, "expected ret=0, got 0x%0x\n", ret);
+ ok(ret == 0, "expected ret=0, got 0x%0lx\n", ret);
ok(str.Buffer && !lstrcmpiW(str.Buffer, szGuid), "Endianness broken\n");
pRtlFreeUnicodeString(&str);
}
@@ -1991,22 +1992,22 @@ static void test_RtlHashUnicodeString(void)
}
status = pRtlHashUnicodeString(NULL, FALSE, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
pRtlInitUnicodeString(&str, strW);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_X65599, NULL);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_INVALID, &hash);
- ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got status 0x%08lx\n", status);
/* embedded null */
str.Buffer = (PWSTR)strW;
str.Length = sizeof(strW) - sizeof(WCHAR);
str.MaximumLength = sizeof(strW);
status = pRtlHashUnicodeString(&str, FALSE, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_SUCCESS, "got status 0x%08x\n", status);
- ok(hash == 0x32803083, "got 0x%08x\n", hash);
+ ok(status == STATUS_SUCCESS, "got status 0x%08lx\n", status);
+ ok(hash == 0x32803083, "got 0x%08lx\n", hash);
ptr = hash_test;
while (*ptr->str)
@@ -2014,8 +2015,8 @@ static void test_RtlHashUnicodeString(void)
pRtlInitUnicodeString(&str, ptr->str);
hash = 0;
status = pRtlHashUnicodeString(&str, ptr->case_insensitive, HASH_STRING_ALGORITHM_X65599, &hash);
- ok(status == STATUS_SUCCESS, "got status 0x%08x for %s\n", status, wine_dbgstr_w(ptr->str));
- ok(hash == ptr->hash, "got wrong hash 0x%08x, expected 0x%08x, for %s, mode %d\n", hash, ptr->hash,
+ ok(status == STATUS_SUCCESS, "got status 0x%08lx for %s\n", status, wine_dbgstr_w(ptr->str));
+ ok(hash == ptr->hash, "got wrong hash 0x%08lx, expected 0x%08lx, for %s, mode %d\n", hash, ptr->hash,
wine_dbgstr_w(ptr->str), ptr->case_insensitive);
ptr++;
@@ -2078,8 +2079,8 @@ static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG ou
status = pRtlUnicodeToUTF8N(
out_string ? buffer : NULL, buflen, &bytes_out,
in_string, in_bytes);
- ok_(__FILE__, line)(status == expect_status, "status 0x%x, expected 0x%x\n", status, expect_status);
- ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u, expected %u\n", bytes_out, out_bytes);
+ ok_(__FILE__, line)(status == expect_status, "status 0x%lx, expected 0x%lx\n", status, expect_status);
+ ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %lu, expected %lu\n", bytes_out, out_bytes);
if (out_string)
{
for (i = 0; i < bytes_out; i++)
@@ -2120,51 +2121,51 @@ static void test_RtlUnicodeToUTF8N(void)
/* show that bytes_out is really ULONG */
memset(bytes_out_array, 0x55, sizeof(bytes_out_array));
status = pRtlUnicodeToUTF8N(NULL, 0, bytes_out_array, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]);
- ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out_array[0] == 0x00000000, "Got 0x%lx\n", bytes_out_array[0]);
+ ok(bytes_out_array[1] == 0x55555555, "Got 0x%lx\n", bytes_out_array[1]);
/* parameter checks */
status = pRtlUnicodeToUTF8N(NULL, 0, NULL, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
status = pRtlUnicodeToUTF8N(NULL, 0, NULL, empty_string, 0);
- ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "status = 0x%lx\n", status);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, invalid_pointer, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, test_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(invalid_pointer, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUnicodeToUTF8N(invalid_pointer, 8, &bytes_out, empty_string, 1);
- ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
/* length output with special chars */
#define length_expect(in_chars, out_bytes, expect_status) \
@@ -2184,14 +2185,14 @@ static void test_RtlUnicodeToUTF8N(void)
memset(buffer, 0x55, sizeof(buffer));
bytes_out = 0xdeadbeef;
status = pRtlUnicodeToUTF8N(buffer, i, &bytes_out, special_string, sizeof(special_string));
- ok(status == STATUS_BUFFER_TOO_SMALL, "%d: status = 0x%x\n", i, status);
- ok(bytes_out == special_string_len[i], "%d: expected %u, got %u\n", i, special_string_len[i], bytes_out);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "%d: status = 0x%lx\n", i, status);
+ ok(bytes_out == special_string_len[i], "%d: expected %lu, got %lu\n", i, special_string_len[i], bytes_out);
ok(memcmp(buffer, special_expected, special_string_len[i]) == 0, "%d: bad conversion\n", i);
}
status = pRtlUnicodeToUTF8N(buffer, 7, &bytes_out, special_string, sizeof(special_string));
- ok(status == STATUS_SOME_NOT_MAPPED, "status = 0x%x\n", status);
- ok(bytes_out == special_string_len[7], "expected %u, got %u\n", special_string_len[7], bytes_out);
+ ok(status == STATUS_SOME_NOT_MAPPED, "status = 0x%lx\n", status);
+ ok(bytes_out == special_string_len[7], "expected %lu, got %lu\n", special_string_len[7], bytes_out);
ok(memcmp(buffer, special_expected, 7) == 0, "bad conversion\n");
/* conversion behavior with varying input length */
@@ -2208,9 +2209,9 @@ static void test_RtlUnicodeToUTF8N(void)
test_string, input_len);
if (input_len % sizeof(WCHAR) == 0) {
ok(status == STATUS_SUCCESS,
- "(len %u): status = 0x%x\n", input_len, status);
+ "(len %u): status = 0x%lx\n", input_len, status);
ok(bytes_out == input_len / sizeof(WCHAR),
- "(len %u): bytes_out = 0x%x\n", input_len, bytes_out);
+ "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
for (i = 0; i < bytes_out; i++) {
ok(buffer[i] == test_string[i],
"(len %u): buffer[%d] = 0x%x, expected 0x%x\n",
@@ -2222,9 +2223,9 @@ static void test_RtlUnicodeToUTF8N(void)
}
} else {
ok(status == STATUS_INVALID_PARAMETER_5,
- "(len %u): status = 0x%x\n", input_len, status);
+ "(len %u): status = 0x%lx\n", input_len, status);
ok(bytes_out == 0x55555555,
- "(len %u): bytes_out = 0x%x\n", input_len, bytes_out);
+ "(len %u): bytes_out = 0x%lx\n", input_len, bytes_out);
for (i = 0; i < sizeof(buffer); i++) {
ok(buffer[i] == 0x55,
"(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]);
@@ -2240,14 +2241,14 @@ static void test_RtlUnicodeToUTF8N(void)
buffer, sizeof(buffer), &bytes_out,
unicode_to_utf8[i].unicode, lstrlenW(unicode_to_utf8[i].unicode) * sizeof(WCHAR));
ok(status == unicode_to_utf8[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, unicode_to_utf8[i].status);
ok(bytes_out == strlen(unicode_to_utf8[i].expected),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %u\n",
i, bytes_out, lstrlenA(unicode_to_utf8[i].expected));
ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out),
"(test %d): got \"%.*s\", expected \"%s\"\n",
- i, bytes_out, buffer, unicode_to_utf8[i].expected);
+ i, (int)bytes_out, buffer, unicode_to_utf8[i].expected);
ok(buffer[bytes_out] == 0x55,
"(test %d): behind string: 0x%x\n", i, buffer[bytes_out]);
memset(buffer, 0x55, sizeof(buffer));
@@ -2266,14 +2267,14 @@ static void test_RtlUnicodeToUTF8N(void)
buffer, sizeof(buffer), &bytes_out,
unicode_to_utf8[i].unicode, (lstrlenW(unicode_to_utf8[i].unicode) + 1) * sizeof(WCHAR));
ok(status == unicode_to_utf8[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, unicode_to_utf8[i].status);
ok(bytes_out == strlen(unicode_to_utf8[i].expected) + 1,
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %u\n",
i, bytes_out, lstrlenA(unicode_to_utf8[i].expected) + 1);
ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out),
"(test %d): got \"%.*s\", expected \"%s\"\n",
- i, bytes_out, buffer, unicode_to_utf8[i].expected);
+ i, (int)bytes_out, buffer, unicode_to_utf8[i].expected);
ok(buffer[bytes_out] == 0x55,
"(test %d): behind string: 0x%x\n", i, buffer[bytes_out]);
memset(buffer, 0x55, sizeof(buffer));
@@ -2290,7 +2291,7 @@ static void test_RtlUnicodeToUTF8N(void)
if (unicode_to_utf8[i].status == STATUS_SOME_NOT_MAPPED)
{
ok( ret == 0, "(test %d): wrong len %u\n", i, ret );
- ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %u\n", i, GetLastError() );
+ ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %lu\n", i, GetLastError() );
ret = strlen(unicode_to_utf8[i].expected) + 1;
}
else
@@ -2410,9 +2411,9 @@ static void unicode_expect_(const WCHAR *out_string, ULONG buflen, ULONG out_cha
status = pRtlUTF8ToUnicodeN(
out_string ? buffer : NULL, buflen, &bytes_out,
in_string, in_chars);
- ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status);
+ ok_(__FILE__, line)(status == expect_status, "status = 0x%lx\n", status);
ok_(__FILE__, line)(bytes_out == out_chars * sizeof(WCHAR),
- "bytes_out = %u, expected %u\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR));
+ "bytes_out = %lu, expected %lu\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR));
if (out_string)
{
for (i = 0; i < bytes_out / sizeof(WCHAR); i++)
@@ -2453,41 +2454,41 @@ static void test_RtlUTF8ToUnicodeN(void)
/* show that bytes_out is really ULONG */
memset(bytes_out_array, 0x55, sizeof(bytes_out_array));
status = pRtlUTF8ToUnicodeN(NULL, 0, bytes_out_array, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]);
- ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out_array[0] == 0x00000000, "Got 0x%lx\n", bytes_out_array[0]);
+ ok(bytes_out_array[1] == 0x55555555, "Got 0x%lx\n", bytes_out_array[1]);
/* parameter checks */
status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, empty_string, 0);
- ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "status = 0x%lx\n", status);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status);
- ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%lx\n", status);
+ ok(bytes_out == 0x55555555, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, invalid_pointer, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, test_string, 0);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == 0, "bytes_out = 0x%lx\n", bytes_out);
bytes_out = 0x55555555;
status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 1);
- ok(status == STATUS_SUCCESS, "status = 0x%x\n", status);
- ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%x\n", bytes_out);
+ ok(status == STATUS_SUCCESS, "status = 0x%lx\n", status);
+ ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%lx\n", bytes_out);
/* length output with special chars */
#define length_expect(in_chars, out_chars, expect_status) \
@@ -2543,10 +2544,10 @@ static void test_RtlUTF8ToUnicodeN(void)
buffer, sizeof(buffer), &bytes_out,
utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8));
ok(status == utf8_to_unicode[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, utf8_to_unicode[i].status);
ok(bytes_out == lstrlenW(utf8_to_unicode[i].expected) * sizeof(WCHAR),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %lu\n",
i, bytes_out, lstrlenW(utf8_to_unicode[i].expected) * (ULONG)sizeof(WCHAR));
ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out),
"(test %d): got %s, expected %s\n",
@@ -2570,10 +2571,10 @@ static void test_RtlUTF8ToUnicodeN(void)
buffer, sizeof(buffer), &bytes_out,
utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8) + 1);
ok(status == utf8_to_unicode[i].status,
- "(test %d): status is 0x%x, expected 0x%x\n",
+ "(test %d): status is 0x%lx, expected 0x%lx\n",
i, status, utf8_to_unicode[i].status);
ok(bytes_out == (lstrlenW(utf8_to_unicode[i].expected) + 1) * sizeof(WCHAR),
- "(test %d): bytes_out is %u, expected %u\n",
+ "(test %d): bytes_out is %lu, expected %lu\n",
i, bytes_out, (lstrlenW(utf8_to_unicode[i].expected) + 1) * (ULONG)sizeof(WCHAR));
ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out),
"(test %d): got %s, expected %s\n",
@@ -2597,7 +2598,7 @@ static void test_RtlUTF8ToUnicodeN(void)
if (utf8_to_unicode[i].status == STATUS_SOME_NOT_MAPPED)
{
ok( ret == 0, "(test %d): wrong len %u\n", i, ret );
- ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %u\n", i, GetLastError() );
+ ok( GetLastError() == ERROR_NO_UNICODE_TRANSLATION, "(test %d): wrong error %lu\n", i, GetLastError() );
ret = lstrlenW(utf8_to_unicode[i].expected) + 1;
}
else
@@ -2635,10 +2636,10 @@ static void WINAPIV testfmt( const WCHAR *src, const WCHAR *expect, ULONG width,
va_start( args, ansi );
status = pRtlFormatMessage( src, width, FALSE, ansi, FALSE, &args, buffer, sizeof(buffer), &size );
va_end( args );
- ok( !status, "%s: failed %x\n", debugstr_w(src), status );
+ ok( !status, "%s: failed %lx\n", debugstr_w(src), status );
ok( !lstrcmpW( buffer, expect ), "%s: got %s expected %s\n", debugstr_w(src),
debugstr_w(buffer), debugstr_w(expect) );
- ok( size == (lstrlenW(expect) + 1) * sizeof(WCHAR), "%s: wrong size %u\n", debugstr_w(src), size );
+ ok( size == (lstrlenW(expect) + 1) * sizeof(WCHAR), "%s: wrong size %lu\n", debugstr_w(src), size );
}
static void test_RtlFormatMessage(void)
@@ -2768,7 +2769,7 @@ static void test_RtlFormatMessage(void)
}
lstrcpyW( buffer, L"xxxxxxxxxx" );
fmt( src, 4, FALSE, FALSE, buffer, sizeof(buffer), &size );
- ok( !lstrcmpW( buffer, expect ), "%04x: got %s\n", i, debugstr_w(buffer) );
+ ok( !lstrcmpW( buffer, expect ), "%04lx: got %s\n", i, debugstr_w(buffer) );
}
/* args are not counted the same way with an argument array */
@@ -2787,37 +2788,37 @@ static void test_RtlFormatMessage(void)
/* buffer overflows */
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"testing", 0, FALSE, FALSE, buffer, 8, &size );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"testxxxxxx" ) || broken(!lstrcmpW( buffer, L"tesxxxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1", 0, FALSE, FALSE, buffer, 8, &size, L"test" );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"tes\0xxxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L"testxxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!x!", 0, FALSE, FALSE, buffer, 8, &size, 0x12345678 );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"123\0xxxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L"1234xxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!*s!", 0, FALSE, FALSE, buffer, 10, &size, 5, L"abc" );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L" ab\0xxxxx", 10 * sizeof(WCHAR) ) || broken(!lstrcmpW( buffer, L" abcxxxxx" )), /* winxp */
"got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"ab%n", 0, FALSE, FALSE, buffer, 6, &size );
- ok( status == STATUS_BUFFER_OVERFLOW, "failed %x\n", status );
+ ok( status == STATUS_BUFFER_OVERFLOW, "failed %lx\n", status );
ok( !memcmp( buffer, L"abxxxxxxxx", 10 * sizeof(WCHAR) ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
/* ignore inserts */
lstrcpyW( buffer, L"xxxxxxxxxx" );
@@ -2826,67 +2827,67 @@ static void test_RtlFormatMessage(void)
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"ab%0cd", 0, TRUE, FALSE, buffer, sizeof(buffer), &size );
- ok( !status, "failed %x\n", status );
+ ok( !status, "failed %lx\n", status );
ok( !memcmp( buffer, L"ab\0xxxxxxx", 10 * sizeof(WCHAR) ), "got %s\n", wine_dbgstr_wn(buffer, 10) );
/* invalid args */
lstrcpyW( buffer, L"xxxxxxxxxx" );
size = 0xdeadbeef;
status = pRtlFormatMessage( L"abc%1", 0, FALSE, FALSE, FALSE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = pRtlFormatMessage( L"abc%1", 0, FALSE, FALSE, TRUE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = pRtlFormatMessage( L"abc%", 0, FALSE, FALSE, TRUE, NULL, buffer, sizeof(buffer), &size );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!u! %2!u", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"34 xxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!**u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"*u" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"%1!0.3+*u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"+*u" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"aa%1!***u!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"aaxxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!#.000000000000000000000000000x!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_SUCCESS, "failed %x\n", status );
+ ok( status == STATUS_SUCCESS, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abc0x22" ), "got %s\n", wine_dbgstr_w(buffer) );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!#.0000000000000000000000000000x!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, 34 );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
lstrcpyW( buffer, L"xxxxxxxxxx" );
status = fmt( L"abc%1!hsaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!", 0, FALSE, FALSE, buffer, sizeof(buffer), &size, "hello" );
- ok( status == STATUS_INVALID_PARAMETER, "failed %x\n", status );
+ ok( status == STATUS_INVALID_PARAMETER, "failed %lx\n", status );
ok( !lstrcmpW( buffer, L"abcxxxxxxx" ), "got %s\n", wine_dbgstr_w(buffer) );
- ok( size == 0xdeadbeef, "wrong size %u\n", size );
+ ok( size == 0xdeadbeef, "wrong size %lu\n", size );
}
1
0
23 Mar '22
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtlbitmap.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/tests/rtlbitmap.c b/dlls/ntdll/tests/rtlbitmap.c
index 3c3992e8fc9..7cb046a105a 100644
--- a/dlls/ntdll/tests/rtlbitmap.c
+++ b/dlls/ntdll/tests/rtlbitmap.c
@@ -20,6 +20,7 @@
* We use function pointers here as some of the bitmap functions exist only
* in later versions of ntdll.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "ntdll_test.h"
@@ -501,7 +502,7 @@ static void test_RtlFindSetRuns(void)
/* Get first 2 */
ulCount = pRtlFindSetRuns(&bm, runs, 2, FALSE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 19 + 3,"bad size\n");
@@ -511,7 +512,7 @@ static void test_RtlFindSetRuns(void)
/* Get longest 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindSetRuns(&bm, runs, 2, TRUE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 1877,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 33 + 19,"bad size\n");
@@ -521,7 +522,7 @@ static void test_RtlFindSetRuns(void)
/* Get all 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindSetRuns(&bm, runs, 3, TRUE);
- ok(ulCount == 3, "RtlFindClearRuns returned %d, expected 3\n", ulCount);
+ ok(ulCount == 3, "RtlFindClearRuns returned %ld, expected 3\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101 ||
runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101 ||
@@ -539,7 +540,7 @@ static void test_RtlFindSetRuns(void)
ULONG ulStart = 0;
ulCount = pRtlFindLongestRunSet(&bm, &ulStart);
- ok(ulCount == 33 && ulStart == 1877,"didn't find longest %d %d\n",ulCount,ulStart);
+ ok(ulCount == 33 && ulStart == 1877,"didn't find longest %ld %ld\n",ulCount,ulStart);
memset(buff, 0, sizeof(buff));
ulCount = pRtlFindLongestRunSet(&bm, &ulStart);
@@ -578,7 +579,7 @@ static void test_RtlFindClearRuns(void)
/* Get first 2 */
ulCount = pRtlFindClearRuns(&bm, runs, 2, FALSE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 19 + 3,"bad size\n");
@@ -588,7 +589,7 @@ static void test_RtlFindClearRuns(void)
/* Get longest 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindClearRuns(&bm, runs, 2, TRUE);
- ok(ulCount == 2, "RtlFindClearRuns returned %d, expected 2\n", ulCount);
+ ok(ulCount == 2, "RtlFindClearRuns returned %ld, expected 2\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 1877,"bad find\n");
ok (runs[0].NumberOfBits + runs[1].NumberOfBits == 33 + 19,"bad size\n");
@@ -598,7 +599,7 @@ static void test_RtlFindClearRuns(void)
/* Get all 3 */
memset(runs, 0, sizeof(runs));
ulCount = pRtlFindClearRuns(&bm, runs, 3, TRUE);
- ok(ulCount == 3, "RtlFindClearRuns returned %d, expected 3\n", ulCount);
+ ok(ulCount == 3, "RtlFindClearRuns returned %ld, expected 3\n", ulCount);
ok (runs[0].StartingIndex == 7 || runs[0].StartingIndex == 101 ||
runs[0].StartingIndex == 1877,"bad find\n");
ok (runs[1].StartingIndex == 7 || runs[1].StartingIndex == 101 ||
@@ -635,8 +636,8 @@ static void test_RtlFindNextForwardRunSet(void)
pRtlInitializeBitMap(&bm, mask, 62);
ulCount = pRtlFindNextForwardRunSet(&bm, ulStart, &lpPos);
- ok(ulCount == 6, "Invalid length of found set run: %d, expected 6\n", ulCount);
- ok(lpPos == 56, "Invalid position of found set run: %d, expected 56\n", lpPos);
+ ok(ulCount == 6, "Invalid length of found set run: %ld, expected 6\n", ulCount);
+ ok(lpPos == 56, "Invalid position of found set run: %ld, expected 56\n", lpPos);
}
static void test_RtlFindNextForwardRunClear(void)
@@ -649,8 +650,8 @@ static void test_RtlFindNextForwardRunClear(void)
pRtlInitializeBitMap(&bm, mask, 62);
ulCount = pRtlFindNextForwardRunClear(&bm, ulStart, &lpPos);
- ok(ulCount == 6, "Invalid length of found clear run: %d, expected 6\n", ulCount);
- ok(lpPos == 56, "Invalid position of found clear run: %d, expected 56\n", lpPos);
+ ok(ulCount == 6, "Invalid length of found clear run: %ld, expected 6\n", ulCount);
+ ok(lpPos == 56, "Invalid position of found clear run: %ld, expected 56\n", lpPos);
}
#endif
1
0
23 Mar '22
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/ntdll/tests/rtl.c | 543 ++++++++++++++++++++++++------------------------
1 file changed, 272 insertions(+), 271 deletions(-)
diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c
index c0168884a0a..6d7a5eb845c 100644
--- a/dlls/ntdll/tests/rtl.c
+++ b/dlls/ntdll/tests/rtl.c
@@ -20,6 +20,7 @@
* We use function pointers here as there is no import library for NTDLL on
* windows.
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdlib.h>
@@ -141,17 +142,17 @@ static void test_RtlQueryProcessDebugInformation(void)
ok( buffer != NULL, "RtlCreateQueryDebugBuffer returned NULL" );
status = RtlQueryProcessDebugInformation( GetCurrentThreadId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
- ok( status == STATUS_INVALID_CID, "RtlQueryProcessDebugInformation returned %x\n", status );
+ ok( status == STATUS_INVALID_CID, "RtlQueryProcessDebugInformation returned %lx\n", status );
status = RtlQueryProcessDebugInformation( GetCurrentProcessId(), PDI_HEAPS | PDI_HEAP_BLOCKS, buffer );
- ok( !status, "RtlQueryProcessDebugInformation returned %x\n", status );
+ ok( !status, "RtlQueryProcessDebugInformation returned %lx\n", status );
status = RtlDestroyQueryDebugBuffer( buffer );
- ok( !status, "RtlDestroyQueryDebugBuffer returned %x\n", status );
+ ok( !status, "RtlDestroyQueryDebugBuffer returned %lx\n", status );
}
#define COMP(str1,str2,cmplen,len) size = RtlCompareMemory(str1, str2, cmplen); \
- ok(size == len, "Expected %ld, got %ld\n", size, (SIZE_T)len)
+ ok(size == len, "Expected %Id, got %Id\n", size, (SIZE_T)len)
static void test_RtlCompareMemory(void)
{
@@ -175,39 +176,39 @@ static void test_RtlCompareMemoryUlong(void)
a[2]= 0x89ab;
a[3]= 0xcdef;
result = RtlCompareMemoryUlong(a, 0, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 0, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 0, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 3, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 5, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 7, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 8, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 9, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0127);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x0127) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x0127) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x7123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x7123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 4, 0x7123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 16, 0x4567);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 16, 0x4567) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 16, 0x4567) returns %lu, expected 0\n", a, result);
a[1]= 0x0123;
result = RtlCompareMemoryUlong(a, 3, 0x0123);
- ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %u, expected 0\n", a, result);
+ ok(result == 0, "RtlCompareMemoryUlong(%p, 3, 0x0123) returns %lu, expected 0\n", a, result);
result = RtlCompareMemoryUlong(a, 4, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 4, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 5, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 5, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 7, 0x0123);
- ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %u, expected 4\n", a, result);
+ ok(result == 4, "RtlCompareMemoryUlong(%p, 7, 0x0123) returns %lu, expected 4\n", a, result);
result = RtlCompareMemoryUlong(a, 8, 0x0123);
- ok(result == 8, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %u, expected 8\n", a, result);
+ ok(result == 8, "RtlCompareMemoryUlong(%p, 8, 0x0123) returns %lu, expected 8\n", a, result);
result = RtlCompareMemoryUlong(a, 9, 0x0123);
- ok(result == 8, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %u, expected 8\n", a, result);
+ ok(result == 8, "RtlCompareMemoryUlong(%p, 9, 0x0123) returns %lu, expected 8\n", a, result);
}
#define COPY(len) memset(dest,0,sizeof(dest_aligned_block)); pRtlMoveMemory(dest, src, len)
@@ -364,7 +365,7 @@ static void test_RtlUniform(void)
expected = 0x7fffffc3;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0)) returns %lx, expected %lx\n",
result, expected);
/*
* The algorithm is now:
@@ -385,7 +386,7 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + 1;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 1)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 1)) returns %lx, expected %lx\n",
result, expected);
/*
* For seed = 2 the const_2 is 0x7fffffc3:
@@ -405,7 +406,7 @@ static void test_RtlUniform(void)
}
ok(result == expected,
- "RtlUniform(&seed (seed == 2)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 2)) returns %lx, expected %lx\n",
result, expected);
/*
@@ -415,21 +416,21 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + (seed & 1);
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 3)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 3)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1aa;
expected = seed * 0xffffffed + 0x7fffffc3;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1aa)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1aa)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1ab;
expected = seed * 0xffffffed + 0x7fffffc3 + 1;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ab)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ab)) returns %lx, expected %lx\n",
result, expected);
/*
* When seed is 0x6bca1ac there is an exception:
@@ -438,7 +439,7 @@ static void test_RtlUniform(void)
expected = seed * 0xffffffed + 0x7fffffc3 + 2;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ac)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ac)) returns %lx, expected %lx\n",
result, expected);
/*
* Note that up to here const_3 is not used
@@ -450,14 +451,14 @@ static void test_RtlUniform(void)
expected = (seed * 0xffffffed + 0x7fffffc3) & MAXLONG;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ad)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ad)) returns %lx, expected %lx\n",
result, expected);
seed = 0x6bca1ae;
expected = (seed * 0xffffffed + 0x7fffffc3 + 1) & MAXLONG;
result = RtlUniform(&seed);
ok(result == expected,
- "RtlUniform(&seed (seed == 0x6bca1ae)) returns %x, expected %x\n",
+ "RtlUniform(&seed (seed == 0x6bca1ae)) returns %lx, expected %lx\n",
result, expected);
/*
* There are several ranges where for odd or even seed the result must be
@@ -565,10 +566,10 @@ static void test_RtlUniform(void)
seed_bak = seed;
result = RtlUniform(&seed);
ok(result == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) returns %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
ok(seed == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) sets seed to %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
} /* for */
/*
@@ -612,10 +613,10 @@ static void test_RtlUniform(void)
seed_bak = seed;
result = RtlUniform(&seed);
ok(result == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) returns %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
ok(seed == expected,
- "test: 0x%s RtlUniform(&seed (seed == %x)) sets seed to %x, expected %x\n",
+ "test: 0x%s RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx\n",
wine_dbgstr_longlong(num), seed_bak, result, expected);
} /* for */
/*
@@ -636,9 +637,9 @@ static void test_RtlRandom(void)
for (i = 0; i < ARRAY_SIZE(res); i++)
{
res[i] = RtlRandom(&seed);
- ok(seed != res[i], "%i: seed is same as res %x\n", i, seed);
+ ok(seed != res[i], "%i: seed is same as res %lx\n", i, seed);
for (j = 0; j < i; j++)
- ok(res[i] != res[j], "res[%i] (%x) is same as res[%i] (%x)\n", j, res[j], i, res[i]);
+ ok(res[i] != res[j], "res[%i] (%lx) is same as res[%i] (%lx)\n", j, res[j], i, res[i]);
}
}
@@ -672,7 +673,7 @@ static void test_RtlAreAllAccessesGranted(void)
result = RtlAreAllAccessesGranted(all_accesses[test_num].GrantedAccess,
all_accesses[test_num].DesiredAccess);
ok(all_accesses[test_num].result == result,
- "(test %d): RtlAreAllAccessesGranted(%08x, %08x) returns %d, expected %d\n",
+ "(test %d): RtlAreAllAccessesGranted(%08lx, %08lx) returns %d, expected %d\n",
test_num, all_accesses[test_num].GrantedAccess,
all_accesses[test_num].DesiredAccess,
result, all_accesses[test_num].result);
@@ -708,7 +709,7 @@ static void test_RtlAreAnyAccessesGranted(void)
result = RtlAreAnyAccessesGranted(any_accesses[test_num].GrantedAccess,
any_accesses[test_num].DesiredAccess);
ok(any_accesses[test_num].result == result,
- "(test %d): RtlAreAnyAccessesGranted(%08x, %08x) returns %d, expected %d\n",
+ "(test %d): RtlAreAnyAccessesGranted(%08lx, %08lx) returns %d, expected %d\n",
test_num, any_accesses[test_num].GrantedAccess,
any_accesses[test_num].DesiredAccess,
result, any_accesses[test_num].result);
@@ -720,7 +721,7 @@ static void test_RtlComputeCrc32(void)
DWORD crc = 0;
crc = RtlComputeCrc32(crc, (const BYTE *)src, LEN);
- ok(crc == 0x40861dc2,"Expected 0x40861dc2, got %8x\n", crc);
+ ok(crc == 0x40861dc2,"Expected 0x40861dc2, got %8lx\n", crc);
}
@@ -754,7 +755,7 @@ static void test_HandleTables(void)
result = RtlFreeHandle(&HandleTable, &MyHandle->RtlHandle);
ok(result, "Couldn't free handle %p\n", MyHandle);
status = RtlDestroyHandleTable(&HandleTable);
- ok(status == STATUS_SUCCESS, "RtlDestroyHandleTable failed with error 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "RtlDestroyHandleTable failed with error 0x%08lx\n", status);
}
static void test_RtlAllocateAndInitializeSid(void)
@@ -764,9 +765,9 @@ static void test_RtlAllocateAndInitializeSid(void)
PSID psid;
ret = RtlAllocateAndInitializeSid(&sia, 0, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
- ok(!ret, "RtlAllocateAndInitializeSid error %08x\n", ret);
+ ok(!ret, "RtlAllocateAndInitializeSid error %08lx\n", ret);
ret = RtlFreeSid(psid);
- ok(!ret, "RtlFreeSid error %08x\n", ret);
+ ok(!ret, "RtlFreeSid error %08lx\n", ret);
/* these tests crash on XP */
if (0)
@@ -776,7 +777,7 @@ static void test_RtlAllocateAndInitializeSid(void)
}
ret = RtlAllocateAndInitializeSid(&sia, 9, 1, 2, 3, 4, 5, 6, 7, 8, &psid);
- ok(ret == STATUS_INVALID_SID, "wrong error %08x\n", ret);
+ ok(ret == STATUS_INVALID_SID, "wrong error %08lx\n", ret);
}
static void test_RtlDeleteTimer(void)
@@ -786,7 +787,7 @@ static void test_RtlDeleteTimer(void)
ret = RtlDeleteTimer(NULL, NULL, NULL);
ok(ret == STATUS_INVALID_PARAMETER_1 ||
ret == STATUS_INVALID_PARAMETER, /* W2K */
- "expected STATUS_INVALID_PARAMETER_1 or STATUS_INVALID_PARAMETER, got %x\n", ret);
+ "expected STATUS_INVALID_PARAMETER_1 or STATUS_INVALID_PARAMETER, got %lx\n", ret);
}
static void test_RtlThreadErrorMode(void)
@@ -810,32 +811,32 @@ static void test_RtlThreadErrorMode(void)
status = pRtlSetThreadErrorMode(0x70, &mode);
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode failed with error 0x%08x\n", status);
+ "RtlSetThreadErrorMode failed with error 0x%08lx\n", status);
ok(mode == oldmode,
- "RtlSetThreadErrorMode returned mode 0x%x, expected 0x%x\n",
+ "RtlSetThreadErrorMode returned mode 0x%lx, expected 0x%lx\n",
mode, oldmode);
ok(pRtlGetThreadErrorMode() == 0x70,
- "RtlGetThreadErrorMode returned 0x%x, expected 0x%x\n", mode, 0x70);
+ "RtlGetThreadErrorMode returned 0x%lx, expected 0x%x\n", mode, 0x70);
if (!is_wow64)
{
ok(NtCurrentTeb()->HardErrorDisabled == 0x70,
- "The TEB contains 0x%x, expected 0x%x\n",
+ "The TEB contains 0x%lx, expected 0x%x\n",
NtCurrentTeb()->HardErrorDisabled, 0x70);
}
status = pRtlSetThreadErrorMode(0, &mode);
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode failed with error 0x%08x\n", status);
+ "RtlSetThreadErrorMode failed with error 0x%08lx\n", status);
ok(mode == 0x70,
- "RtlSetThreadErrorMode returned mode 0x%x, expected 0x%x\n",
+ "RtlSetThreadErrorMode returned mode 0x%lx, expected 0x%x\n",
mode, 0x70);
ok(pRtlGetThreadErrorMode() == 0,
- "RtlGetThreadErrorMode returned 0x%x, expected 0x%x\n", mode, 0);
+ "RtlGetThreadErrorMode returned 0x%lx, expected 0x%x\n", mode, 0);
if (!is_wow64)
{
ok(NtCurrentTeb()->HardErrorDisabled == 0,
- "The TEB contains 0x%x, expected 0x%x\n",
+ "The TEB contains 0x%lx, expected 0x%x\n",
NtCurrentTeb()->HardErrorDisabled, 0);
}
@@ -845,11 +846,11 @@ static void test_RtlThreadErrorMode(void)
if (mode & 0x70)
ok(status == STATUS_SUCCESS ||
status == STATUS_WAIT_1, /* Vista */
- "RtlSetThreadErrorMode(%x,NULL) failed with error 0x%08x\n",
+ "RtlSetThreadErrorMode(%lx,NULL) failed with error 0x%08lx\n",
mode, status);
else
ok(status == STATUS_INVALID_PARAMETER_1,
- "RtlSetThreadErrorMode(%x,NULL) returns 0x%08x, "
+ "RtlSetThreadErrorMode(%lx,NULL) returns 0x%08lx, "
"expected STATUS_INVALID_PARAMETER_1\n",
mode, status);
}
@@ -868,7 +869,7 @@ static void test_LdrProcessRelocationBlock(void)
reloc = IMAGE_REL_BASED_HIGHLOW<<12;
ret = LdrProcessRelocationBlock(&addr32, 1, &reloc, 0x500050);
ok((USHORT*)ret == &reloc+1, "ret = %p, expected %p\n", ret, &reloc+1);
- ok(addr32 == 0x550055, "addr32 = %x, expected 0x550055\n", addr32);
+ ok(addr32 == 0x550055, "addr32 = %lx, expected 0x550055\n", addr32);
addr16 = 0x505;
reloc = IMAGE_REL_BASED_HIGH<<12;
@@ -954,7 +955,7 @@ static void test_RtlIpv4AddressToStringEx(void)
used = strlen(buffer);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used + 1;
memset(buffer, '#', sizeof(buffer) - 1);
@@ -962,14 +963,14 @@ static void test_RtlIpv4AddressToStringEx(void)
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used;
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
size = used - 1;
@@ -977,7 +978,7 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
@@ -992,7 +993,7 @@ static void test_RtlIpv4AddressToStringEx(void)
used = strlen(buffer);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used + 1;
memset(buffer, '#', sizeof(buffer) - 1);
@@ -1000,14 +1001,14 @@ static void test_RtlIpv4AddressToStringEx(void)
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_SUCCESS) &&
(size == strlen(expect) + 1) && !strcmp(buffer, expect),
- "got 0x%x and size %d with '%s'\n", res, size, buffer);
+ "got 0x%lx and size %ld with '%s'\n", res, size, buffer);
size = used;
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
size = used - 1;
@@ -1015,7 +1016,7 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, port, buffer, &size);
ok( (res == STATUS_INVALID_PARAMETER) && (size == used + 1),
- "got 0x%x and %d with '%s' (expected STATUS_INVALID_PARAMETER and %d)\n",
+ "got 0x%lx and %ld with '%s' (expected STATUS_INVALID_PARAMETER and %ld)\n",
res, size, buffer, used + 1);
@@ -1024,19 +1025,19 @@ static void test_RtlIpv4AddressToStringEx(void)
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(&ip, 0, buffer, NULL);
ok(res == STATUS_INVALID_PARAMETER,
- "got 0x%x with '%s' (expected STATUS_INVALID_PARAMETER)\n", res, buffer);
+ "got 0x%lx with '%s' (expected STATUS_INVALID_PARAMETER)\n", res, buffer);
size = sizeof(buffer);
res = pRtlIpv4AddressToStringExA(&ip, 0, NULL, &size);
ok( res == STATUS_INVALID_PARAMETER,
- "got 0x%x and size %d (expected STATUS_INVALID_PARAMETER)\n", res, size);
+ "got 0x%lx and size %ld (expected STATUS_INVALID_PARAMETER)\n", res, size);
size = sizeof(buffer);
memset(buffer, '#', sizeof(buffer) - 1);
buffer[sizeof(buffer) -1] = 0;
res = pRtlIpv4AddressToStringExA(NULL, 0, buffer, &size);
ok( res == STATUS_INVALID_PARAMETER,
- "got 0x%x and size %d with '%s' (expected STATUS_INVALID_PARAMETER)\n",
+ "got 0x%lx and size %ld with '%s' (expected STATUS_INVALID_PARAMETER)\n",
res, size, buffer);
}
@@ -1193,7 +1194,7 @@ static void test_RtlIpv4StringToAddress(void)
ip.S_un.S_addr = 0xabababab;
res = RtlIpv4StringToAddressA(ipv4_tests[i].address, FALSE, &terminator, &ip);
ok(res == ipv4_tests[i].res,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, ipv4_tests[i].res);
ok(terminator == ipv4_tests[i].address + ipv4_tests[i].terminator_offset,
"[%s] terminator = %p, expected %p\n",
@@ -1201,7 +1202,7 @@ static void test_RtlIpv4StringToAddress(void)
init_ip4(&expected_ip, ipv4_tests[i].ip);
ok(ip.S_un.S_addr == expected_ip.S_un.S_addr,
- "[%s] ip = %08x, expected %08x\n",
+ "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
if (!(ipv4_tests[i].flags & strict_diff_4))
@@ -1218,7 +1219,7 @@ static void test_RtlIpv4StringToAddress(void)
ip.S_un.S_addr = 0xabababab;
res = RtlIpv4StringToAddressA(ipv4_tests[i].address, TRUE, &terminator, &ip);
ok(res == ipv4_tests[i].res_strict,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, ipv4_tests[i].res_strict);
ok(terminator == ipv4_tests[i].address + ipv4_tests[i].terminator_offset_strict,
"[%s] terminator = %p, expected %p\n",
@@ -1226,7 +1227,7 @@ static void test_RtlIpv4StringToAddress(void)
init_ip4(&expected_ip, ipv4_tests[i].ip_strict);
ok(ip.S_un.S_addr == expected_ip.S_un.S_addr,
- "[%s] ip = %08x, expected %08x\n",
+ "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
}
}
@@ -1276,23 +1277,23 @@ static void test_RtlIpv4StringToAddressEx(void)
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA(NULL, FALSE, &ip, &port);
- ok(res == STATUS_INVALID_PARAMETER, "[null address] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null address] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
- ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %x\n", ip.S_un.S_addr);
+ ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %lx\n", ip.S_un.S_addr);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
port = 0xdead;
res = pRtlIpv4StringToAddressExA("1.1.1.1", FALSE, NULL, &port);
- ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA("1.1.1.1", FALSE, &ip, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null port] res = 0x%08x, expected 0x%08x\n",
+ ok(res == STATUS_INVALID_PARAMETER, "[null port] res = 0x%08lx, expected 0x%08lx\n",
res, STATUS_INVALID_PARAMETER);
- ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %x\n", ip.S_un.S_addr);
+ ok(ip.S_un.S_addr == 0xabababab, "RtlIpv4StringToAddressExA should not touch the ip!, ip == %lx\n", ip.S_un.S_addr);
ok(port == 0xdead, "RtlIpv4StringToAddressExA should not touch the port!, port == %x\n", port);
/* first we run the non-ex testcases on the ex function */
@@ -1304,11 +1305,11 @@ static void test_RtlIpv4StringToAddressEx(void)
port = 0xdead;
ip.S_un.S_addr = 0xabababab;
res = pRtlIpv4StringToAddressExA(ipv4_tests[i].address, FALSE, &ip, &port);
- ok(res == expect_res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, expect_res);
init_ip4(&expected_ip, ipv4_tests[i].ip);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
if (!(ipv4_tests[i].flags & strict_diff_4))
@@ -1325,11 +1326,11 @@ static void test_RtlIpv4StringToAddressEx(void)
port = 0xdead;
ip.S_un.S_addr = 0xabababab;
res = pRtlIpv4StringToAddressExA(ipv4_tests[i].address, TRUE, &ip, &port);
- ok(res == expect_res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_tests[i].address, res, expect_res);
init_ip4(&expected_ip, ipv4_tests[i].ip_strict);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
}
@@ -1342,11 +1343,11 @@ static void test_RtlIpv4StringToAddressEx(void)
ip.S_un.S_addr = 0xabababab;
port = 0xdead;
res = pRtlIpv4StringToAddressExA(ipv4_ex_tests[i].address, strict, &ip, &port);
- ok(res == ipv4_ex_tests[i].res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == ipv4_ex_tests[i].res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv4_ex_tests[i].address, res, ipv4_ex_tests[i].res);
init_ip4(&expected_ip, ipv4_ex_tests[i].ip);
- ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08x, expected %08x\n",
+ ok(ip.S_un.S_addr == expected_ip.S_un.S_addr, "[%s] ip = %08lx, expected %08lx\n",
ipv4_ex_tests[i].address, ip.S_un.S_addr, expected_ip.S_un.S_addr);
ok(port == ipv4_ex_tests[i].port, "[%s] port = %u, expected %u\n",
ipv4_ex_tests[i].address, port, ipv4_ex_tests[i].port);
@@ -1925,31 +1926,31 @@ static void test_RtlIpv6AddressToStringEx(void)
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, &len);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
ok(len == 3 && !strcmp(buffer, "::"),
- "got len %d with '%s' (expected 3 with '::')\n", len, buffer);
+ "got len %ld with '%s' (expected 3 with '::')\n", len, buffer);
memset(buffer, '#', sizeof(buffer));
buffer[sizeof(buffer)-1] = 0;
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(NULL, 0, 0, buffer, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null ip] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
len = sizeof(buffer);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, NULL, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null buffer] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null buffer] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
len = 2;
memset(buffer, '#', sizeof(buffer));
buffer[sizeof(buffer)-1] = 0;
res = pRtlIpv6AddressToStringExA(&ip, 0, 0, buffer, &len);
- ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null length] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
ok(buffer[0] == '#', "got first char %c (expected '#')\n", buffer[0]);
- ok(len == 3, "got len %d (expected len 3)\n", len);
+ ok(len == 3, "got len %ld (expected len 3)\n", len);
for (i = 0; i < ARRAY_SIZE(tests); i++)
{
@@ -1960,9 +1961,9 @@ static void test_RtlIpv6AddressToStringEx(void)
res = pRtlIpv6AddressToStringExA(&ip, tests[i].scopeid, tests[i].port, buffer, &len);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
ok(len == (strlen(tests[i].address) + 1) && !strcmp(buffer, tests[i].address),
- "got len %d with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address);
+ "got len %ld with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address);
}
}
@@ -1979,7 +1980,7 @@ static void compare_RtlIpv6StringToAddressW(PCSTR name_a, int terminator_offset_
init_ip6(&ip, NULL);
terminator = (void *)0xdeadbeef;
res = RtlIpv6StringToAddressW(name, &terminator, &ip);
- ok(res == res_a, "[W:%s] res = 0x%08x, expected 0x%08x\n", name_a, res, res_a);
+ ok(res == res_a, "[W:%s] res = 0x%08lx, expected 0x%08lx\n", name_a, res, res_a);
if (terminator_offset_a < 0)
{
@@ -2011,16 +2012,16 @@ static void test_RtlIpv6StringToAddress(void)
unsigned int i;
res = RtlIpv6StringToAddressA("::", &terminator, &ip);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
if (0)
{
/* any of these crash */
res = RtlIpv6StringToAddressA(NULL, &terminator, &ip);
- ok(res == STATUS_INVALID_PARAMETER, "[null string] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null string] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = RtlIpv6StringToAddressA("::", NULL, &ip);
- ok(res == STATUS_INVALID_PARAMETER, "[null terminator] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null terminator] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
res = RtlIpv6StringToAddressA("::", &terminator, NULL);
- ok(res == STATUS_INVALID_PARAMETER, "[null result] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(res == STATUS_INVALID_PARAMETER, "[null result] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
}
/* sanity check */
@@ -2037,7 +2038,7 @@ static void test_RtlIpv6StringToAddress(void)
if (ipv6_tests[i].flags & win_broken_6)
{
ok(res == ipv6_tests[i].res || broken(res == STATUS_INVALID_PARAMETER),
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, ipv6_tests[i].res);
if (res == STATUS_INVALID_PARAMETER)
@@ -2046,7 +2047,7 @@ static void test_RtlIpv6StringToAddress(void)
else
{
ok(res == ipv6_tests[i].res,
- "[%s] res = 0x%08x, expected 0x%08x\n",
+ "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, ipv6_tests[i].res);
}
@@ -2090,8 +2091,8 @@ static void compare_RtlIpv6StringToAddressExW(PCSTR name_a, const struct in6_add
init_ip6(&ip, NULL);
res = pRtlIpv6StringToAddressExW(name, &ip, &scope, &port);
- ok(res == res_a, "[W:%s] res = 0x%08x, expected 0x%08x\n", name_a, res, res_a);
- ok(scope == scope_a, "[W:%s] scope = 0x%08x, expected 0x%08x\n", name_a, scope, scope_a);
+ ok(res == res_a, "[W:%s] res = 0x%08lx, expected 0x%08lx\n", name_a, res, res_a);
+ ok(scope == scope_a, "[W:%s] scope = 0x%08lx, expected 0x%08lx\n", name_a, scope, scope_a);
ok(port == port_a, "[W:%s] port = 0x%08x, expected 0x%08x\n", name_a, port, port_a);
ok(!memcmp(&ip, addr_a, sizeof(ip)),
@@ -2199,7 +2200,7 @@ static void test_RtlIpv6StringToAddressEx(void)
}
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, &scope, &port);
- ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res);
+ ok(res == STATUS_SUCCESS, "[validate] res = 0x%08lx, expected STATUS_SUCCESS\n", res);
init_ip6(&ip, NULL);
init_ip6(&expected_ip, NULL);
@@ -2207,8 +2208,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(NULL, &ip, &scope, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null string] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null string] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null string] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null string] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null string] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null string] ip is changed, expected it not to change\n");
@@ -2219,8 +2220,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, NULL, &scope, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null result] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null result] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null result] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null result] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null result] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null result] ip is changed, expected it not to change\n");
@@ -2230,8 +2231,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, NULL, &port);
ok(res == STATUS_INVALID_PARAMETER,
- "[null scope] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null scope] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null scope] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null scope] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null scope] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null scope] ip is changed, expected it not to change\n");
@@ -2241,8 +2242,8 @@ static void test_RtlIpv6StringToAddressEx(void)
port = 0xbeef;
res = pRtlIpv6StringToAddressExA(simple_ip, &ip, &scope, NULL);
ok(res == STATUS_INVALID_PARAMETER,
- "[null port] res = 0x%08x, expected STATUS_INVALID_PARAMETER\n", res);
- ok(scope == 0xbadf00d, "[null port] scope = 0x%08x, expected 0xbadf00d\n", scope);
+ "[null port] res = 0x%08lx, expected STATUS_INVALID_PARAMETER\n", res);
+ ok(scope == 0xbadf00d, "[null port] scope = 0x%08lx, expected 0xbadf00d\n", scope);
ok(port == 0xbeef, "[null port] port = 0x%08x, expected 0xbeef\n", port);
ok(!memcmp(&ip, &expected_ip, sizeof(ip)),
"[null port] ip is changed, expected it not to change\n");
@@ -2267,14 +2268,14 @@ static void test_RtlIpv6StringToAddressEx(void)
/* make sure nothing was changed if this function fails. */
if (res == STATUS_INVALID_PARAMETER)
{
- ok(scope == 0xbadf00d, "[%s] scope = 0x%08x, expected 0xbadf00d\n",
+ ok(scope == 0xbadf00d, "[%s] scope = 0x%08lx, expected 0xbadf00d\n",
ipv6_tests[i].address, scope);
ok(port == 0xbeef, "[%s] port = 0x%08x, expected 0xbeef\n",
ipv6_tests[i].address, port);
}
else
{
- ok(scope != 0xbadf00d, "[%s] scope = 0x%08x, not expected 0xbadf00d\n",
+ ok(scope != 0xbadf00d, "[%s] scope = 0x%08lx, not expected 0xbadf00d\n",
ipv6_tests[i].address, scope);
ok(port != 0xbeef, "[%s] port = 0x%08x, not expected 0xbeef\n",
ipv6_tests[i].address, port);
@@ -2283,14 +2284,14 @@ static void test_RtlIpv6StringToAddressEx(void)
if (ipv6_tests[i].flags & win_broken_6)
{
ok(res == expect_ret || broken(res == STATUS_INVALID_PARAMETER),
- "[%s] res = 0x%08x, expected 0x%08x\n", ipv6_tests[i].address, res, expect_ret);
+ "[%s] res = 0x%08lx, expected 0x%08lx\n", ipv6_tests[i].address, res, expect_ret);
if (res == STATUS_INVALID_PARAMETER)
continue;
}
else
{
- ok(res == expect_ret, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == expect_ret, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_tests[i].address, res, expect_ret);
}
@@ -2318,9 +2319,9 @@ static void test_RtlIpv6StringToAddressEx(void)
res = pRtlIpv6StringToAddressExA(ipv6_ex_tests[i].address, &ip, &scope, &port);
compare_RtlIpv6StringToAddressExW(ipv6_ex_tests[i].address, &ip, res, scope, port);
- ok(res == ipv6_ex_tests[i].res, "[%s] res = 0x%08x, expected 0x%08x\n",
+ ok(res == ipv6_ex_tests[i].res, "[%s] res = 0x%08lx, expected 0x%08lx\n",
ipv6_ex_tests[i].address, res, ipv6_ex_tests[i].res);
- ok(scope == ipv6_ex_tests[i].scope, "[%s] scope = 0x%08x, expected 0x%08x\n",
+ ok(scope == ipv6_ex_tests[i].scope, "[%s] scope = 0x%08lx, expected 0x%08lx\n",
ipv6_ex_tests[i].address, scope, ipv6_ex_tests[i].scope);
ok(port == ipv6_ex_tests[i].port, "[%s] port = 0x%08x, expected 0x%08x\n",
ipv6_ex_tests[i].address, port, ipv6_ex_tests[i].port);
@@ -2354,7 +2355,7 @@ static void test_LdrAddRefDll(void)
mod = LoadLibraryA("comctl32.dll");
ok(mod != NULL, "got %p\n", mod);
status = LdrAddRefDll(0, mod);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
ret = FreeLibrary(mod);
ok(ret, "got %d\n", ret);
@@ -2370,7 +2371,7 @@ static void test_LdrAddRefDll(void)
mod = LoadLibraryA("comctl32.dll");
ok(mod != NULL, "got %p\n", mod);
status = LdrAddRefDll(LDR_ADDREF_DLL_PIN, mod);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
ret = FreeLibrary(mod);
ok(ret, "got %d\n", ret);
@@ -2395,39 +2396,39 @@ static void test_LdrLockLoaderLock(void)
result = 10;
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x10, &result, &magic);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
+ ok(magic == 0, "got %Ix\n", magic);
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x10, NULL, &magic);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(magic == 0, "got %Ix\n", magic);
result = 10;
status = LdrLockLoaderLock(0x10, &result, NULL);
- ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
+ ok(status == STATUS_INVALID_PARAMETER_1, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
/* non-blocking mode, result is null */
magic = 0xdeadbeef;
status = LdrLockLoaderLock(0x2, NULL, &magic);
- ok(status == STATUS_INVALID_PARAMETER_2, "got 0x%08x\n", status);
- ok(magic == 0, "got %lx\n", magic);
+ ok(status == STATUS_INVALID_PARAMETER_2, "got 0x%08lx\n", status);
+ ok(magic == 0, "got %Ix\n", magic);
/* magic pointer is null */
result = 10;
status = LdrLockLoaderLock(0, &result, NULL);
- ok(status == STATUS_INVALID_PARAMETER_3, "got 0x%08x\n", status);
- ok(result == 0, "got %d\n", result);
+ ok(status == STATUS_INVALID_PARAMETER_3, "got 0x%08lx\n", status);
+ ok(result == 0, "got %ld\n", result);
/* lock in non-blocking mode */
result = 0;
magic = 0;
status = LdrLockLoaderLock(0x2, &result, &magic);
- ok(status == STATUS_SUCCESS, "got 0x%08x\n", status);
- ok(result == 1, "got %d\n", result);
- ok(magic != 0, "got %lx\n", magic);
+ ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
+ ok(result == 1, "got %ld\n", result);
+ ok(magic != 0, "got %Ix\n", magic);
LdrUnlockLoaderLock(0, magic);
}
@@ -2443,39 +2444,39 @@ static void test_RtlCompressBuffer(void)
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
workspace = HeapAlloc(GetProcessHeap(), 0, compress_workspace);
- ok(workspace != NULL, "HeapAlloc failed %d\n", GetLastError());
+ ok(workspace != NULL, "HeapAlloc failed %ld\n", GetLastError());
/* test compression format / engine */
final_size = 0xdeadbeef;
status = RtlCompressBuffer(COMPRESSION_FORMAT_NONE, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlCompressBuffer(COMPRESSION_FORMAT_DEFAULT, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlCompressBuffer(0xFF, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1) - 1, 4096, &final_size, workspace);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
/* test compression */
final_size = 0xdeadbeef;
memset(buf1, 0x11, sizeof(buf1));
status = RtlCompressBuffer(COMPRESSION_FORMAT_LZNT1, test_buffer, sizeof(test_buffer),
buf1, sizeof(buf1), 4096, &final_size, workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
ok((*(WORD *)buf1 & 0x7000) == 0x3000, "no chunk signature found %04x\n", *(WORD *)buf1);
todo_wine
- ok(final_size < sizeof(test_buffer), "got wrong final_size %u\n", final_size);
+ ok(final_size < sizeof(test_buffer), "got wrong final_size %lu\n", final_size);
/* test decompression */
buf_size = final_size;
@@ -2483,8 +2484,8 @@ static void test_RtlCompressBuffer(void)
memset(buf2, 0x11, sizeof(buf2));
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf2, sizeof(buf2),
buf1, buf_size, &final_size);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(final_size == sizeof(test_buffer), "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(final_size == sizeof(test_buffer), "got wrong final_size %lu\n", final_size);
ok(!memcmp(buf2, test_buffer, sizeof(test_buffer)), "got wrong decoded data\n");
ok(buf2[sizeof(test_buffer)] == 0x11, "too many bytes written\n");
@@ -2493,7 +2494,7 @@ static void test_RtlCompressBuffer(void)
memset(buf1, 0x11, sizeof(buf1));
status = RtlCompressBuffer(COMPRESSION_FORMAT_LZNT1, test_buffer, sizeof(test_buffer),
buf1, 4, 4096, &final_size, workspace);
- ok(status == STATUS_BUFFER_TOO_SMALL, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "got wrong status 0x%08lx\n", status);
HeapFree(GetProcessHeap(), 0, workspace);
}
@@ -2506,29 +2507,29 @@ static void test_RtlGetCompressionWorkSpaceSize(void)
/* test invalid format / engine */
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_NONE, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_DEFAULT, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
status = RtlGetCompressionWorkSpaceSize(0xFF, &compress_workspace, &decompress_workspace);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
/* test LZNT1 with normal and maximum compression */
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &compress_workspace,
&decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
- ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
+ ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %lu\n", decompress_workspace);
compress_workspace = decompress_workspace = 0xdeadbeef;
status = RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM,
&compress_workspace, &decompress_workspace);
- ok(status == STATUS_SUCCESS, "got wrong status 0x%08x\n", status);
- ok(compress_workspace != 0, "got wrong compress_workspace %u\n", compress_workspace);
- ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %u\n", decompress_workspace);
+ ok(status == STATUS_SUCCESS, "got wrong status 0x%08lx\n", status);
+ ok(compress_workspace != 0, "got wrong compress_workspace %lu\n", compress_workspace);
+ ok(decompress_workspace == 0x1000, "got wrong decompress_workspace %lu\n", decompress_workspace);
}
/* helper for test_RtlDecompressBuffer, checks if a chunk is incomplete */
@@ -2769,25 +2770,25 @@ static void test_RtlDecompressBuffer(void)
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(COMPRESSION_FORMAT_NONE, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(COMPRESSION_FORMAT_DEFAULT, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_INVALID_PARAMETER, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
final_size = 0xdeadbeef;
status = RtlDecompressBuffer(0xFF, buf, sizeof(buf), test_lznt[0].compressed,
test_lznt[0].compressed_size, &final_size);
- ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08x\n", status);
- ok(final_size == 0xdeadbeef, "got wrong final_size %u\n", final_size);
+ ok(status == STATUS_UNSUPPORTED_COMPRESSION, "got wrong status 0x%08lx\n", status);
+ ok(final_size == 0xdeadbeef, "got wrong final_size %lu\n", final_size);
/* regular tests for RtlDecompressBuffer */
for (i = 0; i < ARRAY_SIZE(test_lznt); i++)
{
- trace("Running test %d (compressed_size=%u, uncompressed_size=%u, status=0x%08x)\n",
+ trace("Running test %d (compressed_size=%lu, uncompressed_size=%lu, status=0x%08lx)\n",
i, test_lznt[i].compressed_size, test_lznt[i].uncompressed_size, test_lznt[i].status);
/* test with very big buffer */
@@ -2796,15 +2797,15 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, sizeof(buf), test_lznt[i].compressed,
test_lznt[i].compressed_size, &final_size);
ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
- (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test that modifier for compression engine is ignored */
@@ -2813,15 +2814,15 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1 | COMPRESSION_ENGINE_MAXIMUM, buf, sizeof(buf),
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
ok(status == test_lznt[i].status || broken(status == STATUS_BAD_COMPRESSION_BUFFER &&
- (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08x\n", i, status);
+ (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)), "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test with expected output size */
@@ -2831,15 +2832,15 @@ static void test_RtlDecompressBuffer(void)
memset(buf, 0x11, sizeof(buf));
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, test_lznt[i].uncompressed_size,
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
}
@@ -2852,17 +2853,17 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed, test_lznt[i].compressed_size, &final_size);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_TRUNCATED)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size - 1,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size - 1),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size - 1);
}
}
@@ -2872,11 +2873,11 @@ static void test_RtlDecompressBuffer(void)
status = RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1, buf, 0, test_lznt[i].compressed,
test_lznt[i].compressed_size, &final_size);
if (is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, FALSE))
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
{
- ok(status == STATUS_SUCCESS, "%d: got wrong status 0x%08x\n", i, status);
- ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(status == STATUS_SUCCESS, "%d: got wrong status 0x%08lx\n", i, status);
+ ok(final_size == 0, "%d: got wrong final_size %lu\n", i, final_size);
ok(buf[0] == 0x11, "%d: buf[0] was modified\n", i);
}
@@ -2887,17 +2888,17 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 0, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
ok(final_size == test_lznt[i].uncompressed_size,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed, test_lznt[i].uncompressed_size),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size);
}
/* test RtlDecompressFragment with offset = 1 */
@@ -2907,26 +2908,26 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 1, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
if (test_lznt[i].uncompressed_size == 0)
{
todo_wine
- ok(final_size == 4095, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 4095, "%d: got wrong final_size %lu\n", i, final_size);
/* Buffer doesn't contain any useful value on Windows */
ok(buf[4095] == 0x11, "%d: buf[4095] was modified\n", i);
}
else
{
ok(final_size == test_lznt[i].uncompressed_size - 1,
- "%d: got wrong final_size %u\n", i, final_size);
+ "%d: got wrong final_size %lu\n", i, final_size);
ok(!memcmp(buf, test_lznt[i].uncompressed + 1, test_lznt[i].uncompressed_size - 1),
"%d: got wrong decoded data\n", i);
ok(buf[test_lznt[i].uncompressed_size - 1] == 0x11,
- "%d: buf[%u] was modified\n", i, test_lznt[i].uncompressed_size - 1);
+ "%d: buf[%lu] was modified\n", i, test_lznt[i].uncompressed_size - 1);
}
}
@@ -2937,13 +2938,13 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 4095, &final_size, workspace);
if (test_lznt[i].broken_flags & DECOMPRESS_BROKEN_FRAGMENT)
todo_wine
- ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == STATUS_BAD_COMPRESSION_BUFFER, "%d: got wrong status 0x%08lx\n", i, status);
else
- ok(status == test_lznt[i].status, "%d: got wrong status 0x%08x\n", i, status);
+ ok(status == test_lznt[i].status, "%d: got wrong status 0x%08lx\n", i, status);
if (!status)
{
todo_wine
- ok(final_size == 1, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 1, "%d: got wrong final_size %lu\n", i, final_size);
todo_wine
ok(buf[0] == 0, "%d: padding is not zero\n", i);
ok(buf[1] == 0x11, "%d: buf[1] was modified\n", i);
@@ -2956,10 +2957,10 @@ static void test_RtlDecompressBuffer(void)
test_lznt[i].compressed_size, 4096, &final_size, workspace);
expected_status = is_incomplete_chunk(test_lznt[i].compressed, test_lznt[i].compressed_size, TRUE) ?
test_lznt[i].status : STATUS_SUCCESS;
- ok(status == expected_status, "%d: got wrong status 0x%08x, expected 0x%08x\n", i, status, expected_status);
+ ok(status == expected_status, "%d: got wrong status 0x%08lx, expected 0x%08lx\n", i, status, expected_status);
if (!status)
{
- ok(final_size == 0, "%d: got wrong final_size %u\n", i, final_size);
+ ok(final_size == 0, "%d: got wrong final_size %lu\n", i, final_size);
ok(buf[0] == 0x11, "%d: buf[4096] was modified\n", i);
}
}
@@ -2980,29 +2981,29 @@ static DWORD WINAPI critsect_locked_thread(void *param)
DWORD ret;
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
ReleaseSemaphore(info->semaphores[0], 1, NULL);
ret = WaitForSingleObject(info->semaphores[1], 1000);
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
+ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", ret);
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == FALSE, "expected FALSE, got %u\n", ret);
+ ok(ret == FALSE, "expected FALSE, got %lu\n", ret);
EnterCriticalSection(&info->crit);
ret = pRtlIsCriticalSectionLocked(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ret = pRtlIsCriticalSectionLockedByThread(&info->crit);
- ok(ret == TRUE, "expected TRUE, got %u\n", ret);
+ ok(ret == TRUE, "expected TRUE, got %lu\n", ret);
ReleaseSemaphore(info->semaphores[0], 1, NULL);
ret = WaitForSingleObject(info->semaphores[1], 1000);
- ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
+ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %lu\n", ret);
LeaveCriticalSection(&info->crit);
return 0;
@@ -3022,9 +3023,9 @@ static void test_RtlIsCriticalSectionLocked(void)
InitializeCriticalSection(&info.crit);
info.semaphores[0] = CreateSemaphoreW(NULL, 0, 1, NULL);
- ok(info.semaphores[0] != NULL, "CreateSemaphore failed with %u\n", GetLastError());
+ ok(info.semaphores[0] != NULL, "CreateSemaphore failed with %lu\n", GetLastError());
info.semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL);
- ok(info.semaphores[1] != NULL, "CreateSemaphore failed with %u\n", GetLastError());
+ ok(info.semaphores[1] != NULL, "CreateSemaphore failed with %lu\n", GetLastError());
ret = pRtlIsCriticalSectionLocked(&info.crit);
ok(ret == FALSE, "expected FALSE, got %u\n", ret);
@@ -3039,7 +3040,7 @@ static void test_RtlIsCriticalSectionLocked(void)
ok(ret == TRUE, "expected TRUE, got %u\n", ret);
thread = CreateThread(NULL, 0, critsect_locked_thread, &info, 0, NULL);
- ok(thread != NULL, "CreateThread failed with %u\n", GetLastError());
+ ok(thread != NULL, "CreateThread failed with %lu\n", GetLastError());
ret = WaitForSingleObject(info.semaphores[0], 1000);
ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
@@ -3079,21 +3080,21 @@ static void test_RtlInitializeCriticalSectionEx(void)
pRtlInitializeCriticalSectionEx(&cs, 0, 0);
ok((cs.DebugInfo != NULL && cs.DebugInfo != no_debug) || broken(cs.DebugInfo == no_debug) /* >= Win 8 */,
"expected DebugInfo != NULL and DebugInfo != ~0, got %p\n", cs.DebugInfo);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore);
ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */,
- "expected SpinCount == 0, got %ld\n", cs.SpinCount);
+ "expected SpinCount == 0, got %Id\n", cs.SpinCount);
RtlDeleteCriticalSection(&cs);
memset(&cs, 0x11, sizeof(cs));
pRtlInitializeCriticalSectionEx(&cs, 0, RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO);
ok(cs.DebugInfo == no_debug, "expected DebugInfo == ~0, got %p\n", cs.DebugInfo);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(cs.LockSemaphore == NULL, "expected LockSemaphore == NULL, got %p\n", cs.LockSemaphore);
ok(cs.SpinCount == 0 || broken(cs.SpinCount != 0) /* >= Win 8 */,
- "expected SpinCount == 0, got %ld\n", cs.SpinCount);
+ "expected SpinCount == 0, got %Id\n", cs.SpinCount);
RtlDeleteCriticalSection(&cs);
}
@@ -3106,19 +3107,19 @@ static void test_RtlLeaveCriticalSection(void)
return; /* Skip winxp */
status = RtlInitializeCriticalSection(&cs);
- ok(!status, "RtlInitializeCriticalSection failed: %x\n", status);
+ ok(!status, "RtlInitializeCriticalSection failed: %lx\n", status);
status = RtlEnterCriticalSection(&cs);
- ok(!status, "RtlEnterCriticalSection failed: %x\n", status);
+ ok(!status, "RtlEnterCriticalSection failed: %lx\n", status);
todo_wine
- ok(cs.LockCount == -2, "expected LockCount == -2, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -2, "expected LockCount == -2, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %ld\n", cs.RecursionCount);
ok(cs.OwningThread == ULongToHandle(GetCurrentThreadId()), "unexpected OwningThread\n");
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/*
@@ -3126,34 +3127,34 @@ static void test_RtlLeaveCriticalSection(void)
* but doesn't modify LockCount so that an attempt to enter the section later will work.
*/
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == -1, "expected RecursionCount == -1, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == -1, "expected RecursionCount == -1, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/* and again */
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == -2, "expected RecursionCount == -2, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == -2, "expected RecursionCount == -2, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
/* entering section fixes RecursionCount */
status = RtlEnterCriticalSection(&cs);
- ok(!status, "RtlEnterCriticalSection failed: %x\n", status);
+ ok(!status, "RtlEnterCriticalSection failed: %lx\n", status);
todo_wine
- ok(cs.LockCount == -2, "expected LockCount == -2, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %d\n", cs.RecursionCount);
+ ok(cs.LockCount == -2, "expected LockCount == -2, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 1, "expected RecursionCount == 1, got %ld\n", cs.RecursionCount);
ok(cs.OwningThread == ULongToHandle(GetCurrentThreadId()), "unexpected OwningThread\n");
status = RtlLeaveCriticalSection(&cs);
- ok(!status, "RtlLeaveCriticalSection failed: %x\n", status);
- ok(cs.LockCount == -1, "expected LockCount == -1, got %d\n", cs.LockCount);
- ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %d\n", cs.RecursionCount);
+ ok(!status, "RtlLeaveCriticalSection failed: %lx\n", status);
+ ok(cs.LockCount == -1, "expected LockCount == -1, got %ld\n", cs.LockCount);
+ ok(cs.RecursionCount == 0, "expected RecursionCount == 0, got %ld\n", cs.RecursionCount);
ok(!cs.OwningThread, "unexpected OwningThread %p\n", cs.OwningThread);
status = RtlDeleteCriticalSection(&cs);
- ok(!status, "RtlDeleteCriticalSection failed: %x\n", status);
+ ok(!status, "RtlDeleteCriticalSection failed: %lx\n", status);
}
struct ldr_enum_context
@@ -3190,24 +3191,24 @@ static void test_LdrEnumerateLoadedModules(void)
ctx.found = FALSE;
ctx.count = 0;
status = pLdrEnumerateLoadedModules(NULL, ldr_enum_callback, &ctx);
- ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08x\n", status);
+ ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08lx\n", status);
ok(ctx.count > 1, "Expected more than one module, got %d\n", ctx.count);
ok(ctx.found, "Could not find ntdll in list of modules\n");
ctx.abort = TRUE;
ctx.count = 0;
status = pLdrEnumerateLoadedModules(NULL, ldr_enum_callback, &ctx);
- ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08x\n", status);
+ ok(status == STATUS_SUCCESS, "LdrEnumerateLoadedModules failed with %08lx\n", status);
ok(ctx.count == 1, "Expected exactly one module, got %d\n", ctx.count);
status = pLdrEnumerateLoadedModules((void *)0x1, ldr_enum_callback, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
status = pLdrEnumerateLoadedModules((void *)0xdeadbeef, ldr_enum_callback, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
status = pLdrEnumerateLoadedModules(NULL, NULL, (void *)0xdeadbeef);
- ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got 0x%08lx\n", status);
}
static void test_RtlMakeSelfRelativeSD(void)
@@ -3223,31 +3224,31 @@ static void test_RtlMakeSelfRelativeSD(void)
len = 0;
status = RtlMakeSelfRelativeSD( &sd, NULL, &len );
- ok( status == STATUS_BUFFER_TOO_SMALL, "got %08x\n", status );
- ok( len == sizeof(*sd_rel), "got %u\n", len );
+ ok( status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel), "got %lu\n", len );
len += 4;
status = RtlMakeSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
len = 0;
status = RtlAbsoluteToSelfRelativeSD( &sd, NULL, &len );
- ok( status == STATUS_BUFFER_TOO_SMALL, "got %08x\n", status );
- ok( len == sizeof(*sd_rel), "got %u\n", len );
+ ok( status == STATUS_BUFFER_TOO_SMALL, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel), "got %lu\n", len );
len += 4;
status = RtlAbsoluteToSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
sd.Control = SE_SELF_RELATIVE;
status = RtlMakeSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_SUCCESS, "got %08x\n", status );
- ok( len == sizeof(*sd_rel) + 4, "got %u\n", len );
+ ok( status == STATUS_SUCCESS, "got %08lx\n", status );
+ ok( len == sizeof(*sd_rel) + 4, "got %lu\n", len );
status = RtlAbsoluteToSelfRelativeSD( &sd, sd_rel, &len );
- ok( status == STATUS_BAD_DESCRIPTOR_FORMAT, "got %08x\n", status );
+ ok( status == STATUS_BAD_DESCRIPTOR_FORMAT, "got %08lx\n", status );
}
static DWORD (CALLBACK *orig_entry)(HMODULE,DWORD,LPVOID);
@@ -3275,7 +3276,7 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT
if (!lstrcmpiW(data->Loaded.BaseDllName->Buffer, expected_dll))
return;
- ok(data->Loaded.Flags == 0, "Expected flags 0, got %x\n", data->Loaded.Flags);
+ ok(data->Loaded.Flags == 0, "Expected flags 0, got %lx\n", data->Loaded.Flags);
ok(!lstrcmpiW(data->Loaded.BaseDllName->Buffer, expected_dll), "Expected %s, got %s\n",
wine_dbgstr_w(expected_dll), wine_dbgstr_w(data->Loaded.BaseDllName->Buffer));
ok(!!data->Loaded.DllBase, "Expected non zero base address\n");
@@ -3435,67 +3436,67 @@ static void test_LdrRegisterDllNotification(void)
/* generic test */
status = pLdrRegisterDllNotification(0, ldr_notify_callback1, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == LDR_DLL_NOTIFICATION_REASON_LOADED, "Expected LDR_DLL_NOTIFICATION_REASON_LOADED, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == LDR_DLL_NOTIFICATION_REASON_LOADED, "Expected LDR_DLL_NOTIFICATION_REASON_LOADED, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == LDR_DLL_NOTIFICATION_REASON_UNLOADED, "Expected LDR_DLL_NOTIFICATION_REASON_UNLOADED, got %x\n", calls);
+ ok(calls == LDR_DLL_NOTIFICATION_REASON_UNLOADED, "Expected LDR_DLL_NOTIFICATION_REASON_UNLOADED, got %lx\n", calls);
/* test order of callbacks */
status = pLdrRegisterDllNotification(0, ldr_notify_callback2, &calls, &cookie2);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x13, "Expected order 0x13, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x13, "Expected order 0x13, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == 0x24, "Expected order 0x24, got %x\n", calls);
+ ok(calls == 0x24, "Expected order 0x24, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie2);
pLdrUnregisterDllNotification(cookie);
/* test dll main order */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_dll_main, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x13, "Expected order 0x13, got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x13, "Expected order 0x13, got %lx\n", calls);
calls = 0;
FreeLibrary(mod);
- ok(calls == 0x42, "Expected order 0x42, got %x\n", calls);
+ ok(calls == 0x42, "Expected order 0x42, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie);
/* test dll main order */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_fail, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(expected_dll);
ok(!mod, "Expected library to fail loading\n");
- ok(calls == 0x1342, "Expected order 0x1342, got %x\n", calls);
+ ok(calls == 0x1342, "Expected order 0x1342, got %lx\n", calls);
pLdrUnregisterDllNotification(cookie);
/* test dll with dependencies */
status = pLdrRegisterDllNotification(0, ldr_notify_callback_imports, &calls, &cookie);
- ok(!status, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(!status, "Expected STATUS_SUCCESS, got %08lx\n", status);
calls = 0;
mod = LoadLibraryW(wintrustdllW);
- ok(!!mod, "Failed to load library: %d\n", GetLastError());
- ok(calls == 0x12 || calls == 0x21, "got %x\n", calls);
+ ok(!!mod, "Failed to load library: %ld\n", GetLastError());
+ ok(calls == 0x12 || calls == 0x21, "got %lx\n", calls);
FreeLibrary(mod);
pLdrUnregisterDllNotification(cookie);
@@ -3509,7 +3510,7 @@ static LONG CALLBACK test_dbg_print_except_handler( EXCEPTION_POINTERS *eptrs )
if (eptrs->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C)
{
ok( eptrs->ExceptionRecord->NumberParameters == 2,
- "Unexpected NumberParameters: %d\n", eptrs->ExceptionRecord->NumberParameters );
+ "Unexpected NumberParameters: %ld\n", eptrs->ExceptionRecord->NumberParameters );
ok( eptrs->ExceptionRecord->ExceptionInformation[0] == strlen("test_DbgPrint: Hello World") + 1,
"Unexpected ExceptionInformation[0]: %d\n", (int)eptrs->ExceptionRecord->ExceptionInformation[0] );
ok( !strcmp((char *)eptrs->ExceptionRecord->ExceptionInformation[1], "test_DbgPrint: Hello World"),
@@ -3551,26 +3552,26 @@ static void test_DbgPrint(void)
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C received\n" );
Peb->BeingDebugged = TRUE;
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_CONTINUE_EXECUTION;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_CONTINUE_SEARCH;
status = DbgPrint( "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrint returned %x\n", status );
+ ok( !status, "DbgPrint returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
@@ -3579,38 +3580,38 @@ static void test_DbgPrint(void)
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_ERROR_LEVEL, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_WARNING_LEVEL, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_MASK|(1 << DPFLTR_ERROR_LEVEL), "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = DbgPrintEx( 0, DPFLTR_MASK|(1 << DPFLTR_WARNING_LEVEL), "test_DbgPrint: %s", "Hello World" );
- ok( !status, "DbgPrintEx returned %x\n", status );
+ ok( !status, "DbgPrintEx returned %lx\n", status );
ok( !test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = test_vDbgPrintEx( 0, 0xFFFFFFFF, "test_DbgPrint: %s", "Hello World" );
- ok( !status, "vDbgPrintEx returned %x\n", status );
+ ok( !status, "vDbgPrintEx returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
test_dbg_print_except = FALSE;
test_dbg_print_except_ret = (LONG)EXCEPTION_EXECUTE_HANDLER;
status = test_vDbgPrintExWithPrefix( "test_", 0, 0xFFFFFFFF, "DbgPrint: %s", "Hello World" );
- ok( !status, "vDbgPrintExWithPrefix returned %x\n", status );
+ ok( !status, "vDbgPrintExWithPrefix returned %lx\n", status );
ok( test_dbg_print_except, "DBG_PRINTEXCEPTION_C not received\n" );
Peb->BeingDebugged = debugged;
1
0
1
0
[PATCH v2] ntdll: Avoid the lower 2GB region for large allocations on win64.
by Elaine Lefler 23 Mar '22
by Elaine Lefler 23 Mar '22
23 Mar '22
Fixes a crash in PaintTool SAI when allocating more than 2GB of memory.
Signed-off-by: Elaine Lefler <elaineclefler(a)gmail.com>
---
v2: Removed todo_wine from appropriate tests, along with a note about
why that test is broken on win32.
---
dlls/ntdll/tests/info.c | 16 ++++++++++++----
dlls/ntdll/unix/virtual.c | 6 +++++-
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index d3e70842b00..3652d907db5 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1840,8 +1840,13 @@ static void test_query_process_vm(void)
ok( pvi.PrivateUsage == pvi.PagefileUsage, "wrong value %Iu/%Iu\n", pvi.PrivateUsage, pvi.PagefileUsage );
if (winetest_debug > 1)
dump_vm_counters("VM counters after VirtualAlloc", &pvi);
- todo_wine ok( pvi.VirtualSize >= prev_size + alloc_size,
- "Expected to be greater than %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
+#ifndef _WIN64
+ /* Fails on win32 due to mapping in reserved areas. The unused regions
+ * should be subtracted from VirtualSize for it to succeed. */
+ todo_wine
+#endif
+ ok( pvi.VirtualSize >= prev_size + alloc_size,
+ "Expected to be at least %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
VirtualFree( ptr, 0, MEM_RELEASE);
status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessVmCounters, &pvi, sizeof(pvi), NULL);
@@ -1857,8 +1862,11 @@ static void test_query_process_vm(void)
ok( pvi.PrivateUsage == pvi.PagefileUsage, "wrong value %Iu/%Iu\n", pvi.PrivateUsage, pvi.PagefileUsage );
if (winetest_debug > 1)
dump_vm_counters("VM counters after VirtualAlloc(MEM_RESERVE)", &pvi);
- todo_wine ok( pvi.VirtualSize >= prev_size + alloc_size,
- "Expected to be greater than %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
+#ifndef _WIN64
+ todo_wine
+#endif
+ ok( pvi.VirtualSize >= prev_size + alloc_size,
+ "Expected to be at least %Iu, got %Iu\n", prev_size + alloc_size, pvi.VirtualSize);
prev_size = pvi.VirtualSize;
ptr = VirtualAlloc(ptr, alloc_size, MEM_COMMIT, PAGE_READWRITE);
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 94b300c5057..eac9bcb1f83 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -1917,7 +1917,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
alloc.top_down = top_down;
alloc.limit = (void*)(get_zero_bits_mask( zero_bits ) & (UINT_PTR)user_space_limit);
- if (mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
+ if (
+#ifdef _WIN64
+ size < 2 * 1024 * 1024 &&
+#endif
+ mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
{
ptr = alloc.result;
TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size );
--
2.32.0 (Apple Git-132)
1
0
[PATCH 1/5] mfplat/sample: Simplify code for setting DirectX manager.
by Giovanni Mascellani 23 Mar '22
by Giovanni Mascellani 23 Mar '22
23 Mar '22
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
dlls/mfplat/sample.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/mfplat/sample.c b/dlls/mfplat/sample.c
index 8ef80eb5f24..527f44fd8fd 100644
--- a/dlls/mfplat/sample.c
+++ b/dlls/mfplat/sample.c
@@ -1214,13 +1214,9 @@ static HRESULT WINAPI sample_allocator_SetDirectXManager(IMFVideoSampleAllocator
IDirect3DDeviceManager9_Release(allocator->d3d9_device_manager);
if (allocator->dxgi_device_manager)
IMFDXGIDeviceManager_Release(allocator->dxgi_device_manager);
- allocator->d3d9_device_manager = NULL;
- allocator->dxgi_device_manager = NULL;
- if (dxgi_device_manager)
- allocator->dxgi_device_manager = dxgi_device_manager;
- else if (d3d9_device_manager)
- allocator->d3d9_device_manager = d3d9_device_manager;
+ allocator->d3d9_device_manager = d3d9_device_manager;
+ allocator->dxgi_device_manager = dxgi_device_manager;
LeaveCriticalSection(&allocator->cs);
--
2.35.1
3
7
[PATCH] ntdll: Avoid the lower 2GB region for large allocations on win64.
by Elaine Lefler 23 Mar '22
by Elaine Lefler 23 Mar '22
23 Mar '22
Fixes a crash in PaintTool SAI when allocating more than 2GB of memory.
Signed-off-by: Elaine Lefler <elaineclefler(a)gmail.com>
---
>From what I can tell, Sai basically requests an initial block of
memory from VirtualAlloc, then increments that pointer and calls
VirtualAlloc again with a fixed address when it wants more ram.
Blindly assuming that memory space is non-fragmented enough for the
call to succeed. This is definitely incorrect program behavior, but it
works on Windows, and after this tweak it's working on Wine too.
Heads up: I initially disabled the code path for all allocations, not
just large ones. On macOS this works fine. On Linux it's broken.
Somewhere, presumably in the X11 driver, we're truncating pointers to
32 bits. The change is safe for Windows apps, since Windows itself
seems to avoid the lower 4GB region, even for functions like HeapAlloc.
I can't find any apparent cause for the truncation, other than
converting HWNDs to XIDs, which doesn't seem to be the problem. I
wonder if there might be a confusion between "long" and "long long"
somewhere. Anyway, window data should never be large enough to trigger
the new behavior, so the broken behavior stays under containment until
it can be fixed properly.
---
dlls/ntdll/unix/virtual.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 94b300c5057..eac9bcb1f83 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -1917,7 +1917,11 @@ static NTSTATUS map_view( struct file_view **view_ret, void *base, size_t size,
alloc.top_down = top_down;
alloc.limit = (void*)(get_zero_bits_mask( zero_bits ) & (UINT_PTR)user_space_limit);
- if (mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
+ if (
+#ifdef _WIN64
+ size < 2 * 1024 * 1024 &&
+#endif
+ mmap_enum_reserved_areas( alloc_reserved_area_callback, &alloc, top_down ))
{
ptr = alloc.result;
TRACE( "got mem in reserved area %p-%p\n", ptr, (char *)ptr + size );
--
2.32.0 (Apple Git-132)
3
5
23 Mar '22
Only return it from UrlGetPartA().
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/kernelbase/path.c | 3 ++-
dlls/shlwapi/tests/url.c | 8 ++------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
index 410d87ce620..be7754dade2 100644
--- a/dlls/kernelbase/path.c
+++ b/dlls/kernelbase/path.c
@@ -4166,6 +4166,7 @@ HRESULT WINAPI UrlGetPartA(const char *url, char *out, DWORD *out_len, DWORD par
len2 = WideCharToMultiByte(CP_ACP, 0, outW, len + 1, out, *out_len, NULL, NULL);
*out_len = len2 - 1;
heap_free(inW);
+ if (hr == S_OK && !*out_len) hr = S_FALSE;
return hr;
}
@@ -4382,7 +4383,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
}
TRACE("len=%ld %s\n", *out_len, wine_dbgstr_w(out));
- return *out_len ? S_OK : S_FALSE;
+ return S_OK;
}
BOOL WINAPI UrlIsA(const char *url, URLIS Urlis)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index 476358c6d45..31581f82847 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -748,8 +748,6 @@ static void test_UrlGetPart(void)
{"telnet://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "telnet:hostname"},
};
- winetest_mute_threshold = 5;
-
hr = UrlGetPartA(NULL, NULL, NULL, URL_PART_SCHEME, 0);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
@@ -837,7 +835,7 @@ static void test_UrlGetPart(void)
size = 1;
wcscpy(bufferW, L"x");
hr = UrlGetPartW(urlW, bufferW, &size, part, flags);
- todo_wine_if (tests[i].todo_hr || tests[i].hr == S_FALSE)
+ todo_wine_if (tests[i].todo_hr)
{
if (tests[i].hr == S_OK)
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
@@ -870,7 +868,7 @@ static void test_UrlGetPart(void)
size = ARRAY_SIZE(bufferW);
wcscpy(bufferW, L"x");
hr = UrlGetPartW(urlW, bufferW, &size, part, flags);
- todo_wine_if ((tests[i].hr == S_FALSE || tests[i].todo_hr) && strcmp(url, "a:") && strcmp(url, "0:"))
+ todo_wine_if (tests[i].todo_hr && strcmp(url, "a:") && strcmp(url, "0:"))
ok(hr == (tests[i].hr == S_FALSE ? S_OK : tests[i].hr), "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
@@ -886,8 +884,6 @@ static void test_UrlGetPart(void)
winetest_pop_context();
}
-
- winetest_mute_threshold = 42;
}
/* ########################### */
--
2.34.1
1
3
Signed-off-by: Byeongsik Jeon <bsjeon(a)hanmail.net>
---
po/ko.po | 117 ++++++++++++++++++++++++-------------------------------
1 file changed, 51 insertions(+), 66 deletions(-)
diff --git a/po/ko.po b/po/ko.po
index 34823747a8d..209366150ea 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2021-12-30 11:19+0900\n"
+"PO-Revision-Date: 2022-03-23 11:25+0900\n"
"Last-Translator: Byeongsik Jeon <bsjeon(a)hanmail.net>\n"
"Language-Team: Korean\n"
"Language: ko\n"
@@ -240,8 +240,8 @@ msgstr ""
"다.\n"
"\n"
"참고: 배포판이 제공하는 wine-mono 패키지 사용을 추천합니다. 자세한 내용은 <a "
-"href=\"https://wiki.winehq.org/Mono\">https://wiki.winehq.org/Mono</a>를 보십"
-"시오."
+"href=\"https://wiki.winehq.org/Mono\">https://wiki.winehq.org/Mono</a>를 참고"
+"하세요."
#: dlls/appwiz.cpl/appwiz.rc:31
msgid "Add/Remove Programs"
@@ -3954,13 +3954,11 @@ msgstr ""
#: dlls/jscript/jscript.rc:74
msgid "Cyclic __proto__ value"
-msgstr ""
+msgstr "순환하는 __proto__ 값"
#: dlls/jscript/jscript.rc:75
-#, fuzzy
-#| msgid "Cannot define property '|': object is not extensible"
msgid "Cannot create property for a non-extensible object"
-msgstr "확장 가능하지 않은 속성 '|'을(를) 정의할 수 없습니다"
+msgstr "확장 가능하지 않은 개체에 대한 속성을 만들 수 없습니다"
#: dlls/jscript/jscript.rc:76
msgid "Cannot define property '|': object is not extensible"
@@ -6948,54 +6946,40 @@ msgid "This network connection does not exist.\n"
msgstr "네트워크 연결이 없습니다.\n"
#: dlls/kernel32/winerror.mc:3748
-#, fuzzy
-#| msgid "Invalid at interrupt time.\n"
msgid "Call interrupted.\n"
-msgstr "잘못된 인터럽트 시간.\n"
+msgstr "호출이 중단되었습니다.\n"
#: dlls/kernel32/winerror.mc:3753
-#, fuzzy
-#| msgid "Invalid handle.\n"
msgid "Invalid file handle.\n"
-msgstr "잘못된 핸들입니다.\n"
+msgstr "파일 핸들이 잘못되었습니다.\n"
#: dlls/kernel32/winerror.mc:3763
-#, fuzzy
-#| msgid "Invalid network address.\n"
msgid "Invalid pointer address.\n"
-msgstr "잘못된 네트워크 주소.\n"
+msgstr "주소가 잘못되었습니다.\n"
#: dlls/kernel32/winerror.mc:3768
-#, fuzzy
-#| msgid "Invalid name.\n"
msgid "Invalid argument.\n"
-msgstr "잘못된 이름.\n"
+msgstr "인수가 잘못되었습니다.\n"
#: dlls/kernel32/winerror.mc:3778
msgid "Connection reset by peer.\n"
-msgstr "피어가 연결을 초기화 했습니다.\n"
+msgstr "피어가 연결을 다시 설정했습니다.\n"
#: dlls/kernel32/winerror.mc:3788
-#, fuzzy
-#| msgid "Point not found.\n"
msgid "Host not found.\n"
-msgstr "포인트를 찾을 수 없습니다.\n"
+msgstr "호스트를 찾을 수 없습니다.\n"
#: dlls/kernel32/winerror.mc:3793
-#, fuzzy
-#| msgid "Attribute is not found.\n"
msgid "Nonauthoritative host not found.\n"
-msgstr "특성을 찾을 수 없습니다.\n"
+msgstr "일시적으로 호스트를 찾을 수 없습니다.\n"
#: dlls/kernel32/winerror.mc:3798
-#, fuzzy
-#| msgid "Unrecoverable error occurred.\n"
msgid "Nonrecoverable error.\n"
-msgstr "복구할 수 없는 오류가 발생했습니다.\n"
+msgstr "복구할 수 없는 오류입니다.\n"
#: dlls/kernel32/winerror.mc:3803
msgid "Name valid, no data record.\n"
-msgstr ""
+msgstr "유효한 이름입니다만, 요청한 데이터 레코드가 없습니다.\n"
#: dlls/kernel32/winerror.mc:3817
msgid "Not implemented.\n"
@@ -7011,7 +6995,7 @@ msgstr "파일에서 서명을 찾을 수 없습니다.\n"
#: dlls/kernel32/winerror.mc:3824
msgid "Invalid call.\n"
-msgstr "잘못된 호출.\n"
+msgstr "잘못된 호출입니다.\n"
#: dlls/kernel32/winerror.mc:3831
msgid "Resource is not currently available.\n"
@@ -9135,8 +9119,8 @@ msgid ""
"Provider is no longer available. Ensure that the provider is installed "
"properly."
msgstr ""
-"공급자를 더 이상 사용할 수 없습니다. 공급자가 올바르게 설치되었는지 확인하십"
-"시오."
+"공급자를 더 이상 사용할 수 없습니다. 공급자가 올바르게 설치되었는지 확인하세"
+"요."
#: dlls/oledb32/version.rc:36
msgid "Data Link Properties"
@@ -9427,7 +9411,7 @@ msgid ""
"make sure the correct drive is selected below"
msgstr ""
"제조업체 설치 디스크를 삽입하고,\n"
-"아래의 선택된 드라이브가 올바른지 확인하시오"
+"아래의 선택된 드라이브가 올바른지 확인하세요"
#: dlls/setupapi/setupapi.rc:57
msgid "Copy manufacturer's files from:"
@@ -10193,7 +10177,8 @@ msgstr "'%1' 항목을 휴지통으로 보내시겠습니까?"
#: dlls/shell32/shell32.rc:177
msgid "The item '%1' can't be sent to Trash. Do you want to delete it instead?"
-msgstr "항목'%1'을(를) 휴지통으로 보낼 수 없습니다. 대신에 지우시겠습니까?"
+msgstr ""
+"항목'%1'을(를) 휴지통으로 보낼 수 없습니다. 대신 완전히 지우시겠습니까?"
#: dlls/shell32/shell32.rc:184
msgid ""
@@ -15141,7 +15126,7 @@ msgid ""
msgstr ""
"파일 '%s'이(가) 변경되었습니다.\n"
"\n"
-"변결 내용을 저장하시겠습니까?"
+"변경 내용을 저장하시겠습니까?"
#: programs/notepad/notepad.rc:83
msgid "'%s' could not be found."
@@ -15781,7 +15766,7 @@ msgstr ""
"지원하는 작업:\n"
" ADD | DELETE | IMPORT | EXPORT | QUERY\n"
"\n"
-"특정 작업에 대한 도움말을 보려면 다음을 입력하십시오.\n"
+"특정 작업에 대한 도움말을 보려면 다음처럼 입력하세요.\n"
" REG [작업] /?\n"
"\n"
@@ -16013,7 +15998,7 @@ msgstr ""
" 레지스트리 값 이름의 데이터를 삭제합니다.\n"
"\n"
" /va\n"
-" 레지스트리 키 아래의 모든 값을 삭제하니다.\n"
+" 레지스트리 키 아래의 모든 값을 삭제합니다.\n"
"\n"
" /f\n"
" 확인 절차 없이 (모든 하위키 및 값과 함께) 레지스트리 키를\n"
@@ -17442,7 +17427,7 @@ msgstr "열 선택"
#: programs/taskmgr/taskmgr.rc:519
msgid ""
"Select the columns that will appear on the Process page of the Task Manager."
-msgstr "작업 관리자의 프로세스 페이지에 표시될 열을 선택하십시오."
+msgstr "작업 관리자의 프로세스 페이지에 표시될 열을 선택하세요."
#: programs/taskmgr/taskmgr.rc:521
msgid "&Image Name"
@@ -18426,7 +18411,7 @@ msgstr ""
#: programs/winecfg/winecfg.rc:76
msgctxt "Drive letter"
msgid "Letter"
-msgstr "문자"
+msgstr "드라이브"
#: programs/winecfg/winecfg.rc:77
msgid "Target folder"
@@ -18831,19 +18816,19 @@ msgstr "새 게임(&N)\tF2"
#: programs/winemine/winemine.rc:42
msgid "Question &Marks"
-msgstr "물음표(&M)"
+msgstr "물음표 표시(&M)"
#: programs/winemine/winemine.rc:44
msgid "&Beginner"
-msgstr "초보자(&B)"
+msgstr "초급(&B)"
#: programs/winemine/winemine.rc:45
msgid "&Intermediate"
-msgstr "중급자(&I)"
+msgstr "중급(&I)"
#: programs/winemine/winemine.rc:46
msgid "&Expert"
-msgstr "전문가(&E)"
+msgstr "고급(&E)"
#: programs/winemine/winemine.rc:47
msgid "&Custom..."
@@ -18851,15 +18836,15 @@ msgstr "사용자 정의(&C)..."
#: programs/winemine/winemine.rc:49
msgid "&Fastest Times"
-msgstr "가장 빠른 시간(&F)"
+msgstr "기록 보기(&F)"
#: programs/winemine/winemine.rc:54
msgid "&About WineMine"
-msgstr "지뢰찾기 정보(&A)"
+msgstr "지뢰 찾기 정보(&A)"
#: programs/winemine/winemine.rc:61
msgid "Fastest Times"
-msgstr "최단 시간"
+msgstr "최단 시간 기록"
#: programs/winemine/winemine.rc:63
msgid "Fastest times"
@@ -18867,19 +18852,19 @@ msgstr "최단 시간"
#: programs/winemine/winemine.rc:64
msgid "Beginner"
-msgstr "초보자"
+msgstr "초급"
#: programs/winemine/winemine.rc:65
msgid "Intermediate"
-msgstr "중급자"
+msgstr "중급"
#: programs/winemine/winemine.rc:66
msgid "Expert"
-msgstr "전문가"
+msgstr "고급"
#: programs/winemine/winemine.rc:74 programs/winemine/winemine.rc:33
msgid "Reset Results"
-msgstr "초기화 결과"
+msgstr "초기화"
#: programs/winemine/winemine.rc:80
msgid "Congratulations!"
@@ -18891,31 +18876,31 @@ msgstr "이름을 입력해 주세요"
#: programs/winemine/winemine.rc:90
msgid "Custom Game"
-msgstr "사용자 지정 게임"
+msgstr "사용자 정의"
#: programs/winemine/winemine.rc:92
msgid "Rows"
-msgstr "가로줄"
+msgstr "높이"
#: programs/winemine/winemine.rc:93
msgid "Columns"
-msgstr "세로줄"
+msgstr "너비"
#: programs/winemine/winemine.rc:94
msgid "Mines"
-msgstr "지뢰"
+msgstr "지뢰 수"
#: programs/winemine/winemine.rc:34
msgid "All results will be lost. Are you sure?"
-msgstr "모든 결과를 잃습니다. 계속 진행하시겠습니까?"
+msgstr "모든 기록이 초기화됩니다. 계속 진행하시겠습니까?"
#: programs/winemine/winemine.rc:30
msgid "WineMine"
-msgstr "지뢰찾기"
+msgstr "지뢰 찾기"
#: programs/winemine/winemine.rc:31
msgid "Nobody"
-msgstr "아무개"
+msgstr "익명"
#: programs/winemine/winemine.rc:32
msgid "Copyright 2000 Joshua Thielen"
@@ -18983,7 +18968,7 @@ msgstr "Wine 도움말"
#: programs/winhlp32/winhlp32.rc:86
msgid "Error while reading the help file `%s'"
-msgstr "도움말 파일 `%s'를 읽는 도중 오류 발생"
+msgstr "도움말 파일 '%s'을(를) 읽는 동안 오류 발생"
#: programs/winhlp32/winhlp32.rc:88
msgid "Summary"
@@ -18999,31 +18984,31 @@ msgstr "도움말 파일 (*.hlp)"
#: programs/winhlp32/winhlp32.rc:92
msgid "Cannot find '%s'. Do you want to find this file yourself?"
-msgstr "%s을(를) 찾을 수 없습니다'. 이 파일을 직접 찾으시겠습니까?"
+msgstr "'%s'을(를) 찾을 수 없습니다. 파일을 직접 찾으시겠습니까?"
#: programs/winhlp32/winhlp32.rc:93
msgid "Cannot find a richedit implementation... Aborting"
-msgstr "Richedit 구현을 찾을 수 없습니다... 취소중"
+msgstr "Richedit 구현을 찾을 수 없습니다... 취소 중"
#: programs/winhlp32/winhlp32.rc:94
msgid "Help topics: "
-msgstr "도움말 목차: "
+msgstr "도움말 항목: "
#: programs/wmic/wmic.rc:28
msgid "Error: Command line not supported\n"
-msgstr "오류: 명령 라인은 지원되지 않음\n"
+msgstr "오류: 명령 줄은 지원하지 않습니다\n"
#: programs/wmic/wmic.rc:29
msgid "Error: Alias not found\n"
-msgstr "오류: Alias를 찾을 수 없음\n"
+msgstr "오류: 별칭을 찾을 수 없습니다\n"
#: programs/wmic/wmic.rc:30
msgid "Error: Invalid query\n"
-msgstr "오류: 잘못된 질의\n"
+msgstr "오류: 잘못된 질의입니다\n"
#: programs/wmic/wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
-msgstr "오류: 잘못된 키 이름\n"
+msgstr "오류: 잘못된 구문입니다\n"
#: programs/wordpad/wordpad.rc:31
msgid "&New...\tCtrl+N"
--
2.35.1
1
0
[PATCH] d3dcompiler: Implement D3DCompile2() using vkd3d_shader_compile().
by Zebediah Figura 22 Mar '22
by Zebediah Figura 22 Mar '22
22 Mar '22
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51713
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/d3dcompiler_33/Makefile.in | 3 +-
dlls/d3dcompiler_34/Makefile.in | 3 +-
dlls/d3dcompiler_35/Makefile.in | 3 +-
dlls/d3dcompiler_36/Makefile.in | 3 +-
dlls/d3dcompiler_37/Makefile.in | 3 +-
dlls/d3dcompiler_38/Makefile.in | 3 +-
dlls/d3dcompiler_39/Makefile.in | 3 +-
dlls/d3dcompiler_40/Makefile.in | 3 +-
dlls/d3dcompiler_41/Makefile.in | 3 +-
dlls/d3dcompiler_42/Makefile.in | 3 +-
dlls/d3dcompiler_43/Makefile.in | 2 +
dlls/d3dcompiler_43/compiler.c | 220 ++++++++++++++++++++++---
dlls/d3dcompiler_43/tests/hlsl_d3d11.c | 96 +++++------
dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 214 +++++++++++-------------
dlls/d3dcompiler_46/Makefile.in | 3 +-
dlls/d3dcompiler_47/Makefile.in | 3 +-
16 files changed, 358 insertions(+), 210 deletions(-)
diff --git a/dlls/d3dcompiler_33/Makefile.in b/dlls/d3dcompiler_33/Makefile.in
index 7130fb48376..988230890d8 100644
--- a/dlls/d3dcompiler_33/Makefile.in
+++ b/dlls/d3dcompiler_33/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_33.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=33
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_34/Makefile.in b/dlls/d3dcompiler_34/Makefile.in
index e4dfc72cae8..fb5ff5d0489 100644
--- a/dlls/d3dcompiler_34/Makefile.in
+++ b/dlls/d3dcompiler_34/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_34.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=34
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_35/Makefile.in b/dlls/d3dcompiler_35/Makefile.in
index 56c87186c2e..5e94da0e14b 100644
--- a/dlls/d3dcompiler_35/Makefile.in
+++ b/dlls/d3dcompiler_35/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_35.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=35
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_36/Makefile.in b/dlls/d3dcompiler_36/Makefile.in
index f23ac2cb990..3a1f13a064e 100644
--- a/dlls/d3dcompiler_36/Makefile.in
+++ b/dlls/d3dcompiler_36/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_36.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=36
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_37/Makefile.in b/dlls/d3dcompiler_37/Makefile.in
index 331f5f5f068..4afb74e419a 100644
--- a/dlls/d3dcompiler_37/Makefile.in
+++ b/dlls/d3dcompiler_37/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_37.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=37
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_38/Makefile.in b/dlls/d3dcompiler_38/Makefile.in
index b34c2322aae..304548baadd 100644
--- a/dlls/d3dcompiler_38/Makefile.in
+++ b/dlls/d3dcompiler_38/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_38.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=38
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_39/Makefile.in b/dlls/d3dcompiler_39/Makefile.in
index cf4dc2cdd83..87cb11b9572 100644
--- a/dlls/d3dcompiler_39/Makefile.in
+++ b/dlls/d3dcompiler_39/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_39.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=39
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_40/Makefile.in b/dlls/d3dcompiler_40/Makefile.in
index c8d415baf83..443132d7002 100644
--- a/dlls/d3dcompiler_40/Makefile.in
+++ b/dlls/d3dcompiler_40/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_40.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=40
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_41/Makefile.in b/dlls/d3dcompiler_41/Makefile.in
index 2fa69b5a18d..a71dca88e6c 100644
--- a/dlls/d3dcompiler_41/Makefile.in
+++ b/dlls/d3dcompiler_41/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_41.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=41
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_42/Makefile.in b/dlls/d3dcompiler_42/Makefile.in
index d821b888bde..ea9f0fc3faa 100644
--- a/dlls/d3dcompiler_42/Makefile.in
+++ b/dlls/d3dcompiler_42/Makefile.in
@@ -1,7 +1,8 @@
MODULE = d3dcompiler_42.dll
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=42
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_43/Makefile.in b/dlls/d3dcompiler_43/Makefile.in
index b527f1681d7..b69f3749626 100644
--- a/dlls/d3dcompiler_43/Makefile.in
+++ b/dlls/d3dcompiler_43/Makefile.in
@@ -1,6 +1,8 @@
MODULE = d3dcompiler_43.dll
IMPORTLIB = d3dcompiler_43
EXTRADEFS = -DD3D_COMPILER_VERSION=43
+IMPORTS = wined3d
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c
index 6ae51c75cd4..4d2642f17e3 100644
--- a/dlls/d3dcompiler_43/compiler.c
+++ b/dlls/d3dcompiler_43/compiler.c
@@ -1,6 +1,7 @@
/*
* Copyright 2009 Matteo Bruni
* Copyright 2010 Matteo Bruni for CodeWeavers
+ * Copyright 2016,2018 Józef Kucia for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,8 +26,33 @@
#include "d3dcompiler_private.h"
#include "wpp_private.h"
+#include <vkd3d_shader.h>
+
WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler);
+static HRESULT hresult_from_vkd3d_result(int vkd3d_result)
+{
+ switch (vkd3d_result)
+ {
+ case VKD3D_OK:
+ return S_OK;
+ case VKD3D_ERROR_INVALID_SHADER:
+ WARN("Invalid shader bytecode.\n");
+ /* fall-through */
+ case VKD3D_ERROR:
+ return E_FAIL;
+ case VKD3D_ERROR_OUT_OF_MEMORY:
+ return E_OUTOFMEMORY;
+ case VKD3D_ERROR_INVALID_ARGUMENT:
+ return E_INVALIDARG;
+ case VKD3D_ERROR_NOT_IMPLEMENTED:
+ return E_NOTIMPL;
+ default:
+ FIXME("Unhandled vkd3d result %d.\n", vkd3d_result);
+ return E_FAIL;
+ }
+}
+
#define D3DXERR_INVALIDDATA 0x88760b59
#define BUFFER_INITIAL_CAPACITY 256
@@ -736,39 +762,179 @@ HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filena
return hr;
}
-HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
- const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint,
- const char *target, UINT sflags, UINT eflags, UINT secondary_flags,
- const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader,
- ID3DBlob **error_messages)
+static int open_include(const char *filename, bool local, const char *parent_data, void *context,
+ struct vkd3d_shader_code *code)
{
+ ID3DInclude *iface = context;
+ unsigned int size = 0;
+
+ if (!iface)
+ return VKD3D_ERROR;
+
+ memset(code, 0, sizeof(*code));
+ if (FAILED(ID3DInclude_Open(iface, local ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM,
+ filename, parent_data, &code->code, &size)))
+ return VKD3D_ERROR;
+
+ code->size = size;
+ return VKD3D_OK;
+}
+
+static void close_include(const struct vkd3d_shader_code *code, void *context)
+{
+ ID3DInclude *iface = context;
+
+ ID3DInclude_Close(iface, code->code);
+}
+
+HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename,
+ const D3D_SHADER_MACRO *macros, ID3DInclude *include, const char *entry_point,
+ const char *profile, UINT flags, UINT effect_flags, UINT secondary_flags,
+ const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader_blob,
+ ID3DBlob **messages_blob)
+{
+ struct d3dcompiler_include_from_file include_from_file;
+ struct vkd3d_shader_preprocess_info preprocess_info;
+ struct vkd3d_shader_hlsl_source_info hlsl_info;
+ struct vkd3d_shader_compile_option options[2];
+ struct vkd3d_shader_compile_info compile_info;
+ struct vkd3d_shader_compile_option *option;
+ struct vkd3d_shader_code byte_code;
+ const D3D_SHADER_MACRO *macro;
+ size_t profile_len, i;
+ char *messages;
HRESULT hr;
+ int ret;
- TRACE("data %p, data_size %Iu, filename %s, defines %p, include %p, entrypoint %s, "
- "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, "
- "secondary_data_size %Iu, shader %p, error_messages %p.\n",
- data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
- debugstr_a(target), sflags, eflags, secondary_flags, secondary_data,
- secondary_data_size, shader, error_messages);
-
- if (secondary_data)
- FIXME("secondary data not implemented yet\n");
-
- if (shader) *shader = NULL;
- if (error_messages) *error_messages = NULL;
-
- EnterCriticalSection(&wpp_mutex);
-
- hr = preprocess_shader(data, data_size, filename, defines, include, error_messages);
- if (SUCCEEDED(hr))
+ static const char * const d3dbc_profiles[] =
{
- FIXME("HLSL shader compilation is not yet implemented.\n");
- hr = E_NOTIMPL;
+ "fx_2_",
+
+ "ps.1.",
+ "ps.2.",
+ "ps.3.",
+
+ "ps_1_",
+ "ps_2_",
+ "ps_3_",
+
+ "vs.1.",
+ "vs.2.",
+ "vs.3.",
+
+ "vs_1_",
+ "vs_2_",
+ "vs_3_",
+
+ "tx_1_",
+ };
+
+ TRACE("data %p, data_size %Iu, filename %s, macros %p, include %p, entry_point %s, "
+ "profile %s, flags %#x, effect_flags %#x, secondary_flags %#x, secondary_data %p, "
+ "secondary_data_size %Iu, shader_blob %p, messages_blob %p.\n",
+ data, data_size, debugstr_a(filename), macros, include, debugstr_a(entry_point),
+ debugstr_a(profile), flags, effect_flags, secondary_flags, secondary_data,
+ secondary_data_size, shader_blob, messages_blob);
+
+ if (include == D3D_COMPILE_STANDARD_FILE_INCLUDE)
+ {
+ include_from_file.ID3DInclude_iface.lpVtbl = &d3dcompiler_include_from_file_vtbl;
+ include = &include_from_file.ID3DInclude_iface;
}
- HeapFree(GetProcessHeap(), 0, wpp_output);
- LeaveCriticalSection(&wpp_mutex);
- return hr;
+ if (flags & ~D3DCOMPILE_DEBUG)
+ FIXME("Ignoring flags %#x.\n", flags);
+ if (effect_flags)
+ FIXME("Ignoring effect flags %#x.\n", effect_flags);
+ if (secondary_flags)
+ FIXME("Ignoring secondary flags %#x.\n", secondary_flags);
+
+ if (messages_blob)
+ *messages_blob = NULL;
+
+ option = &options[0];
+ option->name = VKD3D_SHADER_COMPILE_OPTION_API_VERSION;
+ option->value = VKD3D_SHADER_API_VERSION_1_3;
+
+ compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
+ compile_info.next = &preprocess_info;
+ compile_info.source.code = data;
+ compile_info.source.size = data_size;
+ compile_info.source_type = VKD3D_SHADER_SOURCE_HLSL;
+ compile_info.target_type = VKD3D_SHADER_TARGET_DXBC_TPF;
+ compile_info.options = options;
+ compile_info.option_count = 1;
+ compile_info.log_level = VKD3D_SHADER_LOG_INFO;
+ compile_info.source_name = filename;
+
+ profile_len = strlen(profile);
+ for (i = 0; i < ARRAY_SIZE(d3dbc_profiles); ++i)
+ {
+ size_t len = strlen(d3dbc_profiles[i]);
+
+ if (len <= profile_len && !memcmp(profile, d3dbc_profiles[i], len))
+ {
+ compile_info.target_type = VKD3D_SHADER_TARGET_D3D_BYTECODE;
+ break;
+ }
+ }
+
+ preprocess_info.type = VKD3D_SHADER_STRUCTURE_TYPE_PREPROCESS_INFO;
+ preprocess_info.next = &hlsl_info;
+ preprocess_info.macros = (const struct vkd3d_shader_macro *)macros;
+ preprocess_info.macro_count = 0;
+ if (macros)
+ {
+ for (macro = macros; macro->Name; ++macro)
+ ++preprocess_info.macro_count;
+ }
+ preprocess_info.pfn_open_include = open_include;
+ preprocess_info.pfn_close_include = close_include;
+ preprocess_info.include_context = include;
+
+ hlsl_info.type = VKD3D_SHADER_STRUCTURE_TYPE_HLSL_SOURCE_INFO;
+ hlsl_info.next = NULL;
+ hlsl_info.profile = profile;
+ hlsl_info.entry_point = entry_point;
+ hlsl_info.secondary_code.code = secondary_data;
+ hlsl_info.secondary_code.size = secondary_data_size;
+
+ if (!(flags & D3DCOMPILE_DEBUG))
+ {
+ option = &options[compile_info.option_count++];
+ option->name = VKD3D_SHADER_COMPILE_OPTION_STRIP_DEBUG;
+ option->value = true;
+ }
+
+ ret = vkd3d_shader_compile(&compile_info, &byte_code, &messages);
+ if (messages)
+ {
+ if (messages_blob)
+ {
+ size_t size = strlen(messages);
+ if (FAILED(hr = D3DCreateBlob(size, messages_blob)))
+ {
+ vkd3d_shader_free_messages(messages);
+ vkd3d_shader_free_shader_code(&byte_code);
+ return hr;
+ }
+ memcpy(ID3D10Blob_GetBufferPointer(*messages_blob), messages, size);
+ }
+ else
+ vkd3d_shader_free_messages(messages);
+ }
+
+ if (!ret)
+ {
+ if (FAILED(hr = D3DCreateBlob(byte_code.size, shader_blob)))
+ {
+ vkd3d_shader_free_shader_code(&byte_code);
+ return hr;
+ }
+ memcpy(ID3D10Blob_GetBufferPointer(*shader_blob), byte_code.code, byte_code.size);
+ }
+
+ return hresult_from_vkd3d_result(ret);
}
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename,
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
index 5f7846a479b..4f52002866e 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d11.c
@@ -383,20 +383,17 @@ static void test_swizzle(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
- if (ps_code)
- {
- cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniform), &uniform);
- ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
- draw_quad(&test_context, ps_code);
+ ps_code = compile_shader(ps_source, "ps_4_0");
+ cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniform), &uniform);
+ ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
+ draw_quad(&test_context, ps_code);
- v = get_color_vec4(&test_context, 0, 0);
- ok(compare_vec4(&v, 0.0101f, 0.0303f, 0.0202f, 0.0404f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(&test_context, 0, 0);
+ ok(compare_vec4(&v, 0.0101f, 0.0303f, 0.0202f, 0.0404f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D11Buffer_Release(cb);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D11Buffer_Release(cb);
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -421,20 +418,17 @@ static void test_math(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
- if (ps_code)
- {
- cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniforms), uniforms);
- ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
- draw_quad(&test_context, ps_code);
+ ps_code = compile_shader(ps_source, "ps_4_0");
+ cb = create_buffer(test_context.device, D3D11_BIND_CONSTANT_BUFFER, sizeof(uniforms), uniforms);
+ ID3D11DeviceContext_PSSetConstantBuffers(test_context.immediate_context, 0, 1, &cb);
+ draw_quad(&test_context, ps_code);
- v = get_color_vec4(&test_context, 0, 0);
- ok(compare_vec4(&v, -12.43f, 9.833333f, 1.6f, 35.0f, 1),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(&test_context, 0, 0);
+ ok(compare_vec4(&v, -12.43f, 9.833333f, 1.6f, 35.0f, 1),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D11Buffer_Release(cb);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D11Buffer_Release(cb);
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -458,29 +452,26 @@ static void test_conditionals(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_4_0");
- if (ps_code)
+ ps_code = compile_shader(ps_source, "ps_4_0");
+ draw_quad(&test_context, ps_code);
+ init_readback(&test_context, &rb);
+
+ for (i = 0; i < 200; i += 40)
{
- draw_quad(&test_context, ps_code);
- init_readback(&test_context, &rb);
-
- for (i = 0; i < 200; i += 40)
- {
- v = get_readback_vec4(&rb, i, 0);
- ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
- }
-
- for (i = 240; i < 640; i += 40)
- {
- v = get_readback_vec4(&rb, i, 0);
- ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
- }
-
- release_readback(&test_context, &rb);
- ID3D10Blob_Release(ps_code);
+ v = get_readback_vec4(&rb, i, 0);
+ ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
}
+
+ for (i = 240; i < 640; i += 40)
+ {
+ v = get_readback_vec4(&rb, i, 0);
+ ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
+ }
+
+ release_readback(&test_context, &rb);
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -621,7 +612,8 @@ static void test_sampling(void)
winetest_push_context("Test %u", i);
ID3D11DeviceContext_ClearRenderTargetView(test_context.immediate_context, test_context.rtv, red);
- todo_wine ps_code = compile_shader_flags(tests[i], "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY);
+ todo_wine_if (i < 3)
+ ps_code = compile_shader_flags(tests[i], "ps_4_0", D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY);
if (ps_code)
{
draw_quad(&test_context, ps_code);
@@ -937,10 +929,12 @@ static void test_reflection(void)
static void check_parameter_desc(const D3D11_SIGNATURE_PARAMETER_DESC *desc,
const D3D11_SIGNATURE_PARAMETER_DESC *expect)
{
- ok(!strcmp(desc->SemanticName, expect->SemanticName), "Got name %s.\n", debugstr_a(desc->SemanticName));
+ todo_wine_if(strcmp(desc->SemanticName, expect->SemanticName))
+ ok(!strcmp(desc->SemanticName, expect->SemanticName), "Got name %s.\n", debugstr_a(desc->SemanticName));
ok(desc->SemanticIndex == expect->SemanticIndex, "Got index %u.\n", desc->SemanticIndex);
ok(desc->Register == expect->Register, "Got register %u.\n", desc->Register);
- ok(desc->SystemValueType == expect->SystemValueType, "Got sysval %u.\n", desc->SystemValueType);
+ todo_wine_if(desc->SystemValueType != expect->SystemValueType)
+ ok(desc->SystemValueType == expect->SystemValueType, "Got sysval %u.\n", desc->SystemValueType);
ok(desc->ComponentType == expect->ComponentType, "Got data type %u.\n", desc->ComponentType);
ok(desc->Mask == expect->Mask, "Got mask %#x.\n", desc->Mask);
todo_wine_if(desc->ReadWriteMask != expect->ReadWriteMask)
@@ -1129,7 +1123,7 @@ static void test_semantic_reflection(void)
{
winetest_push_context("Test %u", i);
- todo_wine code = compile_shader_flags(tests[i].source, tests[i].target,
+ todo_wine_if (i > 5) code = compile_shader_flags(tests[i].source, tests[i].target,
tests[i].legacy ? D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY : 0);
if (!code)
{
@@ -1143,9 +1137,9 @@ static void test_semantic_reflection(void)
hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
- todo_wine ok(shader_desc.InputParameters == tests[i].input_count,
+ ok(shader_desc.InputParameters == tests[i].input_count,
"Got %u input parameters.\n", shader_desc.InputParameters);
- todo_wine ok(shader_desc.OutputParameters == tests[i].output_count,
+ ok(shader_desc.OutputParameters == tests[i].output_count,
"Got %u output parameters.\n", shader_desc.OutputParameters);
for (j = 0; j < shader_desc.InputParameters; ++j)
diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
index 4461a3f869f..cbf32695625 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
@@ -454,25 +454,22 @@ static void test_swizzle(void)
for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
- todo_wine ps_code = compile_shader(tests[i].source, "ps_2_0");
- if (ps_code)
+ ps_code = compile_shader(tests[i].source, "ps_2_0");
+ if (i == 0)
{
- if (i == 0)
- {
- hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetVector(constants, device, "color", &color);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- ID3DXConstantTable_Release(constants);
- }
- draw_quad(device, ps_code);
-
- v = get_color_vec4(device, 0, 0);
- ok(compare_vec4(&v, tests[i].color.x, tests[i].color.y, tests[i].color.z, tests[i].color.w, 0),
- "Test %u: Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", i, v.x, v.y, v.z, v.w);
-
- ID3D10Blob_Release(ps_code);
+ hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetVector(constants, device, "color", &color);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ ID3DXConstantTable_Release(constants);
}
+ draw_quad(device, ps_code);
+
+ v = get_color_vec4(device, 0, 0);
+ ok(compare_vec4(&v, tests[i].color.x, tests[i].color.y, tests[i].color.z, tests[i].color.w, 0),
+ "Test %u: Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", i, v.x, v.y, v.z, v.w);
+
+ ID3D10Blob_Release(ps_code);
}
release_test_context(&test_context);
@@ -501,33 +498,30 @@ static void test_math(void)
return;
device = test_context.device;
- todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
- if (ps_code)
- {
- hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$u", 2.5f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$v", 0.3f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$w", 0.2f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$x", 0.7f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$y", 0.1f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- hr = ID3DXConstantTable_SetFloat(constants, device, "$z", 1.5f);
- ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
- ID3DXConstantTable_Release(constants);
+ ps_code = compile_shader(ps_source, "ps_2_0");
+ hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$u", 2.5f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$v", 0.3f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$w", 0.2f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$x", 0.7f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$y", 0.1f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ hr = ID3DXConstantTable_SetFloat(constants, device, "$z", 1.5f);
+ ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
+ ID3DXConstantTable_Release(constants);
- draw_quad(device, ps_code);
+ draw_quad(device, ps_code);
- v = get_color_vec4(device, 0, 0);
- ok(compare_vec4(&v, -12.43f, 9.833333f, 1.6f, 35.0f, 1),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(device, 0, 0);
+ ok(compare_vec4(&v, -12.43f, 9.833333f, 1.6f, 35.0f, 1),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -559,30 +553,27 @@ static void test_conditionals(void)
return;
device = test_context.device;
- todo_wine ps_code = compile_shader(ps_if_source, "ps_2_0");
- if (ps_code)
+ ps_code = compile_shader(ps_if_source, "ps_2_0");
+ draw_quad(device, ps_code);
+ init_readback(device, &rb);
+
+ for (i = 0; i < 200; i += 40)
{
- draw_quad(device, ps_code);
- init_readback(device, &rb);
-
- for (i = 0; i < 200; i += 40)
- {
- v = get_readback_vec4(&rb, i, 0);
- ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
- }
-
- for (i = 240; i < 640; i += 40)
- {
- v = get_readback_vec4(&rb, i, 0);
- ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
- }
-
- release_readback(&rb);
- ID3D10Blob_Release(ps_code);
+ v = get_readback_vec4(&rb, i, 0);
+ todo_wine ok(compare_vec4(v, 0.9f, 0.8f, 0.7f, 0.6f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
}
+ for (i = 240; i < 640; i += 40)
+ {
+ v = get_readback_vec4(&rb, i, 0);
+ todo_wine ok(compare_vec4(v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v->x, v->y, v->z, v->w);
+ }
+
+ release_readback(&rb);
+ ID3D10Blob_Release(ps_code);
+
todo_wine ps_code = compile_shader(ps_ternary_source, "ps_2_0");
if (ps_code)
{
@@ -737,17 +728,14 @@ static void test_comma(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
- if (ps_code)
- {
- draw_quad(test_context.device, ps_code);
+ ps_code = compile_shader(ps_source, "ps_2_0");
+ draw_quad(test_context.device, ps_code);
- v = get_color_vec4(test_context.device, 0, 0);
- ok(compare_vec4(&v, 0.6f, 0.7f, 0.8f, 0.9f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(test_context.device, 0, 0);
+ ok(compare_vec4(&v, 0.6f, 0.7f, 0.8f, 0.9f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -774,17 +762,14 @@ static void test_return(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(void_source, "ps_2_0");
- if (ps_code)
- {
- draw_quad(test_context.device, ps_code);
+ ps_code = compile_shader(void_source, "ps_2_0");
+ draw_quad(test_context.device, ps_code);
- v = get_color_vec4(test_context.device, 0, 0);
- ok(compare_vec4(&v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(test_context.device, 0, 0);
+ todo_wine ok(compare_vec4(&v, 0.1f, 0.2f, 0.3f, 0.4f, 0),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D10Blob_Release(ps_code);
todo_wine ps_code = compile_shader(implicit_conversion_source, "ps_2_0");
if (ps_code)
@@ -948,17 +933,14 @@ static void test_struct_assignment(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
- if (ps_code)
- {
- draw_quad(test_context.device, ps_code);
+ ps_code = compile_shader(ps_source, "ps_2_0");
+ draw_quad(test_context.device, ps_code);
- v = get_color_vec4(test_context.device, 0, 0);
- ok(compare_vec4(&v, 0.6f, 0.3f, 0.7f, 0.9f, 1),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(test_context.device, 0, 0);
+ ok(compare_vec4(&v, 0.6f, 0.3f, 0.7f, 0.9f, 1),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -993,22 +975,19 @@ static void test_struct_semantics(void)
if (!init_test_context(&test_context))
return;
- todo_wine ps_code = compile_shader(ps_source, "ps_2_0");
- if (ps_code)
- {
- draw_quad(test_context.device, ps_code);
+ ps_code = compile_shader(ps_source, "ps_2_0");
+ draw_quad(test_context.device, ps_code);
- v = get_color_vec4(test_context.device, 64, 48);
- v.z = v.w = 0.0f;
- todo_wine ok(compare_vec4(&v, 0.1f, 0.1f, 0.0f, 0.0f, 4096),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- v = get_color_vec4(test_context.device, 320, 240);
- v.z = v.w = 0.0f;
- todo_wine ok(compare_vec4(&v, 0.5f, 0.5f, 0.0f, 0.0f, 4096),
- "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(test_context.device, 64, 48);
+ v.z = v.w = 0.0f;
+ ok(compare_vec4(&v, 0.1f, 0.1f, 0.0f, 0.0f, 4096),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
+ v = get_color_vec4(test_context.device, 320, 240);
+ v.z = v.w = 0.0f;
+ ok(compare_vec4(&v, 0.5f, 0.5f, 0.0f, 0.0f, 4096),
+ "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w);
- ID3D10Blob_Release(ps_code);
- }
+ ID3D10Blob_Release(ps_code);
release_test_context(&test_context);
}
@@ -1122,7 +1101,7 @@ static void test_samplers(void)
{
hr = IDirect3DDevice9_Clear(test_context.device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0);
ok(hr == D3D_OK, "Test %u: Got unexpected hr %#lx.\n", i, hr);
- todo_wine ps_code = compile_shader(tests[i], "ps_2_0");
+ todo_wine_if (i < 3) ps_code = compile_shader(tests[i], "ps_2_0");
if (ps_code)
{
draw_quad(test_context.device, ps_code);
@@ -1434,12 +1413,9 @@ static void test_fail(void)
{
compiled = errors = NULL;
hr = D3DCompile(tests[i], strlen(tests[i]), NULL, NULL, NULL, "test", targets[j], 0, 0, &compiled, &errors);
- todo_wine ok(hr == E_FAIL, "Test %u, target %s: Got unexpected hr %#lx.\n", i, targets[j], hr);
- if (hr == E_FAIL)
- {
- ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]);
- ID3D10Blob_Release(errors);
- }
+ ok(hr == E_FAIL, "Test %u, target %s: Got unexpected hr %#lx.\n", i, targets[j], hr);
+ ok(!!errors, "Test %u, target %s, expected non-NULL error blob.\n", i, targets[j]);
+ ID3D10Blob_Release(errors);
ok(!compiled, "Test %u, target %s, expected no compiled shader blob.\n", i, targets[j]);
}
}
@@ -1634,7 +1610,7 @@ static void test_include(void)
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
}
- todo_wine_if (i == 1)
+ todo_wine_if (i != 0)
ok(!errors, "Got unexpected errors.\n");
if (blob)
{
@@ -1644,7 +1620,7 @@ static void test_include(void)
#if D3D_COMPILER_VERSION >= 46
hr = tests[i](NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, &blob, &errors);
- todo_wine_if (i == 0) ok(hr == (i == 0 ? D3DXERR_INVALIDDATA : E_FAIL), "Got unexpected hr %#lx.\n", hr);
+ todo_wine_if (i != 1) ok(hr == (i == 0 ? D3DXERR_INVALIDDATA : E_FAIL), "Got unexpected hr %#lx.\n", hr);
ok(!blob, "Got unexpected blob.\n");
ok(!!errors, "Got unexpected errors.\n");
ID3D10Blob_Release(errors);
@@ -1658,9 +1634,8 @@ static void test_include(void)
{
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
- }
- todo_wine_if (i == 1)
ok(!errors, "Got unexpected errors.\n");
+ }
if (blob)
{
ID3D10Blob_Release(blob);
@@ -1676,7 +1651,7 @@ static void test_include(void)
hr = D3DCompileFromFile(L"nonexistent", NULL, NULL, "main", "vs_2_0", 0, 0, &blob, &errors);
ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got unexpected hr %#lx.\n", hr);
ok(!blob, "Got unexpected blob.\n");
- ok(!errors, "Got unexpected errors.\n");
+ todo_wine ok(!errors, "Got unexpected errors.\n");
hr = D3DCompileFromFile(filename, NULL, NULL, "main", "ps_2_0", 0, 0, &blob, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
@@ -1689,7 +1664,7 @@ static void test_include(void)
hr = D3DCompileFromFile(filename, NULL, &include.ID3DInclude_iface, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
- ok(!errors, "Got unexpected errors.\n");
+ todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
@@ -1702,7 +1677,7 @@ static void test_include(void)
hr = D3DCompileFromFile(filename, NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
- ok(!errors, "Got unexpected errors.\n");
+ todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
@@ -1733,9 +1708,8 @@ static void test_include(void)
{
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!!blob, "Got unexpected blob.\n");
- }
- todo_wine_if (i == 1)
ok(!errors, "Got unexpected errors.\n");
+ }
if (blob)
{
ID3D10Blob_Release(blob);
@@ -1748,7 +1722,7 @@ static void test_include(void)
hr = D3DCompileFromFile(L"source.ps", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
todo_wine ok(!!blob, "Got unexpected blob.\n");
- ok(!errors, "Got unexpected errors.\n");
+ todo_wine ok(!errors, "Got unexpected errors.\n");
if (blob)
{
ID3D10Blob_Release(blob);
diff --git a/dlls/d3dcompiler_46/Makefile.in b/dlls/d3dcompiler_46/Makefile.in
index 066bd6fdd1c..187535772be 100644
--- a/dlls/d3dcompiler_46/Makefile.in
+++ b/dlls/d3dcompiler_46/Makefile.in
@@ -1,8 +1,9 @@
MODULE = d3dcompiler_46.dll
IMPORTLIB = d3dcompiler_46
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=46
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/d3dcompiler_47/Makefile.in b/dlls/d3dcompiler_47/Makefile.in
index 379f0aa4b3a..bc6ce091108 100644
--- a/dlls/d3dcompiler_47/Makefile.in
+++ b/dlls/d3dcompiler_47/Makefile.in
@@ -1,8 +1,9 @@
MODULE = d3dcompiler_47.dll
IMPORTLIB = d3dcompiler
-IMPORTS = dxguid uuid
+IMPORTS = wined3d dxguid uuid
EXTRADEFS = -DD3D_COMPILER_VERSION=47
PARENTSRC = ../d3dcompiler_43
+EXTRAINCL = $(VKD3D_PE_CFLAGS)
EXTRADLLFLAGS = -Wb,--prefer-native
--
2.35.1
3
2