ReactOS 0.4.16-dev-2522-g97cc325
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 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 3333 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
#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
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InstallWizard().

◆ AddInstallationSource()

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

Definition at line 3110 of file wizard.c.

3113{
3114 LONG res;
3115 DWORD dwRegType;
3116 DWORD dwPathLength = 0;
3117 DWORD dwNewLength = 0;
3118 LPWSTR Buffer = NULL;
3119 LPWSTR Path;
3120
3122 hKey,
3123 L"Installation Sources",
3124 NULL,
3125 &dwRegType,
3126 NULL,
3127 &dwPathLength);
3128
3129 if (res != ERROR_SUCCESS ||
3130 dwRegType != REG_MULTI_SZ ||
3131 dwPathLength == 0 ||
3132 dwPathLength % sizeof(WCHAR) != 0)
3133 {
3134 dwPathLength = 0;
3135 goto set;
3136 }
3137
3138 /* Reserve space for existing data + new string */
3139 dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
3140 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3141 if (!Buffer)
3142 return;
3143
3144 ZeroMemory(Buffer, dwNewLength);
3145
3147 hKey,
3148 L"Installation Sources",
3149 NULL,
3150 NULL,
3151 (LPBYTE)Buffer,
3152 &dwPathLength);
3153
3154 if (res != ERROR_SUCCESS)
3155 {
3157 dwPathLength = 0;
3158 goto set;
3159 }
3160
3161 /* Sanity check, these should already be zeros */
3162 Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
3163 Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3164
3165 for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
3166 {
3167 /* Check if path is already added */
3168 if (PathIsEqual(Path, lpPath))
3169 goto cleanup;
3170 }
3171
3172 Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
3173
3174set:
3175 if (dwPathLength == 0)
3176 {
3177 dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
3178 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3179 if (!Buffer)
3180 return;
3181
3182 Path = Buffer;
3183 }
3184
3185 StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
3186 Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3187
3189 hKey,
3190 L"Installation Sources",
3191 0,
3193 (LPBYTE)Buffer,
3194 dwNewLength);
3195
3196cleanup:
3198}
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:3084
unsigned char * LPBYTE
Definition: typedefs.h:53
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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:1609
#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
base of all file and directory entries
Definition: entries.h:83
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
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
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 2653 of file wizard.c.

2657{
2658
2659 switch (uMsg)
2660 {
2661 case WM_INITDIALOG:
2662 {
2663 /* Get pointer to the global setup data */
2665
2667 {
2668 /* Run the Wine Gecko prompt */
2669 Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl,,install_gecko", SW_SHOW);
2670 }
2671
2672 /* Set title font */
2673 SendDlgItemMessage(hwndDlg,
2675 WM_SETFONT,
2677 (LPARAM)TRUE);
2679 {
2680 KillTimer(hwndDlg, 1);
2682 PostQuitMessage(0);
2683 }
2684 }
2685 break;
2686
2687 case WM_DESTROY:
2688 {
2690 PostQuitMessage(0);
2691 return TRUE;
2692 }
2693
2694 case WM_TIMER:
2695 {
2696 INT Position;
2697 HWND hWndProgress;
2698
2699 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2700 Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2701 if (Position == 300)
2702 {
2703 KillTimer(hwndDlg, 1);
2705 }
2706 else
2707 {
2708 SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2709 }
2710 }
2711 return TRUE;
2712
2713 case WM_NOTIFY:
2714 {
2715 LPNMHDR lpnm = (LPNMHDR)lParam;
2716
2717 switch (lpnm->code)
2718 {
2719 case PSN_SETACTIVE:
2720 /* Enable the correct buttons on for the active page */
2722
2724 MAKELPARAM(0, 300));
2726 SetTimer(hwndDlg, 1, 50, NULL);
2727 break;
2728
2729 case PSN_WIZFINISH:
2730 DestroyWindow(GetParent(hwndDlg));
2731 break;
2732
2733 default:
2734 break;
2735 }
2736 }
2737 break;
2738
2739 default:
2740 break;
2741 }
2742
2743 return FALSE;
2744}
#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:2624
#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 2752 of file wizard.c.

2756{
2757 WCHAR wszDrives[512];
2758 WCHAR wszNTPath[512]; // MAX_PATH ?
2759 DWORD cchDrives;
2760 PWCHAR pwszDrive;
2761
2762 *pwszPath = UNICODE_NULL;
2763
2764 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2765 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2766 {
2767 /* Buffer too small or failure */
2768 LogItem(NULL, L"GetLogicalDriveStringsW failed");
2769 return FALSE;
2770 }
2771
2772 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2773 {
2774 WCHAR wszBuf[MAX_PATH];
2775
2776 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2777 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2778 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2779 pwszDrive[2] = L'\\'; // Restore the backslash
2780
2781 wcscat(wszNTPath, L"\\"); // Concat a backslash
2782
2783 /* Logging */
2784 wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2785 pwszDrive, wszNTPath,
2786 (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2787 LogItem(NULL, wszBuf);
2788
2789 /* Check whether the NT path corresponds to the NT installation source path */
2790 if (!_wcsicmp(wszNTPath, pwszNTPath))
2791 {
2792 /* Found it! */
2793 wcscpy(pwszPath, pwszDrive); // cchPathMax
2794
2795 /* Logging */
2796 wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2797 LogItem(NULL, wszBuf);
2798 wcscat(wszBuf, L"\n");
2799 OutputDebugStringW(wszBuf);
2800
2801 return TRUE;
2802 }
2803 }
2804
2805 return FALSE;
2806}
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 3336 of file wizard.c.

3337{
3338 PROPSHEETHEADER psh = {0};
3339 HPROPSHEETPAGE *phpage = NULL;
3340 PROPSHEETPAGE psp = {0};
3341 UINT nPages = 0;
3342 HWND hWnd;
3343 MSG msg;
3344 PSETUPDATA pSetupData = NULL;
3345 HMODULE hNetShell = NULL;
3347 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3348
3349 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3350
3351 /* Allocate setup data */
3352 pSetupData = HeapAlloc(GetProcessHeap(),
3354 sizeof(SETUPDATA));
3355 if (pSetupData == NULL)
3356 {
3357 LogItem(NULL, L"SetupData allocation failed!");
3359 L"Setup failed to allocate global data!",
3360 L"ReactOS Setup",
3362 goto done;
3363 }
3365
3366 hNetShell = LoadLibraryW(L"netshell.dll");
3367 if (hNetShell != NULL)
3368 {
3369 DPRINT("Netshell.dll loaded!\n");
3370
3371 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3372 "NetSetupRequestWizardPages");
3373 if (pfn != NULL)
3374 {
3375 pfn(&dwNetworkPageCount, NULL, NULL);
3376 dwPageCount += dwNetworkPageCount;
3377 }
3378 }
3379
3380 DPRINT("PageCount: %lu\n", dwPageCount);
3381
3382 phpage = HeapAlloc(GetProcessHeap(),
3384 dwPageCount * sizeof(HPROPSHEETPAGE));
3385 if (phpage == NULL)
3386 {
3387 LogItem(NULL, L"Page array allocation failed!");
3389 L"Setup failed to allocate page array!",
3390 L"ReactOS Setup",
3392 goto done;
3393 }
3394
3395 /* Process the $winnt$.inf setup file */
3396 ProcessSetupInf(pSetupData);
3397
3398 /* Create the Welcome page */
3399 psp.dwSize = sizeof(PROPSHEETPAGE);
3400 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3401 psp.hInstance = hDllInstance;
3402 psp.lParam = (LPARAM)pSetupData;
3403 psp.pfnDlgProc = WelcomeDlgProc;
3404 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3405 phpage[nPages++] = CreatePropertySheetPage(&psp);
3406
3407 /* Create the Acknowledgements page */
3408 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3409 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3410 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3411 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3412 psp.pfnDlgProc = AckPageDlgProc;
3413 phpage[nPages++] = CreatePropertySheetPage(&psp);
3414
3415 /* Create the Product page */
3416 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3417 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
3418 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
3419 psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
3420 psp.pfnDlgProc = ProductPageDlgProc;
3421 phpage[nPages++] = CreatePropertySheetPage(&psp);
3422
3423 /* Create the Locale page */
3424 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3425 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3426 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3427 psp.pfnDlgProc = LocalePageDlgProc;
3428 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3429 phpage[nPages++] = CreatePropertySheetPage(&psp);
3430
3431 /* Create the Owner page */
3432 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3433 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3434 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3435 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3436 psp.pfnDlgProc = OwnerPageDlgProc;
3437 phpage[nPages++] = CreatePropertySheetPage(&psp);
3438
3439 /* Create the Computer page */
3440 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3441 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3442 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3443 psp.pfnDlgProc = ComputerPageDlgProc;
3444 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3445 phpage[nPages++] = CreatePropertySheetPage(&psp);
3446
3447 /* Create the DateTime page */
3448 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3449 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3450 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3451 psp.pfnDlgProc = DateTimePageDlgProc;
3452 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3453 phpage[nPages++] = CreatePropertySheetPage(&psp);
3454
3455 /* Create the theme selection page */
3456 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3457 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3458 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3459 psp.pfnDlgProc = ThemePageDlgProc;
3460 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3461 phpage[nPages++] = CreatePropertySheetPage(&psp);
3462
3465
3466 if (pfn)
3467 {
3468 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3469 nPages += dwNetworkPageCount;
3470 }
3471
3472 /* Create the Process page */
3473 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3474 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3475 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3476 psp.pfnDlgProc = ProcessPageDlgProc;
3477 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3478 phpage[nPages++] = CreatePropertySheetPage(&psp);
3479
3480 /* Create the Finish page */
3481 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3482 psp.pfnDlgProc = FinishDlgProc;
3483 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3484 phpage[nPages++] = CreatePropertySheetPage(&psp);
3485
3486 ASSERT(nPages == dwPageCount);
3487
3488 /* Create the property sheet */
3489 psh.dwSize = sizeof(PROPSHEETHEADER);
3490 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3491 psh.hInstance = hDllInstance;
3492 psh.hwndParent = NULL;
3493 psh.nPages = nPages;
3494 psh.nStartPage = 0;
3495 psh.phpage = phpage;
3496 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3497 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3498
3499 /* Create title font */
3500 pSetupData->hTitleFont = CreateTitleFont();
3501 pSetupData->hBoldFont = CreateBoldFont();
3502
3503 /* Display the wizard */
3504 hWnd = (HWND)PropertySheet(&psh);
3506
3507 while (GetMessage(&msg, NULL, 0, 0))
3508 {
3509 if (!IsDialogMessage(hWnd, &msg))
3510 {
3513 }
3514 }
3515
3516 DeleteObject(pSetupData->hBoldFont);
3517 DeleteObject(pSetupData->hTitleFont);
3518
3519 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3520 SetupCloseInfFile(pSetupData->hSetupInf);
3521
3522done:
3523 if (phpage != NULL)
3524 HeapFree(GetProcessHeap(), 0, phpage);
3525
3526 if (hNetShell != NULL)
3527 FreeLibrary(hNetShell);
3528
3529 if (pSetupData != NULL)
3530 HeapFree(GetProcessHeap(), 0, pSetupData);
3531
3532 LogItem(L"END_SECTION", L"InstallWizard");
3533}
#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:3201
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3333
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:2510
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 2364 of file wizard.c.

2366{
2367 PITEMSDATA pItemsData;
2368 HWND hwndDlg;
2369
2370 pItemsData = (PITEMSDATA)Parameter;
2371 hwndDlg = pItemsData->hwndDlg;
2372
2373 /* Step 0 - Registering components */
2374 RegisterComponents(pItemsData);
2375
2376 /* Step 1 - Installing start menu items */
2377 InstallStartMenuItems(pItemsData);
2378
2379 /* FIXME: Add completion steps here! */
2380
2381 // FIXME: Move this call to a separate cleanup page!
2383
2384 /* Free the items data */
2385 HeapFree(GetProcessHeap(), 0, pItemsData);
2386
2387 /* Tell the wizard page that we are done */
2388 PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2389
2390 return 0;
2391}
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 3084 of file wizard.c.

3087{
3088 WCHAR szPath1[MAX_PATH];
3089 WCHAR szPath2[MAX_PATH];
3090
3091 /* If something goes wrong, better return TRUE,
3092 * so the calling function returns early.
3093 */
3094 if (!PathCanonicalizeW(szPath1, lpPath1))
3095 return TRUE;
3096
3097 if (!PathAddBackslashW(szPath1))
3098 return TRUE;
3099
3100 if (!PathCanonicalizeW(szPath2, lpPath2))
3101 return TRUE;
3102
3103 if (!PathAddBackslashW(szPath2))
3104 return TRUE;
3105
3106 return (_wcsicmp(szPath1, szPath2) == 0);
3107}
#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 2510 of file wizard.c.

2514{
2516 PREGISTRATIONNOTIFY RegistrationNotify;
2517 static HICON s_hCheckIcon, s_hArrowIcon, s_hCrossIcon;
2518 static HFONT s_hNormalFont;
2519
2520 /* Retrieve pointer to the global setup data */
2522
2523 switch (uMsg)
2524 {
2525 case WM_INITDIALOG:
2526 /* Save pointer to the global setup data */
2533 s_hCheckIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CHECKICON), IMAGE_ICON, 16, 16, 0);
2534 s_hArrowIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_ARROWICON), IMAGE_ICON, 16, 16, 0);
2535 s_hCrossIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CROSSICON), IMAGE_ICON, 16, 16, 0);
2536 s_hNormalFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1, WM_GETFONT, 0, 0);
2537 break;
2538
2539 case WM_DESTROY:
2540 DestroyIcon(s_hCheckIcon);
2541 DestroyIcon(s_hArrowIcon);
2542 DestroyIcon(s_hCrossIcon);
2543 break;
2544
2545 case WM_NOTIFY:
2546 switch (((LPNMHDR)lParam)->code)
2547 {
2548 case PSN_SETACTIVE:
2549 LogItem(L"BEGIN", L"ProcessPage");
2550
2551 /* Disable the Back and Next buttons */
2553 RunItemCompletionThread(hwndDlg);
2554 break;
2555
2556 case PSN_WIZNEXT:
2557 LogItem(L"END", L"ProcessPage");
2558 break;
2559
2560 case PSN_WIZBACK:
2562 break;
2563
2564 default:
2565 break;
2566 }
2567 break;
2568
2569 case PM_ITEM_START:
2570 DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2575 break;
2576
2577 case PM_ITEM_END:
2578 DPRINT("PM_ITEM_END\n");
2579 SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1 + wParam, WM_SETFONT, (WPARAM)s_hNormalFont, (LPARAM)TRUE);
2580 if (lParam == ERROR_SUCCESS)
2581 {
2583 }
2584 else
2585 {
2587 ShowItemError(hwndDlg, (DWORD)lParam);
2588 }
2589 break;
2590
2591 case PM_STEP_START:
2592 DPRINT("PM_STEP_START\n");
2593 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2595 (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2596 break;
2597
2598 case PM_STEP_END:
2599 DPRINT("PM_STEP_END\n");
2600 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2601 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2602 if (RegistrationNotify->LastError != ERROR_SUCCESS)
2603 {
2604 ShowStepError(hwndDlg, RegistrationNotify);
2605 }
2606 break;
2607
2608 case PM_ITEMS_DONE:
2609 DPRINT("PM_ITEMS_DONE\n");
2610 /* Enable the Back and Next buttons */
2613 break;
2614
2615 default:
2616 break;
2617 }
2618
2619 return FALSE;
2620}
#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 IDC_CHECK3
Definition: resource.h:82
#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
#define IDC_TASKTEXT3
Definition: resource.h:74
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:2429
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2396
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2472
#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 3201 of file wizard.c.

3203{
3205 WCHAR szValue[MAX_PATH];
3206 INFCONTEXT InfContext;
3207 DWORD LineLength;
3208 HKEY hKey;
3209 LONG res;
3210
3211 pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3212
3213 /* Retrieve the path of the setup INF */
3215 wcscat(szPath, L"\\$winnt$.inf");
3216
3217 /* Open the setup INF */
3218 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3219 NULL,
3221 NULL);
3222 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3223 {
3224 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3225 return;
3226 }
3227
3228
3229 /* Retrieve the NT source path from which the 1st-stage installer was run */
3230 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3231 L"data",
3232 L"sourcepath",
3233 &InfContext))
3234 {
3235 DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3236 return;
3237 }
3238
3239 if (!SetupGetStringFieldW(&InfContext,
3240 1,
3241 szValue,
3242 ARRAYSIZE(szValue),
3243 &LineLength))
3244 {
3245 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3246 return;
3247 }
3248
3249 *pSetupData->SourcePath = UNICODE_NULL;
3250
3251 /* Close the setup INF as we are going to modify it manually */
3252 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3253 SetupCloseInfFile(pSetupData->hSetupInf);
3254
3255
3256 /* Find the installation source path in Win32 format */
3257 if (!GetInstallSourceWin32(pSetupData->SourcePath,
3258 _countof(pSetupData->SourcePath),
3259 szValue))
3260 {
3261 *pSetupData->SourcePath = UNICODE_NULL;
3262 }
3263
3264 /* Save the path in Win32 format in the setup INF */
3265 swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3266 WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3267
3268 /*
3269 * Save it also in the registry, in the following keys:
3270 * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3271 * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3272 * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3273 * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3274 */
3275#if 0
3277 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3278 0,
3280 &hKey);
3281
3282 if (res != ERROR_SUCCESS)
3283 {
3284 return FALSE;
3285 }
3286#endif
3287
3289 L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3290 0, NULL,
3292 KEY_ALL_ACCESS, // KEY_WRITE
3293 NULL,
3294 &hKey,
3295 NULL);
3296 if (res == ERROR_SUCCESS)
3297 {
3298 AddInstallationSource(hKey, pSetupData->SourcePath);
3299
3301 L"SourcePath",
3302 0,
3303 REG_SZ,
3304 (LPBYTE)pSetupData->SourcePath,
3305 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3306
3308 L"ServicePackSourcePath",
3309 0,
3310 REG_SZ,
3311 (LPBYTE)pSetupData->SourcePath,
3312 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3313
3315 }
3316
3317
3318 /* Now, re-open the setup INF (this must succeed) */
3319 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3320 NULL,
3322 NULL);
3323 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3324 {
3325 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3326 return;
3327 }
3328
3329 /* Process the unattended section of the setup file */
3330 ProcessUnattendSection(pSetupData);
3331}
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:2752
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:3110
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2809
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 2809 of file wizard.c.

2811{
2812 INFCONTEXT InfContext;
2813 WCHAR szName[256];
2814 WCHAR szValue[MAX_PATH];
2815 DWORD LineLength;
2816 HKEY hKey;
2817
2818 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2819 L"Unattend",
2820 L"UnattendSetupEnabled",
2821 &InfContext))
2822 {
2823 DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2824 return;
2825 }
2826
2827 if (!SetupGetStringFieldW(&InfContext,
2828 1,
2829 szValue,
2830 ARRAYSIZE(szValue),
2831 &LineLength))
2832 {
2833 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2834 return;
2835 }
2836
2837 if (_wcsicmp(szValue, L"yes") != 0)
2838 {
2839 DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2840 return;
2841 }
2842
2843 pSetupData->UnattendSetup = TRUE;
2844
2845 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2846 L"Unattend",
2847 NULL,
2848 &InfContext))
2849 {
2850 DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2851 return;
2852 }
2853
2854 do
2855 {
2856 if (!SetupGetStringFieldW(&InfContext,
2857 0,
2858 szName,
2860 &LineLength))
2861 {
2862 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2863 return;
2864 }
2865
2866 if (!SetupGetStringFieldW(&InfContext,
2867 1,
2868 szValue,
2869 ARRAYSIZE(szValue),
2870 &LineLength))
2871 {
2872 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2873 return;
2874 }
2875 DPRINT1("Name %S Value %S\n", szName, szValue);
2876 if (!_wcsicmp(szName, L"FullName"))
2877 {
2878 if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2879 {
2880 wcscpy(pSetupData->OwnerName, szValue);
2881 }
2882 }
2883 else if (!_wcsicmp(szName, L"OrgName"))
2884 {
2885 if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2886 {
2887 wcscpy(pSetupData->OwnerOrganization, szValue);
2888 }
2889 }
2890 else if (!_wcsicmp(szName, L"ComputerName"))
2891 {
2892 if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2893 {
2894 wcscpy(pSetupData->ComputerName, szValue);
2895 }
2896 }
2897 else if (!_wcsicmp(szName, L"AdminPassword"))
2898 {
2899 if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2900 {
2901 wcscpy(pSetupData->AdminPassword, szValue);
2902 }
2903 }
2904 else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2905 {
2906 pSetupData->TimeZoneIndex = _wtoi(szValue);
2907 }
2908 else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2909 {
2910 pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2911 }
2912 else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2913 {
2914 if (!_wcsicmp(szValue, L"yes"))
2915 pSetupData->DisableGeckoInst = TRUE;
2916 else
2917 pSetupData->DisableGeckoInst = FALSE;
2918 }
2919 else if (!_wcsicmp(szName, L"ProductOption"))
2920 {
2921 pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2922 }
2923 } while (SetupFindNextLine(&InfContext, &InfContext));
2924
2925 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2926 L"Display",
2927 NULL,
2928 &InfContext))
2929 {
2930 DEVMODEW dm = { { 0 } };
2931 dm.dmSize = sizeof(dm);
2933 {
2934 do
2935 {
2936 int iValue;
2937 if (!SetupGetStringFieldW(&InfContext,
2938 0,
2939 szName,
2941 &LineLength))
2942 {
2943 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2944 return;
2945 }
2946
2947 if (!SetupGetStringFieldW(&InfContext,
2948 1,
2949 szValue,
2950 ARRAYSIZE(szValue),
2951 &LineLength))
2952 {
2953 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2954 return;
2955 }
2956 iValue = _wtoi(szValue);
2957 DPRINT1("Name %S Value %i\n", szName, iValue);
2958
2959 if (!iValue)
2960 continue;
2961
2962 if (!_wcsicmp(szName, L"BitsPerPel"))
2963 {
2964 dm.dmFields |= DM_BITSPERPEL;
2965 dm.dmBitsPerPel = iValue;
2966 }
2967 else if (!_wcsicmp(szName, L"XResolution"))
2968 {
2969 dm.dmFields |= DM_PELSWIDTH;
2970 dm.dmPelsWidth = iValue;
2971 }
2972 else if (!_wcsicmp(szName, L"YResolution"))
2973 {
2974 dm.dmFields |= DM_PELSHEIGHT;
2975 dm.dmPelsHeight = iValue;
2976 }
2977 else if (!_wcsicmp(szName, L"VRefresh"))
2978 {
2980 dm.dmDisplayFrequency = iValue;
2981 }
2982 } while (SetupFindNextLine(&InfContext, &InfContext));
2983
2985 }
2986 }
2987
2989 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2990 0,
2992 &hKey) != ERROR_SUCCESS)
2993 {
2994 DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2995 return;
2996 }
2997
2998 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2999 L"GuiRunOnce",
3000 NULL,
3001 &InfContext))
3002 {
3003 int i = 0;
3004 do
3005 {
3006 if (SetupGetStringFieldW(&InfContext,
3007 0,
3008 szValue,
3009 ARRAYSIZE(szValue),
3010 NULL))
3011 {
3013 swprintf(szName, L"%d", i);
3014 DPRINT("szName %S szValue %S\n", szName, szValue);
3015
3017 {
3018 DPRINT("value %S\n", szPath);
3019 if (RegSetValueExW(hKey,
3020 szName,
3021 0,
3022 REG_SZ,
3023 (const BYTE*)szPath,
3024 (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
3025 {
3026 i++;
3027 }
3028 }
3029 }
3030 } while (SetupFindNextLine(&InfContext, &InfContext));
3031 }
3032
3034
3035 if (SetupFindFirstLineW(pSetupData->hSetupInf,
3036 L"Env",
3037 NULL,
3038 &InfContext))
3039 {
3040 if (RegCreateKeyExW(
3041 HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
3043 {
3044 DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
3045 return;
3046 }
3047 do
3048 {
3049 if (!SetupGetStringFieldW(&InfContext,
3050 0,
3051 szName,
3053 &LineLength))
3054 {
3055 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3056 return;
3057 }
3058
3059 if (!SetupGetStringFieldW(&InfContext,
3060 1,
3061 szValue,
3062 ARRAYSIZE(szValue),
3063 &LineLength))
3064 {
3065 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3066 return;
3067 }
3068 DPRINT1("[ENV] %S=%S\n", szName, szValue);
3069
3070 DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
3071
3072 if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
3073 {
3074 DPRINT1(" - Error %d\n", GetLastError());
3075 }
3076
3077 } while (SetupFindNextLine(&InfContext, &InfContext));
3078
3080 }
3081}
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
Definition: wcs.c:2773
#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
char TCHAR
Definition: xmlstorage.h:189

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 2396 of file wizard.c.

2398{
2399 HANDLE hCompletionThread;
2400 PITEMSDATA pItemsData;
2401
2402 pItemsData = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEMSDATA));
2403 if (pItemsData == NULL)
2404 return FALSE;
2405
2406 pItemsData->hwndDlg = hwndDlg;
2407
2408 hCompletionThread = CreateThread(NULL,
2409 0,
2411 pItemsData,
2412 0,
2413 NULL);
2414 if (hCompletionThread == NULL)
2415 {
2416 HeapFree(GetProcessHeap(), 0, pItemsData);
2417 }
2418 else
2419 {
2420 CloseHandle(hCompletionThread);
2421 return TRUE;
2422 }
2423
2424 return FALSE;
2425}
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:2364

Referenced by ProcessPageDlgProc().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2624 of file wizard.c.

2625{
2626 HKEY hKey = 0;
2627 DWORD InProgress = 0;
2628 DWORD InstallDate;
2629
2631 L"SYSTEM\\Setup",
2632 0,
2633 KEY_WRITE,
2634 &hKey ) == ERROR_SUCCESS)
2635 {
2636 RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2637 RegCloseKey( hKey );
2638 }
2639
2641 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2642 0,
2643 KEY_WRITE,
2644 &hKey ) == ERROR_SUCCESS)
2645 {
2646 InstallDate = (DWORD)time(NULL);
2647 RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2648 RegCloseKey( hKey );
2649 }
2650}
__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 2429 of file wizard.c.

2432{
2434 WCHAR UnknownError[84];
2435 WCHAR Title[64];
2436
2438 NULL, LastError, 0, ErrorMessage, 0, NULL) == 0)
2439 {
2441 UnknownError,
2442 ARRAYSIZE(UnknownError) - 20) == 0)
2443 {
2444 wcscpy(UnknownError, L"Unknown error");
2445 }
2446 wcscat(UnknownError, L" ");
2447 _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2448 ErrorMessage = UnknownError;
2449 }
2450
2451 if (ErrorMessage != NULL)
2452 {
2454 Title, ARRAYSIZE(Title)) == 0)
2455 {
2456 wcscpy(Title, L"ReactOS Setup");
2457 }
2458
2460 }
2461
2462 if (ErrorMessage != NULL &&
2463 ErrorMessage != UnknownError)
2464 {
2466 }
2467}
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 2472 of file wizard.c.

2475{
2476 WCHAR ErrorMessage[128];
2477 WCHAR Title[64];
2478
2479 if (LoadStringW(hDllInstance, RegistrationNotify->MessageID,
2481 ARRAYSIZE(ErrorMessage)) == 0)
2482 {
2483 ErrorMessage[0] = L'\0';
2484 }
2485
2486 if (RegistrationNotify->MessageID != IDS_TIMEOUT)
2487 {
2489 RegistrationNotify->LastError, 0,
2492 NULL);
2493 }
2494
2495 if (ErrorMessage[0] != L'\0')
2496 {
2498 Title, ARRAYSIZE(Title)) == 0)
2499 {
2500 wcscpy(Title, L"ReactOS Setup");
2501 }
2502
2503 MessageBoxW(hwndDlg, ErrorMessage,
2505 }
2506}

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().