From e2ac51d89e052f0f8704cdd2d1df91fb5c30455b Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 30 Sep 2020 23:14:47 +0200 Subject: [PATCH] combase: Use wide-char string literals. Signed-off-by: Michael Stefaniuc Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/combase/roapi.c | 12 ++++-------- dlls/combase/rpc.c | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index 94b79ff3cfd..53da979d681 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -39,11 +39,6 @@ static const char *debugstr_hstring(HSTRING hstr) 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; DWORD type, size; HRESULT hr; @@ -52,7 +47,8 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out) *out = NULL; /* 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; 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); /* 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; goto done; @@ -78,7 +74,7 @@ static HRESULT get_library_for_classid(const WCHAR *classid, WCHAR **out) hr = E_OUTOFMEMORY; 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; goto done; diff --git a/dlls/combase/rpc.c b/dlls/combase/rpc.c index c4bc8983a2c..55450ad7f14 100644 --- a/dlls/combase/rpc.c +++ b/dlls/combase/rpc.c @@ -77,8 +77,7 @@ struct registered_if static inline void get_rpc_endpoint(LPWSTR endpoint, const OXID *oxid) { /* 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, wszEndpointFormat, (DWORD)(*oxid >> 32),(DWORD)*oxid); + wsprintfW(endpoint, L"\\pipe\\OLE_%08lx%08lx", (DWORD)(*oxid >> 32), (DWORD)*oxid); } typedef struct