fix bug introduced in r27994

svn path=/trunk/; revision=28012
This commit is contained in:
Christoph von Wittich 2007-07-29 17:30:21 +00:00
parent e36095538d
commit 7875f9d609

View file

@ -513,12 +513,15 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
HKEY hKey = NULL; HKEY hKey = NULL;
LPNMTVDISPINFO ptvdi; LPNMTVDISPINFO ptvdi;
LONG lResult; LONG lResult;
TCHAR szBuffer[MAX_PATH];
ptvdi = (LPNMTVDISPINFO) lParam; ptvdi = (LPNMTVDISPINFO) lParam;
if (ptvdi->item.pszText) 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); 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; lResult = REG_OPENED_EXISTING_KEY;
RegCloseKey(hKey); RegCloseKey(hKey);