Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
March 2022
- 80 participants
- 950 discussions
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52639
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/tests/toolbar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 80f9e067c00..31c360304c6 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -2639,6 +2639,7 @@ static void test_visual(void)
SendMessageA(toolbar, TB_BUTTONSTRUCTSIZE, sizeof(tbbutton), 0);
ret = SendMessageA(toolbar, TB_ADDBUTTONSA, 1, (LPARAM)&tbbutton);
ok(ret, "TB_ADDBUTTONSA failed.\n");
+ flush_events();
theme = pGetWindowTheme(toolbar);
ok(!theme, "Expected theme not opened by window.\n");
@@ -2650,7 +2651,6 @@ static void test_visual(void)
ret = RedrawWindow(toolbar, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW | RDW_UPDATENOW);
ok(ret, "RedrawWindow failed.\n");
- flush_events();
mem_dc1 = CreateCompatibleDC(toolbar_dc);
mem_bitmap1 = CreateCompatibleBitmap(toolbar_dc, width, height);
--
2.32.0
1
0
10 Mar '22
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/crypt32/decode.c | 93 +++++++++++++++++++++++++++++++++++++
dlls/crypt32/tests/encode.c | 73 +++++++++++++++++++++++++++++
2 files changed, 166 insertions(+)
diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index 1550b3d6f85..dde049b3c40 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -6147,6 +6147,96 @@ static BOOL WINAPI CRYPT_AsnDecodeEccSignature(DWORD dwCertEncodingType,
return ret;
}
+static BOOL CRYPT_AsnDecodeOCSPResponseStatus(const BYTE *pbEncoded,
+ DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo,
+ DWORD *pcbDecoded)
+{
+ if (!cbEncoded)
+ {
+ SetLastError(CRYPT_E_ASN1_EOD);
+ return FALSE;
+ }
+ if (pbEncoded[0] != ASN_ENUMERATED)
+ {
+ SetLastError(CRYPT_E_ASN1_BADTAG);
+ return FALSE;
+ }
+
+ return CRYPT_AsnDecodeIntInternal(pbEncoded, cbEncoded, dwFlags, pvStructInfo,
+ pcbStructInfo, pcbDecoded);
+}
+
+static BOOL CRYPT_AsnDecodeOCSPResponseBytes(const BYTE *pbEncoded,
+ DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo,
+ DWORD *pcbDecoded)
+{
+ DWORD dataLen;
+ BOOL ret;
+
+ if (!cbEncoded)
+ {
+ SetLastError(CRYPT_E_ASN1_EOD);
+ return FALSE;
+ }
+ if (pbEncoded[0] != (ASN_CONTEXT | ASN_CONSTRUCTOR))
+ {
+ SetLastError(CRYPT_E_ASN1_BADTAG);
+ return FALSE;
+ }
+
+ if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
+ {
+ struct AsnDecodeSequenceItem items[] = {
+ { ASN_OBJECTIDENTIFIER, 0,
+ CRYPT_AsnDecodeOidIgnoreTag, sizeof(LPSTR), FALSE, TRUE,
+ 0, 0 },
+ { ASN_OCTETSTRING, sizeof(LPSTR),
+ CRYPT_AsnDecodeOctets, sizeof(CRYPT_OBJID_BLOB), FALSE, TRUE,
+ sizeof(LPSTR) + offsetof(CRYPT_OBJID_BLOB, pbData), 0 },
+ };
+ BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
+ DWORD bytesNeeded;
+
+ if (dataLen)
+ {
+ ret = CRYPT_AsnDecodeSequence(items, ARRAY_SIZE(items),
+ pbEncoded + 1 + lenBytes, cbEncoded - 1 - lenBytes, dwFlags, NULL,
+ pvStructInfo, pcbStructInfo, &bytesNeeded, NULL);
+ if (ret) *pcbDecoded = bytesNeeded + lenBytes + 1;
+ }
+ }
+ return ret;
+}
+
+static BOOL WINAPI CRYPT_AsnDecodeOCSPResponse(DWORD dwCertEncodingType,
+ LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
+ CRYPT_DECODE_PARA *pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
+{
+ BOOL ret;
+ struct AsnDecodeSequenceItem items[] = {
+ { ASN_ENUMERATED, offsetof(OCSP_RESPONSE_INFO, dwStatus),
+ CRYPT_AsnDecodeOCSPResponseStatus, sizeof(DWORD), FALSE, FALSE,
+ 0, 0 },
+ { ASN_CONTEXT | ASN_CONSTRUCTOR, offsetof(OCSP_RESPONSE_INFO, pszObjId),
+ CRYPT_AsnDecodeOCSPResponseBytes, sizeof(LPSTR) + sizeof(CRYPT_OBJID_BLOB), TRUE, TRUE,
+ offsetof(OCSP_RESPONSE_INFO, pszObjId), 0 },
+ };
+
+ __TRY
+ {
+ ret = CRYPT_AsnDecodeSequence(items, ARRAY_SIZE(items),
+ pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo,
+ pcbStructInfo, NULL, NULL);
+ }
+ __EXCEPT_PAGE_FAULT
+ {
+ SetLastError(STATUS_ACCESS_VIOLATION);
+ ret = FALSE;
+ }
+ __ENDTRY
+ return ret;
+}
+
static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
LPCSTR lpszStructType)
{
@@ -6295,6 +6385,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
case LOWORD(CNG_RSA_PUBLIC_KEY_BLOB):
decodeFunc = CRYPT_AsnDecodeRsaPubKey_Bcrypt;
break;
+ case LOWORD(OCSP_RESPONSE):
+ decodeFunc = CRYPT_AsnDecodeOCSPResponse;
+ break;
default:
FIXME("Unimplemented decoder for lpszStructType OID %d\n", LOWORD(lpszStructType));
}
diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index c47fd823673..11840d817fe 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -8760,6 +8760,78 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
LocalFree(buf);
}
+static const BYTE ocsp_response[] = {
+ 0x30, 0x03, 0x0a, 0x01, 0x06
+};
+
+static const BYTE ocsp_response2[] = {
+ 0x30, 0x82, 0x01, 0xd3, 0x0a, 0x01, 0x00, 0xa0, 0x82, 0x01, 0xcc, 0x30,
+ 0x82, 0x01, 0xc8, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30,
+ 0x01, 0x01, 0x04, 0x82, 0x01, 0xb9, 0x30, 0x82, 0x01, 0xb5, 0x30, 0x81,
+ 0x9e, 0xa2, 0x16, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84,
+ 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9,
+ 0xf4, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x32, 0x30, 0x33, 0x30, 0x37, 0x31,
+ 0x38, 0x33, 0x36, 0x34, 0x33, 0x5a, 0x30, 0x73, 0x30, 0x71, 0x30, 0x49,
+ 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04,
+ 0x14, 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0,
+ 0x98, 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7,
+ 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f,
+ 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0x08, 0x49, 0x8f,
+ 0x6d, 0xd9, 0xef, 0xfb, 0x40, 0x55, 0x1e, 0xac, 0x54, 0x54, 0x87, 0xc1,
+ 0xb1, 0x80, 0x00, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x32, 0x30, 0x33, 0x30,
+ 0x37, 0x31, 0x38, 0x32, 0x31, 0x30, 0x31, 0x5a, 0xa0, 0x11, 0x18, 0x0f,
+ 0x32, 0x30, 0x32, 0x32, 0x30, 0x33, 0x31, 0x34, 0x31, 0x37, 0x33, 0x36,
+ 0x30, 0x31, 0x5a, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
+ 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x2a,
+ 0xf3, 0x5f, 0xf7, 0x72, 0x6b, 0x27, 0x38, 0x6b, 0xae, 0x66, 0x42, 0xe0,
+ 0x3b, 0xc6, 0x44, 0x5f, 0x95, 0xe2, 0x1f, 0xbc, 0x3f, 0xb3, 0x1d, 0x6c,
+ 0x6c, 0x7c, 0x91, 0xb3, 0x02, 0x23, 0x0f, 0xf0, 0x13, 0x5f, 0x62, 0x92,
+ 0x0d, 0x91, 0xa9, 0x8f, 0x66, 0xe9, 0x18, 0xe3, 0xb1, 0xe0, 0x4c, 0x63,
+ 0x40, 0x9e, 0x14, 0x26, 0x28, 0x7a, 0x5e, 0x51, 0x99, 0x43, 0x1c, 0xd5,
+ 0xbd, 0x84, 0x88, 0x68, 0xd9, 0x0e, 0xd9, 0xf4, 0x78, 0x48, 0x9f, 0x01,
+ 0x4c, 0x34, 0x14, 0x1e, 0x7c, 0x72, 0x9c, 0xdd, 0x94, 0xcb, 0x6e, 0x28,
+ 0xf5, 0x76, 0x75, 0xa2, 0xbe, 0x4b, 0x52, 0xac, 0x38, 0x9d, 0xce, 0x52,
+ 0x68, 0x33, 0xbc, 0x52, 0xc7, 0xdc, 0x2f, 0x19, 0xff, 0x15, 0x9c, 0x4b,
+ 0xdb, 0x83, 0x4e, 0xd7, 0xf6, 0x9b, 0x7f, 0x76, 0x58, 0xa5, 0x46, 0x49,
+ 0xe3, 0x2d, 0x41, 0x26, 0xf8, 0xce, 0xb7, 0x56, 0x61, 0xb2, 0x88, 0x65,
+ 0x2b, 0xb8, 0x4d, 0xf2, 0xf2, 0x32, 0x50, 0x53, 0x8b, 0x0d, 0xc6, 0x58,
+ 0xac, 0xd8, 0xe4, 0x8d, 0x38, 0x9e, 0x61, 0xeb, 0x6b, 0xd2, 0xd6, 0x50,
+ 0x8d, 0xfa, 0x93, 0x47, 0x4e, 0x6e, 0x2b, 0xd3, 0xb9, 0xdc, 0xb9, 0xb5,
+ 0x86, 0x46, 0xcb, 0xda, 0xd9, 0xd8, 0xd5, 0x99, 0x7a, 0x7c, 0x73, 0xee,
+ 0xc1, 0x52, 0x8e, 0xc5, 0xca, 0x28, 0x1d, 0x15, 0x94, 0x06, 0xa0, 0xa5,
+ 0x01, 0xf3, 0xbd, 0x67, 0x3f, 0x3d, 0x46, 0x63, 0xc5, 0xba, 0xd5, 0x12,
+ 0xde, 0xb4, 0xc5, 0x86, 0xfe, 0x97, 0x6b, 0x70, 0xfe, 0xa4, 0x6a, 0x25,
+ 0x63, 0x8e, 0xcf, 0xa4, 0x13, 0x1c, 0x2b, 0xf7, 0xf4, 0xc9, 0x79, 0x8e,
+ 0x07, 0xa3, 0x25, 0x9f, 0xcf, 0x33, 0x65, 0x49, 0x84, 0xad, 0x7f, 0x90,
+ 0x44, 0x85, 0xd8, 0xa7, 0x73, 0x53, 0x56, 0x73, 0xca, 0x15, 0x39, 0x99,
+ 0x5f, 0x39, 0xfd
+};
+
+static void test_decodeOCSPResponseInfo(DWORD dwEncoding)
+{
+ OCSP_RESPONSE_INFO *info;
+ DWORD size;
+ BOOL ret;
+
+ ret = pCryptDecodeObjectEx(dwEncoding, OCSP_RESPONSE, ocsp_response, sizeof(ocsp_response),
+ CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
+ ok(ret, "got %08lx\n", GetLastError());
+ ok(info->dwStatus == OCSP_UNAUTHORIZED_RESPONSE, "got %lu\n", info->dwStatus);
+ ok(info->pszObjId == NULL, "got %s\n", wine_dbgstr_a(info->pszObjId));
+ ok(!info->Value.cbData, "got %lu\n", info->Value.cbData);
+ ok(info->Value.pbData == NULL, "got %p\n", info->Value.pbData);
+ LocalFree(info);
+
+ ret = pCryptDecodeObjectEx(dwEncoding, OCSP_RESPONSE, ocsp_response2, sizeof(ocsp_response2),
+ CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size);
+ ok(ret, "got %08lx\n", GetLastError());
+ ok(info->dwStatus == OCSP_SUCCESSFUL_RESPONSE, "got %lu\n", info->dwStatus);
+ ok(!strcmp(info->pszObjId, szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE), "got %s\n", wine_dbgstr_a(info->pszObjId));
+ ok(info->Value.cbData == 441, "got %lu\n", info->Value.cbData);
+ ok(info->Value.pbData != NULL, "got %p\n", info->Value.pbData);
+ LocalFree(info);
+}
+
START_TEST(encode)
{
static const DWORD encodings[] = { X509_ASN_ENCODING, PKCS_7_ASN_ENCODING,
@@ -8854,6 +8926,7 @@ START_TEST(encode)
test_decodeCertPolicyConstraints(encodings[i]);
test_decodeRsaPrivateKey(encodings[i]);
test_encodeOCSPRequestInfo(encodings[i]);
+ test_decodeOCSPResponseInfo(encodings[i]);
}
testPortPublicKeyInfo();
}
--
2.30.2
1
0
[PATCH 2/3] crypt32: Add partial support for encoding signed OCSP requests.
by Hans Leidekker 10 Mar '22
by Hans Leidekker 10 Mar '22
10 Mar '22
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/crypt32/encode.c | 30 ++++++++++++++++++++++++++++++
dlls/crypt32/tests/encode.c | 24 +++++++++++++++++++++++-
2 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c
index 3391e61679c..8086ad2fc0a 100644
--- a/dlls/crypt32/encode.c
+++ b/dlls/crypt32/encode.c
@@ -4664,6 +4664,33 @@ static BOOL WINAPI CRYPT_AsnEncodeOCSPRequest(DWORD dwCertEncodingType,
return ret;
}
+static BOOL WINAPI CRYPT_AsnEncodeOCSPSignedRequest(DWORD dwCertEncodingType,
+ LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags,
+ PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded)
+{
+ BOOL ret;
+
+ __TRY
+ {
+ const OCSP_SIGNED_REQUEST_INFO *info = pvStructInfo;
+ struct AsnEncodeSequenceItem items[] = {
+ { &info->ToBeSigned, CRYPT_CopyEncodedBlob, 0 },
+ };
+
+ if (info->pOptionalSignatureInfo) FIXME("pOptionalSignatureInfo not supported\n");
+
+ ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items,
+ ARRAY_SIZE(items), dwFlags, pEncodePara, pbEncoded, pcbEncoded);
+ }
+ __EXCEPT_PAGE_FAULT
+ {
+ SetLastError(STATUS_ACCESS_VIOLATION);
+ ret = FALSE;
+ }
+ __ENDTRY
+ return ret;
+}
+
static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
LPCSTR lpszStructType)
{
@@ -4807,6 +4834,9 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
case LOWORD(OCSP_REQUEST):
encodeFunc = CRYPT_AsnEncodeOCSPRequest;
break;
+ case LOWORD(OCSP_SIGNED_REQUEST):
+ encodeFunc = CRYPT_AsnEncodeOCSPSignedRequest;
+ break;
default:
FIXME("Unimplemented encoder for lpszStructType OID %d\n", LOWORD(lpszStructType));
}
diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index 747b4a7d18f..c47fd823673 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -8667,6 +8667,14 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa,
0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10,
0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08};
+ static const BYTE expected4[] =
+ {0x30, 0x6a, 0x30, 0x68, 0xa1, 0x17, 0x82, 0x15, 0x2a, 0x2e, 0x63, 0x6d, 0x2e, 0x73, 0x74, 0x65,
+ 0x61, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x4d, 0x30,
+ 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14,
+ 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0,
+ 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea,
+ 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54,
+ 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08};
static const BYTE issuer_name[] =
{0xe4, 0xe3 ,0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0,
0x09, 0x8a, 0xab, 0xd8};
@@ -8678,8 +8686,9 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
OCSP_REQUEST_ENTRY entry[2];
CERT_ALT_NAME_ENTRY name;
OCSP_REQUEST_INFO info;
+ OCSP_SIGNED_REQUEST_INFO info_signed;
DWORD size;
- BYTE *buf;
+ BYTE *buf, *buf2;
BOOL ret;
memset(&entry, 0, sizeof(entry));
@@ -8707,7 +8716,20 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
ok(ret, "got %08lx\n", GetLastError());
ok(size == sizeof(expected), "got %lu\n", size);
ok(!memcmp(buf, expected, sizeof(expected)), "unexpected value\n");
+
+ /* wrapped in OCSP_SIGNED_REQUEST_INFO */
+ info_signed.ToBeSigned.cbData = size;
+ info_signed.ToBeSigned.pbData = buf;
+ info_signed.pOptionalSignatureInfo = NULL;
+ size = 0;
+ SetLastError(0xdeadbeef);
+ ret = pCryptEncodeObjectEx(dwEncoding, OCSP_SIGNED_REQUEST, &info_signed, CRYPT_ENCODE_ALLOC_FLAG, NULL,
+ &buf2, &size);
+ ok(ret, "got %08lx\n", GetLastError());
+ ok(size == sizeof(expected4), "got %lu\n", size);
+ ok(!memcmp(buf2, expected4, sizeof(expected4)), "unexpected value\n");
LocalFree(buf);
+ LocalFree(buf2);
/* two entries */
entry[1].CertId.HashAlgorithm.pszObjId = (char *)szOID_OIWSEC_sha1;
--
2.30.2
1
0
10 Mar '22
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/crypt32/encode.c | 21 ++++++++++++---------
dlls/crypt32/tests/encode.c | 21 +++++++++++++++++++++
2 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c
index a506f197be1..3391e61679c 100644
--- a/dlls/crypt32/encode.c
+++ b/dlls/crypt32/encode.c
@@ -4632,18 +4632,21 @@ static BOOL WINAPI CRYPT_AsnEncodeOCSPRequest(DWORD dwCertEncodingType,
{
struct AsnConstructedItem name;
struct AsnEncodeSequenceItem items[2];
- DWORD count = 1;
-
- name.tag = 1;
- name.pvStructInfo = info->pRequestorName;
- name.encodeFunc = CRYPT_AsnEncodeAltNameEntry;
- items[0].pvStructInfo = &name;
- items[0].encodeFunc = CRYPT_AsnEncodeConstructed;
+ DWORD count = 0;
+ if (info->pRequestorName)
+ {
+ name.tag = 1;
+ name.pvStructInfo = info->pRequestorName;
+ name.encodeFunc = CRYPT_AsnEncodeAltNameEntry;
+ items[count].pvStructInfo = &name;
+ items[count].encodeFunc = CRYPT_AsnEncodeConstructed;
+ count++;
+ }
if (info->cRequestEntry)
{
- items[1].pvStructInfo = &info->cRequestEntry;
- items[1].encodeFunc = CRYPT_AsnEncodeOCSPRequestEntries;
+ items[count].pvStructInfo = &info->cRequestEntry;
+ items[count].encodeFunc = CRYPT_AsnEncodeOCSPRequestEntries;
count++;
}
diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c
index 9d12223c54c..747b4a7d18f 100644
--- a/dlls/crypt32/tests/encode.c
+++ b/dlls/crypt32/tests/encode.c
@@ -8656,6 +8656,17 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f,
0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e,
0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08};
+ static const BYTE expected3[] =
+ {0x30, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e,
+ 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14, 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3,
+ 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2,
+ 0xea, 0xa8, 0xaa, 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9,
+ 0xf4, 0x02, 0x10, 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d,
+ 0x8f, 0x49, 0x08, 0x30, 0x4b, 0x30, 0x49, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a,
+ 0x05, 0x00, 0x04, 0x14, 0xe4, 0xe3, 0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98,
+ 0x0c, 0x0b, 0x4e, 0xc0, 0x09, 0x8a, 0xab, 0xd8, 0x04, 0x14, 0xb7, 0x6b, 0xa2, 0xea, 0xa8, 0xaa,
+ 0x84, 0x8c, 0x79, 0xea, 0xb4, 0xda, 0x0f, 0x98, 0xb2, 0xc5, 0x95, 0x76, 0xb9, 0xf4, 0x02, 0x10,
+ 0xb1, 0xc1, 0x87, 0x54, 0x54, 0xac, 0x1e, 0x55, 0x40, 0xfb, 0xef, 0xd9, 0x6d, 0x8f, 0x49, 0x08};
static const BYTE issuer_name[] =
{0xe4, 0xe3 ,0x95, 0xa2, 0x29, 0xd3, 0xd4, 0xc1, 0xc3, 0x1f, 0xf0, 0x98, 0x0c, 0x0b, 0x4e, 0xc0,
0x09, 0x8a, 0xab, 0xd8};
@@ -8715,6 +8726,16 @@ static void test_encodeOCSPRequestInfo(DWORD dwEncoding)
ok(size == sizeof(expected2), "got %lu\n", size);
ok(!memcmp(buf, expected2, sizeof(expected2)), "unexpected value\n");
LocalFree(buf);
+
+ /* requestor name not set */
+ info.pRequestorName = NULL;
+ size = 0;
+ SetLastError(0xdeadbeef);
+ ret = pCryptEncodeObjectEx(dwEncoding, OCSP_REQUEST, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
+ ok(ret, "got %08lx\n", GetLastError());
+ ok(size == sizeof(expected3), "got %lu\n", size);
+ ok(!memcmp(buf, expected3, sizeof(expected3)), "unexpected value\n");
+ LocalFree(buf);
}
START_TEST(encode)
--
2.30.2
1
0
10 Mar '22
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20296
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/combase/rpc.c | 49 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/dlls/combase/rpc.c b/dlls/combase/rpc.c
index 0a86183030a..40f900175dd 100644
--- a/dlls/combase/rpc.c
+++ b/dlls/combase/rpc.c
@@ -522,6 +522,52 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
return S_OK;
}
+static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process)
+{
+ static const WCHAR processidW[] = L" /PROCESSID:";
+ HKEY key;
+ HRESULT hr;
+ WCHAR command[MAX_PATH + ARRAY_SIZE(processidW) + CHARS_IN_GUID];
+ DWORD size;
+ STARTUPINFOW sinfo;
+ PROCESS_INFORMATION pinfo;
+ LONG ret;
+
+ TRACE("Attempting to start surrogate server for %s\n", debugstr_guid(rclsid));
+
+ hr = open_appidkey_from_clsid(rclsid, KEY_READ, &key);
+ if (FAILED(hr))
+ return hr;
+
+ size = (MAX_PATH + 1) * sizeof(WCHAR);
+ ret = RegQueryValueExW(key, L"DllSurrogate", NULL, NULL, (LPBYTE)command, &size);
+ RegCloseKey(key);
+ if (ret || !size || !command[0])
+ {
+ TRACE("No value for DllSurrogate key\n");
+ wcscpy(command, L"dllhost.exe");
+ }
+
+ /* Surrogate EXE servers are started with the /PROCESSID:{GUID} switch. */
+ wcscat(command, processidW);
+ StringFromGUID2(rclsid, command + wcslen(command), CHARS_IN_GUID);
+
+ memset(&sinfo, 0, sizeof(sinfo));
+ sinfo.cb = sizeof(sinfo);
+
+ TRACE("Activating surrogate local server %s\n", debugstr_w(command));
+
+ if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &sinfo, &pinfo))
+ {
+ WARN("failed to run surrogate local server %s\n", debugstr_w(command));
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ *process = pinfo.hProcess;
+ CloseHandle(pinfo.hThread);
+
+ return S_OK;
+}
+
HRESULT rpc_get_local_class_object(REFCLSID rclsid, REFIID riid, void **obj)
{
PMInterfacePointer objref = NULL;
@@ -546,7 +592,8 @@ HRESULT rpc_get_local_class_object(REFCLSID rclsid, REFIID riid, void **obj)
if (tries == 1)
{
- if ((hr = create_local_service(rclsid)) && (hr = create_server(rclsid, &process)) )
+ if ((hr = create_local_service(rclsid)) && (hr = create_server(rclsid, &process)) &&
+ (hr = create_surrogate_server(rclsid, &process)) )
return hr;
}
--
2.35.1
2
1
10 Mar '22
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
programs/dllhost/dllhost.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index 241b79d13a0..dc89c978510 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -352,7 +352,8 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
goto cleanup;
}
- WaitForSingleObject(surrogate.event, INFINITE);
+ while (WaitForSingleObject(surrogate.event, 30000) != WAIT_OBJECT_0)
+ CoFreeUnusedLibraries();
}
cleanup:
--
2.35.1
2
1
10 Mar '22
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
programs/dllhost/dllhost.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index bfe1d4cbbd6..241b79d13a0 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -147,9 +147,11 @@ static ULONG WINAPI marshal_Release(IMarshal *iface)
static HRESULT WINAPI marshal_GetUnmarshalClass(IMarshal *iface, REFIID iid, void *pv,
DWORD dwDestContext, void *pvDestContext, DWORD mshlflags, CLSID *clsid)
{
- FIXME("(%p,%s,%p,%08lx,%p,%08lx,%p): stub\n", iface, wine_dbgstr_guid(iid), pv,
+ TRACE("(%p,%s,%p,%08lx,%p,%08lx,%p)\n", iface, wine_dbgstr_guid(iid), pv,
dwDestContext, pvDestContext, mshlflags, clsid);
- return E_NOTIMPL;
+
+ *clsid = CLSID_StdMarshal;
+ return S_OK;
}
static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, void *pv,
@@ -163,8 +165,19 @@ static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, voi
static HRESULT WINAPI marshal_MarshalInterface(IMarshal *iface, IStream *stream, REFIID iid,
void *pv, DWORD dwDestContext, void *pvDestContext, DWORD mshlflags)
{
- FIXME("(%p,%s,%p,%08lx,%p,%08lx): stub\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
- return E_NOTIMPL;
+ struct factory *factory = impl_from_IMarshal(iface);
+ IUnknown *object;
+ HRESULT hr;
+
+ TRACE("(%p,%s,%p,%08lx,%p,%08lx)\n", stream, wine_dbgstr_guid(iid), pv, dwDestContext, pvDestContext, mshlflags);
+
+ hr = CoGetClassObject(&factory->clsid, CLSCTX_INPROC_SERVER, NULL, iid, (void **)&object);
+ if (hr == S_OK)
+ {
+ hr = CoMarshalInterface(stream, iid, object, dwDestContext, pvDestContext, mshlflags);
+ IUnknown_Release(object);
+ }
+ return hr;
}
static HRESULT WINAPI marshal_UnmarshalInterface(IMarshal *iface, IStream *stream,
--
2.35.1
2
1
10 Mar '22
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
programs/dllhost/dllhost.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c
index 691f233906a..bfe1d4cbbd6 100644
--- a/programs/dllhost/dllhost.c
+++ b/programs/dllhost/dllhost.c
@@ -204,6 +204,7 @@ struct surrogate
ISurrogate ISurrogate_iface;
IClassFactory *factory;
DWORD cookie;
+ HANDLE event;
LONG ref;
};
@@ -267,15 +268,35 @@ static HRESULT WINAPI surrogate_LoadDllServer(ISurrogate *iface, const CLSID *cl
if (hr != S_OK)
IClassFactory_Release(&factory->IClassFactory_iface);
else
+ {
surrogate->factory = &factory->IClassFactory_iface;
+ surrogate->event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ }
return hr;
}
static HRESULT WINAPI surrogate_FreeSurrogate(ISurrogate *iface)
{
- FIXME("(%p): stub\n", iface);
- return E_NOTIMPL;
+ struct surrogate *surrogate = impl_from_ISurrogate(iface);
+
+ TRACE("(%p)\n", iface);
+
+ if (surrogate->cookie)
+ {
+ CoRevokeClassObject(surrogate->cookie);
+ surrogate->cookie = 0;
+ }
+
+ if (surrogate->factory)
+ {
+ IClassFactory_Release(surrogate->factory);
+ surrogate->factory = NULL;
+ }
+
+ SetEvent(surrogate->event);
+
+ return S_OK;
}
static const ISurrogateVtbl Surrogate_Vtbl =
@@ -301,6 +322,7 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
surrogate.ISurrogate_iface.lpVtbl = &Surrogate_Vtbl;
surrogate.factory = NULL;
surrogate.cookie = 0;
+ surrogate.event = NULL;
surrogate.ref = 1;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -317,8 +339,7 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho
goto cleanup;
}
- /* FIXME: wait for FreeSurrogate being called */
- Sleep(INFINITE);
+ WaitForSingleObject(surrogate.event, INFINITE);
}
cleanup:
--
2.35.1
2
1
[PATCH v2 1/6] windows.gaming.input: Implement IRawGameControllerStatics_get_RawGameControllers.
by Rémi Bernon 10 Mar '22
by Rémi Bernon 10 Mar '22
10 Mar '22
It is important to add RawGameController instances to the vector in the
initialization callback, because some games check the vector, as well
as the Gamepad class vector in the OnGameControllerAdded callback.
This also removes the OnGameControllerAdded failure case, to avoid
leaking controllers that were already added to the controller vector,
and instead rely on the OnGameControllerRemoved call to do the cleanup.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
v2: * Initialize controller state in GetReading calls,
* Fix IWineGameControllerProvider query failure support in the class
destruction.
dlls/dinput/tests/joystick8.c | 9 +--
dlls/windows.gaming.input/controller.c | 82 +++++++++++++++++++++-----
dlls/windows.gaming.input/manager.c | 6 +-
3 files changed, 70 insertions(+), 27 deletions(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c
index 2d801aacda2..e74e76482f9 100644
--- a/dlls/dinput/tests/joystick8.c
+++ b/dlls/dinput/tests/joystick8.c
@@ -3340,17 +3340,10 @@ static void test_windows_gaming_input(void)
ok( hr == S_OK, "get_RawGameControllers returned %#lx\n", hr );
hr = IVectorView_RawGameController_get_Size( controllers_view, &size );
ok( hr == S_OK, "get_Size returned %#lx\n", hr );
- todo_wine
ok( size == 1, "got size %u\n", size );
hr = IVectorView_RawGameController_GetAt( controllers_view, 0, &raw_controller );
- todo_wine
ok( hr == S_OK, "GetAt returned %#lx\n", hr );
IVectorView_RawGameController_Release( controllers_view );
- if (hr != S_OK)
- {
- IRawGameControllerStatics_Release( controller_statics );
- goto done;
- }
/* HID gamepads aren't exposed as WGI gamepads on Windows */
@@ -3372,6 +3365,7 @@ static void test_windows_gaming_input(void)
check_interface( raw_controller, &IID_IInspectable, TRUE );
check_interface( raw_controller, &IID_IAgileObject, TRUE );
check_interface( raw_controller, &IID_IRawGameController, TRUE );
+ todo_wine
check_interface( raw_controller, &IID_IRawGameController2, TRUE );
check_interface( raw_controller, &IID_IGameController, TRUE );
check_interface( raw_controller, &IID_IGamepad, FALSE );
@@ -3384,6 +3378,7 @@ static void test_windows_gaming_input(void)
check_interface( game_controller, &IID_IInspectable, TRUE );
check_interface( game_controller, &IID_IAgileObject, TRUE );
check_interface( game_controller, &IID_IRawGameController, TRUE );
+ todo_wine
check_interface( game_controller, &IID_IRawGameController2, TRUE );
check_interface( game_controller, &IID_IGameController, TRUE );
check_interface( game_controller, &IID_IGamepad, FALSE );
diff --git a/dlls/windows.gaming.input/controller.c b/dlls/windows.gaming.input/controller.c
index 9fb1b1a69a2..51ede5a0e47 100644
--- a/dlls/windows.gaming.input/controller.c
+++ b/dlls/windows.gaming.input/controller.c
@@ -24,6 +24,36 @@
WINE_DEFAULT_DEBUG_CHANNEL(input);
+static CRITICAL_SECTION controller_cs;
+static CRITICAL_SECTION_DEBUG controller_cs_debug =
+{
+ 0, 0, &controller_cs,
+ { &controller_cs_debug.ProcessLocksList, &controller_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": controller_cs") }
+};
+static CRITICAL_SECTION controller_cs = { &controller_cs_debug, -1, 0, 0, 0, 0 };
+
+static IVector_RawGameController *controllers;
+
+static HRESULT init_controllers(void)
+{
+ static const struct vector_iids iids =
+ {
+ .vector = &IID_IVector_RawGameController,
+ .view = &IID_IVectorView_RawGameController,
+ .iterable = &IID_IIterable_RawGameController,
+ .iterator = &IID_IIterator_RawGameController,
+ };
+ HRESULT hr;
+
+ EnterCriticalSection( &controller_cs );
+ if (controllers) hr = S_OK;
+ else hr = vector_create( &iids, (void **)&controllers );
+ LeaveCriticalSection( &controller_cs );
+
+ return hr;
+}
+
struct controller
{
IGameControllerImpl IGameControllerImpl_iface;
@@ -118,13 +148,19 @@ static HRESULT WINAPI controller_Initialize( IGameControllerImpl *iface, IGameCo
IGameControllerProvider *provider )
{
struct controller *impl = impl_from_IGameControllerImpl( iface );
+ HRESULT hr;
TRACE( "iface %p, outer %p, provider %p.\n", iface, outer, provider );
impl->IGameController_outer = outer;
IGameControllerProvider_AddRef( (impl->provider = provider) );
- return S_OK;
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
+ hr = IVector_RawGameController_Append( controllers, &impl->IRawGameController_iface );
+ LeaveCriticalSection( &controller_cs );
+
+ return hr;
}
static const struct IGameControllerImplVtbl controller_vtbl =
@@ -381,23 +417,14 @@ static HRESULT WINAPI statics_remove_RawGameControllerRemoved( IRawGameControlle
static HRESULT WINAPI statics_get_RawGameControllers( IRawGameControllerStatics *iface, IVectorView_RawGameController **value )
{
- static const struct vector_iids iids =
- {
- .vector = &IID_IVector_RawGameController,
- .view = &IID_IVectorView_RawGameController,
- .iterable = &IID_IIterable_RawGameController,
- .iterator = &IID_IIterator_RawGameController,
- };
- IVector_RawGameController *controllers;
HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
- if (SUCCEEDED(hr = vector_create( &iids, (void **)&controllers )))
- {
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
hr = IVector_RawGameController_GetView( controllers, value );
- IVector_RawGameController_Release( controllers );
- }
+ LeaveCriticalSection( &controller_cs );
return hr;
}
@@ -468,8 +495,33 @@ static HRESULT WINAPI controller_factory_OnGameControllerAdded( ICustomGameContr
static HRESULT WINAPI controller_factory_OnGameControllerRemoved( ICustomGameControllerFactory *iface, IGameController *value )
{
- FIXME( "iface %p, value %p stub!\n", iface, value );
- return E_NOTIMPL;
+ IRawGameController *controller;
+ BOOLEAN found;
+ UINT32 index;
+ HRESULT hr;
+
+ TRACE( "iface %p, value %p.\n", iface, value );
+
+ if (FAILED(hr = IGameController_QueryInterface( value, &IID_IRawGameController, (void **)&controller )))
+ return hr;
+
+ EnterCriticalSection( &controller_cs );
+ if (SUCCEEDED(hr = init_controllers()))
+ {
+ if (FAILED(hr = IVector_RawGameController_IndexOf( controllers, controller, &index, &found )) || !found)
+ WARN( "Could not find controller %p, hr %#lx!\n", controller, hr );
+ else
+ hr = IVector_RawGameController_RemoveAt( controllers, index );
+ }
+ LeaveCriticalSection( &controller_cs );
+
+ if (FAILED(hr))
+ WARN( "Failed to remove controller %p, hr %#lx!\n", controller, hr );
+ else if (found)
+ TRACE( "Removed controller %p.\n", controller );
+ IRawGameController_Release( controller );
+
+ return S_OK;
}
static const struct ICustomGameControllerFactoryVtbl controller_factory_vtbl =
diff --git a/dlls/windows.gaming.input/manager.c b/dlls/windows.gaming.input/manager.c
index 489588a68ab..6a8963a1fc4 100644
--- a/dlls/windows.gaming.input/manager.c
+++ b/dlls/windows.gaming.input/manager.c
@@ -502,11 +502,7 @@ void manager_on_provider_created( IGameControllerProvider *provider )
controller = LIST_ENTRY( entry, struct controller, entry );
hr = ICustomGameControllerFactory_OnGameControllerAdded( controller->factory,
&controller->IGameController_iface );
- if (FAILED(hr))
- {
- list_remove( &controller->entry );
- IGameController_Release( &controller->IGameController_iface );
- }
+ if (FAILED(hr)) WARN( "OnGameControllerAdded failed, hr %#lx\n", hr );
if (next == &controller_list) break;
}
--
2.35.1
2
6
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com>
---
dlls/wmp/tests/Makefile.in | 1
dlls/wmp/tests/media.c | 168 +++++++++++++++++++++----------------------
dlls/wmp/tests/oleobj.c | 172 ++++++++++++++++++++++----------------------
3 files changed, 170 insertions(+), 171 deletions(-)
diff --git a/dlls/wmp/tests/Makefile.in b/dlls/wmp/tests/Makefile.in
index 4b97242f3aa..089d9e7f3e1 100644
--- a/dlls/wmp/tests/Makefile.in
+++ b/dlls/wmp/tests/Makefile.in
@@ -1,4 +1,3 @@
-EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wmp.dll
IMPORTS = ole32 oleaut32 user32 gdi32
diff --git a/dlls/wmp/tests/media.c b/dlls/wmp/tests/media.c
index fa6cb6490f1..f78e741a189 100644
--- a/dlls/wmp/tests/media.c
+++ b/dlls/wmp/tests/media.c
@@ -36,7 +36,7 @@
#define CHECK_EXPECT(kind, index) \
do { \
- ok(expect_ ##kind & (1 << index), "unexpected event for " #kind ", index:%d\n", index); \
+ ok(expect_ ##kind & (1 << index), "unexpected event for " #kind ", index:%ld\n", index); \
called_ ## kind |= (1 << index); \
}while(0)
@@ -81,7 +81,7 @@ static inline WCHAR *load_resource(const WCHAR *name)
lstrcatW(pathW, name);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA);
@@ -146,7 +146,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
case DISPID_WMPCOREEVENT_OPENSTATECHANGE:
CHECK_EXPECT(OPENSTATE, V_UI4(pDispParams->rgvarg));
if (winetest_debug > 1)
- trace("DISPID_WMPCOREEVENT_OPENSTATECHANGE, %d\n", V_UI4(pDispParams->rgvarg));
+ trace("DISPID_WMPCOREEVENT_OPENSTATECHANGE, %ld\n", V_UI4(pDispParams->rgvarg));
break;
case DISPID_WMPCOREEVENT_PLAYSTATECHANGE:
CHECK_EXPECT(PLAYSTATE, V_UI4(pDispParams->rgvarg));
@@ -156,7 +156,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
SetEvent(completed_event);
}
if (winetest_debug > 1)
- trace("DISPID_WMPCOREEVENT_PLAYSTATECHANGE, %d\n", V_UI4(pDispParams->rgvarg));
+ trace("DISPID_WMPCOREEVENT_PLAYSTATECHANGE, %ld\n", V_UI4(pDispParams->rgvarg));
break;
case DISPID_WMPCOREEVENT_MEDIACHANGE:
if (winetest_debug > 1)
@@ -172,7 +172,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
break;
default:
if (winetest_debug > 1)
- trace("event: %d\n", dispIdMember);
+ trace("event: %ld\n", dispIdMember);
break;
}
@@ -227,22 +227,22 @@ static void test_completion_event(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
filename = SysAllocString(load_resource(mp3file1s));
@@ -260,7 +260,7 @@ static void test_completion_event(void)
SET_EXPECT(OPENSTATE, wmposMediaChanging);
SET_EXPECT(PLAYSTATE, wmppsReady);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
res = pump_messages(3000, 1, &completed_event);
ok(res == WAIT_OBJECT_0, "Timed out while waiting for media to complete\n");
@@ -281,7 +281,7 @@ static void test_completion_event(void)
CLEAR_CALLED(OPENSTATE, wmposMediaOpening);
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IConnectionPoint_Release(point);
IWMPPlayer4_Release(player4);
@@ -315,47 +315,47 @@ static BOOL test_wmp(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return FALSE;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
settings = NULL;
hres = IWMPPlayer4_get_settings(player4, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IWMPSettings_put_autoStart(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08lx\n", hres);
controls = NULL;
hres = IWMPPlayer4_get_controls(player4, &controls);
- ok(hres == S_OK, "get_controls failed: %08x\n", hres);
+ ok(hres == S_OK, "get_controls failed: %08lx\n", hres);
ok(controls != NULL, "controls = NULL\n");
bstrcurrentPosition = SysAllocString(L"currentPosition");
hres = IWMPControls_get_isAvailable(controls, bstrcurrentPosition, &vbool);
- ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08lx\n", hres);
ok(vbool == VARIANT_FALSE, "unexpected value\n");
hres = IWMPControls_play(controls);
- ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_play is available: %08x\n", hres);
+ ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_play is available: %08lx\n", hres);
hres = IWMPSettings_put_volume(settings, 36);
- ok(hres == S_OK, "IWMPSettings_put_volume failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPSettings_put_volume failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 36, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 36, "unexpected value: %ld\n", progress);
filename = SysAllocString(load_resource(mp3file));
@@ -365,7 +365,7 @@ static BOOL test_wmp(void)
SET_EXPECT(PLAYSTATE, wmppsTransitioning);
SET_EXPECT(PLAYSTATE, wmppsReady);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
CHECK_CALLED(OPENSTATE, wmposPlaylistChanging);
CHECK_CALLED(OPENSTATE, wmposPlaylistChanged);
CHECK_CALLED(OPENSTATE, wmposPlaylistOpenNoMedia);
@@ -379,7 +379,7 @@ static BOOL test_wmp(void)
/* MediaOpening happens only on xp, 2003 */
SET_EXPECT(OPENSTATE, wmposMediaOpening);
hres = IWMPControls_play(controls);
- ok(hres == S_OK, "IWMPControls_play failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_play failed: %08lx\n", hres);
res = pump_messages(1000, 1, &playing_event);
ok(res == WAIT_OBJECT_0 || broken(res == WAIT_TIMEOUT), "Timed out while waiting for media to become ready\n");
if (res == WAIT_TIMEOUT) {
@@ -397,55 +397,55 @@ static BOOL test_wmp(void)
CLEAR_CALLED(OPENSTATE, wmposMediaOpening);
hres = IWMPControls_get_isAvailable(controls, bstrcurrentPosition, &vbool);
- ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "unexpected value\n");
duration = 0.0;
hres = IWMPControls_get_currentPosition(controls, &duration);
- ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08lx\n", hres);
ok((int)duration == 0, "unexpected value %f\n", duration);
duration = 1.1;
hres = IWMPControls_put_currentPosition(controls, duration);
- ok(hres == S_OK, "IWMPControls_put_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_put_currentPosition failed: %08lx\n", hres);
duration = 0.0;
hres = IWMPControls_get_currentPosition(controls, &duration);
- ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_get_currentPosition failed: %08lx\n", hres);
ok(duration >= 1.05 /* save some fp errors */, "unexpected value %f\n", duration);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "IWMPPlayer4_get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_currentMedia failed: %08lx\n", hres);
hres = IWMPMedia_get_duration(media, &duration);
- ok(hres == S_OK, "IWMPMedia_get_duration failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPMedia_get_duration failed: %08lx\n", hres);
ok(floor(duration + 0.5) == 3, "unexpected value: %f\n", duration);
IWMPMedia_Release(media);
network = NULL;
hres = IWMPPlayer4_get_network(player4, &network);
- ok(hres == S_OK, "get_network failed: %08x\n", hres);
+ ok(hres == S_OK, "get_network failed: %08lx\n", hres);
ok(network != NULL, "network = NULL\n");
progress = 0;
hres = IWMPNetwork_get_bufferingProgress(network, &progress);
- ok(hres == S_OK || broken(hres == S_FALSE), "IWMPNetwork_get_bufferingProgress failed: %08x\n", hres);
- ok(progress == 100, "unexpected value: %d\n", progress);
+ ok(hres == S_OK || broken(hres == S_FALSE), "IWMPNetwork_get_bufferingProgress failed: %08lx\n", hres);
+ ok(progress == 100, "unexpected value: %ld\n", progress);
progress = 0;
hres = IWMPNetwork_get_downloadProgress(network, &progress);
- ok(hres == S_OK, "IWMPNetwork_get_downloadProgress failed: %08x\n", hres);
- ok(progress == 100, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPNetwork_get_downloadProgress failed: %08lx\n", hres);
+ ok(progress == 100, "unexpected value: %ld\n", progress);
IWMPNetwork_Release(network);
SET_EXPECT(PLAYSTATE, wmppsStopped);
/* The following happens on wine only since we close media on stop */
SET_EXPECT(OPENSTATE, wmposPlaylistOpenNoMedia);
hres = IWMPControls_stop(controls);
- ok(hres == S_OK, "IWMPControls_stop failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_stop failed: %08lx\n", hres);
CHECK_CALLED(PLAYSTATE, wmppsStopped);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposPlaylistOpenNoMedia);
/* Already Stopped */
hres = IWMPControls_stop(controls);
- ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_stop is available: %08x\n", hres);
+ ok(hres == NS_S_WMPCORE_COMMAND_NOT_AVAILABLE, "IWMPControls_stop is available: %08lx\n", hres);
SET_EXPECT(PLAYSTATE, wmppsPlaying);
/* The following happens on wine only since we close media on stop */
@@ -453,7 +453,7 @@ static BOOL test_wmp(void)
SET_EXPECT(OPENSTATE, wmposMediaOpen);
SET_EXPECT(PLAYSTATE, wmppsTransitioning);
hres = IWMPControls_play(controls);
- ok(hres == S_OK, "IWMPControls_play failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPControls_play failed: %08lx\n", hres);
CHECK_CALLED(PLAYSTATE, wmppsPlaying);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposOpeningUnknownURL);
todo_wine CHECK_NOT_CALLED(OPENSTATE, wmposMediaOpen);
@@ -461,16 +461,16 @@ static BOOL test_wmp(void)
playback_skip:
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 36, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 36, "unexpected value: %ld\n", progress);
hres = IWMPSettings_put_volume(settings, 99);
- ok(hres == S_OK, "IWMPSettings_put_volume failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPSettings_put_volume failed: %08lx\n", hres);
hres = IWMPSettings_get_volume(settings, &progress);
- ok(hres == S_OK, "IWMPSettings_get_volume failed: %08x\n", hres);
- ok(progress == 99, "unexpected value: %d\n", progress);
+ ok(hres == S_OK, "IWMPSettings_get_volume failed: %08lx\n", hres);
+ ok(progress == 99, "unexpected value: %ld\n", progress);
IConnectionPoint_Release(point);
IWMPSettings_Release(settings);
@@ -517,27 +517,27 @@ static void test_media_item(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
hr = IWMPPlayer4_newMedia(player, NULL, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected name %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
media2 = (void *)0xdeadbeef;
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_FALSE, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_FALSE, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 == NULL, "Unexpected media instance.\n");
hr = IWMPPlayer4_put_currentMedia(player, media);
- ok(hr == S_OK, "Failed to set current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set current media, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_OK, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 != NULL && media != media2, "Unexpected media instance.\n");
IWMPMedia_Release(media2);
@@ -545,38 +545,38 @@ static void test_media_item(void)
str = SysAllocStringLen(NULL, 0);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected name %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media);
str = SysAllocString(mp3file);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
hr = IWMPMedia_put_name(media, NULL);
- ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
hr = IWMPPlayer4_put_currentMedia(player, media);
- ok(hr == S_OK, "Failed to set current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set current media, hr %#lx.\n", hr);
IWMPMedia_Release(media);
hr = IWMPPlayer4_get_currentMedia(player, &media2);
- ok(hr == S_OK, "Failed to get current media, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get current media, hr %#lx.\n", hr);
ok(media2 != NULL, "Unexpected media instance.\n");
hr = IWMPMedia_get_name(media2, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, L"test"), "Expected %s, got %s\n", wine_dbgstr_w(L"test"), wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media2);
@@ -593,10 +593,10 @@ static void test_media_item(void)
str = SysAllocString(pathW);
hr = IWMPPlayer4_newMedia(player, str, &media);
- ok(hr == S_OK, "Failed to create a media item, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a media item, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPMedia_get_name(media, &str);
- ok(hr == S_OK, "Failed to get item name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get item name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, tests[i].expected), "Expected %s, got %s\n", wine_dbgstr_w(tests[i].expected), wine_dbgstr_w(str));
SysFreeString(str);
IWMPMedia_Release(media);
@@ -617,35 +617,35 @@ static void test_player_url(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to get url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
str2 = SysAllocString(mp3file);
hr = IWMPPlayer4_put_URL(player, str2);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
hr = IWMPPlayer4_put_URL(player, NULL);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url, %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
/* Empty url */
hr = IWMPPlayer4_put_URL(player, str2);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
str = SysAllocStringLen(NULL, 0);
hr = IWMPPlayer4_put_URL(player, str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
SysFreeString(str);
hr = IWMPPlayer4_get_URL(player, &str);
- ok(hr == S_OK, "Failed to set url, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to set url, hr %#lx.\n", hr);
ok(*str == 0, "Unexpected url, %s.\n", wine_dbgstr_w(str));
SysFreeString(str);
@@ -668,38 +668,38 @@ static void test_playlist(void)
win_skip("CLSID_WindowsMediaPlayer is not registered.\n");
return;
}
- ok(hr == S_OK, "Failed to create media player instance, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create media player instance, hr %#lx.\n", hr);
playlist = NULL;
hr = IWMPPlayer4_get_currentPlaylist(player, &playlist);
- ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hr);
+ ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hr);
ok(playlist != NULL, "playlist == NULL\n");
if (0) /* fails on non-English locales */
{
hr = IWMPPlaylist_get_name(playlist, &str);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
ok(!lstrcmpW(str, nameW), "Expected %s, got %s\n", wine_dbgstr_w(nameW), wine_dbgstr_w(str));
SysFreeString(str);
}
hr = IWMPPlaylist_get_count(playlist, NULL);
- ok(hr == E_POINTER, "Failed to get count, hr %#x.\n", hr);
+ ok(hr == E_POINTER, "Failed to get count, hr %#lx.\n", hr);
count = -1;
hr = IWMPPlaylist_get_count(playlist, &count);
- ok(hr == S_OK, "Failed to get count, hr %#x.\n", hr);
- ok(count == 0, "Expected 0, got %d\n", count);
+ ok(hr == S_OK, "Failed to get count, hr %#lx.\n", hr);
+ ok(count == 0, "Expected 0, got %ld\n", count);
IWMPPlaylist_Release(playlist);
/* newPlaylist doesn't change current playlist */
hr = IWMPPlayer4_newPlaylist(player, NULL, NULL, &playlist);
- ok(hr == S_OK, "Failed to create a playlist, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a playlist, hr %#lx.\n", hr);
playlist2 = NULL;
hr = IWMPPlayer4_get_currentPlaylist(player, &playlist2);
- ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hr);
+ ok(hr == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hr);
ok(playlist2 != NULL && playlist2 != playlist, "Unexpected playlist instance\n");
IWMPPlaylist_Release(playlist2);
@@ -707,13 +707,13 @@ static void test_playlist(void)
/* different playlists can have the same name */
str = SysAllocString(nameW);
hr = IWMPPlaylist_put_name(playlist, str);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
playlist2 = NULL;
hr = IWMPPlayer4_newPlaylist(player, str, NULL, &playlist2);
- ok(hr == S_OK, "Failed to create a playlist, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to create a playlist, hr %#lx.\n", hr);
hr = IWMPPlaylist_get_name(playlist2, &str2);
- ok(hr == S_OK, "Failed to get playlist name, hr %#x.\n", hr);
+ ok(hr == S_OK, "Failed to get playlist name, hr %#lx.\n", hr);
ok(playlist != playlist2, "Expected playlists to be different");
ok(!lstrcmpW(str, str2), "Expected names to be the same\n");
SysFreeString(str);
diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c
index 80f078e62f5..f36e07dabfc 100644
--- a/dlls/wmp/tests/oleobj.c
+++ b/dlls/wmp/tests/oleobj.c
@@ -83,7 +83,7 @@ static inline WCHAR *load_resource(const WCHAR *name)
lstrcatW(pathW, name);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
- ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW),
+ ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW),
GetLastError());
res = FindResourceW(NULL, name, (LPCWSTR)RT_RCDATA);
@@ -513,7 +513,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REF
CHECK_EXPECT(Invoke_USERMODE);
break;
default:
- ok(0, "unexpected call Invoke(%d)\n", dispIdMember);
+ ok(0, "unexpected call Invoke(%ld)\n", dispIdMember);
}
return E_NOTIMPL;
@@ -550,7 +550,7 @@ static HRESULT WINAPI WMPOCXEvents_Invoke(IDispatch *iface, DISPID dispIdMember,
{
switch(dispIdMember) {
default:
- ok(0, "unexpected call Invoke(%d)\n", dispIdMember);
+ ok(0, "unexpected call Invoke(%ld)\n", dispIdMember);
}
return E_NOTIMPL;
@@ -691,7 +691,7 @@ static HRESULT WINAPI InPlaceSiteWindowless_OnInPlaceActivateEx(
IOleInPlaceSiteWindowless *iface, BOOL *pfNoRedraw, DWORD dwFlags)
{
CHECK_EXPECT(OnInPlaceActivateEx);
- ok(!dwFlags, "dwFlags = %x\n", dwFlags);
+ ok(!dwFlags, "dwFlags = %lx\n", dwFlags);
ok(pfNoRedraw != NULL, "pfNoRedraw = NULL\n");
return S_OK;
}
@@ -870,21 +870,21 @@ static void test_ConnectionPoint(IOleObject *unk)
static DWORD dw = 100;
hres = IOleObject_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
+ ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
IConnectionPointContainer_Release(container);
- ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
+ ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IConnectionPoint_Advise(point, (IUnknown*)&WMPOCXEvents, &dw);
- ok(hres == S_OK, "Advise failed: %08x\n", hres);
- ok(dw == 1, "dw=%d, expected 1\n", dw);
+ ok(hres == S_OK, "Advise failed: %08lx\n", hres);
+ ok(dw == 1, "dw=%ld, expected 1\n", dw);
hres = IConnectionPoint_Unadvise(point, dw);
- ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
+ ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
IConnectionPoint_Release(point);
}
@@ -905,11 +905,11 @@ static void test_wmp_ifaces(IOleObject *oleobj)
BSTR url;
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
- ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08lx\n", hres);
controls = NULL;
hres = IWMPPlayer4_get_controls(player4, &controls);
- ok(hres == S_OK, "get_controls failed: %08x\n", hres);
+ ok(hres == S_OK, "get_controls failed: %08lx\n", hres);
ok(controls != NULL, "controls = NULL\n");
player = NULL;
@@ -919,7 +919,7 @@ static void test_wmp_ifaces(IOleObject *oleobj)
unk = NULL;
hres = IWMPControls_QueryInterface(controls, &IID_IUnknown, (void **)&unk);
- ok(hres == S_OK, "Failed to get IUnknown, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get IUnknown, hr %#lx.\n", hres);
ok(unk != NULL, "Unexpected interface pointer.\n");
IUnknown_Release(unk);
@@ -928,7 +928,7 @@ static void test_wmp_ifaces(IOleObject *oleobj)
/* IWPNetwork */
network = NULL;
hres = IWMPPlayer4_get_network(player4, &network);
- ok(hres == S_OK, "get_network failed: %08x\n", hres);
+ ok(hres == S_OK, "get_network failed: %08lx\n", hres);
ok(network != NULL, "network = NULL\n");
player = NULL;
@@ -940,19 +940,19 @@ static void test_wmp_ifaces(IOleObject *oleobj)
playlist = NULL;
hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPPlaylist, (void**)&playlist);
- ok(hres == E_NOINTERFACE, "Getting IWMPPlaylist from IWMPPlayer4 succeeded: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "Getting IWMPPlaylist from IWMPPlayer4 succeeded: %08lx\n", hres);
ok(playlist == NULL, "playlist != NULL\n");
playlist = NULL;
hres = IWMPPlayer4_get_currentPlaylist(player4, &playlist);
- ok(hres == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_currentPlaylist failed: %08lx\n", hres);
ok(playlist != NULL, "playlist != NULL\n");
IWMPPlaylist_Release(playlist);
media = NULL;
hres = IWMPPlayer4_QueryInterface(player4, &IID_IWMPMedia, (void**)&media);
- ok(hres == E_NOINTERFACE, "get_currentMedia SUCCEEDED: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "get_currentMedia SUCCEEDED: %08lx\n", hres);
ok(media == NULL, "media != NULL\n");
/* Test media put/get */
@@ -966,92 +966,92 @@ static void test_wmp_ifaces(IOleObject *oleobj)
SET_EXPECT(GetContainer);
SET_EXPECT(Invoke_USERMODE);
hres = IWMPPlayer4_put_URL(player4, filename);
- ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_put_URL failed: %08lx\n", hres);
todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);
todo_wine CHECK_CALLED(Invoke_USERMODE);
url = NULL;
SET_EXPECT(Invoke_USERMODE);
hres = IWMPPlayer4_get_URL(player4, &url);
- ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08lx\n", hres);
ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
todo_wine CHECK_CALLED(Invoke_USERMODE);
SysFreeString(url);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "get_currentMedia failed: %08lx\n", hres);
ok(media != NULL, "media = (%p)\n", media);
url = NULL;
hres = IWMPMedia_get_sourceURL(media, &url);
- ok(hres == S_OK, "IWMPMedia_get_sourceURL failed: %08x\n", hres);
+ ok(hres == S_OK, "IWMPMedia_get_sourceURL failed: %08lx\n", hres);
ok(0 == lstrcmpW(url, filename), "%s != %s\n", wine_dbgstr_w(url), wine_dbgstr_w(filename));
SysFreeString(url);
SET_EXPECT(GetContainer);
hres = IWMPPlayer4_put_currentMedia(player4, media);
- ok(hres == S_OK, "put_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "put_currentMedia failed: %08lx\n", hres);
todo_wine CHECK_CALLED_OR_BROKEN(GetContainer);
IWMPMedia_Release(media);
hres = IWMPPlayer4_get_currentMedia(player4, &media);
- ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres);
+ ok(hres == S_OK, "get_currentMedia failed: %08lx\n", hres);
ok(media != NULL, "media = (%p)\n", media);
IWMPMedia_Release(media);
settings = NULL;
hres = IWMPPlayer4_get_settings(player4, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
- ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPSettings iface: %08lx\n", hres);
ok(settings == settings_qi, "settings != settings_qi\n");
IWMPSettings_Release(settings_qi);
/* Test few settings put/gets */
hres = IWMPSettings_get_autoStart(settings, &vbool);
- ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "autoStart = %x\n", vbool);
hres = IWMPSettings_put_autoStart(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put autoStart in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_autoStart(settings, &vbool);
- ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get autoStart from IWMPSettings: %08lx\n", hres);
ok(!vbool, "autoStart = %x\n", vbool);
hres = IWMPSettings_get_invokeURLs(settings, &vbool);
- ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "invokeURLs = %x\n", vbool);
hres = IWMPSettings_put_invokeURLs(settings, VARIANT_FALSE);
- ok(hres == S_OK, "Could not put invokeURLs in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put invokeURLs in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_invokeURLs(settings, &vbool);
- ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get invokeURLs from IWMPSettings: %08lx\n", hres);
ok(!vbool, "invokeURLs = %x\n", vbool);
hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
- ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_FALSE, "enableErrorDialogs = %x\n", vbool);
hres = IWMPSettings_put_enableErrorDialogs(settings, VARIANT_TRUE);
- ok(hres == S_OK, "Could not put enableErrorDialogs in IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not put enableErrorDialogs in IWMPSettings: %08lx\n", hres);
hres = IWMPSettings_get_enableErrorDialogs(settings, &vbool);
- ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08x\n", hres);
+ ok(hres == S_OK, "Could not get enableErrorDialogs from IWMPSettings: %08lx\n", hres);
ok(vbool == VARIANT_TRUE, "enableErrorDialogs = %x\n", vbool);
IWMPSettings_Release(settings);
IWMPPlayer4_Release(player4);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer, (void**)&player);
- ok(hres == S_OK, "Could not get IWMPPlayer iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPPlayer iface: %08lx\n", hres);
settings = NULL;
hres = IWMPPlayer_get_settings(player, &settings);
- ok(hres == S_OK, "get_settings failed: %08x\n", hres);
+ ok(hres == S_OK, "get_settings failed: %08lx\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
- ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IWMPSettings iface: %08lx\n", hres);
ok(settings == settings_qi, "settings != settings_qi\n");
IWMPSettings_Release(settings_qi);
@@ -1064,8 +1064,8 @@ static void test_wmp_ifaces(IOleObject *oleobj)
#define test_rect_size(a,b,c) _test_rect_size(__LINE__,a,b,c)
static void _test_rect_size(unsigned line, const RECT *r, int width, int height)
{
- ok_(__FILE__,line)(r->right-r->left == width, "width = %d, expected %d\n", r->right-r->left, width);
- ok_(__FILE__,line)(r->bottom-r->top == height, "height = %d, expected %d\n", r->bottom-r->top, height);
+ ok_(__FILE__,line)(r->right-r->left == width, "width = %ld, expected %d\n", r->right-r->left, width);
+ ok_(__FILE__,line)(r->bottom-r->top == height, "height = %ld, expected %d\n", r->bottom-r->top, height);
}
static void test_window(HWND hwnd)
@@ -1079,13 +1079,13 @@ static void test_window(HWND hwnd)
ok(!strncmp(class_name, "ATL:", 4), "class_name = %s %d\n", class_name, i);
res = GetWindowInfo(hwnd, &wi);
- ok(res, "GetWindowInfo failed: %u\n", GetLastError());
+ ok(res, "GetWindowInfo failed: %lu\n", GetLastError());
test_rect_size(&wi.rcWindow, 400, 410);
test_rect_size(&wi.rcClient, 400, 410);
- ok(wi.dwStyle == (WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE|WS_CHILD), "dwStyle = %x\n", wi.dwStyle);
- ok(!(wi.dwExStyle & ~0x800 /* undocumented, set by some versions */), "dwExStyle = %x\n", wi.dwExStyle);
+ ok(wi.dwStyle == (WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE|WS_CHILD), "dwStyle = %lx\n", wi.dwStyle);
+ ok(!(wi.dwExStyle & ~0x800 /* undocumented, set by some versions */), "dwExStyle = %lx\n", wi.dwExStyle);
ok(IsWindowVisible(hwnd), "Window is not visible\n");
}
@@ -1099,10 +1099,10 @@ static void test_QI(IUnknown *unk)
ok(hres == E_NOINTERFACE, "Got IQuickActivate iface when no expected\n");
hres = IUnknown_QueryInterface(unk, &IID_IMarshal, (void**)&tmp);
- ok(hres == E_NOINTERFACE, "Could not get IMarshal iface: %08x\n", hres);
+ ok(hres == E_NOINTERFACE, "Could not get IMarshal iface: %08lx\n", hres);
hres = IUnknown_QueryInterface(unk, &IID_IOleInPlaceObjectWindowless, (void**)&tmp);
- ok(hres == S_OK, "Could not get IOleInPlaceObjectWindowless iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IOleInPlaceObjectWindowless iface: %08lx\n", hres);
IUnknown_Release(tmp);
}
@@ -1113,20 +1113,20 @@ static void test_IConnectionPointContainer(IOleObject *oleobj)
HRESULT hres;
hres = IOleObject_QueryInterface(oleobj, &IID_IConnectionPointContainer, (void**)&container);
- ok(hres == S_OK, "Could not get IConnectionPointContainer iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IConnectionPointContainer iface: %08lx\n", hres);
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IPropertyNotifySink, &point);
- ok(hres == CONNECT_E_NOCONNECTION, "got: %08x\n", hres);
+ ok(hres == CONNECT_E_NOCONNECTION, "got: %08lx\n", hres);
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IWMPEvents, &point);
- todo_wine ok(hres == S_OK, "got: %08x\n", hres);
+ todo_wine ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID_IWMPEvents2, &point);
- todo_wine ok(hres == S_OK, "got: %08x\n", hres);
+ todo_wine ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
@@ -1146,7 +1146,7 @@ static void test_IConnectionPointContainer(IOleObject *oleobj)
point = NULL;
hres = IConnectionPointContainer_FindConnectionPoint(container, &IID__WMPOCXEvents, &point);
- ok(hres == S_OK, "got: %08x\n", hres);
+ ok(hres == S_OK, "got: %08lx\n", hres);
if(point)
IConnectionPoint_Release(point);
@@ -1167,40 +1167,40 @@ static void test_extent(IOleObject *oleobj)
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(0, hdc);
if (dpi_x != 96 || dpi_y != 96)
- trace("dpi: %d / %d\n", dpi_y, dpi_y);
+ trace("dpi: %ld / %ld\n", dpi_y, dpi_y);
extent.cx = extent.cy = 0xdeadbeef;
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
expected.cx = MulDiv(192, 2540, dpi_x);
expected.cy = MulDiv(192, 2540, dpi_y);
- ok(extent.cx == expected.cx && extent.cy == expected.cy, "size = {%d %d} (expected %d %d)\n",
+ ok(extent.cx == expected.cx && extent.cy == expected.cy, "size = {%ld %ld} (expected %ld %ld)\n",
extent.cx, extent.cy, expected.cx, expected.cy );
extent.cx = 800;
extent.cy = 700;
hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
extent.cx = extent.cy = 0xdeadbeef;
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &extent);
- ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
- ok(extent.cx == 800 && extent.cy == 700, "size = {%d %d}\n", extent.cx, extent.cy);
+ ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
+ ok(extent.cx == 800 && extent.cy == 700, "size = {%ld %ld}\n", extent.cx, extent.cy);
hres = IOleObject_GetExtent(oleobj, 0, &extent);
- ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres);
+ ok(hres == E_FAIL, "GetExtent failed: %08lx\n", hres);
hres = IOleObject_GetExtent(oleobj, 7, &extent);
- ok(hres == E_FAIL, "GetExtent failed: %08x\n", hres);
+ ok(hres == E_FAIL, "GetExtent failed: %08lx\n", hres);
extent.cx = 900;
extent.cy = 800;
hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &expected);
- ok(hres == S_OK, "SetExtent failed: %08x\n", hres);
+ ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
hres = IOleObject_SetExtent(oleobj, 0, &expected);
- ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres);
+ ok(hres == DV_E_DVASPECT, "SetExtent failed: %08lx\n", hres);
hres = IOleObject_SetExtent(oleobj, 7, &expected);
- ok(hres == DV_E_DVASPECT, "SetExtent failed: %08x\n", hres);
+ ok(hres == DV_E_DVASPECT, "SetExtent failed: %08lx\n", hres);
}
static void test_wmp(void)
@@ -1226,31 +1226,31 @@ static void test_wmp(void)
win_skip("CLSID_WindowsMediaPlayer not registered\n");
return;
}
- ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08x\n", hres);
+ ok(hres == S_OK, "Could not create CLSID_WindowsMediaPlayer instance: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPCore, (void**)&wmpcore);
- ok(hres == S_OK, "got 0x%08x\n", hres);
+ ok(hres == S_OK, "got 0x%08lx\n", hres);
hres = IWMPCore_get_versionInfo(wmpcore, NULL);
- ok(hres == E_POINTER, "got 0x%08x\n", hres);
+ ok(hres == E_POINTER, "got 0x%08lx\n", hres);
hres = IWMPCore_get_versionInfo(wmpcore, &str);
- ok(hres == S_OK, "got 0x%08x\n", hres);
+ ok(hres == S_OK, "got 0x%08lx\n", hres);
SysFreeString(str);
IWMPCore_Release(wmpcore);
hres = IOleObject_QueryInterface(oleobj, &IID_IProvideClassInfo2, (void**)&class_info);
- ok(hres == S_OK, "Could not get IProvideClassInfo2 iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IProvideClassInfo2 iface: %08lx\n", hres);
hres = IProvideClassInfo2_GetGUID(class_info, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &guid);
- ok(hres == S_OK, "GetGUID failed: %08x\n", hres);
+ ok(hres == S_OK, "GetGUID failed: %08lx\n", hres);
ok(IsEqualGUID(&guid, &IID__WMPOCXEvents), "guid = %s\n", wine_dbgstr_guid(&guid));
hres = IProvideClassInfo2_GetClassInfo(class_info, &ti);
- ok(hres == S_OK, "Failed to get class info, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get class info, hr %#lx.\n", hres);
hres = ITypeInfo_GetTypeAttr(ti, &attr);
- ok(hres == S_OK, "Failed to get type attributes, hr %#x.\n", hres);
+ ok(hres == S_OK, "Failed to get type attributes, hr %#lx.\n", hres);
ok(IsEqualGUID(&CLSID_WindowsMediaPlayer, &attr->guid), "Unexpected typeinfo guid %s\n", wine_dbgstr_guid(&attr->guid));
ITypeInfo_ReleaseTypeAttr(ti, attr);
ITypeInfo_Release(ti);
@@ -1262,25 +1262,25 @@ static void test_wmp(void)
test_extent(oleobj);
hres = IOleObject_GetMiscStatus(oleobj, DVASPECT_CONTENT, &misc_status);
- ok(hres == S_OK, "GetMiscStatus failed: %08x\n", hres);
+ ok(hres == S_OK, "GetMiscStatus failed: %08lx\n", hres);
ok(misc_status == (OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_INSIDEOUT
- |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE), "misc_status = %x\n", misc_status);
+ |OLEMISC_CANTLINKINSIDE|OLEMISC_RECOMPOSEONRESIZE), "misc_status = %lx\n", misc_status);
hres = IOleObject_QueryInterface(oleobj, &IID_IPersistStreamInit, (void**)&psi);
- ok(hres == S_OK, "Could not get IPersistStreamInit iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IPersistStreamInit iface: %08lx\n", hres);
hres = IOleObject_QueryInterface(oleobj, &IID_IOleInPlaceObject, (void**)&ipobj);
- ok(hres == S_OK, "Could not get IOleInPlaceObject iface: %08x\n", hres);
+ ok(hres == S_OK, "Could not get IOleInPlaceObject iface: %08lx\n", hres);
hres = IPersistStreamInit_InitNew(psi);
- ok(hres == E_FAIL || broken(hres == S_OK /* Old WMP */), "InitNew failed: %08x\n", hres);
+ ok(hres == E_FAIL || broken(hres == S_OK /* Old WMP */), "InitNew failed: %08lx\n", hres);
SET_EXPECT(GetContainer);
SET_EXPECT(GetExtendedControl);
SET_EXPECT(GetWindow);
SET_EXPECT(Invoke_USERMODE);
hres = IOleObject_SetClientSite(oleobj, &ClientSite);
- ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres);
todo_wine CHECK_CALLED(GetContainer);
CHECK_CALLED(GetExtendedControl);
todo_wine CHECK_CALLED(GetWindow);
@@ -1288,17 +1288,17 @@ static void test_wmp(void)
client_site = NULL;
hres = IOleObject_GetClientSite(oleobj, &client_site);
- ok(hres == S_OK, "GetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "GetClientSite failed: %08lx\n", hres);
ok(client_site == &ClientSite, "client_site != ClientSite\n");
SET_EXPECT(GetWindow);
hres = IPersistStreamInit_InitNew(psi);
- ok(hres == S_OK, "InitNew failed: %08x\n", hres);
+ ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
CHECK_CALLED(GetWindow);
hwnd = (HWND)0xdeadbeef;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == E_UNEXPECTED, "GetWindow failed: %08x\n", hres);
+ ok(hres == E_UNEXPECTED, "GetWindow failed: %08lx\n", hres);
ok(!hwnd, "hwnd = %p\n", hwnd);
SET_EXPECT(GetWindow);
@@ -1307,7 +1307,7 @@ static void test_wmp(void)
SET_EXPECT(GetWindowContext);
SET_EXPECT(ShowObject);
hres = IOleObject_DoVerb(oleobj, OLEIVERB_INPLACEACTIVATE, NULL, &ClientSite, 0, container_hwnd, &pos);
- ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
+ ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
CHECK_CALLED(GetWindow);
CHECK_CALLED(CanWindowlessActivate);
CHECK_CALLED(OnInPlaceActivateEx);
@@ -1316,44 +1316,44 @@ static void test_wmp(void)
hwnd = NULL;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == S_OK, "GetWindow failed: %08x\n", hres);
+ ok(hres == S_OK, "GetWindow failed: %08lx\n", hres);
ok(hwnd != NULL, "hwnd = NULL\n");
test_window(hwnd);
SetRect(&pos, 1, 2, 301, 312);
hres = IOleInPlaceObject_SetObjectRects(ipobj, &pos, &pos);
- ok(hres == S_OK, "SetObjectRects failed: %08x\n", hres);
+ ok(hres == S_OK, "SetObjectRects failed: %08lx\n", hres);
GetClientRect(hwnd, &pos);
test_rect_size(&pos, 300, 310);
test_wmp_ifaces(oleobj);
hres = IOleObject_DoVerb(oleobj, OLEIVERB_HIDE, NULL, &ClientSite, 0, container_hwnd, &pos);
- ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
+ ok(hres == S_OK, "DoVerb failed: %08lx\n", hres);
ok(!IsWindowVisible(hwnd), "Window is visible\n");
SET_EXPECT(OnShowWindow_FALSE);
SET_EXPECT(OnInPlaceDeactivate);
hres = IOleObject_Close(oleobj, 0);
- ok(hres == S_OK, "Close failed: %08x\n", hres);
+ ok(hres == S_OK, "Close failed: %08lx\n", hres);
todo_wine CHECK_CALLED(OnShowWindow_FALSE);
CHECK_CALLED(OnInPlaceDeactivate);
hwnd = (HWND)0xdeadbeef;
hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd);
- ok(hres == E_UNEXPECTED, "GetWindow failed: %08x\n", hres);
+ ok(hres == E_UNEXPECTED, "GetWindow failed: %08lx\n", hres);
ok(!hwnd, "hwnd = %p\n", hwnd);
hres = IOleObject_Close(oleobj, 0);
- ok(hres == S_OK, "Close failed: %08x\n", hres);
+ ok(hres == S_OK, "Close failed: %08lx\n", hres);
hres = IOleObject_SetClientSite(oleobj, NULL);
- ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
+ ok(hres == S_OK, "SetClientSite failed: %08lx\n", hres);
client_site = (void*)0xdeadbeef;
hres = IOleObject_GetClientSite(oleobj, &client_site);
- ok(hres == E_FAIL || broken(hres == S_OK), "GetClientSite failed: %08x\n", hres);
+ ok(hres == E_FAIL || broken(hres == S_OK), "GetClientSite failed: %08lx\n", hres);
ok(!client_site, "client_site = %p\n", client_site);
test_ConnectionPoint(oleobj);
@@ -1362,7 +1362,7 @@ static void test_wmp(void)
IOleInPlaceObject_Release(ipobj);
ref = IOleObject_Release(oleobj);
- ok(!ref, "ref = %d\n", ref);
+ ok(!ref, "ref = %ld\n", ref);
}
static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
2
1