Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
February 2022
- 87 participants
- 926 discussions
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/bcrypt/tests/Makefile.in | 1 -
dlls/bcrypt/tests/bcrypt.c | 1172 ++++++++++++++++-----------------
2 files changed, 586 insertions(+), 587 deletions(-)
diff --git a/dlls/bcrypt/tests/Makefile.in b/dlls/bcrypt/tests/Makefile.in
index 70ce1a6a925..1bf7d2c48f1 100644
--- a/dlls/bcrypt/tests/Makefile.in
+++ b/dlls/bcrypt/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = bcrypt.dll
IMPORTS = bcrypt user32 advapi32
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
index 0f9456fee07..46793018742 100644
--- a/dlls/bcrypt/tests/bcrypt.c
+++ b/dlls/bcrypt/tests/bcrypt.c
@@ -35,27 +35,27 @@ static void test_BCryptGenRandom(void)
UCHAR buffer[256];
ret = BCryptGenRandom(NULL, NULL, 0, 0);
- ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got 0x%x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %#lx\n", ret);
ret = BCryptGenRandom(NULL, buffer, 0, 0);
- ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got 0x%x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %#lx\n", ret);
ret = BCryptGenRandom(NULL, buffer, sizeof(buffer), 0);
- ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got 0x%x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %#lx\n", ret);
ret = BCryptGenRandom(NULL, buffer, sizeof(buffer), BCRYPT_USE_SYSTEM_PREFERRED_RNG);
- ok(ret == STATUS_SUCCESS, "Expected success, got 0x%x\n", ret);
+ ok(ret == STATUS_SUCCESS, "Expected success, got %#lx\n", ret);
ret = BCryptGenRandom(NULL, buffer, sizeof(buffer),
BCRYPT_USE_SYSTEM_PREFERRED_RNG|BCRYPT_RNG_USE_ENTROPY_IN_BUFFER);
- ok(ret == STATUS_SUCCESS, "Expected success, got 0x%x\n", ret);
+ ok(ret == STATUS_SUCCESS, "Expected success, got %#lx\n", ret);
ret = BCryptGenRandom(NULL, NULL, sizeof(buffer), BCRYPT_USE_SYSTEM_PREFERRED_RNG);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got 0x%x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
/* Zero sized buffer should work too */
ret = BCryptGenRandom(NULL, buffer, 0, BCRYPT_USE_SYSTEM_PREFERRED_RNG);
- ok(ret == STATUS_SUCCESS, "Expected success, got 0x%x\n", ret);
+ ok(ret == STATUS_SUCCESS, "Expected success, got %#lx\n", ret);
/* Test random number generation - It's impossible for a sane RNG to return 8 zeros */
memset(buffer, 0, 16);
ret = BCryptGenRandom(NULL, buffer, 8, BCRYPT_USE_SYSTEM_PREFERRED_RNG);
- ok(ret == STATUS_SUCCESS, "Expected success, got 0x%x\n", ret);
+ ok(ret == STATUS_SUCCESS, "Expected success, got %#lx\n", ret);
ok(memcmp(buffer, buffer + 8, 8), "Expected a random number, got 0\n");
}
@@ -87,11 +87,11 @@ todo_wine
RegCloseKey(hkey);
ret = BCryptGetFipsAlgorithmMode(&enabled);
- ok(ret == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got 0x%x\n", ret);
+ ok(ret == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %#lx\n", ret);
ok(enabled == expected, "expected result %d, got %d\n", expected, enabled);
ret = BCryptGetFipsAlgorithmMode(NULL);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got 0x%x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
}
static void format_hash(const UCHAR *bytes, ULONG size, char *buf)
@@ -113,32 +113,32 @@ static void _test_object_length(unsigned line, void *handle)
len = size = 0xdeadbeef;
status = BCryptGetProperty(NULL, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok_(__FILE__,line)(status == STATUS_INVALID_HANDLE, "BCryptGetProperty failed: %08x\n", status);
+ ok_(__FILE__,line)(status == STATUS_INVALID_HANDLE, "BCryptGetProperty failed: %#lx\n", status);
len = size = 0xdeadbeef;
status = BCryptGetProperty(handle, NULL, (UCHAR *)&len, sizeof(len), &size, 0);
- ok_(__FILE__,line)(status == STATUS_INVALID_PARAMETER, "BCryptGetProperty failed: %08x\n", status);
+ ok_(__FILE__,line)(status == STATUS_INVALID_PARAMETER, "BCryptGetProperty failed: %#lx\n", status);
len = size = 0xdeadbeef;
status = BCryptGetProperty(handle, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), NULL, 0);
- ok_(__FILE__,line)(status == STATUS_INVALID_PARAMETER, "BCryptGetProperty failed: %08x\n", status);
+ ok_(__FILE__,line)(status == STATUS_INVALID_PARAMETER, "BCryptGetProperty failed: %#lx\n", status);
len = size = 0xdeadbeef;
status = BCryptGetProperty(handle, BCRYPT_OBJECT_LENGTH, NULL, sizeof(len), &size, 0);
- ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status);
- ok_(__FILE__,line)(size == sizeof(len), "got %u\n", size);
+ ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %#lx\n", status);
+ ok_(__FILE__,line)(size == sizeof(len), "got %lu\n", size);
len = size = 0xdeadbeef;
status = BCryptGetProperty(handle, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, 0, &size, 0);
- ok_(__FILE__,line)(status == STATUS_BUFFER_TOO_SMALL, "BCryptGetProperty failed: %08x\n", status);
- ok_(__FILE__,line)(len == 0xdeadbeef, "got %u\n", len);
- ok_(__FILE__,line)(size == sizeof(len), "got %u\n", size);
+ ok_(__FILE__,line)(status == STATUS_BUFFER_TOO_SMALL, "BCryptGetProperty failed: %#lx\n", status);
+ ok_(__FILE__,line)(len == 0xdeadbeef, "got %lu\n", len);
+ ok_(__FILE__,line)(size == sizeof(len), "got %lu\n", size);
len = size = 0xdeadbeef;
status = BCryptGetProperty(handle, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status);
+ ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %#lx\n", status);
ok_(__FILE__,line)(len != 0xdeadbeef, "len not set\n");
- ok_(__FILE__,line)(size == sizeof(len), "got %u\n", size);
+ ok_(__FILE__,line)(size == sizeof(len), "got %lu\n", size);
}
#define test_hash_length(a,b) _test_hash_length(__LINE__,a,b)
@@ -148,9 +148,9 @@ static void _test_hash_length(unsigned line, void *handle, ULONG exlen)
NTSTATUS status;
status = BCryptGetProperty(handle, BCRYPT_HASH_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status);
- ok_(__FILE__,line)(size == sizeof(len), "got %u\n", size);
- ok_(__FILE__,line)(len == exlen, "len = %u, expected %u\n", len, exlen);
+ ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %#lx\n", status);
+ ok_(__FILE__,line)(size == sizeof(len), "got %lu\n", size);
+ ok_(__FILE__,line)(len == exlen, "len = %lu, expected %lu\n", len, exlen);
}
#define test_alg_name(a,b) _test_alg_name(__LINE__,a,b)
@@ -162,8 +162,8 @@ static void _test_alg_name(unsigned line, void *handle, const WCHAR *exname)
NTSTATUS status;
status = BCryptGetProperty(handle, BCRYPT_ALGORITHM_NAME, buf, sizeof(buf), &size, 0);
- ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %08x\n", status);
- ok_(__FILE__,line)(size == (lstrlenW(exname)+1)*sizeof(WCHAR), "got %u\n", size);
+ ok_(__FILE__,line)(status == STATUS_SUCCESS, "BCryptGetProperty failed: %#lx\n", status);
+ ok_(__FILE__,line)(size == (lstrlenW(exname) + 1) * sizeof(WCHAR), "got %lu\n", size);
ok_(__FILE__,line)(!lstrcmpW(name, exname), "alg name = %s, expected %s\n", wine_dbgstr_w(name),
wine_dbgstr_w(exname));
}
@@ -189,7 +189,7 @@ static void test_hash(const struct hash_test *test)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, test->alg, MS_PRIMITIVE_PROVIDER, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
test_object_length(alg);
@@ -199,122 +199,122 @@ static void test_hash(const struct hash_test *test)
hash = NULL;
len = sizeof(buf);
ret = BCryptCreateHash(alg, &hash, buf, len, NULL, 0, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(hash != NULL, "hash not set\n");
ret = BCryptHashData(hash, NULL, 0, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
test_hash_length(hash, test->hash_size);
test_alg_name(hash, test->alg);
memset(hash_buf, 0, sizeof(hash_buf));
ret = BCryptFinishHash(hash, hash_buf, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hash_buf, test->hash_size, str );
ok(!strcmp(str, test->hash), "got %s\n", str);
ret = BCryptDestroyHash(hash);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
hash = NULL;
len = sizeof(buf);
ret = BCryptCreateHash(alg, &hash, buf, len, NULL, 0, BCRYPT_HASH_REUSABLE_FLAG);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* < win8 */, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* < win8 */, "got %#lx\n", ret);
if (ret == STATUS_SUCCESS)
{
ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
memset(hash_buf, 0, sizeof(hash_buf));
ret = BCryptFinishHash(hash, hash_buf, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hash_buf, test->hash_size, str );
ok(!strcmp(str, test->hash), "got %s\n", str);
/* reuse it */
ret = BCryptHashData(hash, (UCHAR *)"tset", sizeof("tset"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
memset(hash_buf, 0, sizeof(hash_buf));
ret = BCryptFinishHash(hash, hash_buf, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hash_buf, test->hash_size, str );
ok(!strcmp(str, test->hash2), "got %s\n", str);
ret = BCryptDestroyHash(hash);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, test->alg, MS_PRIMITIVE_PROVIDER, BCRYPT_ALG_HANDLE_HMAC_FLAG);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
hash = NULL;
len = sizeof(buf_hmac);
ret = BCryptCreateHash(alg, &hash, buf_hmac, len, (UCHAR *)"key", sizeof("key"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(hash != NULL, "hash not set\n");
ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
test_hash_length(hash, test->hash_size);
test_alg_name(hash, test->alg);
memset(hmac_hash, 0, sizeof(hmac_hash));
ret = BCryptFinishHash(hash, hmac_hash, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hmac_hash, test->hash_size, str );
ok(!strcmp(str, test->hmac_hash), "got %s\n", str);
ret = BCryptDestroyHash(hash);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
hash = NULL;
len = sizeof(buf_hmac);
ret = BCryptCreateHash(alg, &hash, buf_hmac, len, (UCHAR *)"key", sizeof("key"), BCRYPT_HASH_REUSABLE_FLAG);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* < win8 */, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* < win8 */, "got %#lx\n", ret);
if (ret == STATUS_SUCCESS)
{
ret = BCryptHashData(hash, (UCHAR *)"test", sizeof("test"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
memset(hmac_hash, 0, sizeof(hmac_hash));
ret = BCryptFinishHash(hash, hmac_hash, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hmac_hash, test->hash_size, str );
ok(!strcmp(str, test->hmac_hash), "got %s\n", str);
/* reuse it */
ret = BCryptHashData(hash, (UCHAR *)"tset", sizeof("tset"), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
memset(hmac_hash, 0, sizeof(hmac_hash));
ret = BCryptFinishHash(hash, hmac_hash, test->hash_size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( hmac_hash, test->hash_size, str );
ok(!strcmp(str, test->hmac_hash2), "got %s\n", str);
ret = BCryptDestroyHash(hash);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
ret = BCryptDestroyHash(hash);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptDestroyHash(NULL);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_hashes(void)
@@ -397,7 +397,7 @@ static void test_BcryptHash(void)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_MD5_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
test_hash_length(alg, 16);
@@ -405,26 +405,26 @@ static void test_BcryptHash(void)
memset(md5, 0, sizeof(md5));
ret = pBCryptHash(alg, NULL, 0, (UCHAR *)"test", sizeof("test"), md5, sizeof(md5));
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( md5, sizeof(md5), str );
ok(!strcmp(str, expected), "got %s\n", str);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
alg = NULL;
memset(md5_hmac, 0, sizeof(md5_hmac));
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_MD5_ALGORITHM, MS_PRIMITIVE_PROVIDER, BCRYPT_ALG_HANDLE_HMAC_FLAG);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
ret = pBCryptHash(alg, (UCHAR *)"key", sizeof("key"), (UCHAR *)"test", sizeof("test"), md5_hmac, sizeof(md5_hmac));
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash( md5_hmac, sizeof(md5_hmac), str );
ok(!strcmp(str, expected_hmac), "got %s\n", str);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
/* test vectors from RFC 6070 */
@@ -472,7 +472,7 @@ static void test_BcryptDeriveKeyPBKDF2(void)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA1_ALGORITHM, MS_PRIMITIVE_PROVIDER,
BCRYPT_ALG_HANDLE_HMAC_FLAG);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
test_hash_length(alg, 20);
@@ -480,20 +480,20 @@ static void test_BcryptDeriveKeyPBKDF2(void)
ret = BCryptDeriveKeyPBKDF2(alg, rfc6070[0].pwd, rfc6070[0].pwd_len, rfc6070[0].salt, rfc6070[0].salt_len,
0, buf, rfc6070[0].dk_len, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
for (i = 0; i < ARRAY_SIZE(rfc6070); i++)
{
memset(buf, 0, sizeof(buf));
ret = BCryptDeriveKeyPBKDF2(alg, rfc6070[i].pwd, rfc6070[i].pwd_len, rfc6070[i].salt, rfc6070[i].salt_len,
rfc6070[i].iterations, buf, rfc6070[i].dk_len, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
format_hash(buf, rfc6070[i].dk_len, str);
ok(!memcmp(str, rfc6070[i].dk, rfc6070[i].dk_len), "got %s\n", str);
}
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_rng(void)
@@ -505,26 +505,26 @@ static void test_rng(void)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RNG_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
len = size = 0xdeadbeef;
ret = BCryptGetProperty(alg, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
len = size = 0xdeadbeef;
ret = BCryptGetProperty(alg, BCRYPT_HASH_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
test_alg_name(alg, L"RNG");
memset(buf, 0, 16);
ret = BCryptGenRandom(alg, buf, 8, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(memcmp(buf, buf + 8, 8), "got zeroes\n");
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_aes(void)
@@ -537,62 +537,62 @@ static void test_aes(void)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_AES_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
len = size = 0;
ret = BCryptGetProperty(alg, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(len, "expected non-zero len\n");
- ok(size == sizeof(len), "got %u\n", size);
+ ok(size == sizeof(len), "got %lu\n", size);
len = size = 0;
ret = BCryptGetProperty(alg, BCRYPT_BLOCK_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(len == 16, "got %u\n", len);
- ok(size == sizeof(len), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(len == 16, "got %lu\n", len);
+ ok(size == sizeof(len), "got %lu\n", size);
size = 0;
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 64, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 64, "got %lu\n", size);
size = 0;
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode) - 1, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 64, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 64, "got %lu\n", size);
size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
- ok(size == 64, "got %u\n", size);
+ ok(size == 64, "got %lu\n", size);
size = 0;
memset(&key_lengths, 0, sizeof(key_lengths));
ret = BCryptGetProperty(alg, BCRYPT_KEY_LENGTHS, (UCHAR*)&key_lengths, sizeof(key_lengths), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(key_lengths), "got %u\n", size);
- ok(key_lengths.dwMinLength == 128, "Expected 128, got %d\n", key_lengths.dwMinLength);
- ok(key_lengths.dwMaxLength == 256, "Expected 256, got %d\n", key_lengths.dwMaxLength);
- ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(key_lengths), "got %lu\n", size);
+ ok(key_lengths.dwMinLength == 128, "Expected 128, got %lu\n", key_lengths.dwMinLength);
+ ok(key_lengths.dwMaxLength == 256, "Expected 256, got %lu\n", key_lengths.dwMaxLength);
+ ok(key_lengths.dwIncrement == 64, "Expected 64, got %lu\n", key_lengths.dwIncrement);
memcpy(mode, BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM));
ret = BCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_GCM), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
- ok(size == 64, "got %u\n", size);
+ ok(size == 64, "got %lu\n", size);
test_alg_name(alg, L"AES");
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_3des(void)
@@ -605,55 +605,55 @@ static void test_3des(void)
alg = NULL;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_3DES_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(alg != NULL, "alg not set\n");
len = size = 0;
ret = BCryptGetProperty(alg, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(len, "expected non-zero len\n");
- ok(size == sizeof(len), "got %u\n", size);
+ ok(size == sizeof(len), "got %lu\n", size);
len = size = 0;
ret = BCryptGetProperty(alg, BCRYPT_BLOCK_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(len == 8, "got %u\n", len);
- ok(size == sizeof(len), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(len == 8, "got %lu\n", len);
+ ok(size == sizeof(len), "got %lu\n", size);
size = 0;
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 64, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 64, "got %lu\n", size);
size = 0;
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode) - 1, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 64, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 64, "got %lu\n", size);
size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(alg, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
- ok(size == 64, "got %u\n", size);
+ ok(size == 64, "got %lu\n", size);
size = 0;
memset(&key_lengths, 0, sizeof(key_lengths));
ret = BCryptGetProperty(alg, BCRYPT_KEY_LENGTHS, (UCHAR*)&key_lengths, sizeof(key_lengths), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(key_lengths), "got %u\n", size);
- ok(key_lengths.dwMinLength == 192, "Expected 192, got %d\n", key_lengths.dwMinLength);
- ok(key_lengths.dwMaxLength == 192, "Expected 192, got %d\n", key_lengths.dwMaxLength);
- ok(key_lengths.dwIncrement == 0, "Expected 0, got %d\n", key_lengths.dwIncrement);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(key_lengths), "got %lu\n", size);
+ ok(key_lengths.dwMinLength == 192, "Expected 192, got %lu\n", key_lengths.dwMinLength);
+ ok(key_lengths.dwMaxLength == 192, "Expected 192, got %lu\n", key_lengths.dwMaxLength);
+ ok(key_lengths.dwIncrement == 0, "Expected 0, got %lu\n", key_lengths.dwIncrement);
memcpy(mode, BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM));
ret = BCryptSetProperty(alg, BCRYPT_CHAINING_MODE, mode, 0, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
test_alg_name(alg, L"3DES");
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_BCryptGenerateSymmetricKey(void)
@@ -674,15 +674,15 @@ static void test_BCryptGenerateSymmetricKey(void)
NTSTATUS ret;
ret = BCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
len = size = 0xdeadbeef;
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = (void *)0xdeadbeef;
ret = BCryptGenerateSymmetricKey(NULL, &key, NULL, 0, secret, sizeof(secret), 0);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ok(key == (void *)0xdeadbeef, "got %p\n", key);
key = NULL;
@@ -690,80 +690,80 @@ static void test_BCryptGenerateSymmetricKey(void)
key = (BCRYPT_KEY_HANDLE)0xdeadbeef;
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, 1, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ok(key == (HANDLE)0xdeadbeef, "got unexpected key %p.\n", key);
key = (BCRYPT_KEY_HANDLE)0xdeadbeef;
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret) + 1, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ok(key == (HANDLE)0xdeadbeef, "got unexpected key %p.\n", key);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
- ok(size == 64, "got %u\n", size);
+ ok(size == 64, "got %lu\n", size);
ret = BCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_ECB, 0, 0);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %#lx\n", ret);
if (ret == STATUS_SUCCESS)
{
size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_ECB), "got %s\n", wine_dbgstr_w((const WCHAR *)mode));
- ok(size == 64, "got %u\n", size);
+ ok(size == 64, "got %lu\n", size);
}
ret = BCryptSetProperty(key, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC,
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_NOT_SUPPORTED) /* < Win 8 */, "got %#lx\n", ret);
size = 0xdeadbeef;
ret = BCryptEncrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(!size, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(!size, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(ciphertext, expected, sizeof(expected)), "wrong data\n");
for (i = 0; i < 16; i++)
- ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]);
+ ok(ciphertext[i] == expected[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected[i]);
key2 = (void *)0xdeadbeef;
ret = BCryptDuplicateKey(NULL, &key2, NULL, 0, 0);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ok(key2 == (void *)0xdeadbeef, "got %p\n", key2);
if (0) /* crashes on some Windows versions */
{
ret = BCryptDuplicateKey(key, NULL, NULL, 0, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
}
key2 = (void *)0xdeadbeef;
ret = BCryptDuplicateKey(key, &key2, NULL, 0, 0);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER), "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER), "got %#lx\n", ret);
if (ret == STATUS_SUCCESS)
{
@@ -771,62 +771,62 @@ static void test_BCryptGenerateSymmetricKey(void)
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key2, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(ciphertext, expected, sizeof(expected)), "wrong data\n");
for (i = 0; i < 16; i++)
- ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]);
+ ok(ciphertext[i] == expected[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected[i]);
ret = BCryptDestroyKey(key2);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
size = 0xdeadbeef;
ret = BCryptDecrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(!size, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(!size, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext, 16, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext, 16, NULL, ivbuf, 16, plaintext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(plaintext, data, sizeof(data)), "wrong data\n");
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(!lstrcmpW((const WCHAR *)mode, BCRYPT_CHAIN_MODE_CBC), "wrong mode\n");
len = 0;
size = 0;
ret = BCryptGetProperty(key, BCRYPT_BLOCK_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(len == 16, "got %u\n", len);
- ok(size == sizeof(len), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(len == 16, "got %lu\n", len);
+ ok(size == sizeof(len), "got %lu\n", size);
size = 0;
memset(&key_lengths, 0, sizeof(key_lengths));
ret = BCryptGetProperty(aes, BCRYPT_KEY_LENGTHS, (UCHAR*)&key_lengths, sizeof(key_lengths), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(key_lengths), "got %u\n", size);
- ok(key_lengths.dwMinLength == 128, "Expected 128, got %d\n", key_lengths.dwMinLength);
- ok(key_lengths.dwMaxLength == 256, "Expected 256, got %d\n", key_lengths.dwMaxLength);
- ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(key_lengths), "got %lu\n", size);
+ ok(key_lengths.dwMinLength == 128, "Expected 128, got %lu\n", key_lengths.dwMinLength);
+ ok(key_lengths.dwMaxLength == 256, "Expected 256, got %lu\n", key_lengths.dwMaxLength);
+ ok(key_lengths.dwIncrement == 64, "Expected 64, got %lu\n", key_lengths.dwIncrement);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptCloseAlgorithmProvider(aes, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
#define RACE_TEST_COUNT 200
@@ -874,8 +874,8 @@ static DWORD WINAPI encrypt_race_thread(void *parameter)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 32, &auth_info, NULL, 0, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag3, sizeof(expected_tag3)), "wrong tag\n");
for (i = 0; i < 32; i++)
@@ -953,7 +953,7 @@ static void test_BCryptEncrypt(void)
NTSTATUS ret;
ret = BCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
/******************
* AES - CBC mode *
@@ -962,37 +962,37 @@ static void test_BCryptEncrypt(void)
len = 0xdeadbeef;
size = sizeof(len);
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = NULL;
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
/* input size is a multiple of block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(ciphertext, expected, sizeof(expected)), "wrong data\n");
for (i = 0; i < 16; i++)
- ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]);
+ ok(ciphertext[i] == expected[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected[i]);
/* NULL initialization vector */
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 16, NULL, NULL, 0, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
todo_wine ok(!memcmp(ciphertext, expected8, sizeof(expected8)), "wrong data\n");
/* all zero initialization vector */
@@ -1000,103 +1000,103 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0, sizeof(ciphertext));
memset(ivbuf, 0, sizeof(ivbuf));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(ciphertext, expected9, sizeof(expected9)), "wrong data\n");
for (i = 0; i < 16; i++)
- ok(ciphertext[i] == expected9[i], "%u: %02x != %02x\n", i, ciphertext[i], expected9[i]);
+ ok(ciphertext[i] == expected9[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected9[i]);
/* input size is not a multiple of block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data, 17, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
/* input size is not a multiple of block size, block padding set */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data, 17, NULL, ivbuf, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 17, NULL, ivbuf, 16, ciphertext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected2, sizeof(expected2)), "wrong data\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected2[i], "%u: %02x != %02x\n", i, ciphertext[i], expected2[i]);
+ ok(ciphertext[i] == expected2[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected2[i]);
/* input size is a multiple of block size, block padding set */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data2, 32, NULL, ivbuf, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, NULL, ivbuf, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
ok(!memcmp(ciphertext, expected3, sizeof(expected3)), "wrong data\n");
for (i = 0; i < 48; i++)
- ok(ciphertext[i] == expected3[i], "%u: %02x != %02x\n", i, ciphertext[i], expected3[i]);
+ ok(ciphertext[i] == expected3[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected3[i]);
/* output size too small */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 17, NULL, ivbuf, 16, ciphertext, 31, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, NULL, ivbuf, 16, ciphertext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
/* 256 bit key */
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret256, sizeof(secret256), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
/* Key generations succeeds if the key size exceeds maximum and uses maximum key length
* from secret. */
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret256, sizeof(secret256) + 1, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data2, 32, NULL, ivbuf, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, NULL, ivbuf, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
ok(!memcmp(ciphertext, expected10, sizeof(expected10)), "wrong data\n");
for (i = 0; i < 48; i++)
- ok(ciphertext[i] == expected10[i], "%u: %02x != %02x\n", i, ciphertext[i], expected10[i]);
+ ok(ciphertext[i] == expected10[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected10[i]);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
/******************
@@ -1105,38 +1105,38 @@ static void test_BCryptEncrypt(void)
size = 0;
ret = BCryptGetProperty(aes, BCRYPT_AUTH_TAG_LENGTH, NULL, 0, &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
ret = BCryptGetProperty(aes, BCRYPT_AUTH_TAG_LENGTH, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(tag_length), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(tag_length), "got %lu\n", size);
size = 0;
memset(&tag_length, 0, sizeof(tag_length));
ret = BCryptGetProperty(aes, BCRYPT_AUTH_TAG_LENGTH, (UCHAR*)&tag_length, sizeof(tag_length), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(tag_length), "got %u\n", size);
- ok(tag_length.dwMinLength == 12, "Expected 12, got %d\n", tag_length.dwMinLength);
- ok(tag_length.dwMaxLength == 16, "Expected 16, got %d\n", tag_length.dwMaxLength);
- ok(tag_length.dwIncrement == 1, "Expected 1, got %d\n", tag_length.dwIncrement);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(tag_length), "got %lu\n", size);
+ ok(tag_length.dwMinLength == 12, "Expected 12, got %lu\n", tag_length.dwMinLength);
+ ok(tag_length.dwMaxLength == 16, "Expected 16, got %lu\n", tag_length.dwMaxLength);
+ ok(tag_length.dwIncrement == 1, "Expected 1, got %lu\n", tag_length.dwIncrement);
len = 0xdeadbeef;
size = sizeof(len);
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = NULL;
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
ret = BCryptGetProperty(key, BCRYPT_AUTH_TAG_LENGTH, (UCHAR*)&tag_length, sizeof(tag_length), &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
memset(&auth_info, 0, sizeof(auth_info));
auth_info.cbSize = sizeof(auth_info);
@@ -1152,28 +1152,28 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
+ ok(tag[i] == expected_tag[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag[i]);
/* NULL initialization vector */
size = 0;
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 32, &auth_info, NULL, 0, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
+ ok(tag[i] == expected_tag[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag[i]);
/* all zero initialization vector */
size = 0;
@@ -1181,14 +1181,14 @@ static void test_BCryptEncrypt(void)
memset(tag, 0xff, sizeof(tag));
memset(ivbuf, 0, sizeof(ivbuf));
ret = BCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag, sizeof(expected_tag)), "wrong tag\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag[i], "%u: %02x != %02x\n", i, tag[i], expected_tag[i]);
+ ok(tag[i] == expected_tag[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag[i]);
/* input size is not multiple of block size */
size = 0;
@@ -1196,14 +1196,14 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 24, &auth_info, ivbuf, 16, ciphertext, 24, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 24, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 24, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, 24), "wrong data\n");
ok(!memcmp(tag, expected_tag2, sizeof(expected_tag2)), "wrong tag\n");
for (i = 0; i < 24; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]);
+ ok(tag[i] == expected_tag2[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag2[i]);
/* test with auth data */
auth_info.pbAuthData = auth_data;
@@ -1214,40 +1214,40 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag3, sizeof(expected_tag3)), "wrong tag\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag3[i], "%u: %02x != %02x\n", i, tag[i], expected_tag3[i]);
+ ok(tag[i] == expected_tag3[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag3[i]);
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 0, &auth_info, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(!size, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(!size, "got %lu\n", size);
for (i = 0; i < 16; i++)
- ok(tag[i] == 0xff, "%u: %02x != %02x\n", i, tag[i], 0xff);
+ ok(tag[i] == 0xff, "%lu: %02x != %02x\n", i, tag[i], 0xff);
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, NULL, 0, &auth_info, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(!size, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(!size, "got %lu\n", size);
ok(!memcmp(tag, expected_tag4, sizeof(expected_tag4)), "wrong tag\n");
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag4[i], "%u: %02x != %02x\n", i, tag[i], expected_tag4[i]);
+ ok(tag[i] == expected_tag4[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag4[i]);
/* test with padding */
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, BCRYPT_BLOCK_PADDING);
- todo_wine ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
+ todo_wine ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
memcpy(ivbuf, iv, sizeof(iv));
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
/* race test */
@@ -1263,20 +1263,20 @@ static void test_BCryptEncrypt(void)
memset(ciphertext, 0xff, sizeof(ciphertext));
memset(tag, 0xff, sizeof(tag));
ret = BCryptEncrypt(key, data2, 32, &auth_info, NULL, 0, ciphertext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n");
ok(!memcmp(tag, expected_tag3, sizeof(expected_tag2)), "wrong tag\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]);
+ ok(ciphertext[i] == expected4[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected4[i]);
for (i = 0; i < 16; i++)
- ok(tag[i] == expected_tag3[i], "%u: %02x != %02x\n", i, tag[i], expected_tag3[i]);
+ ok(tag[i] == expected_tag3[i], "%lu: %02x != %02x\n", i, tag[i], expected_tag3[i]);
}
WaitForSingleObject(hthread, INFINITE);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
/******************
@@ -1284,94 +1284,94 @@ static void test_BCryptEncrypt(void)
******************/
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_ECB, sizeof(BCRYPT_CHAIN_MODE_ECB), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
len = 0xdeadbeef;
size = sizeof(len);
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
/* initialization vector is not allowed */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptEncrypt(key, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
/* input size is a multiple of block size */
size = 0;
ret = BCryptEncrypt(key, data, 16, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 16, NULL, NULL, 16, ciphertext, 16, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(ciphertext, expected5, sizeof(expected5)), "wrong data\n");
for (i = 0; i < 16; i++)
- ok(ciphertext[i] == expected5[i], "%u: %02x != %02x\n", i, ciphertext[i], expected5[i]);
+ ok(ciphertext[i] == expected5[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected5[i]);
/* input size is not a multiple of block size */
size = 0;
ret = BCryptEncrypt(key, data, 17, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
/* input size is not a multiple of block size, block padding set */
size = 0;
ret = BCryptEncrypt(key, data, 17, NULL, NULL, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 17, NULL, NULL, 16, ciphertext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(ciphertext, expected6, sizeof(expected6)), "wrong data\n");
for (i = 0; i < 32; i++)
- ok(ciphertext[i] == expected6[i], "%u: %02x != %02x\n", i, ciphertext[i], expected6[i]);
+ ok(ciphertext[i] == expected6[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected6[i]);
/* input size is a multiple of block size, block padding set */
size = 0;
ret = BCryptEncrypt(key, data2, 32, NULL, NULL, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, NULL, NULL, 16, ciphertext, 48, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
ok(!memcmp(ciphertext, expected7, sizeof(expected7)), "wrong data\n");
for (i = 0; i < 48; i++)
- ok(ciphertext[i] == expected7[i], "%u: %02x != %02x\n", i, ciphertext[i], expected7[i]);
+ ok(ciphertext[i] == expected7[i], "%lu: %02x != %02x\n", i, ciphertext[i], expected7[i]);
/* output size too small */
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data, 17, NULL, NULL, 16, ciphertext, 31, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memset(ciphertext, 0, sizeof(ciphertext));
ret = BCryptEncrypt(key, data2, 32, NULL, NULL, 16, ciphertext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptCloseAlgorithmProvider(aes, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static void test_BCryptDecrypt(void)
@@ -1425,16 +1425,16 @@ static void test_BCryptDecrypt(void)
NTSTATUS ret;
ret = BCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
memset(&key_lengths, 0, sizeof(key_lengths));
ret = BCryptGetProperty(aes, BCRYPT_KEY_LENGTHS, (UCHAR*)&key_lengths, sizeof(key_lengths), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(key_lengths), "got %u\n", size);
- ok(key_lengths.dwMinLength == 128, "Expected 128, got %d\n", key_lengths.dwMinLength);
- ok(key_lengths.dwMaxLength == 256, "Expected 256, got %d\n", key_lengths.dwMaxLength);
- ok(key_lengths.dwIncrement == 64, "Expected 64, got %d\n", key_lengths.dwIncrement);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(key_lengths), "got %lu\n", size);
+ ok(key_lengths.dwMinLength == 128, "Expected 128, got %lu\n", key_lengths.dwMinLength);
+ ok(key_lengths.dwMaxLength == 256, "Expected 256, got %lu\n", key_lengths.dwMaxLength);
+ ok(key_lengths.dwIncrement == 64, "Expected 64, got %lu\n", key_lengths.dwIncrement);
/******************
* AES - CBC mode *
@@ -1443,100 +1443,100 @@ static void test_BCryptDecrypt(void)
len = 0xdeadbeef;
size = sizeof(len);
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = NULL;
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
/* input size is a multiple of block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext, 32, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext, 32, NULL, ivbuf, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected, sizeof(expected)), "wrong data\n");
/* test with padding smaller than block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext2, 32, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext2, 32, NULL, ivbuf, 16, plaintext, 17, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
ok(!memcmp(plaintext, expected2, sizeof(expected2)), "wrong data\n");
/* test with padding of block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext3, 48, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext3, 48, NULL, ivbuf, 16, plaintext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
/* output size too small */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext, 32, NULL, ivbuf, 16, plaintext, 31, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext2, 32, NULL, ivbuf, 16, plaintext, 15, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext2, 32, NULL, ivbuf, 16, plaintext, 16, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext3, 48, NULL, ivbuf, 16, plaintext, 31, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
/* input size is not a multiple of block size */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext, 17, NULL, ivbuf, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %lu\n", size);
/* input size is not a multiple of block size, block padding set */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext, 17, NULL, ivbuf, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
/******************
@@ -1544,16 +1544,16 @@ static void test_BCryptDecrypt(void)
******************/
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = NULL;
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
ret = BCryptGetProperty(key, BCRYPT_AUTH_TAG_LENGTH, (UCHAR*)&tag_lengths, sizeof(tag_lengths), &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
memset(&auth_info, 0, sizeof(auth_info));
auth_info.cbSize = sizeof(auth_info);
@@ -1568,8 +1568,8 @@ static void test_BCryptDecrypt(void)
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
/* test with auth data */
@@ -1582,19 +1582,19 @@ static void test_BCryptDecrypt(void)
memcpy(ivbuf, iv, sizeof(iv));
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
/* test with wrong tag */
memcpy(ivbuf, iv, sizeof(iv));
auth_info.pbTag = iv; /* wrong tag */
ret = BCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_AUTH_TAG_MISMATCH, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
/******************
@@ -1602,114 +1602,114 @@ static void test_BCryptDecrypt(void)
******************/
ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_ECB, sizeof(BCRYPT_CHAIN_MODE_ECB), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
len = 0xdeadbeef;
size = sizeof(len);
ret = BCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
ret = BCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
/* initialization vector is not allowed */
size = 0;
memcpy(ivbuf, iv, sizeof(iv));
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, ivbuf, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
/* input size is a multiple of block size */
size = 0;
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, plaintext, 32, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected, sizeof(expected)), "wrong data\n");
/* test with padding smaller than block size */
size = 0;
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, plaintext, 17, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
ok(!memcmp(plaintext, expected2, sizeof(expected2)), "wrong data\n");
/* test with padding of block size */
size = 0;
ret = BCryptDecrypt(key, ciphertext6, 48, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
size = 0;
memset(plaintext, 0, sizeof(plaintext));
ret = BCryptDecrypt(key, ciphertext6, 48, NULL, NULL, 16, plaintext, 32, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n");
/* output size too small */
size = 0;
ret = BCryptDecrypt(key, ciphertext4, 32, NULL, NULL, 16, plaintext, 31, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, plaintext, 15, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 32, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 32, "got %lu\n", size);
size = 0;
ret = BCryptDecrypt(key, ciphertext5, 32, NULL, NULL, 16, plaintext, 16, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 17, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 17, "got %lu\n", size);
size = 0;
ret = BCryptDecrypt(key, ciphertext6, 48, NULL, NULL, 16, plaintext, 31, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == 48, "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == 48, "got %lu\n", size);
/* input size is not a multiple of block size */
size = 0;
ret = BCryptDecrypt(key, ciphertext4, 17, NULL, NULL, 16, NULL, 0, &size, 0);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %lu\n", size);
/* input size is not a multiple of block size, block padding set */
size = 0;
ret = BCryptDecrypt(key, ciphertext4, 17, NULL, NULL, 16, NULL, 0, &size, BCRYPT_BLOCK_PADDING);
- ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %08x\n", ret);
- ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %u\n", size);
+ ok(ret == STATUS_INVALID_BUFFER_SIZE, "got %#lx\n", ret);
+ ok(size == 17 || broken(size == 0 /* Win < 7 */), "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptDestroyKey(NULL);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(aes, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(aes, 0);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(NULL, 0);
- ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
}
static void test_key_import_export(void)
@@ -1723,7 +1723,7 @@ static void test_key_import_export(void)
ULONG size;
ret = BCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key_data1->dwMagic = BCRYPT_KEY_DATA_BLOB_MAGIC;
key_data1->dwVersion = BCRYPT_KEY_DATA_BLOB_VERSION1;
@@ -1732,7 +1732,7 @@ static void test_key_import_export(void)
key = NULL;
ret = BCryptImportKey(aes, NULL, BCRYPT_KEY_DATA_BLOB, &key, NULL, 0, buffer1, sizeof(buffer1), 0);
- ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* vista */, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER) /* vista */, "got %#lx\n", ret);
if (ret == STATUS_INVALID_PARAMETER)
{
win_skip("broken BCryptImportKey\n");
@@ -1742,40 +1742,40 @@ static void test_key_import_export(void)
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_KEY_DATA_BLOB, buffer2, 0, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
- ok(size == sizeof(buffer2), "got %u\n", size);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
+ ok(size == sizeof(buffer2), "got %lu\n", size);
size = 0;
memset(buffer2, 0xff, sizeof(buffer2));
ret = BCryptExportKey(key, NULL, BCRYPT_KEY_DATA_BLOB, buffer2, sizeof(buffer2), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(buffer2), "Got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(buffer2), "Got %lu\n", size);
ok(!memcmp(buffer1, buffer2, sizeof(buffer1)), "Expected exported key to match imported key\n");
/* opaque blob */
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_OPAQUE_KEY_BLOB, buffer2, 0, &size, 0);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
ok(size > 0, "got zero\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_OPAQUE_KEY_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
key = NULL;
ret = BCryptImportKey(aes, NULL, BCRYPT_OPAQUE_KEY_BLOB, &key, NULL, 0, buf, size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(key != NULL, "key not set\n");
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptDestroyKey(key);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(aes, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
}
static BYTE eccPrivkey[] =
@@ -1826,7 +1826,7 @@ static void test_ECDSA(void)
status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDSA_P256_ALGORITHM, NULL, 0);
if (status)
{
- skip("Failed to open ECDSA provider: %08x, skipping test\n", status);
+ skip("Failed to open ECDSA provider: %#lx, skipping test\n", status);
return;
}
@@ -1836,23 +1836,23 @@ static void test_ECDSA(void)
ecckey->cbKey = 2;
size = sizeof(BCRYPT_ECCKEY_BLOB) + sizeof(eccPubkey);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
- ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", status);
ecckey->dwMagic = BCRYPT_ECDH_PUBLIC_P256_MAGIC;
ecckey->cbKey = 32;
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
- ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", status);
ecckey->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC;
ecckey->cbKey = 32;
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
- ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
+ ok(!status, "BCryptImportKeyPair failed: %#lx\n", status);
status = BCryptVerifySignature(key, NULL, certHash, sizeof(certHash) - 1, certSignature, sizeof(certSignature), 0);
- ok(status == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %08x\n", status);
+ ok(status == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %#lx\n", status);
status = BCryptVerifySignature(key, NULL, certHash, sizeof(certHash), certSignature, sizeof(certSignature), 0);
- ok(!status, "BCryptVerifySignature failed: %08x\n", status);
+ ok(!status, "BCryptVerifySignature failed: %#lx\n", status);
BCryptDestroyKey(key);
ecckey->dwMagic = BCRYPT_ECDSA_PRIVATE_P256_MAGIC;
@@ -1861,25 +1861,25 @@ static void test_ECDSA(void)
ecckey->cbKey = 2;
size = sizeof(BCRYPT_ECCKEY_BLOB) + sizeof(eccPrivkey);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
- ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", status);
ecckey->dwMagic = BCRYPT_ECDH_PRIVATE_P256_MAGIC;
ecckey->cbKey = 32;
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
- ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", status);
ecckey->dwMagic = BCRYPT_ECDSA_PRIVATE_P256_MAGIC;
ecckey->cbKey = 32;
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
- ok(!status, "BCryptImportKeyPair failed: %08x\n", status);
+ ok(!status, "BCryptImportKeyPair failed: %#lx\n", status);
memset( buffer, 0, sizeof(buffer) );
status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, buffer, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ecckey = (BCRYPT_ECCKEY_BLOB *)buffer;
- ok(ecckey->dwMagic == BCRYPT_ECDSA_PRIVATE_P256_MAGIC, "got %08x\n", ecckey->dwMagic);
- ok(ecckey->cbKey == 32, "got %u\n", ecckey->cbKey);
- ok(size == sizeof(*ecckey) + ecckey->cbKey * 3, "got %u\n", size);
+ ok(ecckey->dwMagic == BCRYPT_ECDSA_PRIVATE_P256_MAGIC, "got %#lx\n", ecckey->dwMagic);
+ ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
+ ok(size == sizeof(*ecckey) + ecckey->cbKey * 3, "got %lu\n", size);
BCryptDestroyKey(key);
BCryptCloseAlgorithmProvider(alg, 0);
@@ -1987,152 +1987,152 @@ static void test_RSA(void)
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RSA_ALGORITHM, NULL, 0);
if (ret)
{
- win_skip("Failed to open RSA provider: %08x, skipping test\n", ret);
+ win_skip("Failed to open RSA provider: %#lx, skipping test\n", ret);
return;
}
schemes = size = 0;
ret = BCryptGetProperty(alg, L"PaddingSchemes", (UCHAR *)&schemes, sizeof(schemes), &size, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ok(schemes, "schemes not set\n");
- ok(size == sizeof(schemes), "got %u\n", size);
+ ok(size == sizeof(schemes), "got %lu\n", size);
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlob, sizeof(rsaPublicBlob), 0);
- ok(!ret, "BCryptImportKeyPair failed: %08x\n", ret);
+ ok(!ret, "BCryptImportKeyPair failed: %#lx\n", ret);
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(!ret, "BCryptVerifySignature failed: %08x\n", ret);
+ ok(!ret, "BCryptVerifySignature failed: %#lx\n", ret);
ret = BCryptVerifySignature(key, NULL, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), 0);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
ret = BCryptVerifySignature(key, NULL, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), 0);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
pad.pszAlgId = BCRYPT_AES_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_NOT_SUPPORTED, "Expected STATUS_NOT_SUPPORTED, got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "Expected STATUS_NOT_SUPPORTED, got %#lx\n", ret);
pad.pszAlgId = NULL;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "BCryptDestroyKey failed: %08x\n", ret);
+ ok(!ret, "BCryptDestroyKey failed: %#lx\n", ret);
/* sign/verify with export/import round-trip */
ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
memset(sig, 0, sizeof(sig));
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* export private key */
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf;
- ok(rsablob->Magic == BCRYPT_RSAPRIVATE_MAGIC, "got %08x\n", rsablob->Magic);
- ok(rsablob->BitLength == 512, "got %u\n", rsablob->BitLength);
- ok(rsablob->cbPublicExp == 3, "got %u\n", rsablob->cbPublicExp);
- ok(rsablob->cbModulus == 64, "got %u\n", rsablob->cbModulus);
- ok(rsablob->cbPrime1 == 32, "got %u\n", rsablob->cbPrime1);
- ok(rsablob->cbPrime2 == 32, "got %u\n", rsablob->cbPrime2);
+ ok(rsablob->Magic == BCRYPT_RSAPRIVATE_MAGIC, "got %#lx\n", rsablob->Magic);
+ ok(rsablob->BitLength == 512, "got %lu\n", rsablob->BitLength);
+ ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
+ ok(rsablob->cbModulus == 64, "got %lu\n", rsablob->cbModulus);
+ ok(rsablob->cbPrime1 == 32, "got %lu\n", rsablob->cbPrime1);
+ ok(rsablob->cbPrime2 == 32, "got %lu\n", rsablob->cbPrime2);
size2 = sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus + rsablob->cbPrime1 + rsablob->cbPrime2;
- ok(size == size2, "got %u expected %u\n", size2, size);
+ ok(size == size2, "got %lu expected %lu\n", size2, size);
HeapFree(GetProcessHeap(), 0, buf);
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf;
- ok(rsablob->Magic == BCRYPT_RSAFULLPRIVATE_MAGIC, "got %08x\n", rsablob->Magic);
- ok(rsablob->BitLength == 512, "got %u\n", rsablob->BitLength);
- ok(rsablob->cbPublicExp == 3, "got %u\n", rsablob->cbPublicExp);
- ok(rsablob->cbModulus == 64, "got %u\n", rsablob->cbModulus);
- ok(rsablob->cbPrime1 == 32, "got %u\n", rsablob->cbPrime1);
- ok(rsablob->cbPrime2 == 32, "got %u\n", rsablob->cbPrime2);
+ ok(rsablob->Magic == BCRYPT_RSAFULLPRIVATE_MAGIC, "got %#lx\n", rsablob->Magic);
+ ok(rsablob->BitLength == 512, "got %lu\n", rsablob->BitLength);
+ ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
+ ok(rsablob->cbModulus == 64, "got %lu\n", rsablob->cbModulus);
+ ok(rsablob->cbPrime1 == 32, "got %lu\n", rsablob->cbPrime1);
+ ok(rsablob->cbPrime2 == 32, "got %lu\n", rsablob->cbPrime2);
size2 = sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus * 2 + rsablob->cbPrime1 * 3 + rsablob->cbPrime2 * 2;
- ok(size == size2, "got %u expected %u\n", size2, size);
+ ok(size == size2, "got %lu expected %lu\n", size2, size);
HeapFree(GetProcessHeap(), 0, buf);
/* export public key */
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPUBLIC_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPUBLIC_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf;
- ok(rsablob->Magic == BCRYPT_RSAPUBLIC_MAGIC, "got %08x\n", rsablob->Magic);
- ok(rsablob->BitLength == 512, "got %u\n", rsablob->BitLength);
- ok(rsablob->cbPublicExp == 3, "got %u\n", rsablob->cbPublicExp);
- ok(rsablob->cbModulus == 64, "got %u\n", rsablob->cbModulus);
- ok(!rsablob->cbPrime1, "got %u\n", rsablob->cbPrime1);
- ok(!rsablob->cbPrime2, "got %u\n", rsablob->cbPrime2);
- ok(size == sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus, "got %u\n", size);
+ ok(rsablob->Magic == BCRYPT_RSAPUBLIC_MAGIC, "got %#lx\n", rsablob->Magic);
+ ok(rsablob->BitLength == 512, "got %lu\n", rsablob->BitLength);
+ ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
+ ok(rsablob->cbModulus == 64, "got %lu\n", rsablob->cbModulus);
+ ok(!rsablob->cbPrime1, "got %lu\n", rsablob->cbPrime1);
+ ok(!rsablob->cbPrime2, "got %lu\n", rsablob->cbPrime2);
+ ok(size == sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus, "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, buf, size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptVerifySignature(key, &pad, hash, sizeof(hash), sig, len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* import/export private key */
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPRIVATE_BLOB, &key, rsaPrivateBlob, sizeof(rsaPrivateBlob), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(rsaPrivateBlob));
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, buf, sizeof(rsaPrivateBlob), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(rsaPrivateBlob), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(rsaPrivateBlob), "got %lu\n", size);
ok(!memcmp(buf, rsaPrivateBlob, size), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
BCryptDestroyKey(key);
/* import/export full private key */
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, &key, rsaFullPrivateBlob, sizeof(rsaFullPrivateBlob), 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(rsaFullPrivateBlob));
ret = BCryptExportKey(key, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, buf, sizeof(rsaFullPrivateBlob), &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(rsaFullPrivateBlob), "got %u\n", size);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(rsaFullPrivateBlob), "got %lu\n", size);
ok(!memcmp(buf, rsaFullPrivateBlob, size), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
BCryptDestroyKey(key);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
}
static void test_RSA_SIGN(void)
@@ -2148,86 +2148,86 @@ static void test_RSA_SIGN(void)
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RSA_SIGN_ALGORITHM, NULL, 0);
if (ret)
{
- win_skip("Failed to open RSA_SIGN provider: %08x, skipping test\n", ret);
+ win_skip("Failed to open RSA_SIGN provider: %#lx, skipping test\n", ret);
return;
}
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlob, sizeof(rsaPublicBlob), 0);
- ok(!ret, "BCryptImportKeyPair failed: %08x\n", ret);
+ ok(!ret, "BCryptImportKeyPair failed: %#lx\n", ret);
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(!ret, "BCryptVerifySignature failed: %08x\n", ret);
+ ok(!ret, "BCryptVerifySignature failed: %#lx\n", ret);
ret = BCryptVerifySignature(key, NULL, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), 0);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
ret = BCryptVerifySignature(key, NULL, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), 0);
- ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got %#lx\n", ret);
pad.pszAlgId = BCRYPT_AES_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_NOT_SUPPORTED, "Expected STATUS_NOT_SUPPORTED, got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "Expected STATUS_NOT_SUPPORTED, got %#lx\n", ret);
pad.pszAlgId = NULL;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %08x\n", ret);
+ ok(ret == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "BCryptDestroyKey failed: %08x\n", ret);
+ ok(!ret, "BCryptDestroyKey failed: %#lx\n", ret);
/* export private key */
ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf;
- ok(rsablob->Magic == BCRYPT_RSAPRIVATE_MAGIC, "got %08x\n", rsablob->Magic);
- ok(rsablob->BitLength == 512, "got %u\n", rsablob->BitLength);
- ok(rsablob->cbPublicExp == 3, "got %u\n", rsablob->cbPublicExp);
- ok(rsablob->cbModulus == 64, "got %u\n", rsablob->cbModulus);
- ok(rsablob->cbPrime1 == 32, "got %u\n", rsablob->cbPrime1);
- ok(rsablob->cbPrime2 == 32, "got %u\n", rsablob->cbPrime2);
+ ok(rsablob->Magic == BCRYPT_RSAPRIVATE_MAGIC, "got %#lx\n", rsablob->Magic);
+ ok(rsablob->BitLength == 512, "got %lu\n", rsablob->BitLength);
+ ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
+ ok(rsablob->cbModulus == 64, "got %lu\n", rsablob->cbModulus);
+ ok(rsablob->cbPrime1 == 32, "got %lu\n", rsablob->cbPrime1);
+ ok(rsablob->cbPrime2 == 32, "got %lu\n", rsablob->cbPrime2);
size2 = sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus + rsablob->cbPrime1 + rsablob->cbPrime2;
- ok(size == size2, "got %u expected %u\n", size2, size);
+ ok(size == size2, "got %lu expected %lu\n", size2, size);
HeapFree(GetProcessHeap(), 0, buf);
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
ret = BCryptExportKey(key, NULL, BCRYPT_RSAFULLPRIVATE_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf;
- ok(rsablob->Magic == BCRYPT_RSAFULLPRIVATE_MAGIC, "got %08x\n", rsablob->Magic);
- ok(rsablob->BitLength == 512, "got %u\n", rsablob->BitLength);
- ok(rsablob->cbPublicExp == 3, "got %u\n", rsablob->cbPublicExp);
- ok(rsablob->cbModulus == 64, "got %u\n", rsablob->cbModulus);
- ok(rsablob->cbPrime1 == 32, "got %u\n", rsablob->cbPrime1);
- ok(rsablob->cbPrime2 == 32, "got %u\n", rsablob->cbPrime2);
+ ok(rsablob->Magic == BCRYPT_RSAFULLPRIVATE_MAGIC, "got %#lx\n", rsablob->Magic);
+ ok(rsablob->BitLength == 512, "got %lu\n", rsablob->BitLength);
+ ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
+ ok(rsablob->cbModulus == 64, "got %lu\n", rsablob->cbModulus);
+ ok(rsablob->cbPrime1 == 32, "got %lu\n", rsablob->cbPrime1);
+ ok(rsablob->cbPrime2 == 32, "got %lu\n", rsablob->cbPrime2);
size2 = sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus * 2 + rsablob->cbPrime1 * 3 + rsablob->cbPrime2 * 2;
- ok(size == size2, "got %u expected %u\n", size2, size);
+ ok(size == size2, "got %lu expected %lu\n", size2, size);
HeapFree(GetProcessHeap(), 0, buf);
BCryptDestroyKey(key);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "BCryptCloseAlgorithmProvider failed: %08x\n", ret);
+ ok(!ret, "BCryptCloseAlgorithmProvider failed: %#lx\n", ret);
}
static BYTE eccprivkey[] =
@@ -2292,75 +2292,75 @@ static void test_ECDH(void)
status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDH_P256_ALGORITHM, NULL, 0);
if (status)
{
- skip("Failed to open BCRYPT_ECDH_P256_ALGORITHM provider %08x\n", status);
+ skip("Failed to open BCRYPT_ECDH_P256_ALGORITHM provider %#lx\n", status);
return;
}
key = NULL;
status = BCryptGenerateKeyPair(alg, &key, 256, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(key != NULL, "key not set\n");
status = BCryptFinalizeKeyPair(key, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
size = 0;
status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, NULL, 0, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, buf, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ecckey = (BCRYPT_ECCKEY_BLOB *)buf;
- ok(ecckey->dwMagic == BCRYPT_ECDH_PUBLIC_P256_MAGIC, "got %08x\n", ecckey->dwMagic);
- ok(ecckey->cbKey == 32, "got %u\n", ecckey->cbKey);
- ok(size == sizeof(*ecckey) + ecckey->cbKey * 2, "got %u\n", size);
+ ok(ecckey->dwMagic == BCRYPT_ECDH_PUBLIC_P256_MAGIC, "got %#lx\n", ecckey->dwMagic);
+ ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
+ ok(size == sizeof(*ecckey) + ecckey->cbKey * 2, "got %lu\n", size);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &pubkey, buf, size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
HeapFree(GetProcessHeap(), 0, buf);
size = 0;
status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, buf, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ecckey = (BCRYPT_ECCKEY_BLOB *)buf;
- ok(ecckey->dwMagic == BCRYPT_ECDH_PRIVATE_P256_MAGIC, "got %08x\n", ecckey->dwMagic);
- ok(ecckey->cbKey == 32, "got %u\n", ecckey->cbKey);
- ok(size == sizeof(*ecckey) + ecckey->cbKey * 3, "got %u\n", size);
+ ok(ecckey->dwMagic == BCRYPT_ECDH_PRIVATE_P256_MAGIC, "got %#lx\n", ecckey->dwMagic);
+ ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
+ ok(size == sizeof(*ecckey) + ecckey->cbKey * 3, "got %lu\n", size);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &privkey, buf, size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
HeapFree(GetProcessHeap(), 0, buf);
BCryptDestroyKey(pubkey);
BCryptDestroyKey(privkey);
BCryptDestroyKey(key);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &privkey, eccprivkey, sizeof(eccprivkey), 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
size = 0;
status = BCryptExportKey(privkey, NULL, BCRYPT_ECCPRIVATE_BLOB, NULL, 0, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), 0, size);
status = BCryptExportKey(privkey, NULL, BCRYPT_ECCPRIVATE_BLOB, buf, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
- ok(size == sizeof(eccprivkey), "got %u\n", size);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
+ ok(size == sizeof(eccprivkey), "got %lu\n", size);
ok(!memcmp(buf, eccprivkey, size), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &pubkey, ecdh_pubkey, sizeof(ecdh_pubkey), 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptSecretAgreement(privkey, pubkey, &secret, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
if (status != STATUS_SUCCESS)
{
@@ -2376,53 +2376,53 @@ static void test_ECDH(void)
goto raw_secret_end;
}
- todo_wine ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status);
if (status != STATUS_SUCCESS)
{
goto raw_secret_end;
}
- ok(size == 32, "size of secret key incorrect, got %u, expected 32\n", size);
+ ok(size == 32, "size of secret key incorrect, got %lu, expected 32\n", size);
buf = HeapAlloc(GetProcessHeap(), 0, size);
status = BCryptDeriveKey(secret, BCRYPT_KDF_RAW_SECRET, NULL, buf, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(!(memcmp(ecdh_secret, buf, size)), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
raw_secret_end:
status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
- todo_wine ok (status == STATUS_SUCCESS, "got %08x\n", status);
+ todo_wine ok (status == STATUS_SUCCESS, "got %#lx\n", status);
if (status != STATUS_SUCCESS)
{
goto derive_end;
}
- ok (size == 20, "got %u\n", size);
+ ok (size == 20, "got %lu\n", size);
buf = HeapAlloc(GetProcessHeap(), 0, size);
status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, buf, size, &size, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(!(memcmp(hashed_secret, buf, size)), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
/* ulVersion is not verified */
hash_params.ulVersion = 0xdeadbeef;
status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
- ok (status == STATUS_SUCCESS, "got %08x\n", status);
+ ok (status == STATUS_SUCCESS, "got %#lx\n", status);
hash_params.ulVersion = BCRYPTBUFFER_VERSION;
hash_param_buffers[0].pvBuffer = (void*) L"INVALID";
hash_param_buffers[0].cbBuffer = sizeof(L"INVALID");
status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
- ok (status == STATUS_NOT_SUPPORTED || broken (status == STATUS_NOT_FOUND) /* < win8 */, "got %08x\n", status);
+ ok (status == STATUS_NOT_SUPPORTED || broken (status == STATUS_NOT_FOUND) /* < win8 */, "got %#lx\n", status);
hash_param_buffers[0].pvBuffer = (void*) BCRYPT_RNG_ALGORITHM;
hash_param_buffers[0].cbBuffer = sizeof(BCRYPT_RNG_ALGORITHM);
status = BCryptDeriveKey(secret, BCRYPT_KDF_HASH, &hash_params, NULL, 0, &size, 0);
- ok (status == STATUS_NOT_SUPPORTED, "got %08x\n", status);
+ ok (status == STATUS_NOT_SUPPORTED, "got %#lx\n", status);
derive_end:
@@ -2440,7 +2440,7 @@ static void test_BCryptEnumContextFunctions(void)
buffer = NULL;
status = BCryptEnumContextFunctions( CRYPT_LOCAL, L"SSL", NCRYPT_SCHANNEL_INTERFACE, &buflen, &buffer );
- todo_wine ok( status == STATUS_SUCCESS, "got %08x\n", status);
+ todo_wine ok( status == STATUS_SUCCESS, "got %#lx\n", status);
if (status == STATUS_SUCCESS) BCryptFreeBuffer( buffer );
}
@@ -2482,94 +2482,94 @@ static void test_BCryptSignHash(void)
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RSA_ALGORITHM, NULL, 0);
if (ret)
{
- win_skip("failed to open RSA provider: %08x\n", ret);
+ win_skip("failed to open RSA provider: %#lx\n", ret);
return;
}
/* public key */
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsapublic, sizeof(rsapublic), 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
len = 0;
pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptSignHash(key, &pad, NULL, 0, NULL, 0, &len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
- ok(len == 256, "got %u\n", len);
+ ok(!ret, "got %#lx\n", ret);
+ ok(len == 256, "got %lu\n", len);
/* test len return when only output is NULL, as described in BCryptSignHash doc */
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), NULL, 0, &len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
- ok(len == 256, "got %u\n", len);
+ ok(!ret, "got %#lx\n", ret);
+ ok(len == 256, "got %lu\n", len);
len = 0;
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_INVALID_PARAMETER || broken(ret == STATUS_INTERNAL_ERROR) /* < win7 */, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER || broken(ret == STATUS_INTERNAL_ERROR) /* < win7 */, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
len = 0;
memset(sig, 0, sizeof(sig));
/* inference of padding info on RSA not supported */
ret = BCryptSignHash(key, NULL, hash, sizeof(hash), sig, sizeof(sig), &len, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, 0, &len, BCRYPT_PAD_PKCS1);
- ok(ret == STATUS_BUFFER_TOO_SMALL, "got %08x\n", ret);
+ ok(ret == STATUS_BUFFER_TOO_SMALL, "got %#lx\n", ret);
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
- ok(len == 64, "got %u\n", len);
+ ok(!ret, "got %#lx\n", ret);
+ ok(len == 64, "got %lu\n", len);
ret = BCryptVerifySignature(key, &pad, hash, sizeof(hash), sig, len, BCRYPT_PAD_PKCS1);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* ECDSA */
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDSA_P256_ALGORITHM, NULL, 0);
if (ret)
{
- win_skip("failed to open ECDSA provider: %08x\n", ret);
+ win_skip("failed to open ECDSA provider: %#lx\n", ret);
return;
}
ret = BCryptGenerateKeyPair(alg, &key, 256, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
memset(sig, 0, sizeof(sig));
len = 0;
/* automatically detects padding info */
ret = BCryptSignHash(key, NULL, hash, sizeof(hash), sig, sizeof(sig), &len, 0);
- ok (!ret, "got %08x\n", ret);
- ok (len == 64, "got %u\n", len);
+ ok (!ret, "got %#lx\n", ret);
+ ok (len == 64, "got %lu\n", len);
ret = BCryptVerifySignature(key, NULL, hash, sizeof(hash), sig, len, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* mismatch info (SHA-1 != SHA-256) */
ret = BCryptSignHash(key, &pad, hash_sha256, sizeof(hash_sha256), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
- ok (ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok (ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
}
static void test_BCryptEnumAlgorithms(void)
@@ -2579,23 +2579,23 @@ static void test_BCryptEnumAlgorithms(void)
ULONG count;
ret = BCryptEnumAlgorithms(0, NULL, NULL, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptEnumAlgorithms(0, &count, NULL, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptEnumAlgorithms(0, NULL, &list, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptEnumAlgorithms(~0u, &count, &list, 0);
- ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
count = 0;
list = NULL;
ret = BCryptEnumAlgorithms(0, &count, &list, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ok(list != NULL, "NULL list\n");
- ok(count, "got %u\n", count);
+ ok(count, "got %lu\n", count);
BCryptFreeBuffer( list );
}
@@ -2615,11 +2615,11 @@ static void test_aes_vector(void)
NTSTATUS ret;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_AES_ALGORITHM, NULL, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
size = sizeof(BCRYPT_CHAIN_MODE_CBC);
ret = BCryptSetProperty(alg, BCRYPT_CHAINING_MODE, (UCHAR *)BCRYPT_CHAIN_MODE_CBC, size, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
blob->dwMagic = BCRYPT_KEY_DATA_BLOB_MAGIC;
blob->dwVersion = BCRYPT_KEY_DATA_BLOB_VERSION1;
@@ -2627,7 +2627,7 @@ static void test_aes_vector(void)
memcpy(data + sizeof(*blob), secret, sizeof(secret));
size = sizeof(BCRYPT_KEY_DATA_BLOB_HEADER) + sizeof(secret);
ret = BCryptImportKey(alg, NULL, BCRYPT_KEY_DATA_BLOB, &key, NULL, 0, data, size, 0);
- ok(!ret || broken(ret == STATUS_INVALID_PARAMETER) /* vista */, "got %08x\n", ret);
+ ok(!ret || broken(ret == STATUS_INVALID_PARAMETER) /* vista */, "got %#lx\n", ret);
if (ret == STATUS_INVALID_PARAMETER)
{
win_skip("broken BCryptImportKey\n");
@@ -2639,16 +2639,16 @@ static void test_aes_vector(void)
size = 0;
memset(output, 0, sizeof(output));
ret = BCryptEncrypt(key, input, sizeof(input), NULL, iv, sizeof(iv), output, sizeof(output), &size, 0);
- ok(!ret, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(!ret, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(output, expect, sizeof(expect)), "wrong cipher text\n");
/* same initialization vector */
size = 0;
memset(output, 0, sizeof(output));
ret = BCryptEncrypt(key, input, sizeof(input), NULL, iv, sizeof(iv), output, sizeof(output), &size, 0);
- ok(!ret, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(!ret, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
ok(!memcmp(output, expect2, sizeof(expect2)), "wrong cipher text\n");
/* different initialization vector */
@@ -2656,15 +2656,15 @@ static void test_aes_vector(void)
size = 0;
memset(output, 0, sizeof(output));
ret = BCryptEncrypt(key, input, sizeof(input), NULL, iv, sizeof(iv), output, sizeof(output), &size, 0);
- ok(!ret, "got %08x\n", ret);
- ok(size == 16, "got %u\n", size);
+ ok(!ret, "got %#lx\n", ret);
+ ok(size == 16, "got %lu\n", size);
todo_wine ok(!memcmp(output, expect3, sizeof(expect3)), "wrong cipher text\n");
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
}
static void test_BcryptDeriveKeyCapi(void)
@@ -2680,10 +2680,10 @@ static void test_BcryptDeriveKeyCapi(void)
NTSTATUS ret;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_SHA1_ALGORITHM, NULL, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
- ok(!ret || broken(ret == STATUS_INVALID_PARAMETER) /* win2k8 */, "got %08x\n", ret);
+ ok(!ret || broken(ret == STATUS_INVALID_PARAMETER) /* win2k8 */, "got %#lx\n", ret);
if (ret == STATUS_INVALID_PARAMETER)
{
win_skip( "broken BCryptCreateHash\n" );
@@ -2691,66 +2691,66 @@ static void test_BcryptDeriveKeyCapi(void)
}
ret = BCryptDeriveKeyCapi(NULL, NULL, NULL, 0, 0);
- ok(ret == STATUS_INVALID_PARAMETER || ret == STATUS_INVALID_HANDLE /* win7 */, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER || ret == STATUS_INVALID_HANDLE /* win7 */, "got %#lx\n", ret);
ret = BCryptDeriveKeyCapi(hash, NULL, NULL, 0, 0);
- ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %#lx\n", ret);
ret = BCryptDestroyHash(hash);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptDeriveKeyCapi(hash, NULL, key, 0, 0);
- ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %#lx\n", ret);
ret = BCryptDestroyHash(hash);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
memset(key, 0, sizeof(key));
ret = BCryptDeriveKeyCapi(hash, NULL, key, 41, 0);
- ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %08x\n", ret);
+ ok(ret == STATUS_INVALID_PARAMETER || !ret /* win7 */, "got %#lx\n", ret);
if (!ret)
ok(!memcmp(key, expect, sizeof(expect) - 1), "wrong key data\n");
ret = BCryptDestroyHash(hash);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
memset(key, 0, sizeof(key));
ret = BCryptDeriveKeyCapi(hash, NULL, key, 20, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ok(!memcmp(key, expect, sizeof(expect) - 1), "wrong key data\n");
ret = BCryptDeriveKeyCapi(hash, NULL, key, 20, 0);
- todo_wine ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ todo_wine ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ret = BCryptHashData(hash, NULL, 0, 0);
- todo_wine ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret);
+ todo_wine ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);
ret = BCryptDestroyHash(hash);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCreateHash(alg, &hash, NULL, 0, NULL, 0, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptHashData(hash, (UCHAR *)"test", 4, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* padding */
memset(key, 0, sizeof(key));
ret = BCryptDeriveKeyCapi(hash, NULL, key, 40, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ok(!memcmp(key, expect2, sizeof(expect2) - 1), "wrong key data\n");
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
}
static UCHAR dsaHash[] =
@@ -2813,78 +2813,78 @@ static void test_DSA(void)
BYTE *buf;
ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DSA_ALGORITHM, NULL, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptGetProperty(alg, L"PaddingSchemes", (UCHAR *)&schemes, sizeof(schemes), &size, 0);
- ok(ret == STATUS_NOT_SUPPORTED, "got %08x\n", ret);
+ ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_DSA_PUBLIC_BLOB, &key, dsaPublicBlob, sizeof(dsaPublicBlob), 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptVerifySignature(key, NULL, dsaHash, sizeof(dsaHash), dsaSignature, sizeof(dsaSignature), 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
/* sign/verify with export/import round-trip */
ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ret = BCryptFinalizeKeyPair(key, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
len = 0;
memset(sig, 0, sizeof(sig));
ret = BCryptSignHash(key, NULL, dsaHash, sizeof(dsaHash), sig, sizeof(sig), &len, 0);
- ok(!ret, "got %08x\n", ret);
- ok(len == 40, "got %u\n", len);
+ ok(!ret, "got %#lx\n", ret);
+ ok(len == 40, "got %lu\n", len);
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_DSA_PUBLIC_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
ret = BCryptExportKey(key, NULL, BCRYPT_DSA_PUBLIC_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
dsablob = (BCRYPT_DSA_KEY_BLOB *)buf;
- ok(dsablob->dwMagic == BCRYPT_DSA_PUBLIC_MAGIC, "got %08x\n", dsablob->dwMagic);
- ok(dsablob->cbKey == 64, "got %u\n", dsablob->cbKey);
- ok(size == sizeof(*dsablob) + dsablob->cbKey * 3, "got %u\n", size);
+ ok(dsablob->dwMagic == BCRYPT_DSA_PUBLIC_MAGIC, "got %#lx\n", dsablob->dwMagic);
+ ok(dsablob->cbKey == 64, "got %lu\n", dsablob->cbKey);
+ ok(size == sizeof(*dsablob) + dsablob->cbKey * 3, "got %lu\n", size);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_DSA_PUBLIC_BLOB, &key, buf, size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptVerifySignature(key, NULL, dsaHash, sizeof(dsaHash), sig, len, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptImportKeyPair(alg, NULL, LEGACY_DSA_V2_PRIVATE_BLOB, &key, dssKey, sizeof(dssKey), 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
size = 0;
ret = BCryptExportKey(key, NULL, LEGACY_DSA_V2_PRIVATE_BLOB, NULL, 0, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
ok(size, "size not set\n");
buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
ret = BCryptExportKey(key, NULL, LEGACY_DSA_V2_PRIVATE_BLOB, buf, size, &size, 0);
- ok(ret == STATUS_SUCCESS, "got %08x\n", ret);
- ok(size == sizeof(dssKey), "got %u expected %u\n", size, sizeof(dssKey));
+ ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
+ ok(size == sizeof(dssKey), "got %lu expected %Iu\n", size, sizeof(dssKey));
ok(!memcmp(dssKey, buf, size), "wrong data\n");
HeapFree(GetProcessHeap(), 0, buf);
ret = BCryptDestroyKey(key);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
ret = BCryptCloseAlgorithmProvider(alg, 0);
- ok(!ret, "got %08x\n", ret);
+ ok(!ret, "got %#lx\n", ret);
}
static void test_SecretAgreement(void)
@@ -2898,63 +2898,63 @@ static void test_SecretAgreement(void)
status = BCryptOpenAlgorithmProvider(&alg, BCRYPT_ECDH_P256_ALGORITHM, NULL, 0);
if (status)
{
- skip("Failed to open BCRYPT_ECDH_P256_ALGORITHM provider %08x\n", status);
+ skip("Failed to open BCRYPT_ECDH_P256_ALGORITHM provider %#lx\n", status);
return;
}
key = NULL;
status = BCryptGenerateKeyPair(alg, &key, 256, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
ok(key != NULL, "key not set\n");
status = BCryptFinalizeKeyPair(key, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptSecretAgreement(NULL, key, &secret, 0);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptSecretAgreement(key, NULL, &secret, 0);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptSecretAgreement(key, key, NULL, 0);
- ok(status == STATUS_INVALID_PARAMETER, "got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status);
status = BCryptSecretAgreement(key, key, &secret, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptDeriveKey(NULL, L"HASH", NULL, NULL, 0, &size, 0);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptDeriveKey(key, L"HASH", NULL, NULL, 0, &size, 0);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptDeriveKey(secret, NULL, NULL, NULL, 0, &size, 0);
- ok(status == STATUS_INVALID_PARAMETER, "got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status);
status = BCryptDeriveKey(secret, L"HASH", NULL, NULL, 0, &size, 0);
todo_wine
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptDestroyHash(secret);
- ok(status == STATUS_INVALID_PARAMETER, "got %08x\n", status);
+ ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status);
status = BCryptDestroyKey(secret);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptDestroySecret(NULL);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptDestroySecret(alg);
- ok(status == STATUS_INVALID_HANDLE, "got %08x\n", status);
+ ok(status == STATUS_INVALID_HANDLE, "got %#lx\n", status);
status = BCryptDestroySecret(secret);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptDestroyKey(key);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
status = BCryptCloseAlgorithmProvider(alg, 0);
- ok(status == STATUS_SUCCESS, "got %08x\n", status);
+ ok(status == STATUS_SUCCESS, "got %#lx\n", status);
}
START_TEST(bcrypt)
--
2.30.2
1
0
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/evr/tests/Makefile.in | 1 -
dlls/evr/tests/evr.c | 1291 ++++++++++++++++++------------------
2 files changed, 647 insertions(+), 645 deletions(-)
diff --git a/dlls/evr/tests/Makefile.in b/dlls/evr/tests/Makefile.in
index b8980a3f397..c5db2226ebc 100644
--- a/dlls/evr/tests/Makefile.in
+++ b/dlls/evr/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = evr.dll
IMPORTS = dxva2 mfplat mfuuid mf strmiids uuid dxguid ole32 oleaut32 evr d3d9 user32
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index acbb2b1869a..ea67ff5b584 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -80,7 +80,7 @@ static IBaseFilter *create_evr(void)
IBaseFilter *filter = NULL;
HRESULT hr = CoCreateInstance(&CLSID_EnhancedVideoRenderer, NULL, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
return filter;
}
@@ -90,7 +90,7 @@ static IFilterGraph2 *create_graph(void)
HRESULT hr;
hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&ret);
- ok(hr == S_OK, "Failed to create FilterGraph: %#x\n", hr);
+ ok(hr == S_OK, "Failed to create FilterGraph: %#lx\n", hr);
return ret;
}
@@ -100,7 +100,7 @@ static void _expect_ref(IUnknown *obj, ULONG ref, int line)
ULONG rc;
IUnknown_AddRef(obj);
rc = IUnknown_Release(obj);
- ok_(__FILE__,line)(rc == ref, "Unexpected refcount %d, expected %d.\n", rc, ref);
+ ok_(__FILE__,line)(rc == ref, "Unexpected refcount %ld, expected %ld.\n", rc, ref);
}
static ULONG get_refcount(void *iface)
@@ -157,69 +157,69 @@ static void test_aggregation(void)
filter = (IBaseFilter *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_EnhancedVideoRenderer, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IBaseFilter, (void **)&filter);
- ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!filter, "Got interface %p.\n", filter);
hr = CoCreateInstance(&CLSID_EnhancedVideoRenderer, &test_outer, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
ref = IUnknown_AddRef(unk);
- ok(ref == 2, "Got unexpected refcount %d.\n", ref);
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ref = IUnknown_Release(unk);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
IUnknown_Release(unk2);
hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
- ok(hr == E_NOINTERFACE, "Got hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
IBaseFilter_Release(filter);
ref = IUnknown_Release(unk);
- ok(!ref, "Got unexpected refcount %d.\n", ref);
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(!ref, "Got unexpected refcount %ld.\n", ref);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
/* Default presenter. */
presenter = (void *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_MFVideoPresenter9, &test_outer, CLSCTX_INPROC_SERVER, &IID_IMFVideoPresenter,
(void **)&presenter);
- ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok(!presenter, "Got interface %p.\n", presenter);
hr = CoCreateInstance(&CLSID_MFVideoPresenter9, &test_outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
- ok(hr == S_OK || broken(hr == E_FAIL) /* WinXP */, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_FAIL) /* WinXP */, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IUnknown_Release(unk);
}
@@ -228,15 +228,15 @@ static void test_aggregation(void)
presenter = (void *)0xdeadbeef;
hr = CoCreateInstance(&CLSID_MFVideoMixer9, &test_outer, CLSCTX_INPROC_SERVER, &IID_IMFTransform,
(void **)&mixer);
- ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
ok(!mixer, "Got interface %p.\n", mixer);
hr = CoCreateInstance(&CLSID_MFVideoMixer9, &test_outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(outer_ref == 1, "Got unexpected refcount %d.\n", outer_ref);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
ref = get_refcount(unk);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IUnknown_Release(unk);
}
@@ -251,7 +251,7 @@ static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOO
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
- ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@@ -266,7 +266,7 @@ static void check_service_interface_(unsigned int line, void *iface_ptr, REFGUID
expected_hr = supported ? S_OK : E_NOINTERFACE;
hr = MFGetService(iface, service, iid, (void **)&unk);
- ok_(__FILE__, line)(hr == expected_hr, "Got hr %#x, expected %#x.\n", hr, expected_hr);
+ ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
if (SUCCEEDED(hr))
IUnknown_Release(unk);
}
@@ -295,7 +295,7 @@ static void test_interfaces(void)
check_interface(filter, &IID_IVideoWindow, FALSE);
ref = IBaseFilter_Release(filter);
- ok(!ref, "Got unexpected refcount %d.\n", ref);
+ ok(!ref, "Got unexpected refcount %ld.\n", ref);
}
static void test_enum_pins(void)
@@ -307,85 +307,85 @@ static void test_enum_pins(void)
HRESULT hr;
ref = get_refcount(filter);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IBaseFilter_EnumPins(filter, NULL);
- ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IBaseFilter_EnumPins(filter, &enum1);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
- ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, NULL, NULL);
- ok(hr == E_POINTER, "Got hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
- ok(ref == 3, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pins[0]);
- ok(ref == 3, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(enum1);
- ok(ref == 1, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
IPin_Release(pins[0]);
ref = get_refcount(filter);
- ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Reset(enum1);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, &count);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
- ok(count == 1, "Got count %u.\n", count);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Next(enum1, 1, pins, &count);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
- ok(!count, "Got count %u.\n", count);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+ ok(!count, "Got count %lu.\n", count);
hr = IEnumPins_Reset(enum1);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, NULL);
- ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 2, pins, &count);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
- ok(count == 1, "Got count %u.\n", count);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
+ ok(count == 1, "Got count %lu.\n", count);
IPin_Release(pins[0]);
hr = IEnumPins_Reset(enum1);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Clone(enum1, &enum2);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 2);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 1);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Skip(enum1, 1);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum1, 1, pins, NULL);
- ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum2, 1, pins, NULL);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
IPin_Release(pins[0]);
IEnumPins_Release(enum2);
IEnumPins_Release(enum1);
ref = IBaseFilter_Release(filter);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_find_pin(void)
@@ -397,19 +397,19 @@ static void test_find_pin(void)
ULONG ref;
hr = IBaseFilter_EnumPins(filter, &enum_pins);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IBaseFilter_FindPin(filter, sink_id, &pin);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2);
IPin_Release(pin2);
IPin_Release(pin);
IEnumPins_Release(enum_pins);
ref = IBaseFilter_Release(filter);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static void test_pin_info(void)
@@ -423,38 +423,38 @@ static void test_pin_info(void)
IPin *pin;
hr = IBaseFilter_FindPin(filter, sink_id, &pin);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ref = get_refcount(filter);
- ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pin);
- ok(ref == 2, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
hr = IPin_QueryPinInfo(pin, &info);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
ok(!lstrcmpW(info.achName, sink_id), "Got name %s.\n", wine_dbgstr_w(info.achName));
ref = get_refcount(filter);
- ok(ref == 3, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
ref = get_refcount(pin);
- ok(ref == 3, "Got unexpected refcount %d.\n", ref);
+ ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
IBaseFilter_Release(info.pFilter);
hr = IPin_QueryDirection(pin, &dir);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
hr = IPin_QueryId(pin, &id);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ok(!lstrcmpW(id, sink_id), "Got id %s.\n", wine_dbgstr_w(id));
CoTaskMemFree(id);
hr = IPin_QueryInternalConnections(pin, NULL, NULL);
- ok(hr == E_NOTIMPL, "Got hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
IPin_Release(pin);
ref = IBaseFilter_Release(filter);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static unsigned int check_event_code(IMediaEvent *eventsrc, DWORD timeout, LONG expected_code, LONG_PTR expected1, LONG_PTR expected2)
@@ -468,14 +468,14 @@ static unsigned int check_event_code(IMediaEvent *eventsrc, DWORD timeout, LONG
{
if (code == expected_code)
{
- ok(param1 == expected1, "Got param1 %#lx.\n", param1);
- ok(param2 == expected2, "Got param2 %#lx.\n", param2);
+ ok(param1 == expected1, "Got param1 %#Ix.\n", param1);
+ ok(param2 == expected2, "Got param2 %#Ix.\n", param2);
ret++;
}
IMediaEvent_FreeEventParams(eventsrc, code, param1, param2);
timeout = 0;
}
- ok(hr == E_ABORT, "Got hr %#x.\n", hr);
+ ok(hr == E_ABORT, "Got hr %#lx.\n", hr);
return ret;
}
@@ -496,49 +496,49 @@ static void test_unconnected_eos(void)
ULONG ref;
hr = IFilterGraph2_AddFilter(graph, filter, L"renderer");
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (void **)&eventsrc);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Pause(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Run(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Pause(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Run(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Stop(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
hr = IMediaControl_Run(control);
- ok(hr == S_OK, "Got hr %#x.\n", hr);
+ ok(hr == S_OK, "Got hr %#lx.\n", hr);
ret = check_ec_complete(eventsrc, 0);
ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
@@ -546,9 +546,9 @@ static void test_unconnected_eos(void)
IMediaControl_Release(control);
IMediaEvent_Release(eventsrc);
ref = IFilterGraph2_Release(graph);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
ref = IBaseFilter_Release(filter);
- ok(!ref, "Got outstanding refcount %d.\n", ref);
+ ok(!ref, "Got outstanding refcount %ld.\n", ref);
}
static IMFMediaType * create_video_type(const GUID *subtype)
@@ -557,13 +557,13 @@ static IMFMediaType * create_video_type(const GUID *subtype)
HRESULT hr;
hr = MFCreateMediaType(&video_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(video_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(video_type, &MF_MT_SUBTYPE, subtype);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
return video_type;
}
@@ -583,17 +583,18 @@ static void test_default_mixer(void)
IMFTransform *transform;
DXVA2_ValueRange range;
DXVA2_Fixed32 dxva_value;
- DWORD flags, value, count;
+ UINT32 count, value;
COLORREF color;
unsigned int i;
DWORD ids[16];
IUnknown *unk;
+ DWORD flags;
GUID *guids;
HRESULT hr;
IID iid;
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform);
- ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default mixer, hr %#lx.\n", hr);
check_interface(transform, &IID_IMFQualityAdvise, TRUE);
check_interface(transform, &IID_IMFClockStateSink, TRUE);
@@ -612,105 +613,105 @@ static void test_default_mixer(void)
check_service_interface(transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFTransform, FALSE);
hr = MFGetService((IUnknown *)transform, &MR_VIDEO_RENDER_SERVICE, &IID_IUnknown, (void **)&unk);
- ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(MFGetService((IUnknown *)transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerControl2, (void **)&mixer_control2)))
{
hr = IMFVideoMixerControl2_GetMixingPrefs(mixer_control2, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl2_GetMixingPrefs(mixer_control2, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!flags, "Unexpected flags %#x.\n", flags);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!flags, "Unexpected flags %#lx.\n", flags);
IMFVideoMixerControl2_Release(mixer_control2);
}
hr = MFGetService((IUnknown *)transform, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoProcessor, (void **)&processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetBackgroundColor(processor, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
color = 1;
hr = IMFVideoProcessor_GetBackgroundColor(processor, &color);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!color, "Unexpected color %#x.\n", color);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!color, "Unexpected color %#lx.\n", color);
hr = IMFVideoProcessor_SetBackgroundColor(processor, 0x00121212);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetBackgroundColor(processor, &color);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(color == 0x121212, "Unexpected color %#x.\n", color);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(color == 0x121212, "Unexpected color %#lx.\n", color);
hr = IMFVideoProcessor_GetFilteringRange(processor, DXVA2_DetailFilterChromaLevel, &range);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetFilteringValue(processor, DXVA2_DetailFilterChromaLevel, &dxva_value);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
IMFVideoProcessor_Release(processor);
hr = IMFTransform_SetOutputBounds(transform, 100, 10);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoDeviceID, (void **)&deviceid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetAttributes(transform, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetAttributes(transform, &attributes);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetAttributes(transform, &attributes2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(attributes == attributes2, "Unexpected attributes instance.\n");
IMFAttributes_Release(attributes2);
hr = IMFTransform_QueryInterface(transform, &IID_IMFAttributes, (void **)&attributes2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(attributes != attributes2, "Unexpected attributes instance.\n");
hr = IMFAttributes_QueryInterface(attributes2, &IID_IMFTransform, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
hr = IMFAttributes_GetCount(attributes2, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected attribute count %u.\n", count);
value = 0;
hr = IMFAttributes_GetUINT32(attributes2, &MF_SA_D3D_AWARE, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(value == 1, "Unexpected value %d.\n", value);
IMFAttributes_Release(attributes2);
hr = IMFAttributes_GetCount(attributes, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected attribute count %u.\n", count);
memset(&rect, 0, sizeof(rect));
hr = IMFAttributes_GetBlob(attributes, &VIDEO_ZOOM_RECT, (UINT8 *)&rect, sizeof(rect), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rect.left == 0.0f && rect.top == 0.0f && rect.right == 1.0f && rect.bottom == 1.0f,
"Unexpected zoom rect (%f, %f) - (%f, %f).\n", rect.left, rect.top, rect.right, rect.bottom);
IMFAttributes_Release(attributes);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, &iid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsEqualIID(&iid, &IID_IDirect3DDevice9), "Unexpected id %s.\n", wine_dbgstr_guid(&iid));
IMFVideoDeviceID_Release(deviceid);
@@ -718,84 +719,84 @@ static void test_default_mixer(void)
/* Stream configuration. */
input_count = output_count = 0;
hr = IMFTransform_GetStreamCount(transform, &input_count, &output_count);
- ok(hr == S_OK, "Failed to get stream count, hr %#x.\n", hr);
- ok(input_count == 1 && output_count == 1, "Unexpected stream count %u/%u.\n", input_count, output_count);
+ ok(hr == S_OK, "Failed to get stream count, hr %#lx.\n", hr);
+ ok(input_count == 1 && output_count == 1, "Unexpected stream count %lu/%lu.\n", input_count, output_count);
hr = IMFTransform_GetStreamLimits(transform, &input_min, &input_max, &output_min, &output_max);
- ok(hr == S_OK, "Failed to get stream limits, hr %#x.\n", hr);
- ok(input_min == 1 && input_max == 16 && output_min == 1 && output_max == 1, "Unexpected stream limits %u/%u, %u/%u.\n",
+ ok(hr == S_OK, "Failed to get stream limits, hr %#lx.\n", hr);
+ ok(input_min == 1 && input_max == 16 && output_min == 1 && output_max == 1, "Unexpected stream limits %lu/%lu, %lu/%lu.\n",
input_min, input_max, output_min, output_max);
hr = IMFTransform_GetInputStreamInfo(transform, 1, &input_info);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputStreamInfo(transform, 1, &output_info);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
memset(&input_info, 0xcc, sizeof(input_info));
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
- ok(hr == S_OK, "Failed to get input info, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get input info, hr %#lx.\n", hr);
memset(&output_info, 0xcc, sizeof(output_info));
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
- ok(hr == S_OK, "Failed to get input info, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get input info, hr %#lx.\n", hr);
ok(!(output_info.dwFlags & (MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES)),
- "Unexpected output flags %#x.\n", output_info.dwFlags);
+ "Unexpected output flags %#lx.\n", output_info.dwFlags);
hr = IMFTransform_GetStreamIDs(transform, 1, &input_id, 1, &output_id);
- ok(hr == S_OK, "Failed to get input info, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get input info, hr %#lx.\n", hr);
ok(input_id == 0 && output_id == 0, "Unexpected stream ids.\n");
hr = IMFTransform_GetInputStreamAttributes(transform, 1, &attributes);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputStreamAttributes(transform, 1, &attributes);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputStreamAttributes(transform, 0, &attributes);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_AddInputStreams(transform, 16, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_AddInputStreams(transform, 16, ids);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
memset(ids, 0, sizeof(ids));
hr = IMFTransform_AddInputStreams(transform, 15, ids);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
for (i = 0; i < ARRAY_SIZE(ids); ++i)
ids[i] = i + 1;
hr = IMFTransform_AddInputStreams(transform, 15, ids);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_count = output_count = 0;
hr = IMFTransform_GetStreamCount(transform, &input_count, &output_count);
- ok(hr == S_OK, "Failed to get stream count, hr %#x.\n", hr);
- ok(input_count == 16 && output_count == 1, "Unexpected stream count %u/%u.\n", input_count, output_count);
+ ok(hr == S_OK, "Failed to get stream count, hr %#lx.\n", hr);
+ ok(input_count == 16 && output_count == 1, "Unexpected stream count %lu/%lu.\n", input_count, output_count);
memset(&input_info, 0, sizeof(input_info));
hr = IMFTransform_GetInputStreamInfo(transform, 1, &input_info);
- ok(hr == S_OK, "Failed to get input info, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get input info, hr %#lx.\n", hr);
ok((input_info.dwFlags & (MFT_INPUT_STREAM_REMOVABLE | MFT_INPUT_STREAM_OPTIONAL)) ==
- (MFT_INPUT_STREAM_REMOVABLE | MFT_INPUT_STREAM_OPTIONAL), "Unexpected flags %#x.\n", input_info.dwFlags);
+ (MFT_INPUT_STREAM_REMOVABLE | MFT_INPUT_STREAM_OPTIONAL), "Unexpected flags %#lx.\n", input_info.dwFlags);
attributes = NULL;
hr = IMFTransform_GetInputStreamAttributes(transform, 0, &attributes);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFAttributes_GetCount(attributes, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected count %u.\n", count);
hr = IMFAttributes_GetUINT32(attributes, &MF_SA_REQUIRED_SAMPLE_COUNT, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected count %u.\n", count);
ok(!!attributes, "Unexpected attributes.\n");
attributes2 = NULL;
hr = IMFTransform_GetInputStreamAttributes(transform, 0, &attributes2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(attributes == attributes2, "Unexpected instance.\n");
IMFAttributes_Release(attributes2);
@@ -803,42 +804,43 @@ static void test_default_mixer(void)
attributes = NULL;
hr = IMFTransform_GetInputStreamAttributes(transform, 1, &attributes);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!attributes, "Unexpected attributes.\n");
IMFAttributes_Release(attributes);
hr = IMFTransform_DeleteInputStream(transform, 0);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_DeleteInputStream(transform, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
input_count = output_count = 0;
hr = IMFTransform_GetStreamCount(transform, &input_count, &output_count);
- ok(hr == S_OK, "Failed to get stream count, hr %#x.\n", hr);
- ok(input_count == 15 && output_count == 1, "Unexpected stream count %u/%u.\n", input_count, output_count);
+ ok(hr == S_OK, "Failed to get stream count, hr %#lx.\n", hr);
+ ok(input_count == 15 && output_count == 1, "Unexpected stream count %lu/%lu.\n", input_count, output_count);
IMFTransform_Release(transform);
hr = MFCreateVideoMixer(NULL, &IID_IMFTransform, &IID_IMFTransform, (void **)&transform);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = CoCreateInstance(&CLSID_MFVideoMixer9, NULL, CLSCTX_INPROC_SERVER, &IID_IMFTransform, (void **)&transform);
- ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default mixer, hr %#lx.\n", hr);
IMFTransform_Release(transform);
}
static void test_surface_sample(void)
{
IDirect3DSurface9 *backbuffer = NULL, *surface;
+ DWORD flags, buffer_count, length;
IMFDesiredSample *desired_sample;
IMFMediaBuffer *buffer, *buffer2;
LONGLONG duration, time1, time2;
IDirect3DSwapChain9 *swapchain;
- DWORD flags, count, length;
IDirect3DDevice9 *device;
IMFSample *sample;
IUnknown *unk;
+ UINT32 count;
HWND window;
HRESULT hr;
BYTE *data;
@@ -851,195 +853,195 @@ static void test_surface_sample(void)
}
hr = IDirect3DDevice9_GetSwapChain(device, 0, &swapchain);
- ok(SUCCEEDED(hr), "Failed to get the implicit swapchain (%08x)\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DSwapChain9_GetBackBuffer(swapchain, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer);
- ok(SUCCEEDED(hr), "Failed to get the back buffer (%08x)\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(backbuffer != NULL, "The back buffer is NULL\n");
IDirect3DSwapChain9_Release(swapchain);
hr = MFCreateVideoSampleFromSurface(NULL, &sample);
- ok(hr == S_OK, "Failed to create surface sample, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create surface sample, hr %#lx.\n", hr);
IMFSample_Release(sample);
hr = MFCreateVideoSampleFromSurface((IUnknown *)backbuffer, &sample);
- ok(hr == S_OK, "Failed to create surface sample, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create surface sample, hr %#lx.\n", hr);
hr = IMFSample_QueryInterface(sample, &IID_IMFTrackedSample, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired_sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!count, "Unexpected attribute count %u.\n", count);
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, NULL, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, NULL, &time2);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, &time1, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, &time1, &time2);
- ok(hr == MF_E_NOT_AVAILABLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOT_AVAILABLE, "Unexpected hr %#lx.\n", hr);
IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired_sample, 123, 456);
time1 = time2 = 0;
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, &time1, &time2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(time1 == 123 && time2 == 456, "Unexpected time values.\n");
IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired_sample, 0, 0);
time1 = time2 = 1;
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, &time1, &time2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(time1 == 0 && time2 == 0, "Unexpected time values.\n");
IMFDesiredSample_Clear(desired_sample);
hr = IMFDesiredSample_GetDesiredSampleTimeAndDuration(desired_sample, &time1, &time2);
- ok(hr == MF_E_NOT_AVAILABLE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOT_AVAILABLE, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!count, "Unexpected attribute count %u.\n", count);
/* Attributes are cleared. */
hr = IMFSample_SetUnknown(sample, &MFSampleExtension_Token, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected attribute count %u.\n", count);
hr = IMFSample_SetSampleTime(sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleTime(sample, &time1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleDuration(sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleDuration(sample, &duration);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleFlags(sample, 0x1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFDesiredSample_Clear(desired_sample);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!count, "Unexpected attribute count %u.\n", count);
hr = IMFSample_GetSampleTime(sample, &time1);
- ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleDuration(sample, &duration);
- ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleFlags(sample, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(flags == 0, "Unexpected flags %#x.\n", flags);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!flags, "Unexpected flags %#lx.\n", flags);
IMFDesiredSample_Release(desired_sample);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Failed to get attribute count, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get attribute count, hr %#lx.\n", hr);
ok(!count, "Unexpected attribute count.\n");
- count = 0;
- hr = IMFSample_GetBufferCount(sample, &count);
- ok(hr == S_OK, "Failed to get buffer count, hr %#x.\n", hr);
- ok(count == 1, "Unexpected attribute count.\n");
+ buffer_count = 0;
+ hr = IMFSample_GetBufferCount(sample, &buffer_count);
+ ok(hr == S_OK, "Failed to get buffer count, hr %#lx.\n", hr);
+ ok(buffer_count == 1, "Unexpected attribute count.\n");
hr = IMFSample_GetTotalLength(sample, &length);
- ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
- ok(!length, "Unexpected length %u.\n", length);
+ ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
+ ok(!length, "Unexpected length %lu.\n", length);
hr = IMFSample_GetSampleDuration(sample, &duration);
- ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleTime(sample, &duration);
- ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetBufferByIndex(sample, 0, &buffer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaBuffer_GetMaxLength(buffer, &length);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaBuffer_GetCurrentLength(buffer, &length);
- ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
- ok(!length, "Unexpected length %u.\n", length);
+ ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
+ ok(!length, "Unexpected length %lu.\n", length);
hr = IMFMediaBuffer_SetCurrentLength(buffer, 16);
- ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
hr = IMFMediaBuffer_GetCurrentLength(buffer, &length);
- ok(hr == S_OK, "Failed to get length, hr %#x.\n", hr);
- ok(length == 16, "Unexpected length %u.\n", length);
+ ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
+ ok(length == 16, "Unexpected length %lu.\n", length);
hr = IMFMediaBuffer_Lock(buffer, &data, NULL, NULL);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaBuffer_Unlock(buffer);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer, (void **)&unk);
- ok(hr == E_NOINTERFACE, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOINTERFACE, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_AddBuffer(sample, buffer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
- hr = IMFSample_GetBufferCount(sample, &count);
- ok(hr == S_OK, "Failed to get buffer count, hr %#x.\n", hr);
- ok(count == 2, "Unexpected attribute count.\n");
+ hr = IMFSample_GetBufferCount(sample, &buffer_count);
+ ok(hr == S_OK, "Failed to get buffer count, hr %#lx.\n", hr);
+ ok(buffer_count == 2, "Unexpected buffer count.\n");
hr = IMFSample_ConvertToContiguousBuffer(sample, &buffer2);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_CopyToBuffer(sample, buffer);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_RemoveAllBuffers(sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
- hr = IMFSample_GetBufferCount(sample, &count);
- ok(hr == S_OK, "Failed to get buffer count, hr %#x.\n", hr);
- ok(!count, "Unexpected attribute count.\n");
+ hr = IMFSample_GetBufferCount(sample, &buffer_count);
+ ok(hr == S_OK, "Failed to get buffer count, hr %#lx.\n", hr);
+ ok(!buffer_count, "Unexpected buffer count.\n");
hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(surface == backbuffer, "Unexpected instance.\n");
IDirect3DSurface9_Release(surface);
hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IUnknown, (void **)&surface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(surface == backbuffer, "Unexpected instance.\n");
IDirect3DSurface9_Release(surface);
IMFMediaBuffer_Release(buffer);
hr = IMFSample_GetSampleFlags(sample, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleFlags(sample, 0x123);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
flags = 0;
hr = IMFSample_GetSampleFlags(sample, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(flags == 0x123, "Unexpected flags %#x.\n", flags);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(flags == 0x123, "Unexpected flags %#lx.\n", flags);
IMFSample_Release(sample);
@@ -1060,38 +1062,38 @@ static void test_default_mixer_type_negotiation(void)
IMFMediaType *video_type;
IMFTransform *transform;
MFVideoArea aperture;
- DWORD index, count;
+ UINT count, token;
IUnknown *unk;
+ DWORD index;
HWND window;
HRESULT hr;
- UINT token;
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform);
- ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default mixer, hr %#lx.\n", hr);
hr = IMFTransform_GetInputAvailableType(transform, 0, 0, &media_type);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMediaType(&media_type);
- ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media type, hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Video);
- ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set attribute, hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_RGB32);
- ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set attribute, hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
- ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
/* Now try with device manager. */
@@ -1103,69 +1105,69 @@ static void test_default_mixer_type_negotiation(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Now manager is not initialized. */
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
- ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == DXVA2_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* And now type description is incomplete. */
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
- ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx.\n", hr);
IMFMediaType_Release(media_type);
video_type = create_video_type(&MFVideoFormat_RGB32);
/* Partially initialized type. */
hr = IMFTransform_SetInputType(transform, 0, video_type, 0);
- ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx.\n", hr);
/* Only required data - frame size and uncompressed marker. */
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64)640 << 32 | 480);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(&aperture, 0, sizeof(aperture));
aperture.Area.cx = 100; aperture.Area.cy = 200;
hr = IMFMediaType_SetBlob(video_type, &MF_MT_GEOMETRIC_APERTURE, (UINT8 *)&aperture, sizeof(aperture));
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(video_type, &MF_MT_FIXED_SIZE_SAMPLES, 2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, video_type, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(media_type == video_type, "Unexpected media type instance.\n");
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(media_type == media_type2, "Unexpected media type instance.\n");
IMFMediaType_Release(media_type);
IMFMediaType_Release(media_type2);
/* Modified after type was set. */
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_PIXEL_ASPECT_RATIO, (UINT64)56 << 32 | 55);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Check attributes on available output types. */
index = 0;
@@ -1177,30 +1179,30 @@ static void test_default_mixer_type_negotiation(void)
UINT32 value;
hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &major);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsEqualGUID(&major, &MFMediaType_Video), "Unexpected major type.\n");
hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &subtype);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &frame_size);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(frame_size == ((UINT64)100 << 32 | 200), "Unexpected frame size %s.\n", wine_dbgstr_longlong(frame_size));
hr = IMFMediaType_GetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_GetUINT32(media_type, &MF_MT_INTERLACE_MODE, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(value == MFVideoInterlace_Progressive, "Unexpected interlace mode.\n");
/* Ratio from input type */
hr = IMFMediaType_GetUINT64(media_type, &MF_MT_PIXEL_ASPECT_RATIO, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ratio == ((UINT64)1 << 32 | 1), "Unexpected PAR %s.\n", wine_dbgstr_longlong(ratio));
hr = IMFMediaType_GetBlob(media_type, &MF_MT_GEOMETRIC_APERTURE, (UINT8 *)&aperture, sizeof(aperture), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(aperture.Area.cx == 100 && aperture.Area.cy == 200, "Unexpected aperture area.\n");
hr = IMFMediaType_GetBlob(media_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (UINT8 *)&aperture, sizeof(aperture), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(aperture.Area.cx == 100 && aperture.Area.cy == 200, "Unexpected aperture area.\n");
hr = IMFMediaType_GetUINT32(video_type, &MF_MT_FIXED_SIZE_SAMPLES, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(value == 2, "Unexpected value %u.\n", value);
IMFMediaType_Release(media_type);
@@ -1208,10 +1210,10 @@ static void test_default_mixer_type_negotiation(void)
ok(index > 1, "Unexpected number of available types.\n");
hr = IMFMediaType_DeleteItem(video_type, &MF_MT_FIXED_SIZE_SAMPLES);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
index = 0;
while (SUCCEEDED(IMFTransform_GetOutputAvailableType(transform, 0, index++, &media_type)))
@@ -1220,11 +1222,11 @@ static void test_default_mixer_type_negotiation(void)
UINT64 ratio;
hr = IMFMediaType_GetUINT64(media_type, &MF_MT_PIXEL_ASPECT_RATIO, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ratio == ((UINT64)56 << 32 | 55), "Unexpected PAR %s.\n", wine_dbgstr_longlong(ratio));
hr = IMFMediaType_GetUINT32(media_type, &MF_MT_FIXED_SIZE_SAMPLES, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(value == 1, "Unexpected value %u.\n", value);
IMFMediaType_Release(media_type);
@@ -1233,97 +1235,97 @@ static void test_default_mixer_type_negotiation(void)
/* Cloned type is returned. */
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(media_type != media_type2, "Unexpected media type instance.\n");
IMFMediaType_Release(media_type);
IMFMediaType_Release(media_type2);
/* Minimal valid attribute set for output type. */
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMediaType(&media_type2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &subtype);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(media_type2, &MF_MT_MAJOR_TYPE, &MFMediaType_Video);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetGUID(media_type2, &MF_MT_SUBTYPE, &subtype);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 1, NULL, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, NULL, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type2, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(media_type2, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type2, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Candidate type have frame size set, mismatching size is accepted. */
hr = IMFMediaType_SetUINT64(media_type2, &MF_MT_FRAME_SIZE, (UINT64)64 << 32 | 64);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type2, MFT_SET_TYPE_TEST_ONLY);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaType_Release(media_type2);
IMFMediaType_Release(media_type);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetVideoProcessorMode(processor, &guid);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetVideoProcessorCaps(processor, (GUID *)&DXVA2_VideoProcSoftwareDevice, &caps);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(media_type == video_type, "Unexpected pointer.\n");
hr = IMFMediaType_QueryInterface(media_type, &IID_IMFVideoMediaType, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
IMFMediaType_Release(media_type);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 1, media_type, 0);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetVideoProcessorMode(processor, &guid);
todo_wine
- ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
CoTaskMemFree(guids);
hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(media_type == media_type2, "Unexpected media type instance.\n");
IMFMediaType_Release(media_type2);
IMFMediaType_Release(media_type);
@@ -1356,10 +1358,10 @@ static void test_default_presenter(void)
GUID iid;
hr = MFCreateVideoPresenter(NULL, &IID_IMFVideoPresenter, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
check_interface(presenter, &IID_IQualProp, TRUE);
check_interface(presenter, &IID_IMFVideoPositionMapper, TRUE);
@@ -1390,101 +1392,101 @@ static void test_default_presenter(void)
/* Query arbitrary supported interface back from device manager wrapper. */
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IDirect3DDeviceManager9, (void **)&dm);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_QueryInterface(dm, &IID_IQualProp, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
hr = IDirect3DDeviceManager9_QueryInterface(dm, &IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IUnknown, (void **)&unk2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(unk == unk2, "Unexpected interface.\n");
IUnknown_Release(unk2);
IUnknown_Release(unk);
IDirect3DDeviceManager9_Release(dm);
hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_MIXER_SERVICE, &IID_IUnknown, (void **)&unk);
- ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDeviceID, (void **)&deviceid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, &iid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(IsEqualIID(&iid, &IID_IDirect3DDevice9), "Unexpected id %s.\n", wine_dbgstr_guid(&iid));
IMFVideoDeviceID_Release(deviceid);
hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetRenderingPrefs(display_control, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
flags = 123;
hr = IMFVideoDisplayControl_GetRenderingPrefs(display_control, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!flags, "Unexpected rendering flags %#x.\n", flags);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!flags, "Unexpected rendering flags %#lx.\n", flags);
IMFVideoDisplayControl_Release(display_control);
hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, (void **)&dm);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Video window */
hwnd = create_window();
ok(!!hwnd, "Failed to create a test window.\n");
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hwnd2 = hwnd;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, (HWND)0x1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hwnd2 = NULL;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(hwnd2 == hwnd, "Unexpected window %p.\n", hwnd2);
/* Rate support. */
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFRateSupport, (void **)&rate_support);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_FORWARD, FALSE, &rate);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_FORWARD, TRUE, &rate);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_REVERSE, FALSE, &rate);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
rate = 1.0f;
hr = IMFRateSupport_GetSlowestRate(rate_support, MFRATE_REVERSE, TRUE, &rate);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(rate == 0.0f, "Unexpected rate %f.\n", rate);
IMFRateSupport_Release(rate_support);
@@ -1500,7 +1502,7 @@ static void test_MFCreateVideoMixerAndPresenter(void)
HRESULT hr;
hr = MFCreateVideoMixerAndPresenter(NULL, NULL, &IID_IUnknown, (void **)&mixer, &IID_IUnknown, (void **)&presenter);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(mixer);
IUnknown_Release(presenter);
@@ -1564,97 +1566,97 @@ static void test_MFCreateVideoSampleAllocator(void)
BYTE *data;
hr = MFCreateVideoSampleAllocator(&IID_IUnknown, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&allocator);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_QueryInterface(allocator, &IID_IMFVideoSampleAllocatorCallback, (void **)&allocator_cb);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, &test_notify);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocatorCallback_SetCallback(allocator_cb, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
count = 10;
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!count, "Unexpected count %d.\n", count);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!count, "Unexpected count %ld.\n", count);
hr = IMFVideoSampleAllocator_UninitializeSampleAllocator(allocator);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
- ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMediaType(&media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* It expects IMFVideoMediaType aka video major type. Exact return code is E_NOINTERFACE,
likely coming from querying for IMFVideoMediaType. Does not seem valuable to match it. */
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, media_type);
- ok(FAILED(hr), "Unexpected hr %#x.\n", hr);
+ ok(FAILED(hr), "Unexpected hr %#lx.\n", hr);
video_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 2, video_type);
- ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDMEDIATYPE, "Unexpected hr %#lx.\n", hr);
/* Frame size is required. */
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(count == 1, "Unexpected count %d.\n", count);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(count == 1, "Unexpected count %ld.\n", count);
sample = NULL;
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
refcount = get_refcount(sample);
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample2);
- ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SAMPLEALLOCATOR_EMPTY, "Unexpected hr %#lx.\n", hr);
/* Reinitialize with active sample. */
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 4, video_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(refcount == get_refcount(sample), "Unexpected refcount %u.\n", get_refcount(sample));
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(refcount == get_refcount(sample), "Unexpected refcount %lu.\n", get_refcount(sample));
hr = IMFVideoSampleAllocatorCallback_GetFreeSampleCount(allocator_cb, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(count == 4, "Unexpected count %d.\n", count);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(count == 4, "Unexpected count %ld.\n", count);
check_interface(sample, &IID_IMFDesiredSample, TRUE);
check_interface(sample, &IID_IMFTrackedSample, TRUE);
hr = IMFSample_GetBufferByIndex(sample, 0, &buffer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
check_interface(buffer, &IID_IMF2DBuffer, TRUE);
hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMFGetService, (void **)&gs);
- ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#lx.\n", hr);
/* Device manager wasn't set, sample gets regular memory buffers. */
if (SUCCEEDED(hr))
{
hr = IMFGetService_GetService(gs, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&surface);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
IMFGetService_Release(gs);
}
@@ -1667,7 +1669,7 @@ static void test_MFCreateVideoSampleAllocator(void)
IMFVideoSampleAllocator_Release(allocator);
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocatorCallback, (void **)&unk);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IUnknown_Release(unk);
/* Using device manager */
@@ -1679,39 +1681,39 @@ static void test_MFCreateVideoSampleAllocator(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Failed to set a device, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set a device, hr %#lx.\n", hr);
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&allocator);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_SetDirectXManager(allocator, (IUnknown *)manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64) 320 << 32 | 240);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_InitializeSampleAllocator(allocator, 0, video_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoSampleAllocator_AllocateSample(allocator, &sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
check_interface(sample, &IID_IMFTrackedSample, TRUE);
check_interface(sample, &IID_IMFDesiredSample, TRUE);
hr = IMFSample_GetBufferByIndex(sample, 0, &buffer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
check_service_interface(buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, TRUE);
check_interface(buffer, &IID_IMF2DBuffer, TRUE);
check_interface(buffer, &IID_IMF2DBuffer2, TRUE);
hr = IMFMediaBuffer_Lock(buffer, &data, NULL, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaBuffer_Unlock(buffer);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFSample_Release(sample);
@@ -1772,7 +1774,7 @@ static HRESULT WINAPI test_host_LookupService(IMFTopologyServiceLookup *iface,
{
struct test_host *host = impl_from_test_host(iface);
- ok(*num_objects == 1, "Unexpected number of requested objects %u\n", *num_objects);
+ ok(*num_objects == 1, "Unexpected number of requested objects %lu\n", *num_objects);
memset(objects, 0, *num_objects * sizeof(*objects));
@@ -1863,8 +1865,8 @@ static void test_presenter_video_position(void)
struct test_host host;
IMFTransform *mixer;
RECT dst_rect;
+ UINT32 count;
HRESULT hr;
- DWORD count;
HWND hwnd;
hwnd = create_window();
@@ -1872,148 +1874,148 @@ static void test_presenter_video_position(void)
/* Setting position without the mixer. */
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
- ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 0, 0, 10, 10);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
- ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFVideoDisplayControl_Release(display_control);
IMFVideoPresenter_Release(presenter);
/* With the mixer. */
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
init_test_host(&host, mixer, presenter);
/* Clear default mixer attributes, then attach presenter. */
hr = IMFTransform_GetAttributes(mixer, &mixer_attributes);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFAttributes_DeleteAllItems(mixer_attributes);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTopologyServiceLookupClient_InitServicePointers(lookup_client, &host.IMFTopologyServiceLookup_iface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFAttributes_GetCount(mixer_attributes, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected count %u.\n", count);
memset(&src_rect, 0, sizeof(src_rect));
hr = IMFAttributes_GetBlob(mixer_attributes, &VIDEO_ZOOM_RECT, (UINT8 *)&src_rect, sizeof(src_rect), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(src_rect.left == 0.0f && src_rect.top == 0.0f && src_rect.right == 1.0f &&
src_rect.bottom == 1.0f, "Unexpected source rectangle.\n");
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 1, 2, 3, 4);
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, &src_rect, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(src_rect.left == 0.0f && src_rect.top == 0.0f && src_rect.right == 1.0f &&
src_rect.bottom == 1.0f, "Unexpected source rectangle.\n");
ok(dst_rect.left == 0 && dst_rect.right == 0 && dst_rect.top == 0 && dst_rect.bottom == 0,
"Unexpected destination rectangle %s.\n", wine_dbgstr_rect(&dst_rect));
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
/* Setting position requires a window. */
SetRect(&dst_rect, 0, 0, 10, 10);
memset(&src_rect, 0, sizeof(src_rect));
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, &dst_rect);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 0, 0, 10, 10);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 1, 2, 3, 4);
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, &src_rect, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(dst_rect.left == 0 && dst_rect.right == 10 && dst_rect.top == 0 && dst_rect.bottom == 10,
"Unexpected destination rectangle %s.\n", wine_dbgstr_rect(&dst_rect));
set_rect(&src_rect, 0.0f, 0.0f, 2.0f, 1.0f);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
set_rect(&src_rect, -0.1f, 0.0f, 0.9f, 1.0f);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Flipped source rectangle. */
set_rect(&src_rect, 0.5f, 0.0f, 0.4f, 1.0f);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
set_rect(&src_rect, 0.0f, 0.5f, 0.4f, 0.1f);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
set_rect(&src_rect, 0.1f, 0.2f, 0.8f, 0.9f);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, &src_rect, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Presenter updates mixer attribute. */
memset(&src_rect, 0, sizeof(src_rect));
hr = IMFAttributes_GetBlob(mixer_attributes, &VIDEO_ZOOM_RECT, (UINT8 *)&src_rect, sizeof(src_rect), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(src_rect.left == 0.1f && src_rect.top == 0.2f && src_rect.right == 0.8f &&
src_rect.bottom == 0.9f, "Unexpected source rectangle.\n");
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, &src_rect, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(src_rect.left == 0.1f && src_rect.top == 0.2f && src_rect.right == 0.8f &&
src_rect.bottom == 0.9f, "Unexpected source rectangle.\n");
SetRect(&dst_rect, 1, 2, 999, 1000);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 0, 1, 3, 4);
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, &src_rect, &dst_rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(dst_rect.left == 1 && dst_rect.right == 999 && dst_rect.top == 2 && dst_rect.bottom == 1000,
"Unexpected destination rectangle %s.\n", wine_dbgstr_rect(&dst_rect));
/* Flipped destination rectangle. */
SetRect(&dst_rect, 100, 1, 50, 1000);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
SetRect(&dst_rect, 1, 100, 100, 50);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst_rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IMFVideoDisplayControl_Release(display_control);
@@ -2038,86 +2040,86 @@ static void test_presenter_native_video_size(void)
IDirect3DDeviceManager9 *dm;
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, NULL, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
memset(&size, 0xcc, sizeof(size));
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(size.cx == 0 && size.cy == 0, "Unexpected size.\n");
memset(&ratio, 0xcc, sizeof(ratio));
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, NULL, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(ratio.cx == 0 && ratio.cy == 0, "Unexpected ratio.\n");
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Configure mixer primary stream. */
hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, (void **)&dm);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)dm);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DDeviceManager9_Release(dm);
video_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64)640 << 32 | 480);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Native video size is cached on initialization. */
init_test_host(&host, mixer, presenter);
hr = IMFTopologyServiceLookupClient_InitServicePointers(lookup_client, &host.IMFTopologyServiceLookup_iface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(size.cx == 640 && size.cy == 480, "Unexpected size %u x %u.\n", size.cx, size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 640 && size.cy == 480, "Unexpected size %lu x %lu.\n", size.cx, size.cy);
ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */,
- "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
+ "Unexpected ratio %lu x %lu.\n", ratio.cx, ratio.cy);
/* Update input type. */
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64)320 << 32 | 240);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(size.cx == 640 && size.cy == 480, "Unexpected size %u x %u.\n", size.cx, size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 640 && size.cy == 480, "Unexpected size %lu x %lu.\n", size.cx, size.cy);
ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */,
- "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
+ "Unexpected ratio %lu x %lu.\n", ratio.cx, ratio.cy);
/* Negotiating types updates native video size. */
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &ratio);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(size.cx == 320 && size.cy == 240, "Unexpected size %u x %u.\n", size.cx, size.cy);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(size.cx == 320 && size.cy == 240, "Unexpected size %lu x %lu.\n", size.cx, size.cy);
ok((ratio.cx == 4 && ratio.cy == 3) || broken(!memcmp(&ratio, &size, sizeof(ratio))) /* < Win10 */,
- "Unexpected ratio %u x %u.\n", ratio.cx, ratio.cy);
+ "Unexpected ratio %lu x %lu.\n", ratio.cx, ratio.cy);
IMFMediaType_Release(video_type);
IMFVideoDisplayControl_Release(display_control);
@@ -2132,26 +2134,26 @@ static void test_presenter_ar_mode(void)
DWORD mode;
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetAspectRatioMode(display_control, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
mode = 0;
hr = IMFVideoDisplayControl_GetAspectRatioMode(display_control, &mode);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(mode == (MFVideoARMode_PreservePicture | MFVideoARMode_PreservePixel), "Unexpected mode %#x.\n", mode);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(mode == (MFVideoARMode_PreservePicture | MFVideoARMode_PreservePixel), "Unexpected mode %#lx.\n", mode);
hr = IMFVideoDisplayControl_SetAspectRatioMode(display_control, 0x100);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetAspectRatioMode(display_control, MFVideoARMode_Mask);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
mode = 0;
hr = IMFVideoDisplayControl_GetAspectRatioMode(display_control, &mode);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(mode == MFVideoARMode_Mask, "Unexpected mode %#x.\n", mode);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(mode == MFVideoARMode_Mask, "Unexpected mode %#lx.\n", mode);
IMFVideoDisplayControl_Release(display_control);
}
@@ -2169,73 +2171,73 @@ static void test_presenter_video_window(void)
HWND window;
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = MFGetService((IUnknown *)display_control, &MR_VIDEO_ACCELERATION_SERVICE,
&IID_IDirect3DDeviceManager9, (void **)&dm);
hr = IDirect3DDeviceManager9_OpenDeviceHandle(dm, &hdevice);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(dm, hdevice, &d3d_device, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_GetCreationParameters(d3d_device, &device_params);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(device_params.hFocusWindow == GetDesktopWindow(), "Unexpected window %p.\n", device_params.hFocusWindow);
hr = IDirect3DDevice9_GetSwapChain(d3d_device, 0, &swapchain);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &present_params);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(present_params.hDeviceWindow == GetDesktopWindow(), "Unexpected device window.\n");
ok(present_params.Windowed, "Unexpected windowed mode.\n");
ok(present_params.SwapEffect == D3DSWAPEFFECT_COPY, "Unexpected swap effect.\n");
- ok(present_params.Flags & D3DPRESENTFLAG_VIDEO, "Unexpected flags %#x.\n", present_params.Flags);
+ ok(present_params.Flags & D3DPRESENTFLAG_VIDEO, "Unexpected flags %#lx.\n", present_params.Flags);
ok(present_params.PresentationInterval == D3DPRESENT_INTERVAL_IMMEDIATE, "Unexpected present interval.\n");
IDirect3DSwapChain9_Release(swapchain);
IDirect3DDevice9_Release(d3d_device);
hr = IDirect3DDeviceManager9_UnlockDevice(dm, hdevice, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Setting window. */
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &window);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!window, "Unexpected window %p.\n", window);
window = create_window();
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, window);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Device is not recreated or reset on window change. */
hr = IDirect3DDeviceManager9_LockDevice(dm, hdevice, &d3d_device, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDevice9_GetSwapChain(d3d_device, 0, &swapchain);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &present_params);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(present_params.hDeviceWindow == GetDesktopWindow(), "Unexpected device window.\n");
ok(present_params.Windowed, "Unexpected windowed mode.\n");
ok(present_params.SwapEffect == D3DSWAPEFFECT_COPY, "Unexpected swap effect.\n");
- ok(present_params.Flags & D3DPRESENTFLAG_VIDEO, "Unexpected flags %#x.\n", present_params.Flags);
+ ok(present_params.Flags & D3DPRESENTFLAG_VIDEO, "Unexpected flags %#lx.\n", present_params.Flags);
ok(present_params.PresentationInterval == D3DPRESENT_INTERVAL_IMMEDIATE, "Unexpected present interval.\n");
IDirect3DSwapChain9_Release(swapchain);
IDirect3DDevice9_Release(d3d_device);
hr = IDirect3DDeviceManager9_UnlockDevice(dm, hdevice, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, hdevice);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFVideoDisplayControl_Release(display_control);
@@ -2254,31 +2256,31 @@ static void test_presenter_quality_control(void)
HRESULT hr;
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdviseLimits, (void **)&qa_limits);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdvise, (void **)&advise);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFQualityAdviseLimits_GetMaximumDropMode(qa_limits, NULL);
todo_wine
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFQualityAdviseLimits_GetMaximumDropMode(qa_limits, &mode);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
hr = IMFQualityAdviseLimits_GetMinimumQualityLevel(qa_limits, NULL);
todo_wine
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFQualityAdviseLimits_GetMinimumQualityLevel(qa_limits, &level);
todo_wine
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
ok(level == MF_QUALITY_NORMAL, "Unexpected level %d.\n", level);
@@ -2287,31 +2289,31 @@ static void test_presenter_quality_control(void)
todo_wine {
mode = 1;
hr = IMFQualityAdvise_GetDropMode(advise, &mode);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
level = 1;
hr = IMFQualityAdvise_GetQualityLevel(advise, &level);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(level == MF_QUALITY_NORMAL, "Unexpected mode %d.\n", level);
hr = IMFQualityAdvise_SetDropMode(advise, MF_DROP_MODE_1);
- ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_MORE_DROP_MODES, "Unexpected hr %#lx.\n", hr);
hr = IMFQualityAdvise_SetQualityLevel(advise, MF_QUALITY_NORMAL_MINUS_1);
- ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_MORE_QUALITY_LEVELS, "Unexpected hr %#lx.\n", hr);
}
IMFQualityAdvise_Release(advise);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IQualProp, (void **)&qual_prop);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IQualProp_get_FramesDrawn(qual_prop, NULL);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IQualProp_get_FramesDrawn(qual_prop, &frame_count);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
IQualProp_Release(qual_prop);
@@ -2328,16 +2330,16 @@ static void get_output_aperture(IMFTransform *mixer, SIZE *frame_size, MFVideoAr
memset(aperture, 0xcc, sizeof(*aperture));
hr = IMFTransform_GetOutputCurrentType(mixer, 0, &media_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_GetUINT64(media_type, &MF_MT_FRAME_SIZE, &size);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
frame_size->cx = size >> 32;
frame_size->cy = size;
hr = IMFMediaType_GetBlob(media_type, &MF_MT_GEOMETRIC_APERTURE, (UINT8 *)aperture, sizeof(*aperture), NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaType_Release(media_type);
}
@@ -2367,74 +2369,74 @@ static void test_presenter_media_type(void)
}
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
input_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFMediaType_SetUINT64(input_type, &MF_MT_FRAME_SIZE, (UINT64)100 << 32 | 50);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(input_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
init_test_host(&host, mixer, presenter);
hr = IMFTopologyServiceLookupClient_InitServicePointers(lookup_client, &host.IMFTopologyServiceLookup_iface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, window);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Set destination rectangle before mixer types are configured. */
SetRect(&dst, 0, 0, 101, 51);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, input_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
- ok(frame_size.cx == 101 && frame_size.cy == 51, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
- ok(aperture.Area.cx == 101 && aperture.Area.cy == 51, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
+ ok(frame_size.cx == 101 && frame_size.cy == 51, "Unexpected frame size %lu x %lu.\n", frame_size.cx, frame_size.cy);
+ ok(aperture.Area.cx == 101 && aperture.Area.cy == 51, "Unexpected size %lu x %lu.\n", aperture.Area.cx, aperture.Area.cy);
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);
SetRect(&dst, 1, 2, 200, 300);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
- ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
- ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
+ ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %lu x %lu.\n", frame_size.cx, frame_size.cy);
+ ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %lu x %lu.\n", aperture.Area.cx, aperture.Area.cy);
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);
hr = IMFVideoDisplayControl_SetAspectRatioMode(display_control, MFVideoARMode_None);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
- ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
- ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
+ ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %lu x %lu.\n", frame_size.cx, frame_size.cy);
+ ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %lu x %lu.\n", aperture.Area.cx, aperture.Area.cy);
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);
@@ -2466,80 +2468,80 @@ static void test_presenter_shutdown(void)
ok(!!window, "Failed to create test window.\n");
hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter);
- ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create default presenter, hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDeviceID, (void **)&deviceid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&display_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IQualProp, (void **)&qual_prop);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTopologyServiceLookupClient_ReleaseServicePointers(lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_BEGINSTREAMING, 0);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_ENDSTREAMING, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_PROCESSINPUTNOTIFY, 0);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoPresenter_GetCurrentMediaType(presenter, &media_type);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDeviceID_GetDeviceID(deviceid, &iid);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetNativeVideoSize(display_control, &size, &size);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetIdealVideoSize(display_control, &size, &size);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
SetRect(&rect, 0, 0, 10, 10);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &rect);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetVideoPosition(display_control, NULL, &rect);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetAspectRatioMode(display_control, MFVideoARMode_None);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetAspectRatioMode(display_control, &mode);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, window);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &rect);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &window2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoDisplayControl_RepaintVideo(display_control);
- ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IQualProp_get_FramesDrawn(qual_prop, NULL);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IQualProp_get_FramesDrawn(qual_prop, &frame_count);
- ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = IMFTopologyServiceLookupClient_ReleaseServicePointers(lookup_client);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IQualProp_Release(qual_prop);
IMFVideoDeviceID_Release(deviceid);
@@ -2559,52 +2561,52 @@ static void test_mixer_output_rectangle(void)
HRESULT hr;
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoMixerControl, (void **)&mixer_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_GetStreamOutputRect(mixer_control, 0, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
set_rect(&rect, 0.0f, 0.0f, 0.0f, 0.0f);
hr = IMFVideoMixerControl_GetStreamOutputRect(mixer_control, 0, &rect);
- ok(hr == S_OK, "Failed to get output rect, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get output rect, hr %#lx.\n", hr);
ok(rect.left == 0.0f && rect.top == 0.0f && rect.right == 1.0f && rect.bottom == 1.0f,
"Unexpected rectangle.\n");
hr = IMFVideoMixerControl_GetStreamOutputRect(mixer_control, 1, &rect);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_GetStreamOutputRect(mixer_control, 1, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 1, &rect);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 1, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
/* Wrong bounds. */
set_rect(&rect, 0.0f, 0.0f, 1.1f, 1.0f);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 0, &rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
set_rect(&rect, -0.1f, 0.0f, 0.5f, 1.0f);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 0, &rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Flipped. */
set_rect(&rect, 1.0f, 0.0f, 0.0f, 1.0f);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 0, &rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
set_rect(&rect, 0.0f, 1.0f, 1.0f, 0.5f);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 0, &rect);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamOutputRect(mixer_control, 0, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
IMFVideoMixerControl_Release(mixer_control);
IMFTransform_Release(mixer);
@@ -2619,96 +2621,96 @@ static void test_mixer_zorder(void)
HRESULT hr;
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoMixerControl, (void **)&mixer_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 0, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 1, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
value = 1;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 0, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!value, "Unexpected value %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!value, "Unexpected value %lu.\n", value);
value = 1;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 1, &value);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 0, 1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 1, 1);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* Exceeds maximum stream number. */
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 0, 20);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
value = 1;
hr = IMFTransform_AddInputStreams(mixer, 1, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 1, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(value == 1, "Unexpected zorder %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 1, "Unexpected zorder %lu.\n", value);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 1, 0);
- ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 1, 2);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 0, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 2;
hr = IMFTransform_AddInputStreams(mixer, 1, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 2, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(value == 2, "Unexpected zorder %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 2, "Unexpected zorder %lu.\n", value);
hr = IMFVideoMixerControl_SetStreamZOrder(mixer_control, 2, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 3;
hr = IMFTransform_AddInputStreams(mixer, 1, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 3, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(value == 3, "Unexpected zorder %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 3, "Unexpected zorder %lu.\n", value);
hr = IMFTransform_DeleteInputStream(mixer, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_DeleteInputStream(mixer, 2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_DeleteInputStream(mixer, 3);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ids[0] = 2;
ids[1] = 1;
hr = IMFTransform_AddInputStreams(mixer, 2, ids);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
value = 0;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 1, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(value == 2, "Unexpected zorder %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 2, "Unexpected zorder %lu.\n", value);
value = 0;
hr = IMFVideoMixerControl_GetStreamZOrder(mixer_control, 2, &value);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(value == 1, "Unexpected zorder %u.\n", value);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(value == 1, "Unexpected zorder %lu.\n", value);
IMFVideoMixerControl_Release(mixer_control);
IMFTransform_Release(mixer);
@@ -2724,31 +2726,31 @@ static IDirect3DSurface9 * create_surface(IDirect3DDeviceManager9 *manager, unsi
HRESULT hr;
hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_LockDevice(manager, handle, &device, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, &IID_IDirectXVideoProcessorService,
(void **)&service);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirectXVideoAccelerationService_CreateSurface(service, width, height, 0, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, 0, DXVA2_VideoProcessorRenderTarget, &surface, NULL);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirectXVideoAccelerationService_Release(service);
hr = IDirect3DDevice9_ColorFill(device, surface, NULL, D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00));
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IDirect3DDevice9_Release(device);
hr = IDirect3DDeviceManager9_UnlockDevice(manager, handle, FALSE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
return surface;
}
@@ -2762,18 +2764,18 @@ static DWORD get_surface_color(IDirect3DSurface9 *surface, unsigned int x, unsig
HRESULT hr;
hr = IDirect3DSurface9_GetDesc(surface, &desc);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(x < desc.Width && y < desc.Height, "Invalid coordinate.\n");
if (x >= desc.Width || y >= desc.Height) return 0;
hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
row = (DWORD *)((char *)locked_rect.pBits + y * locked_rect.Pitch);
color = row[x];
hr = IDirect3DSurface9_UnlockRect(surface);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
return color;
}
@@ -2787,13 +2789,14 @@ static void test_mixer_samples(void)
IMFDesiredSample *desired;
IDirect3DDevice9 *device;
IMFMediaType *video_type;
- DWORD count, flags, color, status;
+ DWORD flags, color, status;
IMFTransform *mixer;
IMFSample *sample, *sample2;
HWND window;
UINT token;
HRESULT hr;
LONGLONG pts, duration;
+ UINT32 count;
window = create_window();
if (!(device = create_device(window)))
@@ -2803,217 +2806,217 @@ static void test_mixer_samples(void)
}
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoProcessor, (void **)&processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputStatus(mixer, 0, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputStatus(mixer, 1, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputStatus(mixer, 0, &status);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputStatus(mixer, 1, &status);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputStatus(mixer, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
/* Configure device and media types. */
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Failed to set a device, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set a device, hr %#lx.\n", hr);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
video_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64)640 << 32 | 480);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputStatus(mixer, 0, &status);
- ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(mixer, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
status = 0;
hr = IMFTransform_GetInputStatus(mixer, 0, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#lx.\n", status);
hr = IMFTransform_GetInputStatus(mixer, 1, &status);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
status = ~0u;
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!status, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!status, "Unexpected status %#lx.\n", status);
IMFMediaType_Release(video_type);
memset(buffers, 0, sizeof(buffers));
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
/* It needs a sample with a backing surface. */
hr = MFCreateSample(&sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
buffers[0].pSample = sample;
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
IMFSample_Release(sample);
surface = create_surface(manager, 64, 64);
hr = MFCreateVideoSampleFromSurface((IUnknown *)surface, &sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_QueryInterface(sample, &IID_IMFDesiredSample, (void **)&desired);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
buffers[0].pSample = sample;
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "Unexpected hr %#lx.\n", hr);
color = get_surface_color(surface, 0, 0);
- ok(color == D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00), "Unexpected color %#x.\n", color);
+ ok(color == D3DCOLOR_ARGB(0x10, 0xff, 0x00, 0x00), "Unexpected color %#lx.\n", color);
/* Streaming is not started yet. Output is colored black, but only if desired timestamps were set. */
IMFDesiredSample_SetDesiredSampleTimeAndDuration(desired, 100, 0);
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
color = get_surface_color(surface, 0, 0);
- ok(!color, "Unexpected color %#x.\n", color);
+ ok(!color, "Unexpected color %#lx.\n", color);
hr = IMFVideoProcessor_SetBackgroundColor(processor, RGB(0, 0, 255));
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
color = get_surface_color(surface, 0, 0);
- ok(!color, "Unexpected color %#x.\n", color);
+ ok(!color, "Unexpected color %#lx.\n", color);
hr = IMFTransform_ProcessOutput(mixer, 0, 2, buffers, &status);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
buffers[1].pSample = sample;
hr = IMFTransform_ProcessOutput(mixer, 0, 2, buffers, &status);
- ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
buffers[0].dwStreamID = 1;
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
IMFDesiredSample_Clear(desired);
hr = IMFTransform_ProcessInput(mixer, 0, NULL, 0);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessInput(mixer, 5, NULL, 0);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
status = 0;
hr = IMFTransform_GetInputStatus(mixer, 0, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(status == MFT_INPUT_STATUS_ACCEPT_DATA, "Unexpected status %#lx.\n", status);
status = ~0u;
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!status, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!status, "Unexpected status %#lx.\n", status);
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
status = ~0u;
hr = IMFTransform_GetInputStatus(mixer, 0, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!status, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!status, "Unexpected status %#lx.\n", status);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#lx.\n", status);
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
- ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_ProcessInput(mixer, 5, sample, 0);
- ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
/* ProcessOutput() sets sample time and duration. */
hr = MFCreateVideoSampleFromSurface((IUnknown *)surface, &sample2);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetUINT32(sample2, &IID_IMFSample, 1);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleFlags(sample2, 0x123);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleTime(sample2, &pts);
- ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleDuration(sample2, &duration);
- ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#x.\n", hr);
+ ok(hr == MF_E_NO_SAMPLE_DURATION, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleTime(sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_SetSampleDuration(sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
memset(buffers, 0, sizeof(buffers));
buffers[0].pSample = sample2;
hr = IMFTransform_ProcessOutput(mixer, 0, 1, buffers, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetSampleTime(sample2, &pts);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!pts, "Unexpected sample time.\n");
hr = IMFSample_GetSampleDuration(sample2, &duration);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!duration, "Unexpected duration\n");
/* Flags are not copied. */
hr = IMFSample_GetSampleFlags(sample2, &flags);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(flags == 0x123, "Unexpected flags %#x.\n", flags);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(flags == 0x123, "Unexpected flags %#lx.\n", flags);
/* Attributes are not removed. */
hr = IMFSample_GetCount(sample2, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(count == 1, "Unexpected attribute count %u.\n", count);
hr = IMFSample_GetCount(sample, &count);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!count, "Unexpected attribute count %u.\n", count);
IMFSample_Release(sample2);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_COMMAND_DRAIN, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFSample_Release(sample);
@@ -3093,39 +3096,39 @@ static void test_mixer_render(void)
}
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&mixer);
- ok(hr == S_OK, "Failed to create a mixer, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a mixer, hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoProcessor, (void **)&processor);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(mixer, &IID_IMFVideoMixerControl, (void **)&mixer_control);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
/* Configure device and media types. */
hr = DXVA2CreateDirect3DDeviceManager9(&token, &manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token);
- ok(hr == S_OK, "Failed to set a device, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set a device, hr %#lx.\n", hr);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
video_type = create_video_type(&MFVideoFormat_RGB32);
hr = IMFMediaType_SetUINT64(video_type, &MF_MT_FRAME_SIZE, (UINT64)64 << 32 | 64);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaType_SetUINT32(video_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, video_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(mixer, 0, 0, &output_type);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_SetOutputType(mixer, 0, output_type, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaType_Release(output_type);
IMFMediaType_Release(video_type);
@@ -3134,41 +3137,41 @@ static void test_mixer_render(void)
ok(!!surface, "Failed to create input surface.\n");
hr = MFCreateVideoSampleFromSurface((IUnknown *)surface, &sample);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(sample, 1);
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(sample, 2);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#lx.\n", status);
/* FLUSH/END_STREAMING releases input */
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_NOTIFY_END_STREAMING, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(sample, 1);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!status, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!status, "Unexpected status %#lx.\n", status);
hr = IMFTransform_ProcessInput(mixer, 0, sample, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(sample, 2);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(status == MFT_OUTPUT_STATUS_SAMPLE_READY, "Unexpected status %#lx.\n", status);
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_COMMAND_FLUSH, 0);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
EXPECT_REF(sample, 1);
hr = IMFTransform_GetOutputStatus(mixer, &status);
- ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(!status, "Unexpected status %#x.\n", status);
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+ ok(!status, "Unexpected status %#lx.\n", status);
IMFSample_Release(sample);
IDirect3DSurface9_Release(surface);
@@ -3190,7 +3193,7 @@ START_TEST(evr)
if (FAILED(hr = MFCreateVideoPresenter(NULL, &IID_IDirect3DDevice9, &IID_IMFVideoPresenter, (void **)&presenter)))
{
- win_skip("Failed to create default presenter, hr %#x. Skipping tests.\n", hr);
+ win_skip("Failed to create default presenter, hr %#lx. Skipping tests.\n", hr);
CoUninitialize();
return;
}
--
2.34.1
1
0
[PATCH 7/7] comctl32/button: Use the brush from WM_CTLCOLORSTATIC to fill text background for group boxes.
by Zhiyi Zhang 09 Feb '22
by Zhiyi Zhang 09 Feb '22
09 Feb '22
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/button.c | 13 ++++++++++++-
dlls/comctl32/tests/misc.c | 3 +--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 1349e10c4c0..2ce12252460 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -2914,10 +2914,20 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
HFONT font, hPrevFont = NULL;
BOOL created_font = FALSE;
TEXTMETRICW textMetric;
+ HBRUSH brush;
+ HWND parent;
+ HRESULT hr;
LONG style;
int part;
- HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
+ /* DrawThemeParentBackground() is used for filling content background. The brush from
+ * WM_CTLCOLORSTATIC is used for filling text background */
+ parent = GetParent(infoPtr->hwnd);
+ if (!parent)
+ parent = infoPtr->hwnd;
+ brush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)infoPtr->hwnd);
+
+ hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
if (SUCCEEDED(hr)) {
font = CreateFontIndirectW(&lf);
if (!font)
@@ -2969,6 +2979,7 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
SelectClipRgn(hDC, textRegion);
DeleteObject(textRegion);
}
+ FillRect(hDC, &textRect, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
BUTTON_DrawThemedLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect, theme, part, state);
}
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index c3de9e68c5a..dc9648c1bf0 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -848,7 +848,7 @@ static void test_themed_background(void)
{WC_BUTTONA, BS_RADIOBUTTON, radiobutton_seq},
{WC_BUTTONA, BS_3STATE, checkbox_seq},
{WC_BUTTONA, BS_AUTO3STATE, checkbox_seq},
- {WC_BUTTONA, BS_GROUPBOX, groupbox_seq, TRUE},
+ {WC_BUTTONA, BS_GROUPBOX, groupbox_seq},
{WC_BUTTONA, BS_USERBUTTON, pushbutton_seq},
{WC_BUTTONA, BS_AUTORADIOBUTTON, radiobutton_seq},
{WC_BUTTONA, BS_PUSHBOX, radiobutton_seq, TRUE},
@@ -962,7 +962,6 @@ static void test_themed_background(void)
/* WM_CTLCOLORSTATIC is used to fill text background */
color = GetPixel(hdc, 10, 10);
- todo_wine
ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
}
--
2.32.0
1
0
[PATCH 5/7] comctl32/button: Use the brush from WM_CTLCOLORBTN to fill background for push buttons.
by Zhiyi Zhang 09 Feb '22
by Zhiyi Zhang 09 Feb '22
09 Feb '22
The brush from WM_CTLCOLORBTN is used for filling background for push buttons after a DrawThemeParentBackground() call
according to tests.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/button.c | 7 +++++++
dlls/comctl32/tests/misc.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 88b48a4a5c0..14b2200afed 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -2729,6 +2729,7 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
{
RECT bgRect, labelRect, imageRect, textRect, focusRect;
NMCUSTOMDRAW nmcd;
+ HBRUSH brush;
LRESULT cdrf;
HWND parent;
@@ -2748,7 +2749,13 @@ static void PB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
if (cdrf & CDRF_SKIPDEFAULT) return;
if (IsThemeBackgroundPartiallyTransparent(theme, BP_PUSHBUTTON, state))
+ {
DrawThemeParentBackground(infoPtr->hwnd, hDC, NULL);
+ /* Tests show that the brush from WM_CTLCOLORBTN is used for filling background after a
+ * DrawThemeParentBackground() call */
+ brush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)infoPtr->hwnd);
+ FillRect(hDC, &bgRect, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
+ }
DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL);
if (cdrf & CDRF_NOTIFYPOSTERASE)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index 72674ea5942..09c5b3d6c40 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -841,15 +841,15 @@ static void test_themed_background(void)
tests[] =
{
{ANIMATE_CLASSA, 0, empty_seq, TRUE},
- {WC_BUTTONA, BS_PUSHBUTTON, pushbutton_seq, TRUE},
- {WC_BUTTONA, BS_DEFPUSHBUTTON, defpushbutton_seq, TRUE},
+ {WC_BUTTONA, BS_PUSHBUTTON, pushbutton_seq},
+ {WC_BUTTONA, BS_DEFPUSHBUTTON, defpushbutton_seq},
{WC_BUTTONA, BS_CHECKBOX, checkbox_seq, TRUE},
{WC_BUTTONA, BS_AUTOCHECKBOX, checkbox_seq, TRUE},
{WC_BUTTONA, BS_RADIOBUTTON, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_3STATE, checkbox_seq, TRUE},
{WC_BUTTONA, BS_AUTO3STATE, checkbox_seq, TRUE},
{WC_BUTTONA, BS_GROUPBOX, groupbox_seq, TRUE},
- {WC_BUTTONA, BS_USERBUTTON, pushbutton_seq, TRUE},
+ {WC_BUTTONA, BS_USERBUTTON, pushbutton_seq},
{WC_BUTTONA, BS_AUTORADIOBUTTON, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_PUSHBOX, radiobutton_seq, TRUE},
{WC_BUTTONA, BS_OWNERDRAW, ownerdrawbutton_seq},
--
2.32.0
1
0
[PATCH 4/7] comctl32/trackbar: Always use brush from WM_CTLCOLORSTATIC to fill background.
by Zhiyi Zhang 09 Feb '22
by Zhiyi Zhang 09 Feb '22
09 Feb '22
Fix the track bar of Mupen64-RR-Lua input window having black background. Mupen64-RR-Lua doesn't actually handle
WM_ERASEBKGND even though it returns nonzero. And tests show that only WM_CTLCOLORSTATIC is sent when drawing themed
trackbar background.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/misc.c | 2 +-
dlls/comctl32/trackbar.c | 12 ++++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index 3a1b5253b58..72674ea5942 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -883,7 +883,7 @@ static void test_themed_background(void)
{WC_TABCONTROLA, 0, drawthemeparentbackground_seq, TRUE},
{TOOLBARCLASSNAMEA, 0, empty_seq, TRUE},
{TOOLTIPS_CLASSA, 0, empty_seq},
- {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq, TRUE},
+ {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq},
{WC_TREEVIEWA, 0, treeview_seq},
{UPDOWN_CLASSA, 0, empty_seq},
{WC_SCROLLBARA, 0, scrollbar_seq, TRUE},
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c
index 6643752c043..f2cb2a07a8d 100644
--- a/dlls/comctl32/trackbar.c
+++ b/dlls/comctl32/trackbar.c
@@ -899,6 +899,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
NMCUSTOMDRAW nmcd;
int gcdrf, icdrf;
+ HBRUSH brush;
if (infoPtr->flags & TB_THUMBCHANGED) {
TRACKBAR_UpdateThumb (infoPtr);
@@ -943,14 +944,9 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
/* Erase background */
if (gcdrf == CDRF_DODEFAULT ||
notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) {
- if (GetWindowTheme (infoPtr->hwndSelf)) {
- DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0);
- }
- else {
- HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
- (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
- FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
- }
+ brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC, (WPARAM)hdc,
+ (LPARAM)infoPtr->hwndSelf);
+ FillRect(hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
if (gcdrf != CDRF_DODEFAULT)
notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
}
--
2.32.0
1
0
Add themed background tests to determine whether DrawThemeParentBackground()
or WM_CTLCOLOR* are used to draw themed background for comctl32 classes.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/misc.c | 327 +++++++++++++++++++++++++++++++++++++
1 file changed, 327 insertions(+)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index 4628e37bb7a..3a1b5253b58 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -46,6 +46,7 @@ static HMODULE hComctl32;
enum seq_index
{
CHILD_SEQ_INDEX,
+ PARENT_SEQ_INDEX,
NUM_MSG_SEQUENCES
};
@@ -652,6 +653,331 @@ static void test_WM_SYSCOLORCHANGE(void)
DestroyWindow(parent);
}
+static const struct message empty_seq[] =
+{
+ {0}
+};
+
+static const struct message wm_erasebkgnd_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {0}
+};
+
+static const struct message wm_ctlcolorstatic_seq[] =
+{
+ {WM_CTLCOLORSTATIC, sent},
+ {0}
+};
+
+static const struct message drawthemeparentbackground_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ {0}
+};
+
+static const struct message drawthemeparentbackground_optional_seq[] =
+{
+ {WM_ERASEBKGND, sent | optional},
+ {WM_PRINTCLIENT, sent | optional},
+ {0}
+};
+
+static const struct message pushbutton_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ {WM_CTLCOLORBTN, sent},
+ {0}
+};
+
+static const struct message defpushbutton_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ {WM_CTLCOLORBTN, sent},
+ {WM_ERASEBKGND, sent | optional},
+ {WM_PRINTCLIENT, sent | optional},
+ {WM_CTLCOLORBTN, sent | optional},
+ {0}
+};
+
+static const struct message checkbox_seq[] =
+{
+ {WM_ERASEBKGND, sent | optional},
+ {WM_PRINTCLIENT, sent | optional},
+ {WM_CTLCOLORSTATIC, sent},
+ {0}
+};
+
+static const struct message radiobutton_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ {WM_CTLCOLORSTATIC, sent},
+ {0}
+};
+
+static const struct message groupbox_seq[] =
+{
+ {WM_CTLCOLORSTATIC, sent},
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ {0}
+};
+
+static const struct message ownerdrawbutton_seq[] =
+{
+ {WM_CTLCOLORBTN, sent},
+ {WM_CTLCOLORBTN, sent},
+ {0}
+};
+
+static const struct message splitbutton_seq[] =
+{
+ {WM_ERASEBKGND, sent},
+ {WM_PRINTCLIENT, sent},
+ /* Either WM_CTLCOLORSTATIC or WM_CTLCOLORBTN */
+ {WM_CTLCOLORSTATIC, sent | optional},
+ {WM_CTLCOLORBTN, sent | optional},
+ /* BS_DEFSPLITBUTTON or BS_DEFCOMMANDLINK */
+ {WM_ERASEBKGND, sent | optional},
+ {WM_PRINTCLIENT, sent | optional},
+ {WM_CTLCOLORSTATIC, sent | optional},
+ {WM_CTLCOLORBTN, sent | optional},
+ {0}
+};
+
+static const struct message combobox_seq[] =
+{
+ {WM_ERASEBKGND, sent | optional},
+ {WM_PRINTCLIENT, sent | optional},
+ {WM_CTLCOLOREDIT, sent},
+ {WM_CTLCOLORLISTBOX, sent},
+ {WM_CTLCOLORLISTBOX, sent | optional},
+ {WM_CTLCOLOREDIT, sent | optional},
+ {WM_CTLCOLOREDIT, sent | optional},
+ {0}
+};
+
+static const struct message edit_seq[] =
+{
+ {WM_CTLCOLOREDIT, sent},
+ {WM_CTLCOLOREDIT, sent | optional},
+ {0}
+};
+
+static const struct message listbox_seq[] =
+{
+ {WM_CTLCOLORLISTBOX, sent},
+ {WM_CTLCOLORLISTBOX, sent},
+ {0}
+};
+
+static const struct message treeview_seq[] =
+{
+ {WM_CTLCOLOREDIT, sent | optional},
+ {WM_CTLCOLOREDIT, sent | optional},
+ {0}
+};
+
+static const struct message scrollbar_seq[] =
+{
+ {WM_CTLCOLORSCROLLBAR, sent},
+ {WM_CTLCOLORSCROLLBAR, sent | optional},
+ {0}
+};
+
+static LRESULT WINAPI test_themed_background_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
+{
+ struct message msg = {0};
+ HBRUSH brush;
+ RECT rect;
+
+ if (message == WM_ERASEBKGND || message == WM_PRINTCLIENT || (message >= WM_CTLCOLORMSGBOX
+ && message <= WM_CTLCOLORSTATIC))
+ {
+ msg.message = message;
+ msg.flags = sent;
+ add_message(sequences, PARENT_SEQ_INDEX, &msg);
+ }
+
+ if (message == WM_ERASEBKGND)
+ {
+ brush = CreateSolidBrush(RGB(255, 0, 0));
+ GetClientRect(hwnd, &rect);
+ FillRect((HDC)wp, &rect, brush);
+ DeleteObject(brush);
+ return 1;
+ }
+ else if (message >= WM_CTLCOLORMSGBOX && message <= WM_CTLCOLORSTATIC)
+ {
+ return (LRESULT)GetStockObject(GRAY_BRUSH);
+ }
+
+ return DefWindowProcA(hwnd, message, wp, lp);
+}
+
+static void test_themed_background(void)
+{
+ DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
+ DPI_AWARENESS_CONTEXT old_context = NULL;
+ BOOL (WINAPI *pIsThemeActive)(void);
+ HWND child, parent;
+ HMODULE uxtheme;
+ COLORREF color;
+ WNDCLASSA cls;
+ HDC hdc;
+ int i;
+
+ static const struct test
+ {
+ const CHAR *class_name;
+ DWORD style;
+ const struct message *seq;
+ BOOL todo;
+ }
+ tests[] =
+ {
+ {ANIMATE_CLASSA, 0, empty_seq, TRUE},
+ {WC_BUTTONA, BS_PUSHBUTTON, pushbutton_seq, TRUE},
+ {WC_BUTTONA, BS_DEFPUSHBUTTON, defpushbutton_seq, TRUE},
+ {WC_BUTTONA, BS_CHECKBOX, checkbox_seq, TRUE},
+ {WC_BUTTONA, BS_AUTOCHECKBOX, checkbox_seq, TRUE},
+ {WC_BUTTONA, BS_RADIOBUTTON, radiobutton_seq, TRUE},
+ {WC_BUTTONA, BS_3STATE, checkbox_seq, TRUE},
+ {WC_BUTTONA, BS_AUTO3STATE, checkbox_seq, TRUE},
+ {WC_BUTTONA, BS_GROUPBOX, groupbox_seq, TRUE},
+ {WC_BUTTONA, BS_USERBUTTON, pushbutton_seq, TRUE},
+ {WC_BUTTONA, BS_AUTORADIOBUTTON, radiobutton_seq, TRUE},
+ {WC_BUTTONA, BS_PUSHBOX, radiobutton_seq, TRUE},
+ {WC_BUTTONA, BS_OWNERDRAW, ownerdrawbutton_seq},
+ {WC_BUTTONA, BS_SPLITBUTTON, splitbutton_seq},
+ {WC_BUTTONA, BS_DEFSPLITBUTTON, splitbutton_seq},
+ {WC_BUTTONA, BS_COMMANDLINK, splitbutton_seq},
+ {WC_BUTTONA, BS_DEFCOMMANDLINK, splitbutton_seq},
+ {WC_COMBOBOXA, 0, combobox_seq, TRUE},
+ {WC_COMBOBOXEXA, 0, drawthemeparentbackground_optional_seq},
+ {DATETIMEPICK_CLASSA, 0, drawthemeparentbackground_optional_seq, TRUE},
+ {WC_EDITA, 0, edit_seq},
+ {WC_HEADERA, 0, empty_seq},
+ {HOTKEY_CLASSA, 0, empty_seq, TRUE},
+ {WC_IPADDRESSA, 0, empty_seq},
+ {WC_LISTBOXA, 0, listbox_seq, TRUE},
+ {WC_LISTVIEWA, 0, empty_seq},
+ {MONTHCAL_CLASSA, 0, empty_seq},
+ {WC_NATIVEFONTCTLA, 0, empty_seq},
+ {WC_PAGESCROLLERA, 0, wm_erasebkgnd_seq},
+ {PROGRESS_CLASSA, 0, drawthemeparentbackground_optional_seq},
+ {REBARCLASSNAMEA, 0, empty_seq},
+ {WC_STATICA, SS_LEFT, wm_ctlcolorstatic_seq},
+ {WC_STATICA, SS_ICON, wm_ctlcolorstatic_seq},
+ {WC_STATICA, SS_BLACKRECT, wm_ctlcolorstatic_seq, TRUE},
+ {WC_STATICA, SS_OWNERDRAW, wm_ctlcolorstatic_seq},
+ {WC_STATICA, SS_BITMAP, wm_ctlcolorstatic_seq},
+ {WC_STATICA, SS_ENHMETAFILE, wm_ctlcolorstatic_seq},
+ {WC_STATICA, SS_ETCHEDHORZ, wm_ctlcolorstatic_seq, TRUE},
+ {STATUSCLASSNAMEA, 0, empty_seq},
+ {"SysLink", 0, wm_ctlcolorstatic_seq},
+ {WC_TABCONTROLA, 0, drawthemeparentbackground_seq, TRUE},
+ {TOOLBARCLASSNAMEA, 0, empty_seq, TRUE},
+ {TOOLTIPS_CLASSA, 0, empty_seq},
+ {TRACKBAR_CLASSA, 0, wm_ctlcolorstatic_seq, TRUE},
+ {WC_TREEVIEWA, 0, treeview_seq},
+ {UPDOWN_CLASSA, 0, empty_seq},
+ {WC_SCROLLBARA, 0, scrollbar_seq, TRUE},
+ {WC_SCROLLBARA, SBS_SIZEBOX, empty_seq, TRUE},
+ {WC_SCROLLBARA, SBS_SIZEGRIP, empty_seq, TRUE},
+ };
+
+ uxtheme = LoadLibraryA("uxtheme.dll");
+ pIsThemeActive = (void *)GetProcAddress(uxtheme, "IsThemeActive");
+ if (!pIsThemeActive())
+ {
+ skip("Theming is inactive.\n");
+ FreeLibrary(uxtheme);
+ return;
+ }
+ FreeLibrary(uxtheme);
+
+ pSetThreadDpiAwarenessContext = (void *)GetProcAddress(GetModuleHandleA("user32.dll"),
+ "SetThreadDpiAwarenessContext");
+ if (pSetThreadDpiAwarenessContext)
+ pSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
+
+ memset(&cls, 0, sizeof(cls));
+ cls.hInstance = GetModuleHandleA(0);
+ cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
+ cls.hbrBackground = GetStockObject(WHITE_BRUSH);
+ cls.lpfnWndProc = test_themed_background_proc;
+ cls.lpszClassName = "ParentClass";
+ RegisterClassA(&cls);
+
+ parent = CreateWindowA(cls.lpszClassName, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100,
+ 0, 0, 0, 0);
+ ok(parent != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ winetest_push_context("%s %#x", tests[i].class_name, tests[i].style);
+
+ child = CreateWindowA(tests[i].class_name, " ", WS_CHILD | WS_VISIBLE | tests[i].style,
+ 0, 0, 50, 50, parent, 0, 0, 0);
+ ok(child != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
+ flush_events();
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+
+ RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, tests[i].seq, "paint background", tests[i].todo);
+
+ /* For message sequences that contain both DrawThemeParentBackground() messages and
+ * WM_CTLCOLOR*, do a color test to check which is really in effect for controls that can be
+ * tested automatically. For WM_ERASEBKGND from DrawThemeParentBackground(), a red brush is
+ * used. For WM_CTLCOLOR*, a gray brush is returned. If there are only WM_CTLCOLOR* messages
+ * in the message sequence, then surely DrawThemeParentBackground() is not used.
+ *
+ * For tests that use pushbutton_seq and defpushbutton_seq, manual tests on XP show that
+ * a brush from WM_CTLCOLORBTN is used to fill background even after a successful
+ * DrawThemeParentBackground(). This behavior can be verified by returning a gray or hollow
+ * brush in test_themed_background_proc() when handling WM_CTLCOLORBTN. It can't be tested
+ * automatically here because stock Windows themes don't use transparent button bitmaps */
+ if (tests[i].seq == radiobutton_seq || tests[i].seq == groupbox_seq)
+ {
+ hdc = GetDC(child);
+
+ if (tests[i].seq == radiobutton_seq)
+ {
+ /* WM_CTLCOLORSTATIC is used to fill background */
+ color = GetPixel(hdc, 40, 40);
+ todo_wine
+ ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
+ }
+ else if (tests[i].seq == groupbox_seq)
+ {
+ /* DrawThemeParentBackground() is used to fill content background */
+ color = GetPixel(hdc, 40, 40);
+ ok(color == 0xff, "Expected color %#x, got %#x.\n", 0xff, color);
+
+ /* WM_CTLCOLORSTATIC is used to fill text background */
+ color = GetPixel(hdc, 10, 10);
+ todo_wine
+ ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
+ }
+
+ ReleaseDC(child, hdc);
+ }
+
+ DestroyWindow(child);
+ winetest_pop_context();
+ }
+
+ DestroyWindow(parent);
+ UnregisterClassA(cls.lpszClassName, GetModuleHandleA(0));
+ if (pSetThreadDpiAwarenessContext)
+ pSetThreadDpiAwarenessContext(old_context);
+}
+
START_TEST(misc)
{
ULONG_PTR ctx_cookie;
@@ -675,6 +1001,7 @@ START_TEST(misc)
test_comctl32_classes(TRUE);
test_builtin_classes();
test_LoadIconWithScaleDown();
+ test_themed_background();
test_WM_THEMECHANGED();
test_WM_SYSCOLORCHANGE();
--
2.32.0
1
0
[PATCH 2/7] uxtheme: Use tab background as dialog texture for more WM_CTLCOLOR* messages.
by Zhiyi Zhang 09 Feb '22
by Zhiyi Zhang 09 Feb '22
09 Feb '22
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/dialog.c | 3 +++
dlls/uxtheme/tests/system.c | 15 ++-------------
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/dlls/uxtheme/dialog.c b/dlls/uxtheme/dialog.c
index 87c2b7d1c13..b91e20f0f33 100644
--- a/dlls/uxtheme/dialog.c
+++ b/dlls/uxtheme/dialog.c
@@ -149,6 +149,9 @@ LRESULT WINAPI UXTHEME_DefDlgProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, BOO
SetBrushOrgEx(hdc, old_org.x, old_org.y, NULL);
return TRUE;
}
+ case WM_CTLCOLORMSGBOX:
+ case WM_CTLCOLORBTN:
+ case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
dlgproc = (WNDPROC)GetWindowLongPtrW(hwnd, DWLP_DLGPROC);
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 77a12f3fa44..c70e6c27361 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1854,7 +1854,6 @@ static void test_EnableThemeDialogTexture(void)
}
else
{
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(org.x == -1 && org.y == -2, "Expected (-1,-2), got %s.\n", wine_dbgstr_point(&org));
}
@@ -1863,7 +1862,6 @@ static void test_EnableThemeDialogTexture(void)
ok(old_mode != 0, "SetBkMode failed.\n");
SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
mode = SetBkMode(child_hdc, old_mode);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(mode == TRANSPARENT, "Expected mode %#x, got %#x.\n", TRANSPARENT, mode);
/* Test that some WM_CTLCOLOR* messages change background color when dialog texture is on */
@@ -1879,24 +1877,18 @@ static void test_EnableThemeDialogTexture(void)
memset(&log_brush, 0, sizeof(log_brush));
count = GetObjectA(brush, sizeof(log_brush), &log_brush);
ok(count == sizeof(log_brush), "GetObjectA failed, error %u.\n", GetLastError());
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(log_brush.lbColor == 0, "Expected brush color %#x, got %#x.\n", 0, log_brush.lbColor);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(log_brush.lbStyle == BS_PATTERN, "Expected brush style %#x, got %#x.\n", BS_PATTERN,
log_brush.lbStyle);
memset(&bmp, 0, sizeof(bmp));
count = GetObjectA((HBITMAP)log_brush.lbHatch, sizeof(bmp), &bmp);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(count == sizeof(bmp), "GetObjectA failed, error %u.\n", GetLastError());
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(bmp.bmWidth == size.cx, "Expected width %d, got %d.\n", size.cx, bmp.bmWidth);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(bmp.bmHeight == size.cy, "Expected height %d, got %d.\n", size.cy, bmp.bmHeight);
/* Test that DefDlgProcA/W() are hooked for some WM_CTLCOLOR* messages */
brush = (HBRUSH)SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
brush2 = (HBRUSH)DefDlgProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
ok(brush2 == brush, "Expected the same brush.\n");
@@ -1905,24 +1897,21 @@ static void test_EnableThemeDialogTexture(void)
/* Test that DefWindowProcA/W() are also hooked for some WM_CTLCOLOR* messages */
brush = (HBRUSH)SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(msg != WM_CTLCOLORSTATIC)
ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
if (msg != WM_CTLCOLORDLG)
{
brush2 = (HBRUSH)DefWindowProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(msg == WM_CTLCOLORSTATIC)
+ todo_wine
ok(brush2 == brush, "Expected the same brush.\n");
brush2 = (HBRUSH)DefWindowProcA(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine_if(msg == WM_CTLCOLORSTATIC)
+ todo_wine
ok(brush2 == brush, "Expected the same brush.\n");
}
else
{
brush2 = (HBRUSH)DefWindowProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine
ok(brush2 != brush, "Expected a different brush.\n");
brush2 = (HBRUSH)DefWindowProcA(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine
ok(brush2 != brush, "Expected a different brush.\n");
}
--
2.32.0
1
0
[PATCH 1/7] uxtheme/tests: Test more WM_CTLCOLOR* messages for dialog theming.
by Zhiyi Zhang 09 Feb '22
by Zhiyi Zhang 09 Feb '22
09 Feb '22
Test that some WM_CTLCOLOR* other than WM_CTLCOLORSTATIC also use tab background as dialog texture.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/uxtheme/tests/system.c | 150 ++++++++++++++++++++++--------------
1 file changed, 94 insertions(+), 56 deletions(-)
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 980676f9e57..77a12f3fa44 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -1617,6 +1617,7 @@ static void test_EnableThemeDialogTexture(void)
LRESULT lr;
POINT org;
SIZE size;
+ UINT msg;
BOOL ret;
struct
@@ -1822,74 +1823,111 @@ static void test_EnableThemeDialogTexture(void)
GetSysColorBrush(COLOR_MENU), brush);
handle_WM_CTLCOLORSTATIC = FALSE;
- /* Test that WM_CTLCOLORSTATIC changes brush origin when dialog texture is on */
- ret = SetBrushOrgEx(child_hdc, 0, 0, NULL);
- ok(ret, "SetBrushOrgEx failed, error %u.\n", GetLastError());
- SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ret = GetBrushOrgEx(child_hdc, &org);
- ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
- ok(org.x == -1 && org.y == -2, "Expected (-1,-2), got %s.\n", wine_dbgstr_point(&org));
-
- /* Test that WM_CTLCOLORSTATIC changes background mode when dialog texture is on */
- old_mode = SetBkMode(child_hdc, OPAQUE);
- ok(old_mode != 0, "SetBkMode failed.\n");
- SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- mode = SetBkMode(child_hdc, old_mode);
- ok(mode == TRANSPARENT, "Expected mode %#x, got %#x.\n", TRANSPARENT, mode);
-
- /* Test that WM_CTLCOLORSTATIC changes background color when dialog texture is on */
- old_color = SetBkColor(child_hdc, 0xaa5511);
- ok(old_color != CLR_INVALID, "SetBkColor failed.\n");
- SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- color = SetBkColor(child_hdc, old_color);
- ok(color == GetSysColor(COLOR_BTNFACE), "Expected background color %#x, got %#x.\n",
- GetSysColor(COLOR_BTNFACE), color);
-
/* Test that dialog doesn't have theme handle opened for itself */
ok(GetWindowTheme(dialog) == NULL, "Expected NULL theme handle.\n");
- /* Test that the returned brush is a pattern brush created from the tab body */
- brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- memset(&log_brush, 0, sizeof(log_brush));
- count = GetObjectA(brush, sizeof(log_brush), &log_brush);
- ok(count == sizeof(log_brush), "GetObjectA failed, error %u.\n", GetLastError());
- ok(log_brush.lbColor == 0, "Expected brush color %#x, got %#x.\n", 0, log_brush.lbColor);
- ok(log_brush.lbStyle == BS_PATTERN, "Expected brush style %#x, got %#x.\n", BS_PATTERN,
- log_brush.lbStyle);
-
- memset(&bmp, 0, sizeof(bmp));
- count = GetObjectA((HBITMAP)log_brush.lbHatch, sizeof(bmp), &bmp);
- ok(count == sizeof(bmp), "GetObjectA failed, error %u.\n", GetLastError());
-
theme = OpenThemeData(NULL, L"Tab");
ok(theme != NULL, "OpenThemeData failed.\n");
-
size.cx = 0;
size.cy = 0;
hr = GetThemePartSize(theme, NULL, TABP_BODY, 0, NULL, TS_TRUE, &size);
ok(hr == S_OK, "GetThemePartSize failed, hr %#x.\n", hr);
- ok(bmp.bmWidth == size.cx, "Expected width %d, got %d.\n", size.cx, bmp.bmWidth);
- ok(bmp.bmHeight == size.cy, "Expected height %d, got %d.\n", size.cy, bmp.bmHeight);
-
CloseThemeData(theme);
- /* Test that DefDlgProcA/W() are hooked for WM_CTLCOLORSTATIC */
- brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
- brush2 = (HBRUSH)DefDlgProcW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush2 == brush, "Expected the same brush.\n");
- brush2 = (HBRUSH)DefDlgProcA(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush2 == brush, "Expected the same brush.\n");
+ /* Test which WM_CTLCOLOR* message uses tab background as dialog texture */
+ for (msg = WM_CTLCOLORMSGBOX; msg <= WM_CTLCOLORSTATIC; ++msg)
+ {
+ winetest_push_context("msg %#x", msg);
- /* Test that DefWindowProcA/W() are also hooked for WM_CTLCOLORSTATIC */
- brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
- brush2 = (HBRUSH)DefWindowProcW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine
- ok(brush2 == brush, "Expected the same brush.\n");
- brush2 = (HBRUSH)DefWindowProcA(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
- todo_wine
- ok(brush2 == brush, "Expected the same brush.\n");
+ /* Test that some WM_CTLCOLOR* messages change brush origin when dialog texture is on */
+ ret = SetBrushOrgEx(child_hdc, 0, 0, NULL);
+ ok(ret, "SetBrushOrgEx failed, error %u.\n", GetLastError());
+ SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ ret = GetBrushOrgEx(child_hdc, &org);
+ ok(ret, "GetBrushOrgEx failed, error %u.\n", GetLastError());
+ /* WM_CTLCOLOREDIT, WM_CTLCOLORLISTBOX and WM_CTLCOLORSCROLLBAR don't use tab background */
+ if (msg == WM_CTLCOLOREDIT || msg == WM_CTLCOLORLISTBOX || msg == WM_CTLCOLORSCROLLBAR)
+ {
+ ok(org.x == 0 && org.y == 0, "Expected (0,0), got %s.\n", wine_dbgstr_point(&org));
+ winetest_pop_context();
+ continue;
+ }
+ else
+ {
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(org.x == -1 && org.y == -2, "Expected (-1,-2), got %s.\n", wine_dbgstr_point(&org));
+ }
+
+ /* Test that some WM_CTLCOLOR* messages change background mode when dialog texture is on */
+ old_mode = SetBkMode(child_hdc, OPAQUE);
+ ok(old_mode != 0, "SetBkMode failed.\n");
+ SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ mode = SetBkMode(child_hdc, old_mode);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(mode == TRANSPARENT, "Expected mode %#x, got %#x.\n", TRANSPARENT, mode);
+
+ /* Test that some WM_CTLCOLOR* messages change background color when dialog texture is on */
+ old_color = SetBkColor(child_hdc, 0xaa5511);
+ ok(old_color != CLR_INVALID, "SetBkColor failed.\n");
+ SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ color = SetBkColor(child_hdc, old_color);
+ ok(color == GetSysColor(COLOR_BTNFACE), "Expected background color %#x, got %#x.\n",
+ GetSysColor(COLOR_BTNFACE), color);
+
+ /* Test that the returned brush is a pattern brush created from the tab body */
+ brush = (HBRUSH)SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ memset(&log_brush, 0, sizeof(log_brush));
+ count = GetObjectA(brush, sizeof(log_brush), &log_brush);
+ ok(count == sizeof(log_brush), "GetObjectA failed, error %u.\n", GetLastError());
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(log_brush.lbColor == 0, "Expected brush color %#x, got %#x.\n", 0, log_brush.lbColor);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(log_brush.lbStyle == BS_PATTERN, "Expected brush style %#x, got %#x.\n", BS_PATTERN,
+ log_brush.lbStyle);
+
+ memset(&bmp, 0, sizeof(bmp));
+ count = GetObjectA((HBITMAP)log_brush.lbHatch, sizeof(bmp), &bmp);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(count == sizeof(bmp), "GetObjectA failed, error %u.\n", GetLastError());
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(bmp.bmWidth == size.cx, "Expected width %d, got %d.\n", size.cx, bmp.bmWidth);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(bmp.bmHeight == size.cy, "Expected height %d, got %d.\n", size.cy, bmp.bmHeight);
+
+ /* Test that DefDlgProcA/W() are hooked for some WM_CTLCOLOR* messages */
+ brush = (HBRUSH)SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
+ brush2 = (HBRUSH)DefDlgProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ ok(brush2 == brush, "Expected the same brush.\n");
+ brush2 = (HBRUSH)DefDlgProcA(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ ok(brush2 == brush, "Expected the same brush.\n");
+
+ /* Test that DefWindowProcA/W() are also hooked for some WM_CTLCOLOR* messages */
+ brush = (HBRUSH)SendMessageW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine_if(msg != WM_CTLCOLORSTATIC)
+ ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected a different brush.\n");
+ if (msg != WM_CTLCOLORDLG)
+ {
+ brush2 = (HBRUSH)DefWindowProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine_if(msg == WM_CTLCOLORSTATIC)
+ ok(brush2 == brush, "Expected the same brush.\n");
+ brush2 = (HBRUSH)DefWindowProcA(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine_if(msg == WM_CTLCOLORSTATIC)
+ ok(brush2 == brush, "Expected the same brush.\n");
+ }
+ else
+ {
+ brush2 = (HBRUSH)DefWindowProcW(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine
+ ok(brush2 != brush, "Expected a different brush.\n");
+ brush2 = (HBRUSH)DefWindowProcA(dialog, msg, (WPARAM)child_hdc, (LPARAM)child);
+ todo_wine
+ ok(brush2 != brush, "Expected a different brush.\n");
+ }
+
+ winetest_pop_context();
+ }
/* Test that DefWindowProcA/W() are not hooked for WM_ERASEBKGND. So the background is still
* drawn with hbrBackground, which in this case, is GRAY_BRUSH.
--
2.32.0
1
0
09 Feb '22
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
programs/schtasks/Makefile.in | 1 -
programs/schtasks/schtasks.c | 8 ++++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/programs/schtasks/Makefile.in b/programs/schtasks/Makefile.in
index 63afc93a876..6eb8d530425 100644
--- a/programs/schtasks/Makefile.in
+++ b/programs/schtasks/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = schtasks.exe
IMPORTS = oleaut32 ole32
diff --git a/programs/schtasks/schtasks.c b/programs/schtasks/schtasks.c
index 340aeaa56fb..c9434801db8 100644
--- a/programs/schtasks/schtasks.c
+++ b/programs/schtasks/schtasks.c
@@ -40,14 +40,14 @@ static ITaskFolder *get_tasks_root_folder(void)
V_VT(&empty) = VT_EMPTY;
hres = ITaskService_Connect(service, empty, empty, empty, empty);
if (FAILED(hres)) {
- FIXME("Connect failed: %08x\n", hres);
+ FIXME("Connect failed: %08lx\n", hres);
return NULL;
}
hres = ITaskService_GetFolder(service, NULL, &root);
ITaskService_Release(service);
if (FAILED(hres)) {
- FIXME("GetFolder failed: %08x\n", hres);
+ FIXME("GetFolder failed: %08lx\n", hres);
return NULL;
}
@@ -70,7 +70,7 @@ static IRegisteredTask *get_registered_task(const WCHAR *name)
SysFreeString(str);
ITaskFolder_Release(root);
if (FAILED(hres)) {
- FIXME("GetTask failed: %08x\n", hres);
+ FIXME("GetTask failed: %08lx\n", hres);
return NULL;
}
@@ -183,7 +183,7 @@ static int change_command(int argc, WCHAR *argv[])
hres = IRegisteredTask_put_Enabled(task, VARIANT_TRUE);
if (FAILED(hres)) {
IRegisteredTask_Release(task);
- FIXME("put_Enabled failed: %08x\n", hres);
+ FIXME("put_Enabled failed: %08lx\n", hres);
return 1;
}
}
1
24
ddraw1 doesn't draw, so presumably not affected. Can't find any crashes in the testbot history
http://test.winehq.org/data/4364ff8d5c0387edd6fae142affe8e844b291518/win81_…
http://test.winehq.org/data/d03984709d87d6eaa0e2e7746f0db5d8fdf81b5a/win150…
I haven't found any examples of ddraw7 crashing in this test. Doesn't mean there aren't any. Let's wait and see.
Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com>
---
dlls/ddraw/tests/ddraw2.c | 20 ++++++++++++++------
dlls/ddraw/tests/ddraw4.c | 9 +++++++++
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 625776c652c..1285fa1b682 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -1076,6 +1076,17 @@ static void test_coop_level_d3d_state(void)
window = create_window();
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
+
+ if (ddraw_is_warp(ddraw))
+ {
+ /* ddraw2 crashes in EndScene, and if it doesn't crash it fails with
+ * DDERR_SURFACELOST on WARP. */
+ win_skip("Skipping test that crashes WARP occasionally.\n");
+ IDirectDraw2_Release(ddraw);
+ DestroyWindow(window);
+ return;
+ }
+
if (!(device = create_device(ddraw, window, DDSCL_NORMAL)))
{
skip("Failed to create a 3D device, skipping test.\n");
@@ -1159,12 +1170,9 @@ static void test_coop_level_d3d_state(void)
hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, ARRAY_SIZE(quad), 0);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice2_EndScene(device);
- ok(hr == DD_OK || broken(ddraw_is_warp(ddraw) && hr == DDERR_SURFACELOST), "Got unexpected hr %#x.\n", hr);
- if (hr == DD_OK)
- {
- color = get_surface_color(rt, 320, 240);
- ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
- }
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
+ color = get_surface_color(rt, 320, 240);
+ ok(compare_color(color, 0x0000ff80, 1), "Got unexpected color 0x%08x.\n", color);
destroy_viewport(device, viewport);
destroy_material(background);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 9b8acb674e3..6ed12d980db 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -1301,6 +1301,14 @@ static void test_coop_level_d3d_state(void)
hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirect3D3_Release(d3d);
+
+ if (ddraw_is_warp(ddraw))
+ {
+ /* ddraw4 occasionally crashes in GetRenderTarget. */
+ win_skip("Skipping test that crashes WARP occasionally.\n");
+ goto done;
+ }
+
hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface4_IsLost(rt);
@@ -1349,6 +1357,7 @@ static void test_coop_level_d3d_state(void)
|| broken(ddraw_is_warp(ddraw) && compare_color(color, 0x0000ff00, 0)),
"Got unexpected color 0x%08x.\n", color);
+done:
destroy_viewport(device, viewport);
IDirectDrawSurface4_Release(surface);
IDirectDrawSurface4_Release(rt);
--
2.34.1
5
13