Author: dchapyshev Date: Wed Aug 26 21:03:32 2009 New Revision: 42946
URL: http://svn.reactos.org/svn/reactos?rev=42946&view=rev Log: - Fix problem with uTorrent deinstallation - Closing of keys at list updating
Modified: trunk/reactos/base/applications/rapps/installed.c trunk/reactos/base/applications/rapps/rapps.h trunk/reactos/base/applications/rapps/winmain.c
Modified: trunk/reactos/base/applications/rapps/installed.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ins... ============================================================================== --- trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] Wed Aug 26 21:03:32 2009 @@ -31,7 +31,7 @@
BOOL -IsInstalledApplication(LPWSTR lpRegName) +IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey) { DWORD dwSize = MAX_PATH, dwType; WCHAR szName[MAX_PATH]; @@ -39,7 +39,7 @@ HKEY hKey, hSubKey; INT ItemIndex = 0;
- if (RegOpenKeyW(HKEY_LOCAL_MACHINE, + if (RegOpenKeyW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, L"Software\Microsoft\Windows\CurrentVersion\Uninstall", &hKey) != ERROR_SUCCESS) { @@ -247,7 +247,6 @@ ItemIndex++; }
- RegCloseKey(hSubKey); RegCloseKey(hKey);
return TRUE;
Modified: trunk/reactos/base/applications/rapps/rapps.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/rap... ============================================================================== --- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Wed Aug 26 21:03:32 2009 @@ -80,7 +80,7 @@ BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString); BOOL ShowInstalledAppInfo(INT Index); BOOL UninstallApplication(INT Index, BOOL bModify); -BOOL IsInstalledApplication(LPWSTR lpRegName); +BOOL IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey);
/* winmain.c */ extern HWND hMainWnd;
Modified: trunk/reactos/base/applications/rapps/winmain.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/win... ============================================================================== --- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Wed Aug 26 21:03:32 2009 @@ -15,6 +15,21 @@ INT SelectedEnumType = ENUM_ALL_COMPONENTS;
+VOID +FreeInstalledAppList(VOID) +{ + INT Count = ListView_GetItemCount(hListView) - 1; + HKEY hKey; + + while (Count >= 0) + { + hKey = ListViewGetlParam(Count); + if (hKey) + RegCloseKey(hKey); + Count--; + } +} + BOOL CALLBACK EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, LPWSTR lpKeyName, LPARAM lParam) @@ -56,7 +71,8 @@ PAPPLICATION_INFO ItemInfo; INT Index;
- if (!IsInstalledApplication(Info.szRegName)) + if (!IsInstalledApplication(Info.szRegName, FALSE) && + !IsInstalledApplication(Info.szRegName, TRUE)) { ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(APPLICATION_INFO)); if (!ItemInfo) return FALSE; @@ -98,6 +114,11 @@
if (EnumType == -1) EnumType = SelectedEnumType;
+ if (IS_INSTALLED_ENUM(SelectedEnumType)) + FreeInstalledAppList(); + else if (IS_AVAILABLE_ENUM(SelectedEnumType)) + FreeAvailableAppList(); + if (IS_INSTALLED_ENUM(EnumType)) { /* Enum installed applications and updates */ @@ -106,9 +127,6 @@ } else if (IS_AVAILABLE_ENUM(EnumType)) { - if (IS_AVAILABLE_ENUM(SelectedEnumType)) - FreeAvailableAppList(); - /* Enum availabled applications */ EnumAvailableApplications(EnumType, EnumAvailableAppProc); } @@ -608,6 +626,8 @@ { if (IS_AVAILABLE_ENUM(SelectedEnumType)) FreeAvailableAppList(); + if (IS_INSTALLED_ENUM(SelectedEnumType)) + FreeInstalledAppList(); if (hImageListView) ImageList_Destroy(hImageListView); if (hImageTreeView) ImageList_Destroy(hImageTreeView); PostQuitMessage(0);