combase: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-09-30 23:14:47 +02:00 committed by Alexandre Julliard
parent eede9959ed
commit e2ac51d89e
2 changed files with 5 additions and 10 deletions

View File

@ -39,11 +39,6 @@ static const char *debugstr_hstring(HSTRING hstr)
static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out) static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
{ {
static const WCHAR classkeyW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','R','u','n','t','i','m','e','\\',
'A','c','t','i','v','a','t','a','b','l','e','C','l','a','s','s','I','d',0};
static const WCHAR dllpathW[] = {'D','l','l','P','a','t','h',0};
HKEY hkey_root, hkey_class; HKEY hkey_root, hkey_class;
DWORD type, size; DWORD type, size;
HRESULT hr; HRESULT hr;
@ -52,7 +47,8 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
*out = NULL; *out = NULL;
/* load class registry key */ /* load class registry key */
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, classkeyW, 0, KEY_READ, &hkey_root)) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\WindowsRuntime\\ActivatableClassId",
0, KEY_READ, &hkey_root))
return REGDB_E_READREGDB; return REGDB_E_READREGDB;
if (RegOpenKeyExW(hkey_root, classid, 0, KEY_READ, &hkey_class)) if (RegOpenKeyExW(hkey_root, classid, 0, KEY_READ, &hkey_class))
{ {
@ -63,7 +59,7 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
RegCloseKey(hkey_root); RegCloseKey(hkey_root);
/* load (and expand) DllPath registry value */ /* load (and expand) DllPath registry value */
if (RegQueryValueExW(hkey_class, dllpathW, NULL, &type, NULL, &size)) if (RegQueryValueExW(hkey_class, L"DllPath", NULL, &type, NULL, &size))
{ {
hr = REGDB_E_READREGDB; hr = REGDB_E_READREGDB;
goto done; goto done;
@ -78,7 +74,7 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out)
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
goto done; goto done;
} }
if (RegQueryValueExW(hkey_class, dllpathW, NULL, NULL, (BYTE *)buf, &size)) if (RegQueryValueExW(hkey_class, L"DllPath", NULL, NULL, (BYTE *)buf, &size))
{ {
hr = REGDB_E_READREGDB; hr = REGDB_E_READREGDB;
goto done; goto done;

View File

@ -77,8 +77,7 @@ struct registered_if
static inline void get_rpc_endpoint(LPWSTR endpoint, const OXID *oxid) static inline void get_rpc_endpoint(LPWSTR endpoint, const OXID *oxid)
{ {
/* FIXME: should get endpoint from rpcss */ /* FIXME: should get endpoint from rpcss */
static const WCHAR wszEndpointFormat[] = {'\\','p','i','p','e','\\','O','L','E','_','%','0','8','l','x','%','0','8','l','x',0}; wsprintfW(endpoint, L"\\pipe\\OLE_%08lx%08lx", (DWORD)(*oxid >> 32), (DWORD)*oxid);
wsprintfW(endpoint, wszEndpointFormat, (DWORD)(*oxid >> 32),(DWORD)*oxid);
} }
typedef struct typedef struct