mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:12:59 +00:00
[RAPPS]
fix handle leaks svn path=/trunk/; revision=67305
This commit is contained in:
parent
ece1ba5016
commit
3804a6e321
3 changed files with 21 additions and 9 deletions
|
@ -26,7 +26,7 @@
|
||||||
b[0] = '\0';
|
b[0] = '\0';
|
||||||
|
|
||||||
LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead };
|
LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead };
|
||||||
PLIST_ENTRY pCachedEntry = NULL;
|
PLIST_ENTRY pCachedEntry = &CachedEntriesHead;
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
ShowAvailableAppInfo(INT Index)
|
ShowAvailableAppInfo(INT Index)
|
||||||
|
@ -151,13 +151,6 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
PAPPLICATION_INFO Info;
|
PAPPLICATION_INFO Info;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
/* initialize the cached list if hasn't been yet */
|
|
||||||
if (pCachedEntry == NULL)
|
|
||||||
{
|
|
||||||
InitializeListHead(&CachedEntriesHead);
|
|
||||||
pCachedEntry = &CachedEntriesHead;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GetStorageDirectory(szPath, _countof(szPath)))
|
if (!GetStorageDirectory(szPath, _countof(szPath)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -282,8 +282,20 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
|
||||||
if (!lpEnumProc(ItemIndex, pszDisplayName, &Info))
|
if (!lpEnumProc(ItemIndex, pszDisplayName, &Info))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegCloseKey(Info.hSubKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegCloseKey(Info.hSubKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegCloseKey(Info.hSubKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dwSize = MAX_PATH;
|
dwSize = MAX_PATH;
|
||||||
|
|
|
@ -127,10 +127,17 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info)
|
||||||
INT Index;
|
INT Index;
|
||||||
|
|
||||||
if (!SearchPatternMatch(lpName, szSearchPattern))
|
if (!SearchPatternMatch(lpName, szSearchPattern))
|
||||||
|
{
|
||||||
|
RegCloseKey(Info->hSubKey);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
|
ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
|
||||||
if (!ItemInfo) return FALSE;
|
if (!ItemInfo)
|
||||||
|
{
|
||||||
|
RegCloseKey(Info->hSubKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
|
RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue