diff --git a/dlls/mscoree/metahost.c b/dlls/mscoree/metahost.c index 9a299662e38..77029942528 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 81fe5610b70..4679d79e662 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);