[REACTOS] RegQueryValueExW() wants bytes, not chars (#2876)

Cherry-pick:
a359e02666
0662da18b8
e4e5eda3d9

CORE-9665

Co-authored-by: Victor Martinez <vicmarcal@gmail.com>
This commit is contained in:
Serge Gautherie 2020-06-01 11:06:49 +02:00 committed by GitHub
parent 1c504f4c57
commit 703c56beb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -907,7 +907,7 @@ HRESULT WINAPI UserInstStubWrapperW(HWND hWnd, HINSTANCE hInstance,
{ {
HKEY setup, guid; HKEY setup, guid;
WCHAR stub[MAX_PATH]; WCHAR stub[MAX_PATH];
DWORD size = MAX_PATH; DWORD size = sizeof(stub);
HRESULT hr = S_OK; HRESULT hr = S_OK;
BOOL res; BOOL res;

View file

@ -377,7 +377,7 @@ static BOOL get_install_root(LPWSTR install_dir)
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key)) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
return FALSE; return FALSE;
len = MAX_PATH; len = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len)) if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
{ {
RegCloseKey(key); RegCloseKey(key);

View file

@ -53,7 +53,7 @@ static BOOL get_install_root(LPWSTR install_dir)
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key)) if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
return FALSE; return FALSE;
len = MAX_PATH; len = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len)) if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
{ {
RegCloseKey(key); RegCloseKey(key);

View file

@ -4126,7 +4126,7 @@ BOOL WINAPI IsOS(DWORD feature)
*/ */
HRESULT WINAPI SHLoadRegUIStringW(HKEY hkey, LPCWSTR value, LPWSTR buf, DWORD size) HRESULT WINAPI SHLoadRegUIStringW(HKEY hkey, LPCWSTR value, LPWSTR buf, DWORD size)
{ {
DWORD type, sz = size; DWORD type, sz = size * sizeof(WCHAR);
if(RegQueryValueExW(hkey, value, NULL, &type, (LPBYTE)buf, &sz) != ERROR_SUCCESS) if(RegQueryValueExW(hkey, value, NULL, &type, (LPBYTE)buf, &sz) != ERROR_SUCCESS)
return E_FAIL; return E_FAIL;