https://git.reactos.org/?p=reactos.git;a=commitdiff;h=703c56beb320196c0d08a…
commit 703c56beb320196c0d08ae8f2b8291cc441f62bc
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Mon Jun 1 11:06:49 2020 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jun 1 12:06:49 2020 +0300
[REACTOS] RegQueryValueExW() wants bytes, not chars (#2876)
Cherry-pick:
https://source.winehq.org/git/wine.git/commit/a359e026662251b7c3367fe2815dc…
https://source.winehq.org/git/wine.git/commit/0662da18b85634928905e72041961…
https://source.winehq.org/git/wine.git/commit/e4e5eda3d9afcb5360747ddd97e6b…
CORE-9665
Co-authored-by: Victor Martinez <vicmarcal(a)gmail.com>
---
dll/win32/advpack/advpack.c | 2 +-
dll/win32/mscoree/metahost.c | 2 +-
dll/win32/mscoree/mscoree_main.c | 2 +-
dll/win32/shlwapi/ordinal.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dll/win32/advpack/advpack.c b/dll/win32/advpack/advpack.c
index f2de8a6b257..e3d4d50837b 100644
--- a/dll/win32/advpack/advpack.c
+++ b/dll/win32/advpack/advpack.c
@@ -907,7 +907,7 @@ HRESULT WINAPI UserInstStubWrapperW(HWND hWnd, HINSTANCE hInstance,
{
HKEY setup, guid;
WCHAR stub[MAX_PATH];
- DWORD size = MAX_PATH;
+ DWORD size = sizeof(stub);
HRESULT hr = S_OK;
BOOL res;
diff --git a/dll/win32/mscoree/metahost.c b/dll/win32/mscoree/metahost.c
index 7b01f1024c6..599fcc829bb 100644
--- a/dll/win32/mscoree/metahost.c
+++ b/dll/win32/mscoree/metahost.c
@@ -377,7 +377,7 @@ static BOOL get_install_root(LPWSTR install_dir)
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
return FALSE;
- len = MAX_PATH;
+ len = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
{
RegCloseKey(key);
diff --git a/dll/win32/mscoree/mscoree_main.c b/dll/win32/mscoree/mscoree_main.c
index 0b982d08fd2..2af851806cf 100644
--- a/dll/win32/mscoree/mscoree_main.c
+++ b/dll/win32/mscoree/mscoree_main.c
@@ -53,7 +53,7 @@ static BOOL get_install_root(LPWSTR install_dir)
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, dotnet_key, 0, KEY_READ, &key))
return FALSE;
- len = MAX_PATH;
+ len = MAX_PATH * sizeof(WCHAR);
if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)install_dir, &len))
{
RegCloseKey(key);
diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c
index 84234865b28..431ec51d2e1 100644
--- a/dll/win32/shlwapi/ordinal.c
+++ b/dll/win32/shlwapi/ordinal.c
@@ -4126,7 +4126,7 @@ BOOL WINAPI IsOS(DWORD feature)
*/
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)
return E_FAIL;