Zhiyi Zhang : uxtheme: Pass size in bytes to RegQueryValueExW().

Alexandre Julliard julliard at winehq.org
Wed Oct 20 15:58:39 CDT 2021


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

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Wed Oct 20 10:06:25 2021 +0800

uxtheme: Pass size in bytes to RegQueryValueExW().

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/uxtheme/system.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
index 18b93435e4c..628bd9bfdc4 100644
--- a/dlls/uxtheme/system.c
+++ b/dlls/uxtheme/system.c
@@ -85,7 +85,7 @@ static BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg)
 static DWORD query_reg_path (HKEY hKey, LPCWSTR lpszValue,
                              LPVOID pvData)
 {
-  DWORD dwRet, dwType, dwUnExpDataLen = MAX_PATH, dwExpDataLen;
+  DWORD dwRet, dwType, dwUnExpDataLen = MAX_PATH * sizeof(WCHAR), dwExpDataLen;
 
   TRACE("(hkey=%p,%s,%p)\n", hKey, debugstr_w(lpszValue),
         pvData);
@@ -147,7 +147,7 @@ static void UXTHEME_LoadTheme(void)
     /* Get current theme configuration */
     if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) {
         TRACE("Loading theme config\n");
-        buffsize = ARRAY_SIZE(tmp);
+        buffsize = sizeof(tmp);
         if (!RegQueryValueExW(hKey, L"ThemeActive", NULL, NULL, (BYTE*)tmp, &buffsize)) {
             bThemeActive = (tmp[0] != '0');
         }
@@ -155,10 +155,10 @@ static void UXTHEME_LoadTheme(void)
             bThemeActive = FALSE;
             TRACE("Failed to get ThemeActive: %d\n", GetLastError());
         }
-        buffsize = ARRAY_SIZE(szCurrentColor);
+        buffsize = sizeof(szCurrentColor);
         if (RegQueryValueExW(hKey, L"ColorName", NULL, NULL, (BYTE*)szCurrentColor, &buffsize))
             szCurrentColor[0] = '\0';
-        buffsize = ARRAY_SIZE(szCurrentSize);
+        buffsize = sizeof(szCurrentSize);
         if (RegQueryValueExW(hKey, L"SizeName", NULL, NULL, (BYTE*)szCurrentSize, &buffsize))
             szCurrentSize[0] = '\0';
         if (query_reg_path (hKey, L"DllName", szCurrentTheme))




More information about the wine-cvs mailing list