[PATCH] programs: fixed two RegEnumValue namelengths

Marcus Meissner marcus at jet.franken.de
Sun Oct 26 09:27:05 CDT 2008


Hi,

The "name" query part of RegEnumValue takes characters,
not bytes. (The "value" part takes bytes though.)

Ciao, Marcus
---
 programs/oleview/details.c |    2 +-
 programs/winecfg/winecfg.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/oleview/details.c b/programs/oleview/details.c
index 531591b..3e266cc 100644
--- a/programs/oleview/details.c
+++ b/programs/oleview/details.c
@@ -51,7 +51,7 @@ static void CreateRegRec(HKEY hKey, HTREEITEM parent, WCHAR *wszKeyName, BOOL ad
 
     while(TRUE)
     {
-        lenName = sizeof(WCHAR[MAX_LOAD_STRING]);
+        lenName = sizeof(WCHAR[MAX_LOAD_STRING])/sizeof(WCHAR);
         lenData = sizeof(WCHAR[MAX_LOAD_STRING]);
 
         retEnum = RegEnumValue(hKey, i, wszName, &lenName,
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index f1439a7..543daf1 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -491,7 +491,7 @@ WCHAR **enumerate_valuesW(HKEY root, WCHAR *path)
         while (TRUE)
         {
             WCHAR name[1024];
-            DWORD namesize = sizeof(name);
+            DWORD namesize = sizeof(name)/sizeof(name[0]);
             BOOL removed = FALSE;
 
             /* find out the needed size, allocate a buffer, read the value  */
-- 
1.5.6



More information about the wine-patches mailing list