Author: pschweitzer
Date: Sat Apr 5 22:49:18 2014
New Revision: 62639
URL:
http://svn.reactos.org/svn/reactos?rev=62639&view=rev
Log:
[RAPPS]
Don't pass structures by copy, give a pointer instead
CID #502621
CID #502622
CID #502623
Modified:
trunk/reactos/base/applications/rapps/available.c
trunk/reactos/base/applications/rapps/installed.c
trunk/reactos/base/applications/rapps/rapps.h
trunk/reactos/base/applications/rapps/settingsdlg.c
trunk/reactos/base/applications/rapps/winmain.c
Modified: trunk/reactos/base/applications/rapps/available.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/av…
==============================================================================
--- trunk/reactos/base/applications/rapps/available.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/available.c [iso-8859-1] Sat Apr 5 22:49:18
2014
@@ -219,7 +219,7 @@
GET_STRING2(L"URLSite", Info.szUrlSite);
GET_STRING2(L"CDPath", Info.szCDPath);
- if (!lpEnumProc(Info)) break;
+ if (!lpEnumProc(&Info)) break;
} while (FindNextFileW(hFind, &FindFileData) != 0);
FindClose(hFind);
Modified: trunk/reactos/base/applications/rapps/installed.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/in…
==============================================================================
--- trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/installed.c [iso-8859-1] Sat Apr 5 22:49:18
2014
@@ -279,7 +279,7 @@
((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /*
Applications only */
((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates
only */
{
- if (!lpEnumProc(ItemIndex, pszDisplayName, Info))
+ if (!lpEnumProc(ItemIndex, pszDisplayName, &Info))
break;
}
}
Modified: trunk/reactos/base/applications/rapps/rapps.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
==============================================================================
--- trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/rapps.h [iso-8859-1] Sat Apr 5 22:49:18 2014
@@ -107,7 +107,7 @@
} SETTINGS_INFO, *PSETTINGS_INFO;
/* available.c */
-typedef BOOL (CALLBACK *AVAILENUMPROC)(APPLICATION_INFO Info);
+typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info);
BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
BOOL ShowAvailableAppInfo(INT Index);
BOOL UpdateAppsDB(VOID);
@@ -116,7 +116,7 @@
BOOL InstallApplication(INT Index);
/* installed.c */
-typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info);
+typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO
Info);
BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString);
BOOL ShowInstalledAppInfo(INT Index);
Modified: trunk/reactos/base/applications/rapps/settingsdlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/se…
==============================================================================
--- trunk/reactos/base/applications/rapps/settingsdlg.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/settingsdlg.c [iso-8859-1] Sat Apr 5 22:49:18
2014
@@ -48,15 +48,15 @@
}
static VOID
-InitSettingsControls(HWND hDlg, SETTINGS_INFO Info)
+InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info)
{
- SendDlgItemMessage(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info.bSaveWndPos, 0);
- SendDlgItemMessage(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info.bUpdateAtStart, 0);
- SendDlgItemMessage(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info.bLogEnabled, 0);
- SendDlgItemMessage(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info.bDelInstaller, 0);
+ SendDlgItemMessage(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info->bSaveWndPos, 0);
+ SendDlgItemMessage(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info->bUpdateAtStart,
0);
+ SendDlgItemMessage(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info->bLogEnabled, 0);
+ SendDlgItemMessage(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info->bDelInstaller,
0);
SetWindowTextW(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT),
- Info.szDownloadDir);
+ Info->szDownloadDir);
}
static
@@ -68,7 +68,7 @@
case WM_INITDIALOG:
{
NewSettingsInfo = SettingsInfo;
- InitSettingsControls(hDlg, SettingsInfo);
+ InitSettingsControls(hDlg, &SettingsInfo);
}
break;
@@ -98,7 +98,7 @@
case IDC_DEFAULT_SETTINGS:
FillDefaultSettings(&NewSettingsInfo);
- InitSettingsControls(hDlg, NewSettingsInfo);
+ InitSettingsControls(hDlg, &NewSettingsInfo);
break;
case IDOK:
Modified: trunk/reactos/base/applications/rapps/winmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/wi…
==============================================================================
--- trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/winmain.c [iso-8859-1] Sat Apr 5 22:49:18 2014
@@ -115,7 +115,7 @@
BOOL
CALLBACK
-EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info)
+EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info)
{
PINSTALLED_INFO ItemInfo;
WCHAR szText[MAX_PATH];
@@ -127,7 +127,7 @@
ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO));
if (!ItemInfo) return FALSE;
- *ItemInfo = Info;
+ RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO));
Index = ListViewAddItem(ItemIndex, 0, lpName, (LPARAM)ItemInfo);
@@ -158,13 +158,13 @@
BOOL
CALLBACK
-EnumAvailableAppProc(APPLICATION_INFO Info)
+EnumAvailableAppProc(PAPPLICATION_INFO Info)
{
PAPPLICATION_INFO ItemInfo;
INT Index;
- if (!SearchPatternMatch(Info.szName, szSearchPattern) &&
- !SearchPatternMatch(Info.szDesc, szSearchPattern))
+ if (!SearchPatternMatch(Info->szName, szSearchPattern) &&
+ !SearchPatternMatch(Info->szDesc, szSearchPattern))
{
return TRUE;
}
@@ -173,16 +173,16 @@
- no RegName was supplied (so we cannot determine whether the application is
installed or not) or
- a RegName was supplied and the application is not installed
*/
- if (!*Info.szRegName || (!IsInstalledApplication(Info.szRegName, FALSE) &&
!IsInstalledApplication(Info.szRegName, TRUE)))
+ if (!*Info->szRegName || (!IsInstalledApplication(Info->szRegName, FALSE)
&& !IsInstalledApplication(Info->szRegName, TRUE)))
{
ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(APPLICATION_INFO));
if (!ItemInfo) return FALSE;
- *ItemInfo = Info;
-
- Index = ListViewAddItem(Info.Category, 0, Info.szName, (LPARAM)ItemInfo);
- ListView_SetItemText(hListView, Index, 1, Info.szVersion);
- ListView_SetItemText(hListView, Index, 2, Info.szDesc);
+ RtlCopyMemory(ItemInfo, Info, sizeof(APPLICATION_INFO));
+
+ Index = ListViewAddItem(Info->Category, 0, Info->szName,
(LPARAM)ItemInfo);
+ ListView_SetItemText(hListView, Index, 1, Info->szVersion);
+ ListView_SetItemText(hListView, Index, 2, Info->szDesc);
}
return TRUE;