ReactOS  0.4.15-dev-5606-gf34e425
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  _REGISTRATIONNOTIFY
 
struct  _ITEMSDATA
 
struct  _REGISTRATIONDATA
 
struct  _TIMEZONE_ENTRY
 
struct  _PRODUCT_OPTION_DATA
 
struct  ThemeInfo
 

Macros

#define NDEBUG
 
#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)
 
#define PM_ITEM_START   (WM_APP + 2)
 
#define PM_ITEM_END   (WM_APP + 3)
 
#define PM_STEP_START   (WM_APP + 4)
 
#define PM_STEP_END   (WM_APP + 5)
 
#define PM_ITEMS_DONE   (WM_APP + 6)
 
#define MAX_LAYOUTS_PER_LANGID   0x10000
 

Typedefs

typedef struct _REGISTRATIONNOTIFY REGISTRATIONNOTIFY
 
typedef struct _REGISTRATIONNOTIFYPREGISTRATIONNOTIFY
 
typedef struct _ITEMSDATA ITEMSDATA
 
typedef struct _ITEMSDATAPITEMSDATA
 
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 (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.

◆ PM_ITEM_END

#define PM_ITEM_END   (WM_APP + 3)

Definition at line 38 of file wizard.c.

◆ PM_ITEM_START

#define PM_ITEM_START   (WM_APP + 2)

Definition at line 37 of file wizard.c.

◆ PM_ITEMS_DONE

#define PM_ITEMS_DONE   (WM_APP + 6)

Definition at line 41 of file wizard.c.

◆ PM_REGISTRATION_NOTIFY

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)

Definition at line 30 of file wizard.c.

◆ PM_STEP_END

#define PM_STEP_END   (WM_APP + 5)

Definition at line 40 of file wizard.c.

◆ PM_STEP_START

#define PM_STEP_START   (WM_APP + 4)

Definition at line 39 of file wizard.c.

Typedef Documentation

◆ ITEMSDATA

◆ PFNREQUESTWIZARDPAGES

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

Definition at line 3134 of file wizard.c.

◆ PITEMSDATA

◆ PREGISTRATIONDATA

◆ PREGISTRATIONNOTIFY

◆ PRODUCT_OPTION_DATA

◆ PTIMEZONE_ENTRY

◆ REGISTRATIONDATA

◆ REGISTRATIONNOTIFY

◆ TIMEZONE_ENTRY

Function Documentation

◆ AckPageDlgProc()

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

Definition at line 303 of file wizard.c.

307 {
308  LPNMHDR lpnm;
309  PWCHAR Projects;
310  PWCHAR End, CurrentProject;
311  INT ProjectsSize, ProjectsCount;
312  PSETUPDATA pSetupData;
313 
314  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
315 
316  switch (uMsg)
317  {
318  case WM_INITDIALOG:
319  {
320  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
321  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
322 
323  Projects = NULL;
324  ProjectsSize = 256;
325  while (TRUE)
326  {
327  Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
328  if (NULL == Projects)
329  {
330  return FALSE;
331  }
332  ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
333  if (0 == ProjectsCount)
334  {
335  HeapFree(GetProcessHeap(), 0, Projects);
336  return FALSE;
337  }
338  if (ProjectsCount < ProjectsSize - 1)
339  {
340  break;
341  }
342  HeapFree(GetProcessHeap(), 0, Projects);
343  ProjectsSize *= 2;
344  }
345 
346  CurrentProject = Projects;
347  while (*CurrentProject != L'\0')
348  {
349  End = wcschr(CurrentProject, L'\n');
350  if (NULL != End)
351  {
352  *End = L'\0';
353  }
354  (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
355  if (NULL != End)
356  {
357  CurrentProject = End + 1;
358  }
359  else
360  {
361  CurrentProject += wcslen(CurrentProject);
362  }
363  }
364  HeapFree(GetProcessHeap(), 0, Projects);
365  }
366  break;
367 
368  case WM_COMMAND:
370  {
372  SetForegroundWindow(GetParent(hwndDlg));
373  }
374  break;
375 
376  case WM_NOTIFY:
377  {
378  lpnm = (LPNMHDR)lParam;
379 
380  switch (lpnm->code)
381  {
382  case PSN_SETACTIVE:
383  /* Enable the Back and Next buttons */
385  if (pSetupData->UnattendSetup)
386  {
388  return TRUE;
389  }
390  break;
391 
392  case PSN_WIZBACK:
393  pSetupData->UnattendSetup = FALSE;
394  break;
395 
396  default:
397  break;
398  }
399  }
400  break;
401 
402  default:
403  break;
404  }
405 
406  return FALSE;
407 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDC_PROJECTS
Definition: resource.h:42
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDD_PRODUCT
Definition: resource.h:102
#define IDD_GPL
Definition: resource.h:85
#define TRUE
Definition: types.h:120
#define IDC_VIEWGPL
Definition: resource.h:43
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:472
uint16_t * PWCHAR
Definition: typedefs.h:56
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3149
#define DialogBox
Definition: winuser.h:5751
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define BN_CLICKED
Definition: winuser.h:1915
#define IDS_ACKPROJECTS
Definition: resource.h:130
#define DWLP_USER
Definition: winuser.h:866
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:150
#define WM_COMMAND
Definition: winuser.h:1730
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:247
BOOL UnattendSetup
Definition: syssetup.h:46
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:735
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ AddInstallationSource()

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

Definition at line 2911 of file wizard.c.

2914 {
2915  LONG res;
2916  DWORD dwRegType;
2917  DWORD dwPathLength = 0;
2918  DWORD dwNewLength = 0;
2919  LPWSTR Buffer = NULL;
2920  LPWSTR Path;
2921 
2923  hKey,
2924  L"Installation Sources",
2925  NULL,
2926  &dwRegType,
2927  NULL,
2928  &dwPathLength);
2929 
2930  if (res != ERROR_SUCCESS ||
2931  dwRegType != REG_MULTI_SZ ||
2932  dwPathLength == 0 ||
2933  dwPathLength % sizeof(WCHAR) != 0)
2934  {
2935  dwPathLength = 0;
2936  goto set;
2937  }
2938 
2939  /* Reserve space for existing data + new string */
2940  dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
2941  Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
2942  if (!Buffer)
2943  return;
2944 
2945  ZeroMemory(Buffer, dwNewLength);
2946 
2948  hKey,
2949  L"Installation Sources",
2950  NULL,
2951  NULL,
2952  (LPBYTE)Buffer,
2953  &dwPathLength);
2954 
2955  if (res != ERROR_SUCCESS)
2956  {
2958  dwPathLength = 0;
2959  goto set;
2960  }
2961 
2962  /* Sanity check, these should already be zeros */
2963  Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
2964  Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
2965 
2966  for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
2967  {
2968  /* Check if path is already added */
2969  if (PathIsEqual(Path, lpPath))
2970  goto cleanup;
2971  }
2972 
2973  Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
2974 
2975 set:
2976  if (dwPathLength == 0)
2977  {
2978  dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
2979  Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
2980  if (!Buffer)
2981  return;
2982 
2983  Path = Buffer;
2984  }
2985 
2986  StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
2987  Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
2988 
2990  hKey,
2991  L"Installation Sources",
2992  0,
2993  REG_MULTI_SZ,
2994  (LPBYTE)Buffer,
2995  dwNewLength);
2996 
2997 cleanup:
2999 }
#define ERROR_SUCCESS
Definition: deptool.c:10
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define ZeroMemory
Definition: winbase.h:1670
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
Definition: bufpool.h:45
static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, struct ctab_constant *constant, const void **indata, D3DXPARAMETER_TYPE intype, UINT *size, UINT incol, D3DXPARAMETER_CLASS inclass, UINT index, BOOL is_pointer)
Definition: shader.c:1102
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:4900
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL PathIsEqual(IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
Definition: wizard.c:2885
PRTL_UNICODE_STRING_BUFFER Path
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
GLuint res
Definition: glext.h:9613
char * cleanup(char *str)
Definition: wpickclick.c:99
WCHAR * LPWSTR
Definition: xmlstorage.h:184
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by ProcessSetupInf().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 84 of file wizard.c.

85 {
87  RECT rcParent;
88  RECT rcWindow;
89 
91  if (hWndParent == NULL)
93 
94  GetWindowRect(hWndParent, &rcParent);
95  GetWindowRect(hWnd, &rcWindow);
96 
98  HWND_TOP,
99  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
100  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
101  0,
102  0,
103  SWP_NOSIZE);
104 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define HWND_TOP
Definition: winuser.h:1197
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SWP_NOSIZE
Definition: winuser.h:1235
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
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)

Referenced by WelcomeDlgProc().

◆ ComputerPageDlgProc()

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

Definition at line 1067 of file wizard.c.

1071 {
1072  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1073  WCHAR Password1[128];
1074  WCHAR Password2[128];
1075  PWCHAR Password;
1076  WCHAR Title[64];
1077  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
1078  LPNMHDR lpnm;
1079  PSETUPDATA pSetupData;
1080 
1081  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1082 
1084  {
1085  wcscpy(Title, L"ReactOS Setup");
1086  }
1087 
1088  switch (uMsg)
1089  {
1090  case WM_INITDIALOG:
1091  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1092  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
1093 
1094  /* Generate a new pseudo-random computer name */
1095  GenerateComputerName(ComputerName);
1096 
1097  /* Display current computer name */
1098  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
1099 
1100  /* Set text limits */
1104 
1105  /* Set focus to computer name */
1107  if (pSetupData->UnattendSetup)
1108  {
1112  WriteComputerSettings(pSetupData->ComputerName, NULL);
1114  }
1115 
1116  /* Store the administrator account name as the default user name */
1117  WriteDefaultLogonData(pSetupData->ComputerName);
1118  break;
1119 
1120 
1121  case WM_NOTIFY:
1122  {
1123  lpnm = (LPNMHDR)lParam;
1124 
1125  switch (lpnm->code)
1126  {
1127  case PSN_SETACTIVE:
1128  /* Enable the Back and Next buttons */
1130  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
1131  {
1133  return TRUE;
1134  }
1135  break;
1136 
1137  case PSN_WIZNEXT:
1138  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
1139  {
1140  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
1141  ARRAYSIZE(EmptyComputerName)))
1142  {
1143  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1144  }
1145  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1147  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1148  return TRUE;
1149  }
1150 
1151  /* No need to check computer name for invalid characters,
1152  * SetComputerName() will do it for us */
1153 
1154  if (!WriteComputerSettings(ComputerName, hwndDlg))
1155  {
1157  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1158  return TRUE;
1159  }
1160 
1161 #ifdef PASSWORDS_MANDATORY
1162  /* Check if admin passwords have been entered */
1163  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1164  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1165  {
1166  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1167  ARRAYSIZE(EmptyPassword)))
1168  {
1169  wcscpy(EmptyPassword, L"You must enter a password !");
1170  }
1171  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1172  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1173  return TRUE;
1174  }
1175 #else
1176  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1177  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1178 #endif
1179  /* Check if passwords match */
1180  if (wcscmp(Password1, Password2))
1181  {
1182  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1183  ARRAYSIZE(NotMatchPassword)))
1184  {
1185  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1186  }
1187  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1188  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1189  return TRUE;
1190  }
1191 
1192  /* Check password for invalid characters */
1193  Password = (PWCHAR)Password1;
1194  while (*Password)
1195  {
1196  if (!isprint(*Password))
1197  {
1198  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1199  ARRAYSIZE(WrongPassword)))
1200  {
1201  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1202  }
1203  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1204  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1205  return TRUE;
1206  }
1207  Password++;
1208  }
1209 
1210  /* Set admin password */
1211  SetAdministratorPassword(Password1);
1212  break;
1213 
1214  case PSN_WIZBACK:
1215  pSetupData->UnattendSetup = FALSE;
1216  break;
1217 
1218  default:
1219  break;
1220  }
1221  }
1222  break;
1223 
1224  default:
1225  break;
1226  }
1227 
1228  return FALSE;
1229 }
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1609
#define EM_LIMITTEXT
Definition: winuser.h:1990
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:1049
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:997
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define SendDlgItemMessage
Definition: winuser.h:5832
uint16_t * PWCHAR
Definition: typedefs.h:56
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:147
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:145
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
UINT code
Definition: winuser.h:3149
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:44
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define IDC_ADMINPASSWORD2
Definition: resource.h:52
#define WM_SETTEXT
Definition: winuser.h:1607
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetDlgItemText
Definition: winuser.h:5775
static const WCHAR Title[]
Definition: oid.c:1259
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define IDC_COMPUTERNAME
Definition: resource.h:15
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:931
#define IDC_ADMINPASSWORD1
Definition: resource.h:51
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:243
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
WCHAR AdminPassword[128]
Definition: syssetup.h:45
#define PSN_WIZBACK
Definition: prsht.h:120
#define isprint(c)
Definition: acclib.h:73
#define SendMessage
Definition: winuser.h:5833
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:146
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:148
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
#define IDD_THEMEPAGE
Definition: resource.h:82
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ Control_RunDLLW()

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

Definition at line 1050 of file control.c.

1051 {
1052  CPanel panel;
1053 
1054  TRACE("(%p, %p, %s, 0x%08x)\n",
1055  hWnd, hInst, debugstr_w(cmd), nCmdShow);
1056 
1057 #ifndef __REACTOS__
1058  memset(&panel, 0, sizeof(panel));
1059  list_init( &panel.applets );
1060 #endif
1061 
1062  if (!cmd || !*cmd) {
1063  Control_DoWindow(&panel, hWnd, hInst);
1064  } else {
1065  Control_DoLaunch(&panel, hWnd, cmd);
1066  }
1067 }
Definition: ftp_var.h:139
HWND hWnd
Definition: settings.c:17
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:873
struct list applets
Definition: cpanel.h:57
Definition: cpanel.h:56
HINSTANCE hInst
Definition: dxdiag.c:13
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:701
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define memset(x, y, z)
Definition: compat.h:39

Referenced by FinishDlgProc().

◆ CreateBoldFont()

static HFONT CreateBoldFont ( VOID  )
static

Definition at line 129 of file wizard.c.

130 {
131  LOGFONTW tmpFont = {0};
132  HFONT hBoldFont;
133  HDC hDc;
134 
135  /* Grabs the Drawing Context */
136  hDc = GetDC(NULL);
137 
138  tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
139  tmpFont.lfWeight = FW_BOLD;
140  wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
141 
142  hBoldFont = CreateFontIndirectW(&tmpFont);
143 
144  ReleaseDC(NULL, hDc);
145 
146  return hBoldFont;
147 }
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
static HDC
Definition: imagelist.c:92
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define L(x)
Definition: ntvdm.h:50
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define NULL
Definition: types.h:112
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:719
LONG lfWeight
Definition: dimm.idl:63

Referenced by InstallWizard().

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1597 of file wizard.c.

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

Referenced by DateTimePageDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 108 of file wizard.c.

109 {
110  LOGFONTW LogFont = {0};
111  HDC hdc;
112  HFONT hFont;
113 
114  LogFont.lfWeight = FW_BOLD;
115  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
116 
117  hdc = GetDC(NULL);
118  LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
119 
120  hFont = CreateFontIndirectW(&LogFont);
121 
122  ReleaseDC(NULL, hdc);
123 
124  return hFont;
125 }
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
static HDC
Definition: imagelist.c:92
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
HFONT hFont
Definition: main.c:53
#define L(x)
Definition: ntvdm.h:50
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define NULL
Definition: types.h:112
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:719
LONG lfWeight
Definition: dimm.idl:63

Referenced by InstallWizard().

◆ DateTimePageDlgProc()

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

Definition at line 1783 of file wizard.c.

1787 {
1789 
1790  /* Retrieve pointer to the global setup data */
1792 
1793  switch (uMsg)
1794  {
1795  case WM_INITDIALOG:
1796  {
1797  /* Save pointer to the global setup data */
1800 
1802 
1803  if (SetupData->UnattendSetup)
1804  {
1807 
1809  {
1811  }
1812  }
1813  else
1814  {
1816  SetupData, -1);
1817 
1819  }
1820  break;
1821  }
1822 
1823  case WM_TIMER:
1824  {
1825  SYSTEMTIME LocalTime;
1826 
1827  GetLocalTime(&LocalTime);
1828  UpdateLocalSystemTime(hwndDlg, LocalTime);
1829 
1830  // Reset timeout.
1831  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1832  break;
1833  }
1834 
1835  case WM_NOTIFY:
1836  switch (((LPNMHDR)lParam)->code)
1837  {
1838  case PSN_SETACTIVE:
1839  {
1840  SYSTEMTIME LocalTime;
1841 
1842  GetLocalTime(&LocalTime);
1843  UpdateLocalSystemTime(hwndDlg, LocalTime);
1844 
1845  /* Enable the Back and Next buttons */
1847 
1849  {
1851  return TRUE;
1852  }
1853 
1854  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1855  break;
1856  }
1857 
1858  case PSN_KILLACTIVE:
1859  case DTN_DATETIMECHANGE:
1860  // NB: Not re-set until changing page (PSN_SETACTIVE).
1861  KillTimer(hwndDlg, 1);
1862  break;
1863 
1864  case PSN_WIZNEXT:
1865  WriteDateTimeSettings(hwndDlg, SetupData);
1866  break;
1867 
1868  case PSN_WIZBACK:
1870  break;
1871 
1872  default:
1873  break;
1874  }
1875  break;
1876 
1877  case WM_DESTROY:
1879  break;
1880 
1881  default:
1882  break;
1883  }
1884 
1885  return FALSE;
1886 }
#define TRUE
Definition: types.h:120
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define PSWIZB_NEXT
Definition: prsht.h:154
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5832
#define PSN_SETACTIVE
Definition: prsht.h:115
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1597
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define FALSE
Definition: types.h:117
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1752
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1603
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1744
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1599
#define BM_SETCHECK
Definition: winuser.h:1911
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define WM_TIMER
Definition: winuser.h:1732
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
SETUPDATA SetupData
Definition: reactos.c:41
WORD wMilliseconds
Definition: winbase.h:912
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
Definition: inflate.c:139
uint32_t DWORD_PTR
Definition: typedefs.h:65
DWORD TimeZoneIndex
Definition: syssetup.h:52
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
#define BST_CHECKED
Definition: winuser.h:197
#define PSN_WIZBACK
Definition: prsht.h:120
BOOL UnattendSetup
Definition: syssetup.h:46
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1625
#define GetWindowLongPtr
Definition: treelist.c:73
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4366
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1603 of file wizard.c.

1604 {
1606 
1607  while (SetupData->TimeZoneListHead != NULL)
1608  {
1610 
1611  SetupData->TimeZoneListHead = Entry->Next;
1613  {
1614  SetupData->TimeZoneListHead->Prev = NULL;
1615  }
1616 
1617  HeapFree(GetProcessHeap(), 0, Entry);
1618  }
1619 
1621 }
struct _Entry Entry
Definition: kefuncs.h:629
Definition: timezone.c:15
#define GetProcessHeap()
Definition: compat.h:736
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
#define NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define HeapFree(x, y, z)
Definition: compat.h:735
base of all file and directory entries
Definition: entries.h:82

Referenced by DateTimePageDlgProc().

◆ DoWriteProductOption()

static BOOL DoWriteProductOption ( PRODUCT_OPTION  nOption)
static

Definition at line 551 of file wizard.c.

552 {
553  HKEY hKey;
554  LONG error;
555  LPCWSTR pszData;
556  DWORD dwValue, cbData;
557  const PRODUCT_OPTION_DATA *pData = &s_ProductOptionData[nOption];
558  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
559 
560  /* open ProductOptions key */
562  if (error)
563  {
564  DPRINT1("RegOpenKeyExW failed\n");
565  goto Error;
566  }
567 
568  /* write ProductSuite */
569  pszData = pData->ProductSuite;
570  cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
571  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
572  if (error)
573  {
574  DPRINT1("RegSetValueExW failed\n");
575  goto Error;
576  }
577 
578  /* write ProductType */
579  pszData = pData->ProductType;
580  cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
581  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
582  if (error)
583  {
584  DPRINT1("RegSetValueExW failed\n");
585  goto Error;
586  }
587 
588  RegCloseKey(hKey);
589 
590  /* open ReactOS version key */
592  if (error)
593  {
594  DPRINT1("RegOpenKeyExW failed\n");
595  goto Error;
596  }
597 
598  /* write ReportAsWorkstation */
599  dwValue = pData->ReportAsWorkstation;
600  cbData = sizeof(dwValue);
601  error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
602  if (error)
603  {
604  DPRINT1("RegSetValueExW failed\n");
605  goto Error;
606  }
607 
608  RegCloseKey(hKey);
609 
610  /* open Control Windows key */
612  if (error)
613  {
614  DPRINT1("RegOpenKeyExW failed\n");
615  goto Error;
616  }
617 
618  /* write Control Windows CSDVersion */
619  dwValue = pData->CSDVersion;
620  cbData = sizeof(dwValue);
621  error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
622  if (error)
623  {
624  DPRINT1("RegSetValueExW failed\n");
625  goto Error;
626  }
627 
628  RegCloseKey(hKey);
629 
630  /* open Winlogon key */
632  if (error)
633  {
634  DPRINT1("RegOpenKeyExW failed\n");
635  goto Error;
636  }
637 
638  /* write LogonType */
639  dwValue = pData->LogonType;
640  cbData = sizeof(dwValue);
641  error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
642  if (error)
643  {
644  DPRINT1("RegSetValueExW failed\n");
645  goto Error;
646  }
647 
648  if (nOption == PRODUCT_OPTION_WORKSTATION)
649  {
650  /* Write system sound events values for Workstation */
653  }
654 
655 Error:
656  if (hKey)
657  RegCloseKey(hKey);
658 
659  return error == ERROR_SUCCESS;
660 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:425
#define lstrlenW
Definition: compat.h:750
static const WCHAR s_szExplorerSoundEvents[]
Definition: wizard.c:414
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static const WCHAR s_szRosVersion[]
Definition: wizard.c:410
static BOOL DoWriteSoundEvents(HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
Definition: wizard.c:468
#define KEY_WRITE
Definition: nt_native.h:1031
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:4900
#define ASSERT(a)
Definition: mode.c:44
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
static const WCHAR * s_DefaultSoundEvents[][2]
Definition: wizard.c:431
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
static const WCHAR s_szDefaultSoundEvents[]
Definition: wizard.c:413
unsigned char BYTE
Definition: xxhash.c:193
static const WCHAR s_szControlWindows[]
Definition: wizard.c:411
FxAutoRegKey hKey
#define DPRINT1
Definition: precomp.h:8
static const WCHAR s_szWinlogon[]
Definition: wizard.c:412
static const WCHAR * s_ExplorerSoundEvents[][2]
Definition: wizard.c:461
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define REG_DWORD
Definition: sdbapi.c:596
#define RegCloseKey(hKey)
Definition: registry.h:47
static const WCHAR s_szProductOptions[]
Definition: wizard.c:409
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by ProductPageDlgProc().

◆ DoWriteSoundEvents()

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

Definition at line 468 of file wizard.c.

472 {
473  HKEY hRootKey, hEventKey, hDefaultKey;
474  LONG error;
475  ULONG i;
476  WCHAR szDest[MAX_PATH];
477  DWORD dwAttribs;
478  DWORD cbData;
479 
480  /* Open the sound events key */
481  error = RegOpenKeyExW(hKey, lpSubkey, 0, KEY_READ, &hRootKey);
482  if (error)
483  {
484  DPRINT1("RegOpenKeyExW failed\n");
485  goto Error;
486  }
487 
488  /* Set each sound event */
489  for (i = 0; i < dwSize; i++)
490  {
491  /*
492  * Verify that the sound file exists and is an actual file.
493  */
494 
495  /* Expand the sound file path */
496  if (!ExpandEnvironmentStringsW(lpEventsArray[i][1], szDest, _countof(szDest)))
497  {
498  /* Failed to expand, continue with the next sound event */
499  continue;
500  }
501 
502  /* Check if the sound file exists and isn't a directory */
503  dwAttribs = GetFileAttributesW(szDest);
504  if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
505  (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
506  {
507  /* It does not, just continue with the next sound event */
508  continue;
509  }
510 
511  /*
512  * Create the sound event entry.
513  */
514 
515  /* Open the sound event subkey */
516  error = RegOpenKeyExW(hRootKey, lpEventsArray[i][0], 0, KEY_READ, &hEventKey);
517  if (error)
518  {
519  /* Failed to open, continue with next sound event */
520  continue;
521  }
522 
523  /* Open .Default subkey */
524  error = RegOpenKeyExW(hEventKey, L".Default", 0, KEY_WRITE, &hDefaultKey);
525  RegCloseKey(hEventKey);
526  if (error)
527  {
528  /* Failed to open, continue with next sound event */
529  continue;
530  }
531 
532  /* Associate the sound file to this sound event */
533  cbData = (lstrlenW(lpEventsArray[i][1]) + 1) * sizeof(WCHAR);
534  error = RegSetValueExW(hDefaultKey, NULL, 0, REG_EXPAND_SZ, (const BYTE *)lpEventsArray[i][1], cbData);
535  RegCloseKey(hDefaultKey);
536  if (error)
537  {
538  /* Failed to set the value, continue with next sound event */
539  continue;
540  }
541  }
542 
543 Error:
544  if (hRootKey)
545  RegCloseKey(hRootKey);
546 
547  return error == ERROR_SUCCESS;
548 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
#define lstrlenW
Definition: compat.h:750
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define KEY_WRITE
Definition: nt_native.h:1031
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:4900
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
unsigned char BYTE
Definition: xxhash.c:193
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
FxAutoRegKey hKey
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define NULL
Definition: types.h:112
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define RegCloseKey(hKey)
Definition: registry.h:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by DoWriteProductOption().

◆ FinishDlgProc()

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

Definition at line 2454 of file wizard.c.

2458 {
2459 
2460  switch (uMsg)
2461  {
2462  case WM_INITDIALOG:
2463  {
2464  /* Get pointer to the global setup data */
2466 
2468  {
2469  /* Run the Wine Gecko prompt */
2470  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2471  }
2472 
2473  /* Set title font */
2474  SendDlgItemMessage(hwndDlg,
2476  WM_SETFONT,
2478  (LPARAM)TRUE);
2479  if (SetupData->UnattendSetup)
2480  {
2481  KillTimer(hwndDlg, 1);
2483  PostQuitMessage(0);
2484  }
2485  }
2486  break;
2487 
2488  case WM_DESTROY:
2489  {
2491  PostQuitMessage(0);
2492  return TRUE;
2493  }
2494 
2495  case WM_TIMER:
2496  {
2497  INT Position;
2498  HWND hWndProgress;
2499 
2500  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2501  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2502  if (Position == 300)
2503  {
2504  KillTimer(hwndDlg, 1);
2506  }
2507  else
2508  {
2509  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2510  }
2511  }
2512  return TRUE;
2513 
2514  case WM_NOTIFY:
2515  {
2516  LPNMHDR lpnm = (LPNMHDR)lParam;
2517 
2518  switch (lpnm->code)
2519  {
2520  case PSN_SETACTIVE:
2521  /* Enable the correct buttons on for the active page */
2523 
2525  MAKELPARAM(0, 300));
2527  SetTimer(hwndDlg, 1, 50, NULL);
2528  break;
2529 
2530  case PSN_WIZFINISH:
2531  DestroyWindow(GetParent(hwndDlg));
2532  break;
2533 
2534  default:
2535  break;
2536  }
2537  }
2538  break;
2539 
2540  default:
2541  break;
2542  }
2543 
2544  return FALSE;
2545 }
#define TRUE
Definition: types.h:120
static COORD Position
Definition: mouse.c:34
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define PBM_SETPOS
Definition: commctrl.h:2184
UINT_PTR WPARAM
Definition: windef.h:207
#define PSBTN_FINISH
Definition: prsht.h:148
#define SendDlgItemMessage
Definition: winuser.h:5832
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PSN_SETACTIVE
Definition: prsht.h:115
int32_t INT
Definition: typedefs.h:58
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3149
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
#define LPPROPSHEETPAGE
Definition: prsht.h:390
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_RESTART_PROGRESS
Definition: resource.h:61
#define SW_SHOW
Definition: winuser.h:769
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
BOOL DisableGeckoInst
Definition: syssetup.h:47
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1599
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2425
#define WM_TIMER
Definition: winuser.h:1732
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1050
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1640
#define SendMessage
Definition: winuser.h:5833
BOOL UnattendSetup
Definition: syssetup.h:46
HFONT hTitleFont
Definition: reactos.h:117
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define PBM_GETPOS
Definition: commctrl.h:2194
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 1049 of file wizard.c.

1050 {
1051  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1052  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
1053  unsigned i;
1054 
1055  wcscpy(lpBuffer, L"REACTOS-");
1056 
1057  srand(GetTickCount());
1058 
1059  /* fill in 7 characters */
1060  for (i = 8; i < 15; i++)
1061  lpBuffer[i] = Chars[rand() % cChars];
1062 
1063  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
1064 }
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
void __cdecl srand(_In_ unsigned int _Seed)
#define L(x)
Definition: ntvdm.h:50
#define UNICODE_NULL
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
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

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

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

Definition at line 2553 of file wizard.c.

2557 {
2558  WCHAR wszDrives[512];
2559  WCHAR wszNTPath[512]; // MAX_PATH ?
2560  DWORD cchDrives;
2561  PWCHAR pwszDrive;
2562 
2563  *pwszPath = UNICODE_NULL;
2564 
2565  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2566  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2567  {
2568  /* Buffer too small or failure */
2569  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2570  return FALSE;
2571  }
2572 
2573  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2574  {
2575  WCHAR wszBuf[MAX_PATH];
2576 
2577  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2578  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2579  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2580  pwszDrive[2] = L'\\'; // Restore the backslash
2581 
2582  wcscat(wszNTPath, L"\\"); // Concat a backslash
2583 
2584  /* Logging */
2585  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2586  pwszDrive, wszNTPath,
2587  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2588  LogItem(NULL, wszBuf);
2589 
2590  /* Check whether the NT path corresponds to the NT installation source path */
2591  if (!_wcsicmp(wszNTPath, pwszNTPath))
2592  {
2593  /* Found it! */
2594  wcscpy(pwszPath, pwszDrive); // cchPathMax
2595 
2596  /* Logging */
2597  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2598  LogItem(NULL, wszBuf);
2599  wcscat(wszBuf, L"\n");
2600  OutputDebugStringW(wszBuf);
2601 
2602  return TRUE;
2603  }
2604  }
2605 
2606  return FALSE;
2607 }
#define TRUE
Definition: types.h:120
uint16_t * PWCHAR
Definition: typedefs.h:56
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define L(x)
Definition: ntvdm.h:50
#define DRIVE_CDROM
Definition: machpc98.h:115
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define wsprintf
Definition: winuser.h:5855
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1499 of file wizard.c.

1500 {
1502 
1504  while (Entry != NULL)
1505  {
1506  if (Entry->Index >= Index)
1507  return Entry;
1508 
1509  Entry = Entry->Next;
1510  }
1511 
1512  return NULL;
1513 }
struct _Entry Entry
Definition: kefuncs.h:629
Definition: timezone.c:15
_In_ WDFCOLLECTION _In_ ULONG Index
SETUPDATA SetupData
Definition: reactos.c:41
#define NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
base of all file and directory entries
Definition: entries.h:82

Referenced by RetrieveTimeZone().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1700 of file wizard.c.

1701 {
1702  SYSTEMTIME Date;
1703  SYSTEMTIME Time;
1704 
1706  {
1707  return FALSE;
1708  }
1709 
1711  {
1712  return FALSE;
1713  }
1714 
1715  SetupData->SystemTime.wYear = Date.wYear;
1718  SetupData->SystemTime.wDay = Date.wDay;
1719  SetupData->SystemTime.wHour = Time.wHour;
1720  SetupData->SystemTime.wMinute = Time.wMinute;
1721  SetupData->SystemTime.wSecond = Time.wSecond;
1722  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1723 
1724  return TRUE;
1725 }
WORD wMonth
Definition: winbase.h:906
#define TRUE
Definition: types.h:120
WORD wDayOfWeek
Definition: winbase.h:907
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:905
#define FALSE
Definition: types.h:117
WORD wMinute
Definition: winbase.h:910
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:911
WORD wMilliseconds
Definition: winbase.h:912
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4330
WORD wDay
Definition: winbase.h:908
#define GDT_VALID
Definition: commctrl.h:4460
#define IDC_DATEPICKER
Definition: resource.h:61
WORD wHour
Definition: winbase.h:909
SYSTEMTIME SystemTime
Definition: syssetup.h:49
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by WriteDateTimeSettings().

◆ GplDlgProc()

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

Definition at line 150 of file wizard.c.

154 {
155  HRSRC GplTextResource;
156  HGLOBAL GplTextMem;
157  PVOID GplTextLocked;
158  PCHAR GplText;
159  DWORD Size;
160 
161 
162  switch (uMsg)
163  {
164  case WM_INITDIALOG:
165  GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
166  if (NULL == GplTextResource)
167  {
168  break;
169  }
170  Size = SizeofResource(hDllInstance, GplTextResource);
171  if (0 == Size)
172  {
173  break;
174  }
175  GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
176  if (NULL == GplText)
177  {
178  break;
179  }
180  GplTextMem = LoadResource(hDllInstance, GplTextResource);
181  if (NULL == GplTextMem)
182  {
183  HeapFree(GetProcessHeap(), 0, GplText);
184  break;
185  }
186  GplTextLocked = LockResource(GplTextMem);
187  if (NULL == GplTextLocked)
188  {
189  HeapFree(GetProcessHeap(), 0, GplText);
190  break;
191  }
192  memcpy(GplText, GplTextLocked, Size);
193  GplText[Size] = '\0';
194  SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
195  HeapFree(GetProcessHeap(), 0, GplText);
196  SetFocus(GetDlgItem(hwndDlg, IDOK));
197  return FALSE;
198 
199  case WM_CLOSE:
200  EndDialog(hwndDlg, IDCANCEL);
201  break;
202 
203  case WM_COMMAND:
204  if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
205  {
206  EndDialog(hwndDlg, IDOK);
207  }
208  break;
209 
210  default:
211  break;
212  }
213 
214  return FALSE;
215 }
signed char * PCHAR
Definition: retypes.h:7
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_GPL_TEXT
Definition: resource.h:86
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HWND WINAPI SetFocus(_In_opt_ HWND)
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SETTEXT
Definition: winuser.h:1607
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_CLOSE
Definition: winuser.h:1611
#define BN_CLICKED
Definition: winuser.h:1915
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WM_COMMAND
Definition: winuser.h:1730
#define IDR_GPL
Definition: resource.h:174
#define NULL
Definition: types.h:112
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define HIWORD(l)
Definition: typedefs.h:247
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1729
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 3137 of file wizard.c.

3138 {
3139  PROPSHEETHEADER psh = {0};
3140  HPROPSHEETPAGE *phpage = NULL;
3141  PROPSHEETPAGE psp = {0};
3142  UINT nPages = 0;
3143  HWND hWnd;
3144  MSG msg;
3145  PSETUPDATA pSetupData = NULL;
3146  HMODULE hNetShell = NULL;
3148  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3149 
3150  LogItem(L"BEGIN_SECTION", L"InstallWizard");
3151 
3152  /* Allocate setup data */
3153  pSetupData = HeapAlloc(GetProcessHeap(),
3155  sizeof(SETUPDATA));
3156  if (pSetupData == NULL)
3157  {
3158  LogItem(NULL, L"SetupData allocation failed!");
3159  MessageBoxW(NULL,
3160  L"Setup failed to allocate global data!",
3161  L"ReactOS Setup",
3162  MB_ICONERROR | MB_OK);
3163  goto done;
3164  }
3165  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
3166 
3167  hNetShell = LoadLibraryW(L"netshell.dll");
3168  if (hNetShell != NULL)
3169  {
3170  DPRINT("Netshell.dll loaded!\n");
3171 
3172  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3173  "NetSetupRequestWizardPages");
3174  if (pfn != NULL)
3175  {
3176  pfn(&dwNetworkPageCount, NULL, NULL);
3177  dwPageCount += dwNetworkPageCount;
3178  }
3179  }
3180 
3181  DPRINT("PageCount: %lu\n", dwPageCount);
3182 
3183  phpage = HeapAlloc(GetProcessHeap(),
3185  dwPageCount * sizeof(HPROPSHEETPAGE));
3186  if (phpage == NULL)
3187  {
3188  LogItem(NULL, L"Page array allocation failed!");
3189  MessageBoxW(NULL,
3190  L"Setup failed to allocate page array!",
3191  L"ReactOS Setup",
3192  MB_ICONERROR | MB_OK);
3193  goto done;
3194  }
3195 
3196  /* Process the $winnt$.inf setup file */
3197  ProcessSetupInf(pSetupData);
3198 
3199  /* Create the Welcome page */
3200  psp.dwSize = sizeof(PROPSHEETPAGE);
3201  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3202  psp.hInstance = hDllInstance;
3203  psp.lParam = (LPARAM)pSetupData;
3204  psp.pfnDlgProc = WelcomeDlgProc;
3205  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3206  phpage[nPages++] = CreatePropertySheetPage(&psp);
3207 
3208  /* Create the Acknowledgements page */
3209  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3210  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3211  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3212  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3213  psp.pfnDlgProc = AckPageDlgProc;
3214  phpage[nPages++] = CreatePropertySheetPage(&psp);
3215 
3216  /* Create the Product page */
3217  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3218  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
3219  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
3220  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
3221  psp.pfnDlgProc = ProductPageDlgProc;
3222  phpage[nPages++] = CreatePropertySheetPage(&psp);
3223 
3224  /* Create the Locale page */
3225  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3226  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3227  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3228  psp.pfnDlgProc = LocalePageDlgProc;
3229  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3230  phpage[nPages++] = CreatePropertySheetPage(&psp);
3231 
3232  /* Create the Owner page */
3233  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3234  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3235  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3236  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3237  psp.pfnDlgProc = OwnerPageDlgProc;
3238  phpage[nPages++] = CreatePropertySheetPage(&psp);
3239 
3240  /* Create the Computer page */
3241  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3242  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3243  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3244  psp.pfnDlgProc = ComputerPageDlgProc;
3245  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3246  phpage[nPages++] = CreatePropertySheetPage(&psp);
3247 
3248  /* Create the DateTime page */
3249  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3250  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3251  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3252  psp.pfnDlgProc = DateTimePageDlgProc;
3253  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3254  phpage[nPages++] = CreatePropertySheetPage(&psp);
3255 
3256  /* Create the theme selection page */
3257  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3258  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3259  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3260  psp.pfnDlgProc = ThemePageDlgProc;
3261  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3262  phpage[nPages++] = CreatePropertySheetPage(&psp);
3263 
3266 
3267  if (pfn)
3268  {
3269  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3270  nPages += dwNetworkPageCount;
3271  }
3272 
3273  /* Create the Process page */
3274  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3275  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3276  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3277  psp.pfnDlgProc = ProcessPageDlgProc;
3278  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3279  phpage[nPages++] = CreatePropertySheetPage(&psp);
3280 
3281  /* Create the Finish page */
3282  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3283  psp.pfnDlgProc = FinishDlgProc;
3284  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3285  phpage[nPages++] = CreatePropertySheetPage(&psp);
3286 
3287  ASSERT(nPages == dwPageCount);
3288 
3289  /* Create the property sheet */
3290  psh.dwSize = sizeof(PROPSHEETHEADER);
3291  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3292  psh.hInstance = hDllInstance;
3293  psh.hwndParent = NULL;
3294  psh.nPages = nPages;
3295  psh.nStartPage = 0;
3296  psh.phpage = phpage;
3297  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3298  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3299 
3300  /* Create title font */
3301  pSetupData->hTitleFont = CreateTitleFont();
3302  pSetupData->hBoldFont = CreateBoldFont();
3303 
3304  /* Display the wizard */
3305  hWnd = (HWND)PropertySheet(&psh);
3307 
3308  while (GetMessage(&msg, NULL, 0, 0))
3309  {
3310  if (!IsDialogMessage(hWnd, &msg))
3311  {
3313  DispatchMessage(&msg);
3314  }
3315  }
3316 
3317  DeleteObject(pSetupData->hBoldFont);
3318  DeleteObject(pSetupData->hTitleFont);
3319 
3320  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3321  SetupCloseInfFile(pSetupData->hSetupInf);
3322 
3323 done:
3324  if (phpage != NULL)
3325  HeapFree(GetProcessHeap(), 0, phpage);
3326 
3327  if (hNetShell != NULL)
3328  FreeLibrary(hNetShell);
3329 
3330  if (pSetupData != NULL)
3331  HeapFree(GetProcessHeap(), 0, pSetupData);
3332 
3333  LogItem(L"END_SECTION", L"InstallWizard");
3334 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2331
#define DispatchMessage
Definition: winuser.h:5755
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:111
#define IDD_PRODUCT
Definition: resource.h:102
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:219
#define IDS_ACKSUBTITLE
Definition: resource.h:108
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:108
#define IDD_COMPUTERPAGE
Definition: resource.h:49
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1414
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:303
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:128
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3002
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1067
HANDLE HWND
Definition: compat.h:19
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1902
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:122
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define IsDialogMessage
Definition: winuser.h:5799
#define IDB_HEADER
Definition: resource.h:30
#define IDD_OWNERPAGE
Definition: resource.h:45
HINF hSetupInf
Definition: syssetup.h:56
#define IDD_PROCESSPAGE
Definition: resource.h:54
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3134
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:127
#define IDS_COMPUTERTITLE
Definition: resource.h:113
#define IDS_DATETIMETITLE
Definition: resource.h:121
#define IDS_ACKTITLE
Definition: resource.h:107
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define L(x)
Definition: ntvdm.h:50
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:167
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1783
#define LoadLibraryW(x)
Definition: compat.h:747
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:129
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
static HINSTANCE hDllInstance
Definition: clb.c:30
#define PSP_DEFAULT
Definition: prsht.h:22
#define IDD_ACKPAGE
Definition: resource.h:41
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:822
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
#define FreeLibrary(x)
Definition: compat.h:748
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ASSERT(a)
Definition: mode.c:44
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define MB_ICONERROR
Definition: winuser.h:781
#define IDD_FINISHPAGE
Definition: resource.h:34
static INT_PTR CALLBACK FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2454
#define IDS_PRODUCTTITLE
Definition: resource.h:166
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:686
HFONT hBoldFont
Definition: syssetup.h:37
#define IDS_OWNERTITLE
Definition: resource.h:110
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define GetMessage
Definition: winuser.h:5780
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:114
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:753
HFONT hTitleFont
Definition: reactos.h:117
#define DPRINT
Definition: sndvol32.h:71
#define IDS_LOCALESUBTITLE
Definition: resource.h:117
#define IDS_LOCALETITLE
Definition: resource.h:116
#define HeapFree(x, y, z)
Definition: compat.h:735
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:82
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by InstallReactOS().

◆ ItemCompletionThread()

static DWORD CALLBACK ItemCompletionThread ( LPVOID  Parameter)
static

Definition at line 2187 of file wizard.c.

2189 {
2190  PITEMSDATA pItemsData;
2191  HWND hwndDlg;
2192 
2193  pItemsData = (PITEMSDATA)Parameter;
2194  hwndDlg = pItemsData->hwndDlg;
2195 
2196  RegisterDlls(pItemsData);
2197 
2198  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
2199 
2200  /* FIXME: Add completion steps here! */
2201 
2202  // FIXME: Move this call to a separate cleanup page!
2204 
2205  /* Free the items data */
2206  HeapFree(GetProcessHeap(), 0, pItemsData);
2207 
2208  /* Tell the wizard page that we are done */
2209  PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2210 
2211  return 0;
2212 }
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:438
_In_ PVOID Parameter
Definition: ldrtypes.h:241
#define L(x)
Definition: ntvdm.h:50
#define PM_ITEMS_DONE
Definition: wizard.c:41
#define PostMessage
Definition: winuser.h:5822
#define GetProcessHeap()
Definition: compat.h:736
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
HWND hwndDlg
Definition: wizard.c:55
struct _ITEMSDATA * PITEMSDATA
static DWORD RegisterDlls(PITEMSDATA pItemsData)
Definition: wizard.c:2111
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by RunItemCompletionThread().

◆ LocalePageDlgProc()

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

Definition at line 1414 of file wizard.c.

1418 {
1420 
1421  /* Retrieve pointer to the global setup data */
1423 
1424  switch (uMsg)
1425  {
1426  case WM_INITDIALOG:
1427  {
1428  /* Save pointer to the global setup data */
1431  WriteUserLocale();
1432 
1435  }
1436  break;
1437 
1438  case WM_COMMAND:
1439  if (HIWORD(wParam) == BN_CLICKED)
1440  {
1441  switch (LOWORD(wParam))
1442  {
1443  case IDC_CUSTOMLOCALE:
1444  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1446  break;
1447 
1448  case IDC_CUSTOMLAYOUT:
1449  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1451  break;
1452  }
1453  }
1454  break;
1455 
1456  case WM_NOTIFY:
1457  {
1458  LPNMHDR lpnm = (LPNMHDR)lParam;
1459 
1460  switch (lpnm->code)
1461  {
1462  case PSN_SETACTIVE:
1463  /* Enable the Back and Next buttons */
1465  if (SetupData->UnattendSetup)
1466  {
1467  // if (!*SetupData->SourcePath)
1468  {
1469  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1470  }
1471 
1473  return TRUE;
1474  }
1475  break;
1476 
1477  case PSN_WIZNEXT:
1478  break;
1479 
1480  case PSN_WIZBACK:
1482  break;
1483 
1484  default:
1485  break;
1486  }
1487  }
1488  break;
1489 
1490  default:
1491  break;
1492  }
1493 
1494  return FALSE;
1495 }
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1393
#define IDC_LOCALETEXT
Definition: resource.h:55
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDD_OWNERPAGE
Definition: resource.h:45
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3149
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1332
#define IDC_CUSTOMLOCALE
Definition: resource.h:56
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define BN_CLICKED
Definition: winuser.h:1915
SETUPDATA SetupData
Definition: reactos.c:41
#define WM_COMMAND
Definition: winuser.h:1730
uint32_t DWORD_PTR
Definition: typedefs.h:65
static VOID SetUserLocaleName(HWND hwnd)
Definition: wizard.c:1233
HWND WINAPI GetParent(_In_ HWND)
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1250
#define IDC_CUSTOMLAYOUT
Definition: resource.h:58
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:247
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_LAYOUTTEXT
Definition: resource.h:57
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ OnChooseOption()

static void OnChooseOption ( HWND  hwndDlg,
PRODUCT_OPTION  nOption 
)
static

Definition at line 663 of file wizard.c.

664 {
665  WCHAR szText[256];
666  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
667 
668  switch (nOption)
669  {
672  break;
673 
676  break;
677 
678  default:
679  return;
680  }
681 
682  SetDlgItemTextW(hwndDlg, IDC_PRODUCT_DESCRIPTION, szText);
683 }
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:171
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:425
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:170
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
static HINSTANCE hDllInstance
Definition: clb.c:30
#define ASSERT(a)
Definition: mode.c:44
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:105

Referenced by ProductPageDlgProc().

◆ OwnerPageDlgProc()

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

Definition at line 822 of file wizard.c.

826 {
827  WCHAR OwnerName[51];
828  WCHAR OwnerOrganization[51];
829  WCHAR Title[64];
830  WCHAR ErrorName[256];
831  LPNMHDR lpnm;
832  PSETUPDATA pSetupData;
833 
834  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
835 
836  switch (uMsg)
837  {
838  case WM_INITDIALOG:
839  {
840  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
841  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
842 
843  /* set a localized ('Owner') placeholder string as default */
844  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
845  {
846  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
847  }
848 
851 
852  /* Set focus to owner name */
853  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
854 
855  /* Select the default text to quickly overwrite it by typing */
856  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
857  }
858  break;
859 
860 
861  case WM_NOTIFY:
862  {
863  lpnm = (LPNMHDR)lParam;
864 
865  switch (lpnm->code)
866  {
867  case PSN_SETACTIVE:
868  /* Enable the Back and Next buttons */
870  if (pSetupData->UnattendSetup)
871  {
872  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
874  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
875  {
877  return TRUE;
878  }
879  }
880  break;
881 
882  case PSN_WIZNEXT:
883  OwnerName[0] = 0;
884  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
885  {
887  {
888  wcscpy(Title, L"ReactOS Setup");
889  }
890  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
891  {
892  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
893  }
894  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
895 
896  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
897  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
898 
899  return TRUE;
900  }
901 
902  OwnerOrganization[0] = 0;
903  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
904 
905  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
906  {
907  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
908  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
909  return TRUE;
910  }
911 
912  case PSN_WIZBACK:
913  pSetupData->UnattendSetup = FALSE;
914  break;
915 
916  default:
917  break;
918  }
919  }
920  break;
921 
922  default:
923  break;
924  }
925 
926  return FALSE;
927 }
#define EM_LIMITTEXT
Definition: winuser.h:1990
#define IDC_OWNERNAME
Definition: resource.h:46
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define IDD_COMPUTERPAGE
Definition: resource.h:49
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:141
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define SendDlgItemMessage
Definition: winuser.h:5832
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3149
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1607
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_OWNERORGANIZATION
Definition: resource.h:47
static const WCHAR Title[]
Definition: oid.c:1259
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define _countof(array)
Definition: sndvol32.h:68
#define EM_SETSEL
Definition: winuser.h:2008
#define IDS_WZD_NAME
Definition: resource.h:143
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
WCHAR OwnerName[51]
Definition: syssetup.h:42
#define PSN_WIZBACK
Definition: prsht.h:120
#define SendMessage
Definition: winuser.h:5833
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:780
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ PathIsEqual()

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

Definition at line 2885 of file wizard.c.

2888 {
2889  WCHAR szPath1[MAX_PATH];
2890  WCHAR szPath2[MAX_PATH];
2891 
2892  /* If something goes wrong, better return TRUE,
2893  * so the calling function returns early.
2894  */
2895  if (!PathCanonicalizeW(szPath1, lpPath1))
2896  return TRUE;
2897 
2898  if (!PathAddBackslashW(szPath1))
2899  return TRUE;
2900 
2901  if (!PathCanonicalizeW(szPath2, lpPath2))
2902  return TRUE;
2903 
2904  if (!PathAddBackslashW(szPath2))
2905  return TRUE;
2906 
2907  return (_wcsicmp(szPath1, szPath2) == 0);
2908 }
BOOL WINAPI PathCanonicalizeW(LPWSTR lpszBuf, LPCWSTR lpszPath)
Definition: path.c:2445
#define TRUE
Definition: types.h:120
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by AddInstallationSource().

◆ ProcessPageDlgProc()

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

Definition at line 2331 of file wizard.c.

2335 {
2337  PREGISTRATIONNOTIFY RegistrationNotify;
2338 
2339  /* Retrieve pointer to the global setup data */
2341 
2342  switch (uMsg)
2343  {
2344  case WM_INITDIALOG:
2345  /* Save pointer to the global setup data */
2351  break;
2352 
2353  case WM_NOTIFY:
2354  switch (((LPNMHDR)lParam)->code)
2355  {
2356  case PSN_SETACTIVE:
2357  /* Disable the Back and Next buttons */
2358  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2359  RunItemCompletionThread(hwndDlg);
2360  break;
2361 
2362  case PSN_WIZNEXT:
2363  break;
2364 
2365  case PSN_WIZBACK:
2367  break;
2368 
2369  default:
2370  break;
2371  }
2372  break;
2373 
2374  case PM_ITEM_START:
2375  DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2379  break;
2380 
2381  case PM_ITEM_END:
2382  DPRINT("PM_ITEM_END\n");
2383  if (lParam == ERROR_SUCCESS)
2384  {
2385  }
2386  else
2387  {
2388  ShowItemError(hwndDlg, (DWORD)lParam);
2389  }
2390  break;
2391 
2392  case PM_STEP_START:
2393  DPRINT("PM_STEP_START\n");
2394  RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2395  SendDlgItemMessage(hwndDlg, IDC_ITEM, WM_SETTEXT, 0,
2396  (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2397  break;
2398 
2399  case PM_STEP_END:
2400  DPRINT("PM_STEP_END\n");
2401  RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2402  SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2403  if (RegistrationNotify->LastError != ERROR_SUCCESS)
2404  {
2405  ShowStepError(hwndDlg, RegistrationNotify);
2406  }
2407  break;
2408 
2409  case PM_ITEMS_DONE:
2410  DPRINT("PM_ITEMS_DONE\n");
2411  /* Enable the Back and Next buttons */
2414  break;
2415 
2416  default:
2417  break;
2418  }
2419 
2420  return FALSE;
2421 }
#define IDC_ITEM
Definition: resource.h:56
LPCWSTR CurrentItem
Definition: wizard.c:47
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define IDC_TASKTEXT1
Definition: resource.h:69
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PBM_SETPOS
Definition: commctrl.h:2184
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5832
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define PM_STEP_START
Definition: wizard.c:39
#define IDC_PROCESSPROGRESS
Definition: resource.h:57
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
#define PM_ITEMS_DONE
Definition: wizard.c:41
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_TASKTEXT2
Definition: resource.h:70
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2217
#define WM_SETTEXT
Definition: winuser.h:1607
#define PM_ITEM_END
Definition: wizard.c:38
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_TASKTEXT3
Definition: resource.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID ShowItemError(HWND hwndDlg, DWORD LastError)
Definition: wizard.c:2250
SETUPDATA SetupData
Definition: reactos.c:41
#define PM_ITEM_START
Definition: wizard.c:37
Definition: inflate.c:139
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define PSBTN_NEXT
Definition: prsht.h:147
#define IDC_TASKTEXT4
Definition: resource.h:72
#define PM_STEP_END
Definition: wizard.c:40
HWND WINAPI GetParent(_In_ HWND)
HFONT hBoldFont
Definition: syssetup.h:37
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2293
#define NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1640
#define PSN_WIZBACK
Definition: prsht.h:120
unsigned int ULONG
Definition: retypes.h:1
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define DPRINT
Definition: sndvol32.h:71
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ ProcessSetupInf()

VOID ProcessSetupInf ( IN OUT PSETUPDATA  pSetupData)

Definition at line 3002 of file wizard.c.

3004 {
3006  WCHAR szValue[MAX_PATH];
3007  INFCONTEXT InfContext;
3008  DWORD LineLength;
3009  HKEY hKey;
3010  LONG res;
3011 
3012  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3013 
3014  /* Retrieve the path of the setup INF */
3016  wcscat(szPath, L"\\$winnt$.inf");
3017 
3018  /* Open the setup INF */
3019  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3020  NULL,
3022  NULL);
3023  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3024  {
3025  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3026  return;
3027  }
3028 
3029 
3030  /* Retrieve the NT source path from which the 1st-stage installer was run */
3031  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3032  L"data",
3033  L"sourcepath",
3034  &InfContext))
3035  {
3036  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3037  return;
3038  }
3039 
3040  if (!SetupGetStringFieldW(&InfContext,
3041  1,
3042  szValue,
3043  ARRAYSIZE(szValue),
3044  &LineLength))
3045  {
3046  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3047  return;
3048  }
3049 
3050  *pSetupData->SourcePath = UNICODE_NULL;
3051 
3052  /* Close the setup INF as we are going to modify it manually */
3053  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3054  SetupCloseInfFile(pSetupData->hSetupInf);
3055 
3056 
3057  /* Find the installation source path in Win32 format */
3058  if (!GetInstallSourceWin32(pSetupData->SourcePath,
3059  _countof(pSetupData->SourcePath),
3060  szValue))
3061  {
3062  *pSetupData->SourcePath = UNICODE_NULL;
3063  }
3064 
3065  /* Save the path in Win32 format in the setup INF */
3066  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3067  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3068 
3069  /*
3070  * Save it also in the registry, in the following keys:
3071  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3072  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3073  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3074  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3075  */
3076 #if 0
3078  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3079  0,
3081  &hKey);
3082 
3083  if (res != ERROR_SUCCESS)
3084  {
3085  return FALSE;
3086  }
3087 #endif
3088 
3090  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3091  0, NULL,
3093  KEY_ALL_ACCESS, // KEY_WRITE
3094  NULL,
3095  &hKey,
3096  NULL);
3097  if (res == ERROR_SUCCESS)
3098  {
3099  AddInstallationSource(hKey, pSetupData->SourcePath);
3100 
3102  L"SourcePath",
3103  0,
3104  REG_SZ,
3105  (LPBYTE)pSetupData->SourcePath,
3106  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3107 
3109  L"ServicePackSourcePath",
3110  0,
3111  REG_SZ,
3112  (LPBYTE)pSetupData->SourcePath,
3113  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3114 
3115  RegCloseKey(hKey);
3116  }
3117 
3118 
3119  /* Now, re-open the setup INF (this must succeed) */
3120  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3121  NULL,
3123  NULL);
3124  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3125  {
3126  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3127  return;
3128  }
3129 
3130  /* Process the unattended section of the setup file */
3131  ProcessUnattendSection(pSetupData);
3132 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2553
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define ERROR_SUCCESS
Definition: deptool.c:10
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
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:1091
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
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:4900
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
int _cdecl swprintf(const WCHAR *,...)
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
FxAutoRegKey hKey
LPCWSTR szPath
Definition: env.c:37
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2610
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define NULL
Definition: types.h:112
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:2911
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define DPRINT1
Definition: precomp.h:8
GLuint res
Definition: glext.h:9613
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define RegCloseKey(hKey)
Definition: registry.h:47
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by InstallWizard().

◆ ProcessUnattendSection()

VOID ProcessUnattendSection ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2610 of file wizard.c.

2612 {
2613  INFCONTEXT InfContext;
2614  WCHAR szName[256];
2615  WCHAR szValue[MAX_PATH];
2616  DWORD LineLength;
2617  HKEY hKey;
2618 
2619  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2620  L"Unattend",
2621  L"UnattendSetupEnabled",
2622  &InfContext))
2623  {
2624  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2625  return;
2626  }
2627 
2628  if (!SetupGetStringFieldW(&InfContext,
2629  1,
2630  szValue,
2631  ARRAYSIZE(szValue),
2632  &LineLength))
2633  {
2634  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2635  return;
2636  }
2637 
2638  if (_wcsicmp(szValue, L"yes") != 0)
2639  {
2640  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2641  return;
2642  }
2643 
2644  pSetupData->UnattendSetup = TRUE;
2645 
2646  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2647  L"Unattend",
2648  NULL,
2649  &InfContext))
2650  {
2651  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2652  return;
2653  }
2654 
2655  do
2656  {
2657  if (!SetupGetStringFieldW(&InfContext,
2658  0,
2659  szName,
2660  ARRAYSIZE(szName),
2661  &LineLength))
2662  {
2663  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2664  return;
2665  }
2666 
2667  if (!SetupGetStringFieldW(&InfContext,
2668  1,
2669  szValue,
2670  ARRAYSIZE(szValue),
2671  &LineLength))
2672  {
2673  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2674  return;
2675  }
2676  DPRINT1("Name %S Value %S\n", szName, szValue);
2677  if (!_wcsicmp(szName, L"FullName"))
2678  {
2679  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2680  {
2681  wcscpy(pSetupData->OwnerName, szValue);
2682  }
2683  }
2684  else if (!_wcsicmp(szName, L"OrgName"))
2685  {
2686  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2687  {
2688  wcscpy(pSetupData->OwnerOrganization, szValue);
2689  }
2690  }
2691  else if (!_wcsicmp(szName, L"ComputerName"))
2692  {
2693  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2694  {
2695  wcscpy(pSetupData->ComputerName, szValue);
2696  }
2697  }
2698  else if (!_wcsicmp(szName, L"AdminPassword"))
2699  {
2700  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2701  {
2702  wcscpy(pSetupData->AdminPassword, szValue);
2703  }
2704  }
2705  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2706  {
2707  pSetupData->TimeZoneIndex = _wtoi(szValue);
2708  }
2709  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2710  {
2711  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2712  }
2713  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2714  {
2715  if (!_wcsicmp(szValue, L"yes"))
2716  pSetupData->DisableGeckoInst = TRUE;
2717  else
2718  pSetupData->DisableGeckoInst = FALSE;
2719  }
2720  else if (!_wcsicmp(szName, L"ProductOption"))
2721  {
2722  pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2723  }
2724  } while (SetupFindNextLine(&InfContext, &InfContext));
2725 
2726  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2727  L"Display",
2728  NULL,
2729  &InfContext))
2730  {
2731  DEVMODEW dm = { { 0 } };
2732  dm.dmSize = sizeof(dm);
2734  {
2735  do
2736  {
2737  int iValue;
2738  if (!SetupGetStringFieldW(&InfContext,
2739  0,
2740  szName,
2741  ARRAYSIZE(szName),
2742  &LineLength))
2743  {
2744  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2745  return;
2746  }
2747 
2748  if (!SetupGetStringFieldW(&InfContext,
2749  1,
2750  szValue,
2751  ARRAYSIZE(szValue),
2752  &LineLength))
2753  {
2754  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2755  return;
2756  }
2757  iValue = _wtoi(szValue);
2758  DPRINT1("Name %S Value %i\n", szName, iValue);
2759 
2760  if (!iValue)
2761  continue;
2762 
2763  if (!_wcsicmp(szName, L"BitsPerPel"))
2764  {
2765  dm.dmFields |= DM_BITSPERPEL;
2766  dm.dmBitsPerPel = iValue;
2767  }
2768  else if (!_wcsicmp(szName, L"XResolution"))
2769  {
2770  dm.dmFields |= DM_PELSWIDTH;
2771  dm.dmPelsWidth = iValue;
2772  }
2773  else if (!_wcsicmp(szName, L"YResolution"))
2774  {
2775  dm.dmFields |= DM_PELSHEIGHT;
2776  dm.dmPelsHeight = iValue;
2777  }
2778  else if (!_wcsicmp(szName, L"VRefresh"))
2779  {
2781  dm.dmDisplayFrequency = iValue;
2782  }
2783  } while (SetupFindNextLine(&InfContext, &InfContext));
2784 
2786  }
2787  }
2788 
2790  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2791  0,
2792  KEY_SET_VALUE,
2793  &hKey) != ERROR_SUCCESS)
2794  {
2795  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2796  return;
2797  }
2798 
2799  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2800  L"GuiRunOnce",
2801  NULL,
2802  &InfContext))
2803  {
2804  int i = 0;
2805  do
2806  {
2807  if (SetupGetStringFieldW(&InfContext,
2808  0,
2809  szValue,
2810  ARRAYSIZE(szValue),
2811  NULL))
2812  {
2814  swprintf(szName, L"%d", i);
2815  DPRINT("szName %S szValue %S\n", szName, szValue);
2816 
2817  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2818  {
2819  DPRINT("value %S\n", szPath);
2820  if (RegSetValueExW(hKey,
2821  szName,
2822  0,
2823  REG_SZ,
2824  (const BYTE*)szPath,
2825  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2826  {
2827  i++;
2828  }
2829  }
2830  }
2831  } while (SetupFindNextLine(&InfContext, &InfContext));
2832  }
2833 
2834  RegCloseKey(hKey);
2835 
2836  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2837  L"Env",
2838  NULL,
2839  &InfContext))
2840  {
2841  if (RegCreateKeyExW(
2842  HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
2844  {
2845  DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
2846  return;
2847  }
2848  do
2849  {
2850  if (!SetupGetStringFieldW(&InfContext,
2851  0,
2852  szName,
2853  ARRAYSIZE(szName),
2854  &LineLength))
2855  {
2856  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2857  return;
2858  }
2859 
2860  if (!SetupGetStringFieldW(&InfContext,
2861  1,
2862  szValue,
2863  ARRAYSIZE(szValue),
2864  &LineLength))
2865  {
2866  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2867  return;
2868  }
2869  DPRINT1("[ENV] %S=%S\n", szName, szValue);
2870 
2871  DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
2872 
2873  if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
2874  {
2875  DPRINT1(" - Error %d\n", GetLastError());
2876  }
2877 
2878  } while (SetupFindNextLine(&InfContext, &InfContext));
2879 
2880  RegCloseKey(hKey);
2881  }
2882 }
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
static const WCHAR szName[]
Definition: powrprof.c:45
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
DWORD dmFields
Definition: wingdi.h:1622
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD dmBitsPerPel
Definition: wingdi.h:1647
enum _PRODUCT_OPTION PRODUCT_OPTION
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
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:1091
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define L(x)
Definition: ntvdm.h:50
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define FALSE
Definition: types.h:117
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
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:4900
char TCHAR
Definition: xmlstorage.h:189
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WORD dmSize
Definition: wingdi.h:1620
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1648
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
int _cdecl swprintf(const WCHAR *,...)
unsigned char BYTE
Definition: xxhash.c:193
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
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
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
FxAutoRegKey hKey
LPCWSTR szPath
Definition: env.c:37
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define NULL
Definition: types.h:112
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define DPRINT1
Definition: precomp.h:8
DWORD dmPelsHeight
Definition: wingdi.h:1649
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DPRINT
Definition: sndvol32.h:71
#define RegCloseKey(hKey)
Definition: registry.h:47
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by ProcessSetupInf().

◆ ProductPageDlgProc()

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

Definition at line 686 of file wizard.c.

687 {
688  LPNMHDR lpnm;
689  PSETUPDATA pSetupData;
690  INT iItem;
691  WCHAR szText[64], szDefault[64];
692  HICON hIcon;
693 
694  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
695 
696  switch (uMsg)
697  {
698  case WM_INITDIALOG:
699  {
700  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
701  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
702 
703  LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
704 
707  {
708  StringCchCatW(szText, _countof(szText), L" ");
709  StringCchCatW(szText, _countof(szText), szDefault);
710  }
712 
715  {
716  StringCchCatW(szText, _countof(szText), L" ");
717  StringCchCatW(szText, _countof(szText), szDefault);
718  }
720 
723 
726  return TRUE;
727  }
728 
729  case WM_COMMAND:
731  {
732  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
733  OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
734  }
735  break;
736 
737  case WM_NOTIFY:
738  {
739  lpnm = (LPNMHDR)lParam;
740 
741  switch (lpnm->code)
742  {
743  case PSN_SETACTIVE:
744  /* Enable the Back and Next buttons */
746  if (pSetupData->UnattendSetup)
747  {
748  OnChooseOption(hwndDlg, pSetupData->ProductOption);
749  DoWriteProductOption(pSetupData->ProductOption);
751  return TRUE;
752  }
753  break;
754 
755  case PSN_WIZNEXT:
756  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
757  pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
758  DoWriteProductOption(pSetupData->ProductOption);
759  break;
760 
761  case PSN_WIZBACK:
762  pSetupData->UnattendSetup = FALSE;
763  break;
764 
765  default:
766  break;
767  }
768  }
769  break;
770 
771  default:
772  break;
773  }
774 
775  return FALSE;
776 }
#define STM_SETICON
Definition: winuser.h:2082
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1933
WPARAM wParam
Definition: combotst.c:138
enum _PRODUCT_OPTION PRODUCT_OPTION
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
UINT code
Definition: winuser.h:3149
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define CB_ADDSTRING
Definition: winuser.h:1926
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_PRODUCT_ICON
Definition: resource.h:103
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:663
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:104
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:551
#define _countof(array)
Definition: sndvol32.h:68
#define IDI_WINLOGO
Definition: winuser.h:704
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define DWLP_USER
Definition: winuser.h:866
#define CB_SETCURSEL
Definition: winuser.h:1951
#define WM_COMMAND
Definition: winuser.h:1730
HWND WINAPI GetParent(_In_ HWND)
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define CBN_SELCHANGE
Definition: winuser.h:1969
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:247
BOOL UnattendSetup
Definition: syssetup.h:46
#define LoadIcon
Definition: winuser.h:5803
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:169
#define IDS_DEFAULT
Definition: resource.h:172
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:168
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ RegisterDlls()

static DWORD RegisterDlls ( PITEMSDATA  pItemsData)
static

Definition at line 2111 of file wizard.c.

2113 {
2114  REGISTRATIONDATA RegistrationData;
2115  WCHAR SectionName[512];
2117  LONG DllCount = 0;
2118  DWORD LastError = NO_ERROR;
2119 
2120  ZeroMemory(&RegistrationData, sizeof(REGISTRATIONDATA));
2121  RegistrationData.hwndDlg = pItemsData->hwndDlg;
2122  RegistrationData.Registered = 0;
2123 
2124  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2125  L"RegisterDlls", &Context))
2126  {
2127  DPRINT1("No RegistrationPhase2 section found\n");
2128  return FALSE;
2129  }
2130 
2131  if (!SetupGetStringFieldW(&Context, 1, SectionName,
2132  ARRAYSIZE(SectionName),
2133  NULL))
2134  {
2135  DPRINT1("Unable to retrieve section name\n");
2136  return FALSE;
2137  }
2138 
2139  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2140  DPRINT1("SectionName %S DllCount %ld\n", SectionName, DllCount);
2141  if (DllCount < 0)
2142  {
2144  return FALSE;
2145  }
2146 
2147  RegistrationData.DllCount = (ULONG)DllCount;
2148  RegistrationData.DefaultContext = SetupInitDefaultQueueCallback(RegistrationData.hwndDlg);
2149 
2150  SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 0, (LPARAM)RegistrationData.DllCount);
2151 
2152  _SEH2_TRY
2153  {
2154  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData.hwndDlg),
2155  hSysSetupInf,
2156  L"RegistrationPhase2",
2157  SPINST_REGISTRY | SPINST_REGISTERCALLBACKAWARE | SPINST_REGSVR,
2158  0,
2159  NULL,
2160  0,
2162  &RegistrationData,
2163  NULL,
2164  NULL))
2165  {
2166  LastError = GetLastError();
2167  }
2168  }
2170  {
2171  DPRINT("Catching exception\n");
2173  }
2174  _SEH2_END;
2175 
2177 
2178  SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 0, LastError);
2179 
2180  return 0;
2181 }
_SEH2_TRY
Definition: create.c:4226
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
ULONG DllCount
Definition: wizard.c:61
#define SPINST_REGSVR
Definition: setupapi.h:594
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ZeroMemory
Definition: winbase.h:1670
ULONG Registered
Definition: wizard.c:62
_SEH2_END
Definition: create.c:4400
#define NO_ERROR
Definition: dderror.h:5
#define L(x)
Definition: ntvdm.h:50
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:2016
#define FALSE
Definition: types.h:117
PVOID DefaultContext
Definition: wizard.c:63
long LONG
Definition: pedump.c:60
#define SPINST_REGISTRY
Definition: setupapi.h:590
LONG_PTR LPARAM
Definition: windef.h:208
#define PM_ITEM_END
Definition: wizard.c:38
#define STATUS_NOT_FOUND
Definition: shellext.h:72
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:752
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:1327
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
#define PM_ITEM_START
Definition: wizard.c:37
HWND WINAPI GetParent(_In_ HWND)
HWND hwndDlg
Definition: wizard.c:55
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1677
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1038
#define SendMessage
Definition: winuser.h:5833
unsigned int ULONG
Definition: retypes.h:1
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define DPRINT
Definition: sndvol32.h:71
HINF hSysSetupInf
Definition: install.c:37
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1494
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by ItemCompletionThread().

◆ RegistrationNotificationProc()

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

Definition at line 2016 of file wizard.c.

2020 {
2021  PREGISTRATIONDATA RegistrationData;
2022  REGISTRATIONNOTIFY RegistrationNotify;
2023  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
2024  UINT MessageID;
2025 
2026  RegistrationData = (PREGISTRATIONDATA)Context;
2027 
2030  {
2031  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
2032  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
2033  if (RegistrationNotify.CurrentItem == NULL)
2034  {
2035  RegistrationNotify.CurrentItem = StatusInfo->FileName;
2036  }
2037  else
2038  {
2039  RegistrationNotify.CurrentItem++;
2040  }
2041 
2043  {
2044  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
2045  StatusInfo->FileName);
2046  RegistrationNotify.ErrorMessage = NULL;
2047  RegistrationNotify.Progress = RegistrationData->Registered;
2048  SendMessage(RegistrationData->hwndDlg, PM_STEP_START, 0, (LPARAM)&RegistrationNotify);
2049  }
2050  else
2051  {
2052  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
2053  StatusInfo->FileName);
2054  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
2055  StatusInfo->FailureCode);
2056  if (StatusInfo->FailureCode != SPREG_SUCCESS)
2057  {
2058  switch (StatusInfo->FailureCode)
2059  {
2060  case SPREG_LOADLIBRARY:
2062  break;
2063  case SPREG_GETPROCADDR:
2065  break;
2066  case SPREG_REGSVR:
2068  break;
2069  case SPREG_DLLINSTALL:
2071  break;
2072  case SPREG_TIMEOUT:
2074  break;
2075  default:
2077  break;
2078  }
2079 
2080  RegistrationNotify.MessageID = MessageID;
2081  RegistrationNotify.LastError = StatusInfo->Win32Error;
2082  }
2083  else
2084  {
2085  RegistrationNotify.MessageID = 0;
2086  RegistrationNotify.LastError = ERROR_SUCCESS;
2087  }
2088 
2089  if (RegistrationData->Registered < RegistrationData->DllCount)
2090  {
2091  RegistrationData->Registered++;
2092  }
2093 
2094  RegistrationNotify.Progress = RegistrationData->Registered;
2095  SendMessage(RegistrationData->hwndDlg, PM_STEP_END, 0, (LPARAM)&RegistrationNotify);
2096  }
2097 
2098  return FILEOP_DOIT;
2099  }
2100  else
2101  {
2102  DPRINT1("Received unexpected notification %u\n", Notification);
2103  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2104  Notification, Param1, Param2);
2105  }
2106 }
LPCWSTR CurrentItem
Definition: wizard.c:47
#define ERROR_SUCCESS
Definition: deptool.c:10
ULONG DllCount
Definition: wizard.c:61
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:134
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:570
#define IDS_TIMEOUT
Definition: resource.h:14
#define SPREG_GETPROCADDR
Definition: setupapi.h:654
ULONG Registered
Definition: wizard.c:62
#define PM_STEP_START
Definition: wizard.c:39
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define L(x)
Definition: ntvdm.h:50
#define SetupDefaultQueueCallback
Definition: setupapi.h:2572
PVOID DefaultContext
Definition: wizard.c:63
#define SPREG_REGSVR
Definition: setupapi.h:655
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:137
LONG_PTR LPARAM
Definition: windef.h:208
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:135
#define FILEOP_DOIT
Definition: fileqsup.h:48
#define IDS_REASON_UNKNOWN
Definition: resource.h:139
#define wcsrchr
Definition: compat.h:16
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:113
#define PM_STEP_END
Definition: wizard.c:40
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:571
struct _REGISTRATIONDATA * PREGISTRATIONDATA
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5833
#define SPREG_DLLINSTALL
Definition: setupapi.h:656
LPCWSTR ErrorMessage
Definition: wizard.c:48
#define DPRINT
Definition: sndvol32.h:71
#define SPREG_TIMEOUT
Definition: setupapi.h:657
#define IDS_REGSVR_FAILED
Definition: resource.h:136
#define SPREG_LOADLIBRARY
Definition: setupapi.h:653
#define SPREG_SUCCESS
Definition: setupapi.h:652

Referenced by RegisterDlls().

◆ RetrieveTimeZone()

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

Definition at line 1516 of file wizard.c.

1519 {
1520  LONG lError;
1523  PTIMEZONE_ENTRY Current;
1524  ULONG DescriptionSize;
1525  ULONG StandardNameSize;
1526  ULONG DaylightNameSize;
1527 
1529  if (Entry == NULL)
1530  {
1531  return ERROR_NOT_ENOUGH_MEMORY;
1532  }
1533 
1534  DescriptionSize = sizeof(Entry->Description);
1535  StandardNameSize = sizeof(Entry->StandardName);
1536  DaylightNameSize = sizeof(Entry->DaylightName);
1537 
1538  lError = QueryTimeZoneData(hZoneKey,
1539  &Entry->Index,
1540  &Entry->TimezoneInfo,
1541  Entry->Description,
1542  &DescriptionSize,
1543  Entry->StandardName,
1544  &StandardNameSize,
1545  Entry->DaylightName,
1546  &DaylightNameSize);
1547  if (lError != ERROR_SUCCESS)
1548  {
1549  HeapFree(GetProcessHeap(), 0, Entry);
1550  return lError;
1551  }
1552 
1553  if (SetupData->TimeZoneListHead == NULL &&
1555  {
1556  Entry->Prev = NULL;
1557  Entry->Next = NULL;
1560  }
1561  else
1562  {
1563  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1564  if (Current != NULL)
1565  {
1566  if (Current == SetupData->TimeZoneListHead)
1567  {
1568  /* Prepend to head */
1569  Entry->Prev = NULL;
1570  Entry->Next = SetupData->TimeZoneListHead;
1571  SetupData->TimeZoneListHead->Prev = Entry;
1573  }
1574  else
1575  {
1576  /* Insert before current */
1577  Entry->Prev = Current->Prev;
1578  Entry->Next = Current;
1579  Current->Prev->Next = Entry;
1580  Current->Prev = Entry;
1581  }
1582  }
1583  else
1584  {
1585  /* Append to tail */
1586  Entry->Prev = SetupData->TimeZoneListTail;
1587  Entry->Next = NULL;
1590  }
1591  }
1592 
1593  return ERROR_SUCCESS;
1594 }
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:629
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1499
Definition: timezone.c:15
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
long LONG
Definition: pedump.c:60
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
#define NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:735
base of all file and directory entries
Definition: entries.h:82
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
struct _SETUPDATA * PSETUPDATA

Referenced by CreateTimeZoneList().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 1332 of file wizard.c.

1333 {
1334  MSG msg;
1335  HWND MainWindow = GetParent(hwnd);
1336  STARTUPINFOW StartupInfo;
1337  PROCESS_INFORMATION ProcessInformation;
1338  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1339 
1340  if (!pwszCPLParameters)
1341  {
1342  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1343  return FALSE;
1344  }
1345 
1346  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1347  StartupInfo.cb = sizeof(StartupInfo);
1348  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1349 
1350  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1351  wcscat(CmdLine, pwszCPLParameters);
1352 
1353  if (!CreateProcessW(NULL,
1354  CmdLine,
1355  NULL,
1356  NULL,
1357  FALSE,
1358  0,
1359  NULL,
1360  NULL,
1361  &StartupInfo,
1362  &ProcessInformation))
1363  {
1364  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1365  return FALSE;
1366  }
1367 
1368  /* Disable the Back and Next buttons and the main window
1369  * while we're interacting with the control panel applet */
1370  PropSheet_SetWizButtons(MainWindow, 0);
1371  EnableWindow(MainWindow, FALSE);
1372 
1374  {
1375  /* We still need to process main window messages to avoid freeze */
1376  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1377  {
1380  }
1381  }
1382  CloseHandle(ProcessInformation.hThread);
1383  CloseHandle(ProcessInformation.hProcess);
1384 
1385  /* Enable the Back and Next buttons and the main window again */
1387  EnableWindow(MainWindow, TRUE);
1388 
1389  return TRUE;
1390 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define CloseHandle
Definition: compat.h:739
#define TRUE
Definition: