=?UTF-8?Q?Bernhard=20=C3=9Cbelacker=20?=: oleview: Call RegEnumValueW with value and val_count parameters.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 8 09:51:23 CDT 2015


Module: wine
Branch: master
Commit: 94c6e3af3a17e0d7541a0a7cfaeff00bf944fa6e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=94c6e3af3a17e0d7541a0a7cfaeff00bf944fa6e

Author: Bernhard Übelacker <bernhardu at vr-web.de>
Date:   Tue Jun 30 14:38:05 2015 +0200

oleview: Call RegEnumValueW with value and val_count parameters.

---

 programs/oleview/tree.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/programs/oleview/tree.c b/programs/oleview/tree.c
index 34021e7..17844bf 100644
--- a/programs/oleview/tree.c
+++ b/programs/oleview/tree.c
@@ -500,10 +500,12 @@ static void AddComponentCategories(void)
 {
     TVINSERTSTRUCTW tvis;
     HKEY hKey, hCurKey;
+    WCHAR keyName[MAX_LOAD_STRING];
     WCHAR valName[MAX_LOAD_STRING];
     WCHAR buffer[MAX_LOAD_STRING];
     LONG lenBuffer;
     DWORD lenBufferHlp;
+    DWORD lenValName;
     int i=-1;
 
     U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_CHILDREN;
@@ -520,23 +522,24 @@ static void AddComponentCategories(void)
     {
         i++;
 
-        if(RegEnumKeyW(hKey, i, valName, sizeof(valName)/sizeof(valName[0])) != ERROR_SUCCESS) break;
+        if(RegEnumKeyW(hKey, i, keyName, sizeof(keyName)/sizeof(keyName[0])) != ERROR_SUCCESS) break;
 
-        if(RegOpenKeyW(hKey, valName, &hCurKey) != ERROR_SUCCESS) continue;
+        if(RegOpenKeyW(hKey, keyName, &hCurKey) != ERROR_SUCCESS) continue;
 
         lenBuffer = sizeof(WCHAR[MAX_LOAD_STRING]);
         lenBufferHlp = sizeof(WCHAR[MAX_LOAD_STRING]);
+        lenValName = sizeof(WCHAR[MAX_LOAD_STRING]);
 
         if(RegQueryValueW(hCurKey, NULL, buffer, &lenBuffer) == ERROR_SUCCESS && *buffer)
             U(tvis).item.pszText = buffer;
-        else if(RegEnumValueW(hCurKey, 0, NULL, NULL, NULL, NULL,
+        else if(RegEnumValueW(hCurKey, 0, valName, &lenValName, NULL, NULL,
                     (LPBYTE)buffer, &lenBufferHlp) == ERROR_SUCCESS && *buffer)
             U(tvis).item.pszText = buffer;
         else continue;
 
         RegCloseKey(hCurKey);
 
-        U(tvis).item.lParam = CreateITEM_INFO(REGTOP, valName, valName, NULL);
+        U(tvis).item.lParam = CreateITEM_INFO(REGTOP, keyName, keyName, NULL);
         SendMessageW(globals.hTree, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
     }
 




More information about the wine-cvs mailing list