ReactOS  0.4.15-dev-2979-gfd8baca
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 <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  _REGISTRATIONDATA
 
struct  _TIMEZONE_ENTRY
 
struct  _PRODUCT_OPTION_DATA
 
struct  ThemeInfo
 

Macros

#define NDEBUG
 
#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)
 

Typedefs

typedef struct _REGISTRATIONNOTIFY REGISTRATIONNOTIFY
 
typedef struct _REGISTRATIONNOTIFYPREGISTRATIONNOTIFY
 
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 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 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 CALLBACK RegistrationProc (LPVOID Parameter)
 
static BOOL StartComponentRegistration (HWND hwndDlg, PULONG MaxProgress)
 
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)
 
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 PRODUCT_OPTION_DATA s_ProductOptionData []
 
static struct ThemeInfo Themes []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 25 of file wizard.c.

◆ PM_REGISTRATION_NOTIFY

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)

Definition at line 28 of file wizard.c.

Typedef Documentation

◆ PFNREQUESTWIZARDPAGES

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

Definition at line 2725 of file wizard.c.

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

292 {
293  LPNMHDR lpnm;
294  PWCHAR Projects;
295  PWCHAR End, CurrentProject;
296  INT ProjectsSize, ProjectsCount;
297  PSETUPDATA pSetupData;
298 
299  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
300 
301  switch (uMsg)
302  {
303  case WM_INITDIALOG:
304  {
305  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
306  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
307 
308  Projects = NULL;
309  ProjectsSize = 256;
310  while (TRUE)
311  {
312  Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
313  if (NULL == Projects)
314  {
315  return FALSE;
316  }
317  ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
318  if (0 == ProjectsCount)
319  {
320  HeapFree(GetProcessHeap(), 0, Projects);
321  return FALSE;
322  }
323  if (ProjectsCount < ProjectsSize - 1)
324  {
325  break;
326  }
327  HeapFree(GetProcessHeap(), 0, Projects);
328  ProjectsSize *= 2;
329  }
330 
331  CurrentProject = Projects;
332  while (*CurrentProject != L'\0')
333  {
334  End = wcschr(CurrentProject, L'\n');
335  if (NULL != End)
336  {
337  *End = L'\0';
338  }
339  (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
340  if (NULL != End)
341  {
342  CurrentProject = End + 1;
343  }
344  else
345  {
346  CurrentProject += wcslen(CurrentProject);
347  }
348  }
349  HeapFree(GetProcessHeap(), 0, Projects);
350  }
351  break;
352 
353  case WM_COMMAND:
355  {
357  SetForegroundWindow(GetParent(hwndDlg));
358  }
359  break;
360 
361  case WM_NOTIFY:
362  {
363  lpnm = (LPNMHDR)lParam;
364 
365  switch (lpnm->code)
366  {
367  case PSN_SETACTIVE:
368  /* Enable the Back and Next buttons */
370  if (pSetupData->UnattendSetup)
371  {
373  return TRUE;
374  }
375  break;
376 
377  case PSN_WIZBACK:
378  pSetupData->UnattendSetup = FALSE;
379  break;
380 
381  default:
382  break;
383  }
384  }
385  break;
386 
387  default:
388  break;
389  }
390 
391  return FALSE;
392 }
#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:95
#define IDD_GPL
Definition: resource.h:78
#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:447
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:3134
#define DialogBox
Definition: winuser.h:5736
#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:595
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:1907
#define IDS_ACKPROJECTS
Definition: resource.h:121
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:135
#define WM_COMMAND
Definition: winuser.h:1722
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:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 69 of file wizard.c.

70 {
72  RECT rcParent;
73  RECT rcWindow;
74 
76  if (hWndParent == NULL)
78 
79  GetWindowRect(hWndParent, &rcParent);
80  GetWindowRect(hWnd, &rcWindow);
81 
83  HWND_TOP,
84  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
85  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
86  0,
87  0,
88  SWP_NOSIZE);
89 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define HWND_TOP
Definition: winuser.h:1193
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:1230
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 924 of file wizard.c.

928 {
929  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
930  WCHAR Password1[128];
931  WCHAR Password2[128];
933  WCHAR Title[64];
934  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
935  LPNMHDR lpnm;
936  PSETUPDATA pSetupData;
937 
938  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
939 
941  {
942  wcscpy(Title, L"ReactOS Setup");
943  }
944 
945  switch (uMsg)
946  {
947  case WM_INITDIALOG:
948  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
949  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
950 
951  /* Generate a new pseudo-random computer name */
952  GenerateComputerName(ComputerName);
953 
954  /* Display current computer name */
955  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
956 
957  /* Set text limits */
961 
962  /* Set focus to computer name */
964  if (pSetupData->UnattendSetup)
965  {
971  }
972 
973  /* Store the administrator account name as the default user name */
974  WriteDefaultLogonData(pSetupData->ComputerName);
975  break;
976 
977 
978  case WM_NOTIFY:
979  {
980  lpnm = (LPNMHDR)lParam;
981 
982  switch (lpnm->code)
983  {
984  case PSN_SETACTIVE:
985  /* Enable the Back and Next buttons */
987  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
988  {
990  return TRUE;
991  }
992  break;
993 
994  case PSN_WIZNEXT:
995  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
996  {
997  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
998  ARRAYSIZE(EmptyComputerName)))
999  {
1000  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1001  }
1002  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1004  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1005  return TRUE;
1006  }
1007 
1008  /* No need to check computer name for invalid characters,
1009  * SetComputerName() will do it for us */
1010 
1011  if (!WriteComputerSettings(ComputerName, hwndDlg))
1012  {
1014  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1015  return TRUE;
1016  }
1017 
1018 #ifdef PASSWORDS_MANDATORY
1019  /* Check if admin passwords have been entered */
1020  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1021  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1022  {
1023  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1024  ARRAYSIZE(EmptyPassword)))
1025  {
1026  wcscpy(EmptyPassword, L"You must enter a password !");
1027  }
1028  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1029  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1030  return TRUE;
1031  }
1032 #else
1033  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1034  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1035 #endif
1036  /* Check if passwords match */
1037  if (wcscmp(Password1, Password2))
1038  {
1039  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1040  ARRAYSIZE(NotMatchPassword)))
1041  {
1042  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1043  }
1044  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1045  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1046  return TRUE;
1047  }
1048 
1049  /* Check password for invalid characters */
1050  Password = (PWCHAR)Password1;
1051  while (*Password)
1052  {
1053  if (!isprint(*Password))
1054  {
1055  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1056  ARRAYSIZE(WrongPassword)))
1057  {
1058  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1059  }
1060  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1061  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1062  return TRUE;
1063  }
1064  Password++;
1065  }
1066 
1067  /* Set admin password */
1068  SetAdministratorPassword(Password1);
1069  break;
1070 
1071  case PSN_WIZBACK:
1072  pSetupData->UnattendSetup = FALSE;
1073  break;
1074 
1075  default:
1076  break;
1077  }
1078  }
1079  break;
1080 
1081  default:
1082  break;
1083  }
1084 
1085  return FALSE;
1086 }
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1609
#define EM_LIMITTEXT
Definition: winuser.h:1982
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:906
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:854
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendDlgItemMessage
Definition: winuser.h:5817
uint16_t * PWCHAR
Definition: typedefs.h:56
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:139
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:137
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:3134
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:44
#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:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetDlgItemText
Definition: winuser.h:5760
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
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)
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:788
#define IDC_ADMINPASSWORD1
Definition: resource.h:51
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
_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:5818
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:138
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:140
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
#define IDD_THEMEPAGE
Definition: resource.h:75
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ Control_RunDLLW()

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

Definition at line 873 of file control.c.

874 {
875  CPanel panel;
876 
877  TRACE("(%p, %p, %s, 0x%08x)\n",
878  hWnd, hInst, debugstr_w(cmd), nCmdShow);
879 
880 #ifndef __REACTOS__
881  memset(&panel, 0, sizeof(panel));
882  list_init( &panel.applets );
883 #endif
884 
885  if (!cmd || !*cmd) {
886  Control_DoWindow(&panel, hWnd, hInst);
887  } else {
888  Control_DoLaunch(&panel, hWnd, cmd);
889  }
890 }
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:742
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:698
__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 114 of file wizard.c.

115 {
116  LOGFONTW tmpFont = {0};
117  HFONT hBoldFont;
118  HDC hDc;
119 
120  /* Grabs the Drawing Context */
121  hDc = GetDC(NULL);
122 
123  tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
124  tmpFont.lfWeight = FW_BOLD;
125  wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
126 
127  hBoldFont = CreateFontIndirectW(&tmpFont);
128 
129  ReleaseDC(NULL, hDc);
130 
131  return hBoldFont;
132 }
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
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)
static const WCHAR L[]
Definition: oid.c:1250
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
#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:718
LONG lfWeight
Definition: dimm.idl:63

Referenced by InstallWizard().

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1398 of file wizard.c.

1399 {
1401 }
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1317
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 93 of file wizard.c.

94 {
95  LOGFONTW LogFont = {0};
96  HDC hdc;
97  HFONT hFont;
98 
99  LogFont.lfWeight = FW_BOLD;
100  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
101 
102  hdc = GetDC(NULL);
103  LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
104 
105  hFont = CreateFontIndirectW(&LogFont);
106 
107  ReleaseDC(NULL, hdc);
108 
109  return hFont;
110 }
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
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)
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
#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:718
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 1584 of file wizard.c.

1588 {
1590 
1591  /* Retrieve pointer to the global setup data */
1593 
1594  switch (uMsg)
1595  {
1596  case WM_INITDIALOG:
1597  {
1598  /* Save pointer to the global setup data */
1601 
1603 
1604  if (SetupData->UnattendSetup)
1605  {
1608 
1610  {
1612  }
1613  }
1614  else
1615  {
1617  SetupData, -1);
1618 
1620  }
1621  break;
1622  }
1623 
1624  case WM_TIMER:
1625  {
1626  SYSTEMTIME LocalTime;
1627 
1628  GetLocalTime(&LocalTime);
1629  UpdateLocalSystemTime(hwndDlg, LocalTime);
1630 
1631  // Reset timeout.
1632  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1633  break;
1634  }
1635 
1636  case WM_NOTIFY:
1637  switch (((LPNMHDR)lParam)->code)
1638  {
1639  case PSN_SETACTIVE:
1640  {
1641  SYSTEMTIME LocalTime;
1642 
1643  GetLocalTime(&LocalTime);
1644  UpdateLocalSystemTime(hwndDlg, LocalTime);
1645 
1646  /* Enable the Back and Next buttons */
1648 
1650  {
1652  return TRUE;
1653  }
1654 
1655  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1656  break;
1657  }
1658 
1659  case PSN_KILLACTIVE:
1660  case DTN_DATETIMECHANGE:
1661  // NB: Not re-set until changing page (PSN_SETACTIVE).
1662  KillTimer(hwndDlg, 1);
1663  break;
1664 
1665  case PSN_WIZNEXT:
1666  WriteDateTimeSettings(hwndDlg, SetupData);
1667  break;
1668 
1669  case PSN_WIZBACK:
1671  break;
1672 
1673  default:
1674  break;
1675  }
1676  break;
1677 
1678  case WM_DESTROY:
1680  break;
1681 
1682  default:
1683  break;
1684  }
1685 
1686  return FALSE;
1687 }
#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:5817
#define PSN_SETACTIVE
Definition: prsht.h:115
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1398
#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:1553
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1404
#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:1545
#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:1591
#define BM_SETCHECK
Definition: winuser.h:1903
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define WM_TIMER
Definition: winuser.h:1724
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
SETUPDATA SetupData
Definition: reactos.c:41
WORD wMilliseconds
Definition: winbase.h:906
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:1426
#define GetWindowLongPtr
Definition: treelist.c:73
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4366
#define WM_INITDIALOG
Definition: winuser.h:1721
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 1404 of file wizard.c.

1405 {
1407 
1408  while (SetupData->TimeZoneListHead != NULL)
1409  {
1411 
1412  SetupData->TimeZoneListHead = Entry->Next;
1414  {
1415  SetupData->TimeZoneListHead->Prev = NULL;
1416  }
1417 
1418  HeapFree(GetProcessHeap(), 0, Entry);
1419  }
1420 
1422 }
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
#define GetProcessHeap()
Definition: compat.h:595
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:594
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 415 of file wizard.c.

416 {
417  HKEY hKey;
418  LONG error;
419  LPCWSTR pszData;
420  DWORD dwValue, cbData;
421  const PRODUCT_OPTION_DATA *pData = &s_ProductOptionData[nOption];
422  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
423 
424  /* open ProductOptions key */
426  if (error)
427  {
428  DPRINT1("RegOpenKeyExW failed\n");
429  goto Error;
430  }
431 
432  /* write ProductSuite */
433  pszData = pData->ProductSuite;
434  cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
435  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
436  if (error)
437  {
438  DPRINT1("RegSetValueExW failed\n");
439  goto Error;
440  }
441 
442  /* write ProductType */
443  pszData = pData->ProductType;
444  cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
445  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
446  if (error)
447  {
448  DPRINT1("RegSetValueExW failed\n");
449  goto Error;
450  }
451 
452  RegCloseKey(hKey);
453 
454  /* open ReactOS version key */
456  if (error)
457  {
458  DPRINT1("RegOpenKeyExW failed\n");
459  goto Error;
460  }
461 
462  /* write ReportAsWorkstation */
463  dwValue = pData->ReportAsWorkstation;
464  cbData = sizeof(dwValue);
465  error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
466  if (error)
467  {
468  DPRINT1("RegSetValueExW failed\n");
469  goto Error;
470  }
471 
472  RegCloseKey(hKey);
473 
474  /* open Control Windows key */
476  if (error)
477  {
478  DPRINT1("RegOpenKeyExW failed\n");
479  goto Error;
480  }
481 
482  /* write Control Windows CSDVersion */
483  dwValue = pData->CSDVersion;
484  cbData = sizeof(dwValue);
485  error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
486  if (error)
487  {
488  DPRINT1("RegSetValueExW failed\n");
489  goto Error;
490  }
491 
492  RegCloseKey(hKey);
493 
494  /* open Winlogon key */
496  if (error)
497  {
498  DPRINT1("RegOpenKeyExW failed\n");
499  goto Error;
500  }
501 
502  /* write LogonType */
503  dwValue = pData->LogonType;
504  cbData = sizeof(dwValue);
505  error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
506  if (error)
507  {
508  DPRINT1("RegSetValueExW failed\n");
509  goto Error;
510  }
511 
512 Error:
513  if (hKey)
514  RegCloseKey(hKey);
515 
516  return error == ERROR_SUCCESS;
517 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:408
#define lstrlenW
Definition: compat.h:609
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static const WCHAR s_szRosVersion[]
Definition: wizard.c:395
#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:4895
#define ASSERT(a)
Definition: mode.c:44
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: xxhash.c:193
static const WCHAR s_szControlWindows[]
Definition: wizard.c:396
FxAutoRegKey hKey
#define DPRINT1
Definition: precomp.h:8
static const WCHAR s_szWinlogon[]
Definition: wizard.c:397
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define REG_DWORD
Definition: sdbapi.c:596
static const WCHAR s_szProductOptions[]
Definition: wizard.c:394
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by ProductPageDlgProc().

◆ FinishDlgProc()

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

Definition at line 2211 of file wizard.c.

2215 {
2216 
2217  switch (uMsg)
2218  {
2219  case WM_INITDIALOG:
2220  {
2221  /* Get pointer to the global setup data */
2223 
2225  {
2226  /* Run the Wine Gecko prompt */
2227  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2228  }
2229 
2230  /* Set title font */
2231  SendDlgItemMessage(hwndDlg,
2233  WM_SETFONT,
2235  (LPARAM)TRUE);
2236  if (SetupData->UnattendSetup)
2237  {
2238  KillTimer(hwndDlg, 1);
2240  PostQuitMessage(0);
2241  }
2242  }
2243  break;
2244 
2245  case WM_DESTROY:
2246  {
2248  PostQuitMessage(0);
2249  return TRUE;
2250  }
2251 
2252  case WM_TIMER:
2253  {
2254  INT Position;
2255  HWND hWndProgress;
2256 
2257  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2258  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2259  if (Position == 300)
2260  {
2261  KillTimer(hwndDlg, 1);
2263  }
2264  else
2265  {
2266  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2267  }
2268  }
2269  return TRUE;
2270 
2271  case WM_NOTIFY:
2272  {
2273  LPNMHDR lpnm = (LPNMHDR)lParam;
2274 
2275  switch (lpnm->code)
2276  {
2277  case PSN_SETACTIVE:
2278  /* Enable the correct buttons on for the active page */
2280 
2282  MAKELPARAM(0, 300));
2284  SetTimer(hwndDlg, 1, 50, NULL);
2285  break;
2286 
2287  case PSN_WIZFINISH:
2288  DestroyWindow(GetParent(hwndDlg));
2289  break;
2290 
2291  default:
2292  break;
2293  }
2294  }
2295  break;
2296 
2297  default:
2298  break;
2299  }
2300 
2301  return FALSE;
2302 }
#define TRUE
Definition: types.h:120
static COORD Position
Definition: mouse.c:34
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#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:5817
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:3134
#define PBM_SETRANGE
Definition: commctrl.h:2183
#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:1591
#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:2182
#define WM_TIMER
Definition: winuser.h:1724
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:873
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static const WCHAR L[]
Definition: oid.c:1250
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1632
#define SendMessage
Definition: winuser.h:5818
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:1721
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 906 of file wizard.c.

907 {
908  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
909  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
910  unsigned i;
911 
912  wcscpy(lpBuffer, L"REACTOS-");
913 
914  srand(GetTickCount());
915 
916  /* fill in 7 characters */
917  for (i = 8; i < 15; i++)
918  lpBuffer[i] = Chars[rand() % cChars];
919 
920  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
921 }
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
void __cdecl srand(_In_ unsigned int _Seed)
#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)
static const WCHAR L[]
Definition: oid.c:1250
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 2310 of file wizard.c.

2314 {
2315  WCHAR wszDrives[512];
2316  WCHAR wszNTPath[512]; // MAX_PATH ?
2317  DWORD cchDrives;
2318  PWCHAR pwszDrive;
2319 
2320  *pwszPath = UNICODE_NULL;
2321 
2322  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2323  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2324  {
2325  /* Buffer too small or failure */
2326  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2327  return FALSE;
2328  }
2329 
2330  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2331  {
2332  WCHAR wszBuf[MAX_PATH];
2333 
2334  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2335  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2336  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2337  pwszDrive[2] = L'\\'; // Restore the backslash
2338 
2339  wcscat(wszNTPath, L"\\"); // Concat a backslash
2340 
2341  /* Logging */
2342  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2343  pwszDrive, wszNTPath,
2344  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2345  LogItem(NULL, wszBuf);
2346 
2347  /* Check whether the NT path corresponds to the NT installation source path */
2348  if (!_wcsicmp(wszNTPath, pwszNTPath))
2349  {
2350  /* Found it! */
2351  wcscpy(pwszPath, pwszDrive); // cchPathMax
2352 
2353  /* Logging */
2354  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2355  LogItem(NULL, wszBuf);
2356  wcscat(wszBuf, L"\n");
2357  OutputDebugStringW(wszBuf);
2358 
2359  return TRUE;
2360  }
2361  }
2362 
2363  return FALSE;
2364 }
#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 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)
static const WCHAR L[]
Definition: oid.c:1250
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:5840
_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 1300 of file wizard.c.

1301 {
1303 
1305  while (Entry != NULL)
1306  {
1307  if (Entry->Index >= Index)
1308  return Entry;
1309 
1310  Entry = Entry->Next;
1311  }
1312 
1313  return NULL;
1314 }
struct _Entry Entry
Definition: kefuncs.h:627
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 1501 of file wizard.c.

1502 {
1503  SYSTEMTIME Date;
1504  SYSTEMTIME Time;
1505 
1507  {
1508  return FALSE;
1509  }
1510 
1512  {
1513  return FALSE;
1514  }
1515 
1516  SetupData->SystemTime.wYear = Date.wYear;
1519  SetupData->SystemTime.wDay = Date.wDay;
1520  SetupData->SystemTime.wHour = Time.wHour;
1521  SetupData->SystemTime.wMinute = Time.wMinute;
1522  SetupData->SystemTime.wSecond = Time.wSecond;
1523  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1524 
1525  return TRUE;
1526 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD wMonth
Definition: winbase.h:900
#define TRUE
Definition: types.h:120
WORD wDayOfWeek
Definition: winbase.h:901
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:899
#define FALSE
Definition: types.h:117
WORD wMinute
Definition: winbase.h:904
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:905
WORD wMilliseconds
Definition: winbase.h:906
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4330
WORD wDay
Definition: winbase.h:902
#define GDT_VALID
Definition: commctrl.h:4460
#define IDC_DATEPICKER
Definition: resource.h:61
WORD wHour
Definition: winbase.h:903
SYSTEMTIME SystemTime
Definition: syssetup.h:49
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 135 of file wizard.c.

139 {
140  HRSRC GplTextResource;
141  HGLOBAL GplTextMem;
142  PVOID GplTextLocked;
143  PCHAR GplText;
144  DWORD Size;
145 
146 
147  switch (uMsg)
148  {
149  case WM_INITDIALOG:
150  GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
151  if (NULL == GplTextResource)
152  {
153  break;
154  }
155  Size = SizeofResource(hDllInstance, GplTextResource);
156  if (0 == Size)
157  {
158  break;
159  }
160  GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
161  if (NULL == GplText)
162  {
163  break;
164  }
165  GplTextMem = LoadResource(hDllInstance, GplTextResource);
166  if (NULL == GplTextMem)
167  {
168  HeapFree(GetProcessHeap(), 0, GplText);
169  break;
170  }
171  GplTextLocked = LockResource(GplTextMem);
172  if (NULL == GplTextLocked)
173  {
174  HeapFree(GetProcessHeap(), 0, GplText);
175  break;
176  }
177  memcpy(GplText, GplTextLocked, Size);
178  GplText[Size] = '\0';
179  SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
180  HeapFree(GetProcessHeap(), 0, GplText);
181  SetFocus(GetDlgItem(hwndDlg, IDOK));
182  return FALSE;
183 
184  case WM_CLOSE:
185  EndDialog(hwndDlg, IDCANCEL);
186  break;
187 
188  case WM_COMMAND:
189  if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
190  {
191  EndDialog(hwndDlg, IDOK);
192  }
193  break;
194 
195  default:
196  break;
197  }
198 
199  return FALSE;
200 }
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:79
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 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:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_CLOSE
Definition: winuser.h:1603
#define BN_CLICKED
Definition: winuser.h:1907
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WM_COMMAND
Definition: winuser.h:1722
#define IDR_GPL
Definition: resource.h:166
#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:1721
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2728 of file wizard.c.

2729 {
2730  PROPSHEETHEADER psh = {0};
2731  HPROPSHEETPAGE *phpage = NULL;
2732  PROPSHEETPAGE psp = {0};
2733  UINT nPages = 0;
2734  HWND hWnd;
2735  MSG msg;
2736  PSETUPDATA pSetupData = NULL;
2737  HMODULE hNetShell = NULL;
2739  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2740 
2741  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2742 
2743  /* Allocate setup data */
2744  pSetupData = HeapAlloc(GetProcessHeap(),
2746  sizeof(SETUPDATA));
2747  if (pSetupData == NULL)
2748  {
2749  LogItem(NULL, L"SetupData allocation failed!");
2750  MessageBoxW(NULL,
2751  L"Setup failed to allocate global data!",
2752  L"ReactOS Setup",
2753  MB_ICONERROR | MB_OK);
2754  goto done;
2755  }
2756  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
2757 
2758  hNetShell = LoadLibraryW(L"netshell.dll");
2759  if (hNetShell != NULL)
2760  {
2761  DPRINT("Netshell.dll loaded!\n");
2762 
2763  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2764  "NetSetupRequestWizardPages");
2765  if (pfn != NULL)
2766  {
2767  pfn(&dwNetworkPageCount, NULL, NULL);
2768  dwPageCount += dwNetworkPageCount;
2769  }
2770  }
2771 
2772  DPRINT("PageCount: %lu\n", dwPageCount);
2773 
2774  phpage = HeapAlloc(GetProcessHeap(),
2776  dwPageCount * sizeof(HPROPSHEETPAGE));
2777  if (phpage == NULL)
2778  {
2779  LogItem(NULL, L"Page array allocation failed!");
2780  MessageBoxW(NULL,
2781  L"Setup failed to allocate page array!",
2782  L"ReactOS Setup",
2783  MB_ICONERROR | MB_OK);
2784  goto done;
2785  }
2786 
2787  /* Process the $winnt$.inf setup file */
2788  ProcessSetupInf(pSetupData);
2789 
2790  /* Create the Welcome page */
2791  psp.dwSize = sizeof(PROPSHEETPAGE);
2792  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2793  psp.hInstance = hDllInstance;
2794  psp.lParam = (LPARAM)pSetupData;
2795  psp.pfnDlgProc = WelcomeDlgProc;
2796  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2797  phpage[nPages++] = CreatePropertySheetPage(&psp);
2798 
2799  /* Create the Acknowledgements page */
2800  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2801  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2802  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2803  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2804  psp.pfnDlgProc = AckPageDlgProc;
2805  phpage[nPages++] = CreatePropertySheetPage(&psp);
2806 
2807  /* Create the Product page */
2808  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2809  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2810  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2811  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2812  psp.pfnDlgProc = ProductPageDlgProc;
2813  phpage[nPages++] = CreatePropertySheetPage(&psp);
2814 
2815  /* Create the Locale page */
2816  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2817  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2818  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2819  psp.pfnDlgProc = LocalePageDlgProc;
2820  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2821  phpage[nPages++] = CreatePropertySheetPage(&psp);
2822 
2823  /* Create the Owner page */
2824  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2825  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2826  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2827  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2828  psp.pfnDlgProc = OwnerPageDlgProc;
2829  phpage[nPages++] = CreatePropertySheetPage(&psp);
2830 
2831  /* Create the Computer page */
2832  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2833  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2834  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2835  psp.pfnDlgProc = ComputerPageDlgProc;
2836  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2837  phpage[nPages++] = CreatePropertySheetPage(&psp);
2838 
2839  /* Create the DateTime page */
2840  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2841  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2842  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2843  psp.pfnDlgProc = DateTimePageDlgProc;
2844  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2845  phpage[nPages++] = CreatePropertySheetPage(&psp);
2846 
2847  /* Create the theme selection page */
2848  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2849  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2850  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2851  psp.pfnDlgProc = ThemePageDlgProc;
2852  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2853  phpage[nPages++] = CreatePropertySheetPage(&psp);
2854 
2857 
2858  if (pfn)
2859  {
2860  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2861  nPages += dwNetworkPageCount;
2862  }
2863 
2864  /* Create the Process page */
2865  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2866  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2867  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2868  psp.pfnDlgProc = ProcessPageDlgProc;
2869  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2870  phpage[nPages++] = CreatePropertySheetPage(&psp);
2871 
2872  /* Create the Finish page */
2873  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2874  psp.pfnDlgProc = FinishDlgProc;
2875  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2876  phpage[nPages++] = CreatePropertySheetPage(&psp);
2877 
2878  ASSERT(nPages == dwPageCount);
2879 
2880  /* Create the property sheet */
2881  psh.dwSize = sizeof(PROPSHEETHEADER);
2882  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2883  psh.hInstance = hDllInstance;
2884  psh.hwndParent = NULL;
2885  psh.nPages = nPages;
2886  psh.nStartPage = 0;
2887  psh.phpage = phpage;
2888  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2889  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2890 
2891  /* Create title font */
2892  pSetupData->hTitleFont = CreateTitleFont();
2893  pSetupData->hBoldFont = CreateBoldFont();
2894 
2895  /* Display the wizard */
2896  hWnd = (HWND)PropertySheet(&psh);
2898 
2899  while (GetMessage(&msg, NULL, 0, 0))
2900  {
2901  if (!IsDialogMessage(hWnd, &msg))
2902  {
2904  DispatchMessage(&msg);
2905  }
2906  }
2907 
2908  DeleteObject(pSetupData->hBoldFont);
2909  DeleteObject(pSetupData->hTitleFont);
2910 
2911  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2912  SetupCloseInfFile(pSetupData->hSetupInf);
2913 
2914 done:
2915  if (phpage != NULL)
2916  HeapFree(GetProcessHeap(), 0, phpage);
2917 
2918  if (hNetShell != NULL)
2919  FreeLibrary(hNetShell);
2920 
2921  if (pSetupData != NULL)
2922  HeapFree(GetProcessHeap(), 0, pSetupData);
2923 
2924  LogItem(L"END_SECTION", L"InstallWizard");
2925 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2076
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:104
#define IDD_PRODUCT
Definition: resource.h:95
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:204
#define IDS_ACKSUBTITLE
Definition: resource.h:101
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:93
#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:1217
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:288
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:119
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2595
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:924
HANDLE HWND
Definition: compat.h:19
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1703
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:113
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define IsDialogMessage
Definition: winuser.h:5784
#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:2725
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:118
#define IDS_COMPUTERTITLE
Definition: resource.h:106
#define IDS_DATETIMETITLE
Definition: resource.h:112
#define IDS_ACKTITLE
Definition: resource.h:100
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:159
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1584
#define LoadLibraryW(x)
Definition: compat.h:606
#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:114
#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:679
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ASSERT(a)
Definition: mode.c:44
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#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:2211
#define IDS_PRODUCTTITLE
Definition: resource.h:158
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:543
HFONT hBoldFont
Definition: syssetup.h:37
#define IDS_OWNERTITLE
Definition: resource.h:103
#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:5765
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:107
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:612
HFONT hTitleFont
Definition: reactos.h:117
#define DPRINT
Definition: sndvol32.h:71
#define IDS_LOCALESUBTITLE
Definition: resource.h:110
#define IDS_LOCALETITLE
Definition: resource.h:109
#define HeapFree(x, y, z)
Definition: compat.h:594
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:75
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by InstallReactOS().

◆ LocalePageDlgProc()

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

Definition at line 1217 of file wizard.c.

1221 {
1223 
1224  /* Retrieve pointer to the global setup data */
1226 
1227  switch (uMsg)
1228  {
1229  case WM_INITDIALOG:
1230  {
1231  /* Save pointer to the global setup data */
1234  WriteUserLocale();
1235 
1237  }
1238  break;
1239 
1240  case WM_COMMAND:
1241  if (HIWORD(wParam) == BN_CLICKED)
1242  {
1243  switch (LOWORD(wParam))
1244  {
1245  case IDC_CUSTOMLOCALE:
1246  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1247  /* FIXME: Update input locale name */
1248  break;
1249 
1250  case IDC_CUSTOMLAYOUT:
1251  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1252  break;
1253  }
1254  }
1255  break;
1256 
1257  case WM_NOTIFY:
1258  {
1259  LPNMHDR lpnm = (LPNMHDR)lParam;
1260 
1261  switch (lpnm->code)
1262  {
1263  case PSN_SETACTIVE:
1264  /* Enable the Back and Next buttons */
1266  if (SetupData->UnattendSetup)
1267  {
1268  // if (!*SetupData->SourcePath)
1269  {
1270  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1271  }
1272 
1274  return TRUE;
1275  }
1276  break;
1277 
1278  case PSN_WIZNEXT:
1279  break;
1280 
1281  case PSN_WIZBACK:
1283  break;
1284 
1285  default:
1286  break;
1287  }
1288  }
1289  break;
1290 
1291  default:
1292  break;
1293  }
1294 
1295  return FALSE;
1296 }
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1196
#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:3134
#define FALSE
Definition: types.h:117
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1147
#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:1907
SETUPDATA SetupData
Definition: reactos.c:41
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1722
uint32_t DWORD_PTR
Definition: typedefs.h:65
HWND WINAPI GetParent(_In_ HWND)
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1090
#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:1721
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 520 of file wizard.c.

521 {
522  WCHAR szText[256];
523  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
524 
525  switch (nOption)
526  {
529  break;
530 
533  break;
534 
535  default:
536  return;
537  }
538 
540 }
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:163
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:408
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:162
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 const WCHAR szText[]
Definition: dialog.c:139
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:98

Referenced by ProductPageDlgProc().

◆ OwnerPageDlgProc()

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

Definition at line 679 of file wizard.c.

683 {
684  WCHAR OwnerName[51];
685  WCHAR OwnerOrganization[51];
686  WCHAR Title[64];
687  WCHAR ErrorName[256];
688  LPNMHDR lpnm;
689  PSETUPDATA pSetupData;
690 
691  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
692 
693  switch (uMsg)
694  {
695  case WM_INITDIALOG:
696  {
697  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
698  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
699 
700  /* set a localized ('Owner') placeholder string as default */
701  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
702  {
703  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
704  }
705 
708 
709  /* Set focus to owner name */
710  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
711 
712  /* Select the default text to quickly overwrite it by typing */
713  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
714  }
715  break;
716 
717 
718  case WM_NOTIFY:
719  {
720  lpnm = (LPNMHDR)lParam;
721 
722  switch (lpnm->code)
723  {
724  case PSN_SETACTIVE:
725  /* Enable the Back and Next buttons */
727  if (pSetupData->UnattendSetup)
728  {
729  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
731  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
732  {
734  return TRUE;
735  }
736  }
737  break;
738 
739  case PSN_WIZNEXT:
740  OwnerName[0] = 0;
741  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
742  {
744  {
745  wcscpy(Title, L"ReactOS Setup");
746  }
747  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
748  {
749  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
750  }
751  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
752 
753  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
754  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
755 
756  return TRUE;
757  }
758 
759  OwnerOrganization[0] = 0;
760  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
761 
762  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
763  {
764  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
765  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
766  return TRUE;
767  }
768 
769  case PSN_WIZBACK:
770  pSetupData->UnattendSetup = FALSE;
771  break;
772 
773  default:
774  break;
775  }
776  }
777  break;
778 
779  default:
780  break;
781  }
782 
783  return FALSE;
784 }
#define EM_LIMITTEXT
Definition: winuser.h:1982
#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:133
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendDlgItemMessage
Definition: winuser.h:5817
#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:3134
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
#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:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_OWNERORGANIZATION
Definition: resource.h:47
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
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:2000
#define IDS_WZD_NAME
Definition: resource.h:135
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#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:5818
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:637
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ ProcessPageDlgProc()

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

Definition at line 2076 of file wizard.c.

2080 {
2082  PREGISTRATIONNOTIFY RegistrationNotify;
2083  static UINT oldActivityID = -1;
2084  WCHAR Title[64];
2085 
2086  /* Retrieve pointer to the global setup data */
2088 
2089  switch (uMsg)
2090  {
2091  case WM_INITDIALOG:
2092  {
2093  /* Save pointer to the global setup data */
2096  }
2097  break;
2098 
2099  case WM_NOTIFY:
2100  {
2101  LPNMHDR lpnm = (LPNMHDR)lParam;
2102  ULONG MaxProgress = 0;
2103 
2104  switch (lpnm->code)
2105  {
2106  case PSN_SETACTIVE:
2107  /* Disable the Back and Next buttons */
2108  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2109 
2110  StartComponentRegistration(hwndDlg, &MaxProgress);
2111 
2113  0, MAKELPARAM(0, MaxProgress));
2115  0, 0);
2116  break;
2117 
2118  case PSN_WIZNEXT:
2119  break;
2120 
2121  case PSN_WIZBACK:
2123  break;
2124 
2125  default:
2126  break;
2127  }
2128  }
2129  break;
2130 
2132  {
2133  WCHAR Activity[64];
2134  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2135  // update if necessary only
2136  if (oldActivityID != RegistrationNotify->ActivityID)
2137  {
2138  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2139  Activity,
2140  ARRAYSIZE(Activity)))
2141  {
2143  0, (LPARAM) Activity);
2144  }
2145  oldActivityID = RegistrationNotify->ActivityID;
2146  }
2148  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2149  L"" : RegistrationNotify->CurrentItem));
2151  RegistrationNotify->Progress, 0);
2152  if (NULL != RegistrationNotify->ErrorMessage)
2153  {
2155  Title, ARRAYSIZE(Title)))
2156  {
2157  wcscpy(Title, L"ReactOS Setup");
2158  }
2159  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2160  Title, MB_ICONERROR | MB_OK);
2161 
2162  }
2163 
2164  if (wParam)
2165  {
2166  /* Enable the Back and Next buttons */
2169  }
2170  }
2171  return TRUE;
2172 
2173  default:
2174  break;
2175  }
2176 
2177  return FALSE;
2178 }
#define IDC_ITEM
Definition: resource.h:56
LPCWSTR CurrentItem
Definition: wizard.c:39
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define PBM_SETPOS
Definition: commctrl.h:2184
#define SendDlgItemMessage
Definition: winuser.h:5817
#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
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
#define IDC_PROCESSPROGRESS
Definition: resource.h:57
UINT code
Definition: winuser.h:3134
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define FALSE
Definition: types.h:117
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define GWLP_USERDATA
Definition: treelist.c:63
#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:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
static BOOL StartComponentRegistration(HWND hwndDlg, PULONG MaxProgress)
Definition: wizard.c:2009
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SETUPDATA SetupData
Definition: reactos.c:41
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define MB_ICONERROR
Definition: winuser.h:781
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define PSBTN_NEXT
Definition: prsht.h:147
HWND WINAPI GetParent(_In_ HWND)
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define PSN_WIZBACK
Definition: prsht.h:120
unsigned int ULONG
Definition: retypes.h:1
BOOL UnattendSetup
Definition: syssetup.h:46
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define GetWindowLongPtr
Definition: treelist.c:73
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define IDC_ACTIVITY
Definition: resource.h:55
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define WM_INITDIALOG
Definition: winuser.h:1721
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 2595 of file wizard.c.

2597 {
2599  WCHAR szValue[MAX_PATH];
2600  INFCONTEXT InfContext;
2601  DWORD LineLength;
2602  HKEY hKey;
2603  LONG res;
2604 
2605  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2606 
2607  /* Retrieve the path of the setup INF */
2609  wcscat(szPath, L"\\$winnt$.inf");
2610 
2611  /* Open the setup INF */
2612  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2613  NULL,
2615  NULL);
2616  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2617  {
2618  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2619  return;
2620  }
2621 
2622 
2623  /* Retrieve the NT source path from which the 1st-stage installer was run */
2624  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2625  L"data",
2626  L"sourcepath",
2627  &InfContext))
2628  {
2629  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2630  return;
2631  }
2632 
2633  if (!SetupGetStringFieldW(&InfContext,
2634  1,
2635  szValue,
2636  ARRAYSIZE(szValue),
2637  &LineLength))
2638  {
2639  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2640  return;
2641  }
2642 
2643  *pSetupData->SourcePath = UNICODE_NULL;
2644 
2645  /* Close the setup INF as we are going to modify it manually */
2646  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2647  SetupCloseInfFile(pSetupData->hSetupInf);
2648 
2649 
2650  /* Find the installation source path in Win32 format */
2651  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2652  _countof(pSetupData->SourcePath),
2653  szValue))
2654  {
2655  *pSetupData->SourcePath = UNICODE_NULL;
2656  }
2657 
2658  /* Save the path in Win32 format in the setup INF */
2659  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2660  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2661 
2662  /*
2663  * Save it also in the registry, in the following keys:
2664  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2665  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2666  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2667  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2668  */
2669 #if 0
2671  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2672  0,
2674  &hKey);
2675 
2676  if (res != ERROR_SUCCESS)
2677  {
2678  return FALSE;
2679  }
2680 #endif
2681 
2683  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2684  0, NULL,
2686  KEY_ALL_ACCESS, // KEY_WRITE
2687  NULL,
2688  &hKey,
2689  NULL);
2690  if (res == ERROR_SUCCESS)
2691  {
2693  L"SourcePath",
2694  0,
2695  REG_SZ,
2696  (LPBYTE)pSetupData->SourcePath,
2697  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2698 
2700  L"ServicePackSourcePath",
2701  0,
2702  REG_SZ,
2703  (LPBYTE)pSetupData->SourcePath,
2704  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2705 
2706  RegCloseKey(hKey);
2707  }
2708 
2709 
2710  /* Now, re-open the setup INF (this must succeed) */
2711  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2712  NULL,
2714  NULL);
2715  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2716  {
2717  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2718  return;
2719  }
2720 
2721  /* Process the unattended section of the setup file */
2722  ProcessUnattendSection(pSetupData);
2723 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2310
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:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define swprintf
Definition: precomp.h:40
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
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:4895
__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
static const WCHAR L[]
Definition: oid.c:1250
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:2312
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2367
_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 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:3366
#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 2367 of file wizard.c.

2369 {
2370  INFCONTEXT InfContext;
2371  WCHAR szName[256];
2372  WCHAR szValue[MAX_PATH];
2373  DWORD LineLength;
2374  HKEY hKey;
2375 
2376  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2377  L"Unattend",
2378  L"UnattendSetupEnabled",
2379  &InfContext))
2380  {
2381  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2382  return;
2383  }
2384 
2385  if (!SetupGetStringFieldW(&InfContext,
2386  1,
2387  szValue,
2388  ARRAYSIZE(szValue),
2389  &LineLength))
2390  {
2391  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2392  return;
2393  }
2394 
2395  if (_wcsicmp(szValue, L"yes") != 0)
2396  {
2397  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2398  return;
2399  }
2400 
2401  pSetupData->UnattendSetup = TRUE;
2402 
2403  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2404  L"Unattend",
2405  NULL,
2406  &InfContext))
2407  {
2408  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2409  return;
2410  }
2411 
2412  do
2413  {
2414  if (!SetupGetStringFieldW(&InfContext,
2415  0,
2416  szName,
2417  ARRAYSIZE(szName),
2418  &LineLength))
2419  {
2420  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2421  return;
2422  }
2423 
2424  if (!SetupGetStringFieldW(&InfContext,
2425  1,
2426  szValue,
2427  ARRAYSIZE(szValue),
2428  &LineLength))
2429  {
2430  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2431  return;
2432  }
2433  DPRINT1("Name %S Value %S\n", szName, szValue);
2434  if (!_wcsicmp(szName, L"FullName"))
2435  {
2436  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2437  {
2438  wcscpy(pSetupData->OwnerName, szValue);
2439  }
2440  }
2441  else if (!_wcsicmp(szName, L"OrgName"))
2442  {
2443  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2444  {
2445  wcscpy(pSetupData->OwnerOrganization, szValue);
2446  }
2447  }
2448  else if (!_wcsicmp(szName, L"ComputerName"))
2449  {
2450  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2451  {
2452  wcscpy(pSetupData->ComputerName, szValue);
2453  }
2454  }
2455  else if (!_wcsicmp(szName, L"AdminPassword"))
2456  {
2457  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2458  {
2459  wcscpy(pSetupData->AdminPassword, szValue);
2460  }
2461  }
2462  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2463  {
2464  pSetupData->TimeZoneIndex = _wtoi(szValue);
2465  }
2466  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2467  {
2468  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2469  }
2470  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2471  {
2472  if (!_wcsicmp(szValue, L"yes"))
2473  pSetupData->DisableGeckoInst = TRUE;
2474  else
2475  pSetupData->DisableGeckoInst = FALSE;
2476  }
2477  else if (!_wcsicmp(szName, L"ProductOption"))
2478  {
2479  pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2480  }
2481  } while (SetupFindNextLine(&InfContext, &InfContext));
2482 
2483  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2484  L"Display",
2485  NULL,
2486  &InfContext))
2487  {
2488  DEVMODEW dm = { { 0 } };
2489  dm.dmSize = sizeof(dm);
2491  {
2492  do
2493  {
2494  int iValue;
2495  if (!SetupGetStringFieldW(&InfContext,
2496  0,
2497  szName,
2498  ARRAYSIZE(szName),
2499  &LineLength))
2500  {
2501  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2502  return;
2503  }
2504 
2505  if (!SetupGetStringFieldW(&InfContext,
2506  1,
2507  szValue,
2508  ARRAYSIZE(szValue),
2509  &LineLength))
2510  {
2511  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2512  return;
2513  }
2514  iValue = _wtoi(szValue);
2515  DPRINT1("Name %S Value %i\n", szName, iValue);
2516 
2517  if (!iValue)
2518  continue;
2519 
2520  if (!_wcsicmp(szName, L"BitsPerPel"))
2521  {
2522  dm.dmFields |= DM_BITSPERPEL;
2523  dm.dmBitsPerPel = iValue;
2524  }
2525  else if (!_wcsicmp(szName, L"XResolution"))
2526  {
2527  dm.dmFields |= DM_PELSWIDTH;
2528  dm.dmPelsWidth = iValue;
2529  }
2530  else if (!_wcsicmp(szName, L"YResolution"))
2531  {
2532  dm.dmFields |= DM_PELSHEIGHT;
2533  dm.dmPelsHeight = iValue;
2534  }
2535  else if (!_wcsicmp(szName, L"VRefresh"))
2536  {
2538  dm.dmDisplayFrequency = iValue;
2539  }
2540  } while (SetupFindNextLine(&InfContext, &InfContext));
2541 
2543  }
2544  }
2545 
2547  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2548  0,
2549  KEY_SET_VALUE,
2550  &hKey) != ERROR_SUCCESS)
2551  {
2552  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2553  return;
2554  }
2555 
2556  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2557  L"GuiRunOnce",
2558  NULL,
2559  &InfContext))
2560  {
2561  int i = 0;
2562  do
2563  {
2564  if (SetupGetStringFieldW(&InfContext,
2565  0,
2566  szValue,
2567  ARRAYSIZE(szValue),
2568  NULL))
2569  {
2571  swprintf(szName, L"%d", i);
2572  DPRINT("szName %S szValue %S\n", szName, szValue);
2573 
2574  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2575  {
2576  DPRINT("value %S\n", szPath);
2577  if (RegSetValueExW(hKey,
2578  szName,
2579  0,
2580  REG_SZ,
2581  (const BYTE*)szPath,
2582  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2583  {
2584  i++;
2585  }
2586  }
2587  }
2588  } while (SetupFindNextLine(&InfContext, &InfContext));
2589  }
2590 
2591  RegCloseKey(hKey);
2592 }
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
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
DWORD dmFields
Definition: wingdi.h:1621
#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
#define swprintf
Definition: precomp.h:40
DWORD dmBitsPerPel
Definition: wingdi.h:1646
enum _PRODUCT_OPTION PRODUCT_OPTION
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define DM_PELSWIDTH
Definition: wingdi.h:1268
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#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
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:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
WORD dmSize
Definition: wingdi.h:1619
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1647
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1271
unsigned char BYTE
Definition: xxhash.c:193
DWORD dmDisplayFrequency
Definition: wingdi.h:1653
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:1269
FxAutoRegKey hKey
LPCWSTR szPath
Definition: env.c:37
#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:1648
static const WCHAR szName[]
Definition: msipriv.h:1194
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define DM_BITSPERPEL
Definition: wingdi.h:1267
#define DPRINT
Definition: sndvol32.h:71
_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 543 of file wizard.c.

544 {
545  LPNMHDR lpnm;
546  PSETUPDATA pSetupData;
547  INT iItem;
548  WCHAR szText[64], szDefault[64];
549  HICON hIcon;
550 
551  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
552 
553  switch (uMsg)
554  {
555  case WM_INITDIALOG:
556  {
557  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
558  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
559 
560  LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
561 
564  {
566  StringCchCatW(szText, _countof(szText), szDefault);
567  }
569 
572  {
574  StringCchCatW(szText, _countof(szText), szDefault);
575  }
577 
580 
583  return TRUE;
584  }
585 
586  case WM_COMMAND:
588  {
589  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
590  OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
591  }
592  break;
593 
594  case WM_NOTIFY:
595  {
596  lpnm = (LPNMHDR)lParam;
597 
598  switch (lpnm->code)
599  {
600  case PSN_SETACTIVE:
601  /* Enable the Back and Next buttons */
603  if (pSetupData->UnattendSetup)
604  {
605  OnChooseOption(hwndDlg, pSetupData->ProductOption);
606  DoWriteProductOption(pSetupData->ProductOption);
608  return TRUE;
609  }
610  break;
611 
612  case PSN_WIZNEXT:
613  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
614  pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
615  DoWriteProductOption(pSetupData->ProductOption);
616  break;
617 
618  case PSN_WIZBACK:
619  pSetupData->UnattendSetup = FALSE;
620  break;
621 
622  default:
623  break;
624  }
625  }
626  break;
627 
628  default:
629  break;
630  }
631 
632  return FALSE;
633 }
#define STM_SETICON
Definition: winuser.h:2074
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:1925
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:3134
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
#define CB_ADDSTRING
Definition: winuser.h:1918
#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:96
#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:520
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:97
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:415
#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)
static const WCHAR L[]
Definition: oid.c:1250
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define DWLP_USER
Definition: winuser.h:866
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
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:1961
#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:5788
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:161
#define IDS_DEFAULT
Definition: resource.h:164
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:160
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ RegistrationNotificationProc()

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

Definition at line 1817 of file wizard.c.

1821 {
1822  PREGISTRATIONDATA RegistrationData;
1823  REGISTRATIONNOTIFY RegistrationNotify;
1824  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1825  UINT MessageID;
1826  WCHAR ErrorMessage[128];
1827 
1828  RegistrationData = (PREGISTRATIONDATA) Context;
1829 
1832  {
1833  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1834  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1835  if (NULL == RegistrationNotify.CurrentItem)
1836  {
1837  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1838  }
1839  else
1840  {
1841  RegistrationNotify.CurrentItem++;
1842  }
1843 
1845  {
1846  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1847  StatusInfo->FileName);
1848  RegistrationNotify.ErrorMessage = NULL;
1849  RegistrationNotify.Progress = RegistrationData->Registered;
1850  }
1851  else
1852  {
1853  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1854  StatusInfo->FileName);
1855  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1856  StatusInfo->FailureCode);
1857  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1858  {
1859  switch(StatusInfo->FailureCode)
1860  {
1861  case SPREG_LOADLIBRARY:
1863  break;
1864  case SPREG_GETPROCADDR:
1866  break;
1867  case SPREG_REGSVR:
1869  break;
1870  case SPREG_DLLINSTALL:
1872  break;
1873  case SPREG_TIMEOUT:
1875  break;
1876  default:
1878  break;
1879  }
1881  ErrorMessage,
1883  {
1884  ErrorMessage[0] = L'\0';
1885  }
1886  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
1887  {
1889  StatusInfo->Win32Error, 0,
1892  NULL);
1893  }
1894  RegistrationNotify.ErrorMessage = ErrorMessage;
1895  }
1896  else
1897  {
1898  RegistrationNotify.ErrorMessage = NULL;
1899  }
1900  if (RegistrationData->Registered < RegistrationData->DllCount)
1901  {
1902  RegistrationData->Registered++;
1903  }
1904  }
1905 
1906  RegistrationNotify.Progress = RegistrationData->Registered;
1907  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1908  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1909  0, (LPARAM) &RegistrationNotify);
1910 
1911  return FILEOP_DOIT;
1912  }
1913  else
1914  {
1915  DPRINT1("Received unexpected notification %u\n", Notification);
1916  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
1917  Notification, Param1, Param2);
1918  }
1919 }
LPCWSTR CurrentItem
Definition: wizard.c:39
ULONG DllCount
Definition: wizard.c:46
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:126
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:565
static VOID ErrorMessage(DWORD dwErrorCode, LPWSTR szFormat,...)
Definition: attrib.c:51
#define IDS_TIMEOUT
Definition: resource.h:14
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define SPREG_GETPROCADDR
Definition: setupapi.h:649
ULONG Registered
Definition: wizard.c:47
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:125
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SetupDefaultQueueCallback
Definition: setupapi.h:2567
PVOID DefaultContext
Definition: wizard.c:48
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define SPREG_REGSVR
Definition: setupapi.h:650
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:129
LONG_PTR LPARAM
Definition: windef.h:208
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
static HINSTANCE hDllInstance
Definition: clb.c:30
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:127
#define FILEOP_DOIT
Definition: fileqsup.h:48
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_REASON_UNKNOWN
Definition: resource.h:131
#define wcsrchr
Definition: compat.h:16
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:113
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:566
struct _REGISTRATIONDATA * PREGISTRATIONDATA
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5818
#define SPREG_DLLINSTALL
Definition: setupapi.h:651
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define DPRINT
Definition: sndvol32.h:71
#define SPREG_TIMEOUT
Definition: setupapi.h:652
#define IDS_REGSVR_FAILED
Definition: resource.h:128
#define SPREG_LOADLIBRARY
Definition: setupapi.h:648
#define SPREG_SUCCESS
Definition: setupapi.h:647

Referenced by RegistrationProc().

◆ RegistrationProc()

static DWORD CALLBACK RegistrationProc ( LPVOID  Parameter)
static

Definition at line 1923 of file wizard.c.

1924 {
1925  PREGISTRATIONDATA RegistrationData;
1926  REGISTRATIONNOTIFY RegistrationNotify;
1927  DWORD LastError = NO_ERROR;
1928  WCHAR UnknownError[84];
1929 
1930  RegistrationData = (PREGISTRATIONDATA) Parameter;
1931  RegistrationData->Registered = 0;
1932  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
1933 
1934  _SEH2_TRY
1935  {
1936  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
1937  hSysSetupInf,
1938  L"RegistrationPhase2",
1939  SPINST_REGISTRY |
1940  SPINST_REGISTERCALLBACKAWARE |
1941  SPINST_REGSVR,
1942  0,
1943  NULL,
1944  0,
1946  RegistrationData,
1947  NULL,
1948  NULL))
1949  {
1950  LastError = GetLastError();
1951  }
1952  }
1954  {
1955  DPRINT("Catching exception\n");
1957  }
1958  _SEH2_END;
1959 
1960  if (NO_ERROR == LastError)
1961  {
1962  RegistrationNotify.ErrorMessage = NULL;
1963  }
1964  else
1965  {
1966  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
1967  LastError);
1969  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
1970  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
1971  NULL))
1972  {
1974  UnknownError,
1975  ARRAYSIZE(UnknownError) - 20))
1976  {
1977  wcscpy(UnknownError, L"Unknown error");
1978  }
1979  wcscat(UnknownError, L" ");
1980  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
1981  RegistrationNotify.ErrorMessage = UnknownError;
1982  }
1983  }
1984 
1985  RegistrationNotify.Progress = RegistrationData->DllCount;
1986  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1987  RegistrationNotify.CurrentItem = NULL;
1988  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1989  1, (LPARAM) &RegistrationNotify);
1990  if (NULL != RegistrationNotify.ErrorMessage &&
1991  UnknownError != RegistrationNotify.ErrorMessage)
1992  {
1993  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
1994  }
1995 
1996  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
1997  HeapFree(GetProcessHeap(), 0, RegistrationData);
1998 
1999  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
2000 
2001  // FIXME: Move this call to a separate cleanup page!
2003 
2004  return 0;
2005 }
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:433
LPCWSTR CurrentItem
Definition: wizard.c:39
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
ULONG DllCount
Definition: wizard.c:46
#define SPINST_REGSVR
Definition: setupapi.h:589
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
ULONG Registered
Definition: wizard.c:47
_In_ PVOID Parameter
Definition: ldrtypes.h:241
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define NO_ERROR
Definition: dderror.h:5
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
_SEH2_TRY
Definition: create.c:4226
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:125
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1817
PVOID DefaultContext
Definition: wizard.c:48
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
#define SPINST_REGISTRY
Definition: setupapi.h:585
LONG_PTR LPARAM
Definition: windef.h:208
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:595
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned long DWORD
Definition: ntddk_ex.h:95
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
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_UNKNOWN_ERROR
Definition: resource.h:124
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
HWND WINAPI GetParent(_In_ HWND)
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
_SEH2_END
Definition: create.c:4400
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1677
struct _REGISTRATIONDATA * PREGISTRATIONDATA
_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 DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5818
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define DPRINT
Definition: sndvol32.h:71
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by StartComponentRegistration().

◆ RetrieveTimeZone()

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

Definition at line 1317 of file wizard.c.

1320 {
1321  LONG lError;
1324  PTIMEZONE_ENTRY Current;
1325  ULONG DescriptionSize;
1326  ULONG StandardNameSize;
1327  ULONG DaylightNameSize;
1328 
1330  if (Entry == NULL)
1331  {
1332  return ERROR_NOT_ENOUGH_MEMORY;
1333  }
1334 
1335  DescriptionSize = sizeof(Entry->Description);
1336  StandardNameSize = sizeof(Entry->StandardName);
1337  DaylightNameSize = sizeof(Entry->DaylightName);
1338 
1339  lError = QueryTimeZoneData(hZoneKey,
1340  &Entry->Index,
1341  &Entry->TimezoneInfo,
1342  Entry->Description,
1343  &DescriptionSize,
1344  Entry->StandardName,
1345  &StandardNameSize,
1346  Entry->DaylightName,
1347  &DaylightNameSize);
1348  if (lError != ERROR_SUCCESS)
1349  {
1350  HeapFree(GetProcessHeap(), 0, Entry);
1351  return lError;
1352  }
1353 
1354  if (SetupData->TimeZoneListHead == NULL &&
1356  {
1357  Entry->Prev = NULL;
1358  Entry->Next = NULL;
1361  }
1362  else
1363  {
1364  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1365  if (Current != NULL)
1366  {
1367  if (Current == SetupData->TimeZoneListHead)
1368  {
1369  /* Prepend to head */
1370  Entry->Prev = NULL;
1371  Entry->Next = SetupData->TimeZoneListHead;
1372  SetupData->TimeZoneListHead->Prev = Entry;
1374  }
1375  else
1376  {
1377  /* Insert before current */
1378  Entry->Prev = Current->Prev;
1379  Entry->Next = Current;
1380  Current->Prev->Next = Entry;
1381  Current->Prev = Entry;
1382  }
1383  }
1384  else
1385  {
1386  /* Append to tail */
1387  Entry->Prev = SetupData->TimeZoneListTail;
1388  Entry->Next = NULL;
1391  }
1392  }
1393 
1394  return ERROR_SUCCESS;
1395 }
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:627
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1300
Definition: timezone.c:15
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
long LONG
Definition: pedump.c:60
#define GetProcessHeap()
Definition: compat.h:595
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:594
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 1147 of file wizard.c.

1148 {
1149  MSG msg;
1150  STARTUPINFOW StartupInfo;
1151  PROCESS_INFORMATION ProcessInformation;
1152  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1153 
1154  if (!pwszCPLParameters)
1155  {
1156  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1157  return FALSE;
1158  }
1159 
1160  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1161  StartupInfo.cb = sizeof(StartupInfo);
1162  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1163 
1164  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1165  wcscat(CmdLine, pwszCPLParameters);
1166 
1167  if (!CreateProcessW(NULL,
1168  CmdLine,
1169  NULL,
1170  NULL,
1171  FALSE,
1172  0,
1173  NULL,
1174  NULL,
1175  &StartupInfo,
1176  &ProcessInformation))
1177  {
1178  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1179  return FALSE;
1180  }
1181 
1183  {
1184  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1185  {
1188  }
1189  }
1190  CloseHandle(ProcessInformation.hThread);
1191  CloseHandle(ProcessInformation.hProcess);
1192  return TRUE;
1193 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define ZeroMemory
Definition: winbase.h:1664
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4594
#define WAIT_OBJECT_0
Definition: winbase.h:403
DWORD cb
Definition: winbase.h:846
#define ASSERT(a)
Definition: mode.c:44
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
CHAR CmdLine[MAX_PATH]
Definition: mach.c:34
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
static const WCHAR L[]
Definition: oid.c:1250
#define MB_ICONERROR
Definition: winuser.h:781
#define QS_ALLINPUT
Definition: winuser.h:874
_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 msg(x)
Definition: auth_time.c:54
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define INFINITE
Definition: serial.h:102

Referenced by LocalePageDlgProc(), and ThemePageDlgProc().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2182 of file wizard.c.

2183 {
2184  HKEY hKey = 0;
2185  DWORD InProgress = 0;
2186  DWORD InstallDate;
2187 
2189  L"SYSTEM\\Setup",
2190  0,
2191  KEY_WRITE,
2192  &hKey ) == ERROR_SUCCESS)
2193  {
2194  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2195  RegCloseKey( hKey );
2196  }
2197 
2199  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2200  0,
2201  KEY_WRITE,
2202  &hKey ) == ERROR_SUCCESS)
2203  {
2204  InstallDate = (DWORD)time(NULL);
2205  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2206  RegCloseKey( hKey );
2207  }
2208 }
#define ERROR_SUCCESS
Definition: deptool.c:10
__u16 time
Definition: mkdosfs.c:366
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#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:4895
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by FinishDlgProc().

◆ SetKeyboardLayoutName()

static VOID SetKeyboardLayoutName ( HWND  hwnd)
static

Definition at line 1090 of file wizard.c.

1091 {
1092 #if 0
1093  TCHAR szLayoutPath[256];
1094  TCHAR szLocaleName[32];
1095  DWORD dwLocaleSize;
1096  HKEY hKey;
1097 
1099  _T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
1100  0,
1102  &hKey))
1103  return;
1104 
1105  dwValueSize = 16 * sizeof(TCHAR);
1106  if (RegQueryValueEx(hKey,
1107  NULL,
1108  NULL,
1109  NULL,
1110  szLocaleName,
1111  &dwLocaleSize))
1112  {
1113  RegCloseKey(hKey);
1114  return;
1115  }
1116 
1117  _tcscpy(szLayoutPath,
1118  _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"));
1119  _tcscat(szLayoutPath,
1120  szLocaleName);
1121 
1123  szLayoutPath,
1124  0,
1126  &hKey))
1127  return;
1128 
1129  dwValueSize = 32 * sizeof(TCHAR);
1130  if (RegQueryValueEx(hKey,
1131  _T("Layout Text"),
1132  NULL,
1133  NULL,
1134  szLocaleName,
1135  &dwLocaleSize))
1136  {
1137  RegCloseKey(hKey);
1138  return;
1139  }
1140 
1141  RegCloseKey(hKey);
1142 #endif
1143 }
#define RegQueryValueEx
Definition: winreg.h:524
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RegOpenKeyEx
Definition: winreg.h:520
FxAutoRegKey hKey
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define NULL
Definition: types.h:112
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by LocalePageDlgProc().

◆ SetLocalTimeZone()

static VOID SetLocalTimeZone ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1456 of file wizard.c.

1457 {
1458  TIME_ZONE_INFORMATION TimeZoneInformation;
1460  DWORD dwIndex;
1461  DWORD i;
1462 
1463  dwIndex = SendMessage(hwnd,
1464  CB_GETCURSEL,
1465  0,
1466  0);
1467 
1468  i = 0;
1470  while (i < dwIndex)
1471  {
1472  if (Entry == NULL)
1473  return;
1474 
1475  i++;
1476  Entry = Entry->Next;
1477  }
1478 
1479  wcscpy(TimeZoneInformation.StandardName,
1480  Entry->StandardName);
1481  wcscpy(TimeZoneInformation.DaylightName,
1482  Entry->DaylightName);
1483 
1484  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1485  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1486  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1487 
1488  memcpy(&TimeZoneInformation.StandardDate,
1489  &Entry->TimezoneInfo.StandardDate,
1490  sizeof(SYSTEMTIME));
1491  memcpy(&TimeZoneInformation.DaylightDate,
1492  &Entry->TimezoneInfo.DaylightDate,
1493  sizeof(SYSTEMTIME));
1494 
1495  /* Set time zone information */
1496  SetTimeZoneInformation(&TimeZoneInformation);
1497 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
#define CB_GETCURSEL
Definition: winuser.h:1925
unsigned long DWORD
Definition: ntddk_ex.h:95
SETUPDATA SetupData
Definition: reactos.c:41
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
SYSTEMTIME StandardDate
Definition: winbase.h:1190
WCHAR DaylightName[32]
Definition: winbase.h:1192
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 NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define SendMessage
Definition: winuser.h:5818
WCHAR StandardName[32]
Definition: winbase.h:1189
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1193

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1530 of file wizard.c.

1531 {
1532  BOOL Ret = FALSE;
1533 
1534  /*
1535  * Call SetLocalTime twice to ensure correct results
1536  */
1537  Ret = SetLocalTime(&SetupData->SystemTime) &&
1539 
1540  return Ret;
1541 }
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
SETUPDATA SetupData
Definition: reactos.c:41
SYSTEMTIME SystemTime
Definition: syssetup.h:49
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356

Referenced by WriteDateTimeSettings().

◆ ShowTimeZoneList()

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

Definition at line 1426 of file wizard.c.

1427 {
1429  DWORD dwIndex = 0;
1430  DWORD dwCount;
1431 
1432  GetTimeZoneListIndex(&dwEntryIndex);
1433 
1435  while (Entry != NULL)
1436  {
1437  dwCount = SendMessage(hwnd,
1438  CB_ADDSTRING,
1439  0,
1440  (LPARAM)Entry->Description);
1441 
1442  if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1443  dwIndex = dwCount;
1444 
1445  Entry = Entry->Next;
1446  }
1447 
1448  SendMessage(hwnd,
1449  CB_SETCURSEL,
1450  (WPARAM)dwIndex,
1451  0);
1452 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG_PTR LPARAM
Definition: windef.h:208
unsigned long DWORD
Definition: ntddk_ex.h:95
SETUPDATA SetupData
Definition: reactos.c:41
#define CB_SETCURSEL
Definition: winuser.h:1943
#define NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define SendMessage
Definition: winuser.h:5818
base of all file and directory entries
Definition: entries.h:82

Referenced by DateTimePageDlgProc().

◆ StartComponentRegistration()

static BOOL StartComponentRegistration ( HWND  hwndDlg,
PULONG  MaxProgress 
)
static

Definition at line 2009 of file wizard.c.

2010 {
2011  HANDLE RegistrationThread;
2012  LONG DllCount;
2014  WCHAR SectionName[512];
2015  PREGISTRATIONDATA RegistrationData;
2016 
2017  DllCount = -1;
2018  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2019  L"RegisterDlls", &Context))
2020  {
2021  DPRINT1("No RegistrationPhase2 section found\n");
2022  return FALSE;
2023  }
2024  if (!SetupGetStringFieldW(&Context, 1, SectionName,
2025  ARRAYSIZE(SectionName),
2026  NULL))
2027  {
2028  DPRINT1("Unable to retrieve section name\n");
2029  return FALSE;
2030  }
2031  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2032  DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2033  if (DllCount < 0)
2034  {
2036  return FALSE;
2037  }
2038 
2039  *MaxProgress = (ULONG) DllCount;
2040 
2041  /*
2042  * Create a background thread to do the actual registrations, so the
2043  * main thread can just run its message loop.
2044  */
2045  RegistrationThread = NULL;
2046  RegistrationData = HeapAlloc(GetProcessHeap(), 0,
2047  sizeof(REGISTRATIONDATA));
2048  if (RegistrationData != NULL)
2049  {
2050  RegistrationData->hwndDlg = hwndDlg;
2051  RegistrationData->DllCount = DllCount;
2052  RegistrationThread = CreateThread(NULL, 0, RegistrationProc,
2053  RegistrationData, 0, NULL);
2054  if (RegistrationThread != NULL)
2055  {
2056  CloseHandle(RegistrationThread);
2057  }
2058  else
2059  {
2060  DPRINT1("CreateThread failed, error %u\n", GetLastError());
2061  HeapFree(GetProcessHeap(), 0, RegistrationData);
2062  return FALSE;
2063  }
2064  }
2065  else
2066  {
2067  DPRINT1("HeapAlloc() failed, error %u\n", GetLastError());
2068  return FALSE;
2069  }
2070 
2071  return TRUE;
2072 }
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define CloseHandle
Definition: compat.h:598
ULONG DllCount
Definition: wizard.c:46
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD CALLBACK RegistrationProc(LPVOID Parameter)
Definition: wizard.c:1923
#define SetLastError(x)
Definition: compat.h:611
static const WCHAR L[]
Definition: oid.c:1250
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1034
unsigned int ULONG
Definition: retypes.h:1
#define DPRINT
Definition: sndvol32.h:71
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:594