- Revert s_EnumInstalledAppProc()

svn path=/branches/GSoC_2017/rapps/; revision=75680
This commit is contained in:
Alexander Shaposhnikov 2017-08-26 17:52:55 +00:00
parent 9fa8155e7c
commit 93010e2e08

View file

@ -1384,27 +1384,35 @@ private:
return StrStrIW(szHaystack, szNeedle) != NULL; 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; ATL::CStringW szText;
INT Index; INT Index;
INSTALLED_INFO Info;
if (!SearchPatternMatch(szName.GetString(), szSearchPattern)) if (!SearchPatternMatch(szName.GetString(), szSearchPattern))
{ {
RegCloseKey(ItemInfo->hSubKey); RegCloseKey(Info->hSubKey);
return TRUE; return TRUE;
} }
RtlCopyMemory(ItemInfo, &Info, sizeof(INSTALLED_INFO)); ItemInfo = (PINSTALLED_INFO) HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) &Info); if (!ItemInfo)
{
RegCloseKey(Info->hSubKey);
return FALSE;
}
RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) ItemInfo);
/* Get version info */ /* 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())); ListView_SetItemText(hListView, Index, 1, const_cast<LPWSTR>(szText.GetString()));
/* Get comments */ /* Get comments */
GetApplicationString(Info.hSubKey, L"Comments", szText); GetApplicationString(ItemInfo->hSubKey, L"Comments", szText);
ListView_SetItemText(hListView, Index, 2, const_cast<LPWSTR>(szText.GetString())); ListView_SetItemText(hListView, Index, 2, const_cast<LPWSTR>(szText.GetString()));
return TRUE; return TRUE;