fix bug introduced in r27994
authorChristoph von Wittich <christoph_vw@reactos.org>
Sun, 29 Jul 2007 17:30:21 +0000 (17:30 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sun, 29 Jul 2007 17:30:21 +0000 (17:30 +0000)
svn path=/trunk/; revision=28012

reactos/base/applications/regedit/childwnd.c

index 5944538..6bf2f15 100644 (file)
@@ -513,12 +513,15 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                   HKEY hKey = NULL;
                   LPNMTVDISPINFO ptvdi;
                   LONG lResult;
+                  TCHAR szBuffer[MAX_PATH];
 
                   ptvdi = (LPNMTVDISPINFO) lParam;
                   if (ptvdi->item.pszText)
                   {
+                    keyPath = GetItemPath(pChildWnd->hTreeWnd, TreeView_GetParent(pChildWnd->hTreeWnd, ptvdi->item.hItem), &hRootKey);
+                    _sntprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), _T("%s\\%s"), keyPath, ptvdi->item.pszText);
                     keyPath = GetItemPath(pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
-                    if (RegOpenKeyEx(hRootKey, keyPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+                    if (RegOpenKeyEx(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
                     {
                       lResult = REG_OPENED_EXISTING_KEY;
                       RegCloseKey(hKey);