Serge Gautherie : mscoree: RegQueryValueExW() wants bytes, not chars.

Alexandre Julliard julliard at winehq.org
Fri May 29 15:22:54 CDT 2020


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

Author: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
Date:   Thu May 28 04:30:37 2020 +0200

mscoree: RegQueryValueExW() wants bytes, not chars.

Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
Signed-off-by: Esme Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mscoree/metahost.c     | 2 +-
 dlls/mscoree/mscoree_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c
index 9a299662e3..7702994252 100644
--- a/dlls/mscoree/metahost.c
+++ b/dlls/mscoree/metahost.c
@@ -477,7 +477,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/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c
index 81fe5610b7..4679d79e66 100644
--- a/dlls/mscoree/mscoree_main.c
+++ b/dlls/mscoree/mscoree_main.c
@@ -80,7 +80,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);




More information about the wine-cvs mailing list