Michael Stefaniuc : combase: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Mon Oct 5 15:54:57 CDT 2020


Module: wine
Branch: master
Commit: e2ac51d89e052f0f8704cdd2d1df91fb5c30455b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e2ac51d89e052f0f8704cdd2d1df91fb5c30455b

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Sep 30 23:14:47 2020 +0200

combase: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 94b79ff3cf..53da979d68 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 c4bc8983a2..55450ad7f1 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




More information about the wine-cvs mailing list