Author: ashaposhnikov
Date: Sat Aug 26 17:52:55 2017
New Revision: 75680
URL:
http://svn.reactos.org/svn/reactos?rev=75680&view=rev
Log:
[RAPPS]
- Revert s_EnumInstalledAppProc()
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1] Sat Aug
26 17:52:55 2017
@@ -1384,27 +1384,35 @@
return StrStrIW(szHaystack, szNeedle) != NULL;
}
- static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, ATL::CStringW &szName,
PINSTALLED_INFO ItemInfo)
- {
+ static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, ATL::CStringW &szName,
PINSTALLED_INFO Info)
+ {
+ PINSTALLED_INFO ItemInfo;
ATL::CStringW szText;
INT Index;
- INSTALLED_INFO Info;
if (!SearchPatternMatch(szName.GetString(), szSearchPattern))
{
- RegCloseKey(ItemInfo->hSubKey);
+ RegCloseKey(Info->hSubKey);
return TRUE;
}
- RtlCopyMemory(ItemInfo, &Info, sizeof(INSTALLED_INFO));
- Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) &Info);
+ ItemInfo = (PINSTALLED_INFO) HeapAlloc(GetProcessHeap(), 0,
sizeof(INSTALLED_INFO));
+ if (!ItemInfo)
+ {
+ RegCloseKey(Info->hSubKey);
+ return FALSE;
+ }
+
+ RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
+
+ Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) ItemInfo);
/* Get version info */
- GetApplicationString(Info.hSubKey, L"DisplayVersion", szText);
+ GetApplicationString(ItemInfo->hSubKey, L"DisplayVersion", szText);
ListView_SetItemText(hListView, Index, 1,
const_cast<LPWSTR>(szText.GetString()));
/* Get comments */
- GetApplicationString(Info.hSubKey, L"Comments", szText);
+ GetApplicationString(ItemInfo->hSubKey, L"Comments", szText);
ListView_SetItemText(hListView, Index, 2,
const_cast<LPWSTR>(szText.GetString()));
return TRUE;