ReactOS  0.4.15-dev-1197-g8081ba9
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)
 
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 2710 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:40
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:92
#define IDD_GPL
Definition: resource.h:76
#define TRUE
Definition: types.h:120
#define IDC_VIEWGPL
Definition: resource.h:41
#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
smooth NULL
Definition: ftsmooth.c:416
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:484
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:118
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 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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:483
#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
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SWP_NOSIZE
Definition: winuser.h:1230
HWND WINAPI GetParent(_In_ HWND)
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:620
#define EM_LIMITTEXT
Definition: winuser.h:1982
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2271
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:136
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:134
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
smooth NULL
Definition: ftsmooth.c:416
#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:50
#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:49
#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 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:135
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:137
#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:73
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 ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
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
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
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

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
HFONT hFont
Definition: main.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
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
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
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by InstallWizard().

◆ DateTimePageDlgProc()

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

Definition at line 1587 of file wizard.c.

1591 {
1593 
1594  /* Retrieve pointer to the global setup data */
1596 
1597  switch (uMsg)
1598  {
1599  case WM_INITDIALOG:
1600  {
1601  /* Save pointer to the global setup data */
1604 
1606 
1607  if (SetupData->UnattendSetup)
1608  {
1611 
1613  {
1615  }
1616  }
1617  else
1618  {
1620  SetupData, -1);
1621 
1623  }
1624  break;
1625  }
1626 
1627  case WM_TIMER:
1628  UpdateLocalSystemTime(hwndDlg);
1629  break;
1630 
1631  case WM_NOTIFY:
1632  switch (((LPNMHDR)lParam)->code)
1633  {
1634  case PSN_SETACTIVE:
1635  /* Enable the Back and Next buttons */
1638  {
1640  return TRUE;
1641  }
1642  SetTimer(hwndDlg, 1, 1000, NULL);
1643  break;
1644 
1645  case PSN_KILLACTIVE:
1646  case DTN_DATETIMECHANGE:
1647  KillTimer(hwndDlg, 1);
1648  break;
1649 
1650  case PSN_WIZNEXT:
1651  WriteDateTimeSettings(hwndDlg, SetupData);
1652  break;
1653 
1654  case PSN_WIZBACK:
1656  break;
1657 
1658  default:
1659  break;
1660  }
1661  break;
1662 
1663  case WM_DESTROY:
1665  break;
1666 
1667  default:
1668  break;
1669  }
1670 
1671  return FALSE;
1672 }
#define TRUE
Definition: types.h:120
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define PSWIZB_NEXT
Definition: prsht.h:154
static VOID UpdateLocalSystemTime(HWND hwnd)
Definition: wizard.c:1545
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:1556
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1404
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#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
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 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:4362
#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
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:484
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define HeapFree(x, y, z)
Definition: compat.h:483
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:498
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
__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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: xxhash.c:193
static const WCHAR s_szControlWindows[]
Definition: wizard.c:396
#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 2196 of file wizard.c.

2200 {
2201 
2202  switch (uMsg)
2203  {
2204  case WM_INITDIALOG:
2205  {
2206  /* Get pointer to the global setup data */
2208 
2210  {
2211  /* Run the Wine Gecko prompt */
2212  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2213  }
2214 
2215  /* Set title font */
2216  SendDlgItemMessage(hwndDlg,
2218  WM_SETFONT,
2220  (LPARAM)TRUE);
2221  if (SetupData->UnattendSetup)
2222  {
2223  KillTimer(hwndDlg, 1);
2225  PostQuitMessage(0);
2226  }
2227  }
2228  break;
2229 
2230  case WM_DESTROY:
2231  {
2233  PostQuitMessage(0);
2234  return TRUE;
2235  }
2236 
2237  case WM_TIMER:
2238  {
2239  INT Position;
2240  HWND hWndProgress;
2241 
2242  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2243  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2244  if (Position == 300)
2245  {
2246  KillTimer(hwndDlg, 1);
2248  }
2249  else
2250  {
2251  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2252  }
2253  }
2254  return TRUE;
2255 
2256  case WM_NOTIFY:
2257  {
2258  LPNMHDR lpnm = (LPNMHDR)lParam;
2259 
2260  switch (lpnm->code)
2261  {
2262  case PSN_SETACTIVE:
2263  /* Enable the correct buttons on for the active page */
2265 
2267  MAKELPARAM(0, 300));
2269  SetTimer(hwndDlg, 1, 50, NULL);
2270  break;
2271 
2272  case PSN_WIZFINISH:
2273  DestroyWindow(GetParent(hwndDlg));
2274  break;
2275 
2276  default:
2277  break;
2278  }
2279  }
2280  break;
2281 
2282  default:
2283  break;
2284  }
2285 
2286  return FALSE;
2287 }
#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:2180
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:2179
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
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:2167
#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 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:2190
#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)
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 UNICODE_NULL
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
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

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

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

Definition at line 2295 of file wizard.c.

2299 {
2300  WCHAR wszDrives[512];
2301  WCHAR wszNTPath[512]; // MAX_PATH ?
2302  DWORD cchDrives;
2303  PWCHAR pwszDrive;
2304 
2305  *pwszPath = UNICODE_NULL;
2306 
2307  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2308  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2309  {
2310  /* Buffer too small or failure */
2311  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2312  return FALSE;
2313  }
2314 
2315  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2316  {
2317  WCHAR wszBuf[MAX_PATH];
2318 
2319  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2320  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2321  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2322  pwszDrive[2] = L'\\'; // Restore the backslash
2323 
2324  wcscat(wszNTPath, L"\\"); // Concat a backslash
2325 
2326  /* Logging */
2327  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2328  pwszDrive, wszNTPath,
2329  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2330  LogItem(NULL, wszBuf);
2331 
2332  /* Check whether the NT path corresponds to the NT installation source path */
2333  if (!_wcsicmp(wszNTPath, pwszNTPath))
2334  {
2335  /* Found it! */
2336  wcscpy(pwszPath, pwszDrive); // cchPathMax
2337 
2338  /* Logging */
2339  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2340  LogItem(NULL, wszBuf);
2341  wcscat(wszBuf, L"\n");
2342  OutputDebugStringW(wszBuf);
2343 
2344  return TRUE;
2345  }
2346  }
2347 
2348  return FALSE;
2349 }
#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
smooth NULL
Definition: ftsmooth.c:416
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 wsprintf
Definition: winuser.h:5840
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_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
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
SETUPDATA SetupData
Definition: reactos.c:41
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:884
#define TRUE
Definition: types.h:120
WORD wDayOfWeek
Definition: winbase.h:885
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:883
#define FALSE
Definition: types.h:117
WORD wMinute
Definition: winbase.h:888
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:889
WORD wMilliseconds
Definition: winbase.h:890
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4326
WORD wDay
Definition: winbase.h:886
#define GDT_VALID
Definition: commctrl.h:4456
#define IDC_DATEPICKER
Definition: resource.h:59
WORD wHour
Definition: winbase.h:887
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:77
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
smooth NULL
Definition: ftsmooth.c:416
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:484
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
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define IDR_GPL
Definition: resource.h:163
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:483

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2713 of file wizard.c.

2714 {
2715  PROPSHEETHEADER psh = {0};
2716  HPROPSHEETPAGE *phpage = NULL;
2717  PROPSHEETPAGE psp = {0};
2718  UINT nPages = 0;
2719  HWND hWnd;
2720  MSG msg;
2721  PSETUPDATA pSetupData = NULL;
2722  HMODULE hNetShell = NULL;
2724  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2725 
2726  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2727 
2728  /* Allocate setup data */
2729  pSetupData = HeapAlloc(GetProcessHeap(),
2731  sizeof(SETUPDATA));
2732  if (pSetupData == NULL)
2733  {
2734  LogItem(NULL, L"SetupData allocation failed!");
2735  MessageBoxW(NULL,
2736  L"Setup failed to allocate global data!",
2737  L"ReactOS Setup",
2738  MB_ICONERROR | MB_OK);
2739  goto done;
2740  }
2741  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
2742 
2743  hNetShell = LoadLibraryW(L"netshell.dll");
2744  if (hNetShell != NULL)
2745  {
2746  DPRINT("Netshell.dll loaded!\n");
2747 
2748  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2749  "NetSetupRequestWizardPages");
2750  if (pfn != NULL)
2751  {
2752  pfn(&dwNetworkPageCount, NULL, NULL);
2753  dwPageCount += dwNetworkPageCount;
2754  }
2755  }
2756 
2757  DPRINT("PageCount: %lu\n", dwPageCount);
2758 
2759  phpage = HeapAlloc(GetProcessHeap(),
2761  dwPageCount * sizeof(HPROPSHEETPAGE));
2762  if (phpage == NULL)
2763  {
2764  LogItem(NULL, L"Page array allocation failed!");
2765  MessageBoxW(NULL,
2766  L"Setup failed to allocate page array!",
2767  L"ReactOS Setup",
2768  MB_ICONERROR | MB_OK);
2769  goto done;
2770  }
2771 
2772  /* Process the $winnt$.inf setup file */
2773  ProcessSetupInf(pSetupData);
2774 
2775  /* Create the Welcome page */
2776  psp.dwSize = sizeof(PROPSHEETPAGE);
2777  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2778  psp.hInstance = hDllInstance;
2779  psp.lParam = (LPARAM)pSetupData;
2780  psp.pfnDlgProc = WelcomeDlgProc;
2781  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2782  phpage[nPages++] = CreatePropertySheetPage(&psp);
2783 
2784  /* Create the Acknowledgements page */
2785  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2786  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2787  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2788  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2789  psp.pfnDlgProc = AckPageDlgProc;
2790  phpage[nPages++] = CreatePropertySheetPage(&psp);
2791 
2792  /* Create the Product page */
2793  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2794  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2795  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2796  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2797  psp.pfnDlgProc = ProductPageDlgProc;
2798  phpage[nPages++] = CreatePropertySheetPage(&psp);
2799 
2800  /* Create the Locale page */
2801  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2802  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2803  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2804  psp.pfnDlgProc = LocalePageDlgProc;
2805  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2806  phpage[nPages++] = CreatePropertySheetPage(&psp);
2807 
2808  /* Create the Owner page */
2809  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2810  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2811  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2812  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2813  psp.pfnDlgProc = OwnerPageDlgProc;
2814  phpage[nPages++] = CreatePropertySheetPage(&psp);
2815 
2816  /* Create the Computer page */
2817  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2818  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2819  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2820  psp.pfnDlgProc = ComputerPageDlgProc;
2821  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2822  phpage[nPages++] = CreatePropertySheetPage(&psp);
2823 
2824  /* Create the DateTime page */
2825  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2826  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2827  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2828  psp.pfnDlgProc = DateTimePageDlgProc;
2829  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2830  phpage[nPages++] = CreatePropertySheetPage(&psp);
2831 
2832  /* Create the theme selection page */
2833  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2834  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2835  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2836  psp.pfnDlgProc = ThemePageDlgProc;
2837  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2838  phpage[nPages++] = CreatePropertySheetPage(&psp);
2839 
2842 
2843  if (pfn)
2844  {
2845  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2846  nPages += dwNetworkPageCount;
2847  }
2848 
2849  /* Create the Process page */
2850  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2851  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2852  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2853  psp.pfnDlgProc = ProcessPageDlgProc;
2854  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2855  phpage[nPages++] = CreatePropertySheetPage(&psp);
2856 
2857  /* Create the Finish page */
2858  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2859  psp.pfnDlgProc = FinishDlgProc;
2860  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2861  phpage[nPages++] = CreatePropertySheetPage(&psp);
2862 
2863  ASSERT(nPages == dwPageCount);
2864 
2865  /* Create the property sheet */
2866  psh.dwSize = sizeof(PROPSHEETHEADER);
2867  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2868  psh.hInstance = hDllInstance;
2869  psh.hwndParent = NULL;
2870  psh.nPages = nPages;
2871  psh.nStartPage = 0;
2872  psh.phpage = phpage;
2873  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2874  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2875 
2876  /* Create title font */
2877  pSetupData->hTitleFont = CreateTitleFont();
2878  pSetupData->hBoldFont = CreateBoldFont();
2879 
2880  /* Display the wizard */
2881  hWnd = (HWND)PropertySheet(&psh);
2883 
2884  while (GetMessage(&msg, NULL, 0, 0))
2885  {
2886  if (!IsDialogMessage(hWnd, &msg))
2887  {
2889  DispatchMessage(&msg);
2890  }
2891  }
2892 
2893  DeleteObject(pSetupData->hBoldFont);
2894  DeleteObject(pSetupData->hTitleFont);
2895 
2896  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2897  SetupCloseInfFile(pSetupData->hSetupInf);
2898 
2899 done:
2900  if (phpage != NULL)
2901  HeapFree(GetProcessHeap(), 0, phpage);
2902 
2903  if (hNetShell != NULL)
2904  FreeLibrary(hNetShell);
2905 
2906  if (pSetupData != NULL)
2907  HeapFree(GetProcessHeap(), 0, pSetupData);
2908 
2909  LogItem(L"END_SECTION", L"InstallWizard");
2910 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2061
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:101
#define IDD_PRODUCT
Definition: resource.h:92
#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:98
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:93
#define IDD_COMPUTERPAGE
Definition: resource.h:47
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:116
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2580
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:1688
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:110
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:43
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:2710
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:115
#define IDS_COMPUTERTITLE
Definition: resource.h:103
#define IDS_DATETIMETITLE
Definition: resource.h:109
#define IDS_ACKTITLE
Definition: resource.h:97
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:156
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1587
#define LoadLibraryW(x)
Definition: compat.h:495
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#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:39
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:496
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
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:2196
#define IDS_PRODUCTTITLE
Definition: resource.h:155
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:100
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#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:104
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:501
HFONT hTitleFont
Definition: reactos.h:117
#define IDS_LOCALESUBTITLE
Definition: resource.h:107
#define IDS_LOCALETITLE
Definition: resource.h:106
#define HeapFree(x, y, z)
Definition: compat.h:483
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:73
#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:43
#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:54
#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:56
#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:55
#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:160
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:408
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:159
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:95

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:44
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2271
#define IDD_COMPUTERPAGE
Definition: resource.h:47
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:130
#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:45
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:132
_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 2061 of file wizard.c.

2065 {
2067  PREGISTRATIONNOTIFY RegistrationNotify;
2068  static UINT oldActivityID = -1;
2069  WCHAR Title[64];
2070 
2071  /* Retrieve pointer to the global setup data */
2073 
2074  switch (uMsg)
2075  {
2076  case WM_INITDIALOG:
2077  {
2078  /* Save pointer to the global setup data */
2081  }
2082  break;
2083 
2084  case WM_NOTIFY:
2085  {
2086  LPNMHDR lpnm = (LPNMHDR)lParam;
2087  ULONG MaxProgress = 0;
2088 
2089  switch (lpnm->code)
2090  {
2091  case PSN_SETACTIVE:
2092  /* Disable the Back and Next buttons */
2093  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2094 
2095  StartComponentRegistration(hwndDlg, &MaxProgress);
2096 
2098  0, MAKELPARAM(0, MaxProgress));
2100  0, 0);
2101  break;
2102 
2103  case PSN_WIZNEXT:
2104  break;
2105 
2106  case PSN_WIZBACK:
2108  break;
2109 
2110  default:
2111  break;
2112  }
2113  }
2114  break;
2115 
2117  {
2118  WCHAR Activity[64];
2119  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2120  // update if necessary only
2121  if (oldActivityID != RegistrationNotify->ActivityID)
2122  {
2123  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2124  Activity,
2125  ARRAYSIZE(Activity)))
2126  {
2128  0, (LPARAM) Activity);
2129  }
2130  oldActivityID = RegistrationNotify->ActivityID;
2131  }
2133  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2134  L"" : RegistrationNotify->CurrentItem));
2136  RegistrationNotify->Progress, 0);
2137  if (NULL != RegistrationNotify->ErrorMessage)
2138  {
2140  Title, ARRAYSIZE(Title)))
2141  {
2142  wcscpy(Title, L"ReactOS Setup");
2143  }
2144  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2145  Title, MB_ICONERROR | MB_OK);
2146 
2147  }
2148 
2149  if (wParam)
2150  {
2151  /* Enable the Back and Next buttons */
2154  }
2155  }
2156  return TRUE;
2157 
2158  default:
2159  break;
2160  }
2161 
2162  return FALSE;
2163 }
#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:2180
#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:2179
#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
smooth NULL
Definition: ftsmooth.c:416
#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:1994
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 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 2580 of file wizard.c.

2582 {
2584  WCHAR szValue[MAX_PATH];
2585  INFCONTEXT InfContext;
2586  DWORD LineLength;
2587  HKEY hKey;
2588  LONG res;
2589 
2590  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2591 
2592  /* Retrieve the path of the setup INF */
2594  wcscat(szPath, L"\\$winnt$.inf");
2595 
2596  /* Open the setup INF */
2597  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2598  NULL,
2600  NULL);
2601  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2602  {
2603  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2604  return;
2605  }
2606 
2607 
2608  /* Retrieve the NT source path from which the 1st-stage installer was run */
2609  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2610  L"data",
2611  L"sourcepath",
2612  &InfContext))
2613  {
2614  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2615  return;
2616  }
2617 
2618  if (!SetupGetStringFieldW(&InfContext,
2619  1,
2620  szValue,
2621  ARRAYSIZE(szValue),
2622  &LineLength))
2623  {
2624  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2625  return;
2626  }
2627 
2628  *pSetupData->SourcePath = UNICODE_NULL;
2629 
2630  /* Close the setup INF as we are going to modify it manually */
2631  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2632  SetupCloseInfFile(pSetupData->hSetupInf);
2633 
2634 
2635  /* Find the installation source path in Win32 format */
2636  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2637  _countof(pSetupData->SourcePath),
2638  szValue))
2639  {
2640  *pSetupData->SourcePath = UNICODE_NULL;
2641  }
2642 
2643  /* Save the path in Win32 format in the setup INF */
2644  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2645  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2646 
2647  /*
2648  * Save it also in the registry, in the following keys:
2649  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2650  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2651  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2652  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2653  */
2654 #if 0
2656  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2657  0,
2659  &hKey);
2660 
2661  if (res != ERROR_SUCCESS)
2662  {
2663  return FALSE;
2664  }
2665 #endif
2666 
2668  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2669  0, NULL,
2671  KEY_ALL_ACCESS, // KEY_WRITE
2672  NULL,
2673  &hKey,
2674  NULL);
2675  if (res == ERROR_SUCCESS)
2676  {
2677  res = RegSetValueExW(hKey,
2678  L"SourcePath",
2679  0,
2680  REG_SZ,
2681  (LPBYTE)pSetupData->SourcePath,
2682  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2683 
2684  res = RegSetValueExW(hKey,
2685  L"ServicePackSourcePath",
2686  0,
2687  REG_SZ,
2688  (LPBYTE)pSetupData->SourcePath,
2689  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2690 
2691  RegCloseKey(hKey);
2692  }
2693 
2694 
2695  /* Now, re-open the setup INF (this must succeed) */
2696  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2697  NULL,
2699  NULL);
2700  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2701  {
2702  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2703  return;
2704  }
2705 
2706  /* Process the unattended section of the setup file */
2707  ProcessUnattendSection(pSetupData);
2708 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2295
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:479
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
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
smooth NULL
Definition: ftsmooth.c:416
#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
#define swprintf(buf, format,...)
Definition: sprintf.c:56
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
LPCWSTR szPath
Definition: env.c:35
#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:2352
_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 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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#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 2352 of file wizard.c.

2354 {
2355  INFCONTEXT InfContext;
2356  WCHAR szName[256];
2357  WCHAR szValue[MAX_PATH];
2358  DWORD LineLength;
2359  HKEY hKey;
2360 
2361  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2362  L"Unattend",
2363  L"UnattendSetupEnabled",
2364  &InfContext))
2365  {
2366  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2367  return;
2368  }
2369 
2370  if (!SetupGetStringFieldW(&InfContext,
2371  1,
2372  szValue,
2373  ARRAYSIZE(szValue),
2374  &LineLength))
2375  {
2376  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2377  return;
2378  }
2379 
2380  if (_wcsicmp(szValue, L"yes") != 0)
2381  {
2382  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2383  return;
2384  }
2385 
2386  pSetupData->UnattendSetup = TRUE;
2387 
2388  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2389  L"Unattend",
2390  NULL,
2391  &InfContext))
2392  {
2393  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2394  return;
2395  }
2396 
2397  do
2398  {
2399  if (!SetupGetStringFieldW(&InfContext,
2400  0,
2401  szName,
2402  ARRAYSIZE(szName),
2403  &LineLength))
2404  {
2405  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2406  return;
2407  }
2408 
2409  if (!SetupGetStringFieldW(&InfContext,
2410  1,
2411  szValue,
2412  ARRAYSIZE(szValue),
2413  &LineLength))
2414  {
2415  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2416  return;
2417  }
2418  DPRINT1("Name %S Value %S\n", szName, szValue);
2419  if (!_wcsicmp(szName, L"FullName"))
2420  {
2421  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2422  {
2423  wcscpy(pSetupData->OwnerName, szValue);
2424  }
2425  }
2426  else if (!_wcsicmp(szName, L"OrgName"))
2427  {
2428  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2429  {
2430  wcscpy(pSetupData->OwnerOrganization, szValue);
2431  }
2432  }
2433  else if (!_wcsicmp(szName, L"ComputerName"))
2434  {
2435  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2436  {
2437  wcscpy(pSetupData->ComputerName, szValue);
2438  }
2439  }
2440  else if (!_wcsicmp(szName, L"AdminPassword"))
2441  {
2442  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2443  {
2444  wcscpy(pSetupData->AdminPassword, szValue);
2445  }
2446  }
2447  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2448  {
2449  pSetupData->TimeZoneIndex = _wtoi(szValue);
2450  }
2451  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2452  {
2453  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2454  }
2455  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2456  {
2457  if (!_wcsicmp(szValue, L"yes"))
2458  pSetupData->DisableGeckoInst = TRUE;
2459  else
2460  pSetupData->DisableGeckoInst = FALSE;
2461  }
2462  else if (!_wcsicmp(szName, L"ProductOption"))
2463  {
2464  pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2465  }
2466  } while (SetupFindNextLine(&InfContext, &InfContext));
2467 
2468  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2469  L"Display",
2470  NULL,
2471  &InfContext))
2472  {
2473  DEVMODEW dm = { { 0 } };
2474  dm.dmSize = sizeof(dm);
2476  {
2477  do
2478  {
2479  int iValue;
2480  if (!SetupGetStringFieldW(&InfContext,
2481  0,
2482  szName,
2483  ARRAYSIZE(szName),
2484  &LineLength))
2485  {
2486  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2487  return;
2488  }
2489 
2490  if (!SetupGetStringFieldW(&InfContext,
2491  1,
2492  szValue,
2493  ARRAYSIZE(szValue),
2494  &LineLength))
2495  {
2496  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2497  return;
2498  }
2499  iValue = _wtoi(szValue);
2500  DPRINT1("Name %S Value %i\n", szName, iValue);
2501 
2502  if (!iValue)
2503  continue;
2504 
2505  if (!_wcsicmp(szName, L"BitsPerPel"))
2506  {
2507  dm.dmFields |= DM_BITSPERPEL;
2508  dm.dmBitsPerPel = iValue;
2509  }
2510  else if (!_wcsicmp(szName, L"XResolution"))
2511  {
2512  dm.dmFields |= DM_PELSWIDTH;
2513  dm.dmPelsWidth = iValue;
2514  }
2515  else if (!_wcsicmp(szName, L"YResolution"))
2516  {
2517  dm.dmFields |= DM_PELSHEIGHT;
2518  dm.dmPelsHeight = iValue;
2519  }
2520  else if (!_wcsicmp(szName, L"VRefresh"))
2521  {
2523  dm.dmDisplayFrequency = iValue;
2524  }
2525  } while (SetupFindNextLine(&InfContext, &InfContext));
2526 
2528  }
2529  }
2530 
2532  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2533  0,
2534  KEY_SET_VALUE,
2535  &hKey) != ERROR_SUCCESS)
2536  {
2537  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2538  return;
2539  }
2540 
2541  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2542  L"GuiRunOnce",
2543  NULL,
2544  &InfContext))
2545  {
2546  int i = 0;
2547  do
2548  {
2549  if (SetupGetStringFieldW(&InfContext,
2550  0,
2551  szValue,
2552  ARRAYSIZE(szValue),
2553  NULL))
2554  {
2556  swprintf(szName, L"%d", i);
2557  DPRINT("szName %S szValue %S\n", szName, szValue);
2558 
2559  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2560  {
2561  DPRINT("value %S\n", szPath);
2562  if (RegSetValueExW(hKey,
2563  szName,
2564  0,
2565  REG_SZ,
2566  (const BYTE*)szPath,
2567  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2568  {
2569  i++;
2570  }
2571  }
2572  }
2573  } while (SetupFindNextLine(&InfContext, &InfContext));
2574  }
2575 
2576  RegCloseKey(hKey);
2577 }
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:1044
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
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
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
#define swprintf(buf, format,...)
Definition: sprintf.c:56
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
#define DM_PELSHEIGHT
Definition: wingdi.h:1269
LPCWSTR szPath
Definition: env.c:35
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
#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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_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
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_PRODUCT_ICON
Definition: resource.h:93
#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:94
__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
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:158
#define IDS_DEFAULT
Definition: resource.h:161
#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:157
#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 1802 of file wizard.c.

1806 {
1807  PREGISTRATIONDATA RegistrationData;
1808  REGISTRATIONNOTIFY RegistrationNotify;
1809  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1810  UINT MessageID;
1811  WCHAR ErrorMessage[128];
1812 
1813  RegistrationData = (PREGISTRATIONDATA) Context;
1814 
1815  if (SPFILENOTIFY_STARTREGISTRATION == Notification ||
1816  SPFILENOTIFY_ENDREGISTRATION == Notification)
1817  {
1818  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1819  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1820  if (NULL == RegistrationNotify.CurrentItem)
1821  {
1822  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1823  }
1824  else
1825  {
1826  RegistrationNotify.CurrentItem++;
1827  }
1828 
1829  if (SPFILENOTIFY_STARTREGISTRATION == Notification)
1830  {
1831  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1832  StatusInfo->FileName);
1833  RegistrationNotify.ErrorMessage = NULL;
1834  RegistrationNotify.Progress = RegistrationData->Registered;
1835  }
1836  else
1837  {
1838  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1839  StatusInfo->FileName);
1840  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1841  StatusInfo->FailureCode);
1842  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1843  {
1844  switch(StatusInfo->FailureCode)
1845  {
1846  case SPREG_LOADLIBRARY:
1848  break;
1849  case SPREG_GETPROCADDR:
1851  break;
1852  case SPREG_REGSVR:
1854  break;
1855  case SPREG_DLLINSTALL:
1857  break;
1858  case SPREG_TIMEOUT:
1860  break;
1861  default:
1863  break;
1864  }
1866  ErrorMessage,
1868  {
1869  ErrorMessage[0] = L'\0';
1870  }
1871  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
1872  {
1874  StatusInfo->Win32Error, 0,
1877  NULL);
1878  }
1879  RegistrationNotify.ErrorMessage = ErrorMessage;
1880  }
1881  else
1882  {
1883  RegistrationNotify.ErrorMessage = NULL;
1884  }
1885  if (RegistrationData->Registered < RegistrationData->DllCount)
1886  {
1887  RegistrationData->Registered++;
1888  }
1889  }
1890 
1891  RegistrationNotify.Progress = RegistrationData->Registered;
1892  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1893  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1894  0, (LPARAM) &RegistrationNotify);
1895 
1896  return FILEOP_DOIT;
1897  }
1898  else
1899  {
1900  DPRINT1("Received unexpected notification %u\n", Notification);
1901  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
1902  Notification, Param1, Param2);
1903  }
1904 }
LPCWSTR CurrentItem
Definition: wizard.c:39
ULONG DllCount
Definition: wizard.c:46
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:123
#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:122
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
_In_ PVOID _In_ ULONG MessageID
Definition: ketypes.h:507
#define SPREG_REGSVR
Definition: setupapi.h:650
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:126
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:124
#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:128
#define wcsrchr
Definition: compat.h:16
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:566
struct _REGISTRATIONDATA * PREGISTRATIONDATA
unsigned int UINT
Definition: ndis.h:50
#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 SPREG_TIMEOUT
Definition: setupapi.h:652
#define IDS_REGSVR_FAILED
Definition: resource.h:125
#define SPREG_LOADLIBRARY
Definition: setupapi.h:648
#define SPREG_SUCCESS
Definition: setupapi.h:647
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by RegistrationProc().

◆ RegistrationProc()

static DWORD CALLBACK RegistrationProc ( LPVOID  Parameter)
static

Definition at line 1908 of file wizard.c.

1909 {
1910  PREGISTRATIONDATA RegistrationData;
1911  REGISTRATIONNOTIFY RegistrationNotify;
1912  DWORD LastError = NO_ERROR;
1913  WCHAR UnknownError[84];
1914 
1915  RegistrationData = (PREGISTRATIONDATA) Parameter;
1916  RegistrationData->Registered = 0;
1917  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
1918 
1919  _SEH2_TRY
1920  {
1921  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
1922  hSysSetupInf,
1923  L"RegistrationPhase2",
1924  SPINST_REGISTRY |
1925  SPINST_REGISTERCALLBACKAWARE |
1926  SPINST_REGSVR,
1927  0,
1928  NULL,
1929  0,
1931  RegistrationData,
1932  NULL,
1933  NULL))
1934  {
1935  LastError = GetLastError();
1936  }
1937  }
1939  {
1940  DPRINT("Catching exception\n");
1942  }
1943  _SEH2_END;
1944 
1945  if (NO_ERROR == LastError)
1946  {
1947  RegistrationNotify.ErrorMessage = NULL;
1948  }
1949  else
1950  {
1951  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
1952  LastError);
1954  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
1955  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
1956  NULL))
1957  {
1959  UnknownError,
1960  ARRAYSIZE(UnknownError) - 20))
1961  {
1962  wcscpy(UnknownError, L"Unknown error");
1963  }
1964  wcscat(UnknownError, L" ");
1965  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
1966  RegistrationNotify.ErrorMessage = UnknownError;
1967  }
1968  }
1969 
1970  RegistrationNotify.Progress = RegistrationData->DllCount;
1971  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1972  RegistrationNotify.CurrentItem = NULL;
1973  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1974  1, (LPARAM) &RegistrationNotify);
1975  if (NULL != RegistrationNotify.ErrorMessage &&
1976  UnknownError != RegistrationNotify.ErrorMessage)
1977  {
1978  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
1979  }
1980 
1981  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
1982  HeapFree(GetProcessHeap(), 0, RegistrationData);
1983 
1984  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
1985 
1986  // FIXME: Move this call to a separate cleanup page!
1988 
1989  return 0;
1990 }
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:423
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:1044
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:122
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1802
PVOID DefaultContext
Definition: wizard.c:48
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define SPINST_REGISTRY
Definition: setupapi.h:585
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:484
__wchar_t WCHAR
Definition: xmlstorage.h:180
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:121
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 DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5818
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HINF hSysSetupInf
Definition: install.c:37
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:483

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
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:484
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
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:483
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:487
#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:1648
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
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:4595
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:830
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
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
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 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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by LocalePageDlgProc(), and ThemePageDlgProc().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2167 of file wizard.c.

2168 {
2169  HKEY hKey = 0;
2170  DWORD InProgress = 0;
2171  DWORD InstallDate;
2172 
2174  L"SYSTEM\\Setup",
2175  0,
2176  KEY_WRITE,
2177  &hKey ) == ERROR_SUCCESS)
2178  {
2179  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2180  RegCloseKey( hKey );
2181  }
2182 
2184  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2185  0,
2186  KEY_WRITE,
2187  &hKey ) == ERROR_SUCCESS)
2188  {
2189  InstallDate = (DWORD)time(NULL);
2190  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2191  RegCloseKey( hKey );
2192  }
2193 }
#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
smooth NULL
Definition: ftsmooth.c:416
#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
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
smooth NULL
Definition: ftsmooth.c:416
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
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
_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
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
smooth NULL
Definition: ftsmooth.c:416
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:1174
WCHAR DaylightName[32]
Definition: winbase.h:1176
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define SendMessage
Definition: winuser.h:5818
WCHAR StandardName[32]
Definition: winbase.h:1173
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1177

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
smooth NULL
Definition: ftsmooth.c:416
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
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 1994 of file wizard.c.

1995 {
1996  HANDLE RegistrationThread;
1997  LONG DllCount;
1999  WCHAR SectionName[512];
2000  PREGISTRATIONDATA RegistrationData;
2001 
2002  DllCount = -1;
2003  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2004  L"RegisterDlls", &Context))
2005  {
2006  DPRINT1("No RegistrationPhase2 section found\n");
2007  return FALSE;
2008  }
2009  if (!SetupGetStringFieldW(&Context, 1, SectionName,
2010  ARRAYSIZE(SectionName),
2011  NULL))
2012  {
2013  DPRINT1("Unable to retrieve section name\n");
2014  return FALSE;
2015  }
2016  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2017  DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2018  if (DllCount < 0)
2019  {
2021  return FALSE;
2022  }
2023 
2024  *MaxProgress = (ULONG) DllCount;
2025 
2026  /*
2027  * Create a background thread to do the actual registrations, so the
2028  * main thread can just run its message loop.
2029  */
2030  RegistrationThread = NULL;
2031  RegistrationData = HeapAlloc(GetProcessHeap(), 0,
2032  sizeof(REGISTRATIONDATA));
2033  if (RegistrationData != NULL)
2034  {
2035  RegistrationData->hwndDlg = hwndDlg;
2036  RegistrationData->DllCount = DllCount;
2037  RegistrationThread = CreateThread(NULL, 0, RegistrationProc,
2038  RegistrationData, 0, NULL);
2039  if (RegistrationThread != NULL)
2040  {
2041  CloseHandle(RegistrationThread);
2042  }
2043  else
2044  {
2045  DPRINT1("CreateThread failed, error %u\n", GetLastError());
2046  HeapFree(GetProcessHeap(), 0, RegistrationData);
2047  return FALSE;
2048  }
2049  }
2050  else
2051  {
2052  DPRINT1("HeapAlloc() failed, error %u\n", GetLastError());
2053  return FALSE;
2054  }
2055 
2056  return TRUE;
2057 }
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:487
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:1044
#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
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD CALLBACK RegistrationProc(LPVOID Parameter)
Definition: wizard.c:1908
#define SetLastError(x)
Definition: compat.h:500
static const WCHAR L[]
Definition: oid.c:1250
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1034
unsigned int ULONG
Definition: retypes.h:1
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:483
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1494
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by ProcessPageDlgProc().

◆ ThemePageDlgProc()

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

Definition at line 1688 of file wizard.c.

1692 {
1694  LPNMLISTVIEW pnmv;
1695 
1696  /* Retrieve pointer to the global setup data */
1698 
1699  switch (uMsg)
1700  {
1701  case WM_INITDIALOG:
1702  {
1703  HWND hListView;
1704  HIMAGELIST himl;
1705  DWORD n;
1706  LVITEM lvi = {0};
1707 
1708  /* Save pointer to the global setup data */
1711 
1712  hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1713 
1714  /* Common */
1716  lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1717 
1718  for (n = 0; n < ARRAYSIZE(Themes); ++n)
1719  {
1720  WCHAR DisplayName[100] = {0};
1721  /* Load the bitmap */
1723  ImageList_AddMasked(himl, image, RGB(255,0,255));
1724 
1725  /* Load the string */
1726  LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
1727  DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
1728 
1729  /* Add the listview item */
1730  lvi.iItem = n;
1731  lvi.iImage = n;
1732  lvi.pszText = DisplayName;
1733  ListView_InsertItem(hListView, &lvi);
1734  }
1735 
1736  /* Register the imagelist */
1738  /* Transparant background */
1739  ListView_SetBkColor(hListView, CLR_NONE);
1740  ListView_SetTextBkColor(hListView, CLR_NONE);
1741  /* Reduce the size between the items */
1742  ListView_SetIconSpacing(hListView, 190, 173);
1743  break;
1744  }
1745  case WM_NOTIFY:
1746