From 71288ba50a6084cd9f3ec2334f088ea154e36cb8 Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Fri, 28 Jan 2022 13:00:54 -0600 Subject: [PATCH] mscoree: Use wide string syntax in create_monodata. Signed-off-by: Esme Povirk Signed-off-by: Alexandre Julliard --- dlls/mscoree/corruntimehost.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/dlls/mscoree/corruntimehost.c b/dlls/mscoree/corruntimehost.c index ec06717be85..afb5a104ca7 100644 --- a/dlls/mscoree/corruntimehost.c +++ b/dlls/mscoree/corruntimehost.c @@ -1718,13 +1718,9 @@ end: HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) { - static const WCHAR wszAssembly[] = {'A','s','s','e','m','b','l','y',0}; - static const WCHAR wszCodebase[] = {'C','o','d','e','B','a','s','e',0}; - static const WCHAR wszClass[] = {'C','l','a','s','s',0}; - static const WCHAR wszFileSlash[] = {'f','i','l','e',':','/','/','/',0}; - static const WCHAR wszCLSIDSlash[] = {'C','L','S','I','D','\\',0}; - static const WCHAR wszInprocServer32[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2',0}; - static const WCHAR wszDLL[] = {'.','d','l','l',0}; + static const WCHAR wszFileSlash[] = L"file:///"; + static const WCHAR wszCLSIDSlash[] = L"CLSID\\"; + static const WCHAR wszInprocServer32[] = L"\\InprocServer32"; WCHAR path[CHARS_IN_GUID + ARRAY_SIZE(wszCLSIDSlash) + ARRAY_SIZE(wszInprocServer32) - 1]; MonoDomain *domain; MonoAssembly *assembly; @@ -1751,7 +1747,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) res = RegOpenKeyExW(HKEY_CLASSES_ROOT, path, 0, KEY_READ, &key); if (res != ERROR_FILE_NOT_FOUND) { - res = RegGetValueW( key, NULL, wszClass, RRF_RT_REG_SZ, NULL, classname, &dwBufLen); + res = RegGetValueW( key, NULL, L"Class", RRF_RT_REG_SZ, NULL, classname, &dwBufLen); if(res != ERROR_SUCCESS) { WARN("Class value cannot be found.\n"); @@ -1762,7 +1758,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) TRACE("classname (%s)\n", debugstr_w(classname)); dwBufLen = MAX_PATH + 8; - res = RegGetValueW( key, NULL, wszCodebase, RRF_RT_REG_SZ, NULL, codebase, &dwBufLen); + res = RegGetValueW( key, NULL, L"CodeBase", RRF_RT_REG_SZ, NULL, codebase, &dwBufLen); if(res == ERROR_SUCCESS) { /* Strip file:/// */ @@ -1797,7 +1793,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) if (res != ERROR_SUCCESS) goto cleanup; dwBufLen = MAX_PATH + 8; - res = RegGetValueW(subkey, NULL, wszAssembly, RRF_RT_REG_SZ, NULL, assemblyname, &dwBufLen); + res = RegGetValueW(subkey, NULL, L"Assembly", RRF_RT_REG_SZ, NULL, assemblyname, &dwBufLen); RegCloseKey(subkey); if (res != ERROR_SUCCESS) goto cleanup; @@ -1805,7 +1801,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) else { dwBufLen = MAX_PATH + 8; - res = RegGetValueW(key, NULL, wszAssembly, RRF_RT_REG_SZ, NULL, assemblyname, &dwBufLen); + res = RegGetValueW(key, NULL, L"Assembly", RRF_RT_REG_SZ, NULL, assemblyname, &dwBufLen); if (res != ERROR_SUCCESS) goto cleanup; } @@ -1830,7 +1826,7 @@ HRESULT create_monodata(REFIID riid, LPVOID *ppObj ) *(ns) = '\0'; lstrcatW(filename, assemblyname); *(ns) = '.'; - lstrcatW(filename, wszDLL); + lstrcatW(filename, L".dll"); } } }