ReactOS 0.4.16-dev-2636-g02c744d
wizard.c File Reference
#include "precomp.h"
#include <stdlib.h>
#include <time.h>
#include <winnls.h>
#include <windowsx.h>
#include <wincon.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <tzlib.h>
#include <strsafe.h>
#include <debug.h>
Include dependency graph for wizard.c:

Go to the source code of this file.

Classes

struct  _REGISTRATIONDATA
 
struct  _TIMEZONE_ENTRY
 
struct  _PRODUCT_OPTION_DATA
 
struct  ThemeInfo
 

Macros

#define NDEBUG
 
#define MAX_LAYOUTS_PER_LANGID   0x10000
 

Typedefs

typedef struct _REGISTRATIONDATA REGISTRATIONDATA
 
typedef struct _REGISTRATIONDATAPREGISTRATIONDATA
 
typedef struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
 
typedef struct _TIMEZONE_ENTRYPTIMEZONE_ENTRY
 
typedef struct _PRODUCT_OPTION_DATA PRODUCT_OPTION_DATA
 
typedef DWORD(WINAPIPFNREQUESTWIZARDPAGES) (PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
 

Functions

void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 
static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateTitleFont (VOID)
 
static HFONT CreateBoldFont (VOID)
 
static INT_PTR CALLBACK GplDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK WelcomeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK AckPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL DoWriteSoundEvents (HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
 
static BOOL DoWriteProductOption (PRODUCT_OPTION nOption)
 
static void OnChooseOption (HWND hwndDlg, PRODUCT_OPTION nOption)
 
static INT_PTR CALLBACK ProductPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteOwnerSettings (WCHAR *OwnerName, WCHAR *OwnerOrganization)
 
static INT_PTR CALLBACK OwnerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteComputerSettings (WCHAR *ComputerName, HWND hwndDlg)
 
static BOOL WriteDefaultLogonData (LPWSTR Domain)
 
static void GenerateComputerName (LPWSTR lpBuffer)
 
static INT_PTR CALLBACK ComputerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetUserLocaleName (HWND hwnd)
 
static VOID SetKeyboardLayoutName (HWND hwnd)
 
static BOOL RunControlPanelApplet (HWND hwnd, PCWSTR pwszCPLParameters)
 
VOID EnableVisualTheme (_In_opt_ HWND hwndParent, _In_opt_ PCWSTR ThemeFile)
 
static VOID WriteUserLocale (VOID)
 
static INT_PTR CALLBACK LocalePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry (PSETUPDATA SetupData, DWORD Index)
 
static LONG RetrieveTimeZone (IN HKEY hZoneKey, IN PVOID Context)
 
static VOID CreateTimeZoneList (PSETUPDATA SetupData)
 
static VOID DestroyTimeZoneList (PSETUPDATA SetupData)
 
static BOOL HasDaylightSavingTime (PTIMEZONE_ENTRY Entry)
 
static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry (PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex (PSETUPDATA SetupData, DWORD dwComboIndex)
 
static VOID UpdateAutoDaylightCheckbox (HWND hwndDlg, PTIMEZONE_ENTRY Entry)
 
static VOID ShowTimeZoneList (HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static VOID SetLocalTimeZone (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL GetLocalSystemTime (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL SetSystemLocalTime (HWND hwnd, PSETUPDATA SetupData)
 
static VOID UpdateLocalSystemTime (HWND hwnd, SYSTEMTIME LocalTime)
 
static BOOL WriteDateTimeSettings (HWND hwndDlg, PSETUPDATA SetupData)
 
static INT_PTR CALLBACK DateTimePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK ThemePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static UINT CALLBACK RegistrationNotificationProc (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
static DWORD RegisterDlls (_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
 
static VOID RegisterComponents (PITEMSDATA pItemsData)
 
static VOID SaveSettings (PITEMSDATA pItemsData)
 
static DWORD CALLBACK ItemCompletionThread (LPVOID Parameter)
 
static BOOL RunItemCompletionThread (_In_ HWND hwndDlg)
 
static VOID ShowItemError (HWND hwndDlg, DWORD LastError)
 
static VOID ShowStepError (HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
 
static INT_PTR CALLBACK ProcessPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetInstallationCompleted (VOID)
 
static INT_PTR CALLBACK FinishDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL GetInstallSourceWin32 (OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
 
VOID ProcessUnattendSection (IN OUT PSETUPDATA pSetupData)
 
static BOOL PathIsEqual (IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
 
static VOID AddInstallationSource (IN HKEY hKey, IN LPWSTR lpPath)
 
VOID ProcessSetupInf (IN OUT PSETUPDATA pSetupData)
 
VOID InstallWizard (VOID)
 

Variables

static const WCHAR s_szProductOptions [] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
 
static const WCHAR s_szRosVersion [] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"
 
static const WCHAR s_szControlWindows [] = L"SYSTEM\\CurrentControlSet\\Control\\Windows"
 
static const WCHAR s_szWinlogon [] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
 
static const WCHAR s_szDefaultSoundEvents [] = L"AppEvents\\Schemes\\Apps\\.Default"
 
static const WCHAR s_szExplorerSoundEvents [] = L"AppEvents\\Schemes\\Apps\\Explorer"
 
static const PRODUCT_OPTION_DATA s_ProductOptionData []
 
static const WCHARs_DefaultSoundEvents [][2]
 
static const WCHARs_ExplorerSoundEvents [][2]
 
static struct ThemeInfo Themes []
 

Macro Definition Documentation

◆ MAX_LAYOUTS_PER_LANGID

#define MAX_LAYOUTS_PER_LANGID   0x10000

◆ NDEBUG

#define NDEBUG

Definition at line 27 of file wizard.c.

Typedef Documentation

◆ PFNREQUESTWIZARDPAGES

typedef DWORD(WINAPI * PFNREQUESTWIZARDPAGES) (PDWORD, HPROPSHEETPAGE *, PSETUPDATA)

Definition at line 3360 of file wizard.c.

◆ PREGISTRATIONDATA

◆ PRODUCT_OPTION_DATA

◆ PTIMEZONE_ENTRY

◆ REGISTRATIONDATA

◆ TIMEZONE_ENTRY

Function Documentation

◆ AckPageDlgProc()

static INT_PTR CALLBACK AckPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 275 of file wizard.c.

279{
280 LPNMHDR lpnm;
281 PWCHAR Projects;
282 PWCHAR End, CurrentProject;
283 INT ProjectsSize, ProjectsCount;
284 PSETUPDATA pSetupData;
285
286 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
287
288 switch (uMsg)
289 {
290 case WM_INITDIALOG:
291 {
292 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
293 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
294
295 Projects = NULL;
296 ProjectsSize = 256;
297 while (TRUE)
298 {
299 Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
300 if (NULL == Projects)
301 {
302 return FALSE;
303 }
304 ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
305 if (0 == ProjectsCount)
306 {
307 HeapFree(GetProcessHeap(), 0, Projects);
308 return FALSE;
309 }
310 if (ProjectsCount < ProjectsSize - 1)
311 {
312 break;
313 }
314 HeapFree(GetProcessHeap(), 0, Projects);
315 ProjectsSize *= 2;
316 }
317
318 CurrentProject = Projects;
319 while (*CurrentProject != L'\0')
320 {
321 End = wcschr(CurrentProject, L'\n');
322 if (NULL != End)
323 {
324 *End = L'\0';
325 }
326 (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
327 if (NULL != End)
328 {
329 CurrentProject = End + 1;
330 }
331 else
332 {
333 CurrentProject += wcslen(CurrentProject);
334 }
335 }
336 HeapFree(GetProcessHeap(), 0, Projects);
337 }
338 break;
339
340 case WM_COMMAND:
342 {
345 }
346 break;
347
348 case WM_NOTIFY:
349 {
350 lpnm = (LPNMHDR)lParam;
351
352 switch (lpnm->code)
353 {
354 case PSN_SETACTIVE:
355 /* Enable the Back and Next buttons */
357 if (pSetupData->UnattendSetup)
358 {
360 return TRUE;
361 }
362 break;
363
364 case PSN_WIZBACK:
365 pSetupData->UnattendSetup = FALSE;
366 break;
367
368 default:
369 break;
370 }
371 }
372 break;
373
374 default:
375 break;
376 }
377
378 return FALSE;
379}
struct _SETUPDATA * PSETUPDATA
static HINSTANCE hDllInstance
Definition: clb.c:9
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define IDD_PRODUCT
Definition: resource.h:109
#define IDC_VIEWGPL
Definition: resource.h:46
#define IDD_GPL
Definition: resource.h:92
#define IDC_PROJECTS
Definition: resource.h:45
#define IDS_ACKPROJECTS
Definition: resource.h:137
#define L(x)
Definition: resources.c:13
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_BACK
Definition: prsht.h:153
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZBACK
Definition: prsht.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
#define LoadStringW
Definition: utils.h:64
BOOL UnattendSetup
Definition: syssetup.h:46
UINT code
Definition: winuser.h:3267
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:122
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
#define HIWORD(l)
Definition: typedefs.h:247
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:472
#define DWLP_USER
Definition: winuser.h:883
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1767
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define BN_CLICKED
Definition: winuser.h:1954
#define DialogBox
Definition: winuser.h:5927

Referenced by InstallWizard().

◆ AddInstallationSource()

static VOID AddInstallationSource ( IN HKEY  hKey,
IN LPWSTR  lpPath 
)
static

Definition at line 3137 of file wizard.c.

3140{
3141 LONG res;
3142 DWORD dwRegType;
3143 DWORD dwPathLength = 0;
3144 DWORD dwNewLength = 0;
3145 LPWSTR Buffer = NULL;
3146 LPWSTR Path;
3147
3149 hKey,
3150 L"Installation Sources",
3151 NULL,
3152 &dwRegType,
3153 NULL,
3154 &dwPathLength);
3155
3156 if (res != ERROR_SUCCESS ||
3157 dwRegType != REG_MULTI_SZ ||
3158 dwPathLength == 0 ||
3159 dwPathLength % sizeof(WCHAR) != 0)
3160 {
3161 dwPathLength = 0;
3162 goto set;
3163 }
3164
3165 /* Reserve space for existing data + new string */
3166 dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
3167 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3168 if (!Buffer)
3169 return;
3170
3171 ZeroMemory(Buffer, dwNewLength);
3172
3174 hKey,
3175 L"Installation Sources",
3176 NULL,
3177 NULL,
3178 (LPBYTE)Buffer,
3179 &dwPathLength);
3180
3181 if (res != ERROR_SUCCESS)
3182 {
3184 dwPathLength = 0;
3185 goto set;
3186 }
3187
3188 /* Sanity check, these should already be zeros */
3189 Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
3190 Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3191
3192 for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
3193 {
3194 /* Check if path is already added */
3195 if (PathIsEqual(Path, lpPath))
3196 goto cleanup;
3197 }
3198
3199 Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
3200
3201set:
3202 if (dwPathLength == 0)
3203 {
3204 dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
3205 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3206 if (!Buffer)
3207 return;
3208
3209 Path = Buffer;
3210 }
3211
3212 StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
3213 Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3214
3216 hKey,
3217 L"Installation Sources",
3218 0,
3220 (LPBYTE)Buffer,
3221 dwNewLength);
3222
3223cleanup:
3225}
PRTL_UNICODE_STRING_BUFFER Path
Definition: bufpool.h:45
Definition: _set.h:50
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
static void cleanup(void)
Definition: main.c:1335
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint res
Definition: glext.h:9613
#define ZeroMemory
Definition: minwinbase.h:31
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
static BOOL PathIsEqual(IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
Definition: wizard.c:3111
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56

Referenced by ProcessSetupInf().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 56 of file wizard.c.

57{
59 RECT rcParent;
60 RECT rcWindow;
61
63 if (hWndParent == NULL)
65
66 GetWindowRect(hWndParent, &rcParent);
67 GetWindowRect(hWnd, &rcWindow);
68
71 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
72 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
73 0,
74 0,
76}
HWND hWnd
Definition: settings.c:17
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1256
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1218

◆ ComputerPageDlgProc()

static INT_PTR CALLBACK ComputerPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1044 of file wizard.c.

1048{
1049 WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1050 WCHAR Password1[128];
1051 WCHAR Password2[128];
1053 WCHAR Title[64];
1054 WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
1055 LPNMHDR lpnm;
1056 PSETUPDATA pSetupData;
1057
1058 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1059
1061 {
1062 wcscpy(Title, L"ReactOS Setup");
1063 }
1064
1065 switch (uMsg)
1066 {
1067 case WM_INITDIALOG:
1068 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1069 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
1070
1071 /* Generate a new pseudo-random computer name */
1072 GenerateComputerName(ComputerName);
1073
1074 /* Display current computer name */
1075 SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
1076
1077 /* Set text limits */
1081
1082 /* Set focus to computer name */
1084 if (pSetupData->UnattendSetup)
1085 {
1091 }
1092
1093 /* Store the administrator account name as the default user name */
1095 break;
1096
1097
1098 case WM_NOTIFY:
1099 {
1100 lpnm = (LPNMHDR)lParam;
1101
1102 switch (lpnm->code)
1103 {
1104 case PSN_SETACTIVE:
1105 /* Enable the Back and Next buttons */
1107 if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
1108 {
1110 return TRUE;
1111 }
1112 break;
1113
1114 case PSN_WIZNEXT:
1115 if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
1116 {
1117 if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
1118 ARRAYSIZE(EmptyComputerName)))
1119 {
1120 wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1121 }
1122 MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1124 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1125 return TRUE;
1126 }
1127
1128 /* No need to check computer name for invalid characters,
1129 * SetComputerName() will do it for us */
1130
1131 if (!WriteComputerSettings(ComputerName, hwndDlg))
1132 {
1134 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1135 return TRUE;
1136 }
1137
1138#ifdef PASSWORDS_MANDATORY
1139 /* Check if admin passwords have been entered */
1140 if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1141 (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1142 {
1143 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1144 ARRAYSIZE(EmptyPassword)))
1145 {
1146 wcscpy(EmptyPassword, L"You must enter a password !");
1147 }
1148 MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1149 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1150 return TRUE;
1151 }
1152#else
1153 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1154 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1155#endif
1156 /* Check if passwords match */
1157 if (wcscmp(Password1, Password2))
1158 {
1159 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1160 ARRAYSIZE(NotMatchPassword)))
1161 {
1162 wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1163 }
1164 MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1165 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1166 return TRUE;
1167 }
1168
1169 /* Check password for invalid characters */
1170 Password = (PWCHAR)Password1;
1171 while (*Password)
1172 {
1173 if (!isprint(*Password))
1174 {
1175 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1176 ARRAYSIZE(WrongPassword)))
1177 {
1178 wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1179 }
1180 MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1181 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1182 return TRUE;
1183 }
1184 Password++;
1185 }
1186
1187 /* Set admin password */
1188 SetAdministratorPassword(Password1);
1189 break;
1190
1191 case PSN_WIZBACK:
1192 pSetupData->UnattendSetup = FALSE;
1193 break;
1194
1195 default:
1196 break;
1197 }
1198 }
1199 break;
1200
1201 default:
1202 break;
1203 }
1204
1205 return FALSE;
1206}
#define isprint(c)
Definition: acclib.h:73
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_REACTOS_SETUP
Definition: resource.h:140
static const WCHAR Title[]
Definition: oid.c:1259
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
#define IDC_COMPUTERNAME
Definition: resource.h:15
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1692
#define IDC_ADMINPASSWORD2
Definition: resource.h:55
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:152
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:154
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:155
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:153
#define IDC_ADMINPASSWORD1
Definition: resource.h:54
LONG_PTR LPARAM
Definition: minwindef.h:175
#define PSN_WIZNEXT
Definition: prsht.h:121
wcscpy
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:44
WCHAR AdminPassword[128]
Definition: syssetup.h:45
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:974
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:1026
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:903
@ Password
Definition: telnetd.h:67
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:267
#define EM_LIMITTEXT
Definition: winuser.h:2029
#define GetDlgItemText
Definition: winuser.h:5951
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:798
#define WM_SETTEXT
Definition: winuser.h:1645
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendMessage
Definition: winuser.h:6009
#define MB_OK
Definition: winuser.h:801
#define SendDlgItemMessage
Definition: winuser.h:6008

Referenced by InstallWizard().

◆ Control_RunDLLW()

void WINAPI Control_RunDLLW ( HWND  hWnd,
HINSTANCE  hInst,
LPCWSTR  cmd,
DWORD  nCmdShow 
)

Definition at line 1177 of file control.c.

1178{
1179 CPanel panel;
1180
1181 TRACE("(%p, %p, %s, 0x%08x)\n",
1182 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1183
1184#ifndef __REACTOS__
1185 memset(&panel, 0, sizeof(panel));
1186 list_init( &panel.applets );
1187#endif
1188
1189 if (!cmd || !*cmd) {
1190 Control_DoWindow(&panel, hWnd, hInst);
1191 } else {
1192 Control_DoLaunch(&panel, hWnd, cmd);
1193 }
1194}
static void list_init(struct list_entry *head)
Definition: list.h:51
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:703
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:867
HINSTANCE hInst
Definition: dxdiag.c:13
#define debugstr_w
Definition: kernel32.h:32
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cpanel.h:56
struct list applets
Definition: cpanel.h:57
Definition: ftp_var.h:139

Referenced by FinishDlgProc().

◆ CreateBoldFont()

static HFONT CreateBoldFont ( VOID  )
static

Definition at line 101 of file wizard.c.

102{
103 LOGFONTW tmpFont = {0};
104 HFONT hBoldFont;
105 HDC hDc;
106
107 /* Grabs the Drawing Context */
108 hDc = GetDC(NULL);
109
110 tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
111 tmpFont.lfWeight = FW_BOLD;
112 wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
113
114 hBoldFont = CreateFontIndirectW(&tmpFont);
115
116 ReleaseDC(NULL, hDc);
117
118 return hBoldFont;
119}
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by InstallWizard().

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1658 of file wizard.c.

1659{
1661}
SETUPDATA SetupData
Definition: reactos.c:41
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1577
VOID EnumerateTimeZoneList(IN PENUM_TIMEZONE_CALLBACK Callback, IN PVOID Context OPTIONAL)
Definition: tzlib.c:223

Referenced by DateTimePageDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 80 of file wizard.c.

81{
82 LOGFONTW LogFont = {0};
83 HDC hdc;
85
86 LogFont.lfWeight = FW_BOLD;
87 wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
88
89 hdc = GetDC(NULL);
90 LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
91
92 hFont = CreateFontIndirectW(&LogFont);
93
95
96 return hFont;
97}
HFONT hFont
Definition: main.c:53
HDC hdc
Definition: main.c:9

◆ DateTimePageDlgProc()

static INT_PTR CALLBACK DateTimePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1891 of file wizard.c.

1895{
1897
1898 /* Retrieve pointer to the global setup data */
1900
1901 switch (uMsg)
1902 {
1903 case WM_INITDIALOG:
1904 {
1905 DWORD dwEntryIndex;
1907
1908 /* Save pointer to the global setup data */
1911
1913
1915 {
1918
1921 {
1924 }
1925 else
1926 {
1929 }
1930 }
1931 else
1932 {
1933 /* Get the default time zone index from the registry */
1934 dwEntryIndex = (DWORD)-1;
1935 GetTimeZoneListIndex(&dwEntryIndex);
1936
1938 SetupData, -1);
1939
1940 /* Set the auto-daylight checkbox based on whether
1941 * the selected timezone observes DST */
1942 Entry = GetSelectedTimeZoneEntry(SetupData, dwEntryIndex);
1944 }
1945 break;
1946 }
1947
1948 case WM_TIMER:
1949 {
1950 SYSTEMTIME LocalTime;
1951
1952 GetLocalTime(&LocalTime);
1953 UpdateLocalSystemTime(hwndDlg, LocalTime);
1954
1955 // Reset timeout.
1956 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1957 break;
1958 }
1959
1960 case WM_COMMAND:
1962 {
1963 /* User changed the timezone selection */
1964 DWORD dwIndex = (DWORD)SendDlgItemMessage(hwndDlg, IDC_TIMEZONELIST, CB_GETCURSEL, 0, 0);
1967 }
1968 break;
1969
1970 case WM_NOTIFY:
1971 switch (((LPNMHDR)lParam)->code)
1972 {
1973 case PSN_SETACTIVE:
1974 {
1975 SYSTEMTIME LocalTime;
1976
1977 GetLocalTime(&LocalTime);
1978 UpdateLocalSystemTime(hwndDlg, LocalTime);
1979
1980 /* Enable the Back and Next buttons */
1982
1984 {
1986 return TRUE;
1987 }
1988
1989 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1990 break;
1991 }
1992
1993 case PSN_KILLACTIVE:
1994 case DTN_DATETIMECHANGE:
1995 // NB: Not re-set until changing page (PSN_SETACTIVE).
1996 KillTimer(hwndDlg, 1);
1997 break;
1998
1999 case PSN_WIZNEXT:
2001 break;
2002
2003 case PSN_WIZBACK:
2005 break;
2006
2007 default:
2008 break;
2009 }
2010 break;
2011
2012 case WM_DESTROY:
2014 break;
2015
2016 default:
2017 break;
2018 }
2019
2020 return FALSE;
2021}
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
#define IDD_THEMEPAGE
Definition: resource.h:89
UINT_PTR WPARAM
Definition: minwindef.h:174
#define DWORD
Definition: nt_native.h:44
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4371
Entry
Definition: section.c:5210
DWORD TimeZoneIndex
Definition: syssetup.h:52
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
WORD wMilliseconds
Definition: minwinbase.h:263
Definition: timezone.c:16
Definition: inflate.c:139
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1658
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1852
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1860
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1664
static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry(PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1695
static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex(PSETUPDATA SetupData, DWORD dwComboIndex)
Definition: wizard.c:1709
static BOOL HasDaylightSavingTime(PTIMEZONE_ENTRY Entry)
Definition: wizard.c:1686
static VOID UpdateAutoDaylightCheckbox(HWND hwndDlg, PTIMEZONE_ENTRY Entry)
Definition: wizard.c:1720
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1733
#define GWLP_USERDATA
Definition: treelist.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
#define BST_UNCHECKED
Definition: winuser.h:199
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define BM_SETCHECK
Definition: winuser.h:1950
#define WM_TIMER
Definition: winuser.h:1770
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1637
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1972
#define BST_CHECKED
Definition: winuser.h:197

Referenced by InstallWizard().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1664 of file wizard.c.

1665{
1667
1668 while (SetupData->TimeZoneListHead != NULL)
1669 {
1671
1674 {
1676 }
1677
1679 }
1680
1682}
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51

Referenced by DateTimePageDlgProc().

◆ DoWriteProductOption()

static BOOL DoWriteProductOption ( PRODUCT_OPTION  nOption)
static

Definition at line 523 of file wizard.c.

524{
525 HKEY hKey;
526 LONG error;
527 LPCWSTR pszData;
528 DWORD dwValue, cbData;
530 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
531
532 /* open ProductOptions key */
534 if (error)
535 {
536 DPRINT1("RegOpenKeyExW failed\n");
537 goto Error;
538 }
539
540 /* write ProductSuite */
541 pszData = pData->ProductSuite;
542 cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
543 error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
544 if (error)
545 {
546 DPRINT1("RegSetValueExW failed\n");
547 goto Error;
548 }
549
550 /* write ProductType */
551 pszData = pData->ProductType;
552 cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
553 error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
554 if (error)
555 {
556 DPRINT1("RegSetValueExW failed\n");
557 goto Error;
558 }
559
561
562 /* open ReactOS version key */
564 if (error)
565 {
566 DPRINT1("RegOpenKeyExW failed\n");
567 goto Error;
568 }
569
570 /* write ReportAsWorkstation */
571 dwValue = pData->ReportAsWorkstation;
572 cbData = sizeof(dwValue);
573 error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
574 if (error)
575 {
576 DPRINT1("RegSetValueExW failed\n");
577 goto Error;
578 }
579
581
582 /* open Control Windows key */
584 if (error)
585 {
586 DPRINT1("RegOpenKeyExW failed\n");
587 goto Error;
588 }
589
590 /* write Control Windows CSDVersion */
591 dwValue = pData->CSDVersion;
592 cbData = sizeof(dwValue);
593 error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
594 if (error)
595 {
596 DPRINT1("RegSetValueExW failed\n");
597 goto Error;
598 }
599
601
602 /* open Winlogon key */
604 if (error)
605 {
606 DPRINT1("RegOpenKeyExW failed\n");
607 goto Error;
608 }
609
610 /* write LogonType */
611 dwValue = pData->LogonType;
612 cbData = sizeof(dwValue);
613 error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
614 if (error)
615 {
616 DPRINT1("RegSetValueExW failed\n");
617 goto Error;
618 }
619
620 if (nOption == PRODUCT_OPTION_WORKSTATION)
621 {
622 /* Write system sound events values for Workstation */
625 }
626
627Error:
628 if (hKey)
630
631 return error == ERROR_SUCCESS;
632}
#define DPRINT1
Definition: precomp.h:8
BOOL Error
Definition: chkdsk.c:66
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define lstrlenW
Definition: compat.h:750
#define REG_SZ
Definition: layer.c:22
#define error(str)
Definition: mkdosfs.c:1605
#define ASSERT(a)
Definition: mode.c:44
#define KEY_WRITE
Definition: nt_native.h:1034
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
#define REG_DWORD
Definition: sdbapi.c:615
#define _countof(array)
Definition: sndvol32.h:70
static const WCHAR * s_ExplorerSoundEvents[][2]
Definition: wizard.c:433
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:397
static BOOL DoWriteSoundEvents(HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
Definition: wizard.c:440
static const WCHAR s_szRosVersion[]
Definition: wizard.c:382
static const WCHAR s_szWinlogon[]
Definition: wizard.c:384
static const WCHAR * s_DefaultSoundEvents[][2]
Definition: wizard.c:403
static const WCHAR s_szExplorerSoundEvents[]
Definition: wizard.c:386
static const WCHAR s_szProductOptions[]
Definition: wizard.c:381
static const WCHAR s_szControlWindows[]
Definition: wizard.c:383
static const WCHAR s_szDefaultSoundEvents[]
Definition: wizard.c:385
@ PRODUCT_OPTION_WORKSTATION
Definition: syssetup.h:29
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
unsigned char BYTE
Definition: xxhash.c:193

Referenced by ProductPageDlgProc().

◆ DoWriteSoundEvents()

static BOOL DoWriteSoundEvents ( HKEY  hKey,
LPCWSTR  lpSubkey,
LPCWSTR  lpEventsArray[][2],
DWORD  dwSize 
)
static

Definition at line 440 of file wizard.c.

444{
445 HKEY hRootKey, hEventKey, hDefaultKey;
446 LONG error;
447 ULONG i;
448 WCHAR szDest[MAX_PATH];
449 DWORD dwAttribs;
451
452 /* Open the sound events key */
453 error = RegOpenKeyExW(hKey, lpSubkey, 0, KEY_READ, &hRootKey);
454 if (error)
455 {
456 DPRINT1("RegOpenKeyExW failed\n");
457 goto Error;
458 }
459
460 /* Set each sound event */
461 for (i = 0; i < dwSize; i++)
462 {
463 /*
464 * Verify that the sound file exists and is an actual file.
465 */
466
467 /* Expand the sound file path */
468 if (!ExpandEnvironmentStringsW(lpEventsArray[i][1], szDest, _countof(szDest)))
469 {
470 /* Failed to expand, continue with the next sound event */
471 continue;
472 }
473
474 /* Check if the sound file exists and isn't a directory */
475 dwAttribs = GetFileAttributesW(szDest);
476 if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
477 (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
478 {
479 /* It does not, just continue with the next sound event */
480 continue;
481 }
482
483 /*
484 * Create the sound event entry.
485 */
486
487 /* Open the sound event subkey */
488 error = RegOpenKeyExW(hRootKey, lpEventsArray[i][0], 0, KEY_READ, &hEventKey);
489 if (error)
490 {
491 /* Failed to open, continue with next sound event */
492 continue;
493 }
494
495 /* Open .Default subkey */
496 error = RegOpenKeyExW(hEventKey, L".Default", 0, KEY_WRITE, &hDefaultKey);
497 RegCloseKey(hEventKey);
498 if (error)
499 {
500 /* Failed to open, continue with next sound event */
501 continue;
502 }
503
504 /* Associate the sound file to this sound event */
505 cbData = (lstrlenW(lpEventsArray[i][1]) + 1) * sizeof(WCHAR);
506 error = RegSetValueExW(hDefaultKey, NULL, 0, REG_EXPAND_SZ, (const BYTE *)lpEventsArray[i][1], cbData);
507 RegCloseKey(hDefaultKey);
508 if (error)
509 {
510 /* Failed to set the value, continue with next sound event */
511 continue;
512 }
513 }
514
515Error:
516 if (hRootKey)
517 RegCloseKey(hRootKey);
518
519 return error == ERROR_SUCCESS;
520}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:520
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1026
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
uint32_t ULONG
Definition: typedefs.h:59
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by DoWriteProductOption().

◆ EnableVisualTheme()

VOID EnableVisualTheme ( _In_opt_ HWND  hwndParent,
_In_opt_ PCWSTR  ThemeFile 
)

Definition at line 1371 of file wizard.c.

1374{
1375 enum { THEME_FILE, STYLE_FILE, UNKNOWN } fType;
1376 WCHAR szPath[MAX_PATH]; // Expanded path of the file to use.
1377 WCHAR szStyleFile[MAX_PATH];
1378
1379 fType = THEME_FILE; // Default to Classic theme.
1380 if (ThemeFile)
1381 {
1382 /* Expand the path if possible */
1383 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1384 ThemeFile = szPath;
1385
1386 /* Determine the file type from its extension */
1387 fType = UNKNOWN; {
1388 PCWSTR pszExt = wcsrchr(ThemeFile, L'.'); // PathFindExtensionW(ThemeFile);
1389 if (pszExt)
1390 {
1391 if (_wcsicmp(pszExt, L".theme") == 0)
1392 fType = THEME_FILE;
1393 else if (_wcsicmp(pszExt, L".msstyles") == 0)
1394 fType = STYLE_FILE;
1395 } }
1396 if (fType == UNKNOWN)
1397 {
1398 DPRINT1("EnableVisualTheme(): Unknown file '%S'\n", ThemeFile);
1399 return;
1400 }
1401 }
1402
1403 DPRINT1("Applying visual %s '%S'\n",
1404 (fType == THEME_FILE) ? "theme" : "style",
1405 ThemeFile ? ThemeFile : L"(Classic)");
1406
1407//
1408// TODO: Use instead uxtheme!SetSystemVisualStyle() once it is implemented,
1409// https://stackoverflow.com/a/1036903
1410// https://pinvoke.net/default.aspx/uxtheme.SetSystemVisualStyle
1411// or ApplyTheme(NULL, 0, NULL) for restoring the classic theme.
1412//
1413// NOTE: The '/Action:ActivateMSTheme' is ReactOS-specific.
1414//
1415
1416 if (ThemeFile && (fType == THEME_FILE))
1417 {
1418 /* Retrieve the visual style specified in the theme file.
1419 * If none, fall back to the classic theme. */
1420 if (GetPrivateProfileStringW(L"VisualStyles", L"Path", NULL,
1421 szStyleFile, _countof(szStyleFile), ThemeFile) && *szStyleFile)
1422 {
1423 /* Expand the path if possible */
1424 ThemeFile = szStyleFile;
1425 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1426 ThemeFile = szPath;
1427 }
1428 else
1429 {
1430 ThemeFile = NULL;
1431 }
1432
1433 DPRINT1("--> Applying visual style '%S'\n",
1434 ThemeFile ? ThemeFile : L"(Classic)");
1435 }
1436
1437 if (ThemeFile)
1438 {
1439 WCHAR wszParams[1024];
1440 // FIXME: L"desk.cpl desk,@Appearance" regression, see commit 50d260a7f0
1441 PCWSTR format = L"desk.cpl,,2 /Action:ActivateMSTheme /file:\"%s\"";
1442
1443 StringCchPrintfW(wszParams, _countof(wszParams), format, ThemeFile);
1445 }
1446 else
1447 {
1448 RunControlPanelApplet(hwndParent, L"desk.cpl,,2 /Action:ActivateMSTheme");
1449 }
1450}
static HWND hwndParent
Definition: cryptui.c:300
#define wcsrchr
Definition: compat.h:16
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
void * UNKNOWN
Definition: ks.h:2676
LPCWSTR szPath
Definition: env.c:37
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
Definition: format.c:58
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1309
const uint16_t * PCWSTR
Definition: typedefs.h:57
struct _THEME_FILE THEME_FILE

Referenced by PreprocessUnattend(), and ThemePageDlgProc().

◆ FinishDlgProc()

static INT_PTR CALLBACK FinishDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2680 of file wizard.c.

2684{
2685
2686 switch (uMsg)
2687 {
2688 case WM_INITDIALOG:
2689 {
2690 /* Get pointer to the global setup data */
2692
2694 {
2695 /* Run the Wine Gecko prompt */
2696 Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl,,install_gecko", SW_SHOW);
2697 }
2698
2699 /* Set title font */
2700 SendDlgItemMessage(hwndDlg,
2702 WM_SETFONT,
2704 (LPARAM)TRUE);
2706 {
2707 KillTimer(hwndDlg, 1);
2709 PostQuitMessage(0);
2710 }
2711 }
2712 break;
2713
2714 case WM_DESTROY:
2715 {
2717 PostQuitMessage(0);
2718 return TRUE;
2719 }
2720
2721 case WM_TIMER:
2722 {
2723 INT Position;
2724 HWND hWndProgress;
2725
2726 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2727 Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2728 if (Position == 300)
2729 {
2730 KillTimer(hwndDlg, 1);
2732 }
2733 else
2734 {
2735 SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2736 }
2737 }
2738 return TRUE;
2739
2740 case WM_NOTIFY:
2741 {
2742 LPNMHDR lpnm = (LPNMHDR)lParam;
2743
2744 switch (lpnm->code)
2745 {
2746 case PSN_SETACTIVE:
2747 /* Enable the correct buttons on for the active page */
2749
2751 MAKELPARAM(0, 300));
2753 SetTimer(hwndDlg, 1, 50, NULL);
2754 break;
2755
2756 case PSN_WIZFINISH:
2757 DestroyWindow(GetParent(hwndDlg));
2758 break;
2759
2760 default:
2761 break;
2762 }
2763 }
2764 break;
2765
2766 default:
2767 break;
2768 }
2769
2770 return FALSE;
2771}
#define IDC_FINISHTITLE
Definition: resource.h:66
#define IDC_RESTART_PROGRESS
Definition: resource.h:67
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSBTN_FINISH
Definition: prsht.h:148
#define PSN_WIZFINISH
Definition: prsht.h:122
#define PBM_GETPOS
Definition: commctrl.h:2199
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
BOOL DisableGeckoInst
Definition: syssetup.h:47
HFONT hTitleFont
Definition: reactos.h:139
static COORD Position
Definition: mouse.c:34
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1177
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2651
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SETFONT
Definition: winuser.h:1678
#define SW_SHOW
Definition: winuser.h:786
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 1026 of file wizard.c.

1027{
1028 static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1029 static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
1030 unsigned i;
1031
1032 wcscpy(lpBuffer, L"REACTOS-");
1033
1035
1036 /* fill in 7 characters */
1037 for (i = 8; i < 15; i++)
1038 lpBuffer[i] = Chars[rand() % cChars];
1039
1040 lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
1041}
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
_ACRTIMP int __cdecl rand(void)
Definition: misc.c:59
_ACRTIMP void __cdecl srand(unsigned int)
Definition: misc.c:50
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

static BOOL GetInstallSourceWin32 ( OUT PWSTR  pwszPath,
IN DWORD  cchPathMax,
IN PCWSTR  pwszNTPath 
)
static

Definition at line 2779 of file wizard.c.

2783{
2784 WCHAR wszDrives[512];
2785 WCHAR wszNTPath[512]; // MAX_PATH ?
2786 DWORD cchDrives;
2787 PWCHAR pwszDrive;
2788
2789 *pwszPath = UNICODE_NULL;
2790
2791 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2792 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2793 {
2794 /* Buffer too small or failure */
2795 LogItem(NULL, L"GetLogicalDriveStringsW failed");
2796 return FALSE;
2797 }
2798
2799 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2800 {
2801 WCHAR wszBuf[MAX_PATH];
2802
2803 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2804 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2805 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2806 pwszDrive[2] = L'\\'; // Restore the backslash
2807
2808 wcscat(wszNTPath, L"\\"); // Concat a backslash
2809
2810 /* Logging */
2811 wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2812 pwszDrive, wszNTPath,
2813 (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2814 LogItem(NULL, wszBuf);
2815
2816 /* Check whether the NT path corresponds to the NT installation source path */
2817 if (!_wcsicmp(wszNTPath, pwszNTPath))
2818 {
2819 /* Found it! */
2820 wcscpy(pwszPath, pwszDrive); // cchPathMax
2821
2822 /* Logging */
2823 wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2824 LogItem(NULL, wszBuf);
2825 wcscat(wszBuf, L"\n");
2826 OutputDebugStringW(wszBuf);
2827
2828 return TRUE;
2829 }
2830 }
2831
2832 return FALSE;
2833}
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
wcscat
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98
#define DRIVE_CDROM
Definition: winbase.h:278
#define wsprintf
Definition: winuser.h:6031

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1560 of file wizard.c.

1561{
1563
1565 while (Entry != NULL)
1566 {
1567 if (Entry->Index >= Index)
1568 return Entry;
1569
1570 Entry = Entry->Next;
1571 }
1572
1573 return NULL;
1574}
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by RetrieveTimeZone().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1808 of file wizard.c.

1809{
1810 SYSTEMTIME Date;
1812
1814 {
1815 return FALSE;
1816 }
1817
1819 {
1820 return FALSE;
1821 }
1822
1826 SetupData->SystemTime.wDay = Date.wDay;
1827 SetupData->SystemTime.wHour = Time.wHour;
1828 SetupData->SystemTime.wMinute = Time.wMinute;
1829 SetupData->SystemTime.wSecond = Time.wSecond;
1830 SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1831
1832 return TRUE;
1833}
#define IDC_TIMEPICKER
Definition: resource.h:11
#define IDC_DATEPICKER
Definition: resource.h:64
static PLARGE_INTEGER Time
Definition: time.c:105
#define GDT_VALID
Definition: commctrl.h:4465
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4335
SYSTEMTIME SystemTime
Definition: syssetup.h:49
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
WORD wDayOfWeek
Definition: minwinbase.h:258
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by WriteDateTimeSettings().

◆ GetSelectedTimeZoneEntry()

static PTIMEZONE_ENTRY GetSelectedTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  dwEntryIndex 
)
static

Definition at line 1695 of file wizard.c.

1696{
1698
1699 for (Entry = SetupData->TimeZoneListHead; Entry != NULL; Entry = Entry->Next)
1700 {
1701 if (Entry->Index == dwEntryIndex)
1702 return Entry;
1703 }
1704
1705 return NULL;
1706}

Referenced by DateTimePageDlgProc().

◆ GetTimeZoneEntryByIndex()

static PTIMEZONE_ENTRY GetTimeZoneEntryByIndex ( PSETUPDATA  SetupData,
DWORD  dwComboIndex 
)
static

Definition at line 1709 of file wizard.c.

1710{
1712 DWORD i;
1713
1714 for (Entry = SetupData->TimeZoneListHead, i = 0; Entry != NULL && i < dwComboIndex; i++, Entry = Entry->Next);
1715
1716 return Entry;
1717}
STDMETHOD() Next(THIS_ ULONG celt, IAssociationElement *pElement, ULONG *pceltFetched) PURE

Referenced by DateTimePageDlgProc().

◆ GplDlgProc()

static INT_PTR CALLBACK GplDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 122 of file wizard.c.

126{
127 HRSRC GplTextResource;
128 HGLOBAL GplTextMem;
129 PVOID GplTextLocked;
130 PCHAR GplText;
131 DWORD Size;
132
133
134 switch (uMsg)
135 {
136 case WM_INITDIALOG:
137 GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
138 if (NULL == GplTextResource)
139 {
140 break;
141 }
142 Size = SizeofResource(hDllInstance, GplTextResource);
143 if (0 == Size)
144 {
145 break;
146 }
147 GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
148 if (NULL == GplText)
149 {
150 break;
151 }
152 GplTextMem = LoadResource(hDllInstance, GplTextResource);
153 if (NULL == GplTextMem)
154 {
155 HeapFree(GetProcessHeap(), 0, GplText);
156 break;
157 }
158 GplTextLocked = LockResource(GplTextMem);
159 if (NULL == GplTextLocked)
160 {
161 HeapFree(GetProcessHeap(), 0, GplText);
162 break;
163 }
164 memcpy(GplText, GplTextLocked, Size);
165 GplText[Size] = '\0';
166 SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
167 HeapFree(GetProcessHeap(), 0, GplText);
168 SetFocus(GetDlgItem(hwndDlg, IDOK));
169 return FALSE;
170
171 case WM_CLOSE:
172 EndDialog(hwndDlg, IDCANCEL);
173 break;
174
175 case WM_COMMAND:
176 if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
177 {
178 EndDialog(hwndDlg, IDOK);
179 }
180 break;
181
182 default:
183 break;
184 }
185
186 return FALSE;
187}
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define IDR_GPL
Definition: resource.h:181
#define IDC_GPL_TEXT
Definition: resource.h:93
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
#define WM_CLOSE
Definition: winuser.h:1649
#define IDCANCEL
Definition: winuser.h:842
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDOK
Definition: winuser.h:841
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by AckPageDlgProc().

◆ HasDaylightSavingTime()

static BOOL HasDaylightSavingTime ( PTIMEZONE_ENTRY  Entry)
static

Definition at line 1686 of file wizard.c.

1687{
1688 /* If StandardDate.wMonth and DaylightDate.wMonth are zero,
1689 * the timezone does not observe daylight saving time */
1690 return (Entry->TimezoneInfo.StandardDate.wMonth != 0 &&
1691 Entry->TimezoneInfo.DaylightDate.wMonth != 0);
1692}

Referenced by DateTimePageDlgProc(), and UpdateAutoDaylightCheckbox().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 3363 of file wizard.c.

3364{
3365 PROPSHEETHEADER psh = {0};
3366 HPROPSHEETPAGE *phpage = NULL;
3367 PROPSHEETPAGE psp = {0};
3368 UINT nPages = 0;
3369 HWND hWnd;
3370 MSG msg;
3371 PSETUPDATA pSetupData = NULL;
3372 HMODULE hNetShell = NULL;
3374 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3375
3376 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3377
3378 /* Allocate setup data */
3379 pSetupData = HeapAlloc(GetProcessHeap(),
3381 sizeof(SETUPDATA));
3382 if (pSetupData == NULL)
3383 {
3384 LogItem(NULL, L"SetupData allocation failed!");
3386 L"Setup failed to allocate global data!",
3387 L"ReactOS Setup",
3389 goto done;
3390 }
3392
3393 hNetShell = LoadLibraryW(L"netshell.dll");
3394 if (hNetShell != NULL)
3395 {
3396 DPRINT("Netshell.dll loaded!\n");
3397
3398 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3399 "NetSetupRequestWizardPages");
3400 if (pfn != NULL)
3401 {
3402 pfn(&dwNetworkPageCount, NULL, NULL);
3403 dwPageCount += dwNetworkPageCount;
3404 }
3405 }
3406
3407 DPRINT("PageCount: %lu\n", dwPageCount);
3408
3409 phpage = HeapAlloc(GetProcessHeap(),
3411 dwPageCount * sizeof(HPROPSHEETPAGE));
3412 if (phpage == NULL)
3413 {
3414 LogItem(NULL, L"Page array allocation failed!");
3416 L"Setup failed to allocate page array!",
3417 L"ReactOS Setup",
3419 goto done;
3420 }
3421
3422 /* Process the $winnt$.inf setup file */
3423 ProcessSetupInf(pSetupData);
3424
3425 /* Create the Welcome page */
3426 psp.dwSize = sizeof(PROPSHEETPAGE);
3427 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3428 psp.hInstance = hDllInstance;
3429 psp.lParam = (LPARAM)pSetupData;
3430 psp.pfnDlgProc = WelcomeDlgProc;
3431 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3432 phpage[nPages++] = CreatePropertySheetPage(&psp);
3433
3434 /* Create the Acknowledgements page */
3435 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3436 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3437 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3438 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3439 psp.pfnDlgProc = AckPageDlgProc;
3440 phpage[nPages++] = CreatePropertySheetPage(&psp);
3441
3442 /* Create the Product page */
3443 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3444 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
3445 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
3446 psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
3447 psp.pfnDlgProc = ProductPageDlgProc;
3448 phpage[nPages++] = CreatePropertySheetPage(&psp);
3449
3450 /* Create the Locale page */
3451 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3452 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3453 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3454 psp.pfnDlgProc = LocalePageDlgProc;
3455 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3456 phpage[nPages++] = CreatePropertySheetPage(&psp);
3457
3458 /* Create the Owner page */
3459 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3460 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3461 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3462 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3463 psp.pfnDlgProc = OwnerPageDlgProc;
3464 phpage[nPages++] = CreatePropertySheetPage(&psp);
3465
3466 /* Create the Computer page */
3467 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3468 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3469 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3470 psp.pfnDlgProc = ComputerPageDlgProc;
3471 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3472 phpage[nPages++] = CreatePropertySheetPage(&psp);
3473
3474 /* Create the DateTime page */
3475 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3476 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3477 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3478 psp.pfnDlgProc = DateTimePageDlgProc;
3479 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3480 phpage[nPages++] = CreatePropertySheetPage(&psp);
3481
3482 /* Create the theme selection page */
3483 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3484 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3485 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3486 psp.pfnDlgProc = ThemePageDlgProc;
3487 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3488 phpage[nPages++] = CreatePropertySheetPage(&psp);
3489
3492
3493 if (pfn)
3494 {
3495 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3496 nPages += dwNetworkPageCount;
3497 }
3498
3499 /* Create the Process page */
3500 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3501 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3502 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3503 psp.pfnDlgProc = ProcessPageDlgProc;
3504 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3505 phpage[nPages++] = CreatePropertySheetPage(&psp);
3506
3507 /* Create the Finish page */
3508 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3509 psp.pfnDlgProc = FinishDlgProc;
3510 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3511 phpage[nPages++] = CreatePropertySheetPage(&psp);
3512
3513 ASSERT(nPages == dwPageCount);
3514
3515 /* Create the property sheet */
3516 psh.dwSize = sizeof(PROPSHEETHEADER);
3517 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3518 psh.hInstance = hDllInstance;
3519 psh.hwndParent = NULL;
3520 psh.nPages = nPages;
3521 psh.nStartPage = 0;
3522 psh.phpage = phpage;
3523 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3524 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3525
3526 /* Create title font */
3527 pSetupData->hTitleFont = CreateTitleFont();
3528 pSetupData->hBoldFont = CreateBoldFont();
3529
3530 /* Display the wizard */
3531 hWnd = (HWND)PropertySheet(&psh);
3533
3534 while (GetMessage(&msg, NULL, 0, 0))
3535 {
3536 if (!IsDialogMessage(hWnd, &msg))
3537 {
3540 }
3541 }
3542
3543 DeleteObject(pSetupData->hBoldFont);
3544 DeleteObject(pSetupData->hTitleFont);
3545
3546 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3547 SetupCloseInfFile(pSetupData->hSetupInf);
3548
3549done:
3550 if (phpage != NULL)
3551 HeapFree(GetProcessHeap(), 0, phpage);
3552
3553 if (hNetShell != NULL)
3554 FreeLibrary(hNetShell);
3555
3556 if (pSetupData != NULL)
3557 HeapFree(GetProcessHeap(), 0, pSetupData);
3558
3559 LogItem(L"END_SECTION", L"InstallWizard");
3560}
#define msg(x)
Definition: auth_time.c:54
#define IDB_HEADER
Definition: resource.h:30
#define IDS_PROCESSSUBTITLE
Definition: resource.h:98
#define IDS_PROCESSTITLE
Definition: resource.h:97
#define IDB_WATERMARK
Definition: resource.h:4
#define IDD_PROCESSPAGE
Definition: resource.h:60
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define IDD_FINISHPAGE
Definition: resource.h:34
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
HANDLE HWND
Definition: compat.h:19
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:134
#define IDS_LOCALESUBTITLE
Definition: resource.h:124
#define IDD_ACKPAGE
Definition: resource.h:44
#define IDS_ACKTITLE
Definition: resource.h:114
#define IDS_PRODUCTTITLE
Definition: resource.h:173
#define IDD_OWNERPAGE
Definition: resource.h:48
#define IDS_OWNERSUBTITLE
Definition: resource.h:118
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:121
#define IDS_DATETIMESUBTITLE
Definition: resource.h:129
#define IDS_LOCALETITLE
Definition: resource.h:123
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:135
#define IDS_COMPUTERTITLE
Definition: resource.h:120
#define IDD_COMPUTERPAGE
Definition: resource.h:52
#define IDS_OWNERTITLE
Definition: resource.h:117
#define IDS_ACKSUBTITLE
Definition: resource.h:115
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:174
#define IDS_DATETIMETITLE
Definition: resource.h:128
pKey DeleteObject()
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1347
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:469
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1268
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_MODELESS
Definition: prsht.h:50
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PropertySheet
Definition: prsht.h:400
#define PROPSHEETPAGE
Definition: prsht.h:389
#define DPRINT
Definition: sndvol32.h:73
HFONT hBoldFont
Definition: reactos.h:140
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
HINF hSetupInf
Definition: syssetup.h:56
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1044
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1475
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:794
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1891
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:101
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3228
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3360
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2037
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:275
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2539
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:658
@ PRODUCT_OPTION_DEFAULT
Definition: syssetup.h:30
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IsDialogMessage
Definition: winuser.h:5975
#define GetMessage
Definition: winuser.h:5956
#define DispatchMessage
Definition: winuser.h:5931

Referenced by InstallReactOS().

◆ ItemCompletionThread()

static DWORD CALLBACK ItemCompletionThread ( LPVOID  Parameter)
static

Definition at line 2389 of file wizard.c.

2391{
2392 PITEMSDATA pItemsData;
2393 HWND hwndDlg;
2394
2395 pItemsData = (PITEMSDATA)Parameter;
2396 hwndDlg = pItemsData->hwndDlg;
2397
2398 /* Step 0 - Registering components */
2399 RegisterComponents(pItemsData);
2400
2401 /* Step 1 - Installing start menu items */
2402 InstallStartMenuItems(pItemsData);
2403
2404 /* Step 2 - Saving Settings */
2405 SaveSettings(pItemsData);
2406
2407 /* Step 3 - Removing temporary files */
2408// RemoveTempFiles(pItemsData);
2409
2410 // FIXME: Move this call to a separate cleanup page!
2412
2413 /* Free the items data */
2414 HeapFree(GetProcessHeap(), 0, pItemsData);
2415
2416 /* Tell the wizard page that we are done */
2417 PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2418
2419 return 0;
2420}
void SaveSettings(void)
Definition: settings.c:115
struct _ITEMSDATA * PITEMSDATA
#define PM_ITEMS_DONE
Definition: globals.h:64
VOID InstallStartMenuItems(_In_ PITEMSDATA pItemsData)
Definition: install.c:313
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
HWND hwndDlg
Definition: globals.h:31
static VOID RegisterComponents(PITEMSDATA pItemsData)
Definition: wizard.c:2315
#define PostMessage
Definition: winuser.h:5998
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336

Referenced by RunItemCompletionThread().

◆ LocalePageDlgProc()

static INT_PTR CALLBACK LocalePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1475 of file wizard.c.

1479{
1481
1482 /* Retrieve pointer to the global setup data */
1484
1485 switch (uMsg)
1486 {
1487 case WM_INITDIALOG:
1488 {
1489 /* Save pointer to the global setup data */
1493
1496 }
1497 break;
1498
1499 case WM_COMMAND:
1500 if (HIWORD(wParam) == BN_CLICKED)
1501 {
1502 switch (LOWORD(wParam))
1503 {
1504 case IDC_CUSTOMLOCALE:
1505 RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1507 break;
1508
1509 case IDC_CUSTOMLAYOUT:
1510 RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1512 break;
1513 }
1514 }
1515 break;
1516
1517 case WM_NOTIFY:
1518 {
1519 LPNMHDR lpnm = (LPNMHDR)lParam;
1520
1521 switch (lpnm->code)
1522 {
1523 case PSN_SETACTIVE:
1524 /* Enable the Back and Next buttons */
1527 {
1528 // if (!*SetupData->SourcePath)
1529 {
1530 RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1531 }
1532
1534 return TRUE;
1535 }
1536 break;
1537
1538 case PSN_WIZNEXT:
1539 break;
1540
1541 case PSN_WIZBACK:
1543 break;
1544
1545 default:
1546 break;
1547 }
1548 }
1549 break;
1550
1551 default:
1552 break;
1553 }
1554
1555 return FALSE;
1556}
#define IDC_LOCALETEXT
Definition: resource.h:58
#define IDC_LAYOUTTEXT
Definition: resource.h:60
#define IDC_CUSTOMLOCALE
Definition: resource.h:59
#define IDC_CUSTOMLAYOUT
Definition: resource.h:61
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1227
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1454
static VOID SetUserLocaleName(HWND hwnd)
Definition: wizard.c:1210

Referenced by InstallWizard().

◆ OnChooseOption()

static void OnChooseOption ( HWND  hwndDlg,
PRODUCT_OPTION  nOption 
)
static

Definition at line 635 of file wizard.c.

636{
637 WCHAR szText[256];
638 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
639
640 switch (nOption)
641 {
644 break;
645
648 break;
649
650 default:
651 return;
652 }
653
655}
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:112
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:178
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:177
@ PRODUCT_OPTION_SERVER
Definition: syssetup.h:28

Referenced by ProductPageDlgProc().

◆ OwnerPageDlgProc()

static INT_PTR CALLBACK OwnerPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 794 of file wizard.c.

798{
799 WCHAR OwnerName[51];
800 WCHAR OwnerOrganization[51];
801 WCHAR Title[64];
802 WCHAR ErrorName[256];
803 LPNMHDR lpnm;
804 PSETUPDATA pSetupData;
805
806 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
807
808 switch (uMsg)
809 {
810 case WM_INITDIALOG:
811 {
812 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
813 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
814
815 /* set a localized ('Owner') placeholder string as default */
816 if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
817 {
818 SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
819 }
820
823
824 /* Set focus to owner name */
826
827 /* Select the default text to quickly overwrite it by typing */
829 }
830 break;
831
832
833 case WM_NOTIFY:
834 {
835 lpnm = (LPNMHDR)lParam;
836
837 switch (lpnm->code)
838 {
839 case PSN_SETACTIVE:
840 /* Enable the Back and Next buttons */
842 if (pSetupData->UnattendSetup)
843 {
844 SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
846 if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
847 {
849 return TRUE;
850 }
851 }
852 break;
853
854 case PSN_WIZNEXT:
855 OwnerName[0] = 0;
856 if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
857 {
859 {
860 wcscpy(Title, L"ReactOS Setup");
861 }
862 if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
863 {
864 wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
865 }
866 MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
867
869 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
870
871 return TRUE;
872 }
873
874 OwnerOrganization[0] = 0;
875 GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
876
877 if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
878 {
880 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
881 return TRUE;
882 }
883
884 case PSN_WIZBACK:
885 pSetupData->UnattendSetup = FALSE;
886 break;
887
888 default:
889 break;
890 }
891 }
892 break;
893
894 default:
895 break;
896 }
897
898 return FALSE;
899}
#define IDC_OWNERORGANIZATION
Definition: resource.h:50
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:148
#define IDS_WZD_NAME
Definition: resource.h:150
#define IDC_OWNERNAME
Definition: resource.h:49
WCHAR OwnerName[51]
Definition: syssetup.h:42
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:752
#define EM_SETSEL
Definition: winuser.h:2047

Referenced by InstallWizard().

◆ PathIsEqual()

static BOOL PathIsEqual ( IN LPCWSTR  lpPath1,
IN LPCWSTR  lpPath2 
)
static

Definition at line 3111 of file wizard.c.

3114{
3115 WCHAR szPath1[MAX_PATH];
3116 WCHAR szPath2[MAX_PATH];
3117
3118 /* If something goes wrong, better return TRUE,
3119 * so the calling function returns early.
3120 */
3121 if (!PathCanonicalizeW(szPath1, lpPath1))
3122 return TRUE;
3123
3124 if (!PathAddBackslashW(szPath1))
3125 return TRUE;
3126
3127 if (!PathCanonicalizeW(szPath2, lpPath2))
3128 return TRUE;
3129
3130 if (!PathAddBackslashW(szPath2))
3131 return TRUE;
3132
3133 return (_wcsicmp(szPath1, szPath2) == 0);
3134}
#define PathCanonicalizeW
Definition: pathcch.h:314
#define PathAddBackslashW
Definition: pathcch.h:302

Referenced by AddInstallationSource().

◆ ProcessPageDlgProc()

static INT_PTR CALLBACK ProcessPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2539 of file wizard.c.

2543{
2545 PREGISTRATIONNOTIFY RegistrationNotify;
2546 static HICON s_hCheckIcon, s_hArrowIcon, s_hCrossIcon;
2547 static HFONT s_hNormalFont;
2548
2549 /* Retrieve pointer to the global setup data */
2551
2552 switch (uMsg)
2553 {
2554 case WM_INITDIALOG:
2555 /* Save pointer to the global setup data */
2560 s_hCheckIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CHECKICON), IMAGE_ICON, 16, 16, 0);
2561 s_hArrowIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_ARROWICON), IMAGE_ICON, 16, 16, 0);
2562 s_hCrossIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CROSSICON), IMAGE_ICON, 16, 16, 0);
2563 s_hNormalFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1, WM_GETFONT, 0, 0);
2564 break;
2565
2566 case WM_DESTROY:
2567 DestroyIcon(s_hCheckIcon);
2568 DestroyIcon(s_hArrowIcon);
2569 DestroyIcon(s_hCrossIcon);
2570 break;
2571
2572 case WM_NOTIFY:
2573 switch (((LPNMHDR)lParam)->code)
2574 {
2575 case PSN_SETACTIVE:
2576 LogItem(L"BEGIN", L"ProcessPage");
2577
2578 /* Disable the Back and Next buttons */
2580 RunItemCompletionThread(hwndDlg);
2581 break;
2582
2583 case PSN_WIZNEXT:
2584 LogItem(L"END", L"ProcessPage");
2585 break;
2586
2587 case PSN_WIZBACK:
2589 break;
2590
2591 default:
2592 break;
2593 }
2594 break;
2595
2596 case PM_ITEM_START:
2597 DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2602 break;
2603
2604 case PM_ITEM_END:
2605 DPRINT("PM_ITEM_END\n");
2606 SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1 + wParam, WM_SETFONT, (WPARAM)s_hNormalFont, (LPARAM)TRUE);
2607 if (lParam == ERROR_SUCCESS)
2608 {
2610 }
2611 else
2612 {
2614 ShowItemError(hwndDlg, (DWORD)lParam);
2615 }
2616 break;
2617
2618 case PM_STEP_START:
2619 DPRINT("PM_STEP_START\n");
2620 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2622 (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2623 break;
2624
2625 case PM_STEP_END:
2626 DPRINT("PM_STEP_END\n");
2627 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2628 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2629 if (RegistrationNotify->LastError != ERROR_SUCCESS)
2630 {
2631 ShowStepError(hwndDlg, RegistrationNotify);
2632 }
2633 break;
2634
2635 case PM_ITEMS_DONE:
2636 DPRINT("PM_ITEMS_DONE\n");
2637 /* Enable the Back and Next buttons */
2640 break;
2641
2642 default:
2643 break;
2644 }
2645
2646 return FALSE;
2647}
#define IDC_PROCESSPROGRESS
Definition: resource.h:63
#define IDC_ITEM
Definition: resource.h:62
#define IDC_CHECK1
Definition: resource.h:319
#define PM_STEP_START
Definition: globals.h:62
#define PM_ITEM_START
Definition: globals.h:52
#define PM_ITEM_END
Definition: globals.h:57
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define PM_STEP_END
Definition: globals.h:63
#define IDC_TASKTEXT4
Definition: resource.h:75
#define IDC_TASKTEXT1
Definition: resource.h:72
#define IDI_ARROWICON
Definition: resource.h:36
#define IDC_CHECK4
Definition: resource.h:83
#define IDI_CHECKICON
Definition: resource.h:35
#define IDI_CROSSICON
Definition: resource.h:37
static HICON
Definition: imagelist.c:80
#define PSBTN_NEXT
Definition: prsht.h:147
LPCWSTR CurrentItem
Definition: globals.h:38
static VOID ShowItemError(HWND hwndDlg, DWORD LastError)
Definition: wizard.c:2458
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2425
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2501
#define SW_HIDE
Definition: winuser.h:779
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define WM_GETFONT
Definition: winuser.h:1679
#define STM_SETIMAGE
Definition: winuser.h:2129
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by InstallWizard().

◆ ProcessSetupInf()

VOID ProcessSetupInf ( IN OUT PSETUPDATA  pSetupData)

Definition at line 3228 of file wizard.c.

3230{
3232 WCHAR szValue[MAX_PATH];
3233 INFCONTEXT InfContext;
3234 DWORD LineLength;
3235 HKEY hKey;
3236 LONG res;
3237
3238 pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3239
3240 /* Retrieve the path of the setup INF */
3242 wcscat(szPath, L"\\$winnt$.inf");
3243
3244 /* Open the setup INF */
3245 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3246 NULL,
3248 NULL);
3249 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3250 {
3251 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3252 return;
3253 }
3254
3255
3256 /* Retrieve the NT source path from which the 1st-stage installer was run */
3257 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3258 L"data",
3259 L"sourcepath",
3260 &InfContext))
3261 {
3262 DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3263 return;
3264 }
3265
3266 if (!SetupGetStringFieldW(&InfContext,
3267 1,
3268 szValue,
3269 ARRAYSIZE(szValue),
3270 &LineLength))
3271 {
3272 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3273 return;
3274 }
3275
3276 *pSetupData->SourcePath = UNICODE_NULL;
3277
3278 /* Close the setup INF as we are going to modify it manually */
3279 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3280 SetupCloseInfFile(pSetupData->hSetupInf);
3281
3282
3283 /* Find the installation source path in Win32 format */
3284 if (!GetInstallSourceWin32(pSetupData->SourcePath,
3285 _countof(pSetupData->SourcePath),
3286 szValue))
3287 {
3288 *pSetupData->SourcePath = UNICODE_NULL;
3289 }
3290
3291 /* Save the path in Win32 format in the setup INF */
3292 swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3293 WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3294
3295 /*
3296 * Save it also in the registry, in the following keys:
3297 * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3298 * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3299 * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3300 * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3301 */
3302#if 0
3304 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3305 0,
3307 &hKey);
3308
3309 if (res != ERROR_SUCCESS)
3310 {
3311 return FALSE;
3312 }
3313#endif
3314
3316 L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3317 0, NULL,
3319 KEY_ALL_ACCESS, // KEY_WRITE
3320 NULL,
3321 &hKey,
3322 NULL);
3323 if (res == ERROR_SUCCESS)
3324 {
3325 AddInstallationSource(hKey, pSetupData->SourcePath);
3326
3328 L"SourcePath",
3329 0,
3330 REG_SZ,
3331 (LPBYTE)pSetupData->SourcePath,
3332 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3333
3335 L"ServicePackSourcePath",
3336 0,
3337 REG_SZ,
3338 (LPBYTE)pSetupData->SourcePath,
3339 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3340
3342 }
3343
3344
3345 /* Now, re-open the setup INF (this must succeed) */
3346 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3347 NULL,
3349 NULL);
3350 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3351 {
3352 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3353 return;
3354 }
3355
3356 /* Process the unattended section of the setup file */
3357 ProcessUnattendSection(pSetupData);
3358}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2232
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define swprintf
Definition: precomp.h:40
#define INF_STYLE_OLDNT
Definition: infsupp.h:39
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2779
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:3137
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2836
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by InstallWizard().

◆ ProcessUnattendSection()

VOID ProcessUnattendSection ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2836 of file wizard.c.

2838{
2839 INFCONTEXT InfContext;
2840 WCHAR szName[256];
2841 WCHAR szValue[MAX_PATH];
2842 DWORD LineLength;
2843 HKEY hKey;
2844
2845 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2846 L"Unattend",
2847 L"UnattendSetupEnabled",
2848 &InfContext))
2849 {
2850 DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2851 return;
2852 }
2853
2854 if (!SetupGetStringFieldW(&InfContext,
2855 1,
2856 szValue,
2857 ARRAYSIZE(szValue),
2858 &LineLength))
2859 {
2860 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2861 return;
2862 }
2863
2864 if (_wcsicmp(szValue, L"yes") != 0)
2865 {
2866 DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2867 return;
2868 }
2869
2870 pSetupData->UnattendSetup = TRUE;
2871
2872 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2873 L"Unattend",
2874 NULL,
2875 &InfContext))
2876 {
2877 DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2878 return;
2879 }
2880
2881 do
2882 {
2883 if (!SetupGetStringFieldW(&InfContext,
2884 0,
2885 szName,
2887 &LineLength))
2888 {
2889 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2890 return;
2891 }
2892
2893 if (!SetupGetStringFieldW(&InfContext,
2894 1,
2895 szValue,
2896 ARRAYSIZE(szValue),
2897 &LineLength))
2898 {
2899 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2900 return;
2901 }
2902 DPRINT1("Name %S Value %S\n", szName, szValue);
2903 if (!_wcsicmp(szName, L"FullName"))
2904 {
2905 if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2906 {
2907 wcscpy(pSetupData->OwnerName, szValue);
2908 }
2909 }
2910 else if (!_wcsicmp(szName, L"OrgName"))
2911 {
2912 if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2913 {
2914 wcscpy(pSetupData->OwnerOrganization, szValue);
2915 }
2916 }
2917 else if (!_wcsicmp(szName, L"ComputerName"))
2918 {
2919 if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2920 {
2921 wcscpy(pSetupData->ComputerName, szValue);
2922 }
2923 }
2924 else if (!_wcsicmp(szName, L"AdminPassword"))
2925 {
2926 if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2927 {
2928 wcscpy(pSetupData->AdminPassword, szValue);
2929 }
2930 }
2931 else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2932 {
2933 pSetupData->TimeZoneIndex = _wtoi(szValue);
2934 }
2935 else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2936 {
2937 pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2938 }
2939 else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2940 {
2941 if (!_wcsicmp(szValue, L"yes"))
2942 pSetupData->DisableGeckoInst = TRUE;
2943 else
2944 pSetupData->DisableGeckoInst = FALSE;
2945 }
2946 else if (!_wcsicmp(szName, L"ProductOption"))
2947 {
2948 pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2949 }
2950 } while (SetupFindNextLine(&InfContext, &InfContext));
2951
2952 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2953 L"Display",
2954 NULL,
2955 &InfContext))
2956 {
2957 DEVMODEW dm = { { 0 } };
2958 dm.dmSize = sizeof(dm);
2960 {
2961 do
2962 {
2963 int iValue;
2964 if (!SetupGetStringFieldW(&InfContext,
2965 0,
2966 szName,
2968 &LineLength))
2969 {
2970 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2971 return;
2972 }
2973
2974 if (!SetupGetStringFieldW(&InfContext,
2975 1,
2976 szValue,
2977 ARRAYSIZE(szValue),
2978 &LineLength))
2979 {
2980 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2981 return;
2982 }
2983 iValue = _wtoi(szValue);
2984 DPRINT1("Name %S Value %i\n", szName, iValue);
2985
2986 if (!iValue)
2987 continue;
2988
2989 if (!_wcsicmp(szName, L"BitsPerPel"))
2990 {
2991 dm.dmFields |= DM_BITSPERPEL;
2992 dm.dmBitsPerPel = iValue;
2993 }
2994 else if (!_wcsicmp(szName, L"XResolution"))
2995 {
2996 dm.dmFields |= DM_PELSWIDTH;
2997 dm.dmPelsWidth = iValue;
2998 }
2999 else if (!_wcsicmp(szName, L"YResolution"))
3000 {
3001 dm.dmFields |= DM_PELSHEIGHT;
3002 dm.dmPelsHeight = iValue;
3003 }
3004 else if (!_wcsicmp(szName, L"VRefresh"))
3005 {
3007 dm.dmDisplayFrequency = iValue;
3008 }
3009 } while (SetupFindNextLine(&InfContext, &InfContext));
3010
3012 }
3013 }
3014
3016 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
3017 0,
3019 &hKey) != ERROR_SUCCESS)
3020 {
3021 DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
3022 return;
3023 }
3024
3025 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3026 L"GuiRunOnce",
3027 NULL,
3028 &InfContext))
3029 {
3030 int i = 0;
3031 do
3032 {
3033 if (SetupGetStringFieldW(&InfContext,
3034 0,
3035 szValue,
3036 ARRAYSIZE(szValue),
3037 NULL))
3038 {
3040 swprintf(szName, L"%d", i);
3041 DPRINT("szName %S szValue %S\n", szName, szValue);
3042
3044 {
3045 DPRINT("value %S\n", szPath);
3046 if (RegSetValueExW(hKey,
3047 szName,
3048 0,
3049 REG_SZ,
3050 (const BYTE*)szPath,
3051 (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
3052 {
3053 i++;
3054 }
3055 }
3056 }
3057 } while (SetupFindNextLine(&InfContext, &InfContext));
3058 }
3059
3061
3062 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3063 L"Env",
3064 NULL,
3065 &InfContext))
3066 {
3067 if (RegCreateKeyExW(
3068 HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
3070 {
3071 DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
3072 return;
3073 }
3074 do
3075 {
3076 if (!SetupGetStringFieldW(&InfContext,
3077 0,
3078 szName,
3080 &LineLength))
3081 {
3082 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3083 return;
3084 }
3085
3086 if (!SetupGetStringFieldW(&InfContext,
3087 1,
3088 szValue,
3089 ARRAYSIZE(szValue),
3090 &LineLength))
3091 {
3092 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3093 return;
3094 }
3095 DPRINT1("[ENV] %S=%S\n", szName, szValue);
3096
3097 DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
3098
3099 if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
3100 {
3101 DPRINT1(" - Error %d\n", GetLastError());
3102 }
3103
3104 } while (SetupFindNextLine(&InfContext, &InfContext));
3105
3107 }
3108}
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
Definition: wcs.c:2773
char TCHAR
Definition: tchar.h:1402
#define KEY_SET_VALUE
Definition: nt_native.h:1020
static const WCHAR szName[]
Definition: powrprof.c:45
DWORD dmBitsPerPel
Definition: wingdi.h:2093
DWORD dmFields
Definition: wingdi.h:2068
DWORD dmPelsWidth
Definition: wingdi.h:2094
DWORD dmPelsHeight
Definition: wingdi.h:2095
DWORD dmDisplayFrequency
Definition: wingdi.h:2100
WORD dmSize
Definition: wingdi.h:2066
enum _PRODUCT_OPTION PRODUCT_OPTION
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179

Referenced by ProcessSetupInf().

◆ ProductPageDlgProc()

static INT_PTR CALLBACK ProductPageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 658 of file wizard.c.

659{
660 LPNMHDR lpnm;
661 PSETUPDATA pSetupData;
662 INT iItem;
663 WCHAR szText[64], szDefault[64];
664 HICON hIcon;
665
666 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
667
668 switch (uMsg)
669 {
670 case WM_INITDIALOG:
671 {
672 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
673 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
674
675 LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
676
679 {
680 StringCchCatW(szText, _countof(szText), L" ");
681 StringCchCatW(szText, _countof(szText), szDefault);
682 }
684
687 {
688 StringCchCatW(szText, _countof(szText), L" ");
689 StringCchCatW(szText, _countof(szText), szDefault);
690 }
692
695
698 return TRUE;
699 }
700
701 case WM_COMMAND:
703 {
705 OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
706 }
707 break;
708
709 case WM_NOTIFY:
710 {
711 lpnm = (LPNMHDR)lParam;
712
713 switch (lpnm->code)
714 {
715 case PSN_SETACTIVE:
716 /* Enable the Back and Next buttons */
718 if (pSetupData->UnattendSetup)
719 {
720 OnChooseOption(hwndDlg, pSetupData->ProductOption);
723 return TRUE;
724 }
725 break;
726
727 case PSN_WIZNEXT:
729 pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
731 break;
732
733 case PSN_WIZBACK:
734 pSetupData->UnattendSetup = FALSE;
735 break;
736
737 default:
738 break;
739 }
740 }
741 break;
742
743 default:
744 break;
745 }
746
747 return FALSE;
748}
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:176
#define IDC_PRODUCT_ICON
Definition: resource.h:110
#define IDS_DEFAULT
Definition: resource.h:179
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:111
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:175
HICON hIcon
Definition: msconfig.c:44
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:523
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:635
#define STM_SETICON
Definition: winuser.h:2128
#define CB_SETCURSEL
Definition: winuser.h:1990
#define IDI_WINLOGO
Definition: winuser.h:717
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1965
#define LoadIcon
Definition: winuser.h:5979

Referenced by InstallWizard().

◆ RegisterComponents()

static VOID RegisterComponents ( PITEMSDATA  pItemsData)
static

Definition at line 2315 of file wizard.c.

2317{
2318 WCHAR SectionName[512];
2320 LONG Steps = 0;
2323
2324 ZeroMemory(&Notify, sizeof(Notify));
2325
2326 /* Count the 'RegisterDlls' steps */
2327 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2328 L"RegisterDlls", &Context))
2329 {
2330 DPRINT1("No RegistrationPhase2 section found\n");
2331 return;
2332 }
2333
2334 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2335 ARRAYSIZE(SectionName),
2336 NULL))
2337 {
2338 DPRINT1("Unable to retrieve section name\n");
2339 return;
2340 }
2341
2342 Steps += SetupGetLineCountW(hSysSetupInf, SectionName);
2343
2344 /* Count the 'TypeLibratries' steps */
2345 Steps += SetupGetLineCountW(hSysSetupInf, L"TypeLibraries");
2346
2347 /* Start the item */
2348 DPRINT("Register Components: %ld Steps\n", Steps);
2349 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 0, (LPARAM)Steps);
2350
2351 Error = RegisterDlls(pItemsData, &Notify);
2352 if (Error == ERROR_SUCCESS)
2353 RegisterTypeLibraries(pItemsData, &Notify, hSysSetupInf, L"TypeLibraries");
2354
2355 /* End the item */
2356 DPRINT("Register Components: done\n");
2357 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 0, Error);
2358}
#define NO_ERROR
Definition: dderror.h:5
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
static const WCHAR RegisterDlls[]
Definition: install.c:118
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1501
HINF hSysSetupInf
Definition: install.c:37
BOOL RegisterTypeLibraries(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:539
_In_ PVOID Context
Definition: storport.h:2269

Referenced by ItemCompletionThread().

◆ RegisterDlls()

static DWORD RegisterDlls ( _In_ PITEMSDATA  pItemsData,
_In_ PREGISTRATIONNOTIFY  pNotify 
)
static

Definition at line 2244 of file wizard.c.

2247{
2248 REGISTRATIONDATA RegistrationData;
2249 WCHAR SectionName[512];
2251 LONG DllCount = 0;
2253
2254 ZeroMemory(&RegistrationData, sizeof(REGISTRATIONDATA));
2255 RegistrationData.hwndDlg = pItemsData->hwndDlg;
2256 RegistrationData.Registered = 0;
2257
2258 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2259 L"RegisterDlls", &Context))
2260 {
2261 DPRINT1("No RegistrationPhase2 section found\n");
2262 return GetLastError();
2263 }
2264
2265 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2266 ARRAYSIZE(SectionName),
2267 NULL))
2268 {
2269 DPRINT1("Unable to retrieve section name\n");
2270 return GetLastError();
2271 }
2272
2273 DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2274 DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2275 if (DllCount < 0)
2276 {
2277 return STATUS_NOT_FOUND;
2278 }
2279
2280 RegistrationData.DllCount = (ULONG)DllCount;
2281 RegistrationData.DefaultContext = SetupInitDefaultQueueCallback(RegistrationData.hwndDlg);
2282 RegistrationData.pNotify = pNotify;
2283
2284 _SEH2_TRY
2285 {
2286 if (!SetupInstallFromInfSectionW(GetParent(RegistrationData.hwndDlg),
2288 L"RegistrationPhase2",
2289 SPINST_REGISTRY | SPINST_REGISTERCALLBACKAWARE | SPINST_REGSVR,
2290 0,
2291 NULL,
2292 0,
2294 &RegistrationData,
2295 NULL,
2296 NULL))
2297 {
2298 Error = GetLastError();
2299 }
2300 }
2302 {
2303 DPRINT("Catching exception\n");
2305 }
2306 _SEH2_END;
2307
2309
2310 return Error;
2311}
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1330
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1629
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define SPINST_REGSVR
Definition: setupapi.h:595
#define SPINST_REGISTRY
Definition: setupapi.h:591
#define STATUS_NOT_FOUND
Definition: shellext.h:72
PVOID DefaultContext
Definition: wizard.c:35
PREGISTRATIONNOTIFY pNotify
Definition: wizard.c:36
ULONG Registered
Definition: wizard.c:34
ULONG DllCount
Definition: wizard.c:33
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:2148
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ RegistrationNotificationProc()

static UINT CALLBACK RegistrationNotificationProc ( PVOID  Context,
UINT  Notification,
UINT_PTR  Param1,
UINT_PTR  Param2 
)
static

Definition at line 2148 of file wizard.c.

2152{
2153 PREGISTRATIONDATA RegistrationData;
2156
2157 RegistrationData = (PREGISTRATIONDATA)Context;
2158
2161 {
2162 StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
2163 RegistrationData->pNotify->CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
2164 if (RegistrationData->pNotify->CurrentItem == NULL)
2165 {
2166 RegistrationData->pNotify->CurrentItem = StatusInfo->FileName;
2167 }
2168 else
2169 {
2170 RegistrationData->pNotify->CurrentItem++;
2171 }
2172
2174 {
2175 DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
2176 StatusInfo->FileName);
2177 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2178
2179 DPRINT("RegisterDll: Start step %ld\n", RegistrationData->pNotify->Progress);
2180 SendMessage(RegistrationData->hwndDlg, PM_STEP_START, 0, (LPARAM)RegistrationData->pNotify);
2181 }
2182 else
2183 {
2184 DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
2185 StatusInfo->FileName);
2186 DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
2187 StatusInfo->FailureCode);
2188 if (StatusInfo->FailureCode != SPREG_SUCCESS)
2189 {
2190 switch (StatusInfo->FailureCode)
2191 {
2192 case SPREG_LOADLIBRARY:
2194 break;
2195 case SPREG_GETPROCADDR:
2197 break;
2198 case SPREG_REGSVR:
2200 break;
2201 case SPREG_DLLINSTALL:
2203 break;
2204 case SPREG_TIMEOUT:
2206 break;
2207 default:
2209 break;
2210 }
2211
2212 RegistrationData->pNotify->MessageID = MessageID;
2213 RegistrationData->pNotify->LastError = StatusInfo->Win32Error;
2214 }
2215 else
2216 {
2217 RegistrationData->pNotify->MessageID = 0;
2218 RegistrationData->pNotify->LastError = ERROR_SUCCESS;
2219 }
2220
2221 if (RegistrationData->Registered < RegistrationData->DllCount)
2222 {
2223 RegistrationData->Registered++;
2224 }
2225
2226 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2227 DPRINT("RegisterDll: End step %ld\n", RegistrationData->pNotify->Progress);
2228 SendMessage(RegistrationData->hwndDlg, PM_STEP_END, 0, (LPARAM)RegistrationData->pNotify);
2229 }
2230
2231 return FILEOP_DOIT;
2232 }
2233 else
2234 {
2235 DPRINT1("Received unexpected notification %u\n", Notification);
2236 return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2237 Notification, Param1, Param2);
2238 }
2239}
#define IDS_TIMEOUT
Definition: resource.h:14
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:144
#define IDS_REGSVR_FAILED
Definition: resource.h:143
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:141
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:142
#define IDS_REASON_UNKNOWN
Definition: resource.h:146
#define FILEOP_DOIT
Definition: fileqsup.h:48
#define SPREG_GETPROCADDR
Definition: setupapi.h:655
#define SPREG_REGSVR
Definition: setupapi.h:656
#define SetupDefaultQueueCallback
Definition: setupapi.h:2573
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:571
#define SPREG_SUCCESS
Definition: setupapi.h:653
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SPREG_TIMEOUT
Definition: setupapi.h:658
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:572
#define SPREG_DLLINSTALL
Definition: setupapi.h:657
#define SPREG_LOADLIBRARY
Definition: setupapi.h:654
struct _REGISTRATIONDATA * PREGISTRATIONDATA
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92

Referenced by RegisterDlls().

◆ RetrieveTimeZone()

static LONG RetrieveTimeZone ( IN HKEY  hZoneKey,
IN PVOID  Context 
)
static

Definition at line 1577 of file wizard.c.

1580{
1581 LONG lError;
1584 PTIMEZONE_ENTRY Current;
1585 ULONG DescriptionSize;
1586 ULONG StandardNameSize;
1587 ULONG DaylightNameSize;
1588
1590 if (Entry == NULL)
1591 {
1593 }
1594
1595 DescriptionSize = sizeof(Entry->Description);
1596 StandardNameSize = sizeof(Entry->StandardName);
1597 DaylightNameSize = sizeof(Entry->DaylightName);
1598
1599 lError = QueryTimeZoneData(hZoneKey,
1600 &Entry->Index,
1601 &Entry->TimezoneInfo,
1602 Entry->Description,
1603 &DescriptionSize,
1604 Entry->StandardName,
1605 &StandardNameSize,
1606 Entry->DaylightName,
1607 &DaylightNameSize);
1608 if (lError != ERROR_SUCCESS)
1609 {
1611 return lError;
1612 }
1613
1616 {
1617 Entry->Prev = NULL;
1618 Entry->Next = NULL;
1621 }
1622 else
1623 {
1624 Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1625 if (Current != NULL)
1626 {
1627 if (Current == SetupData->TimeZoneListHead)
1628 {
1629 /* Prepend to head */
1630 Entry->Prev = NULL;
1634 }
1635 else
1636 {
1637 /* Insert before current */
1638 Entry->Prev = Current->Prev;
1639 Entry->Next = Current;
1640 Current->Prev->Next = Entry;
1641 Current->Prev = Entry;
1642 }
1643 }
1644 else
1645 {
1646 /* Append to tail */
1648 Entry->Next = NULL;
1651 }
1652 }
1653
1654 return ERROR_SUCCESS;
1655}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1560
LONG QueryTimeZoneData(IN HKEY hZoneKey, OUT PULONG Index OPTIONAL, OUT PREG_TZI_FORMAT TimeZoneInfo, OUT PWCHAR Description OPTIONAL, IN OUT PULONG DescriptionSize OPTIONAL, OUT PWCHAR StandardName OPTIONAL, IN OUT PULONG StandardNameSize OPTIONAL, OUT PWCHAR DaylightName OPTIONAL, IN OUT PULONG DaylightNameSize OPTIONAL)
Definition: tzlib.c:141

Referenced by CreateTimeZoneList().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 1309 of file wizard.c.

1310{
1311 MSG msg;
1312 HWND MainWindow = GetParent(hwnd);
1313 STARTUPINFOW StartupInfo;
1314 PROCESS_INFORMATION ProcessInformation;
1315 WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1316
1317 if (!pwszCPLParameters)
1318 {
1319 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1320 return FALSE;
1321 }
1322
1323 ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1324 StartupInfo.cb = sizeof(StartupInfo);
1325 ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1326
1327 ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1328 wcscat(CmdLine, pwszCPLParameters);
1329
1330 if (!CreateProcessW(NULL,
1331 CmdLine,
1332 NULL,
1333 NULL,
1334 FALSE,
1335 0,
1336 NULL,
1337 NULL,
1338 &StartupInfo,
1339 &ProcessInformation))
1340 {
1341 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1342 return FALSE;
1343 }
1344
1345 /* Disable the Back and Next buttons and the main window
1346 * while we're interacting with the control panel applet */
1347 PropSheet_SetWizButtons(MainWindow, 0);
1348 EnableWindow(MainWindow, FALSE);
1349
1351 {
1352 /* We still need to process main window messages to avoid freeze */
1353 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1354 {
1357 }
1358 }
1359 CloseHandle(ProcessInformation.hThread);
1360 CloseHandle(ProcessInformation.hProcess);
1361
1362 /* Enable the Back and Next buttons and the main window again */
1364 EnableWindow(MainWindow, TRUE);
1365
1366 return TRUE;
1367}
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4442
static const WCHAR CmdLine[]
Definition: install.c:48
#define INFINITE
Definition: serial.h:102
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:893
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by EnableVisualTheme(), and LocalePageDlgProc().

◆ RunItemCompletionThread()

static BOOL RunItemCompletionThread ( _In_ HWND  hwndDlg)
static

Definition at line 2425 of file wizard.c.

2427{
2428 HANDLE hCompletionThread;
2429 PITEMSDATA pItemsData;
2430
2431 pItemsData = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEMSDATA));
2432 if (pItemsData == NULL)
2433 return FALSE;
2434
2435 pItemsData->hwndDlg = hwndDlg;
2436
2437 hCompletionThread = CreateThread(NULL,
2438 0,
2440 pItemsData,
2441 0,
2442 NULL);
2443 if (hCompletionThread == NULL)
2444 {
2445 HeapFree(GetProcessHeap(), 0, pItemsData);
2446 }
2447 else
2448 {
2449 CloseHandle(hCompletionThread);
2450 return TRUE;
2451 }
2452
2453 return FALSE;
2454}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static DWORD CALLBACK ItemCompletionThread(LPVOID Parameter)
Definition: wizard.c:2389

Referenced by ProcessPageDlgProc().

◆ SaveSettings()

static VOID SaveSettings ( PITEMSDATA  pItemsData)
static

Definition at line 2362 of file wizard.c.

2364{
2365 LONG Steps = 0;
2368
2369 ZeroMemory(&Notify, sizeof(Notify));
2370
2371 /* Count steps */
2372 Steps = CountSecuritySteps();
2373
2374 /* Start the item */
2375 DPRINT("Install security: %ld Steps\n", Steps);
2376 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 2, (LPARAM)Steps);
2377
2378 /* Install steps */
2379 Error = InstallSecurity(pItemsData, &Notify);
2380
2381 /* End the item */
2382 DPRINT("Install security: done\n");
2383 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 2, Error);
2384}
LONG CountSecuritySteps(VOID)
Definition: security.c:1607
DWORD InstallSecurity(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify)
Definition: security.c:1648

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2651 of file wizard.c.

2652{
2653 HKEY hKey = 0;
2654 DWORD InProgress = 0;
2655 DWORD InstallDate;
2656
2658 L"SYSTEM\\Setup",
2659 0,
2660 KEY_WRITE,
2661 &hKey ) == ERROR_SUCCESS)
2662 {
2663 RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2664 RegCloseKey( hKey );
2665 }
2666
2668 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2669 0,
2670 KEY_WRITE,
2671 &hKey ) == ERROR_SUCCESS)
2672 {
2673 InstallDate = (DWORD)time(NULL);
2674 RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2675 RegCloseKey( hKey );
2676 }
2677}
__u16 time
Definition: mkdosfs.c:8

Referenced by FinishDlgProc().

◆ SetKeyboardLayoutName()

static VOID SetKeyboardLayoutName ( HWND  hwnd)
static

Definition at line 1227 of file wizard.c.

1228{
1229 HKL hkl;
1230 BOOL LayoutSpecial = FALSE;
1231 WCHAR LayoutPath[256];
1232 WCHAR LocaleName[32];
1233 WCHAR SpecialId[5] = L"";
1234 WCHAR ResText[256] = L"";
1235 DWORD dwValueSize;
1236 HKEY hKey;
1237 UINT i;
1238
1239 /* Get the default input language and method */
1240 if (!SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, 0, (LPDWORD)&hkl, 0))
1241 {
1243 }
1244
1245 if ((HIWORD(hkl) & 0xF000) == 0xF000)
1246 {
1247 /* Process keyboard layout with special id */
1248 StringCchPrintfW(SpecialId, ARRAYSIZE(SpecialId), L"%04x", (HIWORD(hkl) & 0x0FFF));
1249 LayoutSpecial = TRUE;
1250 }
1251
1252#define MAX_LAYOUTS_PER_LANGID 0x10000
1253 for (i = 0; i < (LayoutSpecial ? MAX_LAYOUTS_PER_LANGID : 1); i++)
1254 {
1255 /* Generate a hexadecimal identifier for keyboard layout registry key */
1257
1258 StringCchCopyW(LayoutPath, ARRAYSIZE(LayoutPath), L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\");
1259 StringCchCatW(LayoutPath, ARRAYSIZE(LayoutPath), LocaleName);
1261
1263 LayoutPath,
1264 0,
1266 &hKey) == ERROR_SUCCESS)
1267 {
1268 /* Make sure the keyboard layout key we opened is the one we need.
1269 * If the layout has no special id, just pass this check. */
1270 dwValueSize = sizeof(LocaleName);
1271 if (!LayoutSpecial ||
1273 L"Layout Id",
1274 NULL,
1275 NULL,
1276 (PVOID)&LocaleName,
1277 &dwValueSize) == ERROR_SUCCESS) &&
1278 (wcscmp(LocaleName, SpecialId) == 0)))
1279 {
1281 dwValueSize = sizeof(LocaleName);
1283 L"Layout Text",
1284 NULL,
1285 NULL,
1286 (PVOID)&LocaleName,
1287 &dwValueSize);
1288 /* Let the loop know where to stop */
1290 }
1292 }
1293 else
1294 {
1295 /* Keyboard layout registry keys are expected to go in order without gaps */
1296 break;
1297 }
1298 }
1299#undef MAX_LAYOUTS_PER_LANGID
1300
1301 LoadStringW(hDllInstance, IDS_LAYOUTTEXT, ResText, ARRAYSIZE(ResText));
1302 StringCchPrintfW(LayoutPath, ARRAYSIZE(LayoutPath), ResText, LocaleName);
1303
1304 SetWindowTextW(hwnd, LayoutPath);
1305}
static _In_ LPCWSTR LocaleName
#define IDS_LAYOUTTEXT
Definition: resource.h:126
unsigned int BOOL
Definition: ntddk_ex.h:94
HKL hkl
Definition: msctf.idl:632
UINT_PTR HKL
Definition: msctf.idl:125
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
#define MAX_LAYOUTS_PER_LANGID
uint32_t * LPDWORD
Definition: typedefs.h:59
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by LocalePageDlgProc().

◆ SetLocalTimeZone()

static VOID SetLocalTimeZone ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1763 of file wizard.c.

1764{
1765 TIME_ZONE_INFORMATION TimeZoneInformation;
1767 DWORD dwIndex;
1768 DWORD i;
1769
1770 dwIndex = SendMessage(hwnd,
1772 0,
1773 0);
1774
1775 i = 0;
1777 while (i < dwIndex)
1778 {
1779 if (Entry == NULL)
1780 return;
1781
1782 i++;
1783 Entry = Entry->Next;
1784 }
1785
1786 wcscpy(TimeZoneInformation.StandardName,
1787 Entry->StandardName);
1788 wcscpy(TimeZoneInformation.DaylightName,
1789 Entry->DaylightName);
1790
1791 TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1792 TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1793 TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1794
1795 memcpy(&TimeZoneInformation.StandardDate,
1796 &Entry->TimezoneInfo.StandardDate,
1797 sizeof(SYSTEMTIME));
1798 memcpy(&TimeZoneInformation.DaylightDate,
1799 &Entry->TimezoneInfo.DaylightDate,
1800 sizeof(SYSTEMTIME));
1801
1802 /* Set time zone information */
1803 SetTimeZoneInformation(&TimeZoneInformation);
1804}
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
SYSTEMTIME DaylightDate
Definition: winbase.h:936
WCHAR DaylightName[32]
Definition: winbase.h:935
WCHAR StandardName[32]
Definition: winbase.h:932
SYSTEMTIME StandardDate
Definition: winbase.h:933

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1837 of file wizard.c.

1838{
1839 BOOL Ret = FALSE;
1840
1841 /*
1842 * Call SetLocalTime twice to ensure correct results
1843 */
1846
1847 return Ret;
1848}
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356

Referenced by WriteDateTimeSettings().

◆ SetUserLocaleName()

static VOID SetUserLocaleName ( HWND  hwnd)
static

Definition at line 1210 of file wizard.c.

1211{
1212 WCHAR CurLocale[256] = L"";
1213 WCHAR CurGeo[256] = L"";
1214 WCHAR ResText[256] = L"";
1215 WCHAR LocaleText[256 * 2];
1216
1219
1220 LoadStringW(hDllInstance, IDS_LOCALETEXT, ResText, ARRAYSIZE(ResText));
1221 StringCchPrintfW(LocaleText, ARRAYSIZE(LocaleText), ResText, CurLocale, CurGeo);
1222
1223 SetWindowTextW(hwnd, LocaleText);
1224}
GEOID WINAPI GetUserGeoID(GEOCLASS GeoClass)
Definition: locale.c:4747
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang)
Definition: locale.c:5401
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
#define IDS_LOCALETEXT
Definition: resource.h:125
@ GEO_FRIENDLYNAME
Definition: winnls.h:634
#define LOCALE_SLANGUAGE
Definition: winnls.h:31
@ GEOCLASS_NATION
Definition: winnls.h:621

Referenced by LocalePageDlgProc().

◆ ShowItemError()

static VOID ShowItemError ( HWND  hwndDlg,
DWORD  LastError 
)
static

Definition at line 2458 of file wizard.c.

2461{
2463 WCHAR UnknownError[84];
2464 WCHAR Title[64];
2465
2467 NULL, LastError, 0, ErrorMessage, 0, NULL) == 0)
2468 {
2470 UnknownError,
2471 ARRAYSIZE(UnknownError) - 20) == 0)
2472 {
2473 wcscpy(UnknownError, L"Unknown error");
2474 }
2475 wcscat(UnknownError, L" ");
2476 _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2477 ErrorMessage = UnknownError;
2478 }
2479
2480 if (ErrorMessage != NULL)
2481 {
2483 Title, ARRAYSIZE(Title)) == 0)
2484 {
2485 wcscpy(Title, L"ReactOS Setup");
2486 }
2487
2489 }
2490
2491 if (ErrorMessage != NULL &&
2492 ErrorMessage != UnknownError)
2493 {
2495 }
2496}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
Definition: attrib.c:32
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
_ACRTIMP wchar_t *__cdecl _ultow(__msvcrt_ulong, wchar_t *, int)
Definition: string.c:2199
#define IDS_UNKNOWN_ERROR
Definition: resource.h:140
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396

Referenced by ProcessPageDlgProc().

◆ ShowStepError()

static VOID ShowStepError ( HWND  hwndDlg,
PREGISTRATIONNOTIFY  RegistrationNotify 
)
static

Definition at line 2501 of file wizard.c.

2504{
2505 WCHAR ErrorMessage[128];
2506 WCHAR Title[64];
2507
2508 if (LoadStringW(hDllInstance, RegistrationNotify->MessageID,
2510 ARRAYSIZE(ErrorMessage)) == 0)
2511 {
2512 ErrorMessage[0] = L'\0';
2513 }
2514
2515 if (RegistrationNotify->MessageID != IDS_TIMEOUT)
2516 {
2518 RegistrationNotify->LastError, 0,
2521 NULL);
2522 }
2523
2524 if (ErrorMessage[0] != L'\0')
2525 {
2527 Title, ARRAYSIZE(Title)) == 0)
2528 {
2529 wcscpy(Title, L"ReactOS Setup");
2530 }
2531
2532 MessageBoxW(hwndDlg, ErrorMessage,
2534 }
2535}

Referenced by ProcessPageDlgProc().

◆ ShowTimeZoneList()

static VOID ShowTimeZoneList ( HWND  hwnd,
PSETUPDATA  SetupData,
DWORD  dwEntryIndex 
)
static

Definition at line 1733 of file wizard.c.

1734{
1736 DWORD dwIndex = 0;
1737 DWORD dwCount;
1738
1739 GetTimeZoneListIndex(&dwEntryIndex);
1740
1742 while (Entry != NULL)
1743 {
1744 dwCount = SendMessage(hwnd,
1746 0,
1747 (LPARAM)Entry->Description);
1748
1749 if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1750 dwIndex = dwCount;
1751
1752 Entry = Entry->Next;
1753 }
1754
1757 (WPARAM)dwIndex,
1758 0);
1759}

Referenced by DateTimePageDlgProc().

◆ ThemePageDlgProc()

static INT_PTR CALLBACK ThemePageDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2037 of file wizard.c.

2041{
2043 LPNMLISTVIEW pnmv;
2044
2045 /* Retrieve pointer to the global setup data */
2047
2048 switch (uMsg)
2049 {
2050 case WM_INITDIALOG:
2051 {
2052 HWND hListView;
2054 DWORD n;
2055 LVITEM lvi = {0};
2056
2057 /* Save pointer to the global setup data */
2060
2061 hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
2062
2063 /* Common */
2065 lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
2066
2067 for (n = 0; n < ARRAYSIZE(Themes); ++n)
2068 {
2069 WCHAR DisplayName[100] = {0};
2070 /* Load the bitmap */
2072 ImageList_AddMasked(himl, image, RGB(255,0,255));
2073
2074 /* Load the string */
2075 LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
2076 DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
2077
2078 /* Add the listview item */
2079 lvi.iItem = n;
2080 lvi.iImage = n;
2081 lvi.pszText = DisplayName;
2082 ListView_InsertItem(hListView, &lvi);
2083 }
2084
2085 /* Register the imagelist */
2087 /* Transparent background */
2088 ListView_SetBkColor(hListView, CLR_NONE);
2090 /* Reduce the size between the items */
2091 ListView_SetIconSpacing(hListView, 190, 173);
2092 break;
2093 }
2094
2095 case WM_NOTIFY:
2096 switch (((LPNMHDR)lParam)->code)
2097 {
2098 //case LVN_ITEMCHANGING:
2099 case LVN_ITEMCHANGED:
2100 pnmv = (LPNMLISTVIEW)lParam;
2101 if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
2102 {
2103 int iTheme = pnmv->iItem;
2104 DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
2105
2106 if (Themes[iTheme].ThemeFile)
2107 {
2108 WCHAR wszTheme[MAX_PATH];
2109 SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
2110 EnableVisualTheme(hwndDlg, wszTheme);
2111 }
2112 else
2113 {
2114 EnableVisualTheme(hwndDlg, Themes[iTheme].ThemeFile);
2115 }
2116 }
2117 break;
2118 case PSN_SETACTIVE:
2119 /* Enable the Back and Next buttons */
2122 {
2124 return TRUE;
2125 }
2126 break;
2127
2128 case PSN_WIZNEXT:
2129 break;
2130
2131 case PSN_WIZBACK:
2133 break;
2134
2135 default:
2136 break;
2137 }
2138 break;
2139
2140 default:
2141 break;
2142 }
2143
2144 return FALSE;
2145}
HIMAGELIST himl
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:573
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2781
#define IDC_THEMEPICKER
Definition: resource.h:90
#define RGB(r, g, b)
Definition: precomp.h:67
GLdouble n
Definition: glext.h:7729
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2413
#define ListView_SetIconSpacing(hwndLV, cx, cy)
Definition: commctrl.h:2728
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define CLR_NONE
Definition: commctrl.h:319
#define ListView_SetBkColor(hwnd, clrBk)
Definition: commctrl.h:2299
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVITEM
Definition: commctrl.h:2380
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVIF_TEXT
Definition: commctrl.h:2314
#define ILC_MASK
Definition: commctrl.h:351
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define ListView_SetTextBkColor(hwnd, clrTextBk)
Definition: commctrl.h:2668
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define LVSIL_NORMAL
Definition: commctrl.h:2303
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2158
#define CSIDL_RESOURCES
Definition: shlobj.h:2233
UINT uNewState
Definition: commctrl.h:3041
VOID EnableVisualTheme(_In_opt_ HWND hwndParent, _In_opt_ PCWSTR ThemeFile)
Definition: wizard.c:1371
static struct ThemeInfo Themes[]
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109

Referenced by InstallWizard().

◆ UpdateAutoDaylightCheckbox()

static VOID UpdateAutoDaylightCheckbox ( HWND  hwndDlg,
PTIMEZONE_ENTRY  Entry 
)
static

Definition at line 1720 of file wizard.c.

1721{
1722 BOOL bHasDST = (Entry != NULL && HasDaylightSavingTime(Entry));
1723
1724 /* Enable or disable the checkbox based on DST support */
1725 EnableWindow(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT), bHasDST);
1726
1727 /* Check the checkbox only if DST is supported, otherwise uncheck it */
1729 (WPARAM)(bHasDST ? BST_CHECKED : BST_UNCHECKED), 0);
1730}

Referenced by DateTimePageDlgProc().

◆ UpdateLocalSystemTime()

static VOID UpdateLocalSystemTime ( HWND  hwnd,
SYSTEMTIME  LocalTime 
)
static

Definition at line 1852 of file wizard.c.

1853{
1856}
#define DateTime_SetSystemtime(hdp, gd, pst)
Definition: commctrl.h:4337

Referenced by DateTimePageDlgProc().

◆ WelcomeDlgProc()

static INT_PTR CALLBACK WelcomeDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 191 of file wizard.c.

195{
196 PSETUPDATA pSetupData;
197
198 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
199
200 switch (uMsg)
201 {
202 case WM_INITDIALOG:
203 {
204 HWND hwndControl;
205 DWORD dwStyle;
206
207 /* Get pointer to the global setup data */
208 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
209 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
210
211 hwndControl = GetParent(hwndDlg);
212
213 /* Center the wizard window */
214 CenterWindow (hwndControl);
215
216 /* Hide the system menu */
217 dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
218 SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
219
220 /* Hide and disable the 'Cancel' button */
221 hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
222 ShowWindow (hwndControl, SW_HIDE);
223 EnableWindow (hwndControl, FALSE);
224
225 /* Set title font */
226 SendDlgItemMessage(hwndDlg,
229 (WPARAM)pSetupData->hTitleFont,
230 (LPARAM)TRUE);
231 }
232 break;
233
234
235 case WM_NOTIFY:
236 {
237 LPNMHDR lpnm = (LPNMHDR)lParam;
238
239 switch (lpnm->code)
240 {
241 case PSN_SETACTIVE:
242 LogItem(L"BEGIN", L"WelcomePage");
243 /* Enable the Next button */
245 if (pSetupData->UnattendSetup)
246 {
248 return TRUE;
249 }
250 break;
251
252 case PSN_WIZNEXT:
253 LogItem(L"END", L"WelcomePage");
254 break;
255
256 case PSN_WIZBACK:
257 pSetupData->UnattendSetup = FALSE;
258 break;
259
260 default:
261 break;
262 }
263 }
264 break;
265
266 default:
267 break;
268 }
269
270 return FALSE;
271}
#define IDC_WELCOMETITLE
Definition: resource.h:16
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define WS_SYSMENU
Definition: pedump.c:629
#define GWL_STYLE
Definition: winuser.h:863

◆ WriteComputerSettings()

static BOOL WriteComputerSettings ( WCHAR ComputerName,
HWND  hwndDlg 
)
static

Definition at line 903 of file wizard.c.

904{
905 WCHAR Title[64];
906 WCHAR ErrorComputerName[256];
907 LONG lError;
908 HKEY hKey = NULL;
909
910 if (!SetComputerNameW(ComputerName))
911 {
912 if (hwndDlg != NULL)
913 {
915 {
916 wcscpy(Title, L"ReactOS Setup");
917 }
918 if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName,
919 ARRAYSIZE(ErrorComputerName)))
920 {
921 wcscpy(ErrorComputerName, L"Setup failed to set the computer name.");
922 }
923 MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
924 }
925
926 return FALSE;
927 }
928
929 /* Set the physical DNS domain */
930 SetComputerNameExW(ComputerNamePhysicalDnsDomain, L"");
931
932 /* Set the physical DNS hostname */
933 SetComputerNameExW(ComputerNamePhysicalDnsHostname, ComputerName);
934
935 /* Set the accounts domain name */
936 SetAccountsDomainSid(NULL, ComputerName);
937
938 /* Now we need to set the Hostname */
940 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
941 0,
942 NULL,
944 KEY_WRITE,
945 NULL,
946 &hKey,
947 NULL);
948 if (lError == ERROR_SUCCESS)
949 {
950 lError = RegSetValueEx(hKey,
951 L"Hostname",
952 0,
953 REG_SZ,
954 (LPBYTE)ComputerName,
955 (wcslen(ComputerName) + 1) * sizeof(WCHAR));
956 if (lError != ERROR_SUCCESS)
957 {
958 DPRINT1("RegSetValueEx(\"Hostname\") failed (%08lX)\n", lError);
959 }
960
962 }
963 else
964 {
965 DPRINT1("RegCreateKeyExW for Tcpip\\Parameters failed (%08lX)\n", lError);
966 }
967
968 return TRUE;
969}
BOOL WINAPI SetComputerNameW(LPCWSTR lpComputerName)
Definition: compname.c:616
BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer)
Definition: compname.c:648
#define IDS_WZD_SETCOMPUTERNAME
Definition: resource.h:151
NTSTATUS WINAPI SetAccountsDomainSid(PSID DomainSid, LPCWSTR DomainName)
Definition: security.c:28
#define RegSetValueEx
Definition: winreg.h:565

Referenced by ComputerPageDlgProc().

◆ WriteDateTimeSettings()

static BOOL WriteDateTimeSettings ( HWND  hwndDlg,
PSETUPDATA  SetupData 
)
static

Definition at line 1860 of file wizard.c.

1861{
1862 WCHAR Title[64];
1863 WCHAR ErrorLocalTime[256];
1864
1865 GetLocalSystemTime(hwndDlg, SetupData);
1867 SetupData);
1868
1870 BM_GETCHECK, 0, 0) != BST_UNCHECKED);
1871 if (!SetSystemLocalTime(hwndDlg, SetupData))
1872 {
1874 {
1875 wcscpy(Title, L"ReactOS Setup");
1876 }
1877 if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
1878 ARRAYSIZE(ErrorLocalTime)))
1879 {
1880 wcscpy(ErrorLocalTime, L"Setup was unable to set the local time.");
1881 }
1882 MessageBoxW(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
1883 return FALSE;
1884 }
1885
1886 return TRUE;
1887}
#define IDS_WZD_LOCALTIME
Definition: resource.h:156
static BOOL SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1837
static BOOL GetLocalSystemTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1808
static VOID SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1763
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
#define MB_ICONWARNING
Definition: winuser.h:797
#define BM_GETCHECK
Definition: winuser.h:1947

Referenced by DateTimePageDlgProc().

◆ WriteDefaultLogonData()

static BOOL WriteDefaultLogonData ( LPWSTR  Domain)
static

Definition at line 974 of file wizard.c.

975{
976 WCHAR szAdministratorName[256];
977 HKEY hKey = NULL;
978 LONG lError;
979
982 szAdministratorName,
983 ARRAYSIZE(szAdministratorName)) == 0)
984 {
985 wcscpy(szAdministratorName, L"Administrator");
986 }
987
989 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
990 0,
992 &hKey);
993 if (lError != ERROR_SUCCESS)
994 return FALSE;
995
996 lError = RegSetValueEx(hKey,
997 L"DefaultDomainName",
998 0,
999 REG_SZ,
1000 (LPBYTE)Domain,
1001 (wcslen(Domain)+ 1) * sizeof(WCHAR));
1002 if (lError != ERROR_SUCCESS)
1003 {
1004 DPRINT1("RegSetValueEx(\"DefaultDomainName\") failed!\n");
1005 }
1006
1007 lError = RegSetValueEx(hKey,
1008 L"DefaultUserName",
1009 0,
1010 REG_SZ,
1011 (LPBYTE)szAdministratorName,
1012 (wcslen(szAdministratorName)+ 1) * sizeof(WCHAR));
1013 if (lError != ERROR_SUCCESS)
1014 {
1015 DPRINT1("RegSetValueEx(\"DefaultUserName\") failed!\n");
1016 }
1017
1019
1020 return TRUE;
1021}
#define IDS_ADMINISTRATOR_NAME
Definition: resource.h:147
_In_ ULONG Domain
Definition: haltypes.h:1814

Referenced by ComputerPageDlgProc().

◆ WriteOwnerSettings()

static BOOL WriteOwnerSettings ( WCHAR OwnerName,
WCHAR OwnerOrganization 
)
static

Definition at line 752 of file wizard.c.

754{
755 HKEY hKey;
756 LONG res;
757
759 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
760 0,
762 &hKey);
763
764 if (res != ERROR_SUCCESS)
765 {
766 return FALSE;
767 }
768
770 L"RegisteredOwner",
771 0,
772 REG_SZ,
773 (LPBYTE)OwnerName,
774 (wcslen(OwnerName) + 1) * sizeof(WCHAR));
775
776 if (res != ERROR_SUCCESS)
777 {
779 return FALSE;
780 }
781
783 L"RegisteredOrganization",
784 0,
785 REG_SZ,
786 (LPBYTE)OwnerOrganization,
787 (wcslen(OwnerOrganization) + 1) * sizeof(WCHAR));
788
790 return (res == ERROR_SUCCESS);
791}

Referenced by OwnerPageDlgProc().

◆ WriteUserLocale()

static VOID WriteUserLocale ( VOID  )
static

Definition at line 1454 of file wizard.c.

1455{
1456 HKEY hKey;
1457 LCID lcid;
1458 WCHAR Locale[9] = L"0000";
1459
1461
1462 if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0)
1463 {
1464 if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
1467 {
1468 RegSetValueExW(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (wcslen(Locale) + 1) * sizeof(WCHAR));
1470 }
1471 }
1472}
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1235
LCID lcid
Definition: locale.c:5656
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
DWORD LCID
Definition: nls.h:13
#define LOCALE_ILANGUAGE
Definition: winnls.h:30

Referenced by LocalePageDlgProc().

Variable Documentation

◆ s_DefaultSoundEvents

const WCHAR* s_DefaultSoundEvents[][2]
static
Initial value:
=
{
{ L".Default", L"%SystemRoot%\\Media\\ReactOS_Default.wav" },
{ L"AppGPFault", L"" },
{ L"Close", L"" },
{ L"CriticalBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Critical.wav" },
{ L"DeviceConnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Insert.wav" },
{ L"DeviceDisconnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Remove.wav" },
{ L"DeviceFail", L"%SystemRoot%\\Media\\ReactOS_Hardware_Fail.wav" },
{ L"LowBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Low.wav" },
{ L"MailBeep", L"%SystemRoot%\\Media\\ReactOS_Notify.wav" },
{ L"Maximize", L"%SystemRoot%\\Media\\ReactOS_Restore.wav" },
{ L"MenuCommand", L"%SystemRoot%\\Media\\ReactOS_Menu_Command.wav" },
{ L"MenuPopup", L"" },
{ L"Minimize", L"%SystemRoot%\\Media\\ReactOS_Minimize.wav" },
{ L"Open", L"" },
{ L"PrintComplete", L"%SystemRoot%\\Media\\ReactOS_Print_Complete.wav" },
{ L"RestoreDown", L"" },
{ L"RestoreUp", L"" },
{ L"SystemAsterisk", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
{ L"SystemExclamation", L"%SystemRoot%\\Media\\ReactOS_Exclamation.wav" },
{ L"SystemExit", L"%SystemRoot%\\Media\\ReactOS_Shutdown.wav" },
{ L"SystemHand", L"%SystemRoot%\\Media\\ReactOS_Critical_Stop.wav" },
{ L"SystemNotification", L"%SystemRoot%\\Media\\ReactOS_Balloon.wav" },
{ L"SystemQuestion", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
{ L"SystemStart", L"%SystemRoot%\\Media\\ReactOS_Startup.wav" },
{ L"WindowsLogoff", L"%SystemRoot%\\Media\\ReactOS_LogOff.wav" }
}

Definition at line 403 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_ExplorerSoundEvents

const WCHAR* s_ExplorerSoundEvents[][2]
static
Initial value:
=
{
{ L"EmptyRecycleBin", L"%SystemRoot%\\Media\\ReactOS_Recycle.wav" },
{ L"Navigating", L"%SystemRoot%\\Media\\ReactOS_Start.wav" }
}

Definition at line 433 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_ProductOptionData

const PRODUCT_OPTION_DATA s_ProductOptionData[]
static
Initial value:
=
{
{ L"Terminal Server\0", L"ServerNT", 0, 0x200, 0 },
{ L"\0", L"WinNT", 1, 0x300, 1 }
}

Definition at line 397 of file wizard.c.

Referenced by DoWriteProductOption(), and OnChooseOption().

◆ s_szControlWindows

const WCHAR s_szControlWindows[] = L"SYSTEM\\CurrentControlSet\\Control\\Windows"
static

Definition at line 383 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szDefaultSoundEvents

const WCHAR s_szDefaultSoundEvents[] = L"AppEvents\\Schemes\\Apps\\.Default"
static

Definition at line 385 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szExplorerSoundEvents

const WCHAR s_szExplorerSoundEvents[] = L"AppEvents\\Schemes\\Apps\\Explorer"
static

Definition at line 386 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szProductOptions

const WCHAR s_szProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
static

Definition at line 381 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szRosVersion

const WCHAR s_szRosVersion[] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"
static

Definition at line 382 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szWinlogon

const WCHAR s_szWinlogon[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"
static

Definition at line 384 of file wizard.c.

Referenced by DoWriteProductOption().

◆ Themes

struct ThemeInfo Themes[]
static
Initial value:
= {
{ MAKEINTRESOURCE(IDB_LAUTUS), IDS_LAUTUS, L"themes\\lautus\\lautus.msstyles" },
{ MAKEINTRESOURCE(IDB_LUNAR), IDS_LUNAR, L"themes\\lunar\\lunar.msstyles" },
{ MAKEINTRESOURCE(IDB_MIZU), IDS_MIZU, L"themes\\mizu\\mizu.msstyles"},
}
#define IDS_LAUTUS
Definition: resource.h:169
#define IDB_LUNAR
Definition: resource.h:25
#define IDB_MIZU
Definition: resource.h:26
#define IDS_CLASSIC
Definition: resource.h:168
#define IDS_LUNAR
Definition: resource.h:170
#define IDS_MIZU
Definition: resource.h:171
#define IDB_LAUTUS
Definition: resource.h:24
#define IDB_CLASSIC
Definition: resource.h:23

Referenced by ThemePageDlgProc().