mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 23:48:12 +00:00
[RAPPS]
Don't pass structures by copy, give a pointer instead CID #502621 CID #502622 CID #502623 svn path=/trunk/; revision=62639
This commit is contained in:
parent
9300d44ca7
commit
9483e8b29c
5 changed files with 22 additions and 22 deletions
|
@ -219,7 +219,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
|||
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);
|
||||
|
|
|
@ -279,7 +279,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc)
|
|||
((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /* Applications only */
|
||||
((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates only */
|
||||
{
|
||||
if (!lpEnumProc(ItemIndex, pszDisplayName, Info))
|
||||
if (!lpEnumProc(ItemIndex, pszDisplayName, &Info))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ typedef struct
|
|||
} 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 UpdateAppsDB(VOID);
|
|||
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);
|
||||
|
|
|
@ -48,15 +48,15 @@ ChooseFolder(HWND hwnd)
|
|||
}
|
||||
|
||||
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 @@ SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_INITDIALOG:
|
||||
{
|
||||
NewSettingsInfo = SettingsInfo;
|
||||
InitSettingsControls(hDlg, SettingsInfo);
|
||||
InitSettingsControls(hDlg, &SettingsInfo);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -98,7 +98,7 @@ SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case IDC_DEFAULT_SETTINGS:
|
||||
FillDefaultSettings(&NewSettingsInfo);
|
||||
InitSettingsControls(hDlg, NewSettingsInfo);
|
||||
InitSettingsControls(hDlg, &NewSettingsInfo);
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
|
|
|
@ -115,7 +115,7 @@ FreeInstalledAppList(VOID)
|
|||
|
||||
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 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info)
|
|||
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 @@ FreeAvailableAppList(VOID)
|
|||
|
||||
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 @@ EnumAvailableAppProc(APPLICATION_INFO Info)
|
|||
- 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;
|
||||
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);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue