Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 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
- 6 participants
- 84545 discussions
[PATCH 6/6] combase: Execute dllhost.exe for correct architecture in a WoW64 setup.
by Dmitry Timoshkov March 9, 2022
by Dmitry Timoshkov March 9, 2022
March 9, 2022
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/combase/combase.c | 2 +-
dlls/combase/rpc.c | 48 +++++++++++++++++++++++++++++---------
programs/dllhost/dllhost.c | 2 ++
3 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c
index fb8f453661f..376f270fdf1 100644
--- a/dlls/combase/combase.c
+++ b/dlls/combase/combase.c
@@ -350,7 +350,7 @@ HRESULT open_appidkey_from_clsid(REFCLSID clsid, REGSAM access, HKEY *subkey)
HRESULT hr;
/* read the AppID value under the class's key */
- hr = open_key_for_clsid(clsid, NULL, KEY_READ, &hkey);
+ hr = open_key_for_clsid(clsid, NULL, access, &hkey);
if (FAILED(hr))
return hr;
diff --git a/dlls/combase/rpc.c b/dlls/combase/rpc.c
index 40f900175dd..f620339f19e 100644
--- a/dlls/combase/rpc.c
+++ b/dlls/combase/rpc.c
@@ -526,18 +526,24 @@ static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process)
{
static const WCHAR processidW[] = L" /PROCESSID:";
HKEY key;
+ int arch = (sizeof(void *) > sizeof(int)) ? 64 : 32;
+ REGSAM opposite = (arch == 64) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
+ BOOL is_wow64 = FALSE;
HRESULT hr;
WCHAR command[MAX_PATH + ARRAY_SIZE(processidW) + CHARS_IN_GUID];
DWORD size;
- STARTUPINFOW sinfo;
- PROCESS_INFORMATION pinfo;
+ STARTUPINFOW si;
+ PROCESS_INFORMATION pi;
LONG ret;
TRACE("Attempting to start surrogate server for %s\n", debugstr_guid(rclsid));
hr = open_appidkey_from_clsid(rclsid, KEY_READ, &key);
- if (FAILED(hr))
- return hr;
+ if (FAILED(hr) && (arch == 64 || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
+ {
+ hr = open_appidkey_from_clsid(rclsid, opposite | KEY_READ, &key);
+ if (FAILED(hr)) return hr;
+ }
size = (MAX_PATH + 1) * sizeof(WCHAR);
ret = RegQueryValueExW(key, L"DllSurrogate", NULL, NULL, (LPBYTE)command, &size);
@@ -545,25 +551,45 @@ static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process)
if (ret || !size || !command[0])
{
TRACE("No value for DllSurrogate key\n");
- wcscpy(command, L"dllhost.exe");
+
+ if ((sizeof(void *) == 8 || is_wow64) && opposite == KEY_WOW64_32KEY)
+ GetSystemWow64DirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe"));
+ else
+ GetSystemDirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe"));
+
+ wcscat(command, L"\\dllhost.exe");
}
/* Surrogate EXE servers are started with the /PROCESSID:{GUID} switch. */
wcscat(command, processidW);
StringFromGUID2(rclsid, command + wcslen(command), CHARS_IN_GUID);
- memset(&sinfo, 0, sizeof(sinfo));
- sinfo.cb = sizeof(sinfo);
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
TRACE("Activating surrogate local server %s\n", debugstr_w(command));
- if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &sinfo, &pinfo))
+ if (is_wow64 && arch == 64)
+ {
+ void *cookie;
+ Wow64DisableWow64FsRedirection(&cookie);
+ if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
+ {
+ WARN("failed to run surrogate local server %s\n", debugstr_w(command));
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ }
+ Wow64RevertWow64FsRedirection(cookie);
+ }
+ else if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
{
WARN("failed to run surrogate local server %s\n", debugstr_w(command));
- return HRESULT_FROM_WIN32(GetLastError());
+ hr = HRESULT_FROM_WIN32(GetLastError());
}
- *process = pinfo.hProcess;
- CloseHandle(pinfo.hThread);
+
+ if (FAILED(hr)) return hr;
+
+ *process = pi.hProcess;
+ CloseHandle(pi.hThread);
return S_OK;
}
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index dc89c978510..83700826f8b 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -327,6 +327,8 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
CLSID clsid;
struct surrogate surrogate;
+ TRACE("Running as %u-bit\n", (int)sizeof(void *) * 8);
+
if (wcsnicmp(cmdline, L"/PROCESSID:", 11))
return 0;
--
2.35.1
1
0
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/wintrust/tests/Makefile.in | 1
dlls/wintrust/tests/asn.c | 208 ++++++++++++++++++-------------------
dlls/wintrust/tests/crypt.c | 222 ++++++++++++++++++++-------------------
dlls/wintrust/tests/register.c | 44 ++++----
dlls/wintrust/tests/softpub.c | 144 +++++++++++++------------
5 files changed, 309 insertions(+), 310 deletions(-)
diff --git a/dlls/wintrust/tests/Makefile.in b/dlls/wintrust/tests/Makefile.in
index c19db4558a9..87654a685ff 100644
--- a/dlls/wintrust/tests/Makefile.in
+++ b/dlls/wintrust/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wintrust.dll
IMPORTS = wintrust crypt32 advapi32
diff --git a/dlls/wintrust/tests/asn.c b/dlls/wintrust/tests/asn.c
index 82feac61bfe..9cb255d3048 100644
--- a/dlls/wintrust/tests/asn.c
+++ b/dlls/wintrust/tests/asn.c
@@ -46,20 +46,20 @@ static void test_encodeSPCFinancialCriteria(void)
}
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
&criteria, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(falseCriteria), "Unexpected size %d\n", size);
+ ok(size == sizeof(falseCriteria), "Unexpected size %ld\n", size);
ok(!memcmp(buf, falseCriteria, size), "Unexpected value\n");
LocalFree(buf);
}
criteria.fFinancialInfoAvailable = criteria.fMeetsCriteria = TRUE;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
&criteria, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(trueCriteria), "Unexpected size %d\n", size);
+ ok(size == sizeof(trueCriteria), "Unexpected size %ld\n", size);
ok(!memcmp(buf, trueCriteria, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -79,7 +79,7 @@ static void test_decodeSPCFinancialCriteria(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
falseCriteria, sizeof(falseCriteria), 0, NULL, &criteria, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(!criteria.fFinancialInfoAvailable, "expected FALSE\n");
@@ -87,7 +87,7 @@ static void test_decodeSPCFinancialCriteria(void)
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_FINANCIAL_CRITERIA_STRUCT,
trueCriteria, sizeof(trueCriteria), 0, NULL, &criteria, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(criteria.fFinancialInfoAvailable, "expected TRUE\n");
@@ -131,14 +131,14 @@ static void test_encodeSPCLink(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
ok(!ret && GetLastError() == E_INVALIDARG,
- "Expected E_INVALIDARG, got %08x\n", GetLastError());
+ "Expected E_INVALIDARG, got %08lx\n", GetLastError());
link.dwLinkChoice = SPC_URL_LINK_CHOICE;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptyURLSPCLink), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptyURLSPCLink), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptyURLSPCLink, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -151,18 +151,18 @@ static void test_encodeSPCLink(void)
ok(!ret &&
(GetLastError() == CRYPT_E_INVALID_IA5_STRING ||
GetLastError() == OSS_BAD_PTR /* WinNT */),
- "Expected CRYPT_E_INVALID_IA5_STRING, got %08x\n", GetLastError());
+ "Expected CRYPT_E_INVALID_IA5_STRING, got %08lx\n", GetLastError());
/* Unlike the crypt32 string encoding routines, size is not set to the
* index of the first invalid character.
*/
- ok(size == 0, "Expected size 0, got %d\n", size);
+ ok(size == 0, "Expected size 0, got %ld\n", size);
U(link).pwszUrl = url;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(urlSPCLink), "Unexpected size %d\n", size);
+ ok(size == sizeof(urlSPCLink), "Unexpected size %ld\n", size);
ok(!memcmp(buf, urlSPCLink, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -170,10 +170,10 @@ static void test_encodeSPCLink(void)
U(link).pwszFile = (LPWSTR)nihongoURL;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(fileSPCLink), "Unexpected size %d\n", size);
+ ok(size == sizeof(fileSPCLink), "Unexpected size %ld\n", size);
ok(!memcmp(buf, fileSPCLink, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -181,10 +181,10 @@ static void test_encodeSPCLink(void)
memset(&U(link).Moniker, 0, sizeof(U(link).Moniker));
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptyMonikerSPCLink), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptyMonikerSPCLink), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptyMonikerSPCLink, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -193,10 +193,10 @@ static void test_encodeSPCLink(void)
U(link).Moniker.SerializedData.cbData = sizeof(data);
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT, &link,
CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(monikerSPCLink), "Unexpected size %d\n", size);
+ ok(size == sizeof(monikerSPCLink), "Unexpected size %ld\n", size);
ok(!memcmp(buf, monikerSPCLink, size), "Unexpected value\n");
LocalFree(buf);
}
@@ -222,50 +222,50 @@ static void test_decodeSPCLink(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
emptyURLSPCLink, sizeof(emptyURLSPCLink), CRYPT_DECODE_ALLOC_FLAG, NULL,
&buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
link = (SPC_LINK *)buf;
ok(link->dwLinkChoice == SPC_URL_LINK_CHOICE,
- "Expected SPC_URL_LINK_CHOICE, got %d\n", link->dwLinkChoice);
+ "Expected SPC_URL_LINK_CHOICE, got %ld\n", link->dwLinkChoice);
ok(lstrlenW(U(*link).pwszUrl) == 0, "Expected empty string\n");
LocalFree(buf);
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
urlSPCLink, sizeof(urlSPCLink), CRYPT_DECODE_ALLOC_FLAG, NULL,
&buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
link = (SPC_LINK *)buf;
ok(link->dwLinkChoice == SPC_URL_LINK_CHOICE,
- "Expected SPC_URL_LINK_CHOICE, got %d\n", link->dwLinkChoice);
+ "Expected SPC_URL_LINK_CHOICE, got %ld\n", link->dwLinkChoice);
ok(!lstrcmpW(U(*link).pwszUrl, url), "Unexpected URL\n");
LocalFree(buf);
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
fileSPCLink, sizeof(fileSPCLink), CRYPT_DECODE_ALLOC_FLAG, NULL,
&buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
link = (SPC_LINK *)buf;
ok(link->dwLinkChoice == SPC_FILE_LINK_CHOICE,
- "Expected SPC_FILE_LINK_CHOICE, got %d\n", link->dwLinkChoice);
+ "Expected SPC_FILE_LINK_CHOICE, got %ld\n", link->dwLinkChoice);
ok(!lstrcmpW(U(*link).pwszFile, nihongoURL), "Unexpected file\n");
LocalFree(buf);
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
emptyMonikerSPCLink, sizeof(emptyMonikerSPCLink), CRYPT_DECODE_ALLOC_FLAG,
NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
SPC_SERIALIZED_OBJECT emptyMoniker = { { 0 } };
link = (SPC_LINK *)buf;
ok(link->dwLinkChoice == SPC_MONIKER_LINK_CHOICE,
- "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link->dwLinkChoice);
+ "Expected SPC_MONIKER_LINK_CHOICE, got %ld\n", link->dwLinkChoice);
ok(!memcmp(&U(*link).Moniker.ClassId, &emptyMoniker.ClassId,
sizeof(emptyMoniker.ClassId)), "Unexpected value\n");
ok(U(*link).Moniker.SerializedData.cbData == 0,
@@ -275,19 +275,19 @@ static void test_decodeSPCLink(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_LINK_STRUCT,
monikerSPCLink, sizeof(monikerSPCLink), CRYPT_DECODE_ALLOC_FLAG, NULL,
&buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
SPC_UUID id;
link = (SPC_LINK *)buf;
ok(link->dwLinkChoice == SPC_MONIKER_LINK_CHOICE,
- "Expected SPC_MONIKER_LINK_CHOICE, got %d\n", link->dwLinkChoice);
+ "Expected SPC_MONIKER_LINK_CHOICE, got %ld\n", link->dwLinkChoice);
memset(&id, 0xea, sizeof(id));
ok(!memcmp(&U(*link).Moniker.ClassId, &id, sizeof(id)),
"Unexpected value\n");
ok(U(*link).Moniker.SerializedData.cbData == sizeof(data),
- "Unexpected data size %d\n", U(*link).Moniker.SerializedData.cbData);
+ "Unexpected data size %ld\n", U(*link).Moniker.SerializedData.cbData);
ok(!memcmp(U(*link).Moniker.SerializedData.pbData, data, sizeof(data)),
"Unexpected value\n");
LocalFree(buf);
@@ -299,7 +299,7 @@ static void test_decodeSPCLink(void)
ok(!ret &&
(GetLastError() == CRYPT_E_BAD_ENCODE ||
GetLastError() == OSS_DATA_ERROR /* WinNT */),
- "Expected CRYPT_E_BAD_ENCODE, got %08x\n", GetLastError());
+ "Expected CRYPT_E_BAD_ENCODE, got %08lx\n", GetLastError());
}
static const BYTE emptySequence[] = { 0x30,0x00 };
@@ -329,10 +329,10 @@ static void test_encodeSPCPEImage(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptySequence), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptySequence, sizeof(emptySequence)),
"Unexpected value\n");
LocalFree(buf);
@@ -343,16 +343,16 @@ static void test_encodeSPCPEImage(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
ok(!ret && GetLastError () == E_INVALIDARG,
- "Expected E_INVALIDARG, got %08x\n", GetLastError());
+ "Expected E_INVALIDARG, got %08lx\n", GetLastError());
/* With just unused bits field set: */
imageData.pFile = NULL;
imageData.Flags.cUnusedBits = 1;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptySequence), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptySequence), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptySequence, sizeof(emptySequence)),
"Unexpected value\n");
LocalFree(buf);
@@ -368,10 +368,10 @@ static void test_encodeSPCPEImage(void)
skip("SPC_PE_IMAGE_DATA_STRUCT not supported\n");
return;
}
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(onlyFlagsPEImage), "Unexpected size %d\n", size);
+ ok(size == sizeof(onlyFlagsPEImage), "Unexpected size %ld\n", size);
ok(!memcmp(buf, onlyFlagsPEImage, sizeof(onlyFlagsPEImage)),
"Unexpected value\n");
LocalFree(buf);
@@ -382,10 +382,10 @@ static void test_encodeSPCPEImage(void)
imageData.pFile = &link;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(onlyEmptyFilePEImage), "Unexpected size %d\n", size);
+ ok(size == sizeof(onlyEmptyFilePEImage), "Unexpected size %ld\n", size);
ok(!memcmp(buf, onlyEmptyFilePEImage, sizeof(onlyEmptyFilePEImage)),
"Unexpected value\n");
LocalFree(buf);
@@ -395,10 +395,10 @@ static void test_encodeSPCPEImage(void)
imageData.Flags.cbData = sizeof(flags);
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(flagsAndEmptyFilePEImage), "Unexpected size %d\n",
+ ok(size == sizeof(flagsAndEmptyFilePEImage), "Unexpected size %ld\n",
size);
ok(!memcmp(buf, flagsAndEmptyFilePEImage,
sizeof(flagsAndEmptyFilePEImage)), "Unexpected value\n");
@@ -408,10 +408,10 @@ static void test_encodeSPCPEImage(void)
U(link).pwszFile = (LPWSTR)nihongoURL;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
&imageData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(flagsAndFilePEImage), "Unexpected size %d\n", size);
+ ok(size == sizeof(flagsAndFilePEImage), "Unexpected size %ld\n", size);
ok(!memcmp(buf, flagsAndFilePEImage, sizeof(flagsAndFilePEImage)),
"Unexpected value\n");
LocalFree(buf);
@@ -435,11 +435,11 @@ static void test_decodeSPCPEImage(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
emptySequence, sizeof(emptySequence),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
imageData = (SPC_PE_IMAGE_DATA *)buf;
- ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
+ ok(imageData->Flags.cbData == 0, "Expected empty flags, got %ld\n",
imageData->Flags.cbData);
ok(imageData->pFile == NULL, "Expected no file\n");
LocalFree(buf);
@@ -447,12 +447,12 @@ static void test_decodeSPCPEImage(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
onlyFlagsPEImage, sizeof(onlyFlagsPEImage),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
imageData = (SPC_PE_IMAGE_DATA *)buf;
ok(imageData->Flags.cbData == sizeof(flags),
- "Unexpected flags size %d\n", imageData->Flags.cbData);
+ "Unexpected flags size %ld\n", imageData->Flags.cbData);
if (imageData->Flags.cbData)
ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
"Unexpected flags\n");
@@ -462,17 +462,17 @@ static void test_decodeSPCPEImage(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
onlyEmptyFilePEImage, sizeof(onlyEmptyFilePEImage),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
imageData = (SPC_PE_IMAGE_DATA *)buf;
- ok(imageData->Flags.cbData == 0, "Expected empty flags, got %d\n",
+ ok(imageData->Flags.cbData == 0, "Expected empty flags, got %ld\n",
imageData->Flags.cbData);
ok(imageData->pFile != NULL, "Expected a file\n");
if (imageData->pFile)
{
ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
- "Expected SPC_FILE_LINK_CHOICE, got %d\n",
+ "Expected SPC_FILE_LINK_CHOICE, got %ld\n",
imageData->pFile->dwLinkChoice);
ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
"Unexpected file\n");
@@ -482,12 +482,12 @@ static void test_decodeSPCPEImage(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
flagsAndEmptyFilePEImage, sizeof(flagsAndEmptyFilePEImage),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
imageData = (SPC_PE_IMAGE_DATA *)buf;
ok(imageData->Flags.cbData == sizeof(flags),
- "Unexpected flags size %d\n", imageData->Flags.cbData);
+ "Unexpected flags size %ld\n", imageData->Flags.cbData);
if (imageData->Flags.cbData)
ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
"Unexpected flags\n");
@@ -495,7 +495,7 @@ static void test_decodeSPCPEImage(void)
if (imageData->pFile)
{
ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
- "Expected SPC_FILE_LINK_CHOICE, got %d\n",
+ "Expected SPC_FILE_LINK_CHOICE, got %ld\n",
imageData->pFile->dwLinkChoice);
ok(!lstrcmpW(U(*imageData->pFile).pwszFile, emptyString),
"Unexpected file\n");
@@ -505,12 +505,12 @@ static void test_decodeSPCPEImage(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_PE_IMAGE_DATA_STRUCT,
flagsAndFilePEImage, sizeof(flagsAndFilePEImage),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
imageData = (SPC_PE_IMAGE_DATA *)buf;
ok(imageData->Flags.cbData == sizeof(flags),
- "Unexpected flags size %d\n", imageData->Flags.cbData);
+ "Unexpected flags size %ld\n", imageData->Flags.cbData);
if (imageData->Flags.cbData)
ok(!memcmp(imageData->Flags.pbData, flags, sizeof(flags)),
"Unexpected flags\n");
@@ -518,7 +518,7 @@ static void test_decodeSPCPEImage(void)
if (imageData->pFile)
{
ok(imageData->pFile->dwLinkChoice == SPC_FILE_LINK_CHOICE,
- "Expected SPC_FILE_LINK_CHOICE, got %d\n",
+ "Expected SPC_FILE_LINK_CHOICE, got %ld\n",
imageData->pFile->dwLinkChoice);
ok(!lstrcmpW(U(*imageData->pFile).pwszFile, nihongoURL),
"Unexpected file\n");
@@ -560,10 +560,10 @@ static void test_encodeCatMemberInfo(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptyCatMemberInfo), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptyCatMemberInfo), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptyCatMemberInfo, sizeof(emptyCatMemberInfo)),
"Unexpected value\n");
LocalFree(buf);
@@ -571,10 +571,10 @@ static void test_encodeCatMemberInfo(void)
info.pwszSubjGuid = foo;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(catMemberInfoWithSillyGuid), "Unexpected size %d\n",
+ ok(size == sizeof(catMemberInfoWithSillyGuid), "Unexpected size %ld\n",
size);
ok(!memcmp(buf, catMemberInfoWithSillyGuid,
sizeof(catMemberInfoWithSillyGuid)), "Unexpected value\n");
@@ -583,10 +583,10 @@ static void test_encodeCatMemberInfo(void)
info.pwszSubjGuid = guidStr;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(catMemberInfoWithGuid), "Unexpected size %d\n",
+ ok(size == sizeof(catMemberInfoWithGuid), "Unexpected size %ld\n",
size);
ok(!memcmp(buf, catMemberInfoWithGuid, sizeof(catMemberInfoWithGuid)),
"Unexpected value\n");
@@ -610,39 +610,39 @@ static void test_decodeCatMemberInfo(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
emptyCatMemberInfo, sizeof(emptyCatMemberInfo),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
info = (CAT_MEMBERINFO *)buf;
ok(!info->pwszSubjGuid || !info->pwszSubjGuid[0],
"expected empty pwszSubjGuid\n");
- ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
+ ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %ld\n",
info->dwCertVersion);
LocalFree(buf);
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
catMemberInfoWithSillyGuid, sizeof(catMemberInfoWithSillyGuid),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
info = (CAT_MEMBERINFO *)buf;
ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, foo),
"unexpected pwszSubjGuid\n");
- ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
+ ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %ld\n",
info->dwCertVersion);
LocalFree(buf);
}
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT,
catMemberInfoWithGuid, sizeof(catMemberInfoWithGuid),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
info = (CAT_MEMBERINFO *)buf;
ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, guidStr),
"unexpected pwszSubjGuid\n");
- ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n",
+ ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %ld\n",
info->dwCertVersion);
LocalFree(buf);
}
@@ -670,10 +670,10 @@ static void test_encodeCatNameValue(void)
memset(&value, 0, sizeof(value));
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptyCatNameValue), "Unexpected size %d\n", size);
+ ok(size == sizeof(emptyCatNameValue), "Unexpected size %ld\n", size);
ok(!memcmp(buf, emptyCatNameValue, sizeof(emptyCatNameValue)),
"Unexpected value\n");
LocalFree(buf);
@@ -681,10 +681,10 @@ static void test_encodeCatNameValue(void)
value.pwszTag = foo;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(catNameValueWithTag), "Unexpected size %d\n", size);
+ ok(size == sizeof(catNameValueWithTag), "Unexpected size %ld\n", size);
ok(!memcmp(buf, catNameValueWithTag, sizeof(catNameValueWithTag)),
"Unexpected value\n");
LocalFree(buf);
@@ -693,10 +693,10 @@ static void test_encodeCatNameValue(void)
value.fdwFlags = 0xf00dd00d;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(catNameValueWithFlags), "Unexpected size %d\n", size);
+ ok(size == sizeof(catNameValueWithFlags), "Unexpected size %ld\n", size);
ok(!memcmp(buf, catNameValueWithFlags, sizeof(catNameValueWithFlags)),
"Unexpected value\n");
LocalFree(buf);
@@ -706,10 +706,10 @@ static void test_encodeCatNameValue(void)
value.Value.pbData = aVal;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(catNameValueWithValue), "Unexpected size %d\n", size);
+ ok(size == sizeof(catNameValueWithValue), "Unexpected size %ld\n", size);
ok(!memcmp(buf, catNameValueWithValue, sizeof(catNameValueWithValue)),
"Unexpected value\n");
LocalFree(buf);
@@ -727,14 +727,14 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
emptyCatNameValue, sizeof(emptyCatNameValue),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
value = (CAT_NAMEVALUE *)buf;
ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
- ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
+ ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08lx\n",
value->fdwFlags);
- ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
+ ok(value->Value.cbData == 0, "expected 0-length value, got %ld\n",
value->Value.cbData);
LocalFree(buf);
}
@@ -742,15 +742,15 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithTag, sizeof(catNameValueWithTag),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
value = (CAT_NAMEVALUE *)buf;
ok(value->pwszTag && !lstrcmpW(value->pwszTag, foo),
"unexpected pwszTag\n");
- ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
+ ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08lx\n",
value->fdwFlags);
- ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
+ ok(value->Value.cbData == 0, "expected 0-length value, got %ld\n",
value->Value.cbData);
LocalFree(buf);
}
@@ -758,14 +758,14 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithFlags, sizeof(catNameValueWithFlags),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
value = (CAT_NAMEVALUE *)buf;
ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
ok(value->fdwFlags == 0xf00dd00d,
- "expected fdwFlags == 0xf00dd00d, got %08x\n", value->fdwFlags);
- ok(value->Value.cbData == 0, "expected 0-length value, got %d\n",
+ "expected fdwFlags == 0xf00dd00d, got %08lx\n", value->fdwFlags);
+ ok(value->Value.cbData == 0, "expected 0-length value, got %ld\n",
value->Value.cbData);
LocalFree(buf);
}
@@ -773,14 +773,14 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithValue, sizeof(catNameValueWithValue),
CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
value = (CAT_NAMEVALUE *)buf;
ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n");
- ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n",
+ ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08lx\n",
value->fdwFlags);
- ok(value->Value.cbData == sizeof(aVal), "unexpected size %d\n",
+ ok(value->Value.cbData == sizeof(aVal), "unexpected size %ld\n",
value->Value.cbData);
ok(!memcmp(value->Value.pbData, aVal, value->Value.cbData),
"unexpected value\n");
@@ -812,20 +812,20 @@ static void test_encodeSpOpusInfo(void)
memset(&info, 0, sizeof(info));
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(emptySequence), "unexpected size %d\n", size);
+ ok(size == sizeof(emptySequence), "unexpected size %ld\n", size);
ok(!memcmp(buf, emptySequence, size), "unexpected value\n");
LocalFree(buf);
}
info.pwszProgramName = progName;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
- ok(size == sizeof(spOpusInfoWithProgramName), "unexpected size %d\n",
+ ok(size == sizeof(spOpusInfoWithProgramName), "unexpected size %ld\n",
size);
ok(!memcmp(buf, spOpusInfoWithProgramName, size),
"unexpected value\n");
@@ -838,16 +838,16 @@ static void test_encodeSpOpusInfo(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
ok(!ret && GetLastError() == E_INVALIDARG,
- "expected E_INVALIDARG, got %08x\n", GetLastError());
+ "expected E_INVALIDARG, got %08lx\n", GetLastError());
moreInfo.dwLinkChoice = SPC_URL_LINK_CHOICE;
U(moreInfo).pwszUrl = winehq;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(size == sizeof(spOpusInfoWithMoreInfo),
- "unexpected size %d\n", size);
+ "unexpected size %ld\n", size);
ok(!memcmp(buf, spOpusInfoWithMoreInfo, size),
"unexpected value\n");
LocalFree(buf);
@@ -856,11 +856,11 @@ static void test_encodeSpOpusInfo(void)
info.pPublisherInfo = &moreInfo;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
- ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(size == sizeof(spOpusInfoWithPublisherInfo),
- "unexpected size %d\n", size);
+ "unexpected size %ld\n", size);
ok(!memcmp(buf, spOpusInfoWithPublisherInfo, size),
"unexpected value\n");
LocalFree(buf);
@@ -876,7 +876,7 @@ static void test_decodeSpOpusInfo(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
emptySequence, sizeof(emptySequence), CRYPT_DECODE_ALLOC_FLAG, NULL,
&info, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(!info->pwszProgramName, "expected NULL\n");
@@ -887,7 +887,7 @@ static void test_decodeSpOpusInfo(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
spOpusInfoWithProgramName, sizeof(spOpusInfoWithProgramName),
CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(info->pwszProgramName && !lstrcmpW(info->pwszProgramName,
@@ -899,7 +899,7 @@ static void test_decodeSpOpusInfo(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
spOpusInfoWithMoreInfo, sizeof(spOpusInfoWithMoreInfo),
CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(!info->pwszProgramName, "expected NULL\n");
@@ -907,7 +907,7 @@ static void test_decodeSpOpusInfo(void)
if (info->pMoreInfo)
{
ok(info->pMoreInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
- "unexpected link choice %d\n", info->pMoreInfo->dwLinkChoice);
+ "unexpected link choice %ld\n", info->pMoreInfo->dwLinkChoice);
ok(!lstrcmpW(U(*info->pMoreInfo).pwszUrl, winehq),
"unexpected link value\n");
}
@@ -917,7 +917,7 @@ static void test_decodeSpOpusInfo(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, SPC_SP_OPUS_INFO_STRUCT,
spOpusInfoWithPublisherInfo, sizeof(spOpusInfoWithPublisherInfo),
CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
- ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
+ ok(ret, "CryptDecodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
ok(!info->pwszProgramName, "expected NULL\n");
@@ -927,7 +927,7 @@ static void test_decodeSpOpusInfo(void)
if (info->pPublisherInfo)
{
ok(info->pPublisherInfo->dwLinkChoice == SPC_URL_LINK_CHOICE,
- "unexpected link choice %d\n",
+ "unexpected link choice %ld\n",
info->pPublisherInfo->dwLinkChoice);
ok(!lstrcmpW(U(*info->pPublisherInfo).pwszUrl, winehq),
"unexpected link value\n");
diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c
index 5f9c402e00f..ca246776046 100644
--- a/dlls/wintrust/tests/crypt.c
+++ b/dlls/wintrust/tests/crypt.c
@@ -200,25 +200,25 @@ static void test_context(void)
ret = pCryptCATAdminAcquireContext(NULL, NULL, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* NULL GUID */
if (0) { /* crashes on 64-bit win10 */
ret = pCryptCATAdminAcquireContext(&hca, NULL, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
ok(hca != NULL, "Expected a context handle, got NULL\n");
/* Proper release */
SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(hca, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
/* Try to release a second time */
SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(hca, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
}
/* All NULL */
@@ -226,14 +226,14 @@ static void test_context(void)
ret = pCryptCATAdminReleaseContext(NULL, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* NULL context handle and dummy GUID */
SetLastError(0xdeadbeef);
ret = pCryptCATAdminAcquireContext(NULL, &dummy, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Correct context handle and dummy GUID
*
@@ -246,7 +246,7 @@ static void test_context(void)
*/
ret = pCryptCATAdminAcquireContext(&hca, &dummy, 0);
- ok(ret || GetLastError() == ERROR_ACCESS_DENIED, "CryptCATAdminAcquireContext failed %u\n", GetLastError());
+ ok(ret || GetLastError() == ERROR_ACCESS_DENIED, "CryptCATAdminAcquireContext failed %lu\n", GetLastError());
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
{
win_skip("Not running as administrator\n");
@@ -276,15 +276,15 @@ static void test_context(void)
}
ret = pCryptCATAdminReleaseContext(hca, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
/* Correct context handle and GUID */
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
ok(hca != NULL, "Expected a context handle, got NULL\n");
ret = pCryptCATAdminReleaseContext(hca, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
hca = (void *) 0xdeadbeef;
SetLastError(0xdeadbeef);
@@ -292,14 +292,14 @@ static void test_context(void)
ret = pCryptCATAdminAcquireContext(&hca, &unknown, 1);
ok((!ret && (GetLastError() == ERROR_INVALID_PARAMETER) && (hca == (void *) 0xdeadbeef)) ||
broken(ret && hca != NULL && hca != (void *) 0xdeadbeef),
- "Expected FALSE and ERROR_INVALID_PARAMETER with untouched handle, got %d and %u with %p\n",
+ "Expected FALSE and ERROR_INVALID_PARAMETER with untouched handle, got %d and %lu with %p\n",
ret, GetLastError(), hca);
if (ret && hca)
{
SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(hca, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
}
}
@@ -319,14 +319,14 @@ static void test_calchash(void)
ret = pCryptCATAdminCalcHashFromFileHandle(NULL, NULL, NULL, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* NULL filehandle, rest is legal */
SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(NULL, &hashsize, NULL, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Correct filehandle, rest is NULL */
file = CreateFileA(selfname, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
@@ -334,7 +334,7 @@ static void test_calchash(void)
ret = pCryptCATAdminCalcHashFromFileHandle(file, NULL, NULL, 0);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
CloseHandle(file);
/* All OK, but dwFlags set to 1 */
@@ -343,18 +343,18 @@ static void test_calchash(void)
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, NULL, 1);
ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
CloseHandle(file);
/* All OK, requesting the size of the hash */
file = CreateFileA(selfname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFile failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile failed %lu\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, NULL, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
- ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize);
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
+ ok(hashsize == 20," Expected a hash size of 20, got %ld\n", hashsize);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
+ "Expected ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
CloseHandle(file);
/* All OK, retrieve the hash
@@ -365,10 +365,10 @@ static void test_calchash(void)
hash = HeapAlloc(GetProcessHeap(), 0, hashsize);
SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, hash, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
- ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize);
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
+ ok(hashsize == 20," Expected a hash size of 20, got %ld\n", hashsize);
ok(GetLastError() == ERROR_SUCCESS,
- "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
CloseHandle(file);
HeapFree(GetProcessHeap(), 0, hash);
@@ -387,9 +387,9 @@ static void test_calchash(void)
hash = HeapAlloc(GetProcessHeap(), 0, hashsize);
SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, hash, 0);
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
ok(GetLastError() == ERROR_SUCCESS,
- "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
ok(hashsize == sizeof(expectedhash) &&
!memcmp(hash, expectedhash, sizeof(expectedhash)),
"Hashes didn't match\n");
@@ -414,7 +414,7 @@ static void test_CryptCATOpen(void)
SetLastError(0xdeadbeef);
cat = pCryptCATOpen(NULL, 0, 0, 0, 0);
ok(cat == INVALID_HANDLE_VALUE, "expected failure\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
for (flags = 0; flags < 8; ++flags)
{
@@ -422,19 +422,19 @@ static void test_CryptCATOpen(void)
cat = pCryptCATOpen(filename, flags, 0, 0, 0);
if (flags == CRYPTCAT_OPEN_EXISTING)
{
- ok(cat == INVALID_HANDLE_VALUE, "flags %#x: expected failure\n", flags);
- ok(GetLastError() == ERROR_FILE_NOT_FOUND, "flags %#x: got error %u\n", flags, GetLastError());
+ ok(cat == INVALID_HANDLE_VALUE, "flags %#lx: expected failure\n", flags);
+ ok(GetLastError() == ERROR_FILE_NOT_FOUND, "flags %#lx: got error %lu\n", flags, GetLastError());
ret = DeleteFileW(filename);
- ok(!ret, "flags %#x: expected failure\n", flags);
+ ok(!ret, "flags %#lx: expected failure\n", flags);
}
else
{
- ok(cat != INVALID_HANDLE_VALUE, "flags %#x: expected success\n", flags);
- ok(!GetLastError(), "flags %#x: got error %u\n", flags, GetLastError());
+ ok(cat != INVALID_HANDLE_VALUE, "flags %#lx: expected success\n", flags);
+ ok(!GetLastError(), "flags %#lx: got error %lu\n", flags, GetLastError());
ret = pCryptCATClose(cat);
- ok(ret, "flags %#x: failed to close file\n", flags);
+ ok(ret, "flags %#lx: failed to close file\n", flags);
ret = DeleteFileW(filename);
- ok(ret, "flags %#x: failed to delete file, error %u\n", flags, GetLastError());
+ ok(ret, "flags %#lx: failed to delete file, error %lu\n", flags, GetLastError());
}
file = _wfopen(filename, L"w");
@@ -443,21 +443,21 @@ static void test_CryptCATOpen(void)
SetLastError(0xdeadbeef);
cat = pCryptCATOpen(filename, flags, 0, 0, 0);
- ok(cat != INVALID_HANDLE_VALUE, "flags %#x: expected success\n", flags);
- ok(!GetLastError(), "flags %#x: got error %u\n", flags, GetLastError());
+ ok(cat != INVALID_HANDLE_VALUE, "flags %#lx: expected success\n", flags);
+ ok(!GetLastError(), "flags %#lx: got error %lu\n", flags, GetLastError());
ret = pCryptCATClose(cat);
- ok(ret, "flags %#x: failed to close file\n", flags);
+ ok(ret, "flags %#lx: failed to close file\n", flags);
file = _wfopen(filename, L"r");
ret = fread(buffer, 1, sizeof(buffer), file);
if (flags & CRYPTCAT_OPEN_CREATENEW)
- ok(!ret, "flags %#x: got %s\n", flags, debugstr_an(buffer, ret));
+ ok(!ret, "flags %#lx: got %s\n", flags, debugstr_an(buffer, ret));
else
- ok(ret == 9 && !strncmp(buffer, "test text", ret), "flags %#x: got %s\n", flags, debugstr_an(buffer, ret));
+ ok(ret == 9 && !strncmp(buffer, "test text", ret), "flags %#lx: got %s\n", flags, debugstr_an(buffer, ret));
fclose(file);
ret = DeleteFileW(filename);
- ok(ret, "flags %#x: failed to delete file, error %u\n", flags, GetLastError());
+ ok(ret, "flags %#lx: failed to delete file, error %lu\n", flags, GetLastError());
}
}
@@ -466,7 +466,7 @@ static DWORD local_error;
static void WINAPI cdf_callback(DWORD area, DWORD error, WCHAR* line)
{
- ok(error_area != -2, "Didn't expect cdf_callback() to be called (%08x, %08x)\n",
+ ok(error_area != -2, "Didn't expect cdf_callback() to be called (%08lx, %08lx)\n",
area, error);
error_area = area;
@@ -489,33 +489,33 @@ static void test_CryptCATCDF_params(void)
catcdf = pCryptCATCDFOpen(NULL, NULL);
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
catcdf = pCryptCATCDFOpen(NULL, cdf_callback);
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* File doesn't exist */
SetLastError(0xdeadbeef);
catcdf = pCryptCATCDFOpen(nonexistent, cdf_callback);
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
- ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pCryptCATCDFClose(NULL);
ok(!ret, "Expected failure\n");
todo_wine
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
catcdf = NULL;
SetLastError(0xdeadbeef);
ret = pCryptCATCDFClose(catcdf);
ok(!ret, "Expected failure\n");
todo_wine
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
}
/* FIXME: Once Wine can create catalog files we should use the created catalog file in this test */
@@ -545,11 +545,11 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
if (!GetTempFileNameA(CURR_DIR, "cat", 0, tmpfile)) return;
DeleteFileA(tmpfile);
file = CreateFileA(tmpfile, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError());
CloseHandle(file);
ret = pCryptCATAdminAcquireContext(&hcatadmin, &dummy, 0);
- ok(ret || GetLastError() == ERROR_ACCESS_DENIED, "CryptCATAdminAcquireContext failed %u\n", GetLastError());
+ ok(ret || GetLastError() == ERROR_ACCESS_DENIED, "CryptCATAdminAcquireContext failed %lu\n", GetLastError());
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
{
win_skip("Not running as administrator\n");
@@ -560,13 +560,13 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
hcatinfo = pCryptCATAdminAddCatalog(NULL, NULL, NULL, 0);
error = GetLastError();
ok(hcatinfo == NULL, "CryptCATAdminAddCatalog succeeded\n");
- ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", GetLastError());
+ ok(error == ERROR_INVALID_PARAMETER, "got %lu expected ERROR_INVALID_PARAMETER\n", GetLastError());
SetLastError(0xdeadbeef);
hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, NULL, NULL, 0);
error = GetLastError();
ok(hcatinfo == NULL, "CryptCATAdminAddCatalog succeeded\n");
- ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", GetLastError());
+ ok(error == ERROR_INVALID_PARAMETER, "got %lu expected ERROR_INVALID_PARAMETER\n", GetLastError());
MultiByteToWideChar(CP_ACP, 0, tmpfile, -1, tmpfileW, MAX_PATH);
@@ -575,7 +575,7 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
error = GetLastError();
todo_wine {
ok(hcatinfo == NULL, "CryptCATAdminAddCatalog succeeded\n");
- ok(error == ERROR_BAD_FORMAT, "got %u expected ERROR_BAD_FORMAT\n", GetLastError());
+ ok(error == ERROR_BAD_FORMAT, "got %lu expected ERROR_BAD_FORMAT\n", GetLastError());
}
if (hcatinfo != NULL)
pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0);
@@ -586,17 +586,17 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
ok(hcatinfo == NULL, "CryptCATAdminAddCatalog succeeded\n");
ok(error == ERROR_INVALID_PARAMETER ||
error == ERROR_BAD_FORMAT, /* win 8 */
- "got %u\n", GetLastError());
+ "got %lu\n", GetLastError());
SetLastError(0xdeadbeef);
hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, NULL, 0);
error = GetLastError();
ok(hcatinfo == NULL, "CryptCATAdminAddCatalog succeeded\n");
- todo_wine ok(error == ERROR_BAD_FORMAT, "got %u expected ERROR_BAD_FORMAT\n", GetLastError());
+ todo_wine ok(error == ERROR_BAD_FORMAT, "got %lu expected ERROR_BAD_FORMAT\n", GetLastError());
DeleteFileA(tmpfile);
file = CreateFileA(tmpfile, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError());
WriteFile(file, test_catalog, sizeof(test_catalog), &written, NULL);
CloseHandle(file);
@@ -607,14 +607,14 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
win_skip("Not enough rights\n");
goto cleanup;
}
- todo_wine ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError());
+ todo_wine ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %lu\n", GetLastError());
info.cbStruct = sizeof(info);
info.wszCatalogFile[0] = 0;
ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0);
todo_wine
{
- ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError());
+ ok(ret, "CryptCATCatalogInfoFromContext failed %lu\n", GetLastError());
ok(info.wszCatalogFile[0] != 0, "Expected a filename\n");
}
WideCharToMultiByte(CP_ACP, 0, info.wszCatalogFile, -1, catfile, MAX_PATH, NULL, NULL);
@@ -625,11 +625,11 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
/* Set the file attributes so we can check what happens with them during the 'copy' */
attrs = FILE_ATTRIBUTE_READONLY;
ret = SetFileAttributesA(tmpfile, attrs);
- ok(ret, "SetFileAttributesA failed : %u\n", GetLastError());
+ ok(ret, "SetFileAttributesA failed : %lu\n", GetLastError());
/* winetest.cat will be created */
hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0);
- ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError());
+ ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %lu\n", GetLastError());
lstrcpyA(catfilepath, catroot);
lstrcatA(catfilepath, "\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}\\winetest.cat");
@@ -638,45 +638,45 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
todo_wine
ok(attrs == FILE_ATTRIBUTE_SYSTEM ||
attrs == (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | FILE_ATTRIBUTE_SYSTEM), /* Vista */
- "File has wrong attributes : %08x\n", attrs);
+ "File has wrong attributes : %08lx\n", attrs);
info.cbStruct = sizeof(info);
info.wszCatalogFile[0] = 0;
ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0);
- ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError());
+ ok(ret, "CryptCATCatalogInfoFromContext failed %lu\n", GetLastError());
ok(info.wszCatalogFile[0] != 0, "Expected a filename\n");
WideCharToMultiByte(CP_ACP, 0, info.wszCatalogFile, -1, catfile, MAX_PATH, NULL, NULL);
if ((p = strrchr(catfile, '\\'))) p++;
ok(!lstrcmpA(basename, p), "Expected %s, got %s\n", basename, p);
ret = pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0);
- ok(ret, "CryptCATAdminReleaseCatalogContext failed %u\n", GetLastError());
+ ok(ret, "CryptCATAdminReleaseCatalogContext failed %lu\n", GetLastError());
/* Remove the catalog file with the unique name */
ret = pCryptCATAdminRemoveCatalog(hcatadmin, catfileW, 0);
- ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError());
+ ok(ret, "CryptCATAdminRemoveCatalog failed %lu\n", GetLastError());
/* Remove the winetest.cat catalog file, first with the full path. This should not succeed
* according to MSDN */
ret = pCryptCATAdminRemoveCatalog(hcatadmin, info.wszCatalogFile, 0);
- ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError());
+ ok(ret, "CryptCATAdminRemoveCatalog failed %lu\n", GetLastError());
/* The call succeeded with the full path but the file is not removed */
attrs = GetFileAttributesA(catfilepath);
ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected %s to exist\n", catfilepath);
/* Given only the filename the file is removed */
ret = pCryptCATAdminRemoveCatalog(hcatadmin, basenameW, 0);
- ok(ret, "CryptCATAdminRemoveCatalog failed %u\n", GetLastError());
+ ok(ret, "CryptCATAdminRemoveCatalog failed %lu\n", GetLastError());
attrs = GetFileAttributesA(catfilepath);
ok(attrs == INVALID_FILE_ATTRIBUTES, "Expected %s to be removed\n", catfilepath);
cleanup:
ret = pCryptCATAdminReleaseContext(hcatadmin, 0);
- ok(ret, "CryptCATAdminReleaseContext failed %u\n", GetLastError());
+ ok(ret, "CryptCATAdminReleaseContext failed %lu\n", GetLastError());
/* Set the attributes so we can delete the file */
attrs = FILE_ATTRIBUTE_NORMAL;
ret = SetFileAttributesA(tmpfile, attrs);
- ok(ret, "SetFileAttributesA failed %u\n", GetLastError());
+ ok(ret, "SetFileAttributesA failed %lu\n", GetLastError());
DeleteFileA(tmpfile);
}
@@ -705,7 +705,7 @@ static void test_catalog_properties(const char *catfile, int attributes, int mem
trace("Creating the catalog file\n");
if (!GetTempFileNameA(CURR_DIR, "cat", 0, catalog)) return;
file = CreateFileA(catalog, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError());
WriteFile(file, test_catalog, sizeof(test_catalog), &written, NULL);
CloseHandle(file);
@@ -725,7 +725,7 @@ static void test_catalog_properties(const char *catfile, int attributes, int mem
win_skip("CryptCATOpen on W2K can't handle catalog files with no members\n");
return;
}
- ok(hcat != INVALID_HANDLE_VALUE, "CryptCATOpen failed %u\n", GetLastError());
+ ok(hcat != INVALID_HANDLE_VALUE, "CryptCATOpen failed %lu\n", GetLastError());
m = pCryptCATEnumerateMember(NULL, NULL);
ok(m == NULL, "CryptCATEnumerateMember succeeded\n");
@@ -733,12 +733,12 @@ static void test_catalog_properties(const char *catfile, int attributes, int mem
m = NULL;
while ((m = pCryptCATEnumerateMember(hcat, m)))
{
- ok(m->cbStruct == sizeof(CRYPTCATMEMBER), "unexpected size %u\n", m->cbStruct);
+ ok(m->cbStruct == sizeof(CRYPTCATMEMBER), "unexpected size %lu\n", m->cbStruct);
todo_wine ok(!lstrcmpW(m->pwszReferenceTag, hashmeW), "unexpected tag\n");
ok(!memcmp(&m->gSubjectType, &subject, sizeof(subject)), "guid differs\n");
- ok(!m->fdwMemberFlags, "got %x expected 0\n", m->fdwMemberFlags);
- ok(m->dwCertVersion == 0x200, "got %x expected 0x200\n", m->dwCertVersion);
- ok(!m->dwReserved, "got %x expected 0\n", m->dwReserved);
+ ok(!m->fdwMemberFlags, "got %lx expected 0\n", m->fdwMemberFlags);
+ ok(m->dwCertVersion == 0x200, "got %lx expected 0x200\n", m->dwCertVersion);
+ ok(!m->dwReserved, "got %lx expected 0\n", m->dwReserved);
ok(m->hReserved == NULL, "got %p expected NULL\n", m->hReserved);
attr = pCryptCATEnumerateAttr(hcat, m, NULL);
@@ -793,7 +793,7 @@ static void test_create_catalog_file(void)
/* Create the cdf file */
file = CreateFileA(cdffileA, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError());
WriteFile(file, test_cdf, sizeof(test_cdf) - 1, &written, NULL);
CloseHandle(file);
@@ -804,14 +804,14 @@ static void test_create_catalog_file(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
ret = pCryptCATCDFClose(catcdf);
todo_wine
{
- ok(ret, "Expected success, got FALSE with %d\n", GetLastError());
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(ret, "Expected success, got FALSE with %ld\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
attrs = GetFileAttributesA(catfileA);
@@ -893,15 +893,15 @@ static void create_cdf_file(const CHAR *filename, const CHAR *contents)
DWORD written;
file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError());
+ ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %lu\n", GetLastError());
WriteFile(file, contents, lstrlenA(contents), &written, NULL);
CloseHandle(file);
}
#define CHECK_EXPECT(a, b) \
do { \
- ok(a == error_area, "Expected %08x, got %08x\n", a, error_area); \
- ok(b == local_error, "Expected %08x, got %08x\n", b, local_error); \
+ ok(a == error_area, "Expected %08x, got %08lx\n", a, error_area); \
+ ok(b == local_error, "Expected %08x, got %08lx\n", b, local_error); \
} while (0)
/* Clear the variables (can't use 0) */
@@ -940,7 +940,7 @@ static void test_cdf_parsing(void)
CHECK_EXPECT(CRYPTCAT_E_AREA_HEADER, CRYPTCAT_E_CDF_TAGNOTFOUND);
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
DeleteFileA(cdffileA);
ok(!DeleteFileA(catfileA), "Didn't expect a catalog file to be created\n");
@@ -954,7 +954,7 @@ static void test_cdf_parsing(void)
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
ok(GetLastError() == ERROR_SHARING_VIOLATION,
- "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
+ "Expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
DeleteFileA(cdffileA);
/* Header and member only */
@@ -969,7 +969,7 @@ static void test_cdf_parsing(void)
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
ok(GetLastError() == ERROR_SHARING_VIOLATION,
- "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
+ "Expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
DeleteFileA(cdffileA);
ok(!DeleteFileA(catfileA), "Didn't expect a catalog file to be created\n");
@@ -984,7 +984,7 @@ static void test_cdf_parsing(void)
ok(catcdf == NULL, "CryptCATCDFOpen succeeded\n");
todo_wine
ok(GetLastError() == ERROR_SHARING_VIOLATION,
- "Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError());
+ "Expected ERROR_SHARING_VIOLATION, got %ld\n", GetLastError());
DeleteFileA(cdffileA);
ok(!DeleteFileA(catfileA), "Didn't expect a catalog file to be created\n");
@@ -999,7 +999,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
pCryptCATCDFClose(catcdf);
DeleteFileA(cdffileA);
@@ -1019,7 +1019,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the members */
CLEAR_EXPECT;
@@ -1046,7 +1046,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the members */
CLEAR_EXPECT;
@@ -1054,9 +1054,9 @@ static void test_cdf_parsing(void)
catmembertag = NULL;
while ((catmembertag = pCryptCATCDFEnumMembersByCDFTagEx(catcdf, catmembertag, cdf_callback, &catmember, FALSE, NULL))) ;
ok(error_area == 0xffffffff || broken(error_area == CRYPTCAT_E_AREA_MEMBER) /* < win81 */,
- "Expected area 0xffffffff, got %08x\n", error_area);
+ "Expected area 0xffffffff, got %08lx\n", error_area);
ok(local_error == 0xffffffff || broken(local_error == CRYPTCAT_E_CDF_MEMBER_FILE_PATH) /* < win81 */,
- "Expected error 0xffffffff, got %08x\n", local_error);
+ "Expected error 0xffffffff, got %08lx\n", local_error);
pCryptCATCDFClose(catcdf);
DeleteFileA(cdffileA);
@@ -1077,7 +1077,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the members */
SET_UNEXPECTED;
@@ -1102,7 +1102,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the attributes */
CLEAR_EXPECT;
@@ -1130,7 +1130,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the members */
SET_UNEXPECTED;
@@ -1162,7 +1162,7 @@ static void test_cdf_parsing(void)
todo_wine
{
ok(catcdf != NULL, "CryptCATCDFOpen failed\n");
- ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", GetLastError());
}
/* Loop through the members */
SET_UNEXPECTED;
@@ -1266,26 +1266,26 @@ static void test_sip(void)
info.cbSize = sizeof(SIP_SUBJECTINFO);
info.pgSubjectType = &guid;
ret = CryptSIPRetrieveSubjectGuid(NULL, file, info.pgSubjectType);
- ok(ret, "CryptSIPRetrieveSubjectGuid failed (%x)\n", GetLastError());
+ ok(ret, "CryptSIPRetrieveSubjectGuid failed (%lx)\n", GetLastError());
ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test");
ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n");
index = GetLastError();
- ok(index == ERROR_PATH_NOT_FOUND, "GetLastError returned %x\n", index);
+ ok(index == ERROR_PATH_NOT_FOUND, "GetLastError returned %lx\n", index);
info.hFile = file;
info.pwsFileName = nameW;
ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test");
ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n");
index = GetLastError();
- todo_wine ok(index == ERROR_INVALID_PARAMETER, "GetLastError returned %x\n", index);
+ todo_wine ok(index == ERROR_INVALID_PARAMETER, "GetLastError returned %lx\n", index);
info.hFile = INVALID_HANDLE_VALUE;
info.pwsFileName = nameW;
ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test");
ok(!ret, "CryptSIPPutSignedDataMsg succeeded\n");
index = GetLastError();
- ok(index == ERROR_SHARING_VIOLATION, "GetLastError returned %x\n", index);
+ ok(index == ERROR_SHARING_VIOLATION, "GetLastError returned %lx\n", index);
CloseHandle(file);
file= CreateFileW(nameW, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -1293,8 +1293,8 @@ static void test_sip(void)
info.hFile = file;
info.pwsFileName = (void*)0xdeadbeef;
ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 4, (BYTE*)"test");
- ok(ret, "CryptSIPPutSignedDataMsg failed (%x)\n", GetLastError());
- ok(index == 0, "index = %x\n", index);
+ ok(ret, "CryptSIPPutSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(index == 0, "index = %lx\n", index);
CloseHandle(file);
file= CreateFileW(nameW, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -1302,33 +1302,33 @@ static void test_sip(void)
info.hFile = INVALID_HANDLE_VALUE;
info.pwsFileName = nameW;
ret = pPutSignedDataMsg(&info, X509_ASN_ENCODING, &index, 14, (BYTE*)"longer message");
- ok(ret, "CryptSIPPutSignedDataMsg failed (%x)\n", GetLastError());
- ok(index == 1, "index = %x\n", index);
+ ok(ret, "CryptSIPPutSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(index == 1, "index = %lx\n", index);
size = 0;
encoding = 0xdeadbeef;
ret = pGetSignedDataMsg(&info, &encoding, 0, &size, NULL);
- ok(ret, "CryptSIPGetSignedDataMsg failed (%x)\n", GetLastError());
- ok(encoding == 0xdeadbeef, "encoding = %x\n", encoding);
- ok(size == 16, "size = %d\n", size);
+ ok(ret, "CryptSIPGetSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(encoding == 0xdeadbeef, "encoding = %lx\n", encoding);
+ ok(size == 16, "size = %ld\n", size);
ret = pGetSignedDataMsg(&info, &encoding, 0, &size, (BYTE*)buf);
- ok(ret, "CryptSIPGetSignedDataMsg failed (%x)\n", GetLastError());
- ok(encoding == (X509_ASN_ENCODING|PKCS_7_ASN_ENCODING), "encoding = %x\n", encoding);
- ok(size == 8, "size = %d\n", size);
+ ok(ret, "CryptSIPGetSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(encoding == (X509_ASN_ENCODING|PKCS_7_ASN_ENCODING), "encoding = %lx\n", encoding);
+ ok(size == 8, "size = %ld\n", size);
ok(!memcmp(buf, "test\0\0\0\0", 8), "buf = %s\n", buf);
size = 0;
encoding = 0xdeadbeef;
ret = pGetSignedDataMsg(&info, &encoding, 1, &size, NULL);
- ok(ret, "CryptSIPGetSignedDataMsg failed (%x)\n", GetLastError());
- ok(encoding == 0xdeadbeef, "encoding = %x\n", encoding);
- ok(size == 24, "size = %d\n", size);
+ ok(ret, "CryptSIPGetSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(encoding == 0xdeadbeef, "encoding = %lx\n", encoding);
+ ok(size == 24, "size = %ld\n", size);
ret = pGetSignedDataMsg(&info, &encoding, 1, &size, (BYTE*)buf);
- ok(ret, "CryptSIPGetSignedDataMsg failed (%x)\n", GetLastError());
- ok(encoding == (X509_ASN_ENCODING|PKCS_7_ASN_ENCODING), "encoding = %x\n", encoding);
- ok(size == 16, "size = %d\n", size);
+ ok(ret, "CryptSIPGetSignedDataMsg failed (%lx)\n", GetLastError());
+ ok(encoding == (X509_ASN_ENCODING|PKCS_7_ASN_ENCODING), "encoding = %lx\n", encoding);
+ ok(size == 16, "size = %ld\n", size);
ok(!strcmp(buf, "longer message"), "buf = %s\n", buf);
CryptReleaseContext(info.hProv, 0);
diff --git a/dlls/wintrust/tests/register.c b/dlls/wintrust/tests/register.c
index 32c87827491..bf4746d9284 100644
--- a/dlls/wintrust/tests/register.c
+++ b/dlls/wintrust/tests/register.c
@@ -76,7 +76,7 @@ static void test_AddRem_ActionID(void)
ok (!ret, "Expected WintrustAddActionID to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER /* XP/W2K3 */ ||
GetLastError() == 0xdeadbeef /* Win98/NT4/W2K */,
- "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %lu.\n", GetLastError());
/* NULL functions */
SetLastError(0xdeadbeef);
@@ -84,7 +84,7 @@ static void test_AddRem_ActionID(void)
ok (!ret, "Expected WintrustAddActionID to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER /* XP/W2K3 */ ||
GetLastError() == 0xdeadbeef /* Win98/NT4/W2K */,
- "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %lu.\n", GetLastError());
/* All OK (although no functions defined), except cbStruct is not set in ActionIDFunctions */
SetLastError(0xdeadbeef);
@@ -93,7 +93,7 @@ static void test_AddRem_ActionID(void)
ok (!ret, "Expected WintrustAddActionID to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER /* XP/W2K3 */ ||
GetLastError() == 0xdeadbeef /* Win98/NT4/W2K */,
- "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %lu.\n", GetLastError());
/* All OK (although no functions defined) and cbStruct is set now */
SetLastError(0xdeadbeef);
@@ -102,7 +102,7 @@ static void test_AddRem_ActionID(void)
ret = pWintrustAddActionID(&ActionID, 0, &ActionIDFunctions);
ok (ret, "Expected WintrustAddActionID to succeed.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
/* All OK and all (but 1) functions are correctly defined. The DLL and entrypoints
* are not present.
@@ -122,7 +122,7 @@ static void test_AddRem_ActionID(void)
ok (ret, "Expected WintrustAddActionID to succeed.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_ACCESS_DENIED,
- "Expected ERROR_INVALID_PARAMETER or ERROR_ACCESS_DENIED, got %u.\n",
+ "Expected ERROR_INVALID_PARAMETER or ERROR_ACCESS_DENIED, got %lu.\n",
GetLastError());
/* All OK and all functions are correctly defined. The DLL and entrypoints
@@ -142,27 +142,27 @@ static void test_AddRem_ActionID(void)
ret = pWintrustAddActionID(&ActionID, 0, &ActionIDFunctions);
ok (ret, "Expected WintrustAddActionID to succeed.\n");
ok (GetLastError() == 0xdeadbeef || GetLastError() == ERROR_ACCESS_DENIED,
- "Expected 0xdeadbeef or ERROR_ACCESS_DENIED, got %u.\n",
+ "Expected 0xdeadbeef or ERROR_ACCESS_DENIED, got %lu.\n",
GetLastError());
SetLastError(0xdeadbeef);
ret = pWintrustRemoveActionID(&ActionID);
- ok ( ret, "WintrustRemoveActionID failed : %d\n", GetLastError());
- ok ( GetLastError() == 0xdeadbeef, "Last error should not have been changed: %u\n", GetLastError());
+ ok ( ret, "WintrustRemoveActionID failed : %ld\n", GetLastError());
+ ok ( GetLastError() == 0xdeadbeef, "Last error should not have been changed: %lu\n", GetLastError());
/* NULL input */
SetLastError(0xdeadbeef);
ret = pWintrustRemoveActionID(NULL);
ok (ret, "Expected WintrustRemoveActionID to succeed.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
/* The passed GUID is removed by a previous call, so it's basically a test with a nonexistent Trust provider */
SetLastError(0xdeadbeef);
ret = pWintrustRemoveActionID(&ActionID);
ok (ret, "Expected WintrustRemoveActionID to succeed.\n");
ok (GetLastError() == 0xdeadbeef,
- "Expected 0xdeadbeef, got %u.\n", GetLastError());
+ "Expected 0xdeadbeef, got %lu.\n", GetLastError());
}
static void test_AddDefaultForUsage(void)
@@ -185,14 +185,14 @@ static void test_AddDefaultForUsage(void)
ret = pWintrustAddDefaultForUsage(NULL, NULL);
ok (!ret, "Expected WintrustAddDefaultForUsage to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
/* NULL defusage */
SetLastError(0xdeadbeef);
ret = pWintrustAddDefaultForUsage(oid, NULL);
ok (!ret, "Expected WintrustAddDefaultForUsage to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
/* NULL oid and proper defusage */
memset(&DefUsage, 0 , sizeof(CRYPT_PROVIDER_REGDEFUSAGE));
@@ -205,7 +205,7 @@ static void test_AddDefaultForUsage(void)
ret = pWintrustAddDefaultForUsage(NULL, &DefUsage);
ok (!ret, "Expected WintrustAddDefaultForUsage to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
/* cbStruct set to 0 */
memset(&DefUsage, 0 , sizeof(CRYPT_PROVIDER_REGDEFUSAGE));
@@ -218,7 +218,7 @@ static void test_AddDefaultForUsage(void)
ret = pWintrustAddDefaultForUsage(oid, &DefUsage);
ok (!ret, "Expected WintrustAddDefaultForUsage to fail.\n");
ok (GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %u.\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %lu.\n", GetLastError());
}
static void test_LoadFunctionPointers(void)
@@ -244,7 +244,7 @@ static void test_LoadFunctionPointers(void)
ok(!ret, "WintrustLoadFunctionPointers succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == 0xdeadbeef /* W2K and XP-SP1 */,
- "Expected ERROR_INVALID_PARAMETER or 0xdeadbeef, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER or 0xdeadbeef, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
funcs.cbStruct = 0;
@@ -253,7 +253,7 @@ static void test_LoadFunctionPointers(void)
SetLastError(0xdeadbeef);
funcs.cbStruct = sizeof(funcs);
ret = pWintrustLoadFunctionPointers(&action, &funcs);
- ok(ret, "WintrustLoadFunctionPointers failed: %d\n", GetLastError());
+ ok(ret, "WintrustLoadFunctionPointers failed: %ld\n", GetLastError());
ok(funcs.pfnAlloc != NULL, "Expected a pointer\n");
ok(funcs.pfnFree != NULL, "Expected a pointer\n");
}
@@ -286,21 +286,21 @@ static void test_RegPolicyFlags(void)
r = RegOpenKeyExA(HKEY_CURRENT_USER, Software_Publishing, 0, KEY_ALL_ACCESS,
&key);
- ok(!r, "RegOpenKeyEx failed: %d\n", r);
+ ok(!r, "RegOpenKeyEx failed: %ld\n", r);
size = sizeof(flags1);
r = RegQueryValueExA(key, State, NULL, NULL, (LPBYTE)&flags1, &size);
- ok(!r || r == ERROR_FILE_NOT_FOUND, "RegQueryValueEx failed: %d\n", r);
+ ok(!r || r == ERROR_FILE_NOT_FOUND, "RegQueryValueEx failed: %ld\n", r);
if (!r)
- ok(flags1 == flags2, "Got %08x flags instead of %08x\n", flags1, flags2);
+ ok(flags1 == flags2, "Got %08lx flags instead of %08lx\n", flags1, flags2);
flags3 = flags2 | 1;
ret = pWintrustSetRegPolicyFlags(flags3);
- ok(ret, "WintrustSetRegPolicyFlags failed: %d\n", GetLastError());
+ ok(ret, "WintrustSetRegPolicyFlags failed: %ld\n", GetLastError());
size = sizeof(flags1);
r = RegQueryValueExA(key, State, NULL, NULL, (LPBYTE)&flags1, &size);
- ok(!r, "RegQueryValueEx failed: %d\n", r);
- ok(flags1 == flags3, "Got %08x flags instead of %08x\n", flags1, flags3);
+ ok(!r, "RegQueryValueEx failed: %ld\n", r);
+ ok(flags1 == flags3, "Got %08lx flags instead of %08lx\n", flags1, flags3);
pWintrustSetRegPolicyFlags(flags2);
diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c
index 25d458faad7..8195e6006b1 100644
--- a/dlls/wintrust/tests/softpub.c
+++ b/dlls/wintrust/tests/softpub.c
@@ -138,8 +138,8 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
if (store)
{
ret = funcs->pfnAddStore2Chain(&data, store);
- ok(ret, "pfnAddStore2Chain failed: %08x\n", GetLastError());
- ok(data.chStores == 1, "Expected 1 store, got %d\n", data.chStores);
+ ok(ret, "pfnAddStore2Chain failed: %08lx\n", GetLastError());
+ ok(data.chStores == 1, "Expected 1 store, got %ld\n", data.chStores);
ok(data.pahStores != NULL, "Expected pahStores to be allocated\n");
if (data.pahStores)
{
@@ -153,15 +153,15 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
}
}
else
- skip("CertOpenStore failed: %08x\n", GetLastError());
+ skip("CertOpenStore failed: %08lx\n", GetLastError());
/* Crash
ret = funcs->pfnAddSgnr2Chain(NULL, FALSE, 0, NULL);
ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, NULL);
*/
ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr);
- ok(ret, "pfnAddSgnr2Chain failed: %08x\n", GetLastError());
- ok(data.csSigners == 1, "Expected 1 signer, got %d\n", data.csSigners);
+ ok(ret, "pfnAddSgnr2Chain failed: %08lx\n", GetLastError());
+ ok(data.csSigners == 1, "Expected 1 signer, got %ld\n", data.csSigners);
ok(data.pasSigners != NULL, "Expected pasSigners to be allocated\n");
if (data.pasSigners)
{
@@ -173,15 +173,15 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
sgnr.cbStruct = sizeof(CRYPT_PROVIDER_SGNR);
sgnr.sftVerifyAsOf.dwLowDateTime = 0xdeadbeef;
ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 1, &sgnr);
- ok(ret, "pfnAddSgnr2Chain failed: %08x\n", GetLastError());
- ok(data.csSigners == 2, "Expected 2 signers, got %d\n", data.csSigners);
+ ok(ret, "pfnAddSgnr2Chain failed: %08lx\n", GetLastError());
+ ok(data.csSigners == 2, "Expected 2 signers, got %ld\n", data.csSigners);
ok(!memcmp(&data.pasSigners[1], &sgnr, sizeof(sgnr)),
"Unexpected data in signer\n");
/* This also adds, but the index is ignored */
sgnr.cbStruct = sizeof(DWORD);
ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr);
- ok(ret, "pfnAddSgnr2Chain failed: %08x\n", GetLastError());
- ok(data.csSigners == 3, "Expected 3 signers, got %d\n", data.csSigners);
+ ok(ret, "pfnAddSgnr2Chain failed: %08lx\n", GetLastError());
+ ok(data.csSigners == 3, "Expected 3 signers, got %ld\n", data.csSigners);
sgnr.sftVerifyAsOf.dwLowDateTime = 0;
todo_wine
ok(!memcmp(&data.pasSigners[2], &sgnr, sizeof(sgnr)),
@@ -191,7 +191,7 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
SetLastError(0xdeadbeef);
ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "Expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* Crash
ret = funcs->pfnAddCert2Chain(NULL, 0, FALSE, 0, NULL);
@@ -206,8 +206,8 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
* 2. An invalid signer index isn't checked.
*/
ret = funcs->pfnAddCert2Chain(&data, 0, FALSE, 0, cert);
- ok(ret, "pfnAddCert2Chain failed: %08x\n", GetLastError());
- ok(data.pasSigners[0].csCertChain == 1, "Expected 1 cert, got %d\n",
+ ok(ret, "pfnAddCert2Chain failed: %08lx\n", GetLastError());
+ ok(data.pasSigners[0].csCertChain == 1, "Expected 1 cert, got %ld\n",
data.pasSigners[0].csCertChain);
ok(data.pasSigners[0].pasCertChain != NULL,
"Expected pasCertChain to be allocated\n");
@@ -221,7 +221,7 @@ static void test_utils(SAFE_PROVIDER_FUNCTIONS *funcs)
CertFreeCertificateContext(cert);
}
else
- skip("CertCreateCertificateContext failed: %08x\n", GetLastError());
+ skip("CertCreateCertificateContext failed: %08lx\n", GetLastError());
funcs->pfnFree(data.pasSigners);
}
}
@@ -243,7 +243,7 @@ static void testInitialize(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
*/
memset(&data, 0, sizeof(data));
ret = funcs->pfnInitialize(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
data.padwTrustStepErrors =
funcs->pfnAlloc(TRUSTERROR_MAX_STEPS * sizeof(DWORD));
/* Without wintrust data set, crashes when padwTrustStepErrors is set */
@@ -254,17 +254,17 @@ static void testInitialize(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
memset(data.padwTrustStepErrors, 0,
TRUSTERROR_MAX_STEPS * sizeof(DWORD));
ret = funcs->pfnInitialize(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
data.cdwTrustStepErrors = 1;
ret = funcs->pfnInitialize(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
memset(data.padwTrustStepErrors, 0xba,
TRUSTERROR_MAX_STEPS * sizeof(DWORD));
ret = funcs->pfnInitialize(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_WVTINIT] = 0;
ret = funcs->pfnInitialize(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
funcs->pfnFree(data.padwTrustStepErrors);
}
}
@@ -333,28 +333,28 @@ static void testObjTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
0x00,0x00,0x00,0x00,0x00 } };
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %08x\n",
+ "Expected ERROR_INVALID_PARAMETER, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
U(wintrust_data).pCert = &certInfo;
wintrust_data.dwUnionChoice = WTD_CHOICE_CERT;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
certInfo.psCertContext = (PCERT_CONTEXT)CertCreateCertificateContext(
X509_ASN_ENCODING, v1CertWithPubKey, sizeof(v1CertWithPubKey));
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
CertFreeCertificateContext(certInfo.psCertContext);
certInfo.psCertContext = NULL;
wintrust_data.dwUnionChoice = WTD_CHOICE_FILE;
U(wintrust_data).pFile = NULL;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
ERROR_INVALID_PARAMETER,
- "Expected ERROR_INVALID_PARAMETER, got %08x\n",
+ "Expected ERROR_INVALID_PARAMETER, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
U(wintrust_data).pFile = &fileInfo;
/* Crashes
@@ -366,19 +366,19 @@ static void testObjTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
U(data).pPDSip = &provDataSIP;
data.psPfns = (CRYPT_PROVIDER_FUNCTIONS *)funcs;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_SUBJECT_FORM_UNKNOWN,
- "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08x\n",
+ "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
CloseHandle(fileInfo.hFile);
fileInfo.hFile = NULL;
fileInfo.pcwszFilePath = pathW;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_SUBJECT_FORM_UNKNOWN,
- "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08x\n",
+ "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
DeleteFileW(pathW);
/* Test again with a file we expect to exist, and to contain no
@@ -386,12 +386,12 @@ static void testObjTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
*/
getNotepadPath(pathW, MAX_PATH);
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_NOSIGNATURE ||
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_SUBJECT_FORM_UNKNOWN,
- "Expected TRUST_E_NOSIGNATURE or TRUST_E_SUBJECT_FORM_UNKNOWN, got %08x\n",
+ "Expected TRUST_E_NOSIGNATURE or TRUST_E_SUBJECT_FORM_UNKNOWN, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
if (data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_NOSIGNATURE)
@@ -405,14 +405,14 @@ static void testObjTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
/* Specifying the GUID results in that GUID being the subject GUID */
fileInfo.pgKnownSubject = &bogusGuid;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_NOSIGNATURE ||
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_SUBJECT_FORM_UNKNOWN ||
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_PROVIDER_UNKNOWN,
- "Expected TRUST_E_NOSIGNATURE or TRUST_E_SUBJECT_FORM_UNKNOWN or TRUST_E_PROVIDER_UNKNOWN, got %08x\n",
+ "Expected TRUST_E_NOSIGNATURE or TRUST_E_SUBJECT_FORM_UNKNOWN or TRUST_E_PROVIDER_UNKNOWN, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV]);
if (data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] ==
TRUST_E_NOSIGNATURE)
@@ -425,7 +425,7 @@ static void testObjTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
{
fileInfo.pgKnownSubject = (GUID *)0xdeadbeef;
ret = funcs->pfnObjectTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
}
funcs->pfnFree(data.padwTrustStepErrors);
}
@@ -568,9 +568,9 @@ static void testCertTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
return;
}
ret = funcs->pfnCertificateTrust(&data);
- ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret);
+ ok(ret == S_FALSE, "Expected S_FALSE, got %08lx\n", ret);
ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV] ==
- TRUST_E_NOSIGNATURE, "Expected TRUST_E_NOSIGNATURE, got %08x\n",
+ TRUST_E_NOSIGNATURE, "Expected TRUST_E_NOSIGNATURE, got %08lx\n",
data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV]);
b = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr);
if (b)
@@ -579,7 +579,7 @@ static void testCertTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
/* An empty signer "succeeds," even though there's no cert */
ret = funcs->pfnCertificateTrust(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
cert = CertCreateCertificateContext(X509_ASN_ENCODING, selfSignedCert,
sizeof(selfSignedCert));
if (cert)
@@ -598,13 +598,13 @@ static void testCertTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
*/
data.psPfns = (CRYPT_PROVIDER_FUNCTIONS *)funcs;
ret = funcs->pfnCertificateTrust(&data);
- ok(ret == S_OK, "Expected S_OK, got %08x\n", ret);
- ok(data.csSigners == 1, "Unexpected number of signers %d\n",
+ ok(ret == S_OK, "Expected S_OK, got %08lx\n", ret);
+ ok(data.csSigners == 1, "Unexpected number of signers %ld\n",
data.csSigners);
ok(data.pasSigners[0].pChainContext != NULL,
"Expected a certificate chain\n");
ok(data.pasSigners[0].csCertChain == 1,
- "Unexpected number of chain elements %d\n",
+ "Unexpected number of chain elements %ld\n",
data.pasSigners[0].csCertChain);
/* pasSigners and pasSigners[0].pasCertChain are guaranteed to be
* initialized, see tests for pfnAddSgnr2Chain and pfnAddCert2Chain
@@ -615,7 +615,7 @@ static void testCertTrust(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
"Expected cert to be self-signed\n");
ok(data.pasSigners[0].pasCertChain[0].dwConfidence ==
(CERT_CONFIDENCE_SIG | CERT_CONFIDENCE_TIMENEST),
- "Expected CERT_CONFIDENCE_SIG | CERT_CONFIDENCE_TIMENEST, got %08x\n",
+ "Expected CERT_CONFIDENCE_SIG | CERT_CONFIDENCE_TIMENEST, got %08lx\n",
data.pasSigners[0].pasCertChain[0].dwConfidence);
CertFreeCertificateContext(
data.pasSigners[0].pasCertChain[0].pCert);
@@ -756,16 +756,16 @@ static void test_sip_create_indirect_data(void)
SetLastError(0xdeadbeef);
ret = CryptSIPCreateIndirectData_p(NULL, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = CryptSIPCreateIndirectData_p(&subjinfo, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
subjinfo.cbSize = sizeof(subjinfo);
SetLastError(0xdeadbeef);
ret = CryptSIPCreateIndirectData_p(&subjinfo, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
file = create_temp_file(temp_file);
if (file == INVALID_HANDLE_VALUE)
{
@@ -779,17 +779,17 @@ static void test_sip_create_indirect_data(void)
SetLastError(0xdeadbeef);
ret = CryptSIPCreateIndirectData_p(&subjinfo, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
subjinfo.pgSubjectType = &unknown;
SetLastError(0xdeadbeef);
ret = CryptSIPCreateIndirectData_p(&subjinfo, NULL, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
subjinfo.DigestAlgorithm.pszObjId = oid_sha1;
count = 0xdeadbeef;
ret = CryptSIPCreateIndirectData_p(&subjinfo, &count, NULL);
todo_wine
- ok(ret, "CryptSIPCreateIndirectData failed: %d\n", GetLastError());
+ ok(ret, "CryptSIPCreateIndirectData failed: %ld\n", GetLastError());
ok(count, "expected a positive count\n");
if (ret)
{
@@ -797,16 +797,16 @@ static void test_sip_create_indirect_data(void)
count = 256;
ret = CryptSIPCreateIndirectData_p(&subjinfo, &count, indirect);
- ok(ret, "CryptSIPCreateIndirectData failed: %d\n", GetLastError());
+ ok(ret, "CryptSIPCreateIndirectData failed: %ld\n", GetLastError());
/* If the count is larger than needed, it's unmodified */
- ok(count == 256, "unexpected count %d\n", count);
+ ok(count == 256, "unexpected count %ld\n", count);
ok(!strcmp(indirect->Data.pszObjId, SPC_PE_IMAGE_DATA_OBJID),
"unexpected data oid %s\n",
indirect->Data.pszObjId);
ok(!strcmp(indirect->DigestAlgorithm.pszObjId, oid_sha1),
"unexpected digest algorithm oid %s\n",
indirect->DigestAlgorithm.pszObjId);
- ok(indirect->Digest.cbData == 20, "unexpected hash size %d\n",
+ ok(indirect->Digest.cbData == 20, "unexpected hash size %ld\n",
indirect->Digest.cbData);
if (indirect->Digest.cbData == 20)
{
@@ -847,9 +847,9 @@ static void test_wintrust(void)
file.hFile = create_temp_file(pathW);
SetLastError(0xdeadbeef);
r = WinVerifyTrust(INVALID_HANDLE_VALUE, &generic_action_v2, &wtd);
- ok(r == GetLastError(), "expected %08x, got %08x\n", GetLastError(), r);
+ ok(r == GetLastError(), "expected %08lx, got %08lx\n", GetLastError(), r);
ok(r == TRUST_E_SUBJECT_FORM_UNKNOWN,
- "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08x\n", r);
+ "expected TRUST_E_SUBJECT_FORM_UNKNOWN, got %08lx\n", r);
CloseHandle(file.hFile);
DeleteFileW(pathW);
file.hFile = NULL;
@@ -857,25 +857,25 @@ static void test_wintrust(void)
getNotepadPath(pathW, MAX_PATH);
SetLastError(0xdeadbeef);
r = WinVerifyTrust(INVALID_HANDLE_VALUE, &generic_action_v2, &wtd);
- ok(r == GetLastError(), "expected %08x, got %08x\n", GetLastError(), r);
+ ok(r == GetLastError(), "expected %08lx, got %08lx\n", GetLastError(), r);
ok(r == TRUST_E_NOSIGNATURE || r == CRYPT_E_FILE_ERROR,
- "expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08x\n", r);
+ "expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08lx\n", r);
wtd.dwStateAction = WTD_STATEACTION_CLOSE;
SetLastError(0xdeadbeef);
r = WinVerifyTrust(INVALID_HANDLE_VALUE, &generic_action_v2, &wtd);
- ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %08x\n", GetLastError());
- ok(r == S_OK, "WinVerifyTrust failed: %08x\n", r);
+ ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %08lx\n", GetLastError());
+ ok(r == S_OK, "WinVerifyTrust failed: %08lx\n", r);
wtd.dwStateAction = WTD_STATEACTION_VERIFY;
SetLastError(0xdeadbeef);
hr = WinVerifyTrustEx(INVALID_HANDLE_VALUE, &generic_action_v2, &wtd);
- ok(hr == GetLastError(), "expected %08x, got %08x\n", GetLastError(), hr);
+ ok(hr == GetLastError(), "expected %08lx, got %08lx\n", GetLastError(), hr);
ok(hr == TRUST_E_NOSIGNATURE || hr == CRYPT_E_FILE_ERROR,
- "expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08x\n", hr);
+ "expected TRUST_E_NOSIGNATURE or CRYPT_E_FILE_ERROR, got %08lx\n", hr);
wtd.dwStateAction = WTD_STATEACTION_CLOSE;
SetLastError(0xdeadbeef);
r = WinVerifyTrust(INVALID_HANDLE_VALUE, &generic_action_v2, &wtd);
- ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %08x\n", GetLastError());
- ok(r == S_OK, "WinVerifyTrust failed: %08x\n", r);
+ ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %08lx\n", GetLastError());
+ ok(r == S_OK, "WinVerifyTrust failed: %08lx\n", r);
}
/* Self-signed .exe, built with tcc, signed with signtool
@@ -1142,7 +1142,7 @@ static void call_winverify(WCHAR *pathW, LONG *status, BOOL hash_only)
data.dwStateAction = WTD_STATEACTION_CLOSE;
ret = WinVerifyTrust(NULL, &WVTPolicyGUID, &data);
- ok(ret == S_OK, "WinVerifyTrust failed: %08x\n", ret);
+ ok(ret == S_OK, "WinVerifyTrust failed: %08lx\n", ret);
}
static void test_wintrust_digest(void)
@@ -1231,18 +1231,18 @@ static void test_wintrust_digest(void)
for (j = 0; tests[i].blocks[j].data; j++)
{
ret = WriteFile(file, tests[i].blocks[j].data, tests[i].blocks[j].length, &written, NULL);
- ok(ret && written == tests[i].blocks[j].length, "WriteFile failed with %u\n", GetLastError());
+ ok(ret && written == tests[i].blocks[j].length, "WriteFile failed with %lu\n", GetLastError());
}
CloseHandle(file);
call_winverify(pathW, &status, FALSE);
todo_wine_if(tests[i].t1.todo)
- ok(status == tests[i].t1.status, "test %d/1: expected %08x, got %08x\n", i, tests[i].t1.status, status);
+ ok(status == tests[i].t1.status, "test %d/1: expected %08lx, got %08lx\n", i, tests[i].t1.status, status);
call_winverify(pathW, &status, TRUE);
todo_wine_if(tests[i].t2.todo)
- ok(status == tests[i].t2.status, "test %d/2: expected %08x, got %08x\n", i, tests[i].t2.status, status);
+ ok(status == tests[i].t2.status, "test %d/2: expected %08lx, got %08lx\n", i, tests[i].t2.status, status);
DeleteFileW(pathW);
}
@@ -1261,22 +1261,22 @@ static void test_get_known_usages(void)
SetLastError(0xdeadbeef);
ret = pWTHelperGetKnownUsages(0, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pWTHelperGetKnownUsages(1, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pWTHelperGetKnownUsages(0, &usages);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
/* A value of 1 for the first parameter seems to imply the value is
* allocated
*/
SetLastError(0xdeadbeef);
usages = NULL;
ret = pWTHelperGetKnownUsages(1, &usages);
- ok(ret, "WTHelperGetKnownUsages failed: %d\n", GetLastError());
+ ok(ret, "WTHelperGetKnownUsages failed: %ld\n", GetLastError());
ok(usages != NULL, "expected a pointer\n");
if (ret && usages)
{
@@ -1289,10 +1289,10 @@ static void test_get_known_usages(void)
{
ok((*ptr)->cbSize == sizeof(CRYPT_OID_INFO) ||
(*ptr)->cbSize == (sizeof(CRYPT_OID_INFO) + 2 * sizeof(LPCWSTR)), /* Vista */
- "unexpected size %d\n", (*ptr)->cbSize);
+ "unexpected size %ld\n", (*ptr)->cbSize);
/* Each returned usage is in the CRYPT_ENHKEY_USAGE_OID_GROUP_ID group */
ok((*ptr)->dwGroupId == CRYPT_ENHKEY_USAGE_OID_GROUP_ID,
- "expected group CRYPT_ENHKEY_USAGE_OID_GROUP_ID, got %d\n",
+ "expected group CRYPT_ENHKEY_USAGE_OID_GROUP_ID, got %ld\n",
(*ptr)->dwGroupId);
}
}
@@ -1300,16 +1300,16 @@ static void test_get_known_usages(void)
*/
SetLastError(0xdeadbeef);
ret = pWTHelperGetKnownUsages(2, &usages);
- ok(ret, "WTHelperGetKnownUsages failed: %d\n", GetLastError());
+ ok(ret, "WTHelperGetKnownUsages failed: %ld\n", GetLastError());
ok(usages == NULL, "expected pointer to be cleared\n");
SetLastError(0xdeadbeef);
usages = NULL;
ret = pWTHelperGetKnownUsages(2, &usages);
- ok(ret, "WTHelperGetKnownUsages failed: %d\n", GetLastError());
+ ok(ret, "WTHelperGetKnownUsages failed: %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = pWTHelperGetKnownUsages(2, NULL);
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER,
- "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+ "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
}
START_TEST(softpub)
1
0
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/wintab32/tests/Makefile.in | 1 -
dlls/wintab32/tests/context.c | 22 +++++++++++-----------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/wintab32/tests/Makefile.in b/dlls/wintab32/tests/Makefile.in
index 921d97284dc..635e03fd5d6 100644
--- a/dlls/wintab32/tests/Makefile.in
+++ b/dlls/wintab32/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wintab32.dll
IMPORTS = user32
diff --git a/dlls/wintab32/tests/context.c b/dlls/wintab32/tests/context.c
index a88e4bb845d..4359412785a 100644
--- a/dlls/wintab32/tests/context.c
+++ b/dlls/wintab32/tests/context.c
@@ -165,40 +165,40 @@ static void test_WTInfoA(void)
ret = pWTInfoA( WTI_DEVICES, DVC_X, &value );
ok(ret == sizeof( AXIS ), "Wrong DVC_X size %d\n", ret);
- trace("DVC_X %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+ trace("DVC_X %ld, %ld, %d\n", value.axMin, value.axMax, value.axUnits);
ret = pWTInfoA( WTI_DEVICES, DVC_Y, &value );
ok(ret == sizeof( AXIS ), "Wrong DVC_Y size %d\n", ret);
- trace("DVC_Y %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+ trace("DVC_Y %ld, %ld, %d\n", value.axMin, value.axMax, value.axUnits);
ret = pWTInfoA( WTI_DEVICES, DVC_Z, &value );
if(ret)
- trace("DVC_Z %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+ trace("DVC_Z %ld, %ld, %d\n", value.axMin, value.axMax, value.axUnits);
else
trace("DVC_Z not supported\n");
ret = pWTInfoA( WTI_DEVICES, DVC_NPRESSURE, &value );
ok(ret == sizeof( AXIS ), "Wrong DVC_NPRESSURE, size %d\n", ret);
- trace("DVC_NPRESSURE %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+ trace("DVC_NPRESSURE %ld, %ld, %d\n", value.axMin, value.axMax, value.axUnits);
ret = pWTInfoA( WTI_DEVICES, DVC_TPRESSURE, &value );
if(ret)
- trace("DVC_TPRESSURE %d, %d, %d\n", value.axMin, value.axMax, value.axUnits);
+ trace("DVC_TPRESSURE %ld, %ld, %d\n", value.axMin, value.axMax, value.axUnits);
else
trace("DVC_TPRESSURE not supported\n");
ret = pWTInfoA( WTI_DEVICES, DVC_ORIENTATION, &orientation );
ok(ret == sizeof( AXIS )*3, "Wrong DVC_ORIENTATION, size %d\n", ret);
- trace("DVC_ORIENTATION0 %d, %d, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
- trace("DVC_ORIENTATION1 %d, %d, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
- trace("DVC_ORIENTATION2 %d, %d, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
+ trace("DVC_ORIENTATION0 %ld, %ld, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
+ trace("DVC_ORIENTATION1 %ld, %ld, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
+ trace("DVC_ORIENTATION2 %ld, %ld, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
ret = pWTInfoA( WTI_DEVICES, DVC_ROTATION, &orientation );
if(ret)
{
- trace("DVC_ROTATION0 %d, %d, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
- trace("DVC_ROTATION1 %d, %d, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
- trace("DVC_ROTATION2 %d, %d, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
+ trace("DVC_ROTATION0 %ld, %ld, %d\n", orientation[0].axMin, orientation[0].axMax, orientation[0].axUnits);
+ trace("DVC_ROTATION1 %ld, %ld, %d\n", orientation[1].axMin, orientation[1].axMax, orientation[1].axUnits);
+ trace("DVC_ROTATION2 %ld, %ld, %d\n", orientation[2].axMin, orientation[2].axMax, orientation[2].axUnits);
}
else
trace("DVC_ROTATION not supported\n");
1
0
[PATCH] dlls/windows.media.devices/tests: enable compilation with long types
by Eric Pouech March 9, 2022
by Eric Pouech March 9, 2022
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/windows.media.devices/tests/Makefile.in | 1 -
dlls/windows.media.devices/tests/devices.c | 40 +++++++++++++-------------
2 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/dlls/windows.media.devices/tests/Makefile.in b/dlls/windows.media.devices/tests/Makefile.in
index 37f5f7bde06..4d107889dad 100644
--- a/dlls/windows.media.devices/tests/Makefile.in
+++ b/dlls/windows.media.devices/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = windows.media.devices.dll
IMPORTS = combase
diff --git a/dlls/windows.media.devices/tests/devices.c b/dlls/windows.media.devices/tests/devices.c
index d8acc638837..c992686d4e8 100644
--- a/dlls/windows.media.devices/tests/devices.c
+++ b/dlls/windows.media.devices/tests/devices.c
@@ -103,7 +103,7 @@ static HRESULT WINAPI async_activate_ActivateCompleted(
hr = IActivateAudioInterfaceAsyncOperation_GetActivateResult(op,
&async_activate_test.result_hr, &async_activate_test.result_iface);
ok(hr == S_OK,
- "%s: GetActivateResult failed: %08x\n",
+ "%s: GetActivateResult failed: %08lx\n",
async_activate_test.msg_pfx, hr);
return S_OK;
@@ -135,29 +135,29 @@ static void test_MediaDeviceStatics(void)
DWORD dr;
hr = WindowsCreateString(media_device_statics_name, wcslen(media_device_statics_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK, "RoGetActivationFactory failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoGetActivationFactory failed, hr %#lx\n", hr);
WindowsDeleteString(str);
/* interface tests */
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IMediaDeviceStatics, (void **)&media_device_statics);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IMediaDeviceStatics failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IMediaDeviceStatics failed, hr %#lx\n", hr);
hr = IMediaDeviceStatics_QueryInterface(media_device_statics, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IMediaDeviceStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IMediaDeviceStatics_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IMediaDeviceStatics_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IMediaDeviceStatics_QueryInterface(media_device_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IMediaDeviceStatics_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IMediaDeviceStatics_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IMediaDeviceStatics_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
@@ -169,7 +169,7 @@ static void test_MediaDeviceStatics(void)
/* test default capture device creation */
hr = IMediaDeviceStatics_GetDefaultAudioCaptureId(media_device_statics, AudioDeviceRole_Default, &str);
- ok(hr == S_OK, "GetDefaultAudioCaptureId failed: %08x\n", hr);
+ ok(hr == S_OK, "GetDefaultAudioCaptureId failed: %08lx\n", hr);
ok((!!g_default_capture_id) == (!!str),
"Presence of default capture device doesn't match expected state\n");
@@ -181,7 +181,7 @@ static void test_MediaDeviceStatics(void)
/* returned id does not work in GetDevice... */
hr = IMMDeviceEnumerator_GetDevice(g_mmdevenum, WindowsGetStringRawBuffer(str, NULL), &mmdev);
- ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08x\n", hr);
+ ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08lx\n", hr);
/* ...but does work in ActivateAudioInterfaceAsync */
async_activate_test.ref = 1;
@@ -194,14 +194,14 @@ static void test_MediaDeviceStatics(void)
EnterCriticalSection(&async_activate_test.lock);
hr = pActivateAudioInterfaceAsync(WindowsGetStringRawBuffer(str, NULL),
&IID_IAudioClient2, NULL, &async_activate_done, &async_activate_test.op);
- ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08x\n", hr);
+ ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08lx\n", hr);
LeaveCriticalSection(&async_activate_test.lock);
IActivateAudioInterfaceAsyncOperation_Release(async_activate_test.op);
dr = WaitForSingleObject(async_activate_test.evt, 1000); /* wait for all refs other than our own to be released */
ok(dr == WAIT_OBJECT_0, "Timed out waiting for async activate to complete\n");
- ok(async_activate_test.result_hr == S_OK, "Got unexpected activation result: %08x\n", async_activate_test.result_hr);
+ ok(async_activate_test.result_hr == S_OK, "Got unexpected activation result: %08lx\n", async_activate_test.result_hr);
ok(async_activate_test.result_iface != NULL, "Expected to get WASAPI interface, but got NULL\n");
IUnknown_Release(async_activate_test.result_iface);
@@ -210,7 +210,7 @@ static void test_MediaDeviceStatics(void)
/* test default render device creation */
hr = IMediaDeviceStatics_GetDefaultAudioRenderId(media_device_statics, AudioDeviceRole_Default, &str);
- ok(hr == S_OK, "GetDefaultAudioRenderId failed: %08x\n", hr);
+ ok(hr == S_OK, "GetDefaultAudioRenderId failed: %08lx\n", hr);
ok((!!g_default_render_id) == (!!str),
"Presence of default render device doesn't match expected state\n");
@@ -222,7 +222,7 @@ static void test_MediaDeviceStatics(void)
/* returned id does not work in GetDevice... */
hr = IMMDeviceEnumerator_GetDevice(g_mmdevenum, WindowsGetStringRawBuffer(str, NULL), &mmdev);
- ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08x\n", hr);
+ ok(hr == E_INVALIDARG, "GetDevice gave wrong error: %08lx\n", hr);
/* ...but does work in ActivateAudioInterfaceAsync */
async_activate_test.ref = 1;
@@ -235,14 +235,14 @@ static void test_MediaDeviceStatics(void)
EnterCriticalSection(&async_activate_test.lock);
hr = pActivateAudioInterfaceAsync(WindowsGetStringRawBuffer(str, NULL),
&IID_IAudioClient2, NULL, &async_activate_done, &async_activate_test.op);
- ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08x\n", hr);
+ ok(hr == S_OK, "ActivateAudioInterfaceAsync failed: %08lx\n", hr);
LeaveCriticalSection(&async_activate_test.lock);
IActivateAudioInterfaceAsyncOperation_Release(async_activate_test.op);
dr = WaitForSingleObject(async_activate_test.evt, 1000); /* wait for all refs other than our own to be released */
ok(dr == WAIT_OBJECT_0, "Timed out waiting for async activate to complete\n");
- ok(async_activate_test.result_hr == S_OK, "Got unexpected activation result: %08x\n", async_activate_test.result_hr);
+ ok(async_activate_test.result_hr == S_OK, "Got unexpected activation result: %08lx\n", async_activate_test.result_hr);
ok(async_activate_test.result_iface != NULL, "Expected to get WASAPI interface, but got NULL\n");
IUnknown_Release(async_activate_test.result_iface);
@@ -278,17 +278,17 @@ START_TEST(devices)
#undef LOAD_FUNCPTR
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL,
CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&g_mmdevenum);
- ok(hr == S_OK, "Couldn't make MMDeviceEnumerator: %08x\n", hr);
+ ok(hr == S_OK, "Couldn't make MMDeviceEnumerator: %08lx\n", hr);
hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(g_mmdevenum, eCapture, eMultimedia, &mmdev);
if (hr == S_OK)
{
hr = IMMDevice_GetId(mmdev, &g_default_capture_id);
- ok(hr == S_OK, "IMMDevice::GetId(capture) failed: %08x\n", hr);
+ ok(hr == S_OK, "IMMDevice::GetId(capture) failed: %08lx\n", hr);
IMMDevice_Release(mmdev);
}
@@ -299,7 +299,7 @@ START_TEST(devices)
if (hr == S_OK)
{
hr = IMMDevice_GetId(mmdev, &g_default_render_id);
- ok(hr == S_OK, "IMMDevice::GetId(render) failed: %08x\n", hr);
+ ok(hr == S_OK, "IMMDevice::GetId(render) failed: %08lx\n", hr);
IMMDevice_Release(mmdev);
}
1
0
[PATCH] dlls/windows.globalization/tests: enable compilation with long types
by Eric Pouech March 9, 2022
by Eric Pouech March 9, 2022
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/windows.globalization/tests/Makefile.in | 1
dlls/windows.globalization/tests/globalization.c | 52 +++++++++++-----------
2 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/dlls/windows.globalization/tests/Makefile.in b/dlls/windows.globalization/tests/Makefile.in
index 2b643ef8437..7ee2bc407d6 100644
--- a/dlls/windows.globalization/tests/Makefile.in
+++ b/dlls/windows.globalization/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = windows.globalization.dll
IMPORTS = combase uuid
diff --git a/dlls/windows.globalization/tests/globalization.c b/dlls/windows.globalization/tests/globalization.c
index ebe7ccc4704..c42cb67496e 100644
--- a/dlls/windows.globalization/tests/globalization.c
+++ b/dlls/windows.globalization/tests/globalization.c
@@ -59,13 +59,13 @@ static void test_GlobalizationPreferences(void)
GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH);
hr = RoInitialize(RO_INIT_MULTITHREADED);
- ok(hr == S_OK, "RoInitialize failed, hr %#x\n", hr);
+ ok(hr == S_OK, "RoInitialize failed, hr %#lx\n", hr);
hr = WindowsCreateString(class_name, wcslen(class_name), &str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory);
- ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#x\n", hr);
+ ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG), "RoGetActivationFactory failed, hr %#lx\n", hr);
if (hr == REGDB_E_CLASSNOTREG)
{
win_skip("%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w(class_name));
@@ -75,26 +75,26 @@ static void test_GlobalizationPreferences(void)
}
hr = IActivationFactory_QueryInterface(factory, &IID_IInspectable, (void **)&inspectable);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IAgileObject, (void **)&agile_object);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
hr = IActivationFactory_QueryInterface(factory, &IID_IGlobalizationPreferencesStatics, (void **)&preferences_statics);
- ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IActivationFactory_QueryInterface IID_IGlobalizationPreferencesStatics failed, hr %#lx\n", hr);
hr = IGlobalizationPreferencesStatics_QueryInterface(preferences_statics, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable failed, hr %#lx\n", hr);
ok(tmp_inspectable == inspectable, "IGlobalizationPreferencesStatics_QueryInterface IID_IInspectable returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IGlobalizationPreferencesStatics_QueryInterface(preferences_statics, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject failed, hr %#lx\n", hr);
ok(tmp_agile_object == agile_object, "IGlobalizationPreferencesStatics_QueryInterface IID_IAgileObject returned %p, expected %p\n", tmp_agile_object, agile_object);
IAgileObject_Release(tmp_agile_object);
hr = IGlobalizationPreferencesStatics_get_HomeGeographicRegion(preferences_statics, &tmp_str);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_HomeGeographicRegion failed, hr %#lx\n", hr);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len);
@@ -112,25 +112,25 @@ static void test_GlobalizationPreferences(void)
WindowsDeleteString(tmp_str);
hr = IGlobalizationPreferencesStatics_get_Languages(preferences_statics, &languages);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Languages failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Languages failed, hr %#lx\n", hr);
hr = IVectorView_HSTRING_QueryInterface(languages, &IID_IInspectable, (void **)&tmp_inspectable);
- ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_inspectable != inspectable, "IVectorView_HSTRING_QueryInterface returned %p, expected %p\n", tmp_inspectable, inspectable);
IInspectable_Release(tmp_inspectable);
hr = IVectorView_HSTRING_QueryInterface(languages, &IID_IAgileObject, (void **)&tmp_agile_object);
- ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_QueryInterface failed, hr %#lx\n", hr);
ok(tmp_agile_object != agile_object, "IVectorView_HSTRING_QueryInterface IID_IAgileObject returned agile_object\n");
IAgileObject_Release(tmp_agile_object);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(languages, &size);
- ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
hr = IVectorView_HSTRING_GetAt(languages, 0, &tmp_str);
- ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
ok(buf != NULL && len > 0, "WindowsGetStringRawBuffer returned buf %p, len %u\n", buf, len);
@@ -141,34 +141,34 @@ static void test_GlobalizationPreferences(void)
i = 0xdeadbeef;
found = FALSE;
hr = IVectorView_HSTRING_IndexOf(languages, tmp_str, &i, &found);
- ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#lx\n", hr);
ok(i == 0 && found == TRUE, "IVectorView_HSTRING_IndexOf returned size %d, found %d\n", size, found);
WindowsDeleteString(tmp_str);
hr = WindowsCreateString(L"deadbeef", 8, &tmp_str);
- ok(hr == S_OK, "WindowsCreateString failed, hr %#x\n", hr);
+ ok(hr == S_OK, "WindowsCreateString failed, hr %#lx\n", hr);
i = 0xdeadbeef;
found = TRUE;
hr = IVectorView_HSTRING_IndexOf(languages, tmp_str, &i, &found);
- ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_IndexOf failed, hr %#lx\n", hr);
ok(i == 0 && found == FALSE, "IVectorView_HSTRING_IndexOf returned size %d, found %d\n", size, found);
WindowsDeleteString(tmp_str);
tmp_str = (HSTRING)0xdeadbeef;
hr = IVectorView_HSTRING_GetAt(languages, size, &tmp_str);
- ok(hr == E_BOUNDS, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
+ ok(hr == E_BOUNDS, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(tmp_str == NULL, "IVectorView_HSTRING_GetAt returned %p\n", tmp_str);
tmp_str = (HSTRING)0xdeadbeef;
hr = IVectorView_HSTRING_GetMany(languages, size, 1, &tmp_str, &i);
- ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(i == 0 && tmp_str == NULL, "IVectorView_HSTRING_GetMany returned count %u, str %p\n", i, tmp_str);
hr = IVectorView_HSTRING_GetMany(languages, 0, 1, &tmp_str, &i);
- ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_GetAt failed, hr %#lx\n", hr);
ok(i == 1, "IVectorView_HSTRING_GetMany returned count %u, expected 1\n", i);
buf = WindowsGetStringRawBuffer(tmp_str, &len);
@@ -184,33 +184,33 @@ static void test_GlobalizationPreferences(void)
hr = IGlobalizationPreferencesStatics_get_Calendars(preferences_statics, &calendars);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Calendars failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Calendars failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(calendars, &size);
- ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(calendars);
hr = IGlobalizationPreferencesStatics_get_Clocks(preferences_statics, &clocks);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Clocks failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Clocks failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(clocks, &size);
- ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(clocks);
hr = IGlobalizationPreferencesStatics_get_Currencies(preferences_statics, ¤cies);
- ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Currencies failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IGlobalizationPreferencesStatics_get_Currencies failed, hr %#lx\n", hr);
size = 0xdeadbeef;
hr = IVectorView_HSTRING_get_Size(currencies, &size);
- ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#x\n", hr);
+ ok(hr == S_OK, "IVectorView_HSTRING_get_Size failed, hr %#lx\n", hr);
todo_wine ok(size != 0 && size != 0xdeadbeef, "IVectorView_HSTRING_get_Size returned %u\n", size);
IVectorView_HSTRING_Release(currencies);
1
0
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/wiaservc/tests/Makefile.in | 1 -
dlls/wiaservc/tests/wia.c | 16 ++++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/wiaservc/tests/Makefile.in b/dlls/wiaservc/tests/Makefile.in
index 7eadf649a35..594e1b2a988 100644
--- a/dlls/wiaservc/tests/Makefile.in
+++ b/dlls/wiaservc/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wiaservc.dll
IMPORTS = ole32
diff --git a/dlls/wiaservc/tests/wia.c b/dlls/wiaservc/tests/wia.c
index 48050f4ecc9..b2ac607a8dd 100644
--- a/dlls/wiaservc/tests/wia.c
+++ b/dlls/wiaservc/tests/wia.c
@@ -39,19 +39,19 @@ static void test_EnumDeviceInfo(void)
ULONG count;
hr = IWiaDevMgr_EnumDeviceInfo(devmanager, WIA_DEVINFO_ENUM_LOCAL, NULL);
- ok(FAILED(hr), "got 0x%08x\n", hr);
+ ok(FAILED(hr), "got 0x%08lx\n", hr);
hr = IWiaDevMgr_EnumDeviceInfo(devmanager, WIA_DEVINFO_ENUM_LOCAL, &devenum);
- ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
hr = IEnumWIA_DEV_INFO_GetCount(devenum, NULL);
- ok(FAILED(hr), "got 0x%08x\n", hr);
+ ok(FAILED(hr), "got 0x%08lx\n", hr);
count = 1000;
hr = IEnumWIA_DEV_INFO_GetCount(devenum, &count);
todo_wine
- ok(hr == S_OK, "got 0x%08x\n", hr);
- ok(count != 1000, "got %u\n", count);
+ ok(hr == S_OK, "got 0x%08lx\n", hr);
+ ok(count != 1000, "got %lu\n", count);
IEnumWIA_DEV_INFO_Release(devenum);
}
@@ -62,11 +62,11 @@ static void test_SelectDeviceDlg(void)
IWiaItem *root;
hr = IWiaDevMgr_SelectDeviceDlg(devmanager, NULL, StiDeviceTypeDefault, 0, NULL, NULL);
todo_wine
- ok(hr == E_POINTER, "got 0x%08x\n", hr);
+ ok(hr == E_POINTER, "got 0x%08lx\n", hr);
hr = IWiaDevMgr_SelectDeviceDlg(devmanager, NULL, StiDeviceTypeDefault, 0, NULL, &root);
todo_wine
- ok(hr == S_OK || hr == WIA_S_NO_DEVICE_AVAILABLE, "got 0x%08x\n", hr);
+ ok(hr == S_OK || hr == WIA_S_NO_DEVICE_AVAILABLE, "got 0x%08lx\n", hr);
}
START_TEST(wia)
@@ -77,7 +77,7 @@ START_TEST(wia)
hr = CoCreateInstance(&CLSID_WiaDevMgr, NULL, CLSCTX_LOCAL_SERVER, &IID_IWiaDevMgr, (void**)&devmanager);
if (FAILED(hr)) {
- win_skip("Failed to create WiaDevMgr instance, 0x%08x\n", hr);
+ win_skip("Failed to create WiaDevMgr instance, 0x%08lx\n", hr);
CoUninitialize();
return;
}
1
0
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/kernel32/tests/atom.c | 33 +++++++++++++------------
dlls/kernel32/tests/drive.c | 37 ++++++++++++++--------------
dlls/kernel32/tests/mailslot.c | 53 ++++++++++++++++++++--------------------
dlls/kernel32/tests/power.c | 11 +++++---
dlls/kernel32/tests/resource.c | 47 ++++++++++++++++++-----------------
dlls/kernel32/tests/timer.c | 29 +++++++++++-----------
dlls/kernel32/tests/toolhelp.c | 17 +++++++------
7 files changed, 117 insertions(+), 110 deletions(-)
diff --git a/dlls/kernel32/tests/atom.c b/dlls/kernel32/tests/atom.c
index 4796d41d23d..ac69a53066b 100644
--- a/dlls/kernel32/tests/atom.c
+++ b/dlls/kernel32/tests/atom.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdio.h>
@@ -115,20 +116,20 @@ static void test_add_atom(void)
{
SetLastError( 0xdeadbeef );
ok( GlobalAddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
if (unicode_OS)
{
SetLastError( 0xdeadbeef );
ok( GlobalAddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
}
}
for (i = 0xc000; i <= 0xffff; i++)
{
- ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %lx\n", i );
+ ok( !GlobalAddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i );
if (unicode_OS)
- ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i );
+ ok( !GlobalAddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i );
}
}
@@ -196,7 +197,7 @@ static void test_get_atom_name(void)
len = GlobalGetAtomNameA( (ATOM)i, buf, 2);
ok(!len, "bad length %d\n", len);
ok(GetLastError() == ERROR_MORE_DATA || GetLastError() == ERROR_INVALID_PARAMETER,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
memset( buf, '.', sizeof(buf) );
@@ -229,7 +230,7 @@ static void test_get_atom_name(void)
SetLastError(0xdeadbeef);
len = GlobalGetAtomNameA(atom, out, 10);
ok(!len, "bad length %d\n", len);
- ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%u instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
+ ok(GetLastError() == ERROR_MORE_DATA, "wrong error code (%lu instead of %u)\n", GetLastError(), ERROR_MORE_DATA);
for (i = 0; i < 9; i++)
{
ok(out[i] == "abcdefghij"[i % 10], "wrong string at %i (%c instead of %c)\n", i, out[i], "abcdefghij"[i % 10]);
@@ -266,7 +267,7 @@ static void test_get_atom_name(void)
{
/* len == 0 with ERROR_MORE_DATA is on NT3.51 */
ok(len == 1 || (len == 0 && GetLastError() == ERROR_MORE_DATA),
- "0x%04x: got %u with %d (expected '1' or '0' with "
+ "0x%04x: got %u with %ld (expected '1' or '0' with "
"ERROR_MORE_DATA)\n", i, len, GetLastError());
ok(outW[1] == DOUBLE('.'), "buffer overwrite\n");
}
@@ -373,20 +374,20 @@ static void test_local_add_atom(void)
{
SetLastError( 0xdeadbeef );
ok( AddAtomA((LPCSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
if (unicode_OS)
{
SetLastError( 0xdeadbeef );
ok( AddAtomW((LPCWSTR)i) == i && GetLastError() == 0xdeadbeef,
- "failed to add atom %lx\n", i );
+ "failed to add atom %Ix\n", i );
}
}
for (i = 0xc000; i <= 0xffff; i++)
{
- ok( !AddAtomA((LPCSTR)i), "succeeded adding %lx\n", i );
+ ok( !AddAtomA((LPCSTR)i), "succeeded adding %Ix\n", i );
if (unicode_OS)
- ok( !AddAtomW((LPCWSTR)i), "succeeded adding %lx\n", i );
+ ok( !AddAtomW((LPCWSTR)i), "succeeded adding %Ix\n", i );
}
}
@@ -472,11 +473,11 @@ static void test_local_get_atom_name(void)
if (i)
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
else
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
/* test string limits & overflow */
do_initA(in, "abcdefghij", 255);
@@ -505,7 +506,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error code (%u)\n", GetLastError());
+ "wrong error code (%lu)\n", GetLastError());
if (unicode_OS)
{
@@ -532,7 +533,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_MORE_DATA ||
GetLastError() == (i ? ERROR_INSUFFICIENT_BUFFER : ERROR_INVALID_PARAMETER),
- "wrong error conditions %u for %u\n", GetLastError(), i);
+ "wrong error conditions %lu for %u\n", GetLastError(), i);
}
do_initW(inW, "abcdefghij", 255);
atom = AddAtomW(inW);
@@ -560,7 +561,7 @@ static void test_local_get_atom_name(void)
/* ERROR_MORE_DATA is on nt3.51 sp5 */
ok(GetLastError() == ERROR_INVALID_PARAMETER ||
GetLastError() == ERROR_MORE_DATA,
- "wrong error code (%u)\n", GetLastError());
+ "wrong error code (%lu)\n", GetLastError());
}
}
diff --git a/dlls/kernel32/tests/drive.c b/dlls/kernel32/tests/drive.c
index 98dc454f340..6fa0754de3e 100644
--- a/dlls/kernel32/tests/drive.c
+++ b/dlls/kernel32/tests/drive.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
@@ -35,7 +36,7 @@ static void test_GetDriveTypeA(void)
UINT type;
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -88,7 +89,7 @@ static void test_GetDriveTypeW(void)
UINT type;
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -142,21 +143,21 @@ static void test_GetDiskFreeSpaceA(void)
DWORD logical_drives;
ret = GetDiskFreeSpaceA(NULL, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_NAME),
- "GetDiskFreeSpaceA(\"\"): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceA(\"\"): ret=%d GetLastError=%ld\n",
ret, GetLastError());
ret = GetDiskFreeSpaceA("\\", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
ret = GetDiskFreeSpaceA("/", §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceA error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceA error %ld\n", GetLastError());
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -169,7 +170,7 @@ static void test_GetDiskFreeSpaceA(void)
ret = GetDiskFreeSpaceA(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
if (!(logical_drives & 1))
ok(!ret && (GetLastError() == ERROR_PATH_NOT_FOUND || GetLastError() == ERROR_INVALID_DRIVE),
- "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceA(%s): ret=%d GetLastError=%ld\n",
drive, ret, GetLastError());
else
{
@@ -177,12 +178,12 @@ static void test_GetDiskFreeSpaceA(void)
if (!ret)
/* GetDiskFreeSpaceA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceA(%s) failed with %d\n", drive, GetLastError());
+ trace("GetDiskFreeSpaceA(%s) failed with %ld\n", drive, GetLastError());
if( GetVersion() & 0x80000000)
/* win3.0 through winME */
ok( total_clusters <= 65535,
- "total clusters is %d > 65535\n", total_clusters);
+ "total clusters is %ld > 65535\n", total_clusters);
else if (pGetDiskFreeSpaceExA) {
/* NT, 2k, XP : GetDiskFreeSpace should be accurate */
ULARGE_INTEGER totEx, tot, d;
@@ -194,7 +195,7 @@ static void test_GetDiskFreeSpaceA(void)
if (!ret)
/* GetDiskFreeSpaceExA() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceExA(%s) failed with %d\n", drive, GetLastError());
+ trace("GetDiskFreeSpaceExA(%s) failed with %ld\n", drive, GetLastError());
ok( bytes_per_sector == 0 || /* empty cd rom drive */
totEx.QuadPart <= tot.QuadPart,
@@ -222,21 +223,21 @@ static void test_GetDiskFreeSpaceW(void)
win_skip("GetDiskFreeSpaceW is not available\n");
return;
}
- ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(empty_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
- "GetDiskFreeSpaceW(\"\"): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceW(\"\"): ret=%d GetLastError=%ld\n",
ret, GetLastError());
ret = GetDiskFreeSpaceW(root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceW(\"\") error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW(\"\") error %ld\n", GetLastError());
ret = GetDiskFreeSpaceW(unix_style_root_pathW, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
- ok(ret, "GetDiskFreeSpaceW error %d\n", GetLastError());
+ ok(ret, "GetDiskFreeSpaceW error %ld\n", GetLastError());
logical_drives = GetLogicalDrives();
- ok(logical_drives != 0, "GetLogicalDrives error %d\n", GetLastError());
+ ok(logical_drives != 0, "GetLogicalDrives error %ld\n", GetLastError());
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{
@@ -247,12 +248,12 @@ static void test_GetDiskFreeSpaceW(void)
ret = GetDiskFreeSpaceW(drive, §ors_per_cluster, &bytes_per_sector, &free_clusters, &total_clusters);
if (!(logical_drives & 1))
ok(!ret && GetLastError() == ERROR_PATH_NOT_FOUND,
- "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%d\n",
+ "GetDiskFreeSpaceW(%c): ret=%d GetLastError=%ld\n",
drive[0], ret, GetLastError());
else if (!ret)
/* GetDiskFreeSpaceW() should succeed, but it can fail with too many
different GetLastError() results to be usable for an ok() */
- trace("GetDiskFreeSpaceW(%c) failed with %d\n", drive[0], GetLastError());
+ trace("GetDiskFreeSpaceW(%c) failed with %ld\n", drive[0], GetLastError());
}
logical_drives >>= 1;
}
diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c
index 7e488566dbb..8011249542d 100644
--- a/dlls/kernel32/tests/mailslot.c
+++ b/dlls/kernel32/tests/mailslot.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
@@ -81,38 +82,38 @@ static int mailslot_test(void)
SetLastError(0xdeadbeef);
ret = ReadFile(INVALID_HANDLE_VALUE, buffer, 0, &count, NULL);
ok(!ret, "ReadFile should fail\n");
- ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError());
- ok(count == 0, "expected 0, got %u\n", count);
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %lu\n", GetLastError());
+ ok(count == 0, "expected 0, got %lu\n", count);
count = 0xdeadbeef;
SetLastError(0xdeadbeef);
ret = ReadFile(hSlot, buffer, 0, &count, NULL);
ok(!ret, "ReadFile should fail\n");
todo_wine
- ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError());
- ok(count == 0, "expected 0, got %u\n", count);
+ ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError());
+ ok(count == 0, "expected 0, got %lu\n", count);
count = 0;
memset(buffer, 0, sizeof buffer);
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL),
"slot write\n");
- ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/* now try and open the client, but with the wrong sharing mode */
hWriter = CreateFileA(szmspath, GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION,
- "error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter, GetLastError());
+ "error should be ERROR_SHARING_VIOLATION got %p / %lu\n", hWriter, GetLastError());
if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter );
/* now open the client with the correct sharing mode */
hWriter = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
- ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError());
+ ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %lu\n", GetLastError());
/*
* opening a client should make no difference to
@@ -120,11 +121,11 @@ static int mailslot_test(void)
*/
ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL),
"slot write\n");
- ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %lu\n", GetLastError() );
/*
* we can't read from this client,
@@ -133,13 +134,13 @@ static int mailslot_test(void)
ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can read client\n");
ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED,
- "wrong error %u\n", GetLastError() );
+ "wrong error %lu\n", GetLastError() );
ok( WriteFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can't write client\n");
ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL),
"can read client\n");
ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED,
- "wrong error %u\n", GetLastError() );
+ "wrong error %lu\n", GetLastError() );
/*
* seeing as there's something in the slot,
@@ -152,8 +153,8 @@ static int mailslot_test(void)
/* but not again */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* now try open another writer... should fail */
hWriter2 = CreateFileA(szmspath, GENERIC_READ|GENERIC_WRITE,
@@ -214,8 +215,8 @@ static int mailslot_test(void)
/* check there's still no data */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "slot read\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* write two messages */
buffer[0] = 'a';
@@ -250,7 +251,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n");
ok( dwNext == 1, "dwNext incorrect\n");
todo_wine
- ok( dwMsgCount == 3, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 3, "dwMsgCount incorrect %lu\n", dwMsgCount);
buffer[0]=buffer[1]=0;
@@ -269,7 +270,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n");
ok( dwNext == 2, "dwNext incorrect\n");
todo_wine {
- ok( dwMsgCount == 2, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 2, "dwMsgCount incorrect %lu\n", dwMsgCount);
}
/* read the second message */
@@ -282,9 +283,9 @@ static int mailslot_test(void)
dwNext = dwMsgCount = 0;
ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
"getmailslotinfo failed\n");
- ok( dwNext == 0, "dwNext incorrect %u\n", dwNext);
+ ok( dwNext == 0, "dwNext incorrect %lu\n", dwNext);
todo_wine {
- ok( dwMsgCount == 1, "dwMsgCount incorrect %u\n", dwMsgCount);
+ ok( dwMsgCount == 1, "dwMsgCount incorrect %lu\n", dwMsgCount);
}
/* read the 3rd (zero length) message */
@@ -307,8 +308,8 @@ static int mailslot_test(void)
/* check that reads fail */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret, "3rd slot read succeeded\n");
- if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
- else ok( count == 0, "wrong count %u\n", count );
+ if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
+ else ok( count == 0, "wrong count %lu\n", count );
/* finally close the mailslot and its client */
ok( CloseHandle( hWriter2 ), "closing 2nd client\n");
@@ -322,9 +323,9 @@ static int mailslot_test(void)
memset(buffer, 0, sizeof buffer);
dwTimeout = GetTickCount();
ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n");
- ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %lu\n", GetLastError() );
dwTimeout = GetTickCount() - dwTimeout;
- ok( dwTimeout >= 900, "timeout too short %u\n", dwTimeout );
+ ok( dwTimeout >= 900, "timeout too short %lu\n", dwTimeout );
ok( CloseHandle( hSlot ), "closing the mailslot\n");
return 0;
diff --git a/dlls/kernel32/tests/power.c b/dlls/kernel32/tests/power.c
index af488849e21..40ecf29a941 100644
--- a/dlls/kernel32/tests/power.c
+++ b/dlls/kernel32/tests/power.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "wine/test.h"
@@ -53,14 +54,14 @@ void test_GetSystemPowerStatus(void)
"expected %u%%-charged battery to have capacity flags 0x%02x, got 0x%02x\n",
ps.BatteryLifePercent, expected_capacity_flags, capacity_flags);
ok(ps.BatteryLifeTime <= ps.BatteryFullLifeTime,
- "expected BatteryLifeTime %u to be less than or equal to BatteryFullLifeTime %u\n",
+ "expected BatteryLifeTime %lu to be less than or equal to BatteryFullLifeTime %lu\n",
ps.BatteryLifeTime, ps.BatteryFullLifeTime);
if (ps.BatteryFlag & BATTERY_FLAG_CHARGING)
{
ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryLifeTime to be -1 when charging, got %u\n", ps.BatteryLifeTime);
+ "expected BatteryLifeTime to be -1 when charging, got %lu\n", ps.BatteryLifeTime);
ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryFullLifeTime to be -1 when charging, got %u\n", ps.BatteryFullLifeTime);
+ "expected BatteryFullLifeTime to be -1 when charging, got %lu\n", ps.BatteryFullLifeTime);
}
}
else
@@ -71,9 +72,9 @@ void test_GetSystemPowerStatus(void)
ok(ps.BatteryLifePercent == BATTERY_PERCENTAGE_UNKNOWN,
"expected BatteryLifePercent to be -1, got %u\n", ps.BatteryLifePercent);
ok(ps.BatteryLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryLifeTime to be -1, got %u\n", ps.BatteryLifeTime);
+ "expected BatteryLifeTime to be -1, got %lu\n", ps.BatteryLifeTime);
ok(ps.BatteryFullLifeTime == BATTERY_LIFE_UNKNOWN,
- "expected BatteryFullLifeTime to be -1, got %u\n", ps.BatteryFullLifeTime);
+ "expected BatteryFullLifeTime to be -1, got %lu\n", ps.BatteryFullLifeTime);
}
}
diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c
index bca0298044f..b9428a7b240 100644
--- a/dlls/kernel32/tests/resource.c
+++ b/dlls/kernel32/tests/resource.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <windows.h>
#include <stdio.h>
@@ -332,10 +333,10 @@ static void update_resources_version( void )
MAKEINTRESOURCEA(0x4567),
0xabcd,
foo, sizeof foo );
- ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
+ ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE );
- ok( r, "EndUpdateResource failed: %d\n", GetLastError());
+ ok( r, "EndUpdateResource failed: %ld\n", GetLastError());
}
static void update_resources_bigdata( void )
@@ -352,7 +353,7 @@ static void update_resources_bigdata( void )
MAKEINTRESOURCEA(0x5647),
0xcdba,
foo, sizeof foo );
- ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
+ ok( r == TRUE, "UpdateResource failed: %ld\n", GetLastError());
r = EndUpdateResourceA( res, FALSE );
ok( r, "EndUpdateResource failed\n");
@@ -367,27 +368,27 @@ static void update_resources_name( void )
BOOL ret;
res = BeginUpdateResourceA( filename, TRUE );
- ok( res != NULL, "BeginUpdateResource failed: %u\n", GetLastError() );
+ ok( res != NULL, "BeginUpdateResource failed: %lu\n", GetLastError() );
if ( !res ) return;
ret = UpdateResourceA( res, res_type, res_name, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), foo, sizeof(foo) );
- ok( ret == TRUE, "UpdateResource failed: %u\n", GetLastError() );
+ ok( ret == TRUE, "UpdateResource failed: %lu\n", GetLastError() );
ret = EndUpdateResourceA( res, FALSE );
- ok( ret, "EndUpdateResource failed: %u\n", GetLastError() );
+ ok( ret, "EndUpdateResource failed: %lu\n", GetLastError() );
if ( !ret ) return;
module = LoadLibraryExA( filename, NULL, LOAD_LIBRARY_AS_DATAFILE );
- ok( module != NULL, "LoadLibraryEx failed: %u\n", GetLastError() );
+ ok( module != NULL, "LoadLibraryEx failed: %lu\n", GetLastError() );
if ( !module ) return;
rsrc = FindResourceA( module, res_name, res_type );
ok( rsrc != NULL ||
broken( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND ) /* win2008 */,
- "FindResource failed: %u\n", GetLastError() );
+ "FindResource failed: %lu\n", GetLastError() );
ret = FreeLibrary(module);
- ok( ret, "FreeLibrary failed: %u\n", GetLastError() );
+ ok( ret, "FreeLibrary failed: %lu\n", GetLastError() );
}
static void check_exe( const sec_verify *verify )
@@ -402,7 +403,7 @@ static void check_exe( const sec_verify *verify )
DWORD length, sec_count = 0;
file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
- ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError());
+ ok (file != INVALID_HANDLE_VALUE, "failed to create file (%ld)\n", GetLastError());
length = GetFileSize( file, NULL );
ok( length >= verify->length, "file size wrong\n");
@@ -423,11 +424,11 @@ static void check_exe( const sec_verify *verify )
for(i = 0; i < max_sections; i++)
if (verify->sect_out[i])
{
- ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %d name wrong\n", sec_count);
- ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %d vaddr wrong\n", sec_count);
- ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %d SizeOfRawData wrong (%d vs %d)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData);
- ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %d PointerToRawData wrong\n", sec_count);
- ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %d characteristics wrong\n", sec_count);
+ ok( !memcmp(&verify->sect_out[i]->Name, &sec[sec_count].Name, 8), "section %ld name wrong\n", sec_count);
+ ok( verify->sect_out[i]->VirtualAddress == sec[sec_count].VirtualAddress, "section %ld vaddr wrong\n", sec_count);
+ ok( verify->sect_out[i]->SizeOfRawData <= sec[sec_count].SizeOfRawData, "section %ld SizeOfRawData wrong (%ld vs %ld)\n", sec_count, verify->sect_out[i]->SizeOfRawData ,sec[sec_count].SizeOfRawData);
+ ok( verify->sect_out[i]->PointerToRawData == sec[sec_count].PointerToRawData, "section %ld PointerToRawData wrong\n", sec_count);
+ ok( verify->sect_out[i]->Characteristics == sec[sec_count].Characteristics , "section %ld characteristics wrong\n", sec_count);
sec_count++;
}
@@ -438,17 +439,17 @@ static void check_exe( const sec_verify *verify )
dir = (void*) ((BYTE*) dos + sec[verify->rsrc_section].VirtualAddress);
ok( dir->Characteristics == 0, "Characteristics wrong\n");
- ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %u\n", dir->TimeDateStamp);
+ ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong %lu\n", dir->TimeDateStamp);
ok( dir->MajorVersion == 4, "MajorVersion wrong\n");
ok( dir->MinorVersion == 0, "MinorVersion wrong\n");
- ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %d instead of %d\n",
+ ok( dir->NumberOfNamedEntries == verify->NumberOfNamedEntries, "NumberOfNamedEntries should be %ld instead of %d\n",
verify->NumberOfNamedEntries, dir->NumberOfNamedEntries);
- ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %d instead of %d\n",
+ ok( dir->NumberOfIdEntries == verify->NumberOfIdEntries, "NumberOfIdEntries should be %ld instead of %d\n",
verify->NumberOfIdEntries, dir->NumberOfIdEntries);
ok(opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress == sec[verify->rsrc_section].VirtualAddress,
- "VirtualAddress in optional header should be %d instead of %d\n",
+ "VirtualAddress in optional header should be %ld instead of %ld\n",
sec[verify->rsrc_section].VirtualAddress, opt->DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY].VirtualAddress);
}
@@ -476,24 +477,24 @@ static void test_find_resource(void)
SetLastError( 0xdeadbeef );
rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(1), (LPCWSTR)RT_DIALOG );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(2), (LPCWSTR)RT_MENU );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1),
MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() );
SetLastError( 0xdeadbeef );
rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1),
MAKELANGID( LANG_FRENCH, SUBLANG_DEFAULT ) );
ok( !rsrc, "resource found\n" );
- ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() );
+ ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %lu\n", GetLastError() );
}
typedef struct
diff --git a/dlls/kernel32/tests/timer.c b/dlls/kernel32/tests/timer.c
index 156f1acd7f1..e64d2b6300d 100644
--- a/dlls/kernel32/tests/timer.c
+++ b/dlls/kernel32/tests/timer.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "wine/test.h"
#include "winbase.h"
@@ -79,10 +80,10 @@ static DWORD WINAPI thread_WaitForSingleObject(void *arg)
ok(event != NULL, "CreateEvent failed\n");
t = GetTickCount();
r = WaitForSingleObject(event, 3000);
- ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %x\n", r);
+ ok(r == WAIT_TIMEOUT, "WiatForSingleObject returned %lx\n", r);
CloseHandle(event);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -92,7 +93,7 @@ static DWORD WINAPI thread_Sleep(void *arg)
Sleep(3000);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -102,7 +103,7 @@ static DWORD WINAPI thread_SleepEx(void *arg)
SleepEx(3000, TRUE);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -122,10 +123,10 @@ static DWORD WINAPI thread_WaitableTimer_rel(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -149,10 +150,10 @@ static DWORD WINAPI thread_WaitableTimer_abs(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t < 2000, "t = %d\n", t);
+ ok(t < 2000, "t = %ld\n", t);
return 0;
}
@@ -172,13 +173,13 @@ static DWORD WINAPI thread_WaitableTimer_period(void *arg)
ok(r, "SetWaitableTimer failed\n");
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
r = WaitForSingleObject(timer, INFINITE);
- ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %d\n", r);
+ ok(r == WAIT_OBJECT_0, "WaitForSingleObject returned %ld\n", r);
CloseHandle(timer);
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
return 0;
}
@@ -189,7 +190,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
MSG msg;
timer = SetTimer(NULL, 0, 3000, NULL);
- ok(timer, "SetTimer failed (%d)\n", GetLastError());
+ ok(timer, "SetTimer failed (%ld)\n", GetLastError());
while (GetMessageW(&msg, NULL, 0, 0))
{
@@ -198,7 +199,7 @@ static DWORD WINAPI thread_SetTimer(void *arg)
}
t = GetTickCount() - t;
- ok(t > 2000, "t = %d\n", t);
+ ok(t > 2000, "t = %ld\n", t);
KillTimer(NULL, timer);
return 0;
}
@@ -210,7 +211,7 @@ static void test_timeouts(void)
if (!adjust_system_time(1))
{
- skip("can't adjust system clock (%d)\n", GetLastError());
+ skip("can't adjust system clock (%ld)\n", GetLastError());
return;
}
diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c
index 3bc07ec84f3..7d3df2d5e38 100644
--- a/dlls/kernel32/tests/toolhelp.c
+++ b/dlls/kernel32/tests/toolhelp.c
@@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include <stdarg.h>
#include <stdlib.h>
@@ -124,7 +125,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if (pe.th32ProcessID == curr_pid) found++;
if (pe.th32ProcessID == sub_pcs_pid) { childpos = num; found++; }
- trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile);
+ trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile);
num++;
} while (pProcess32Next( hSnapshot, &pe ));
}
@@ -138,7 +139,7 @@ static void test_process(DWORD curr_pid, DWORD sub_pcs_pid)
{
if (pe.th32ProcessID == curr_pid) found++;
if (pe.th32ProcessID == sub_pcs_pid) found++;
- trace("PID=%x %s\n", pe.th32ProcessID, pe.szExeFile);
+ trace("PID=%lx %s\n", pe.th32ProcessID, pe.szExeFile);
num--;
} while (pProcess32Next( hSnapshot, &pe ));
}
@@ -237,7 +238,7 @@ static DWORD WINAPI get_id_thread(void* curr_pid)
free(pcs_buffer);
pcs_buffer = malloc(buf_size);
}
- ok(status == STATUS_SUCCESS, "got %#x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
found = FALSE;
matched_idx = -1;
@@ -332,7 +333,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if (te.th32OwnerProcessID == curr_pid) curr_found++;
if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++;
if (winetest_debug > 1)
- trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
+ trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
num++;
} while (pThread32Next( hSnapshot, &te ));
}
@@ -349,7 +350,7 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid)
if (te.th32OwnerProcessID == curr_pid) curr_found++;
if (te.th32OwnerProcessID == sub_pcs_pid) sub_found++;
if (winetest_debug > 1)
- trace("PID=%x TID=%x %d\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
+ trace("PID=%lx TID=%lx %ld\n", te.th32OwnerProcessID, te.th32ThreadID, te.tpBasePri);
num--;
} while (pThread32Next( hSnapshot, &te ));
}
@@ -399,7 +400,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
- trace("PID=%x base=%p size=%x %s %s\n",
+ trace("PID=%lx base=%p size=%lx %s %s\n",
me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule);
ok(me.th32ProcessID == pid, "wrong returned process id\n");
for (i = 0; i < num_expected; i++)
@@ -418,7 +419,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected
{
do
{
- trace("PID=%x base=%p size=%x %s %s\n",
+ trace("PID=%lx base=%p size=%lx %s %s\n",
me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule);
for (i = 0; i < num_expected; i++)
if (!lstrcmpiA(expected[i], me.szModule)) found[i]++;
@@ -489,7 +490,7 @@ START_TEST(toolhelp)
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
- sprintf(buffer, "%s toolhelp %lu %lu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2);
+ sprintf(buffer, "%s toolhelp %Iu %Iu", selfname, (DWORD_PTR)ev1, (DWORD_PTR)ev2);
ok(CreateProcessA(NULL, buffer, NULL, NULL, TRUE, 0, NULL, NULL, &startup, &info), "CreateProcess\n");
/* wait for child to be initialized */
w = WaitForSingleObject(ev1, WAIT_TIME);
1
0
March 9, 2022
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/kernel32/tests/fiber.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/tests/fiber.c b/dlls/kernel32/tests/fiber.c
index 9ae45c2091b..3503520bdcf 100644
--- a/dlls/kernel32/tests/fiber.c
+++ b/dlls/kernel32/tests/fiber.c
@@ -285,6 +285,7 @@ static void test_FiberLocalStorage(void)
PEB *peb = teb->Peb;
NTSTATUS status;
HANDLE hthread;
+ ULONG index2;
SIZE_T size;
void* val;
BOOL ret;
@@ -407,13 +408,13 @@ static void test_FiberLocalStorage(void)
g_fls_data->fls_callback_chunks[j]->callbacks[index].callback);
fls_data->fls_data_chunks[j][index + 1] = (void *)(ULONG_PTR)0x28;
- status = pRtlFlsAlloc(test_fls_callback, &i);
+ status = pRtlFlsAlloc(test_fls_callback, &index2);
ok(!status, "Got unexpected status %#x.\n", status);
- ok(i == fls_indices[0x10], "Got unexpected index %u.\n", i);
+ ok(index2 == fls_indices[0x10], "Got unexpected index %u.\n", index2);
ok(fls_data->fls_data_chunks[j][index + 1] == (void *)(ULONG_PTR)0x28, "Got unexpected data %p.\n",
fls_data->fls_data_chunks[j][index + 1]);
- status = pRtlFlsSetValue(i, (void *)(ULONG_PTR)0x11);
+ status = pRtlFlsSetValue(index2, (void *)(ULONG_PTR)0x11);
ok(!status, "Got unexpected status %#x.\n", status);
teb->FlsSlots = NULL;
1
1
[PATCH vkd3d] vkd3d: Handle D3D12_APPEND_ALIGNED_ELEMENT for <4 byte wide elements
by Conor McCarthy March 9, 2022
by Conor McCarthy March 9, 2022
March 9, 2022
In d3d12, input element alignment needs to be the _minimum_ of 4 and the size of
the type. See the D3D11 spec, section 4.4.6, which behaves similarly:
https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpe…
This is correctly taken into account when generating, e.g., the
vertex_buffer_stride_align_mask used for validation, but is not taken
into account when D3D12_APPEND_ALIGNED_ELEMENT is used to automatically
place input elements. Currently, vkd3d always assumes the alignment is
4.
This means that, for example, bytes or shorts should be packed tightly
together when D3D12_APPEND_ALIGNED_ELEMENT is used, but are instead
padded to 4 bytes.
Fixing this makes units appear in Age of Empires IV.
(CrossOver bug 19924).
From: David Gow <david(a)ingeniumdigital.com>
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
libs/vkd3d/state.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c
index e51c11ea..847f497b 100644
--- a/libs/vkd3d/state.c
+++ b/libs/vkd3d/state.c
@@ -2807,9 +2807,9 @@ static HRESULT compute_input_layout_offsets(const struct d3d12_device *device,
if (e->AlignedByteOffset != D3D12_APPEND_ALIGNED_ELEMENT)
offsets[i] = e->AlignedByteOffset;
else
- offsets[i] = input_slot_offsets[e->InputSlot];
+ offsets[i] = align(input_slot_offsets[e->InputSlot], min(4, format->byte_count));
- input_slot_offsets[e->InputSlot] = align(offsets[i] + format->byte_count, 4);
+ input_slot_offsets[e->InputSlot] = offsets[i] + format->byte_count;
}
return S_OK;
--
2.34.1
1
0
Signed-off-by: Xu Wei <xuwei(a)uniontech.com>
---
dlls/kernel32/tests/volume.c | 10 ++++++++++
dlls/kernelbase/volume.c | 17 +++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c
index 3bc3c7e4872..10746dd6507 100644
--- a/dlls/kernel32/tests/volume.c
+++ b/dlls/kernel32/tests/volume.c
@@ -112,6 +112,7 @@ static void test_dos_devices(void)
{
char buf[MAX_PATH], buf2[400];
char drivestr[3];
+ WCHAR drivestrW[3];
HANDLE file;
BOOL ret;
@@ -186,6 +187,15 @@ static void test_dos_devices(void)
ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) );
ok(!ret, "expected failure\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError());
+
+ SetLastError(0);
+ ret = DefineDosDeviceW( DDD_RAW_TARGET_PATH, drivestrW, NULL );
+ ok(!ret, "expected failure\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError());
+
+ SetLastError(0);
+ ret = DefineDosDeviceW ( DDD_RAW_TARGET_PATH,L"C:/windows/",L"\\Device\\C:/windows/" );
+ ok(ret, "got error %u\n", GetLastError());
}
static void test_FindFirstVolume(void)
diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c
index 39386867aa3..d604ee02500 100644
--- a/dlls/kernelbase/volume.c
+++ b/dlls/kernelbase/volume.c
@@ -384,7 +384,7 @@ err_ret:
*/
BOOL WINAPI DECLSPEC_HOTPATCH DefineDosDeviceW( DWORD flags, const WCHAR *device, const WCHAR *target )
{
- WCHAR link_name[15] = L"\\DosDevices\\";
+ WCHAR *link_name = NULL;
UNICODE_STRING nt_name, nt_target;
OBJECT_ATTRIBUTES attr;
NTSTATUS status;
@@ -395,17 +395,28 @@ BOOL WINAPI DECLSPEC_HOTPATCH DefineDosDeviceW( DWORD flags, const WCHAR *device
if (flags & ~(DDD_RAW_TARGET_PATH | DDD_REMOVE_DEFINITION))
FIXME("Ignoring flags %#lx.\n", flags & ~(DDD_RAW_TARGET_PATH | DDD_REMOVE_DEFINITION));
- lstrcatW( link_name, device );
+ if (!(link_name = HeapAlloc( GetProcessHeap(), 0, sizeof(L"\\DosDevices\\") + (device ? lstrlenW(device)*sizeof(WCHAR) : 0))))
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+
+ lstrcpyW( link_name, L"\\DosDevices\\" );
+ if (device) lstrcatW( link_name, device );
RtlInitUnicodeString( &nt_name, link_name );
InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE | OBJ_PERMANENT, 0, NULL );
if (flags & DDD_REMOVE_DEFINITION)
{
if (!set_ntstatus( NtOpenSymbolicLinkObject( &handle, 0, &attr ) ))
+ {
+ HeapFree( GetProcessHeap(), 0, link_name );
return FALSE;
+ }
status = NtMakeTemporaryObject( handle );
NtClose( handle );
+ HeapFree( GetProcessHeap(), 0, link_name );
return set_ntstatus( status );
}
@@ -414,6 +425,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH DefineDosDeviceW( DWORD flags, const WCHAR *device
if (!RtlDosPathNameToNtPathName_U( target, &nt_target, NULL, NULL))
{
SetLastError( ERROR_PATH_NOT_FOUND );
+ HeapFree( GetProcessHeap(), 0, link_name );
return FALSE;
}
}
@@ -422,6 +434,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH DefineDosDeviceW( DWORD flags, const WCHAR *device
if (!(status = NtCreateSymbolicLinkObject( &handle, SYMBOLIC_LINK_ALL_ACCESS, &attr, &nt_target )))
NtClose( handle );
+ HeapFree( GetProcessHeap(), 0, link_name );
return set_ntstatus( status );
}
--
2.20.1
1
0