Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
November 2020
- 73 participants
- 1459 messages
[PATCH] sti: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/sti/sti.c | 17 ++++-------------
dlls/sti/tests/sti.c | 2 +-
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/dlls/sti/sti.c b/dlls/sti/sti.c
index 962371f92d2..0bb60382979 100644
--- a/dlls/sti/sti.c
+++ b/dlls/sti/sti.c
@@ -32,14 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(sti);
-static const WCHAR registeredAppsLaunchPath[] = {
- 'S','O','F','T','W','A','R','E','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'S','t','i','l','l','I','m','a','g','e','\\',
- 'R','e','g','i','s','t','e','r','e','d',' ','A','p','p','l','i','c','a','t','i','o','n','s',0
-};
+static const WCHAR registeredAppsLaunchPath[] =
+ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StillImage\\Registered Applications";
typedef struct _stillimage
{
@@ -134,10 +128,7 @@ static HRESULT WINAPI stillimagew_GetSTILaunchInformation(IStillImageW *iface, L
static HRESULT WINAPI stillimagew_RegisterLaunchApplication(IStillImageW *iface, LPWSTR pwszAppName,
LPWSTR pwszCommandLine)
{
- static const WCHAR format[] = {'%','s',' ','%','s',0};
- static const WCHAR commandLineSuffix[] = {
- '/','S','t','i','D','e','v','i','c','e',':','%','1',' ',
- '/','S','t','i','E','v','e','n','t',':','%','2',0};
+ static const WCHAR commandLineSuffix[] = L"/StiDevice:%1 /StiEvent:%2";
HKEY registeredAppsKey = NULL;
DWORD ret;
HRESULT hr = S_OK;
@@ -152,7 +143,7 @@ static HRESULT WINAPI stillimagew_RegisterLaunchApplication(IStillImageW *iface,
WCHAR *value = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (value)
{
- swprintf(value, len, format, pwszCommandLine, commandLineSuffix);
+ swprintf(value, len, L"%s %s", pwszCommandLine, commandLineSuffix);
ret = RegSetValueExW(registeredAppsKey, pwszAppName, 0,
REG_SZ, (BYTE*)value, (lstrlenW(value)+1)*sizeof(WCHAR));
if (ret != ERROR_SUCCESS)
diff --git a/dlls/sti/tests/sti.c b/dlls/sti/tests/sti.c
index bd8b7b6b171..a87ab9fe47e 100644
--- a/dlls/sti/tests/sti.c
+++ b/dlls/sti/tests/sti.c
@@ -230,7 +230,7 @@ static void test_stillimage_aggregation(void)
static void test_launch_app_registry(void)
{
- static WCHAR appName[] = {'w','i','n','e','s','t','i','t','e','s','t','a','p','p',0};
+ static WCHAR appName[] = L"winestitestapp";
IStillImageW *pStiW = NULL;
HRESULT hr;
--
2.26.2
Nov. 30, 2020
[PATCH] cryptdlg: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/cryptdlg/main.c | 91 ++++++++++++++++----------------------------
1 file changed, 33 insertions(+), 58 deletions(-)
diff --git a/dlls/cryptdlg/main.c b/dlls/cryptdlg/main.c
index 4812ac9e621..e74ce0f48e7 100644
--- a/dlls/cryptdlg/main.c
+++ b/dlls/cryptdlg/main.c
@@ -109,21 +109,15 @@ HRESULT WINAPI CertTrustCleanup(CRYPT_PROVIDER_DATA *pProvData)
static BOOL CRYPTDLG_CheckOnlineCRL(void)
{
- static const WCHAR policyFlagsKey[] = { 'S','o','f','t','w','a','r','e',
- '\\','M','i','c','r','o','s','o','f','t','\\','C','r','y','p','t','o','g',
- 'r','a','p','h','y','\\','{','7','8','0','1','e','b','d','0','-','c','f',
- '4','b','-','1','1','d','0','-','8','5','1','f','-','0','0','6','0','9',
- '7','9','3','8','7','e','a','}',0 };
- static const WCHAR policyFlags[] = { 'P','o','l','i','c','y','F','l','a',
- 'g','s',0 };
HKEY key;
BOOL ret = FALSE;
- if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE, policyFlagsKey, 0, KEY_READ, &key))
+ if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ L"Software\\Microsoft\\Cryptography\\{7801ebd0-cf4b-11d0-851f-0060979387ea}", 0, KEY_READ, &key))
{
DWORD type, flags, size = sizeof(flags);
- if (!RegQueryValueExW(key, policyFlags, NULL, &type, (BYTE *)&flags,
+ if (!RegQueryValueExW(key, L"PolicyFlags", NULL, &type, (BYTE *)&flags,
&size) && type == REG_DWORD)
{
/* The flag values aren't defined in any header I'm aware of, but
@@ -149,10 +143,8 @@ static BOOL CRYPTDLG_IsCertAllowed(PCCERT_CONTEXT pCert)
if ((ret = CertGetCertificateContextProperty(pCert,
CERT_SIGNATURE_HASH_PROP_ID, hash, &size)))
{
- static const WCHAR disallowedW[] =
- { 'D','i','s','a','l','l','o','w','e','d',0 };
HCERTSTORE disallowed = CertOpenStore(CERT_STORE_PROV_SYSTEM_W,
- X509_ASN_ENCODING, 0, CERT_SYSTEM_STORE_CURRENT_USER, disallowedW);
+ X509_ASN_ENCODING, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"Disallowed");
if (disallowed)
{
@@ -487,8 +479,6 @@ static BOOL CRYPT_FormatHexString(const BYTE *pbEncoded, DWORD cbEncoded,
}
else
{
- static const WCHAR fmt[] = { '%','0','2','x',' ',0 };
- static const WCHAR endFmt[] = { '%','0','2','x',0 };
DWORD i;
LPWSTR ptr = str;
@@ -498,9 +488,9 @@ static BOOL CRYPT_FormatHexString(const BYTE *pbEncoded, DWORD cbEncoded,
for (i = 0; i < cbEncoded; i++)
{
if (i < cbEncoded - 1)
- ptr += swprintf(ptr, 4, fmt, pbEncoded[i]);
+ ptr += swprintf(ptr, 4, L"%02x ", pbEncoded[i]);
else
- ptr += swprintf(ptr, 3, endFmt, pbEncoded[i]);
+ ptr += swprintf(ptr, 3, L"%02x", pbEncoded[i]);
}
}
else
@@ -510,11 +500,7 @@ static BOOL CRYPT_FormatHexString(const BYTE *pbEncoded, DWORD cbEncoded,
return ret;
}
-static const WCHAR indent[] = { ' ',' ',' ',' ',' ',0 };
-static const WCHAR colonCrlf[] = { ':','\r','\n',0 };
-static const WCHAR colonSpace[] = { ':',' ',0 };
-static const WCHAR crlf[] = { '\r','\n',0 };
-static const WCHAR commaSep[] = { ',',' ',0 };
+static const WCHAR indent[] = L" ";
static BOOL CRYPT_FormatCPS(DWORD dwCertEncodingType,
DWORD dwFormatStrType, const BYTE *pbEncoded, DWORD cbEncoded,
@@ -531,9 +517,9 @@ static BOOL CRYPT_FormatCPS(DWORD dwCertEncodingType,
DWORD sepLen;
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
- sep = crlf;
+ sep = L"\r\n";
else
- sep = commaSep;
+ sep = L", ";
sepLen = lstrlenW(sep);
@@ -589,7 +575,6 @@ static BOOL CRYPT_FormatUserNotice(DWORD dwCertEncodingType,
X509_PKIX_POLICY_QUALIFIER_USERNOTICE, pbEncoded, cbEncoded,
CRYPT_DECODE_ALLOC_FLAG, NULL, ¬ice, &size)))
{
- static const WCHAR numFmt[] = { '%','d',0 };
CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *pNoticeRef =
notice->pNoticeReference;
LPCWSTR headingSep, sep;
@@ -608,13 +593,13 @@ static BOOL CRYPT_FormatUserNotice(DWORD dwCertEncodingType,
(LPWSTR)¬iceText, 0);
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
{
- headingSep = colonCrlf;
- sep = crlf;
+ headingSep = L":\r\n";
+ sep = L"\r\n";
}
else
{
- headingSep = colonSpace;
- sep = commaSep;
+ headingSep = L": ";
+ sep = L", ";
}
sepLen = lstrlenW(sep);
headingSepLen = lstrlenW(headingSep);
@@ -704,7 +689,7 @@ static BOOL CRYPT_FormatUserNotice(DWORD dwCertEncodingType,
memcpy(str, noticeNum, noticeNumLen * sizeof(WCHAR));
str += noticeNumLen;
}
- swprintf(noticeNumStr, ARRAY_SIZE(noticeNumStr), numFmt, k + 1);
+ swprintf(noticeNumStr, ARRAY_SIZE(noticeNumStr), L"%d", k + 1);
charsNeeded += lstrlenW(noticeNumStr);
if (str && *pcchStr >= charsNeeded)
{
@@ -788,7 +773,6 @@ BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType,
if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_CERT_POLICIES,
pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &policies, &size)))
{
- static const WCHAR numFmt[] = { '%','d',0 };
DWORD charsNeeded = 1; /* space for NULL terminator */
LPCWSTR headingSep, sep;
DWORD headingSepLen, sepLen;
@@ -815,13 +799,13 @@ BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType,
(LPWSTR)&qualifier, 0);
if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE)
{
- headingSep = colonCrlf;
- sep = crlf;
+ headingSep = L":\r\n";
+ sep = L"\r\n";
}
else
{
- headingSep = colonSpace;
- sep = commaSep;
+ headingSep = L": ";
+ sep = L", ";
}
sepLen = lstrlenW(sep);
headingSepLen = lstrlenW(headingSep);
@@ -835,7 +819,7 @@ BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType,
charsNeeded += 1; /* '['*/
if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR))
*str++ = '[';
- swprintf(policyNum, ARRAY_SIZE(policyNum), numFmt, i + 1);
+ swprintf(policyNum, ARRAY_SIZE(policyNum), L"%d", i + 1);
charsNeeded += lstrlenW(policyNum);
if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR))
{
@@ -912,7 +896,7 @@ BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType,
charsNeeded += 1; /* ','*/
if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR))
*str++ = ',';
- swprintf(policyQualifierNum, ARRAY_SIZE(policyQualifierNum), numFmt, j + 1);
+ swprintf(policyQualifierNum, ARRAY_SIZE(policyQualifierNum), L"%d", j + 1);
charsNeeded += lstrlenW(policyQualifierNum);
if (str && *pcbFormat >= charsNeeded * sizeof(WCHAR))
{
@@ -1120,22 +1104,13 @@ BOOL WINAPI FormatVerisignExtension(DWORD dwCertEncodingType,
*/
HRESULT WINAPI DllRegisterServer(void)
{
- static WCHAR cryptdlg[] = { 'c','r','y','p','t','d','l','g','.',
- 'd','l','l',0 };
- static WCHAR wintrust[] = { 'w','i','n','t','r','u','s','t','.',
- 'd','l','l',0 };
- static WCHAR certTrustInit[] = { 'C','e','r','t','T','r','u','s','t',
- 'I','n','i','t',0 };
- static WCHAR wintrustCertificateTrust[] = { 'W','i','n','t','r','u','s','t',
- 'C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t',0 };
- static WCHAR certTrustCertPolicy[] = { 'C','e','r','t','T','r','u','s','t',
- 'C','e','r','t','P','o','l','i','c','y',0 };
- static WCHAR certTrustFinalPolicy[] = { 'C','e','r','t','T','r','u','s','t',
- 'F','i','n','a','l','P','o','l','i','c','y',0 };
- static WCHAR certTrustCleanup[] = { 'C','e','r','t','T','r','u','s','t',
- 'C','l','e','a','n','u','p',0 };
- static const WCHAR cryptDlg[] = { 'c','r','y','p','t','d','l','g','.',
- 'd','l','l',0 };
+ static WCHAR cryptdlg[] = L"cryptdlg.dll";
+ static WCHAR wintrust[] = L"wintrust.dll";
+ static WCHAR certTrustInit[] = L"CertTrustInit";
+ static WCHAR wintrustCertificateTrust[] = L"WintrustCertificateTrust";
+ static WCHAR certTrustCertPolicy[] = L"CertTrustCertPolicy";
+ static WCHAR certTrustFinalPolicy[] = L"CertTrustFinalPolicy";
+ static WCHAR certTrustCleanup[] = L"CertTrustCleanup";
CRYPT_REGISTER_ACTIONID reg;
GUID guid = CERT_CERTIFICATE_ACTION_VERIFY;
HRESULT hr = S_OK;
@@ -1160,17 +1135,17 @@ HRESULT WINAPI DllRegisterServer(void)
if (!WintrustAddActionID(&guid, WT_ADD_ACTION_ID_RET_RESULT_FLAG, ®))
hr = GetLastError();
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC,
- "1.3.6.1.4.1.311.16.1.1", cryptDlg, "EncodeAttrSequence");
+ "1.3.6.1.4.1.311.16.1.1", L"cryptdlg.dll", "EncodeAttrSequence");
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC,
- szOID_MICROSOFT_Encryption_Key_Preference, cryptDlg, "EncodeRecipientID");
+ szOID_MICROSOFT_Encryption_Key_Preference, L"cryptdlg.dll", "EncodeRecipientID");
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC,
- "1.3.6.1.4.1.311.16.1.1", cryptDlg, "DecodeAttrSequence");
+ "1.3.6.1.4.1.311.16.1.1", L"cryptdlg.dll", "DecodeAttrSequence");
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC,
- szOID_MICROSOFT_Encryption_Key_Preference, cryptDlg, "DecodeRecipientID");
+ szOID_MICROSOFT_Encryption_Key_Preference, L"cryptdlg.dll", "DecodeRecipientID");
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC,
- szOID_PKIX_KP_EMAIL_PROTECTION, cryptDlg, "FormatPKIXEmailProtection");
+ szOID_PKIX_KP_EMAIL_PROTECTION, L"cryptdlg.dll", "FormatPKIXEmailProtection");
CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC,
- szOID_CERT_POLICIES, cryptDlg, "FormatVerisignExtension");
+ szOID_CERT_POLICIES, L"cryptdlg.dll", "FormatVerisignExtension");
return hr;
}
--
2.26.2
Nov. 30, 2020
[PATCH] windowscodecs: Use wide-char string literals.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/windowscodecs/info.c | 172 +++++++++++++--------------------
dlls/windowscodecs/pngformat.c | 21 ++--
2 files changed, 75 insertions(+), 118 deletions(-)
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 34e14087f94..db6d25b46b3 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -35,26 +35,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
-static const WCHAR mimetypes_valuename[] = {'M','i','m','e','T','y','p','e','s',0};
-static const WCHAR author_valuename[] = {'A','u','t','h','o','r',0};
-static const WCHAR friendlyname_valuename[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
-static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m','a','t','s',0};
-static const WCHAR formats_keyname[] = {'F','o','r','m','a','t','s',0};
-static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
-static const WCHAR metadataformat_valuename[] = {'M','e','t','a','d','a','t','a','F','o','r','m','a','t',0};
-static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
-static const WCHAR version_valuename[] = {'V','e','r','s','i','o','n',0};
-static const WCHAR specversion_valuename[] = {'S','p','e','c','V','e','r','s','i','o','n',0};
-static const WCHAR bitsperpixel_valuename[] = {'B','i','t','L','e','n','g','t','h',0};
-static const WCHAR channelcount_valuename[] = {'C','h','a','n','n','e','l','C','o','u','n','t',0};
-static const WCHAR channelmasks_keyname[] = {'C','h','a','n','n','e','l','M','a','s','k','s',0};
-static const WCHAR numericrepresentation_valuename[] = {'N','u','m','e','r','i','c','R','e','p','r','e','s','e','n','t','a','t','i','o','n',0};
-static const WCHAR supportstransparency_valuename[] = {'S','u','p','p','o','r','t','s','T','r','a','n','s','p','a','r','e','n','c','y',0};
-static const WCHAR requiresfullstream_valuename[] = {'R','e','q','u','i','r','e','s','F','u','l','l','S','t','r','e','a','m',0};
-static const WCHAR supportspadding_valuename[] = {'S','u','p','p','o','r','t','s','P','a','d','d','i','n','g',0};
-static const WCHAR fileextensions_valuename[] = {'F','i','l','e','E','x','t','e','n','s','i','o','n','s',0};
-static const WCHAR containers_keyname[] = {'C','o','n','t','a','i','n','e','r','s',0};
-
typedef struct {
IWICComponentInfo IWICComponentInfo_iface;
LONG ref;
@@ -308,8 +288,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetAuthor(IWICBitmapDecoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI BitmapDecoderInfo_GetVendorGUID(IWICBitmapDecoderInfo *iface, GUID *pguidVendor)
@@ -318,7 +297,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetVendorGUID(IWICBitmapDecoderInfo *ifa
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI BitmapDecoderInfo_GetVersion(IWICBitmapDecoderInfo *iface, UINT cchVersion,
@@ -328,7 +307,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetVersion(IWICBitmapDecoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -339,7 +318,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetSpecVersion(IWICBitmapDecoderInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -350,7 +329,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetFriendlyName(IWICBitmapDecoderInfo *i
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -359,7 +338,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetContainerFormat(IWICBitmapDecoderInfo
{
BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
TRACE("(%p,%p)\n", iface, pguidContainerFormat);
- return ComponentInfo_GetGUIDValue(This->classkey, containerformat_valuename, pguidContainerFormat);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"ContainerFormat", pguidContainerFormat);
}
static HRESULT WINAPI BitmapDecoderInfo_GetPixelFormats(IWICBitmapDecoderInfo *iface,
@@ -367,7 +346,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetPixelFormats(IWICBitmapDecoderInfo *i
{
BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
TRACE("(%p,%u,%p,%p)\n", iface, cFormats, pguidPixelFormats, pcActual);
- return ComponentInfo_GetGuidList(This->classkey, formats_keyname, cFormats, pguidPixelFormats, pcActual);
+ return ComponentInfo_GetGuidList(This->classkey, L"Formats", cFormats, pguidPixelFormats, pcActual);
}
static HRESULT WINAPI BitmapDecoderInfo_GetColorManagementVersion(IWICBitmapDecoderInfo *iface,
@@ -398,7 +377,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetMimeTypes(IWICBitmapDecoderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchMimeTypes, wzMimeTypes, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, mimetypes_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"MimeTypes",
cchMimeTypes, wzMimeTypes, pcchActual);
}
@@ -409,7 +388,7 @@ static HRESULT WINAPI BitmapDecoderInfo_GetFileExtensions(IWICBitmapDecoderInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchFileExtensions, wzFileExtensions, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, fileextensions_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FileExtensions",
cchFileExtensions, wzFileExtensions, pcchActual);
}
@@ -577,19 +556,12 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
WCHAR subkeyname[11];
LONG res;
HKEY patternskey, patternkey;
- static const WCHAR uintformatW[] = {'%','u',0};
- static const WCHAR patternsW[] = {'P','a','t','t','e','r','n','s',0};
- static const WCHAR positionW[] = {'P','o','s','i','t','i','o','n',0};
- static const WCHAR lengthW[] = {'L','e','n','g','t','h',0};
- static const WCHAR patternW[] = {'P','a','t','t','e','r','n',0};
- static const WCHAR maskW[] = {'M','a','s','k',0};
- static const WCHAR endofstreamW[] = {'E','n','d','O','f','S','t','r','e','a','m',0};
UINT i;
WICBitmapPattern *patterns;
BYTE *patterns_ptr;
DWORD length, valuesize;
- res = RegOpenKeyExW(info->classkey, patternsW, 0, KEY_READ, &patternskey);
+ res = RegOpenKeyExW(info->classkey, L"Patterns", 0, KEY_READ, &patternskey);
if (res != ERROR_SUCCESS) return;
res = RegQueryInfoKeyW(patternskey, NULL, NULL, NULL, &pattern_count, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -609,25 +581,25 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(patternskey, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
valuesize = sizeof(ULONG);
- res = RegGetValueW(patternkey, NULL, lengthW, RRF_RT_DWORD, NULL, &length, &valuesize);
+ res = RegGetValueW(patternkey, NULL, L"Length", RRF_RT_DWORD, NULL, &length, &valuesize);
if (res == ERROR_SUCCESS)
{
patterns_size += length*2;
patterns[i].Length = length;
valuesize = sizeof(BOOL);
- res = RegGetValueW(patternkey, NULL, endofstreamW, RRF_RT_DWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"EndOfStream", RRF_RT_DWORD, NULL,
&patterns[i].EndOfStream, &valuesize);
if (res) patterns[i].EndOfStream = 0;
patterns[i].Position.QuadPart = 0;
valuesize = sizeof(ULARGE_INTEGER);
- res = RegGetValueW(patternkey, NULL, positionW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Position", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].Position, &valuesize);
}
@@ -645,14 +617,14 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(patternskey, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
length = patterns[i].Length;
patterns[i].Pattern = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL,
patterns[i].Pattern, &valuesize);
patterns_ptr += length;
@@ -660,7 +632,7 @@ static void read_bitmap_patterns(BitmapDecoderInfo *info)
{
patterns[i].Mask = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, maskW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Mask", RRF_RT_REG_BINARY, NULL,
patterns[i].Mask, &valuesize);
patterns_ptr += length;
}
@@ -798,8 +770,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetAuthor(IWICBitmapEncoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI BitmapEncoderInfo_GetVendorGUID(IWICBitmapEncoderInfo *iface, GUID *pguidVendor)
@@ -808,7 +779,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetVendorGUID(IWICBitmapEncoderInfo *ifa
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI BitmapEncoderInfo_GetVersion(IWICBitmapEncoderInfo *iface, UINT cchVersion,
@@ -818,7 +789,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetVersion(IWICBitmapEncoderInfo *iface,
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -829,7 +800,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetSpecVersion(IWICBitmapEncoderInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -840,7 +811,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetFriendlyName(IWICBitmapEncoderInfo *i
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -849,7 +820,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetContainerFormat(IWICBitmapEncoderInfo
{
BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
TRACE("(%p,%p)\n", iface, pguidContainerFormat);
- return ComponentInfo_GetGUIDValue(This->classkey, containerformat_valuename, pguidContainerFormat);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"ContainerFormat", pguidContainerFormat);
}
static HRESULT WINAPI BitmapEncoderInfo_GetPixelFormats(IWICBitmapEncoderInfo *iface,
@@ -857,7 +828,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetPixelFormats(IWICBitmapEncoderInfo *i
{
BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
TRACE("(%p,%u,%p,%p)\n", iface, cFormats, pguidPixelFormats, pcActual);
- return ComponentInfo_GetGuidList(This->classkey, formats_keyname, cFormats, pguidPixelFormats, pcActual);
+ return ComponentInfo_GetGuidList(This->classkey, L"Formats", cFormats, pguidPixelFormats, pcActual);
}
static HRESULT WINAPI BitmapEncoderInfo_GetColorManagementVersion(IWICBitmapEncoderInfo *iface,
@@ -888,7 +859,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetMimeTypes(IWICBitmapEncoderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchMimeTypes, wzMimeTypes, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, mimetypes_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"MimeTypes",
cchMimeTypes, wzMimeTypes, pcchActual);
}
@@ -899,7 +870,7 @@ static HRESULT WINAPI BitmapEncoderInfo_GetFileExtensions(IWICBitmapEncoderInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchFileExtensions, wzFileExtensions, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, fileextensions_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FileExtensions",
cchFileExtensions, wzFileExtensions, pcchActual);
}
@@ -1089,8 +1060,7 @@ static HRESULT WINAPI FormatConverterInfo_GetAuthor(IWICFormatConverterInfo *ifa
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI FormatConverterInfo_GetVendorGUID(IWICFormatConverterInfo *iface, GUID *pguidVendor)
@@ -1099,7 +1069,7 @@ static HRESULT WINAPI FormatConverterInfo_GetVendorGUID(IWICFormatConverterInfo
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI FormatConverterInfo_GetVersion(IWICFormatConverterInfo *iface, UINT cchVersion,
@@ -1109,7 +1079,7 @@ static HRESULT WINAPI FormatConverterInfo_GetVersion(IWICFormatConverterInfo *if
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -1120,7 +1090,7 @@ static HRESULT WINAPI FormatConverterInfo_GetSpecVersion(IWICFormatConverterInfo
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -1131,7 +1101,7 @@ static HRESULT WINAPI FormatConverterInfo_GetFriendlyName(IWICFormatConverterInf
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -1162,7 +1132,7 @@ static BOOL ConverterSupportsFormat(IWICFormatConverterInfo *iface, const WCHAR
/* Avoid testing using IWICFormatConverter_GetPixelFormats because that
would be O(n). A registry test should do better. */
- res = RegOpenKeyExW(This->classkey, pixelformats_keyname, 0, KEY_READ, &formats_key);
+ res = RegOpenKeyExW(This->classkey, L"PixelFormats", 0, KEY_READ, &formats_key);
if (res != ERROR_SUCCESS) return FALSE;
res = RegOpenKeyExW(formats_key, formatguid, 0, KEY_READ, &guid_key);
@@ -1311,8 +1281,7 @@ static HRESULT WINAPI PixelFormatInfo_GetAuthor(IWICPixelFormatInfo2 *iface, UIN
TRACE("(%p,%u,%p,%p)\n", iface, cchAuthor, wzAuthor, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- cchAuthor, wzAuthor, pcchActual);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", cchAuthor, wzAuthor, pcchActual);
}
static HRESULT WINAPI PixelFormatInfo_GetVendorGUID(IWICPixelFormatInfo2 *iface, GUID *pguidVendor)
@@ -1321,7 +1290,7 @@ static HRESULT WINAPI PixelFormatInfo_GetVendorGUID(IWICPixelFormatInfo2 *iface,
TRACE("(%p,%p)\n", iface, pguidVendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, pguidVendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", pguidVendor);
}
static HRESULT WINAPI PixelFormatInfo_GetVersion(IWICPixelFormatInfo2 *iface, UINT cchVersion,
@@ -1331,7 +1300,7 @@ static HRESULT WINAPI PixelFormatInfo_GetVersion(IWICPixelFormatInfo2 *iface, UI
TRACE("(%p,%u,%p,%p)\n", iface, cchVersion, wzVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"Version",
cchVersion, wzVersion, pcchActual);
}
@@ -1342,7 +1311,7 @@ static HRESULT WINAPI PixelFormatInfo_GetSpecVersion(IWICPixelFormatInfo2 *iface
TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
cchSpecVersion, wzSpecVersion, pcchActual);
}
@@ -1353,7 +1322,7 @@ static HRESULT WINAPI PixelFormatInfo_GetFriendlyName(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
cchFriendlyName, wzFriendlyName, pcchActual);
}
@@ -1384,7 +1353,7 @@ static HRESULT WINAPI PixelFormatInfo_GetBitsPerPixel(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiBitsPerPixel);
- return ComponentInfo_GetDWORDValue(This->classkey, bitsperpixel_valuename, puiBitsPerPixel);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"BitLength", puiBitsPerPixel);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *iface,
@@ -1394,13 +1363,12 @@ static HRESULT WINAPI PixelFormatInfo_GetChannelCount(IWICPixelFormatInfo2 *ifac
TRACE("(%p,%p)\n", iface, puiChannelCount);
- return ComponentInfo_GetDWORDValue(This->classkey, channelcount_valuename, puiChannelCount);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"ChannelCount", puiChannelCount);
}
static HRESULT WINAPI PixelFormatInfo_GetChannelMask(IWICPixelFormatInfo2 *iface,
UINT uiChannelIndex, UINT cbMaskBuffer, BYTE *pbMaskBuffer, UINT *pcbActual)
{
- static const WCHAR uintformatW[] = {'%','u',0};
PixelFormatInfo *This = impl_from_IWICPixelFormatInfo2(iface);
UINT channel_count;
HRESULT hr;
@@ -1420,11 +1388,11 @@ static HRESULT WINAPI PixelFormatInfo_GetChannelMask(IWICPixelFormatInfo2 *iface
if (SUCCEEDED(hr))
{
- swprintf(valuename, 11, uintformatW, uiChannelIndex);
+ swprintf(valuename, 11, L"%u", uiChannelIndex);
cbData = cbMaskBuffer;
- ret = RegGetValueW(This->classkey, channelmasks_keyname, valuename, RRF_RT_REG_BINARY, NULL, pbMaskBuffer, &cbData);
+ ret = RegGetValueW(This->classkey, L"ChannelMasks", valuename, RRF_RT_REG_BINARY, NULL, pbMaskBuffer, &cbData);
if (ret == ERROR_SUCCESS || ret == ERROR_MORE_DATA)
*pcbActual = cbData;
@@ -1445,7 +1413,7 @@ static HRESULT WINAPI PixelFormatInfo_SupportsTransparency(IWICPixelFormatInfo2
TRACE("(%p,%p)\n", iface, pfSupportsTransparency);
- return ComponentInfo_GetDWORDValue(This->classkey, supportstransparency_valuename, (DWORD*)pfSupportsTransparency);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsTransparency", (DWORD*)pfSupportsTransparency);
}
static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatInfo2 *iface,
@@ -1455,7 +1423,7 @@ static HRESULT WINAPI PixelFormatInfo_GetNumericRepresentation(IWICPixelFormatIn
TRACE("(%p,%p)\n", iface, pNumericRepresentation);
- return ComponentInfo_GetDWORDValue(This->classkey, numericrepresentation_valuename, pNumericRepresentation);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"NumericRepresentation", pNumericRepresentation);
}
static const IWICPixelFormatInfo2Vtbl PixelFormatInfo_Vtbl = {
@@ -1622,8 +1590,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetAuthor(IWICMetadataReaderInfo *iface
TRACE("(%p,%u,%p,%p)\n", iface, length, author, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, author_valuename,
- length, author, actual_length);
+ return ComponentInfo_GetStringValue(This->classkey, L"Author", length, author, actual_length);
}
static HRESULT WINAPI MetadataReaderInfo_GetVendorGUID(IWICMetadataReaderInfo *iface,
@@ -1633,7 +1600,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetVendorGUID(IWICMetadataReaderInfo *i
TRACE("(%p,%p)\n", iface, vendor);
- return ComponentInfo_GetGUIDValue(This->classkey, vendor_valuename, vendor);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"Vendor", vendor);
}
static HRESULT WINAPI MetadataReaderInfo_GetVersion(IWICMetadataReaderInfo *iface,
@@ -1643,8 +1610,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetVersion(IWICMetadataReaderInfo *ifac
TRACE("(%p,%u,%p,%p)\n", iface, length, version, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, version_valuename,
- length, version, actual_length);
+ return ComponentInfo_GetStringValue(This->classkey, L"Version", length, version, actual_length);
}
static HRESULT WINAPI MetadataReaderInfo_GetSpecVersion(IWICMetadataReaderInfo *iface,
@@ -1654,7 +1620,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetSpecVersion(IWICMetadataReaderInfo *
TRACE("(%p,%u,%p,%p)\n", iface, length, version, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"SpecVersion",
length, version, actual_length);
}
@@ -1665,7 +1631,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetFriendlyName(IWICMetadataReaderInfo
TRACE("(%p,%u,%p,%p)\n", iface, length, name, actual_length);
- return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+ return ComponentInfo_GetStringValue(This->classkey, L"FriendlyName",
length, name, actual_length);
}
@@ -1674,7 +1640,7 @@ static HRESULT WINAPI MetadataReaderInfo_GetMetadataFormat(IWICMetadataReaderInf
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, format);
- return ComponentInfo_GetGUIDValue(This->classkey, metadataformat_valuename, format);
+ return ComponentInfo_GetGUIDValue(This->classkey, L"MetadataFormat", format);
}
static HRESULT WINAPI MetadataReaderInfo_GetContainerFormats(IWICMetadataReaderInfo *iface,
@@ -1716,7 +1682,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesRequireFullStream(IWICMetadataReade
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, requiresfullstream_valuename, (DWORD *)param);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"RequiresFullStream", (DWORD *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderInfo *iface,
@@ -1724,7 +1690,7 @@ static HRESULT WINAPI MetadataReaderInfo_DoesSupportPadding(IWICMetadataReaderIn
{
MetadataReaderInfo *This = impl_from_IWICMetadataReaderInfo(iface);
TRACE("(%p,%p)\n", iface, param);
- return ComponentInfo_GetDWORDValue(This->classkey, supportspadding_valuename, (DWORD *)param);
+ return ComponentInfo_GetDWORDValue(This->classkey, L"SupportsPadding", (DWORD *)param);
}
static HRESULT WINAPI MetadataReaderInfo_DoesRequireFixedSize(IWICMetadataReaderInfo *iface,
@@ -1864,17 +1830,12 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
WCHAR subkeyname[11], guidkeyname[39];
LONG res;
HKEY containers_key, guid_key, patternkey;
- static const WCHAR uintformatW[] = {'%','u',0};
- static const WCHAR patternW[] = {'P','a','t','t','e','r','n',0};
- static const WCHAR positionW[] = {'P','o','s','i','t','i','o','n',0};
- static const WCHAR maskW[] = {'M','a','s','k',0};
- static const WCHAR dataoffsetW[] = {'D','a','t','a','O','f','f','s','e','t',0};
UINT i;
WICMetadataPattern *patterns;
BYTE *patterns_ptr;
DWORD length, valuesize;
- res = RegOpenKeyExW(info->classkey, containers_keyname, 0, KEY_READ, &containers_key);
+ res = RegOpenKeyExW(info->classkey, L"Containers", 0, KEY_READ, &containers_key);
if (res != ERROR_SUCCESS) return;
StringFromGUID2(container_guid, guidkeyname, 39);
@@ -1900,24 +1861,24 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(guid_key, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL, NULL, &length);
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL, NULL, &length);
if (res == ERROR_SUCCESS)
{
patterns_size += length*2;
patterns[i].Length = length;
valuesize = sizeof(DWORD64);
- res = RegGetValueW(patternkey, NULL, dataoffsetW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"DataOffset", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].DataOffset, &valuesize);
if (res) patterns[i].DataOffset.QuadPart = 0;
patterns[i].Position.QuadPart = 0;
valuesize = sizeof(DWORD64);
- res = RegGetValueW(patternkey, NULL, positionW, RRF_RT_DWORD|RRF_RT_QWORD, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Position", RRF_RT_DWORD|RRF_RT_QWORD, NULL,
&patterns[i].Position, &valuesize);
}
@@ -1935,14 +1896,14 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
for (i=0; res == ERROR_SUCCESS && i < pattern_count; i++)
{
- swprintf(subkeyname, 11, uintformatW, i);
+ swprintf(subkeyname, 11, L"%u", i);
res = RegOpenKeyExW(guid_key, subkeyname, 0, KEY_READ, &patternkey);
if (res != ERROR_SUCCESS) break;
length = patterns[i].Length;
patterns[i].Pattern = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, patternW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Pattern", RRF_RT_REG_BINARY, NULL,
patterns[i].Pattern, &valuesize);
patterns_ptr += length;
@@ -1950,7 +1911,7 @@ static void read_metadata_patterns(MetadataReaderInfo *info, GUID *container_gui
{
patterns[i].Mask = patterns_ptr;
valuesize = length;
- res = RegGetValueW(patternkey, NULL, maskW, RRF_RT_REG_BINARY, NULL,
+ res = RegGetValueW(patternkey, NULL, L"Mask", RRF_RT_REG_BINARY, NULL,
patterns[i].Mask, &valuesize);
patterns_ptr += length;
}
@@ -1977,13 +1938,13 @@ static BOOL read_metadata_info(MetadataReaderInfo *info)
GUID *formats;
HRESULT hr;
- hr = ComponentInfo_GetGuidList(info->classkey, containers_keyname, 0, NULL, &format_count);
+ hr = ComponentInfo_GetGuidList(info->classkey, L"Containers", 0, NULL, &format_count);
if (FAILED(hr)) return TRUE;
formats = heap_calloc(format_count, sizeof(*formats));
if (!formats) return FALSE;
- hr = ComponentInfo_GetGuidList(info->classkey, containers_keyname, format_count, formats,
+ hr = ComponentInfo_GetGuidList(info->classkey, L"Containers", format_count, formats,
&format_count);
if (FAILED(hr))
{
@@ -2034,9 +1995,6 @@ static HRESULT MetadataReaderInfo_Constructor(HKEY classkey, REFCLSID clsid, Com
return S_OK;
}
-static const WCHAR clsid_keyname[] = {'C','L','S','I','D',0};
-static const WCHAR instance_keyname[] = {'I','n','s','t','a','n','c','e',0};
-
struct category {
WICComponentType type;
const GUID *catid;
@@ -2094,7 +2052,7 @@ HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
return S_OK;
}
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, KEY_READ, &clsidkey);
+ res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &clsidkey);
if (res != ERROR_SUCCESS)
{
LeaveCriticalSection(&component_info_cache_cs);
@@ -2107,7 +2065,7 @@ HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
if (res == ERROR_SUCCESS)
{
- res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
+ res = RegOpenKeyExW(catidkey, L"Instance", 0, KEY_READ, &instancekey);
if (res == ERROR_SUCCESS)
{
StringFromGUID2(clsid, guidstring, 39);
@@ -2388,7 +2346,7 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
if (options) FIXME("ignoring flags %x\n", options);
- res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, KEY_READ, &clsidkey);
+ res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"CLSID", 0, KEY_READ, &clsidkey);
if (res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res);
@@ -2412,7 +2370,7 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn
res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
if (res == ERROR_SUCCESS)
{
- res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
+ res = RegOpenKeyExW(catidkey, L"Instance", 0, KEY_READ, &instancekey);
if (res == ERROR_SUCCESS)
{
i=0;
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index d14490560aa..89701bbab77 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -114,7 +114,6 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
BYTE *data;
ULONG data_size;
ULONG gamma;
- static const WCHAR ImageGamma[] = {'I','m','a','g','e','G','a','m','m','a',0};
LPWSTR name;
MetadataItem *result;
@@ -132,7 +131,7 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
HeapFree(GetProcessHeap(), 0, data);
result = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MetadataItem));
- name = HeapAlloc(GetProcessHeap(), 0, sizeof(ImageGamma));
+ name = HeapAlloc(GetProcessHeap(), 0, sizeof(L"ImageGamma"));
if (!result || !name)
{
HeapFree(GetProcessHeap(), 0, result);
@@ -144,7 +143,7 @@ static HRESULT LoadGamaMetadata(IStream *stream, const GUID *preferred_vendor,
PropVariantInit(&result[0].id);
PropVariantInit(&result[0].value);
- memcpy(name, ImageGamma, sizeof(ImageGamma));
+ memcpy(name, L"ImageGamma", sizeof(L"ImageGamma"));
result[0].id.vt = VT_LPWSTR;
result[0].id.u.pwszVal = name;
@@ -176,14 +175,14 @@ static HRESULT LoadChrmMetadata(IStream *stream, const GUID *preferred_vendor,
BYTE *data;
ULONG data_size;
static const WCHAR names[8][12] = {
- {'W','h','i','t','e','P','o','i','n','t','X',0},
- {'W','h','i','t','e','P','o','i','n','t','Y',0},
- {'R','e','d','X',0},
- {'R','e','d','Y',0},
- {'G','r','e','e','n','X',0},
- {'G','r','e','e','n','Y',0},
- {'B','l','u','e','X',0},
- {'B','l','u','e','Y',0},
+ L"WhitePointX",
+ L"WhitePointY",
+ L"RedX",
+ L"RedY",
+ L"GreenX",
+ L"GreenY",
+ L"BlueX",
+ L"BlueY",
};
LPWSTR dyn_names[8] = {0};
MetadataItem *result;
--
2.26.2
Nov. 30, 2020
[PATCH] windowscodecs: Use wide-char string literals in regsvr.c.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
Odd one as it has also non-inlined ascii strings so I've kept the WCHAR
string variables too.
dlls/windowscodecs/regsvr.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 2fb03a2e1e9..5ab43353320 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -147,37 +147,36 @@ static HRESULT unregister_pixelformats(struct regsvr_pixelformat const *list);
/***********************************************************************
* static string constants
*/
-static const WCHAR clsid_keyname[] = {
- 'C', 'L', 'S', 'I', 'D', 0 };
+static const WCHAR clsid_keyname[] = L"CLSID";
static const char author_valuename[] = "Author";
static const char friendlyname_valuename[] = "FriendlyName";
-static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
-static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
+static const WCHAR vendor_valuename[] = L"Vendor";
+static const WCHAR containerformat_valuename[] = L"ContainerFormat";
static const char version_valuename[] = "Version";
static const char mimetypes_valuename[] = "MimeTypes";
static const char extensions_valuename[] = "FileExtensions";
-static const WCHAR formats_keyname[] = {'F','o','r','m','a','t','s',0};
-static const WCHAR patterns_keyname[] = {'P','a','t','t','e','r','n','s',0};
-static const WCHAR instance_keyname[] = {'I','n','s','t','a','n','c','e',0};
-static const WCHAR clsid_valuename[] = {'C','L','S','I','D',0};
+static const WCHAR formats_keyname[] = L"Formats";
+static const WCHAR patterns_keyname[] = L"Patterns";
+static const WCHAR instance_keyname[] = L"Instance";
+static const WCHAR clsid_valuename[] = L"CLSID";
static const char length_valuename[] = "Length";
static const char position_valuename[] = "Position";
static const char pattern_valuename[] = "Pattern";
static const char mask_valuename[] = "Mask";
static const char endofstream_valuename[] = "EndOfStream";
-static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m','a','t','s',0};
-static const WCHAR metadataformat_valuename[] = {'M','e','t','a','d','a','t','a','F','o','r','m','a','t',0};
+static const WCHAR pixelformats_keyname[] = L"PixelFormats";
+static const WCHAR metadataformat_valuename[] = L"MetadataFormat";
static const char specversion_valuename[] = "SpecVersion";
static const char requiresfullstream_valuename[] = "RequiresFullStream";
static const char supportspadding_valuename[] = "SupportsPadding";
static const char requiresfixedsize_valuename[] = "FixedSize";
-static const WCHAR containers_keyname[] = {'C','o','n','t','a','i','n','e','r','s',0};
+static const WCHAR containers_keyname[] = L"Containers";
static const char dataoffset_valuename[] = "DataOffset";
static const char bitsperpixel_valuename[] = "BitLength";
static const char channelcount_valuename[] = "ChannelCount";
static const char numericrepresentation_valuename[] = "NumericRepresentation";
static const char supportstransparency_valuename[] = "SupportsTransparency";
-static const WCHAR channelmasks_keyname[] = {'C','h','a','n','n','e','l','M','a','s','k','s',0};
+static const WCHAR channelmasks_keyname[] = L"ChannelMasks";
/***********************************************************************
* register_decoders
@@ -305,8 +304,7 @@ static HRESULT register_decoders(struct regsvr_decoder const *list)
for (i=0; list->patterns[i].length; i++)
{
HKEY pattern_key;
- static const WCHAR int_format[] = {'%','i',0};
- swprintf(buf, 39, int_format, i);
+ swprintf(buf, 39, L"%i", i);
res = RegCreateKeyExW(patterns_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &pattern_key, NULL);
if (res != ERROR_SUCCESS) break;
@@ -851,8 +849,7 @@ static HRESULT register_metadatareaders(struct regsvr_metadatareader const *list
for (i=0; container->patterns[i].length; i++)
{
HKEY pattern_key;
- static const WCHAR int_format[] = {'%','i',0};
- swprintf(buf, 39, int_format, i);
+ swprintf(buf, 39, L"%i", i);
res = RegCreateKeyExW(format_key, buf, 0, NULL, 0,
KEY_READ | KEY_WRITE, NULL, &pattern_key, NULL);
if (res != ERROR_SUCCESS) break;
@@ -1031,7 +1028,6 @@ static HRESULT register_pixelformats(struct regsvr_pixelformat const *list)
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
if (list->channelmasks) {
- static const WCHAR valuename_format[] = {'%','d',0};
HKEY masks_key;
UINT i, mask_size;
WCHAR mask_valuename[11];
@@ -1043,7 +1039,7 @@ static HRESULT register_pixelformats(struct regsvr_pixelformat const *list)
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
for (i=0; i < list->channelcount; i++)
{
- swprintf(mask_valuename, ARRAY_SIZE(mask_valuename), valuename_format, i);
+ swprintf(mask_valuename, ARRAY_SIZE(mask_valuename), L"%d", i);
res = RegSetValueExW(masks_key, mask_valuename, 0, REG_BINARY,
list->channelmasks[i], mask_size);
if (res != ERROR_SUCCESS) break;
--
2.26.2
Nov. 30, 2020
[PATCH] windowscodecs: Don't make variables const just to cast the const away.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
Of course the strings could be inlined with the cast kept but that
doesn't seems to be the preferred way.
dlls/windowscodecs/bmpencode.c | 4 ++--
dlls/windowscodecs/encoder.c | 40 +++++++++++++++++-----------------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index 342f2c897e8..4bbeb4c27dd 100644
--- a/dlls/windowscodecs/bmpencode.c
+++ b/dlls/windowscodecs/bmpencode.c
@@ -77,7 +77,7 @@ typedef struct BmpFrameEncode {
BOOL committed;
} BmpFrameEncode;
-static const WCHAR wszEnableV5Header32bppBGRA[] = {'E','n','a','b','l','e','V','5','H','e','a','d','e','r','3','2','b','p','p','B','G','R','A',0};
+static WCHAR wszEnableV5Header32bppBGRA[] = L"EnableV5Header32bppBGRA";
static inline BmpFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
{
@@ -562,7 +562,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
HRESULT hr;
static const PROPBAG2 opts[1] =
{
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszEnableV5Header32bppBGRA },
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszEnableV5Header32bppBGRA },
};
TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
diff --git a/dlls/windowscodecs/encoder.c b/dlls/windowscodecs/encoder.c
index 869588baec1..b634db6f0c2 100644
--- a/dlls/windowscodecs/encoder.c
+++ b/dlls/windowscodecs/encoder.c
@@ -31,28 +31,28 @@
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
-static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0};
-static const WCHAR wszPngFilterOption[] = {'F','i','l','t','e','r','O','p','t','i','o','n',0};
-static const WCHAR wszTiffCompressionMethod[] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0};
-static const WCHAR wszCompressionQuality[] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0};
-static const WCHAR wszImageQuality[] = {'I','m','a','g','e','Q','u','a','l','i','t','y',0};
-static const WCHAR wszBitmapTransform[] = {'B','i','t','m','a','p','T','r','a','n','s','f','o','r','m',0};
-static const WCHAR wszLuminance[] = {'L','u','m','i','n','a','n','c','e',0};
-static const WCHAR wszChrominance[] = {'C','h','r','o','m','i','n','a','n','c','e',0};
-static const WCHAR wszJpegYCrCbSubsampling[] = {'J','p','e','g','Y','C','r','C','b','S','u','b','s','a','m','p','l','i','n','g',0};
-static const WCHAR wszSuppressApp0[] = {'S','u','p','p','r','e','s','s','A','p','p','0',0};
+static WCHAR wszPngInterlaceOption[] = L"InterlaceOption";
+static WCHAR wszPngFilterOption[] = L"FilterOption";
+static WCHAR wszTiffCompressionMethod[] = L"TiffCompressionMethod";
+static WCHAR wszCompressionQuality[] = L"CompressionQuality";
+static WCHAR wszImageQuality[] = L"ImageQuality";
+static WCHAR wszBitmapTransform[] = L"BitmapTransform";
+static WCHAR wszLuminance[] = L"Luminance";
+static WCHAR wszChrominance[] = L"Chrominance";
+static WCHAR wszJpegYCrCbSubsampling[] = L"JpegYCrCbSubsampling";
+static WCHAR wszSuppressApp0[] = L"SuppressApp0";
static const PROPBAG2 encoder_option_properties[ENCODER_OPTION_END] = {
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszPngInterlaceOption },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszPngFilterOption },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszTiffCompressionMethod },
- { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, (LPOLESTR)wszCompressionQuality },
- { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, (LPOLESTR)wszImageQuality },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszBitmapTransform },
- { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, (LPOLESTR)wszLuminance },
- { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, (LPOLESTR)wszChrominance },
- { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, (LPOLESTR)wszJpegYCrCbSubsampling },
- { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszSuppressApp0 }
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszPngInterlaceOption },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszPngFilterOption },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszTiffCompressionMethod },
+ { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, wszCompressionQuality },
+ { PROPBAG2_TYPE_DATA, VT_R4, 0, 0, wszImageQuality },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszBitmapTransform },
+ { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, wszLuminance },
+ { PROPBAG2_TYPE_DATA, VT_I4 | VT_ARRAY, 0, 0, wszChrominance },
+ { PROPBAG2_TYPE_DATA, VT_UI1, 0, 0, wszJpegYCrCbSubsampling },
+ { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, wszSuppressApp0 }
};
typedef struct CommonEncoder {
--
2.26.2
Nov. 30, 2020
[PATCH] windowscodecs: Use wide-char string literals in metadataquery.c.
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/windowscodecs/metadataquery.c | 241 +++++++++--------------------
1 file changed, 71 insertions(+), 170 deletions(-)
diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c
index 189187fb2ab..2761a520083 100644
--- a/dlls/windowscodecs/metadataquery.c
+++ b/dlls/windowscodecs/metadataquery.c
@@ -103,7 +103,6 @@ static HRESULT WINAPI mqr_GetContainerFormat(IWICMetadataQueryReader *iface, GUI
static HRESULT WINAPI mqr_GetLocation(IWICMetadataQueryReader *iface, UINT len, WCHAR *location, UINT *ret_len)
{
- static const WCHAR rootW[] = { '/',0 };
QueryReader *This = impl_from_IWICMetadataQueryReader(iface);
const WCHAR *root;
UINT actual_len;
@@ -112,7 +111,7 @@ static HRESULT WINAPI mqr_GetLocation(IWICMetadataQueryReader *iface, UINT len,
if (!ret_len) return E_INVALIDARG;
- root = This->root ? This->root : rootW;
+ root = This->root ? This->root : L"/";
actual_len = lstrlenW(root) + 1;
if (location)
@@ -636,101 +635,56 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
return S_OK;
}
-static const WCHAR bmpW[] = { 'b','m','p',0 };
-static const WCHAR pngW[] = { 'p','n','g',0 };
-static const WCHAR icoW[] = { 'i','c','o',0 };
-static const WCHAR jpgW[] = { 'j','p','g',0 };
-static const WCHAR tiffW[] = { 't','i','f','f',0 };
-static const WCHAR gifW[] = { 'g','i','f',0 };
-static const WCHAR wmphotoW[] = { 'w','m','p','h','o','t','o',0 };
-static const WCHAR unknownW[] = { 'u','n','k','n','o','w','n',0 };
-static const WCHAR ifdW[] = { 'i','f','d',0 };
-static const WCHAR subW[] = { 's','u','b',0 };
-static const WCHAR exifW[] = { 'e','x','i','f',0 };
-static const WCHAR gpsW[] = { 'g','p','s',0 };
-static const WCHAR interopW[] = { 'i','n','t','e','r','o','p',0 };
-static const WCHAR app0W[] = { 'a','p','p','0',0 };
-static const WCHAR app1W[] = { 'a','p','p','1',0 };
-static const WCHAR app13W[] = { 'a','p','p','1','3',0 };
-static const WCHAR iptcW[] = { 'i','p','t','c',0 };
-static const WCHAR irbW[] = { 'i','r','b',0 };
-static const WCHAR _8bimiptcW[] = { '8','b','i','m','i','p','t','c',0 };
-static const WCHAR _8bimResInfoW[] = { '8','b','i','m','R','e','s','I','n','f','o',0 };
-static const WCHAR _8bimiptcdigestW[] = { '8','b','i','m','i','p','t','c','d','i','g','e','s','t',0 };
-static const WCHAR xmpW[] = { 'x','m','p',0 };
-static const WCHAR thumbW[] = { 't','h','u','m','b',0 };
-static const WCHAR tEXtW[] = { 't','E','X','t',0 };
-static const WCHAR xmpstructW[] = { 'x','m','p','s','t','r','u','c','t',0 };
-static const WCHAR xmpbagW[] = { 'x','m','p','b','a','g',0 };
-static const WCHAR xmpseqW[] = { 'x','m','p','s','e','q',0 };
-static const WCHAR xmpaltW[] = { 'x','m','p','a','l','t',0 };
-static const WCHAR logscrdescW[] = { 'l','o','g','s','c','r','d','e','s','c',0 };
-static const WCHAR imgdescW[] = { 'i','m','g','d','e','s','c',0 };
-static const WCHAR grctlextW[] = { 'g','r','c','t','l','e','x','t',0 };
-static const WCHAR appextW[] = { 'a','p','p','e','x','t',0 };
-static const WCHAR chrominanceW[] = { 'c','h','r','o','m','i','n','a','n','c','e',0 };
-static const WCHAR luminanceW[] = { 'l','u','m','i','n','a','n','c','e',0 };
-static const WCHAR comW[] = { 'c','o','m',0 };
-static const WCHAR commentextW[] = { 'c','o','m','m','e','n','t','e','x','t',0 };
-static const WCHAR gAMAW[] = { 'g','A','M','A',0 };
-static const WCHAR bKGDW[] = { 'b','K','G','D',0 };
-static const WCHAR iTXtW[] = { 'i','T','X','t',0 };
-static const WCHAR cHRMW[] = { 'c','H','R','M',0 };
-static const WCHAR hISTW[] = { 'h','I','S','T',0 };
-static const WCHAR iCCPW[] = { 'i','C','C','P',0 };
-static const WCHAR sRGBW[] = { 's','R','G','B',0 };
-static const WCHAR tIMEW[] = { 't','I','M','E',0 };
-
static const struct
{
const GUID *guid;
const WCHAR *name;
} guid2name[] =
{
- { &GUID_ContainerFormatBmp, bmpW },
- { &GUID_ContainerFormatPng, pngW },
- { &GUID_ContainerFormatIco, icoW },
- { &GUID_ContainerFormatJpeg, jpgW },
- { &GUID_ContainerFormatTiff, tiffW },
- { &GUID_ContainerFormatGif, gifW },
- { &GUID_ContainerFormatWmp, wmphotoW },
- { &GUID_MetadataFormatUnknown, unknownW },
- { &GUID_MetadataFormatIfd, ifdW },
- { &GUID_MetadataFormatSubIfd, subW },
- { &GUID_MetadataFormatExif, exifW },
- { &GUID_MetadataFormatGps, gpsW },
- { &GUID_MetadataFormatInterop, interopW },
- { &GUID_MetadataFormatApp0, app0W },
- { &GUID_MetadataFormatApp1, app1W },
- { &GUID_MetadataFormatApp13, app13W },
- { &GUID_MetadataFormatIPTC, iptcW },
- { &GUID_MetadataFormatIRB, irbW },
- { &GUID_MetadataFormat8BIMIPTC, _8bimiptcW },
- { &GUID_MetadataFormat8BIMResolutionInfo, _8bimResInfoW },
- { &GUID_MetadataFormat8BIMIPTCDigest, _8bimiptcdigestW },
- { &GUID_MetadataFormatXMP, xmpW },
- { &GUID_MetadataFormatThumbnail, thumbW },
- { &GUID_MetadataFormatChunktEXt, tEXtW },
- { &GUID_MetadataFormatXMPStruct, xmpstructW },
- { &GUID_MetadataFormatXMPBag, xmpbagW },
- { &GUID_MetadataFormatXMPSeq, xmpseqW },
- { &GUID_MetadataFormatXMPAlt, xmpaltW },
- { &GUID_MetadataFormatLSD, logscrdescW },
- { &GUID_MetadataFormatIMD, imgdescW },
- { &GUID_MetadataFormatGCE, grctlextW },
- { &GUID_MetadataFormatAPE, appextW },
- { &GUID_MetadataFormatJpegChrominance, chrominanceW },
- { &GUID_MetadataFormatJpegLuminance, luminanceW },
- { &GUID_MetadataFormatJpegComment, comW },
- { &GUID_MetadataFormatGifComment, commentextW },
- { &GUID_MetadataFormatChunkgAMA, gAMAW },
- { &GUID_MetadataFormatChunkbKGD, bKGDW },
- { &GUID_MetadataFormatChunkiTXt, iTXtW },
- { &GUID_MetadataFormatChunkcHRM, cHRMW },
- { &GUID_MetadataFormatChunkhIST, hISTW },
- { &GUID_MetadataFormatChunkiCCP, iCCPW },
- { &GUID_MetadataFormatChunksRGB, sRGBW },
- { &GUID_MetadataFormatChunktIME, tIMEW }
+ { &GUID_ContainerFormatBmp, L"bmp" },
+ { &GUID_ContainerFormatPng, L"png" },
+ { &GUID_ContainerFormatIco, L"ico" },
+ { &GUID_ContainerFormatJpeg, L"jpg" },
+ { &GUID_ContainerFormatTiff, L"tiff" },
+ { &GUID_ContainerFormatGif, L"gif" },
+ { &GUID_ContainerFormatWmp, L"wmphoto" },
+ { &GUID_MetadataFormatUnknown, L"unknown" },
+ { &GUID_MetadataFormatIfd, L"ifd" },
+ { &GUID_MetadataFormatSubIfd, L"sub" },
+ { &GUID_MetadataFormatExif, L"exif" },
+ { &GUID_MetadataFormatGps, L"gps" },
+ { &GUID_MetadataFormatInterop, L"interop" },
+ { &GUID_MetadataFormatApp0, L"app0" },
+ { &GUID_MetadataFormatApp1, L"app1" },
+ { &GUID_MetadataFormatApp13, L"app13" },
+ { &GUID_MetadataFormatIPTC, L"iptc" },
+ { &GUID_MetadataFormatIRB, L"irb" },
+ { &GUID_MetadataFormat8BIMIPTC, L"8bimiptc" },
+ { &GUID_MetadataFormat8BIMResolutionInfo, L"8bimResInfo" },
+ { &GUID_MetadataFormat8BIMIPTCDigest, L"8bimiptcdigest" },
+ { &GUID_MetadataFormatXMP, L"xmp" },
+ { &GUID_MetadataFormatThumbnail, L"thumb" },
+ { &GUID_MetadataFormatChunktEXt, L"tEXt" },
+ { &GUID_MetadataFormatXMPStruct, L"xmpstruct" },
+ { &GUID_MetadataFormatXMPBag, L"xmpbag" },
+ { &GUID_MetadataFormatXMPSeq, L"xmpseq" },
+ { &GUID_MetadataFormatXMPAlt, L"xmpalt" },
+ { &GUID_MetadataFormatLSD, L"logscrdesc" },
+ { &GUID_MetadataFormatIMD, L"imgdesc" },
+ { &GUID_MetadataFormatGCE, L"grctlext" },
+ { &GUID_MetadataFormatAPE, L"appext" },
+ { &GUID_MetadataFormatJpegChrominance, L"chrominance" },
+ { &GUID_MetadataFormatJpegLuminance, L"luminance" },
+ { &GUID_MetadataFormatJpegComment, L"com" },
+ { &GUID_MetadataFormatGifComment, L"commentext" },
+ { &GUID_MetadataFormatChunkgAMA, L"gAMA" },
+ { &GUID_MetadataFormatChunkbKGD, L"bKGD" },
+ { &GUID_MetadataFormatChunkiTXt, L"iTXt" },
+ { &GUID_MetadataFormatChunkcHRM, L"cHRM" },
+ { &GUID_MetadataFormatChunkhIST, L"hIST" },
+ { &GUID_MetadataFormatChunkiCCP, L"iCCP" },
+ { &GUID_MetadataFormatChunksRGB, L"sRGB" },
+ { &GUID_MetadataFormatChunktIME, L"tIME" }
};
HRESULT WINAPI WICMapGuidToShortName(REFGUID guid, UINT len, WCHAR *name, UINT *ret_len)
@@ -784,91 +738,38 @@ HRESULT WINAPI WICMapShortNameToGuid(PCWSTR name, GUID *guid)
return WINCODEC_ERR_PROPERTYNOTFOUND;
}
-static const WCHAR rdf[] = { 'r','d','f',0 };
-static const WCHAR rdf_scheme[] = { 'h','t','t','p',':','/','/','w','w','w','.','w','3','.','o','r','g','/','1','9','9','9','/','0','2','/','2','2','-','r','d','f','-','s','y','n','t','a','x','-','n','s','#',0 };
-static const WCHAR dc[] = { 'd','c',0 };
-static const WCHAR dc_scheme[] = { 'h','t','t','p',':','/','/','p','u','r','l','.','o','r','g','/','d','c','/','e','l','e','m','e','n','t','s','/','1','.','1','/',0 };
-static const WCHAR xmp[] = { 'x','m','p',0 };
-static const WCHAR xmp_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/',0 };
-static const WCHAR xmpidq[] = { 'x','m','p','i','d','q',0 };
-static const WCHAR xmpidq_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','m','p','/','I','d','e','n','t','i','f','i','e','r','/','q','u','a','l','/','1','.','0','/',0 };
-static const WCHAR xmpRights[] = { 'x','m','p','R','i','g','h','t','s',0 };
-static const WCHAR xmpRights_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','r','i','g','h','t','s','/',0 };
-static const WCHAR xmpMM[] = { 'x','m','p','M','M',0 };
-static const WCHAR xmpMM_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','m','m','/',0 };
-static const WCHAR xmpBJ[] = { 'x','m','p','B','J',0 };
-static const WCHAR xmpBJ_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','b','j','/',0 };
-static const WCHAR xmpTPg[] = { 'x','m','p','T','P','g',0 };
-static const WCHAR xmpTPg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','t','/','p','g','/',0 };
-static const WCHAR pdf[] = { 'p','d','f',0 };
-static const WCHAR pdf_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','p','d','f','/','1','.','3','/',0 };
-static const WCHAR photoshop[] = { 'p','h','o','t','o','s','h','o','p',0 };
-static const WCHAR photoshop_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','p','h','o','t','o','s','h','o','p','/','1','.','0','/',0 };
-static const WCHAR tiff[] = { 't','i','f','f',0 };
-static const WCHAR tiff_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','t','i','f','f','/','1','.','0','/',0 };
-static const WCHAR exif[] = { 'e','x','i','f',0 };
-static const WCHAR exif_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','e','x','i','f','/','1','.','0','/',0 };
-static const WCHAR stDim[] = { 's','t','D','i','m',0 };
-static const WCHAR stDim_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','D','i','m','e','n','s','i','o','n','s','#',0 };
-static const WCHAR xapGImg[] = { 'x','a','p','G','I','m','g',0 };
-static const WCHAR xapGImg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','g','/','i','m','g','/',0 };
-static const WCHAR stEvt[] = { 's','t','E','v','t',0 };
-static const WCHAR stEvt_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','R','e','s','o','u','r','c','e','E','v','e','n','t','#',0 };
-static const WCHAR stRef[] = { 's','t','R','e','f',0 };
-static const WCHAR stRef_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','R','e','s','o','u','r','c','e','R','e','f','#',0 };
-static const WCHAR stVer[] = { 's','t','V','e','r',0 };
-static const WCHAR stVer_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','V','e','r','s','i','o','n','#',0 };
-static const WCHAR stJob[] = { 's','t','J','o','b',0 };
-static const WCHAR stJob_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','a','p','/','1','.','0','/','s','T','y','p','e','/','J','o','b','#',0 };
-static const WCHAR aux[] = { 'a','u','x',0 };
-static const WCHAR aux_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','e','x','i','f','/','1','.','0','/','a','u','x','/',0 };
-static const WCHAR crs[] = { 'c','r','s',0 };
-static const WCHAR crs_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','c','a','m','e','r','a','-','r','a','w','-','s','e','t','t','i','n','g','s','/','1','.','0','/',0 };
-static const WCHAR xmpDM[] = { 'x','m','p','D','M',0 };
-static const WCHAR xmpDM_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','a','d','o','b','e','.','c','o','m','/','x','m','p','/','1','.','0','/','D','y','n','a','m','i','c','M','e','d','i','a','/',0 };
-static const WCHAR Iptc4xmpCore[] = { 'I','p','t','c','4','x','m','p','C','o','r','e',0 };
-static const WCHAR Iptc4xmpCore_scheme[] = { 'h','t','t','p',':','/','/','i','p','t','c','.','o','r','g','/','s','t','d','/','I','p','t','c','4','x','m','p','C','o','r','e','/','1','.','0','/','x','m','l','n','s','/',0 };
-static const WCHAR MicrosoftPhoto[] = { 'M','i','c','r','o','s','o','f','t','P','h','o','t','o',0 };
-static const WCHAR MicrosoftPhoto_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','0','/',0 };
-static const WCHAR MP[] = { 'M','P',0 };
-static const WCHAR MP_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/',0 };
-static const WCHAR MPRI[] = { 'M','P','R','I',0 };
-static const WCHAR MPRI_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/','t','/','R','e','g','i','o','n','I','n','f','o','#',0 };
-static const WCHAR MPReg[] = { 'M','P','R','e','g',0 };
-static const WCHAR MPReg_scheme[] = { 'h','t','t','p',':','/','/','n','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','p','h','o','t','o','/','1','.','2','/','t','/','R','e','g','i','o','n','#',0 };
-
static const struct
{
const WCHAR *name;
const WCHAR *schema;
} name2schema[] =
{
- { rdf, rdf_scheme },
- { dc, dc_scheme },
- { xmp, xmp_scheme },
- { xmpidq, xmpidq_scheme },
- { xmpRights, xmpRights_scheme },
- { xmpMM, xmpMM_scheme },
- { xmpBJ, xmpBJ_scheme },
- { xmpTPg, xmpTPg_scheme },
- { pdf, pdf_scheme },
- { photoshop, photoshop_scheme },
- { tiff, tiff_scheme },
- { exif, exif_scheme },
- { stDim, stDim_scheme },
- { xapGImg, xapGImg_scheme },
- { stEvt, stEvt_scheme },
- { stRef, stRef_scheme },
- { stVer, stVer_scheme },
- { stJob, stJob_scheme },
- { aux, aux_scheme },
- { crs, crs_scheme },
- { xmpDM, xmpDM_scheme },
- { Iptc4xmpCore, Iptc4xmpCore_scheme },
- { MicrosoftPhoto, MicrosoftPhoto_scheme },
- { MP, MP_scheme },
- { MPRI, MPRI_scheme },
- { MPReg, MPReg_scheme }
+ { L"rdf", L"http://www.w3.org/1999/02/22-rdf-syntax-ns#" },
+ { L"dc", L"http://purl.org/dc/elements/1.1/" },
+ { L"xmp", L"http://ns.adobe.com/xap/1.0/" },
+ { L"xmpidq", L"http://ns.adobe.com/xmp/Identifier/qual/1.0/" },
+ { L"xmpRights", L"http://ns.adobe.com/xap/1.0/rights/" },
+ { L"xmpMM", L"http://ns.adobe.com/xap/1.0/mm/" },
+ { L"xmpBJ", L"http://ns.adobe.com/xap/1.0/bj/" },
+ { L"xmpTPg", L"http://ns.adobe.com/xap/1.0/t/pg/" },
+ { L"pdf", L"http://ns.adobe.com/pdf/1.3/" },
+ { L"photoshop", L"http://ns.adobe.com/photoshop/1.0/" },
+ { L"tiff", L"http://ns.adobe.com/tiff/1.0/" },
+ { L"exif", L"http://ns.adobe.com/exif/1.0/" },
+ { L"stDim", L"http://ns.adobe.com/xap/1.0/sType/Dimensions#" },
+ { L"xapGImg", L"http://ns.adobe.com/xap/1.0/g/img/" },
+ { L"stEvt", L"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" },
+ { L"stRef", L"http://ns.adobe.com/xap/1.0/sType/ResourceRef#" },
+ { L"stVer", L"http://ns.adobe.com/xap/1.0/sType/Version#" },
+ { L"stJob", L"http://ns.adobe.com/xap/1.0/sType/Job#" },
+ { L"aux", L"http://ns.adobe.com/exif/1.0/aux/" },
+ { L"crs", L"http://ns.adobe.com/camera-raw-settings/1.0/" },
+ { L"xmpDM", L"http://ns.adobe.com/xmp/1.0/DynamicMedia/" },
+ { L"Iptc4xmpCore", L"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" },
+ { L"MicrosoftPhoto", L"http://ns.microsoft.com/photo/1.0/" },
+ { L"MP", L"http://ns.microsoft.com/photo/1.2/" },
+ { L"MPRI", L"http://ns.microsoft.com/photo/1.2/t/RegionInfo#" },
+ { L"MPReg", L"http://ns.microsoft.com/photo/1.2/t/Region#" }
};
static const WCHAR *map_shortname_to_schema(const GUID *format, const WCHAR *name)
--
2.26.2
Nov. 30, 2020
Re: [PATCH 1/4] winex11.drv: Do not set AA flags for font default AA in xrender backend.
by Alexandre Julliard
Paul Gofman <pgofman(a)codeweavers.com> writes:
> On 11/30/20 23:10, Alexandre Julliard wrote:
>> Paul Gofman <pgofman(a)codeweavers.com> writes:
>>
>>> If LOGFONT lfQuality assumes user default antialiasing Wine's
>>> Control Panel\\Desktop parameters should be used.
>> Why? Most users expect Wine to respect the X11 settings, like any other
>> app.
>>
> I am trying to fix https://bugs.winehq.org/show_bug.cgi?id=45857
>
> The app sets the font anitaliaing through system option. If it is
> effectively not respected and font is still antialiased, the color
> keying in ddraw surface blitting does not work and all the text looks
> pink. I don't know, maybe this case should be a 'won't fix' then?
Does the app really change the system-wide settings, instead of simply
requesting a non-anti-aliased font? If so, I'd say it's an app bug and
a won't fix.
--
Alexandre Julliard
julliard(a)winehq.org
Nov. 30, 2020
[PATCH] dmusic: Sync up the dmobject.[ch] files
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmband/dmobject.h | 8 ++-
dlls/dmcompos/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmcompos/dmobject.h | 8 ++-
dlls/dmloader/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmloader/dmobject.h | 8 ++-
dlls/dmscript/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmscript/dmobject.h | 8 ++-
dlls/dmstyle/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmstyle/dmobject.h | 8 ++-
dlls/dmusic/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dmusic/dmobject.h | 8 ++-
dlls/dswave/dmobject.c | 111 +++++++++++++++++++++++++++++++++++++--
dlls/dswave/dmobject.h | 8 ++-
14 files changed, 791 insertions(+), 42 deletions(-)
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dmcompos/dmobject.c b/dlls/dmcompos/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmcompos/dmobject.c
+++ b/dlls/dmcompos/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmcompos/dmobject.h b/dlls/dmcompos/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmcompos/dmobject.h
+++ b/dlls/dmcompos/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dmloader/dmobject.c b/dlls/dmloader/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmloader/dmobject.c
+++ b/dlls/dmloader/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmloader/dmobject.h b/dlls/dmloader/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmloader/dmobject.h
+++ b/dlls/dmloader/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dmscript/dmobject.c b/dlls/dmscript/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmscript/dmobject.c
+++ b/dlls/dmscript/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmscript/dmobject.h b/dlls/dmscript/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmscript/dmobject.h
+++ b/dlls/dmscript/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dmstyle/dmobject.c b/dlls/dmstyle/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmstyle/dmobject.c
+++ b/dlls/dmstyle/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmstyle/dmobject.h b/dlls/dmstyle/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmstyle/dmobject.h
+++ b/dlls/dmstyle/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dmusic/dmobject.c b/dlls/dmusic/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dmusic/dmobject.c
+++ b/dlls/dmusic/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dmusic/dmobject.h b/dlls/dmusic/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dmusic/dmobject.h
+++ b/dlls/dmusic/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
diff --git a/dlls/dswave/dmobject.c b/dlls/dswave/dmobject.c
index 9ea31ab32a6..e6a1ce906a7 100644
--- a/dlls/dswave/dmobject.c
+++ b/dlls/dswave/dmobject.c
@@ -28,6 +28,7 @@
#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -349,7 +350,7 @@ HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk)
return S_OK;
}
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk)
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk)
{
LARGE_INTEGER end;
@@ -371,6 +372,50 @@ HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk)
return stream_get_chunk(stream, chunk);
}
+/* Reads chunk data of the form:
+ DWORD - size of array element
+ element[] - Array of elements
+ The caller needs to heap_free() the array.
+*/
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size)
+{
+ DWORD size;
+ HRESULT hr;
+
+ *array = NULL;
+ *count = 0;
+
+ if (chunk->size < sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Too short to read element size\n", debugstr_chunk(chunk));
+ return E_FAIL;
+ }
+ if (FAILED(hr = stream_read(stream, &size, sizeof(DWORD))))
+ return hr;
+ if (size != elem_size) {
+ WARN_(dmfile)("%s: Array element size mismatch: got %u, expected %u\n",
+ debugstr_chunk(chunk), size, elem_size);
+ return DMUS_E_UNSUPPORTED_STREAM;
+ }
+
+ *count = (chunk->size - sizeof(DWORD)) / elem_size;
+ size = *count * elem_size;
+ if (!(*array = heap_alloc(size)))
+ return E_OUTOFMEMORY;
+ if (FAILED(hr = stream_read(stream, *array, size))) {
+ heap_free(*array);
+ *array = NULL;
+ return hr;
+ }
+
+ if (chunk->size > size + sizeof(DWORD)) {
+ WARN_(dmfile)("%s: Extraneous data at end of array\n", debugstr_chunk(chunk));
+ stream_skip_chunk(stream, chunk);
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size)
{
@@ -529,15 +574,30 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) {
switch (chunk.id) {
+ case DMUS_FOURCC_CATEGORY_CHUNK:
+ if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ break;
+ case DMUS_FOURCC_DATE_CHUNK:
+ if ((supported & DMUS_OBJ_DATE) && stream_chunk_get_data(stream, &chunk,
+ &desc->ftDate, sizeof(desc->ftDate)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_DATE;
+ break;
+ case DMUS_FOURCC_FILE_CHUNK:
+ if ((supported & DMUS_OBJ_FILENAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszFileName, sizeof(desc->wszFileName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_FILENAME;
+ break;
case DMUS_FOURCC_GUID_CHUNK:
if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk,
&desc->guidObject, sizeof(desc->guidObject)) == S_OK)
desc->dwValidData |= DMUS_OBJ_OBJECT;
break;
- case DMUS_FOURCC_CATEGORY_CHUNK:
- if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk,
- desc->wszCategory, sizeof(desc->wszCategory)) == S_OK)
- desc->dwValidData |= DMUS_OBJ_CATEGORY;
+ case DMUS_FOURCC_NAME_CHUNK:
+ if ((supported & DMUS_OBJ_NAME) && stream_chunk_get_wstr(stream, &chunk,
+ desc->wszName, sizeof(desc->wszName)) == S_OK)
+ desc->dwValidData |= DMUS_OBJ_NAME;
break;
case DMUS_FOURCC_VERSION_CHUNK:
if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk,
@@ -557,6 +617,47 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
return hr;
}
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj)
+{
+ struct chunk_entry chunk = {.parent = list};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_OBJECTDESC desc;
+ DMUS_IO_REFERENCE reference;
+ HRESULT hr;
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+ if (chunk.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &chunk, &reference, sizeof(reference)))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&chunk));
+ return hr;
+ }
+ TRACE("REFERENCE guidClassID %s, dwValidData %#x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ if (FAILED(hr = dmobj_parsedescriptor(stream, list, &desc, reference.dwValidData)))
+ return hr;
+ desc.guidClass = reference.guidClassID;
+ desc.dwValidData |= DMUS_OBJ_CLASS;
+ dump_DMUS_OBJECTDESC(&desc);
+
+ if (FAILED(hr = IStream_QueryInterface(stream, &IID_IDirectMusicGetLoader, (void**)&getloader)))
+ return hr;
+ hr = IDirectMusicGetLoader_GetLoader(getloader, &loader);
+ IDirectMusicGetLoader_Release(getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicLoader_GetObject(loader, &desc, &IID_IDirectMusicObject, (void**)dmobj);
+ IDirectMusicLoader_Release(loader);
+
+ return hr;
+}
+
/* Generic IPersistStream methods */
static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface)
{
diff --git a/dlls/dswave/dmobject.h b/dlls/dswave/dmobject.h
index d347020691c..afe721dc824 100644
--- a/dlls/dswave/dmobject.h
+++ b/dlls/dswave/dmobject.h
@@ -33,8 +33,10 @@ struct chunk_entry {
HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_skip_chunk(IStream *stream, const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+HRESULT stream_chunk_get_array(IStream *stream, const struct chunk_entry *chunk, void **array,
+ unsigned int *count, DWORD elem_size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data,
ULONG size) DECLSPEC_HIDDEN;
HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str,
@@ -89,6 +91,10 @@ HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff,
#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */
#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */
+/* 'DMRF' (reference list) helper */
+HRESULT dmobj_parsereference(IStream *stream, const struct chunk_entry *list,
+ IDirectMusicObject **dmobj) DECLSPEC_HIDDEN;
+
/* Generic IPersistStream methods */
HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid,
void **ret_iface) DECLSPEC_HIDDEN;
--
2.26.2
Nov. 30, 2020
[PATCH v3 2/2] winegstreamer: Set MF_MT_ALL_SAMPLES_INDEPENDENT attribute on raw video media types.
by Derek Lesho
Signed-off-by: Derek Lesho <dlesho(a)codeweavers.com>
---
v3: Reword commit name.
---
dlls/winegstreamer/mfplat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index 07dfae64f4f..50cd93b62d1 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -610,6 +610,7 @@ IMFMediaType *mf_media_type_from_caps(const GstCaps *caps)
unsigned int i;
IMFMediaType_SetUINT32(media_type, &MF_MT_COMPRESSED, FALSE);
+ IMFMediaType_SetUINT32(media_type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
/* First try FOURCC */
if ((fourcc_subtype.Data1 = gst_video_format_to_fourcc(video_info.finfo->format)))
--
2.29.2
Nov. 30, 2020
Re: [PATCH 1/4] winex11.drv: Do not set AA flags for font default AA in xrender backend.
by Paul Gofman
On 11/30/20 23:33, Paul Gofman wrote:
> On 11/30/20 23:10, Alexandre Julliard wrote:
>> Paul Gofman <pgofman(a)codeweavers.com> writes:
>>
>>> If LOGFONT lfQuality assumes user default antialiasing Wine's
>>> Control Panel\\Desktop parameters should be used.
>> Why? Most users expect Wine to respect the X11 settings, like any other
>> app.
>>
> I am trying to fix https://bugs.winehq.org/show_bug.cgi?id=45857
>
> The app sets the font anitaliaing through system option. If it is
> effectively not respected and font is still antialiased, the color
> keying in ddraw surface blitting does not work and all the text looks
> pink. I don't know, maybe this case should be a 'won't fix' then?
>
Maybe we can set antialalis option in Control Panel\Desktop from X
option during wine boot somehow?
Nov. 30, 2020