shdocvw: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-11-29 23:30:31 +01:00 committed by Alexandre Julliard
parent 56f1ce6be6
commit 447924a6d6
3 changed files with 6 additions and 16 deletions

View File

@ -43,10 +43,8 @@ static HINSTANCE ieframe_instance;
static HINSTANCE get_ieframe_instance(void)
{
static const WCHAR ieframe_dllW[] = {'i','e','f','r','a','m','e','.','d','l','l',0};
if(!ieframe_instance)
ieframe_instance = LoadLibraryW(ieframe_dllW);
ieframe_instance = LoadLibraryW(L"ieframe.dll");
return ieframe_instance;
}
@ -276,10 +274,9 @@ DWORD WINAPI SetQueryNetSessionCount(DWORD arg)
static void* fetch_shlwapi_ordinal(UINT_PTR ord)
{
static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'};
static HANDLE h;
if (!h && !(h = GetModuleHandleW(shlwapiW))) return NULL;
if (!h && !(h = GetModuleHandleW(L"shlwapi.dll"))) return NULL;
return (void*)GetProcAddress(h, (const char*)ord);
}

View File

@ -357,12 +357,7 @@ static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *
HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
LPVOID *ppvClassObj)
{
WCHAR wszInstanceKey[] = { 'C','L','S','I','D','\\','{','0','0','0','0','0','0','0','0','-',
'0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0',
'0','0','0','0','}','\\','I','n','s','t','a','n','c','e', 0 };
static const WCHAR wszCLSID[] = { 'C','L','S','I','D',0 };
static const WCHAR wszInitPropertyBag[] =
{ 'I','n','i','t','P','r','o','p','e','r','t','y','B','a','g',0 };
WCHAR wszInstanceKey[] = L"CLSID\\{00000000-0000-0000-0000-000000000000}\\Instance";
WCHAR wszCLSIDInstance[CHARS_IN_GUID];
CLSID clsidInstance;
HKEY hInstanceKey, hInitPropertyBagKey;
@ -382,7 +377,7 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
/* If there is no 'Instance' subkey, then it's not a Shell Instance Object. */
return CLASS_E_CLASSNOTAVAILABLE;
if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, wszCLSID, NULL, &dwType, (LPBYTE)wszCLSIDInstance, &cbBytes) ||
if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, L"CLSID", NULL, &dwType, (BYTE *)wszCLSIDInstance, &cbBytes) ||
FAILED(CLSIDFromString(wszCLSIDInstance, &clsidInstance)))
{
/* 'Instance' should have a 'CLSID' value with a well-formed clsid-string. */
@ -392,7 +387,7 @@ HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, REFIID riid,
}
/* Try to open the 'InitPropertyBag' subkey. */
res = RegOpenKeyExW(hInstanceKey, wszInitPropertyBag, 0, KEY_READ, &hInitPropertyBagKey);
res = RegOpenKeyExW(hInstanceKey, L"InitPropertyBag", 0, KEY_READ, &hInitPropertyBagKey);
RegCloseKey(hInstanceKey);
if (res != ERROR_SUCCESS) {
/* Besides 'InitPropertyBag's, shell instance objects might be initialized by streams.

View File

@ -165,9 +165,7 @@ static void test_ShortcutFolder(void) {
CLSID clsid;
const CLSID CLSID_WineTest =
{ 0x9b352ebf, 0x2765, 0x45c1, { 0xb4, 0xc6, 0x85, 0xcc, 0x7f, 0x7a, 0xbc, 0x64 } };
WCHAR wszWineTestFolder[] = {
':',':','{','9','B','3','5','2','E','B','F','-','2','7','6','5','-','4','5','C','1','-',
'B','4','C','6','-','8','5','C','C','7','F','7','A','B','C','6','4','}',0 };
static WCHAR wszWineTestFolder[] = L"::{9B352EBF-2765-45C1-B4C6-85CC7F7ABC64}";
/* First, we register all the necessary registry keys/values for our 'WineTest'
* shell object. */