ReactOS 0.4.16-dev-823-g9a093ec
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)
 
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 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 3161 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 276 of file wizard.c.

280{
281 LPNMHDR lpnm;
282 PWCHAR Projects;
283 PWCHAR End, CurrentProject;
284 INT ProjectsSize, ProjectsCount;
285 PSETUPDATA pSetupData;
286
287 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
288
289 switch (uMsg)
290 {
291 case WM_INITDIALOG:
292 {
293 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
294 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
295
296 Projects = NULL;
297 ProjectsSize = 256;
298 while (TRUE)
299 {
300 Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
301 if (NULL == Projects)
302 {
303 return FALSE;
304 }
305 ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
306 if (0 == ProjectsCount)
307 {
308 HeapFree(GetProcessHeap(), 0, Projects);
309 return FALSE;
310 }
311 if (ProjectsCount < ProjectsSize - 1)
312 {
313 break;
314 }
315 HeapFree(GetProcessHeap(), 0, Projects);
316 ProjectsSize *= 2;
317 }
318
319 CurrentProject = Projects;
320 while (*CurrentProject != L'\0')
321 {
322 End = wcschr(CurrentProject, L'\n');
323 if (NULL != End)
324 {
325 *End = L'\0';
326 }
327 (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
328 if (NULL != End)
329 {
330 CurrentProject = End + 1;
331 }
332 else
333 {
334 CurrentProject += wcslen(CurrentProject);
335 }
336 }
337 HeapFree(GetProcessHeap(), 0, Projects);
338 }
339 break;
340
341 case WM_COMMAND:
343 {
346 }
347 break;
348
349 case WM_NOTIFY:
350 {
351 lpnm = (LPNMHDR)lParam;
352
353 switch (lpnm->code)
354 {
355 case PSN_SETACTIVE:
356 /* Enable the Back and Next buttons */
358 if (pSetupData->UnattendSetup)
359 {
361 return TRUE;
362 }
363 break;
364
365 case PSN_WIZBACK:
366 pSetupData->UnattendSetup = FALSE;
367 break;
368
369 default:
370 break;
371 }
372 }
373 break;
374
375 default:
376 break;
377 }
378
379 return FALSE;
380}
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
#define IDD_PRODUCT
Definition: resource.h:102
#define IDC_VIEWGPL
Definition: resource.h:43
#define IDD_GPL
Definition: resource.h:85
#define IDC_PROJECTS
Definition: resource.h:42
#define IDS_ACKPROJECTS
Definition: resource.h:130
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define L(x)
Definition: ntvdm.h:50
#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
BOOL UnattendSetup
Definition: syssetup.h:46
UINT code
Definition: winuser.h:3162
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:123
#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:875
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_COMMAND
Definition: winuser.h:1743
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1742
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define DWLP_MSGRESULT
Definition: winuser.h:873
#define BN_CLICKED
Definition: winuser.h:1928
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DialogBox
Definition: winuser.h:5773
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by InstallWizard().

◆ AddInstallationSource()

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

Definition at line 2938 of file wizard.c.

2941{
2942 LONG res;
2943 DWORD dwRegType;
2944 DWORD dwPathLength = 0;
2945 DWORD dwNewLength = 0;
2946 LPWSTR Buffer = NULL;
2947 LPWSTR Path;
2948
2950 hKey,
2951 L"Installation Sources",
2952 NULL,
2953 &dwRegType,
2954 NULL,
2955 &dwPathLength);
2956
2957 if (res != ERROR_SUCCESS ||
2958 dwRegType != REG_MULTI_SZ ||
2959 dwPathLength == 0 ||
2960 dwPathLength % sizeof(WCHAR) != 0)
2961 {
2962 dwPathLength = 0;
2963 goto set;
2964 }
2965
2966 /* Reserve space for existing data + new string */
2967 dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
2968 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
2969 if (!Buffer)
2970 return;
2971
2972 ZeroMemory(Buffer, dwNewLength);
2973
2975 hKey,
2976 L"Installation Sources",
2977 NULL,
2978 NULL,
2979 (LPBYTE)Buffer,
2980 &dwPathLength);
2981
2982 if (res != ERROR_SUCCESS)
2983 {
2985 dwPathLength = 0;
2986 goto set;
2987 }
2988
2989 /* Sanity check, these should already be zeros */
2990 Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
2991 Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
2992
2993 for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
2994 {
2995 /* Check if path is already added */
2996 if (PathIsEqual(Path, lpPath))
2997 goto cleanup;
2998 }
2999
3000 Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
3001
3002set:
3003 if (dwPathLength == 0)
3004 {
3005 dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
3006 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3007 if (!Buffer)
3008 return;
3009
3010 Path = Buffer;
3011 }
3012
3013 StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
3014 Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3015
3017 hKey,
3018 L"Installation Sources",
3019 0,
3021 (LPBYTE)Buffer,
3022 dwNewLength);
3023
3024cleanup:
3026}
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 REG_MULTI_SZ
Definition: nt_native.h:1501
#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:2912
unsigned char * LPBYTE
Definition: typedefs.h:53
#define ZeroMemory
Definition: winbase.h:1737
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ProcessSetupInf().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 57 of file wizard.c.

58{
60 RECT rcParent;
61 RECT rcWindow;
62
64 if (hWndParent == NULL)
66
67 GetWindowRect(hWndParent, &rcParent);
68 GetWindowRect(hWnd, &rcWindow);
69
72 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
73 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
74 0,
75 0,
77}
HWND hWnd
Definition: settings.c:17
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
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:1248
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1210

◆ ComputerPageDlgProc()

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

Definition at line 1045 of file wizard.c.

1049{
1050 WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1051 WCHAR Password1[128];
1052 WCHAR Password2[128];
1054 WCHAR Title[64];
1055 WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
1056 LPNMHDR lpnm;
1057 PSETUPDATA pSetupData;
1058
1059 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1060
1062 {
1063 wcscpy(Title, L"ReactOS Setup");
1064 }
1065
1066 switch (uMsg)
1067 {
1068 case WM_INITDIALOG:
1069 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1070 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
1071
1072 /* Generate a new pseudo-random computer name */
1073 GenerateComputerName(ComputerName);
1074
1075 /* Display current computer name */
1076 SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
1077
1078 /* Set text limits */
1082
1083 /* Set focus to computer name */
1085 if (pSetupData->UnattendSetup)
1086 {
1092 }
1093
1094 /* Store the administrator account name as the default user name */
1096 break;
1097
1098
1099 case WM_NOTIFY:
1100 {
1101 lpnm = (LPNMHDR)lParam;
1102
1103 switch (lpnm->code)
1104 {
1105 case PSN_SETACTIVE:
1106 /* Enable the Back and Next buttons */
1108 if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
1109 {
1111 return TRUE;
1112 }
1113 break;
1114
1115 case PSN_WIZNEXT:
1116 if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
1117 {
1118 if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
1119 ARRAYSIZE(EmptyComputerName)))
1120 {
1121 wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1122 }
1123 MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1125 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1126 return TRUE;
1127 }
1128
1129 /* No need to check computer name for invalid characters,
1130 * SetComputerName() will do it for us */
1131
1132 if (!WriteComputerSettings(ComputerName, hwndDlg))
1133 {
1135 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1136 return TRUE;
1137 }
1138
1139#ifdef PASSWORDS_MANDATORY
1140 /* Check if admin passwords have been entered */
1141 if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1142 (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1143 {
1144 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1145 ARRAYSIZE(EmptyPassword)))
1146 {
1147 wcscpy(EmptyPassword, L"You must enter a password !");
1148 }
1149 MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1150 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1151 return TRUE;
1152 }
1153#else
1154 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1155 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1156#endif
1157 /* Check if passwords match */
1158 if (wcscmp(Password1, Password2))
1159 {
1160 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1161 ARRAYSIZE(NotMatchPassword)))
1162 {
1163 wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1164 }
1165 MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1166 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1167 return TRUE;
1168 }
1169
1170 /* Check password for invalid characters */
1171 Password = (PWCHAR)Password1;
1172 while (*Password)
1173 {
1174 if (!isprint(*Password))
1175 {
1176 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1177 ARRAYSIZE(WrongPassword)))
1178 {
1179 wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1180 }
1181 MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1182 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1183 return TRUE;
1184 }
1185 Password++;
1186 }
1187
1188 /* Set admin password */
1189 SetAdministratorPassword(Password1);
1190 break;
1191
1192 case PSN_WIZBACK:
1193 pSetupData->UnattendSetup = FALSE;
1194 break;
1195
1196 default:
1197 break;
1198 }
1199 }
1200 break;
1201
1202 default:
1203 break;
1204 }
1205
1206 return FALSE;
1207}
#define isprint(c)
Definition: acclib.h:73
wcscpy
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_REACTOS_SETUP
Definition: resource.h:129
static const WCHAR Title[]
Definition: oid.c:1259
#define IDC_COMPUTERNAME
Definition: resource.h:15
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1609
#define IDC_ADMINPASSWORD2
Definition: resource.h:52
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:145
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:147
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:148
#define IDD_THEMEPAGE
Definition: resource.h:82
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:146
#define IDC_ADMINPASSWORD1
Definition: resource.h:51
#define PSN_WIZNEXT
Definition: prsht.h:121
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
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:975
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:1027
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:904
@ Password
Definition: telnetd.h:65
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:269
LONG_PTR LPARAM
Definition: windef.h:208
#define EM_LIMITTEXT
Definition: winuser.h:2003
#define GetDlgItemText
Definition: winuser.h:5797
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:790
#define WM_SETTEXT
Definition: winuser.h:1620
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendMessage
Definition: winuser.h:5855
#define MB_OK
Definition: winuser.h:793
#define SendDlgItemMessage
Definition: winuser.h:5854

Referenced by InstallWizard().

◆ Control_RunDLLW()

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

Definition at line 1173 of file control.c.

1174{
1175 CPanel panel;
1176
1177 TRACE("(%p, %p, %s, 0x%08x)\n",
1178 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1179
1180#ifndef __REACTOS__
1181 memset(&panel, 0, sizeof(panel));
1182 list_init( &panel.applets );
1183#endif
1184
1185 if (!cmd || !*cmd) {
1186 Control_DoWindow(&panel, hWnd, hInst);
1187 } else {
1188 Control_DoLaunch(&panel, hWnd, cmd);
1189 }
1190}
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 102 of file wizard.c.

103{
104 LOGFONTW tmpFont = {0};
105 HFONT hBoldFont;
106 HDC hDc;
107
108 /* Grabs the Drawing Context */
109 hDc = GetDC(NULL);
110
111 tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
112 tmpFont.lfWeight = FW_BOLD;
113 wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
114
115 hBoldFont = CreateFontIndirectW(&tmpFont);
116
117 ReleaseDC(NULL, hDc);
118
119 return hBoldFont;
120}
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 1575 of file wizard.c.

1576{
1578}
SETUPDATA SetupData
Definition: reactos.c:41
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1494
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 81 of file wizard.c.

82{
83 LOGFONTW LogFont = {0};
84 HDC hdc;
86
87 LogFont.lfWeight = FW_BOLD;
88 wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
89
90 hdc = GetDC(NULL);
91 LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
92
93 hFont = CreateFontIndirectW(&LogFont);
94
96
97 return hFont;
98}
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 1761 of file wizard.c.

1765{
1767
1768 /* Retrieve pointer to the global setup data */
1770
1771 switch (uMsg)
1772 {
1773 case WM_INITDIALOG:
1774 {
1775 /* Save pointer to the global setup data */
1778
1780
1782 {
1785
1787 {
1789 }
1790 }
1791 else
1792 {
1794 SetupData, -1);
1795
1797 }
1798 break;
1799 }
1800
1801 case WM_TIMER:
1802 {
1803 SYSTEMTIME LocalTime;
1804
1805 GetLocalTime(&LocalTime);
1806 UpdateLocalSystemTime(hwndDlg, LocalTime);
1807
1808 // Reset timeout.
1809 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1810 break;
1811 }
1812
1813 case WM_NOTIFY:
1814 switch (((LPNMHDR)lParam)->code)
1815 {
1816 case PSN_SETACTIVE:
1817 {
1818 SYSTEMTIME LocalTime;
1819
1820 GetLocalTime(&LocalTime);
1821 UpdateLocalSystemTime(hwndDlg, LocalTime);
1822
1823 /* Enable the Back and Next buttons */
1825
1827 {
1829 return TRUE;
1830 }
1831
1832 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1833 break;
1834 }
1835
1836 case PSN_KILLACTIVE:
1837 case DTN_DATETIMECHANGE:
1838 // NB: Not re-set until changing page (PSN_SETACTIVE).
1839 KillTimer(hwndDlg, 1);
1840 break;
1841
1842 case PSN_WIZNEXT:
1844 break;
1845
1846 case PSN_WIZBACK:
1848 break;
1849
1850 default:
1851 break;
1852 }
1853 break;
1854
1855 case WM_DESTROY:
1857 break;
1858
1859 default:
1860 break;
1861 }
1862
1863 return FALSE;
1864}
#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 PSN_KILLACTIVE
Definition: prsht.h:116
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4371
DWORD TimeZoneIndex
Definition: syssetup.h:52
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
WORD wMilliseconds
Definition: winbase.h:937
Definition: inflate.c:139
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1575
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1722
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1730
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1581
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1603
#define GWLP_USERDATA
Definition: treelist.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
UINT_PTR WPARAM
Definition: windef.h:207
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define BM_SETCHECK
Definition: winuser.h:1924
#define WM_TIMER
Definition: winuser.h:1745
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define BST_CHECKED
Definition: winuser.h:197

Referenced by InstallWizard().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1581 of file wizard.c.

1582{
1584
1585 while (SetupData->TimeZoneListHead != NULL)
1586 {
1588
1591 {
1593 }
1594
1596 }
1597
1599}
base of all file and directory entries
Definition: entries.h:83
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
Definition: timezone.c:16

Referenced by DateTimePageDlgProc().

◆ DoWriteProductOption()

static BOOL DoWriteProductOption ( PRODUCT_OPTION  nOption)
static

Definition at line 524 of file wizard.c.

525{
526 HKEY hKey;
527 LONG error;
528 LPCWSTR pszData;
529 DWORD dwValue, cbData;
531 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
532
533 /* open ProductOptions key */
535 if (error)
536 {
537 DPRINT1("RegOpenKeyExW failed\n");
538 goto Error;
539 }
540
541 /* write ProductSuite */
542 pszData = pData->ProductSuite;
543 cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
544 error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
545 if (error)
546 {
547 DPRINT1("RegSetValueExW failed\n");
548 goto Error;
549 }
550
551 /* write ProductType */
552 pszData = pData->ProductType;
553 cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
554 error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
555 if (error)
556 {
557 DPRINT1("RegSetValueExW failed\n");
558 goto Error;
559 }
560
562
563 /* open ReactOS version key */
565 if (error)
566 {
567 DPRINT1("RegOpenKeyExW failed\n");
568 goto Error;
569 }
570
571 /* write ReportAsWorkstation */
572 dwValue = pData->ReportAsWorkstation;
573 cbData = sizeof(dwValue);
574 error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
575 if (error)
576 {
577 DPRINT1("RegSetValueExW failed\n");
578 goto Error;
579 }
580
582
583 /* open Control Windows key */
585 if (error)
586 {
587 DPRINT1("RegOpenKeyExW failed\n");
588 goto Error;
589 }
590
591 /* write Control Windows CSDVersion */
592 dwValue = pData->CSDVersion;
593 cbData = sizeof(dwValue);
594 error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
595 if (error)
596 {
597 DPRINT1("RegSetValueExW failed\n");
598 goto Error;
599 }
600
602
603 /* open Winlogon key */
605 if (error)
606 {
607 DPRINT1("RegOpenKeyExW failed\n");
608 goto Error;
609 }
610
611 /* write LogonType */
612 dwValue = pData->LogonType;
613 cbData = sizeof(dwValue);
614 error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
615 if (error)
616 {
617 DPRINT1("RegSetValueExW failed\n");
618 goto Error;
619 }
620
621 if (nOption == PRODUCT_OPTION_WORKSTATION)
622 {
623 /* Write system sound events values for Workstation */
626 }
627
628Error:
629 if (hKey)
631
632 return error == ERROR_SUCCESS;
633}
#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:1031
#define REG_DWORD
Definition: sdbapi.c:596
#define _countof(array)
Definition: sndvol32.h:70
static const WCHAR * s_ExplorerSoundEvents[][2]
Definition: wizard.c:434
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:398
static BOOL DoWriteSoundEvents(HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
Definition: wizard.c:441
static const WCHAR s_szRosVersion[]
Definition: wizard.c:383
static const WCHAR s_szWinlogon[]
Definition: wizard.c:385
static const WCHAR * s_DefaultSoundEvents[][2]
Definition: wizard.c:404
static const WCHAR s_szExplorerSoundEvents[]
Definition: wizard.c:387
static const WCHAR s_szProductOptions[]
Definition: wizard.c:382
static const WCHAR s_szControlWindows[]
Definition: wizard.c:384
static const WCHAR s_szDefaultSoundEvents[]
Definition: wizard.c:386
@ 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 441 of file wizard.c.

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

Referenced by DoWriteProductOption().

◆ FinishDlgProc()

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

Definition at line 2481 of file wizard.c.

2485{
2486
2487 switch (uMsg)
2488 {
2489 case WM_INITDIALOG:
2490 {
2491 /* Get pointer to the global setup data */
2493
2495 {
2496 /* Run the Wine Gecko prompt */
2497 Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl,,install_gecko", SW_SHOW);
2498 }
2499
2500 /* Set title font */
2501 SendDlgItemMessage(hwndDlg,
2503 WM_SETFONT,
2505 (LPARAM)TRUE);
2507 {
2508 KillTimer(hwndDlg, 1);
2510 PostQuitMessage(0);
2511 }
2512 }
2513 break;
2514
2515 case WM_DESTROY:
2516 {
2518 PostQuitMessage(0);
2519 return TRUE;
2520 }
2521
2522 case WM_TIMER:
2523 {
2524 INT Position;
2525 HWND hWndProgress;
2526
2527 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2528 Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2529 if (Position == 300)
2530 {
2531 KillTimer(hwndDlg, 1);
2533 }
2534 else
2535 {
2536 SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2537 }
2538 }
2539 return TRUE;
2540
2541 case WM_NOTIFY:
2542 {
2543 LPNMHDR lpnm = (LPNMHDR)lParam;
2544
2545 switch (lpnm->code)
2546 {
2547 case PSN_SETACTIVE:
2548 /* Enable the correct buttons on for the active page */
2550
2552 MAKELPARAM(0, 300));
2554 SetTimer(hwndDlg, 1, 50, NULL);
2555 break;
2556
2557 case PSN_WIZFINISH:
2558 DestroyWindow(GetParent(hwndDlg));
2559 break;
2560
2561 default:
2562 break;
2563 }
2564 }
2565 break;
2566
2567 default:
2568 break;
2569 }
2570
2571 return FALSE;
2572}
#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:1173
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2452
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SETFONT
Definition: winuser.h:1653
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 1027 of file wizard.c.

1028{
1029 static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1030 static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
1031 unsigned i;
1032
1033 wcscpy(lpBuffer, L"REACTOS-");
1034
1036
1037 /* fill in 7 characters */
1038 for (i = 8; i < 15; i++)
1039 lpBuffer[i] = Chars[rand() % cChars];
1040
1041 lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
1042}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

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

Definition at line 2580 of file wizard.c.

2584{
2585 WCHAR wszDrives[512];
2586 WCHAR wszNTPath[512]; // MAX_PATH ?
2587 DWORD cchDrives;
2588 PWCHAR pwszDrive;
2589
2590 *pwszPath = UNICODE_NULL;
2591
2592 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2593 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2594 {
2595 /* Buffer too small or failure */
2596 LogItem(NULL, L"GetLogicalDriveStringsW failed");
2597 return FALSE;
2598 }
2599
2600 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2601 {
2602 WCHAR wszBuf[MAX_PATH];
2603
2604 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2605 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2606 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2607 pwszDrive[2] = L'\\'; // Restore the backslash
2608
2609 wcscat(wszNTPath, L"\\"); // Concat a backslash
2610
2611 /* Logging */
2612 wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2613 pwszDrive, wszNTPath,
2614 (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2615 LogItem(NULL, wszBuf);
2616
2617 /* Check whether the NT path corresponds to the NT installation source path */
2618 if (!_wcsicmp(wszNTPath, pwszNTPath))
2619 {
2620 /* Found it! */
2621 wcscpy(pwszPath, pwszDrive); // cchPathMax
2622
2623 /* Logging */
2624 wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2625 LogItem(NULL, wszBuf);
2626 wcscat(wszBuf, L"\n");
2627 OutputDebugStringW(wszBuf);
2628
2629 return TRUE;
2630 }
2631 }
2632
2633 return FALSE;
2634}
wcscat
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
#define DRIVE_CDROM
Definition: machpc98.h:119
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98
#define wsprintf
Definition: winuser.h:5877

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1477 of file wizard.c.

1478{
1480
1482 while (Entry != NULL)
1483 {
1484 if (Entry->Index >= Index)
1485 return Entry;
1486
1487 Entry = Entry->Next;
1488 }
1489
1490 return NULL;
1491}
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by RetrieveTimeZone().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1678 of file wizard.c.

1679{
1680 SYSTEMTIME Date;
1682
1684 {
1685 return FALSE;
1686 }
1687
1689 {
1690 return FALSE;
1691 }
1692
1696 SetupData->SystemTime.wDay = Date.wDay;
1697 SetupData->SystemTime.wHour = Time.wHour;
1698 SetupData->SystemTime.wMinute = Time.wMinute;
1699 SetupData->SystemTime.wSecond = Time.wSecond;
1700 SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1701
1702 return TRUE;
1703}
#define IDC_TIMEPICKER
Definition: resource.h:11
#define IDC_DATEPICKER
Definition: resource.h:61
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 wYear
Definition: winbase.h:930
WORD wMonth
Definition: winbase.h:931
WORD wHour
Definition: winbase.h:934
WORD wSecond
Definition: winbase.h:936
WORD wMinute
Definition: winbase.h:935
WORD wDay
Definition: winbase.h:933
WORD wDayOfWeek
Definition: winbase.h:932
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by WriteDateTimeSettings().

◆ GplDlgProc()

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

Definition at line 123 of file wizard.c.

127{
128 HRSRC GplTextResource;
129 HGLOBAL GplTextMem;
130 PVOID GplTextLocked;
131 PCHAR GplText;
132 DWORD Size;
133
134
135 switch (uMsg)
136 {
137 case WM_INITDIALOG:
138 GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
139 if (NULL == GplTextResource)
140 {
141 break;
142 }
143 Size = SizeofResource(hDllInstance, GplTextResource);
144 if (0 == Size)
145 {
146 break;
147 }
148 GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
149 if (NULL == GplText)
150 {
151 break;
152 }
153 GplTextMem = LoadResource(hDllInstance, GplTextResource);
154 if (NULL == GplTextMem)
155 {
156 HeapFree(GetProcessHeap(), 0, GplText);
157 break;
158 }
159 GplTextLocked = LockResource(GplTextMem);
160 if (NULL == GplTextLocked)
161 {
162 HeapFree(GetProcessHeap(), 0, GplText);
163 break;
164 }
165 memcpy(GplText, GplTextLocked, Size);
166 GplText[Size] = '\0';
167 SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
168 HeapFree(GetProcessHeap(), 0, GplText);
169 SetFocus(GetDlgItem(hwndDlg, IDOK));
170 return FALSE;
171
172 case WM_CLOSE:
173 EndDialog(hwndDlg, IDCANCEL);
174 break;
175
176 case WM_COMMAND:
177 if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
178 {
179 EndDialog(hwndDlg, IDOK);
180 }
181 break;
182
183 default:
184 break;
185 }
186
187 return FALSE;
188}
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:174
#define IDC_GPL_TEXT
Definition: resource.h:86
#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:4533
#define WM_CLOSE
Definition: winuser.h:1624
#define IDCANCEL
Definition: winuser.h:834
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDOK
Definition: winuser.h:833
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 3164 of file wizard.c.

3165{
3166 PROPSHEETHEADER psh = {0};
3167 HPROPSHEETPAGE *phpage = NULL;
3168 PROPSHEETPAGE psp = {0};
3169 UINT nPages = 0;
3170 HWND hWnd;
3171 MSG msg;
3172 PSETUPDATA pSetupData = NULL;
3173 HMODULE hNetShell = NULL;
3175 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3176
3177 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3178
3179 /* Allocate setup data */
3180 pSetupData = HeapAlloc(GetProcessHeap(),
3182 sizeof(SETUPDATA));
3183 if (pSetupData == NULL)
3184 {
3185 LogItem(NULL, L"SetupData allocation failed!");
3187 L"Setup failed to allocate global data!",
3188 L"ReactOS Setup",
3190 goto done;
3191 }
3193
3194 hNetShell = LoadLibraryW(L"netshell.dll");
3195 if (hNetShell != NULL)
3196 {
3197 DPRINT("Netshell.dll loaded!\n");
3198
3199 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3200 "NetSetupRequestWizardPages");
3201 if (pfn != NULL)
3202 {
3203 pfn(&dwNetworkPageCount, NULL, NULL);
3204 dwPageCount += dwNetworkPageCount;
3205 }
3206 }
3207
3208 DPRINT("PageCount: %lu\n", dwPageCount);
3209
3210 phpage = HeapAlloc(GetProcessHeap(),
3212 dwPageCount * sizeof(HPROPSHEETPAGE));
3213 if (phpage == NULL)
3214 {
3215 LogItem(NULL, L"Page array allocation failed!");
3217 L"Setup failed to allocate page array!",
3218 L"ReactOS Setup",
3220 goto done;
3221 }
3222
3223 /* Process the $winnt$.inf setup file */
3224 ProcessSetupInf(pSetupData);
3225
3226 /* Create the Welcome page */
3227 psp.dwSize = sizeof(PROPSHEETPAGE);
3228 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3229 psp.hInstance = hDllInstance;
3230 psp.lParam = (LPARAM)pSetupData;
3231 psp.pfnDlgProc = WelcomeDlgProc;
3232 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3233 phpage[nPages++] = CreatePropertySheetPage(&psp);
3234
3235 /* Create the Acknowledgements page */
3236 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3237 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3238 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3239 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3240 psp.pfnDlgProc = AckPageDlgProc;
3241 phpage[nPages++] = CreatePropertySheetPage(&psp);
3242
3243 /* Create the Product page */
3244 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3245 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
3246 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
3247 psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
3248 psp.pfnDlgProc = ProductPageDlgProc;
3249 phpage[nPages++] = CreatePropertySheetPage(&psp);
3250
3251 /* Create the Locale page */
3252 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3253 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3254 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3255 psp.pfnDlgProc = LocalePageDlgProc;
3256 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3257 phpage[nPages++] = CreatePropertySheetPage(&psp);
3258
3259 /* Create the Owner page */
3260 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3261 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3262 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3263 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3264 psp.pfnDlgProc = OwnerPageDlgProc;
3265 phpage[nPages++] = CreatePropertySheetPage(&psp);
3266
3267 /* Create the Computer page */
3268 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3269 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3270 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3271 psp.pfnDlgProc = ComputerPageDlgProc;
3272 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3273 phpage[nPages++] = CreatePropertySheetPage(&psp);
3274
3275 /* Create the DateTime page */
3276 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3277 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3278 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3279 psp.pfnDlgProc = DateTimePageDlgProc;
3280 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3281 phpage[nPages++] = CreatePropertySheetPage(&psp);
3282
3283 /* Create the theme selection page */
3284 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3285 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3286 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3287 psp.pfnDlgProc = ThemePageDlgProc;
3288 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3289 phpage[nPages++] = CreatePropertySheetPage(&psp);
3290
3293
3294 if (pfn)
3295 {
3296 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3297 nPages += dwNetworkPageCount;
3298 }
3299
3300 /* Create the Process page */
3301 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3302 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3303 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3304 psp.pfnDlgProc = ProcessPageDlgProc;
3305 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3306 phpage[nPages++] = CreatePropertySheetPage(&psp);
3307
3308 /* Create the Finish page */
3309 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3310 psp.pfnDlgProc = FinishDlgProc;
3311 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3312 phpage[nPages++] = CreatePropertySheetPage(&psp);
3313
3314 ASSERT(nPages == dwPageCount);
3315
3316 /* Create the property sheet */
3317 psh.dwSize = sizeof(PROPSHEETHEADER);
3318 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3319 psh.hInstance = hDllInstance;
3320 psh.hwndParent = NULL;
3321 psh.nPages = nPages;
3322 psh.nStartPage = 0;
3323 psh.phpage = phpage;
3324 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3325 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3326
3327 /* Create title font */
3328 pSetupData->hTitleFont = CreateTitleFont();
3329 pSetupData->hBoldFont = CreateBoldFont();
3330
3331 /* Display the wizard */
3332 hWnd = (HWND)PropertySheet(&psh);
3334
3335 while (GetMessage(&msg, NULL, 0, 0))
3336 {
3337 if (!IsDialogMessage(hWnd, &msg))
3338 {
3341 }
3342 }
3343
3344 DeleteObject(pSetupData->hBoldFont);
3345 DeleteObject(pSetupData->hTitleFont);
3346
3347 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3348 SetupCloseInfFile(pSetupData->hSetupInf);
3349
3350done:
3351 if (phpage != NULL)
3352 HeapFree(GetProcessHeap(), 0, phpage);
3353
3354 if (hNetShell != NULL)
3355 FreeLibrary(hNetShell);
3356
3357 if (pSetupData != NULL)
3358 HeapFree(GetProcessHeap(), 0, pSetupData);
3359
3360 LogItem(L"END_SECTION", L"InstallWizard");
3361}
#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 IDD_DATETIMEPAGE
Definition: resource.h:5
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#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:127
#define IDS_LOCALESUBTITLE
Definition: resource.h:117
#define IDD_ACKPAGE
Definition: resource.h:41
#define IDS_ACKTITLE
Definition: resource.h:107
#define IDS_PRODUCTTITLE
Definition: resource.h:166
#define IDD_OWNERPAGE
Definition: resource.h:45
#define IDS_OWNERSUBTITLE
Definition: resource.h:111
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:114
#define IDS_DATETIMESUBTITLE
Definition: resource.h:122
#define IDS_LOCALETITLE
Definition: resource.h:116
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:128
#define IDS_COMPUTERTITLE
Definition: resource.h:113
#define IDD_COMPUTERPAGE
Definition: resource.h:49
#define IDS_OWNERTITLE
Definition: resource.h:110
#define IDS_ACKSUBTITLE
Definition: resource.h:108
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:167
#define IDS_DATETIMETITLE
Definition: resource.h:121
pKey DeleteObject()
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1353
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:1274
#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
HINF hSetupInf
Definition: syssetup.h:56
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1045
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1392
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:795
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1761
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:102
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3029
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3161
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1880
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:276
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2356
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:659
@ 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:5821
#define GetMessage
Definition: winuser.h:5802
#define DispatchMessage
Definition: winuser.h:5777

Referenced by InstallReactOS().

◆ ItemCompletionThread()

static DWORD CALLBACK ItemCompletionThread ( LPVOID  Parameter)
static

Definition at line 2210 of file wizard.c.

2212{
2213 PITEMSDATA pItemsData;
2214 HWND hwndDlg;
2215
2216 pItemsData = (PITEMSDATA)Parameter;
2217 hwndDlg = pItemsData->hwndDlg;
2218
2219 /* Step 0 - Registering components */
2220 RegisterComponents(pItemsData);
2221
2222 /* Step 1 - Installing start menu items */
2223 InstallStartMenuItems(pItemsData);
2224
2225 /* FIXME: Add completion steps here! */
2226
2227 // FIXME: Move this call to a separate cleanup page!
2229
2230 /* Free the items data */
2231 HeapFree(GetProcessHeap(), 0, pItemsData);
2232
2233 /* Tell the wizard page that we are done */
2234 PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2235
2236 return 0;
2237}
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:2161
#define PostMessage
Definition: winuser.h:5844
_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 1392 of file wizard.c.

1396{
1398
1399 /* Retrieve pointer to the global setup data */
1401
1402 switch (uMsg)
1403 {
1404 case WM_INITDIALOG:
1405 {
1406 /* Save pointer to the global setup data */
1410
1413 }
1414 break;
1415
1416 case WM_COMMAND:
1417 if (HIWORD(wParam) == BN_CLICKED)
1418 {
1419 switch (LOWORD(wParam))
1420 {
1421 case IDC_CUSTOMLOCALE:
1422 RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1424 break;
1425
1426 case IDC_CUSTOMLAYOUT:
1427 RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1429 break;
1430 }
1431 }
1432 break;
1433
1434 case WM_NOTIFY:
1435 {
1436 LPNMHDR lpnm = (LPNMHDR)lParam;
1437
1438 switch (lpnm->code)
1439 {
1440 case PSN_SETACTIVE:
1441 /* Enable the Back and Next buttons */
1444 {
1445 // if (!*SetupData->SourcePath)
1446 {
1447 RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1448 }
1449
1451 return TRUE;
1452 }
1453 break;
1454
1455 case PSN_WIZNEXT:
1456 break;
1457
1458 case PSN_WIZBACK:
1460 break;
1461
1462 default:
1463 break;
1464 }
1465 }
1466 break;
1467
1468 default:
1469 break;
1470 }
1471
1472 return FALSE;
1473}
#define IDC_LOCALETEXT
Definition: resource.h:55
#define IDC_LAYOUTTEXT
Definition: resource.h:57
#define IDC_CUSTOMLOCALE
Definition: resource.h:56
#define IDC_CUSTOMLAYOUT
Definition: resource.h:58
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1228
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1371
static VOID SetUserLocaleName(HWND hwnd)
Definition: wizard.c:1211
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1310

Referenced by InstallWizard().

◆ OnChooseOption()

static void OnChooseOption ( HWND  hwndDlg,
PRODUCT_OPTION  nOption 
)
static

Definition at line 636 of file wizard.c.

637{
638 WCHAR szText[256];
639 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
640
641 switch (nOption)
642 {
645 break;
646
649 break;
650
651 default:
652 return;
653 }
654
656}
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:105
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:171
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:170
@ 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 795 of file wizard.c.

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

Referenced by InstallWizard().

◆ PathIsEqual()

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

Definition at line 2912 of file wizard.c.

2915{
2916 WCHAR szPath1[MAX_PATH];
2917 WCHAR szPath2[MAX_PATH];
2918
2919 /* If something goes wrong, better return TRUE,
2920 * so the calling function returns early.
2921 */
2922 if (!PathCanonicalizeW(szPath1, lpPath1))
2923 return TRUE;
2924
2925 if (!PathAddBackslashW(szPath1))
2926 return TRUE;
2927
2928 if (!PathCanonicalizeW(szPath2, lpPath2))
2929 return TRUE;
2930
2931 if (!PathAddBackslashW(szPath2))
2932 return TRUE;
2933
2934 return (_wcsicmp(szPath1, szPath2) == 0);
2935}
#define PathCanonicalizeW
Definition: pathcch.h:313
#define PathAddBackslashW
Definition: pathcch.h:301

Referenced by AddInstallationSource().

◆ ProcessPageDlgProc()

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

Definition at line 2356 of file wizard.c.

2360{
2362 PREGISTRATIONNOTIFY RegistrationNotify;
2363
2364 /* Retrieve pointer to the global setup data */
2366
2367 switch (uMsg)
2368 {
2369 case WM_INITDIALOG:
2370 /* Save pointer to the global setup data */
2375 break;
2376
2377 case WM_NOTIFY:
2378 switch (((LPNMHDR)lParam)->code)
2379 {
2380 case PSN_SETACTIVE:
2381 LogItem(L"BEGIN", L"ProcessPage");
2382
2383 /* Disable the Back and Next buttons */
2385 RunItemCompletionThread(hwndDlg);
2386 break;
2387
2388 case PSN_WIZNEXT:
2389 LogItem(L"END", L"ProcessPage");
2390 break;
2391
2392 case PSN_WIZBACK:
2394 break;
2395
2396 default:
2397 break;
2398 }
2399 break;
2400
2401 case PM_ITEM_START:
2402 DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2406 break;
2407
2408 case PM_ITEM_END:
2409 DPRINT("PM_ITEM_END\n");
2410 if (lParam == ERROR_SUCCESS)
2411 {
2412 }
2413 else
2414 {
2415 ShowItemError(hwndDlg, (DWORD)lParam);
2416 }
2417 break;
2418
2419 case PM_STEP_START:
2420 DPRINT("PM_STEP_START\n");
2421 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2423 (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2424 break;
2425
2426 case PM_STEP_END:
2427 DPRINT("PM_STEP_END\n");
2428 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2429 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2430 if (RegistrationNotify->LastError != ERROR_SUCCESS)
2431 {
2432 ShowStepError(hwndDlg, RegistrationNotify);
2433 }
2434 break;
2435
2436 case PM_ITEMS_DONE:
2437 DPRINT("PM_ITEMS_DONE\n");
2438 /* Enable the Back and Next buttons */
2441 break;
2442
2443 default:
2444 break;
2445 }
2446
2447 return FALSE;
2448}
#define IDC_PROCESSPROGRESS
Definition: resource.h:63
#define IDC_ITEM
Definition: resource.h:62
#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:72
#define IDC_TASKTEXT1
Definition: resource.h:69
#define IDC_TASKTEXT3
Definition: resource.h:71
#define PSBTN_NEXT
Definition: prsht.h:147
LPCWSTR CurrentItem
Definition: globals.h:38
static VOID ShowItemError(HWND hwndDlg, DWORD LastError)
Definition: wizard.c:2275
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2242
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2318
#define SW_HIDE
Definition: winuser.h:771

Referenced by InstallWizard().

◆ ProcessSetupInf()

VOID ProcessSetupInf ( IN OUT PSETUPDATA  pSetupData)

Definition at line 3029 of file wizard.c.

3031{
3033 WCHAR szValue[MAX_PATH];
3034 INFCONTEXT InfContext;
3035 DWORD LineLength;
3036 HKEY hKey;
3037 LONG res;
3038
3039 pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3040
3041 /* Retrieve the path of the setup INF */
3043 wcscat(szPath, L"\\$winnt$.inf");
3044
3045 /* Open the setup INF */
3046 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3047 NULL,
3049 NULL);
3050 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3051 {
3052 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3053 return;
3054 }
3055
3056
3057 /* Retrieve the NT source path from which the 1st-stage installer was run */
3058 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3059 L"data",
3060 L"sourcepath",
3061 &InfContext))
3062 {
3063 DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3064 return;
3065 }
3066
3067 if (!SetupGetStringFieldW(&InfContext,
3068 1,
3069 szValue,
3070 ARRAYSIZE(szValue),
3071 &LineLength))
3072 {
3073 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3074 return;
3075 }
3076
3077 *pSetupData->SourcePath = UNICODE_NULL;
3078
3079 /* Close the setup INF as we are going to modify it manually */
3080 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3081 SetupCloseInfFile(pSetupData->hSetupInf);
3082
3083
3084 /* Find the installation source path in Win32 format */
3085 if (!GetInstallSourceWin32(pSetupData->SourcePath,
3086 _countof(pSetupData->SourcePath),
3087 szValue))
3088 {
3089 *pSetupData->SourcePath = UNICODE_NULL;
3090 }
3091
3092 /* Save the path in Win32 format in the setup INF */
3093 swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3094 WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3095
3096 /*
3097 * Save it also in the registry, in the following keys:
3098 * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3099 * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3100 * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3101 * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3102 */
3103#if 0
3105 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3106 0,
3108 &hKey);
3109
3110 if (res != ERROR_SUCCESS)
3111 {
3112 return FALSE;
3113 }
3114#endif
3115
3117 L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3118 0, NULL,
3120 KEY_ALL_ACCESS, // KEY_WRITE
3121 NULL,
3122 &hKey,
3123 NULL);
3124 if (res == ERROR_SUCCESS)
3125 {
3126 AddInstallationSource(hKey, pSetupData->SourcePath);
3127
3129 L"SourcePath",
3130 0,
3131 REG_SZ,
3132 (LPBYTE)pSetupData->SourcePath,
3133 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3134
3136 L"ServicePackSourcePath",
3137 0,
3138 REG_SZ,
3139 (LPBYTE)pSetupData->SourcePath,
3140 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3141
3143 }
3144
3145
3146 /* Now, re-open the setup INF (this must succeed) */
3147 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3148 NULL,
3150 NULL);
3151 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3152 {
3153 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3154 return;
3155 }
3156
3157 /* Process the unattended section of the setup file */
3158 ProcessUnattendSection(pSetupData);
3159}
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:2313
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
LPCWSTR szPath
Definition: env.c:37
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2580
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:2938
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2637
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 2637 of file wizard.c.

2639{
2640 INFCONTEXT InfContext;
2641 WCHAR szName[256];
2642 WCHAR szValue[MAX_PATH];
2643 DWORD LineLength;
2644 HKEY hKey;
2645
2646 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2647 L"Unattend",
2648 L"UnattendSetupEnabled",
2649 &InfContext))
2650 {
2651 DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2652 return;
2653 }
2654
2655 if (!SetupGetStringFieldW(&InfContext,
2656 1,
2657 szValue,
2658 ARRAYSIZE(szValue),
2659 &LineLength))
2660 {
2661 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2662 return;
2663 }
2664
2665 if (_wcsicmp(szValue, L"yes") != 0)
2666 {
2667 DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2668 return;
2669 }
2670
2671 pSetupData->UnattendSetup = TRUE;
2672
2673 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2674 L"Unattend",
2675 NULL,
2676 &InfContext))
2677 {
2678 DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2679 return;
2680 }
2681
2682 do
2683 {
2684 if (!SetupGetStringFieldW(&InfContext,
2685 0,
2686 szName,
2688 &LineLength))
2689 {
2690 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2691 return;
2692 }
2693
2694 if (!SetupGetStringFieldW(&InfContext,
2695 1,
2696 szValue,
2697 ARRAYSIZE(szValue),
2698 &LineLength))
2699 {
2700 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2701 return;
2702 }
2703 DPRINT1("Name %S Value %S\n", szName, szValue);
2704 if (!_wcsicmp(szName, L"FullName"))
2705 {
2706 if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2707 {
2708 wcscpy(pSetupData->OwnerName, szValue);
2709 }
2710 }
2711 else if (!_wcsicmp(szName, L"OrgName"))
2712 {
2713 if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2714 {
2715 wcscpy(pSetupData->OwnerOrganization, szValue);
2716 }
2717 }
2718 else if (!_wcsicmp(szName, L"ComputerName"))
2719 {
2720 if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2721 {
2722 wcscpy(pSetupData->ComputerName, szValue);
2723 }
2724 }
2725 else if (!_wcsicmp(szName, L"AdminPassword"))
2726 {
2727 if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2728 {
2729 wcscpy(pSetupData->AdminPassword, szValue);
2730 }
2731 }
2732 else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2733 {
2734 pSetupData->TimeZoneIndex = _wtoi(szValue);
2735 }
2736 else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2737 {
2738 pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2739 }
2740 else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2741 {
2742 if (!_wcsicmp(szValue, L"yes"))
2743 pSetupData->DisableGeckoInst = TRUE;
2744 else
2745 pSetupData->DisableGeckoInst = FALSE;
2746 }
2747 else if (!_wcsicmp(szName, L"ProductOption"))
2748 {
2749 pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2750 }
2751 } while (SetupFindNextLine(&InfContext, &InfContext));
2752
2753 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2754 L"Display",
2755 NULL,
2756 &InfContext))
2757 {
2758 DEVMODEW dm = { { 0 } };
2759 dm.dmSize = sizeof(dm);
2761 {
2762 do
2763 {
2764 int iValue;
2765 if (!SetupGetStringFieldW(&InfContext,
2766 0,
2767 szName,
2769 &LineLength))
2770 {
2771 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2772 return;
2773 }
2774
2775 if (!SetupGetStringFieldW(&InfContext,
2776 1,
2777 szValue,
2778 ARRAYSIZE(szValue),
2779 &LineLength))
2780 {
2781 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2782 return;
2783 }
2784 iValue = _wtoi(szValue);
2785 DPRINT1("Name %S Value %i\n", szName, iValue);
2786
2787 if (!iValue)
2788 continue;
2789
2790 if (!_wcsicmp(szName, L"BitsPerPel"))
2791 {
2792 dm.dmFields |= DM_BITSPERPEL;
2793 dm.dmBitsPerPel = iValue;
2794 }
2795 else if (!_wcsicmp(szName, L"XResolution"))
2796 {
2797 dm.dmFields |= DM_PELSWIDTH;
2798 dm.dmPelsWidth = iValue;
2799 }
2800 else if (!_wcsicmp(szName, L"YResolution"))
2801 {
2802 dm.dmFields |= DM_PELSHEIGHT;
2803 dm.dmPelsHeight = iValue;
2804 }
2805 else if (!_wcsicmp(szName, L"VRefresh"))
2806 {
2808 dm.dmDisplayFrequency = iValue;
2809 }
2810 } while (SetupFindNextLine(&InfContext, &InfContext));
2811
2813 }
2814 }
2815
2817 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2818 0,
2820 &hKey) != ERROR_SUCCESS)
2821 {
2822 DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2823 return;
2824 }
2825
2826 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2827 L"GuiRunOnce",
2828 NULL,
2829 &InfContext))
2830 {
2831 int i = 0;
2832 do
2833 {
2834 if (SetupGetStringFieldW(&InfContext,
2835 0,
2836 szValue,
2837 ARRAYSIZE(szValue),
2838 NULL))
2839 {
2841 swprintf(szName, L"%d", i);
2842 DPRINT("szName %S szValue %S\n", szName, szValue);
2843
2845 {
2846 DPRINT("value %S\n", szPath);
2847 if (RegSetValueExW(hKey,
2848 szName,
2849 0,
2850 REG_SZ,
2851 (const BYTE*)szPath,
2852 (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2853 {
2854 i++;
2855 }
2856 }
2857 }
2858 } while (SetupFindNextLine(&InfContext, &InfContext));
2859 }
2860
2862
2863 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2864 L"Env",
2865 NULL,
2866 &InfContext))
2867 {
2868 if (RegCreateKeyExW(
2869 HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
2871 {
2872 DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
2873 return;
2874 }
2875 do
2876 {
2877 if (!SetupGetStringFieldW(&InfContext,
2878 0,
2879 szName,
2881 &LineLength))
2882 {
2883 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2884 return;
2885 }
2886
2887 if (!SetupGetStringFieldW(&InfContext,
2888 1,
2889 szValue,
2890 ARRAYSIZE(szValue),
2891 &LineLength))
2892 {
2893 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2894 return;
2895 }
2896 DPRINT1("[ENV] %S=%S\n", szName, szValue);
2897
2898 DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
2899
2900 if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
2901 {
2902 DPRINT1(" - Error %d\n", GetLastError());
2903 }
2904
2905 } while (SetupFindNextLine(&InfContext, &InfContext));
2906
2908 }
2909}
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define KEY_SET_VALUE
Definition: nt_native.h:1017
static const WCHAR szName[]
Definition: powrprof.c:45
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
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 659 of file wizard.c.

660{
661 LPNMHDR lpnm;
662 PSETUPDATA pSetupData;
663 INT iItem;
664 WCHAR szText[64], szDefault[64];
665 HICON hIcon;
666
667 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
668
669 switch (uMsg)
670 {
671 case WM_INITDIALOG:
672 {
673 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
674 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
675
676 LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
677
680 {
681 StringCchCatW(szText, _countof(szText), L" ");
682 StringCchCatW(szText, _countof(szText), szDefault);
683 }
685
688 {
689 StringCchCatW(szText, _countof(szText), L" ");
690 StringCchCatW(szText, _countof(szText), szDefault);
691 }
693
696
699 return TRUE;
700 }
701
702 case WM_COMMAND:
704 {
706 OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
707 }
708 break;
709
710 case WM_NOTIFY:
711 {
712 lpnm = (LPNMHDR)lParam;
713
714 switch (lpnm->code)
715 {
716 case PSN_SETACTIVE:
717 /* Enable the Back and Next buttons */
719 if (pSetupData->UnattendSetup)
720 {
721 OnChooseOption(hwndDlg, pSetupData->ProductOption);
724 return TRUE;
725 }
726 break;
727
728 case PSN_WIZNEXT:
730 pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
732 break;
733
734 case PSN_WIZBACK:
735 pSetupData->UnattendSetup = FALSE;
736 break;
737
738 default:
739 break;
740 }
741 }
742 break;
743
744 default:
745 break;
746 }
747
748 return FALSE;
749}
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:169
#define IDC_PRODUCT_ICON
Definition: resource.h:103
#define IDS_DEFAULT
Definition: resource.h:172
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:104
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:168
static HICON
Definition: imagelist.c:80
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:524
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:636
#define STM_SETICON
Definition: winuser.h:2095
#define CB_SETCURSEL
Definition: winuser.h:1964
#define IDI_WINLOGO
Definition: winuser.h:709
#define CBN_SELCHANGE
Definition: winuser.h:1982
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CB_ADDSTRING
Definition: winuser.h:1939
#define LoadIcon
Definition: winuser.h:5825
#define CB_GETCURSEL
Definition: winuser.h:1946

Referenced by InstallWizard().

◆ RegisterComponents()

static VOID RegisterComponents ( PITEMSDATA  pItemsData)
static

Definition at line 2161 of file wizard.c.

2163{
2164 WCHAR SectionName[512];
2166 LONG Steps = 0;
2169
2170 ZeroMemory(&Notify, sizeof(Notify));
2171
2172 /* Count the 'RegisterDlls' steps */
2173 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2174 L"RegisterDlls", &Context))
2175 {
2176 DPRINT1("No RegistrationPhase2 section found\n");
2177 return;
2178 }
2179
2180 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2181 ARRAYSIZE(SectionName),
2182 NULL))
2183 {
2184 DPRINT1("Unable to retrieve section name\n");
2185 return;
2186 }
2187
2188 Steps += SetupGetLineCountW(hSysSetupInf, SectionName);
2189
2190 /* Count the 'TypeLibratries' steps */
2191 Steps += SetupGetLineCountW(hSysSetupInf, L"TypeLibraries");
2192
2193 /* Start the item */
2194 DPRINT("Register Components: %ld Steps\n", Steps);
2195 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 0, (LPARAM)Steps);
2196
2197 Error = RegisterDlls(pItemsData, &Notify);
2198 if (Error == ERROR_SUCCESS)
2199 RegisterTypeLibraries(pItemsData, &Notify, hSysSetupInf, L"TypeLibraries");
2200
2201 /* End the item */
2202 DPRINT("Register Components: done\n");
2203 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 0, Error);
2204}
#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:1494
HINF hSysSetupInf
Definition: install.c:37
BOOL RegisterTypeLibraries(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:539

Referenced by ItemCompletionThread().

◆ RegisterDlls()

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

Definition at line 2090 of file wizard.c.

2093{
2094 REGISTRATIONDATA RegistrationData;
2095 WCHAR SectionName[512];
2097 LONG DllCount = 0;
2099
2100 ZeroMemory(&RegistrationData, sizeof(REGISTRATIONDATA));
2101 RegistrationData.hwndDlg = pItemsData->hwndDlg;
2102 RegistrationData.Registered = 0;
2103
2104 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2105 L"RegisterDlls", &Context))
2106 {
2107 DPRINT1("No RegistrationPhase2 section found\n");
2108 return GetLastError();
2109 }
2110
2111 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2112 ARRAYSIZE(SectionName),
2113 NULL))
2114 {
2115 DPRINT1("Unable to retrieve section name\n");
2116 return GetLastError();
2117 }
2118
2119 DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2120 DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2121 if (DllCount < 0)
2122 {
2123 return STATUS_NOT_FOUND;
2124 }
2125
2126 RegistrationData.DllCount = (ULONG)DllCount;
2127 RegistrationData.DefaultContext = SetupInitDefaultQueueCallback(RegistrationData.hwndDlg);
2128 RegistrationData.pNotify = pNotify;
2129
2130 _SEH2_TRY
2131 {
2132 if (!SetupInstallFromInfSectionW(GetParent(RegistrationData.hwndDlg),
2134 L"RegistrationPhase2",
2135 SPINST_REGISTRY | SPINST_REGISTERCALLBACKAWARE | SPINST_REGSVR,
2136 0,
2137 NULL,
2138 0,
2140 &RegistrationData,
2141 NULL,
2142 NULL))
2143 {
2144 Error = GetLastError();
2145 }
2146 }
2148 {
2149 DPRINT("Catching exception\n");
2151 }
2152 _SEH2_END;
2153
2155
2156 return Error;
2157}
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
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#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:1994

◆ RegistrationNotificationProc()

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

Definition at line 1994 of file wizard.c.

1998{
1999 PREGISTRATIONDATA RegistrationData;
2002
2003 RegistrationData = (PREGISTRATIONDATA)Context;
2004
2007 {
2008 StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
2009 RegistrationData->pNotify->CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
2010 if (RegistrationData->pNotify->CurrentItem == NULL)
2011 {
2012 RegistrationData->pNotify->CurrentItem = StatusInfo->FileName;
2013 }
2014 else
2015 {
2016 RegistrationData->pNotify->CurrentItem++;
2017 }
2018
2020 {
2021 DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
2022 StatusInfo->FileName);
2023 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2024
2025 DPRINT("RegisterDll: Start step %ld\n", RegistrationData->pNotify->Progress);
2026 SendMessage(RegistrationData->hwndDlg, PM_STEP_START, 0, (LPARAM)RegistrationData->pNotify);
2027 }
2028 else
2029 {
2030 DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
2031 StatusInfo->FileName);
2032 DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
2033 StatusInfo->FailureCode);
2034 if (StatusInfo->FailureCode != SPREG_SUCCESS)
2035 {
2036 switch (StatusInfo->FailureCode)
2037 {
2038 case SPREG_LOADLIBRARY:
2040 break;
2041 case SPREG_GETPROCADDR:
2043 break;
2044 case SPREG_REGSVR:
2046 break;
2047 case SPREG_DLLINSTALL:
2049 break;
2050 case SPREG_TIMEOUT:
2052 break;
2053 default:
2055 break;
2056 }
2057
2058 RegistrationData->pNotify->MessageID = MessageID;
2059 RegistrationData->pNotify->LastError = StatusInfo->Win32Error;
2060 }
2061 else
2062 {
2063 RegistrationData->pNotify->MessageID = 0;
2064 RegistrationData->pNotify->LastError = ERROR_SUCCESS;
2065 }
2066
2067 if (RegistrationData->Registered < RegistrationData->DllCount)
2068 {
2069 RegistrationData->Registered++;
2070 }
2071
2072 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2073 DPRINT("RegisterDll: End step %ld\n", RegistrationData->pNotify->Progress);
2074 SendMessage(RegistrationData->hwndDlg, PM_STEP_END, 0, (LPARAM)RegistrationData->pNotify);
2075 }
2076
2077 return FILEOP_DOIT;
2078 }
2079 else
2080 {
2081 DPRINT1("Received unexpected notification %u\n", Notification);
2082 return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2083 Notification, Param1, Param2);
2084 }
2085}
#define IDS_TIMEOUT
Definition: resource.h:14
#define wcsrchr
Definition: compat.h:16
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:137
#define IDS_REGSVR_FAILED
Definition: resource.h:136
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:134
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:135
#define IDS_REASON_UNKNOWN
Definition: resource.h:139
#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 1494 of file wizard.c.

1497{
1498 LONG lError;
1501 PTIMEZONE_ENTRY Current;
1502 ULONG DescriptionSize;
1503 ULONG StandardNameSize;
1504 ULONG DaylightNameSize;
1505
1507 if (Entry == NULL)
1508 {
1510 }
1511
1512 DescriptionSize = sizeof(Entry->Description);
1513 StandardNameSize = sizeof(Entry->StandardName);
1514 DaylightNameSize = sizeof(Entry->DaylightName);
1515
1516 lError = QueryTimeZoneData(hZoneKey,
1517 &Entry->Index,
1518 &Entry->TimezoneInfo,
1519 Entry->Description,
1520 &DescriptionSize,
1521 Entry->StandardName,
1522 &StandardNameSize,
1523 Entry->DaylightName,
1524 &DaylightNameSize);
1525 if (lError != ERROR_SUCCESS)
1526 {
1528 return lError;
1529 }
1530
1533 {
1534 Entry->Prev = NULL;
1535 Entry->Next = NULL;
1538 }
1539 else
1540 {
1541 Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1542 if (Current != NULL)
1543 {
1544 if (Current == SetupData->TimeZoneListHead)
1545 {
1546 /* Prepend to head */
1547 Entry->Prev = NULL;
1551 }
1552 else
1553 {
1554 /* Insert before current */
1555 Entry->Prev = Current->Prev;
1556 Entry->Next = Current;
1557 Current->Prev->Next = Entry;
1558 Current->Prev = Entry;
1559 }
1560 }
1561 else
1562 {
1563 /* Append to tail */
1565 Entry->Next = NULL;
1568 }
1569 }
1570
1571 return ERROR_SUCCESS;
1572}
#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:1477
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 1310 of file wizard.c.

1311{
1312 MSG msg;
1313 HWND MainWindow = GetParent(hwnd);
1314 STARTUPINFOW StartupInfo;
1315 PROCESS_INFORMATION ProcessInformation;
1316 WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1317
1318 if (!pwszCPLParameters)
1319 {
1320 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1321 return FALSE;
1322 }
1323
1324 ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1325 StartupInfo.cb = sizeof(StartupInfo);
1326 ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1327
1328 ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1329 wcscat(CmdLine, pwszCPLParameters);
1330
1331 if (!CreateProcessW(NULL,
1332 CmdLine,
1333 NULL,
1334 NULL,
1335 FALSE,
1336 0,
1337 NULL,
1338 NULL,
1339 &StartupInfo,
1340 &ProcessInformation))
1341 {
1342 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1343 return FALSE;
1344 }
1345
1346 /* Disable the Back and Next buttons and the main window
1347 * while we're interacting with the control panel applet */
1348 PropSheet_SetWizButtons(MainWindow, 0);
1349 EnableWindow(MainWindow, FALSE);
1350
1352 {
1353 /* We still need to process main window messages to avoid freeze */
1354 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1355 {
1358 }
1359 }
1360 CloseHandle(ProcessInformation.hThread);
1361 CloseHandle(ProcessInformation.hProcess);
1362
1363 /* Enable the Back and Next buttons and the main window again */
1365 EnableWindow(MainWindow, TRUE);
1366
1367 return TRUE;
1368}
#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:4598
static const WCHAR CmdLine[]
Definition: install.c:48
#define INFINITE
Definition: serial.h:102
DWORD cb
Definition: winbase.h:877
#define WAIT_OBJECT_0
Definition: winbase.h:432
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:885
#define QS_ALLINPUT
Definition: winuser.h:906
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:1199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by LocalePageDlgProc(), and ThemePageDlgProc().

◆ RunItemCompletionThread()

static BOOL RunItemCompletionThread ( _In_ HWND  hwndDlg)
static

Definition at line 2242 of file wizard.c.

2244{
2245 HANDLE hCompletionThread;
2246 PITEMSDATA pItemsData;
2247
2248 pItemsData = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEMSDATA));
2249 if (pItemsData == NULL)
2250 return FALSE;
2251
2252 pItemsData->hwndDlg = hwndDlg;
2253
2254 hCompletionThread = CreateThread(NULL,
2255 0,
2257 pItemsData,
2258 0,
2259 NULL);
2260 if (hCompletionThread == NULL)
2261 {
2262 HeapFree(GetProcessHeap(), 0, pItemsData);
2263 }
2264 else
2265 {
2266 CloseHandle(hCompletionThread);
2267 return TRUE;
2268 }
2269
2270 return FALSE;
2271}
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:2210

Referenced by ProcessPageDlgProc().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2452 of file wizard.c.

2453{
2454 HKEY hKey = 0;
2455 DWORD InProgress = 0;
2456 DWORD InstallDate;
2457
2459 L"SYSTEM\\Setup",
2460 0,
2461 KEY_WRITE,
2462 &hKey ) == ERROR_SUCCESS)
2463 {
2464 RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2465 RegCloseKey( hKey );
2466 }
2467
2469 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2470 0,
2471 KEY_WRITE,
2472 &hKey ) == ERROR_SUCCESS)
2473 {
2474 InstallDate = (DWORD)time(NULL);
2475 RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2476 RegCloseKey( hKey );
2477 }
2478}
__u16 time
Definition: mkdosfs.c:8
#define DWORD
Definition: nt_native.h:44

Referenced by FinishDlgProc().

◆ SetKeyboardLayoutName()

static VOID SetKeyboardLayoutName ( HWND  hwnd)
static

Definition at line 1228 of file wizard.c.

1229{
1230 HKL hkl;
1231 BOOL LayoutSpecial = FALSE;
1232 WCHAR LayoutPath[256];
1233 WCHAR LocaleName[32];
1234 WCHAR SpecialId[5] = L"";
1235 WCHAR ResText[256] = L"";
1236 DWORD dwValueSize;
1237 HKEY hKey;
1238 UINT i;
1239
1240 /* Get the default input language and method */
1241 if (!SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, 0, (LPDWORD)&hkl, 0))
1242 {
1244 }
1245
1246 if ((HIWORD(hkl) & 0xF000) == 0xF000)
1247 {
1248 /* Process keyboard layout with special id */
1249 StringCchPrintfW(SpecialId, ARRAYSIZE(SpecialId), L"%04x", (HIWORD(hkl) & 0x0FFF));
1250 LayoutSpecial = TRUE;
1251 }
1252
1253#define MAX_LAYOUTS_PER_LANGID 0x10000
1254 for (i = 0; i < (LayoutSpecial ? MAX_LAYOUTS_PER_LANGID : 1); i++)
1255 {
1256 /* Generate a hexadecimal identifier for keyboard layout registry key */
1258
1259 StringCchCopyW(LayoutPath, ARRAYSIZE(LayoutPath), L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\");
1260 StringCchCatW(LayoutPath, ARRAYSIZE(LayoutPath), LocaleName);
1262
1264 LayoutPath,
1265 0,
1267 &hKey) == ERROR_SUCCESS)
1268 {
1269 /* Make sure the keyboard layout key we opened is the one we need.
1270 * If the layout has no special id, just pass this check. */
1271 dwValueSize = sizeof(LocaleName);
1272 if (!LayoutSpecial ||
1274 L"Layout Id",
1275 NULL,
1276 NULL,
1277 (PVOID)&LocaleName,
1278 &dwValueSize) == ERROR_SUCCESS) &&
1279 (wcscmp(LocaleName, SpecialId) == 0)))
1280 {
1282 dwValueSize = sizeof(LocaleName);
1284 L"Layout Text",
1285 NULL,
1286 NULL,
1287 (PVOID)&LocaleName,
1288 &dwValueSize);
1289 /* Let the loop know where to stop */
1291 }
1293 }
1294 else
1295 {
1296 /* Keyboard layout registry keys are expected to go in order without gaps */
1297 break;
1298 }
1299 }
1300#undef MAX_LAYOUTS_PER_LANGID
1301
1302 LoadStringW(hDllInstance, IDS_LAYOUTTEXT, ResText, ARRAYSIZE(ResText));
1303 StringCchPrintfW(LayoutPath, ARRAYSIZE(LayoutPath), ResText, LocaleName);
1304
1305 SetWindowTextW(hwnd, LayoutPath);
1306}
static _In_ LPCWSTR LocaleName
#define IDS_LAYOUTTEXT
Definition: resource.h:119
unsigned int BOOL
Definition: ntddk_ex.h:94
HKL hkl
Definition: msctf.idl:650
UINT_PTR HKL
Definition: msctf.idl:143
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
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 1633 of file wizard.c.

1634{
1635 TIME_ZONE_INFORMATION TimeZoneInformation;
1637 DWORD dwIndex;
1638 DWORD i;
1639
1640 dwIndex = SendMessage(hwnd,
1642 0,
1643 0);
1644
1645 i = 0;
1647 while (i < dwIndex)
1648 {
1649 if (Entry == NULL)
1650 return;
1651
1652 i++;
1653 Entry = Entry->Next;
1654 }
1655
1656 wcscpy(TimeZoneInformation.StandardName,
1657 Entry->StandardName);
1658 wcscpy(TimeZoneInformation.DaylightName,
1659 Entry->DaylightName);
1660
1661 TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1662 TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1663 TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1664
1665 memcpy(&TimeZoneInformation.StandardDate,
1666 &Entry->TimezoneInfo.StandardDate,
1667 sizeof(SYSTEMTIME));
1668 memcpy(&TimeZoneInformation.DaylightDate,
1669 &Entry->TimezoneInfo.DaylightDate,
1670 sizeof(SYSTEMTIME));
1671
1672 /* Set time zone information */
1673 SetTimeZoneInformation(&TimeZoneInformation);
1674}
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
SYSTEMTIME DaylightDate
Definition: winbase.h:1236
WCHAR DaylightName[32]
Definition: winbase.h:1235
WCHAR StandardName[32]
Definition: winbase.h:1232
SYSTEMTIME StandardDate
Definition: winbase.h:1233

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1707 of file wizard.c.

1708{
1709 BOOL Ret = FALSE;
1710
1711 /*
1712 * Call SetLocalTime twice to ensure correct results
1713 */
1716
1717 return Ret;
1718}
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356

Referenced by WriteDateTimeSettings().

◆ SetUserLocaleName()

static VOID SetUserLocaleName ( HWND  hwnd)
static

Definition at line 1211 of file wizard.c.

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

Referenced by LocalePageDlgProc().

◆ ShowItemError()

static VOID ShowItemError ( HWND  hwndDlg,
DWORD  LastError 
)
static

Definition at line 2275 of file wizard.c.

2278{
2280 WCHAR UnknownError[84];
2281 WCHAR Title[64];
2282
2284 NULL, LastError, 0, ErrorMessage, 0, NULL) == 0)
2285 {
2287 UnknownError,
2288 ARRAYSIZE(UnknownError) - 20) == 0)
2289 {
2290 wcscpy(UnknownError, L"Unknown error");
2291 }
2292 wcscat(UnknownError, L" ");
2293 _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2294 ErrorMessage = UnknownError;
2295 }
2296
2297 if (ErrorMessage != NULL)
2298 {
2300 Title, ARRAYSIZE(Title)) == 0)
2301 {
2302 wcscpy(Title, L"ReactOS Setup");
2303 }
2304
2306 }
2307
2308 if (ErrorMessage != NULL &&
2309 ErrorMessage != UnknownError)
2310 {
2312 }
2313}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
Definition: attrib.c:33
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define IDS_UNKNOWN_ERROR
Definition: resource.h:133
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:449
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:445

Referenced by ProcessPageDlgProc().

◆ ShowStepError()

static VOID ShowStepError ( HWND  hwndDlg,
PREGISTRATIONNOTIFY  RegistrationNotify 
)
static

Definition at line 2318 of file wizard.c.

2321{
2322 WCHAR ErrorMessage[128];
2323 WCHAR Title[64];
2324
2325 if (LoadStringW(hDllInstance, RegistrationNotify->MessageID,
2327 ARRAYSIZE(ErrorMessage)) == 0)
2328 {
2329 ErrorMessage[0] = L'\0';
2330 }
2331
2332 if (RegistrationNotify->MessageID != IDS_TIMEOUT)
2333 {
2335 RegistrationNotify->LastError, 0,
2338 NULL);
2339 }
2340
2341 if (ErrorMessage[0] != L'\0')
2342 {
2344 Title, ARRAYSIZE(Title)) == 0)
2345 {
2346 wcscpy(Title, L"ReactOS Setup");
2347 }
2348
2349 MessageBoxW(hwndDlg, ErrorMessage,
2351 }
2352}

Referenced by ProcessPageDlgProc().

◆ ShowTimeZoneList()

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

Definition at line 1603 of file wizard.c.

1604{
1606 DWORD dwIndex = 0;
1607 DWORD dwCount;
1608
1609 GetTimeZoneListIndex(&dwEntryIndex);
1610
1612 while (Entry != NULL)
1613 {
1614 dwCount = SendMessage(hwnd,
1616 0,
1617 (LPARAM)Entry->Description);
1618
1619 if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1620 dwIndex = dwCount;
1621
1622 Entry = Entry->Next;
1623 }
1624
1627 (WPARAM)dwIndex,
1628 0);
1629}
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20

Referenced by DateTimePageDlgProc().

◆ ThemePageDlgProc()

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

Definition at line 1880 of file wizard.c.

1884{
1886 LPNMLISTVIEW pnmv;
1887
1888 /* Retrieve pointer to the global setup data */
1890
1891 switch (uMsg)
1892 {
1893 case WM_INITDIALOG:
1894 {
1895 HWND hListView;
1897 DWORD n;
1898 LVITEM lvi = {0};
1899
1900 /* Save pointer to the global setup data */
1903
1904 hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1905
1906 /* Common */
1908 lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1909
1910 for (n = 0; n < ARRAYSIZE(Themes); ++n)
1911 {
1912 WCHAR DisplayName[100] = {0};
1913 /* Load the bitmap */
1915 ImageList_AddMasked(himl, image, RGB(255,0,255));
1916
1917 /* Load the string */
1918 LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
1919 DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
1920
1921 /* Add the listview item */
1922 lvi.iItem = n;
1923 lvi.iImage = n;
1924 lvi.pszText = DisplayName;
1925 ListView_InsertItem(hListView, &lvi);
1926 }
1927
1928 /* Register the imagelist */
1930 /* Transparant background */
1931 ListView_SetBkColor(hListView, CLR_NONE);
1933 /* Reduce the size between the items */
1934 ListView_SetIconSpacing(hListView, 190, 173);
1935 break;
1936 }
1937 case WM_NOTIFY:
1938 switch (((LPNMHDR)lParam)->code)
1939 {
1940 //case LVN_ITEMCHANGING:
1941 case LVN_ITEMCHANGED:
1942 pnmv = (LPNMLISTVIEW)lParam;
1943 if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
1944 {
1945 int iTheme = pnmv->iItem;
1946 DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
1947
1948 if (Themes[iTheme].ThemeFile)
1949 {
1950 WCHAR wszParams[1024];
1951 WCHAR wszTheme[MAX_PATH];
1952 WCHAR* format = L"desk.cpl,,2 /Action:ActivateMSTheme /file:\"%s\"";
1953
1954 SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
1955 swprintf(wszParams, format, wszTheme);
1956 RunControlPanelApplet(hwndDlg, wszParams);
1957 }
1958 else
1959 {
1960 RunControlPanelApplet(hwndDlg, L"desk.cpl,,2 /Action:ActivateMSTheme");
1961 }
1962 }
1963 break;
1964 case PSN_SETACTIVE:
1965 /* Enable the Back and Next buttons */
1968 {
1970 return TRUE;
1971 }
1972 break;
1973
1974 case PSN_WIZNEXT:
1975 break;
1976
1977 case PSN_WIZBACK:
1979 break;
1980
1981 default:
1982 break;
1983 }
1984 break;
1985
1986 default:
1987 break;
1988 }
1989
1990 return FALSE;
1991}
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:2654
#define IDC_THEMEPICKER
Definition: resource.h:83
#define RGB(r, g, b)
Definition: precomp.h:71
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:2150
#define CSIDL_RESOURCES
Definition: shlobj.h:2225
Definition: format.c:58
UINT uNewState
Definition: commctrl.h:3041
static struct ThemeInfo Themes[]
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_CREATEDIBSECTION
Definition: winuser.h:1101
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:2289

Referenced by InstallWizard().

◆ UpdateLocalSystemTime()

static VOID UpdateLocalSystemTime ( HWND  hwnd,
SYSTEMTIME  LocalTime 
)
static

Definition at line 1722 of file wizard.c.

1723{
1726}
#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 192 of file wizard.c.

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

◆ WriteComputerSettings()

static BOOL WriteComputerSettings ( WCHAR ComputerName,
HWND  hwndDlg 
)
static

Definition at line 904 of file wizard.c.

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

Referenced by ComputerPageDlgProc().

◆ WriteDateTimeSettings()

static BOOL WriteDateTimeSettings ( HWND  hwndDlg,
PSETUPDATA  SetupData 
)
static

Definition at line 1730 of file wizard.c.

1731{
1732 WCHAR Title[64];
1733 WCHAR ErrorLocalTime[256];
1734
1735 GetLocalSystemTime(hwndDlg, SetupData);
1737 SetupData);
1738
1740 BM_GETCHECK, 0, 0) != BST_UNCHECKED);
1741 if (!SetSystemLocalTime(hwndDlg, SetupData))
1742 {
1744 {
1745 wcscpy(Title, L"ReactOS Setup");
1746 }
1747 if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
1748 ARRAYSIZE(ErrorLocalTime)))
1749 {
1750 wcscpy(ErrorLocalTime, L"Setup was unable to set the local time.");
1751 }
1752 MessageBoxW(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
1753 return FALSE;
1754 }
1755
1756 return TRUE;
1757}
#define IDS_WZD_LOCALTIME
Definition: resource.h:149
static BOOL SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1707
static BOOL GetLocalSystemTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1678
static VOID SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1633
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
#define BST_UNCHECKED
Definition: winuser.h:199
#define MB_ICONWARNING
Definition: winuser.h:789
#define BM_GETCHECK
Definition: winuser.h:1921

Referenced by DateTimePageDlgProc().

◆ WriteDefaultLogonData()

static BOOL WriteDefaultLogonData ( LPWSTR  Domain)
static

Definition at line 975 of file wizard.c.

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

Referenced by ComputerPageDlgProc().

◆ WriteOwnerSettings()

static BOOL WriteOwnerSettings ( WCHAR OwnerName,
WCHAR OwnerOrganization 
)
static

Definition at line 753 of file wizard.c.

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

Referenced by OwnerPageDlgProc().

◆ WriteUserLocale()

static VOID WriteUserLocale ( VOID  )
static

Definition at line 1371 of file wizard.c.

1372{
1373 HKEY hKey;
1374 LCID lcid;
1375 WCHAR Locale[12];
1376
1377 lcid = GetSystemDefaultLCID();
1378
1379 if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, ARRAYSIZE(Locale)) != 0)
1380 {
1381 if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
1384 {
1385 RegSetValueExW(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (wcslen(Locale) + 1) * sizeof(WCHAR));
1387 }
1388 }
1389}
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1230
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
DWORD LCID
Definition: nls.h:13
#define LOCALE_ILANGUAGE
Definition: winnls.h:25

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 404 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 434 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 398 of file wizard.c.

Referenced by DoWriteProductOption(), and OnChooseOption().

◆ s_szControlWindows

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

Definition at line 384 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szDefaultSoundEvents

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

Definition at line 386 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szExplorerSoundEvents

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

Definition at line 387 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szProductOptions

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

Definition at line 382 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szRosVersion

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

Definition at line 383 of file wizard.c.

Referenced by DoWriteProductOption().

◆ s_szWinlogon

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

Definition at line 385 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:162
#define IDB_LUNAR
Definition: resource.h:25
#define IDB_MIZU
Definition: resource.h:26
#define IDS_CLASSIC
Definition: resource.h:161
#define IDS_LUNAR
Definition: resource.h:163
#define IDS_MIZU
Definition: resource.h:164
#define IDB_LAUTUS
Definition: resource.h:24
#define IDB_CLASSIC
Definition: resource.h:23

Referenced by ThemePageDlgProc().