ReactOS  0.4.14-dev-1034-g1e60116
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 <debug.h>
Include dependency graph for wizard.c:

Go to the source code of this file.

Classes

struct  _REGISTRATIONNOTIFY
 
struct  _REGISTRATIONDATA
 
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 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 OnChooseServer (HWND hwndDlg)
 
static void OnChooseWorkstation (HWND hwndDlg)
 
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 VOID CreateTimeZoneList (PSETUPDATA SetupData)
 
static VOID DestroyTimeZoneList (PSETUPDATA SetupData)
 
static BOOL GetTimeZoneListIndex (LPDWORD lpIndex)
 
static VOID ShowTimeZoneList (HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static VOID SetLocalTimeZone (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL GetLocalSystemTime (HWND hwnd, PSETUPDATA SetupData)
 
static VOID SetAutoDaylightInfo (HWND hwnd)
 
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 struct ThemeInfo Themes []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 22 of file wizard.c.

◆ PM_REGISTRATION_NOTIFY

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)

Definition at line 25 of file wizard.c.

Typedef Documentation

◆ PFNREQUESTWIZARDPAGES

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

Definition at line 2838 of file wizard.c.

◆ PREGISTRATIONDATA

◆ PREGISTRATIONNOTIFY

◆ REGISTRATIONDATA

◆ REGISTRATIONNOTIFY

Function Documentation

◆ AckPageDlgProc()

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

Definition at line 274 of file wizard.c.

278 {
279  LPNMHDR lpnm;
280  PWCHAR Projects;
281  PWCHAR End, CurrentProject;
282  INT ProjectsSize, ProjectsCount;
283  PSETUPDATA pSetupData;
284 
285  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
286 
287  switch (uMsg)
288  {
289  case WM_INITDIALOG:
290  {
291  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
292  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
293 
294  Projects = NULL;
295  ProjectsSize = 256;
296  while (TRUE)
297  {
298  Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
299  if (NULL == Projects)
300  {
301  return FALSE;
302  }
303  ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
304  if (0 == ProjectsCount)
305  {
306  HeapFree(GetProcessHeap(), 0, Projects);
307  return FALSE;
308  }
309  if (ProjectsCount < ProjectsSize - 1)
310  {
311  break;
312  }
313  HeapFree(GetProcessHeap(), 0, Projects);
314  ProjectsSize *= 2;
315  }
316 
317  CurrentProject = Projects;
318  while (*CurrentProject != L'\0')
319  {
320  End = wcschr(CurrentProject, L'\n');
321  if (NULL != End)
322  {
323  *End = L'\0';
324  }
325  (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
326  if (NULL != End)
327  {
328  CurrentProject = End + 1;
329  }
330  else
331  {
332  CurrentProject += wcslen(CurrentProject);
333  }
334  }
335  HeapFree(GetProcessHeap(), 0, Projects);
336  }
337  break;
338 
339  case WM_COMMAND:
341  {
343  SetForegroundWindow(GetParent(hwndDlg));
344  }
345  break;
346 
347  case WM_NOTIFY:
348  {
349  lpnm = (LPNMHDR)lParam;
350 
351  switch (lpnm->code)
352  {
353  case PSN_SETACTIVE:
354  /* Enable the Back and Next buttons */
356  if (pSetupData->UnattendSetup)
357  {
359  return TRUE;
360  }
361  break;
362 
363  case PSN_WIZBACK:
364  pSetupData->UnattendSetup = FALSE;
365  break;
366 
367  default:
368  break;
369  }
370  }
371  break;
372 
373  default:
374  break;
375  }
376 
377  return FALSE;
378 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#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:91
#define IDD_GPL
Definition: resource.h:76
#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:55
#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:57
#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 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:403
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:119
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:121
#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:66
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:402
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 55 of file wizard.c.

56 {
58  RECT rcParent;
59  RECT rcWindow;
60 
62  if (hWndParent == NULL)
64 
65  GetWindowRect(hWndParent, &rcParent);
66  GetWindowRect(hWnd, &rcWindow);
67 
69  HWND_TOP,
70  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
71  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
72  0,
73  0,
74  SWP_NOSIZE);
75 }
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:652
#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 848 of file wizard.c.

852 {
853  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
854  WCHAR Password1[128];
855  WCHAR Password2[128];
857  WCHAR Title[64];
858  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
859  LPNMHDR lpnm;
860  PSETUPDATA pSetupData;
861 
862  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
863 
865  {
866  wcscpy(Title, L"ReactOS Setup");
867  }
868 
869  switch (uMsg)
870  {
871  case WM_INITDIALOG:
872  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
873  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
874 
875  /* Generate a new pseudo-random computer name */
876  GenerateComputerName(ComputerName);
877 
878  /* Display current computer name */
879  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
880 
881  /* Set text limits */
885 
886  /* Set focus to computer name */
888  if (pSetupData->UnattendSetup)
889  {
895  }
896 
897  /* Store the administrator account name as the default user name */
898  WriteDefaultLogonData(pSetupData->ComputerName);
899  break;
900 
901 
902  case WM_NOTIFY:
903  {
904  lpnm = (LPNMHDR)lParam;
905 
906  switch (lpnm->code)
907  {
908  case PSN_SETACTIVE:
909  /* Enable the Back and Next buttons */
911  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
912  {
914  return TRUE;
915  }
916  break;
917 
918  case PSN_WIZNEXT:
919  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
920  {
921  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
922  ARRAYSIZE(EmptyComputerName)))
923  {
924  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
925  }
926  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
928  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
929  return TRUE;
930  }
931 
932  /* No need to check computer name for invalid characters,
933  * SetComputerName() will do it for us */
934 
935  if (!WriteComputerSettings(ComputerName, hwndDlg))
936  {
938  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
939  return TRUE;
940  }
941 
942 #if 0
943  /* Check if admin passwords have been entered */
944  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
945  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
946  {
947  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
948  ARRAYSIZE(EmptyPassword)))
949  {
950  wcscpy(EmptyPassword, L"You must enter a password !");
951  }
952  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
953  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
954  return TRUE;
955  }
956 #else
957  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
958  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
959 #endif
960  /* Check if passwords match */
961  if (wcscmp(Password1, Password2))
962  {
963  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
964  ARRAYSIZE(NotMatchPassword)))
965  {
966  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
967  }
968  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
969  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
970  return TRUE;
971  }
972 
973  /* Check password for invalid characters */
974  Password = (PWCHAR)Password1;
975  while (*Password)
976  {
977  if (!isprint(*Password))
978  {
979  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
980  ARRAYSIZE(WrongPassword)))
981  {
982  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
983  }
984  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
985  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
986  return TRUE;
987  }
988  Password++;
989  }
990 
991  /* Set admin password */
992  SetAdministratorPassword(Password1);
993  break;
994 
995  case PSN_WIZBACK:
996  pSetupData->UnattendSetup = FALSE;
997  break;
998 
999  default:
1000  break;
1001  }
1002  }
1003  break;
1004 
1005  default:
1006  break;
1007  }
1008 
1009  return FALSE;
1010 }
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:2265
#define TRUE
Definition: types.h:120
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:830
#define IDS_REACTOS_SETUP
Definition: resource.h:124
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:778
#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:55
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:137
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:135
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:64
#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:712
#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:65
#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:66
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:136
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:138
#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 100 of file wizard.c.

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

1243 {
1244  WCHAR szKeyName[256];
1245  DWORD dwIndex;
1246  DWORD dwNameSize;
1247  DWORD dwValueSize;
1248  LONG lError;
1249  HKEY hZonesKey;
1250  HKEY hZoneKey;
1251 
1253  PTIMEZONE_ENTRY Current;
1254 
1256  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
1257  0,
1259  &hZonesKey))
1260  return;
1261 
1262  dwIndex = 0;
1263  while (TRUE)
1264  {
1265  dwNameSize = 256 * sizeof(WCHAR);
1266  lError = RegEnumKeyExW(hZonesKey,
1267  dwIndex,
1268  szKeyName,
1269  &dwNameSize,
1270  NULL,
1271  NULL,
1272  NULL,
1273  NULL);
1274  if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA)
1275  break;
1276 
1277  if (RegOpenKeyExW(hZonesKey,
1278  szKeyName,
1279  0,
1281  &hZoneKey))
1282  break;
1283 
1285  if (Entry == NULL)
1286  {
1287  RegCloseKey(hZoneKey);
1288  break;
1289  }
1290 
1291  dwValueSize = 64 * sizeof(WCHAR);
1292  if (RegQueryValueExW(hZoneKey,
1293  L"Display",
1294  NULL,
1295  NULL,
1296  (LPBYTE)&Entry->Description,
1297  &dwValueSize))
1298  {
1299  RegCloseKey(hZoneKey);
1300  break;
1301  }
1302 
1303  dwValueSize = 32 * sizeof(WCHAR);
1304  if (RegQueryValueExW(hZoneKey,
1305  L"Std",
1306  NULL,
1307  NULL,
1308  (LPBYTE)&Entry->StandardName,
1309  &dwValueSize))
1310  {
1311  RegCloseKey(hZoneKey);
1312  break;
1313  }
1314 
1315  dwValueSize = 32 * sizeof(WCHAR);
1316  if (RegQueryValueExW(hZoneKey,
1317  L"Dlt",
1318  NULL,
1319  NULL,
1320  (LPBYTE)&Entry->DaylightName,
1321  &dwValueSize))
1322  {
1323  RegCloseKey(hZoneKey);
1324  break;
1325  }
1326 
1327  dwValueSize = sizeof(DWORD);
1328  if (RegQueryValueExW(hZoneKey,
1329  L"Index",
1330  NULL,
1331  NULL,
1332  (LPBYTE)&Entry->Index,
1333  &dwValueSize))
1334  {
1335  RegCloseKey(hZoneKey);
1336  break;
1337  }
1338 
1339  dwValueSize = sizeof(TZ_INFO);
1340  if (RegQueryValueExW(hZoneKey,
1341  L"TZI",
1342  NULL,
1343  NULL,
1344  (LPBYTE)&Entry->TimezoneInfo,
1345  &dwValueSize))
1346  {
1347  RegCloseKey(hZoneKey);
1348  break;
1349  }
1350 
1351  RegCloseKey(hZoneKey);
1352 
1353  if (SetupData->TimeZoneListHead == NULL &&
1355  {
1356  Entry->Prev = NULL;
1357  Entry->Next = NULL;
1360  }
1361  else
1362  {
1363  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1364  if (Current != NULL)
1365  {
1366  if (Current == SetupData->TimeZoneListHead)
1367  {
1368  /* Prepend to head */
1369  Entry->Prev = NULL;
1370  Entry->Next = SetupData->TimeZoneListHead;
1373  }
1374  else
1375  {
1376  /* Insert before current */
1377  Entry->Prev = Current->Prev;
1378  Entry->Next = Current;
1379  Current->Prev->Next = Entry;
1380  Current->Prev = Entry;
1381  }
1382  }
1383  else
1384  {
1385  /* Append to tail */
1386  Entry->Prev = SetupData->TimeZoneListTail;
1387  Entry->Next = NULL;
1390  }
1391  }
1392 
1393  dwIndex++;
1394  }
1395 
1396  RegCloseKey(hZonesKey);
1397 }
#define TRUE
Definition: types.h:120
#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:1224
Definition: timezone.c:24
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
SETUPDATA SetupData
Definition: reactos.c:41
static const WCHAR L[]
Definition: oid.c:1250
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:26
#define ERROR_MORE_DATA
Definition: dderror.h:13
struct _TIMEZONE_ENTRY * Next
Definition: timezone.c:27
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:70
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
struct _TZ_INFO TZ_INFO
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
base of all file and directory entries
Definition: entries.h:82
PTIMEZONE_ENTRY TimeZoneListTail
Definition: syssetup.h:71
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by DateTimePageDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 79 of file wizard.c.

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

1724 {
1726 
1727  /* Retrieve pointer to the global setup data */
1729 
1730  switch (uMsg)
1731  {
1732  case WM_INITDIALOG:
1733  /* Save pointer to the global setup data */
1736 
1738 
1739  if (SetupData->UnattendSetup)
1740  {
1743 
1745  {
1747  }
1748  }
1749  else
1750  {
1752  SetupData, -1);
1753 
1755  }
1756  break;
1757 
1758  case WM_TIMER:
1759  UpdateLocalSystemTime(hwndDlg);
1760  break;
1761 
1762  case WM_NOTIFY:
1763  switch (((LPNMHDR)lParam)->code)
1764  {
1765  case PSN_SETACTIVE:
1766  /* Enable the Back and Next buttons */
1769  {
1771  return TRUE;
1772  }
1773  SetTimer(hwndDlg, 1, 1000, NULL);
1774  break;
1775 
1776  case PSN_KILLACTIVE:
1777  case DTN_DATETIMECHANGE:
1778  KillTimer(hwndDlg, 1);
1779  break;
1780 
1781  case PSN_WIZNEXT:
1782  WriteDateTimeSettings(hwndDlg, SetupData);
1783  break;
1784 
1785  case PSN_WIZBACK:
1787  break;
1788 
1789  default:
1790  break;
1791  }
1792  break;
1793 
1794  case WM_DESTROY:
1796  break;
1797 
1798  default:
1799  break;
1800  }
1801 
1802  return FALSE;
1803 }
#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:1679
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:73
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1242
#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
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1690
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1401
#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:78
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
uint32_t DWORD_PTR
Definition: typedefs.h:64
DWORD TimeZoneIndex
Definition: syssetup.h:72
HWND WINAPI GetParent(_In_ HWND)
#define BST_CHECKED
Definition: winuser.h:197
#define PSN_WIZBACK
Definition: prsht.h:120
BOOL UnattendSetup
Definition: syssetup.h:66
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1534
#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 1401 of file wizard.c.

1402 {
1404 
1405  while (SetupData->TimeZoneListHead != NULL)
1406  {
1408 
1409  SetupData->TimeZoneListHead = Entry->Next;
1411  {
1413  }
1414 
1415  HeapFree(GetProcessHeap(), 0, Entry);
1416  }
1417 
1419 }
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:24
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:26
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:70
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82
PTIMEZONE_ENTRY TimeZoneListTail
Definition: syssetup.h:71

Referenced by DateTimePageDlgProc().

◆ DoWriteProductOption()

static BOOL DoWriteProductOption ( PRODUCT_OPTION  nOption)
static

Definition at line 381 of file wizard.c.

382 {
383  static const WCHAR s_szProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
384  static const WCHAR s_szRosVersion[] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version";
385  HKEY hKey;
386  LONG error;
387  LPCWSTR pData;
388  DWORD cbData, dwValue;
389 
390  error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szProductOptions, 0, KEY_WRITE, &hKey);
391  if (error)
392  return FALSE;
393 
394  switch (nOption)
395  {
397  /* write ProductSuite */
398  pData = L"Terminal Server\0";
399  cbData = sizeof(L"Terminal Server\0");
400  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (BYTE *)pData, cbData);
401  if (error)
402  break;
403 
404  /* write ProductType */
405  pData = L"ServerNT";
406  cbData = sizeof(L"ServerNT");
407  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (BYTE *)pData, cbData);
408  break;
409 
411  /* write ProductSuite */
412  pData = L"\0";
413  cbData = sizeof(L"\0");
414  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (BYTE *)pData, cbData);
415  if (error)
416  break;
417 
418  /* write ProductType */
419  pData = L"WinNT";
420  cbData = sizeof(L"WinNT");
421  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (BYTE *)pData, cbData);
422  break;
423  }
424 
425  RegCloseKey(hKey);
426 
427  error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szRosVersion, 0, KEY_WRITE, &hKey);
428  if (error)
429  return FALSE;
430 
431  /* write ReportAsWorkstation value */
432  dwValue = (nOption == PRODUCT_OPTION_WORKSTATION);
433  cbData = sizeof(dwValue);
434  error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (BYTE *)&dwValue, cbData);
435 
436  RegCloseKey(hKey);
437 
438  return error == ERROR_SUCCESS;
439 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#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
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: mem.h:68
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
#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 2327 of file wizard.c.

2331 {
2332 
2333  switch (uMsg)
2334  {
2335  case WM_INITDIALOG:
2336  {
2337  /* Get pointer to the global setup data */
2339 
2341  {
2342  /* Run the Wine Gecko prompt */
2343  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2344  }
2345 
2346  /* Set title font */
2347  SendDlgItemMessage(hwndDlg,
2349  WM_SETFONT,
2351  (LPARAM)TRUE);
2352  if (SetupData->UnattendSetup)
2353  {
2354  KillTimer(hwndDlg, 1);
2356  PostQuitMessage(0);
2357  }
2358  }
2359  break;
2360 
2361  case WM_DESTROY:
2362  {
2364  PostQuitMessage(0);
2365  return TRUE;
2366  }
2367 
2368  case WM_TIMER:
2369  {
2370  INT Position;
2371  HWND hWndProgress;
2372 
2373  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2374  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2375  if (Position == 300)
2376  {
2377  KillTimer(hwndDlg, 1);
2379  }
2380  else
2381  {
2382  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2383  }
2384  }
2385  return TRUE;
2386 
2387  case WM_NOTIFY:
2388  {
2389  LPNMHDR lpnm = (LPNMHDR)lParam;
2390 
2391  switch (lpnm->code)
2392  {
2393  case PSN_SETACTIVE:
2394  /* Enable the correct buttons on for the active page */
2396 
2398  MAKELPARAM(0, 300));
2400  SetTimer(hwndDlg, 1, 50, NULL);
2401  break;
2402 
2403  case PSN_WIZFINISH:
2404  DestroyWindow(GetParent(hwndDlg));
2405  break;
2406 
2407  default:
2408  break;
2409  }
2410  }
2411  break;
2412 
2413  default:
2414  break;
2415  }
2416 
2417  return FALSE;
2418 }
#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:57
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
#define PBM_SETRANGE
Definition: commctrl.h:2179
#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:67
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:2298
#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:66
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 830 of file wizard.c.

831 {
832  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
833  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
834  unsigned i;
835 
836  wcscpy(lpBuffer, L"REACTOS-");
837 
838  srand(GetTickCount());
839 
840  /* fill in 7 characters */
841  for (i = 8; i < 15; i++)
842  lpBuffer[i] = Chars[rand() % cChars];
843 
844  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
845 }
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 2426 of file wizard.c.

2430 {
2431  WCHAR wszDrives[512];
2432  WCHAR wszNTPath[512]; // MAX_PATH ?
2433  DWORD cchDrives;
2434  PWCHAR pwszDrive;
2435 
2436  *pwszPath = UNICODE_NULL;
2437 
2438  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2439  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2440  {
2441  /* Buffer too small or failure */
2442  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2443  return FALSE;
2444  }
2445 
2446  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2447  {
2448  WCHAR wszBuf[MAX_PATH];
2449 
2450  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2451  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2452  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2453  pwszDrive[2] = L'\\'; // Restore the backslash
2454 
2455  wcscat(wszNTPath, L"\\"); // Concat a backslash
2456 
2457  /* Logging */
2458  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2459  pwszDrive, wszNTPath,
2460  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2461  LogItem(NULL, wszBuf);
2462 
2463  /* Check whether the NT path corresponds to the NT installation source path */
2464  if (!_wcsicmp(wszNTPath, pwszNTPath))
2465  {
2466  /* Found it! */
2467  wcscpy(pwszPath, pwszDrive); // cchPathMax
2468 
2469  /* Logging */
2470  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2471  LogItem(NULL, wszBuf);
2472  wcscat(wszBuf, L"\n");
2473  OutputDebugStringW(wszBuf);
2474 
2475  return TRUE;
2476  }
2477  }
2478 
2479  return FALSE;
2480 }
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
uint16_t * PWCHAR
Definition: typedefs.h:55
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#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 MAX_PATH
Definition: compat.h:26
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
#define DRIVE_CDROM
Definition: winbase.h:251
_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:118

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1224 of file wizard.c.

1225 {
1227 
1229  while (Entry != NULL)
1230  {
1231  if (Entry->Index >= Index)
1232  return Entry;
1233 
1234  Entry = Entry->Next;
1235  }
1236 
1237  return NULL;
1238 }
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:24
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
SETUPDATA SetupData
Definition: reactos.c:41
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:70
base of all file and directory entries
Definition: entries.h:82

Referenced by CreateTimeZoneList().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1609 of file wizard.c.

1610 {
1611  SYSTEMTIME Date;
1612  SYSTEMTIME Time;
1613 
1615  {
1616  return FALSE;
1617  }
1618 
1620  {
1621  return FALSE;
1622  }
1623 
1624  SetupData->SystemTime.wYear = Date.wYear;
1627  SetupData->SystemTime.wDay = Date.wDay;
1628  SetupData->SystemTime.wHour = Time.wHour;
1629  SetupData->SystemTime.wMinute = Time.wMinute;
1630  SetupData->SystemTime.wSecond = Time.wSecond;
1631  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1632 
1633  return TRUE;
1634 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD wMonth
Definition: winbase.h:878
WORD wDayOfWeek
Definition: winbase.h:879
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:877
WORD wMinute
Definition: winbase.h:882
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:883
WORD wMilliseconds
Definition: winbase.h:884
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4326
WORD wDay
Definition: winbase.h:880
#define GDT_VALID
Definition: commctrl.h:4456
#define IDC_DATEPICKER
Definition: resource.h:59
WORD wHour
Definition: winbase.h:881
SYSTEMTIME SystemTime
Definition: syssetup.h:69
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by WriteDateTimeSettings().

◆ GetTimeZoneListIndex()

static BOOL GetTimeZoneListIndex ( LPDWORD  lpIndex)
static

Definition at line 1422 of file wizard.c.

1423 {
1424  WCHAR szLanguageIdString[9];
1425  HKEY hKey;
1426  DWORD dwValueSize;
1427  DWORD Length;
1428  LPWSTR Buffer;
1429  LPWSTR Ptr;
1430  LPWSTR End;
1431  BOOL bFound = FALSE;
1432  unsigned long iLanguageID;
1433 
1434  if (*lpIndex == -1)
1435  {
1436  *lpIndex = 85; /* fallback to GMT time zone */
1437 
1439  L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Language",
1440  0,
1442  &hKey))
1443  return FALSE;
1444 
1445  dwValueSize = 9 * sizeof(WCHAR);
1446  if (RegQueryValueExW(hKey,
1447  L"Default",
1448  NULL,
1449  NULL,
1450  (LPBYTE)szLanguageIdString,
1451  &dwValueSize))
1452  {
1453  RegCloseKey(hKey);
1454  return FALSE;
1455  }
1456 
1457  iLanguageID = wcstoul(szLanguageIdString, NULL, 16);
1458  RegCloseKey(hKey);
1459  }
1460  else
1461  {
1462  iLanguageID = *lpIndex;
1463  }
1464 
1466  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
1467  0,
1469  &hKey))
1470  return FALSE;
1471 
1472  dwValueSize = 0;
1473  if (RegQueryValueExW(hKey,
1474  L"IndexMapping",
1475  NULL,
1476  NULL,
1477  NULL,
1478  &dwValueSize))
1479  {
1480  RegCloseKey(hKey);
1481  return FALSE;
1482  }
1483 
1484  Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize);
1485  if (Buffer == NULL)
1486  {
1487  RegCloseKey(hKey);
1488  return FALSE;
1489  }
1490 
1491  if (RegQueryValueExW(hKey,
1492  L"IndexMapping",
1493  NULL,
1494  NULL,
1495  (LPBYTE)Buffer,
1496  &dwValueSize))
1497  {
1499  RegCloseKey(hKey);
1500  return FALSE;
1501  }
1502 
1503  RegCloseKey(hKey);
1504 
1505  Ptr = Buffer;
1506  while (*Ptr != 0)
1507  {
1508  Length = wcslen(Ptr);
1509  if (wcstoul(Ptr, NULL, 16) == iLanguageID)
1510  bFound = TRUE;
1511 
1512  Ptr = Ptr + Length + 1;
1513  if (*Ptr == 0)
1514  break;
1515 
1516  if (bFound)
1517  {
1518  *lpIndex = wcstoul(Ptr, &End, 10);
1520  return TRUE;
1521  }
1522 
1523  Length = wcslen(Ptr);
1524  Ptr = Ptr + Length + 1;
1525  }
1526 
1528 
1529  return FALSE;
1530 }
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
WCHAR * LPWSTR
Definition: xmlstorage.h:184
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by ShowTimeZoneList().

◆ GplDlgProc()

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

Definition at line 121 of file wizard.c.

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

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2841 of file wizard.c.

2842 {
2843  PROPSHEETHEADER psh = {0};
2844  HPROPSHEETPAGE *phpage = NULL;
2845  PROPSHEETPAGE psp = {0};
2846  UINT nPages = 0;
2847  HWND hWnd;
2848  MSG msg;
2849  PSETUPDATA pSetupData = NULL;
2850  HMODULE hNetShell = NULL;
2852  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2853 
2854  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2855 
2856  /* Allocate setup data */
2857  pSetupData = HeapAlloc(GetProcessHeap(),
2859  sizeof(SETUPDATA));
2860  if (pSetupData == NULL)
2861  {
2862  LogItem(NULL, L"SetupData allocation failed!");
2863  MessageBoxW(NULL,
2864  L"Setup failed to allocate global data!",
2865  L"ReactOS Setup",
2866  MB_ICONERROR | MB_OK);
2867  goto done;
2868  }
2869 
2870  hNetShell = LoadLibraryW(L"netshell.dll");
2871  if (hNetShell != NULL)
2872  {
2873  DPRINT("Netshell.dll loaded!\n");
2874 
2875  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2876  "NetSetupRequestWizardPages");
2877  if (pfn != NULL)
2878  {
2879  pfn(&dwNetworkPageCount, NULL, NULL);
2880  dwPageCount += dwNetworkPageCount;
2881  }
2882  }
2883 
2884  DPRINT("PageCount: %lu\n", dwPageCount);
2885 
2886  phpage = HeapAlloc(GetProcessHeap(),
2888  dwPageCount * sizeof(HPROPSHEETPAGE));
2889  if (phpage == NULL)
2890  {
2891  LogItem(NULL, L"Page array allocation failed!");
2892  MessageBoxW(NULL,
2893  L"Setup failed to allocate page array!",
2894  L"ReactOS Setup",
2895  MB_ICONERROR | MB_OK);
2896  goto done;
2897  }
2898 
2899  /* Process the $winnt$.inf setup file */
2900  ProcessSetupInf(pSetupData);
2901 
2902  /* Create the Welcome page */
2903  psp.dwSize = sizeof(PROPSHEETPAGE);
2904  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2905  psp.hInstance = hDllInstance;
2906  psp.lParam = (LPARAM)pSetupData;
2907  psp.pfnDlgProc = WelcomeDlgProc;
2908  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2909  phpage[nPages++] = CreatePropertySheetPage(&psp);
2910 
2911  /* Create the Acknowledgements page */
2912  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2913  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2914  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2915  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2916  psp.pfnDlgProc = AckPageDlgProc;
2917  phpage[nPages++] = CreatePropertySheetPage(&psp);
2918 
2919  /* Create the Product page */
2920  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2921  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2922  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2923  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2924  psp.pfnDlgProc = ProductPageDlgProc;
2925  phpage[nPages++] = CreatePropertySheetPage(&psp);
2926 
2927  /* Create the Locale page */
2928  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2929  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2930  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2931  psp.pfnDlgProc = LocalePageDlgProc;
2932  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2933  phpage[nPages++] = CreatePropertySheetPage(&psp);
2934 
2935  /* Create the Owner page */
2936  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2937  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2938  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2939  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2940  psp.pfnDlgProc = OwnerPageDlgProc;
2941  phpage[nPages++] = CreatePropertySheetPage(&psp);
2942 
2943  /* Create the Computer page */
2944  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2945  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2946  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2947  psp.pfnDlgProc = ComputerPageDlgProc;
2948  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2949  phpage[nPages++] = CreatePropertySheetPage(&psp);
2950 
2951  /* Create the DateTime page */
2952  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2953  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2954  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2955  psp.pfnDlgProc = DateTimePageDlgProc;
2956  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2957  phpage[nPages++] = CreatePropertySheetPage(&psp);
2958 
2959  /* Create the theme selection page */
2960  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2961  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2962  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2963  psp.pfnDlgProc = ThemePageDlgProc;
2964  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2965  phpage[nPages++] = CreatePropertySheetPage(&psp);
2966 
2969 
2970  if (pfn)
2971  {
2972  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2973  nPages += dwNetworkPageCount;
2974  }
2975 
2976  /* Create the Process page */
2977  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2978  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2979  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2980  psp.pfnDlgProc = ProcessPageDlgProc;
2981  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2982  phpage[nPages++] = CreatePropertySheetPage(&psp);
2983 
2984  /* Create the Finish page */
2985  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2986  psp.pfnDlgProc = FinishDlgProc;
2987  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2988  phpage[nPages++] = CreatePropertySheetPage(&psp);
2989 
2990  ASSERT(nPages == dwPageCount);
2991 
2992  /* Create the property sheet */
2993  psh.dwSize = sizeof(PROPSHEETHEADER);
2994  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2995  psh.hInstance = hDllInstance;
2996  psh.hwndParent = NULL;
2997  psh.nPages = nPages;
2998  psh.nStartPage = 0;
2999  psh.phpage = phpage;
3000  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3001  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3002 
3003  /* Create title font */
3004  pSetupData->hTitleFont = CreateTitleFont();
3005  pSetupData->hBoldFont = CreateBoldFont();
3006 
3007  /* Display the wizard */
3008  hWnd = (HWND)PropertySheet(&psh);
3010 
3011  while (GetMessage(&msg, NULL, 0, 0))
3012  {
3013  if (!IsDialogMessage(hWnd, &msg))
3014  {
3016  DispatchMessage(&msg);
3017  }
3018  }
3019 
3020  DeleteObject(pSetupData->hBoldFont);
3021  DeleteObject(pSetupData->hTitleFont);
3022 
3023  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3024  SetupCloseInfFile(pSetupData->hSetupInf);
3025 
3026 done:
3027  if (phpage != NULL)
3028  HeapFree(GetProcessHeap(), 0, phpage);
3029 
3030  if (hNetShell != NULL)
3031  FreeLibrary(hNetShell);
3032 
3033  if (pSetupData != NULL)
3034  HeapFree(GetProcessHeap(), 0, pSetupData);
3035 
3036  LogItem(L"END_SECTION", L"InstallWizard");
3037 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2192
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:102
#define IDD_PRODUCT
Definition: resource.h:91
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:190
#define IDS_ACKSUBTITLE
Definition: resource.h:99
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:79
#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:1141
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:274
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:117
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2708
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:848
HANDLE HWND
Definition: compat.h:13
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1819
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:111
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:76
#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:2838
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:116
#define IDS_COMPUTERTITLE
Definition: resource.h:104
#define IDS_DATETIMETITLE
Definition: resource.h:110
#define IDS_ACKTITLE
Definition: resource.h:98
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:157
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1720
#define LoadLibraryW(x)
Definition: compat.h:412
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:100
#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:603
UINT uPostNetworkWizardPage
Definition: syssetup.h:79
#define FreeLibrary(x)
Definition: compat.h:413
#define GetProcessHeap()
Definition: compat.h:403
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:78
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:2327
#define IDS_PRODUCTTITLE
Definition: resource.h:156
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:466
HFONT hBoldFont
Definition: syssetup.h:57
#define IDS_OWNERTITLE
Definition: resource.h:101
#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:123
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:105
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:418
HFONT hTitleFont
Definition: reactos.h:117
#define IDS_LOCALESUBTITLE
Definition: resource.h:108
#define IDS_LOCALETITLE
Definition: resource.h:107
#define HeapFree(x, y, z)
Definition: compat.h:402
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:73
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:118

Referenced by InstallReactOS().

◆ LocalePageDlgProc()

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

Definition at line 1141 of file wizard.c.

1145 {
1147 
1148  /* Retrieve pointer to the global setup data */
1150 
1151  switch (uMsg)
1152  {
1153  case WM_INITDIALOG:
1154  {
1155  /* Save pointer to the global setup data */
1158  WriteUserLocale();
1159 
1161  }
1162  break;
1163 
1164  case WM_COMMAND:
1165  if (HIWORD(wParam) == BN_CLICKED)
1166  {
1167  switch (LOWORD(wParam))
1168  {
1169  case IDC_CUSTOMLOCALE:
1170  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1171  /* FIXME: Update input locale name */
1172  break;
1173 
1174  case IDC_CUSTOMLAYOUT:
1175  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1176  break;
1177  }
1178  }
1179  break;
1180 
1181  case WM_NOTIFY:
1182  {
1183  LPNMHDR lpnm = (LPNMHDR)lParam;
1184 
1185  switch (lpnm->code)
1186  {
1187  case PSN_SETACTIVE:
1188  /* Enable the Back and Next buttons */
1190  if (SetupData->UnattendSetup)
1191  {
1192  // if (!*SetupData->SourcePath)
1193  {
1194  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1195  }
1196 
1198  return TRUE;
1199  }
1200  break;
1201 
1202  case PSN_WIZNEXT:
1203  break;
1204 
1205  case PSN_WIZBACK:
1207  break;
1208 
1209  default:
1210  break;
1211  }
1212  }
1213  break;
1214 
1215  default:
1216  break;
1217  }
1218 
1219  return FALSE;
1220 }
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1120
#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
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1071
#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:64
HWND WINAPI GetParent(_In_ HWND)
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1014
#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:66
#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().

◆ OnChooseServer()

static void OnChooseServer ( HWND  hwndDlg)
static

Definition at line 442 of file wizard.c.

443 {
444  WCHAR szText[256];
445 
446  SetDlgItemTextW(hwndDlg, IDC_PRODUCT_SUITE, L"Terminal Server");
447  SetDlgItemTextW(hwndDlg, IDC_PRODUCT_TYPE, L"ServerNT");
448 
451 }
#define _countof(array)
Definition: fontsub.cpp:30
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:160
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 IDC_PRODUCT_TYPE
Definition: resource.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define IDC_PRODUCT_SUITE
Definition: resource.h:94
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:96

Referenced by ProductPageDlgProc().

◆ OnChooseWorkstation()

static void OnChooseWorkstation ( HWND  hwndDlg)
static

Definition at line 454 of file wizard.c.

455 {
456  WCHAR szText[256];
457 
458  SetDlgItemTextW(hwndDlg, IDC_PRODUCT_SUITE, L"");
459  SetDlgItemTextW(hwndDlg, IDC_PRODUCT_TYPE, L"WinNT");
460 
463 }
#define _countof(array)
Definition: fontsub.cpp:30
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:161
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 IDC_PRODUCT_TYPE
Definition: resource.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define IDC_PRODUCT_SUITE
Definition: resource.h:94
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:96

Referenced by ProductPageDlgProc().

◆ OwnerPageDlgProc()

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

Definition at line 603 of file wizard.c.

607 {
608  WCHAR OwnerName[51];
609  WCHAR OwnerOrganization[51];
610  WCHAR Title[64];
611  WCHAR ErrorName[256];
612  LPNMHDR lpnm;
613  PSETUPDATA pSetupData;
614 
615  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
616 
617  switch (uMsg)
618  {
619  case WM_INITDIALOG:
620  {
621  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
622  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
623 
624  /* set a localized ('Owner') placeholder string as default */
625  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
626  {
627  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
628  }
629 
632 
633  /* Set focus to owner name */
634  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
635 
636  /* Select the default text to quickly overwrite it by typing */
637  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
638  }
639  break;
640 
641 
642  case WM_NOTIFY:
643  {
644  lpnm = (LPNMHDR)lParam;
645 
646  switch (lpnm->code)
647  {
648  case PSN_SETACTIVE:
649  /* Enable the Back and Next buttons */
651  if (pSetupData->UnattendSetup)
652  {
653  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
655  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
656  {
658  return TRUE;
659  }
660  }
661  break;
662 
663  case PSN_WIZNEXT:
664  OwnerName[0] = 0;
665  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
666  {
668  {
669  wcscpy(Title, L"ReactOS Setup");
670  }
671  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
672  {
673  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
674  }
675  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
676 
677  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
678  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
679 
680  return TRUE;
681  }
682 
683  OwnerOrganization[0] = 0;
684  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
685 
686  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
687  {
688  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
689  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
690  return TRUE;
691  }
692 
693  case PSN_WIZBACK:
694  pSetupData->UnattendSetup = FALSE;
695  break;
696 
697  default:
698  break;
699  }
700  }
701  break;
702 
703  default:
704  break;
705  }
706 
707  return FALSE;
708 }
#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:2265
#define TRUE
Definition: types.h:120
#define IDD_COMPUTERPAGE
Definition: resource.h:47
#define _countof(array)
Definition: fontsub.cpp:30
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:131
#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:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#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 EM_SETSEL
Definition: winuser.h:2000
#define IDS_WZD_NAME
Definition: resource.h:133
_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:62
#define PSN_WIZBACK
Definition: prsht.h:120
#define SendMessage
Definition: winuser.h:5818
BOOL UnattendSetup
Definition: syssetup.h:66
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:561
#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 2192 of file wizard.c.

2196 {
2198  PREGISTRATIONNOTIFY RegistrationNotify;
2199  static UINT oldActivityID = -1;
2200  WCHAR Title[64];
2201 
2202  /* Retrieve pointer to the global setup data */
2204 
2205  switch (uMsg)
2206  {
2207  case WM_INITDIALOG:
2208  {
2209  /* Save pointer to the global setup data */
2212  }
2213  break;
2214 
2215  case WM_NOTIFY:
2216  {
2217  LPNMHDR lpnm = (LPNMHDR)lParam;
2218  ULONG MaxProgress = 0;
2219 
2220  switch (lpnm->code)
2221  {
2222  case PSN_SETACTIVE:
2223  /* Disable the Back and Next buttons */
2224  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2225 
2226  StartComponentRegistration(hwndDlg, &MaxProgress);
2227 
2229  0, MAKELPARAM(0, MaxProgress));
2231  0, 0);
2232  break;
2233 
2234  case PSN_WIZNEXT:
2235  break;
2236 
2237  case PSN_WIZBACK:
2239  break;
2240 
2241  default:
2242  break;
2243  }
2244  }
2245  break;
2246 
2248  {
2249  WCHAR Activity[64];
2250  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2251  // update if necessary only
2252  if (oldActivityID != RegistrationNotify->ActivityID)
2253  {
2254  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2255  Activity,
2256  ARRAYSIZE(Activity)))
2257  {
2259  0, (LPARAM) Activity);
2260  }
2261  oldActivityID = RegistrationNotify->ActivityID;
2262  }
2264  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2265  L"" : RegistrationNotify->CurrentItem));
2267  RegistrationNotify->Progress, 0);
2268  if (NULL != RegistrationNotify->ErrorMessage)
2269  {
2271  Title, ARRAYSIZE(Title)))
2272  {
2273  wcscpy(Title, L"ReactOS Setup");
2274  }
2275  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2276  Title, MB_ICONERROR | MB_OK);
2277 
2278  }
2279 
2280  if (wParam)
2281  {
2282  /* Enable the Back and Next buttons */
2285  }
2286  }
2287  return TRUE;
2288 
2289  default:
2290  break;
2291  }
2292 
2293  return FALSE;
2294 }
#define IDC_ITEM
Definition: resource.h:56
LPCWSTR CurrentItem
Definition: wizard.c:36
#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 PM_REGISTRATION_NOTIFY
Definition: wizard.c:25
#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:2125
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:64
#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:66
LPCWSTR ErrorMessage
Definition: wizard.c:37
#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 2708 of file wizard.c.

2710 {
2712  WCHAR szValue[MAX_PATH];
2713  INFCONTEXT InfContext;
2714  DWORD LineLength;
2715  HKEY hKey;
2716  LONG res;
2717 
2718  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2719 
2720  /* Retrieve the path of the setup INF */
2722  wcscat(szPath, L"\\$winnt$.inf");
2723 
2724  /* Open the setup INF */
2725  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2726  NULL,
2728  NULL);
2729  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2730  {
2731  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2732  return;
2733  }
2734 
2735 
2736  /* Retrieve the NT source path from which the 1st-stage installer was run */
2737  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2738  L"data",
2739  L"sourcepath",
2740  &InfContext))
2741  {
2742  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2743  return;
2744  }
2745 
2746  if (!SetupGetStringFieldW(&InfContext,
2747  1,
2748  szValue,
2749  ARRAYSIZE(szValue),
2750  &LineLength))
2751  {
2752  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2753  return;
2754  }
2755 
2756  *pSetupData->SourcePath = UNICODE_NULL;
2757 
2758  /* Close the setup INF as we are going to modify it manually */
2759  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2760  SetupCloseInfFile(pSetupData->hSetupInf);
2761 
2762 
2763  /* Find the installation source path in Win32 format */
2764  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2765  _countof(pSetupData->SourcePath),
2766  szValue))
2767  {
2768  *pSetupData->SourcePath = UNICODE_NULL;
2769  }
2770 
2771  /* Save the path in Win32 format in the setup INF */
2772  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2773  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2774 
2775  /*
2776  * Save it also in the registry, in the following keys:
2777  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2778  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2779  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2780  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2781  */
2782 #if 0
2784  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2785  0,
2787  &hKey);
2788 
2789  if (res != ERROR_SUCCESS)
2790  {
2791  return FALSE;
2792  }
2793 #endif
2794 
2796  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2797  0, NULL,
2799  KEY_ALL_ACCESS, // KEY_WRITE
2800  NULL,
2801  &hKey,
2802  NULL);
2803  if (res == ERROR_SUCCESS)
2804  {
2805  res = RegSetValueExW(hKey,
2806  L"SourcePath",
2807  0,
2808  REG_SZ,
2809  (LPBYTE)pSetupData->SourcePath,
2810  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2811 
2812  res = RegSetValueExW(hKey,
2813  L"ServicePackSourcePath",
2814  0,
2815  REG_SZ,
2816  (LPBYTE)pSetupData->SourcePath,
2817  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2818 
2819  RegCloseKey(hKey);
2820  }
2821 
2822 
2823  /* Now, re-open the setup INF (this must succeed) */
2824  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2825  NULL,
2827  NULL);
2828  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2829  {
2830  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2831  return;
2832  }
2833 
2834  /* Process the unattended section of the setup file */
2835  ProcessUnattendSection(pSetupData);
2836 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2426
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 _countof(array)
Definition: fontsub.cpp:30
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
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 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 MAX_PATH
Definition: compat.h:26
#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:2483
_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 2483 of file wizard.c.

2485 {
2486  INFCONTEXT InfContext;
2487  WCHAR szName[256];
2488  WCHAR szValue[MAX_PATH];
2489  DWORD LineLength;
2490  HKEY hKey;
2491 
2492  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2493  L"Unattend",
2494  L"UnattendSetupEnabled",
2495  &InfContext))
2496  {
2497  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2498  return;
2499  }
2500 
2501  if (!SetupGetStringFieldW(&InfContext,
2502  1,
2503  szValue,
2504  ARRAYSIZE(szValue),
2505  &LineLength))
2506  {
2507  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2508  return;
2509  }
2510 
2511  if (_wcsicmp(szValue, L"yes") != 0)
2512  {
2513  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2514  return;
2515  }
2516 
2517  pSetupData->UnattendSetup = TRUE;
2518 
2519  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2520  L"Unattend",
2521  NULL,
2522  &InfContext))
2523  {
2524  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2525  return;
2526  }
2527 
2528  do
2529  {
2530  if (!SetupGetStringFieldW(&InfContext,
2531  0,
2532  szName,
2533  ARRAYSIZE(szName),
2534  &LineLength))
2535  {
2536  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2537  return;
2538  }
2539 
2540  if (!SetupGetStringFieldW(&InfContext,
2541  1,
2542  szValue,
2543  ARRAYSIZE(szValue),
2544  &LineLength))
2545  {
2546  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2547  return;
2548  }
2549  DPRINT1("Name %S Value %S\n", szName, szValue);
2550  if (!_wcsicmp(szName, L"FullName"))
2551  {
2552  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2553  {
2554  wcscpy(pSetupData->OwnerName, szValue);
2555  }
2556  }
2557  else if (!_wcsicmp(szName, L"OrgName"))
2558  {
2559  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2560  {
2561  wcscpy(pSetupData->OwnerOrganization, szValue);
2562  }
2563  }
2564  else if (!_wcsicmp(szName, L"ComputerName"))
2565  {
2566  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2567  {
2568  wcscpy(pSetupData->ComputerName, szValue);
2569  }
2570  }
2571  else if (!_wcsicmp(szName, L"AdminPassword"))
2572  {
2573  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2574  {
2575  wcscpy(pSetupData->AdminPassword, szValue);
2576  }
2577  }
2578  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2579  {
2580  pSetupData->TimeZoneIndex = _wtoi(szValue);
2581  }
2582  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2583  {
2584  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2585  }
2586  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2587  {
2588  if (!_wcsicmp(szValue, L"yes"))
2589  pSetupData->DisableGeckoInst = TRUE;
2590  else
2591  pSetupData->DisableGeckoInst = FALSE;
2592  }
2593 
2594  } while (SetupFindNextLine(&InfContext, &InfContext));
2595 
2596  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2597  L"Display",
2598  NULL,
2599  &InfContext))
2600  {
2601  DEVMODEW dm = { { 0 } };
2602  dm.dmSize = sizeof(dm);
2604  {
2605  do
2606  {
2607  int iValue;
2608  if (!SetupGetStringFieldW(&InfContext,
2609  0,
2610  szName,
2611  ARRAYSIZE(szName),
2612  &LineLength))
2613  {
2614  DPRINT1("Error: SetupGetStringField failed with %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  iValue = _wtoi(szValue);
2628  DPRINT1("Name %S Value %i\n", szName, iValue);
2629 
2630  if (!iValue)
2631  continue;
2632 
2633  if (!_wcsicmp(szName, L"BitsPerPel"))
2634  {
2635  dm.dmFields |= DM_BITSPERPEL;
2636  dm.dmBitsPerPel = iValue;
2637  }
2638  else if (!_wcsicmp(szName, L"XResolution"))
2639  {
2640  dm.dmFields |= DM_PELSWIDTH;
2641  dm.dmPelsWidth = iValue;
2642  }
2643  else if (!_wcsicmp(szName, L"YResolution"))
2644  {
2645  dm.dmFields |= DM_PELSHEIGHT;
2646  dm.dmPelsHeight = iValue;
2647  }
2648  else if (!_wcsicmp(szName, L"VRefresh"))
2649  {
2651  dm.dmDisplayFrequency = iValue;
2652  }
2653  } while (SetupFindNextLine(&InfContext, &InfContext));
2654 
2656  }
2657  }
2658 
2660  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2661  0,
2662  KEY_SET_VALUE,
2663  &hKey) != ERROR_SUCCESS)
2664  {
2665  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2666  return;
2667  }
2668 
2669  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2670  L"GuiRunOnce",
2671  NULL,
2672  &InfContext))
2673  {
2674  int i = 0;
2675  do
2676  {
2677  if (SetupGetStringFieldW(&InfContext,
2678  0,
2679  szValue,
2680  ARRAYSIZE(szValue),
2681  NULL))
2682  {
2684  swprintf(szName, L"%d", i);
2685  DPRINT("szName %S szValue %S\n", szName, szValue);
2686 
2687  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2688  {
2689  DPRINT("value %S\n", szPath);
2690  if (RegSetValueExW(hKey,
2691  szName,
2692  0,
2693  REG_SZ,
2694  (const BYTE*)szPath,
2695  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2696  {
2697  i++;
2698  }
2699  }
2700  }
2701  } while (SetupFindNextLine(&InfContext, &InfContext));
2702  }
2703 
2704  RegCloseKey(hKey);
2705 }
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 TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
DWORD dmFields
Definition: wingdi.h:1621
_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:1059
DWORD dmBitsPerPel
Definition: wingdi.h:1646
#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
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:26
#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: mem.h:68
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 466 of file wizard.c.

467 {
468  LPNMHDR lpnm;
469  PSETUPDATA pSetupData;
470  INT iItem;
471  WCHAR szText[64];
472  HICON hIcon;
473 
474  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
475 
476  switch (uMsg)
477  {
478  case WM_INITDIALOG:
479  {
480  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
481  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
482 
485 
488 
490  OnChooseWorkstation(hwndDlg);
491 
494  return TRUE;
495  }
496 
497  case WM_COMMAND:
499  {
500  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
501  switch ((PRODUCT_OPTION)iItem)
502  {
504  OnChooseServer(hwndDlg);
505  break;
506 
508  OnChooseWorkstation(hwndDlg);
509  break;
510 
511  default:
512  break;
513  }
514  }
515  break;
516 
517  case WM_NOTIFY:
518  {
519  lpnm = (LPNMHDR)lParam;
520 
521  switch (lpnm->code)
522  {
523  case PSN_SETACTIVE:
524  /* Enable the Back and Next buttons */
526  if (pSetupData->UnattendSetup)
527  {
529  OnChooseWorkstation(hwndDlg);
530  DoWriteProductOption(pSetupData->ProductOption);
532  return TRUE;
533  }
534  break;
535 
536  case PSN_WIZNEXT:
537  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
538  pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
539  DoWriteProductOption(pSetupData->ProductOption);
540  break;
541 
542  case PSN_WIZBACK:
543  pSetupData->UnattendSetup = FALSE;
544  break;
545 
546  default:
547  break;
548  }
549  }
550  break;
551 
552  default:
553  break;
554  }
555 
556  return FALSE;
557 }
#define STM_SETICON
Definition: winuser.h:2074
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
#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:57
#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
UINT code
Definition: winuser.h:3134
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:92
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:93
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:381
#define IDI_WINLOGO
Definition: winuser.h:704
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void OnChooseServer(HWND hwndDlg)
Definition: wizard.c:442
#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:81
#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:66
#define LoadIcon
Definition: winuser.h:5788
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:159
#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:158
#define WM_NOTIFY
Definition: richedit.h:61
static void OnChooseWorkstation(HWND hwndDlg)
Definition: wizard.c:454
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 1933 of file wizard.c.

1937 {
1938  PREGISTRATIONDATA RegistrationData;
1939  REGISTRATIONNOTIFY RegistrationNotify;
1940  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1941  UINT MessageID;
1942  WCHAR ErrorMessage[128];
1943 
1944  RegistrationData = (PREGISTRATIONDATA) Context;
1945 
1946  if (SPFILENOTIFY_STARTREGISTRATION == Notification ||
1947  SPFILENOTIFY_ENDREGISTRATION == Notification)
1948  {
1949  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1950  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1951  if (NULL == RegistrationNotify.CurrentItem)
1952  {
1953  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1954  }
1955  else
1956  {
1957  RegistrationNotify.CurrentItem++;
1958  }
1959 
1960  if (SPFILENOTIFY_STARTREGISTRATION == Notification)
1961  {
1962  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1963  StatusInfo->FileName);
1964  RegistrationNotify.ErrorMessage = NULL;
1965  RegistrationNotify.Progress = RegistrationData->Registered;
1966  }
1967  else
1968  {
1969  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1970  StatusInfo->FileName);
1971  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1972  StatusInfo->FailureCode);
1973  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1974  {
1975  switch(StatusInfo->FailureCode)
1976  {
1977  case SPREG_LOADLIBRARY:
1979  break;
1980  case SPREG_GETPROCADDR:
1982  break;
1983  case SPREG_REGSVR:
1985  break;
1986  case SPREG_DLLINSTALL:
1988  break;
1989  case SPREG_TIMEOUT:
1991  break;
1992  default:
1994  break;
1995  }
1997  ErrorMessage,
1999  {
2000  ErrorMessage[0] = L'\0';
2001  }
2002  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
2003  {
2005  StatusInfo->Win32Error, 0,
2008  NULL);
2009  }
2010  RegistrationNotify.ErrorMessage = ErrorMessage;
2011  }
2012  else
2013  {
2014  RegistrationNotify.ErrorMessage = NULL;
2015  }
2016  if (RegistrationData->Registered < RegistrationData->DllCount)
2017  {
2018  RegistrationData->Registered++;
2019  }
2020  }
2021 
2022  RegistrationNotify.Progress = RegistrationData->Registered;
2023  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
2024  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
2025  0, (LPARAM) &RegistrationNotify);
2026 
2027  return FILEOP_DOIT;
2028  }
2029  else
2030  {
2031  DPRINT1("Received unexpected notification %u\n", Notification);
2032  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2033  Notification, Param1, Param2);
2034  }
2035 }
LPCWSTR CurrentItem
Definition: wizard.c:36
ULONG DllCount
Definition: wizard.c:43
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:124
#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:44
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:123
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SetupDefaultQueueCallback
Definition: setupapi.h:2567
PVOID DefaultContext
Definition: wizard.c:45
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:25
_In_ PVOID _In_ ULONG MessageID
Definition: ketypes.h:507
#define SPREG_REGSVR
Definition: setupapi.h:650
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:127
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(_In_z_ const wchar_t *_Str, _In_ wchar_t _Ch)
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:125
#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:129
#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:37
#define SPREG_TIMEOUT
Definition: setupapi.h:652
#define IDS_REGSVR_FAILED
Definition: resource.h:126
#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 2039 of file wizard.c.

2040 {
2041  PREGISTRATIONDATA RegistrationData;
2042  REGISTRATIONNOTIFY RegistrationNotify;
2043  DWORD LastError = NO_ERROR;
2044  WCHAR UnknownError[84];
2045 
2046  RegistrationData = (PREGISTRATIONDATA) Parameter;
2047  RegistrationData->Registered = 0;
2048  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
2049 
2050  _SEH2_TRY
2051  {
2052  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
2053  hSysSetupInf,
2054  L"RegistrationPhase2",
2055  SPINST_REGISTRY |
2056  SPINST_REGISTERCALLBACKAWARE |
2057  SPINST_REGSVR,
2058  0,
2059  NULL,
2060  0,
2062  RegistrationData,
2063  NULL,
2064  NULL))
2065  {
2066  LastError = GetLastError();
2067  }
2068  }
2070  {
2071  DPRINT("Catching exception\n");
2073  }
2074  _SEH2_END;
2075 
2076  if (NO_ERROR == LastError)
2077  {
2078  RegistrationNotify.ErrorMessage = NULL;
2079  }
2080  else
2081  {
2082  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
2083  LastError);
2085  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
2086  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
2087  NULL))
2088  {
2090  UnknownError,
2091  ARRAYSIZE(UnknownError) - 20))
2092  {
2093  wcscpy(UnknownError, L"Unknown error");
2094  }
2095  wcscat(UnknownError, L" ");
2096  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2097  RegistrationNotify.ErrorMessage = UnknownError;
2098  }
2099  }
2100 
2101  RegistrationNotify.Progress = RegistrationData->DllCount;
2102  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
2103  RegistrationNotify.CurrentItem = NULL;
2104  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
2105  1, (LPARAM) &RegistrationNotify);
2106  if (NULL != RegistrationNotify.ErrorMessage &&
2107  UnknownError != RegistrationNotify.ErrorMessage)
2108  {
2109  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
2110  }
2111 
2112  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
2113  HeapFree(GetProcessHeap(), 0, RegistrationData);
2114 
2115  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
2116 
2117  // FIXME: Move this call to a separate cleanup page!
2119 
2120  return 0;
2121 }
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:423
LPCWSTR CurrentItem
Definition: wizard.c:36
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
ULONG DllCount
Definition: wizard.c:43
#define SPINST_REGSVR
Definition: setupapi.h:589
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
ULONG Registered
Definition: wizard.c:44
_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:4250
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:123
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1933
PVOID DefaultContext
Definition: wizard.c:45
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:25
#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:403
__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:122
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:4424
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:37
#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:402

Referenced by StartComponentRegistration().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 1071 of file wizard.c.

1072 {
1073  MSG msg;
1074  STARTUPINFOW StartupInfo;
1075  PROCESS_INFORMATION ProcessInformation;
1076  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1077 
1078  if (!pwszCPLParameters)
1079  {
1080  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1081  return FALSE;
1082  }
1083 
1084  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1085  StartupInfo.cb = sizeof(StartupInfo);
1086  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1087 
1088  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1089  wcscat(CmdLine, pwszCPLParameters);
1090 
1091  if (!CreateProcessW(NULL,
1092  CmdLine,
1093  NULL,
1094  NULL,
1095  FALSE,
1096  0,
1097  NULL,
1098  NULL,
1099  &StartupInfo,
1100  &ProcessInformation))
1101  {
1102  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1103  return FALSE;
1104  }
1105 
1107  {
1108  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1109  {
1112  }
1113  }
1114  CloseHandle(ProcessInformation.hThread);
1115  CloseHandle(ProcessInformation.hProcess);
1116  return TRUE;
1117 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
#define _countof(array)
Definition: fontsub.cpp:30
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define ZeroMemory
Definition: winbase.h:1642
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:4593
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:824
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
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().

◆ SetAutoDaylightInfo()

static VOID SetAutoDaylightInfo ( HWND  hwnd)
static

Definition at line 1638 of file wizard.c.

1639 {
1640  HKEY hKey;
1641  DWORD dwValue = 1;
1642 
1643  if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED)
1644  {
1646  L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
1647  0,
1648  KEY_SET_VALUE,
1649  &hKey))
1650  return;
1651 
1652  RegSetValueExW(hKey,
1653  L"DisableAutoDaylightTimeSet",
1654  0,
1655  REG_DWORD,
1656  (LPBYTE)&dwValue,
1657  sizeof(DWORD));
1658  RegCloseKey(hKey);
1659  }
1660 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define KEY_SET_VALUE
Definition: nt_native.h:1017
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define BM_GETCHECK
Definition: winuser.h:1900
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
#define BST_UNCHECKED
Definition: winuser.h:199
#define SendMessage
Definition: winuser.h:5818
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 WriteDateTimeSettings().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2298 of file wizard.c.

2299 {
2300  HKEY hKey = 0;
2301  DWORD InProgress = 0;
2302  DWORD InstallDate;
2303 
2305  L"SYSTEM\\Setup",
2306  0,
2307  KEY_WRITE,
2308  &hKey ) == ERROR_SUCCESS)
2309  {
2310  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2311  RegCloseKey( hKey );
2312  }
2313 
2315  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2316  0,
2317  KEY_WRITE,
2318  &hKey ) == ERROR_SUCCESS)
2319  {
2320  InstallDate = (DWORD)time(NULL);
2321  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2322  RegCloseKey( hKey );
2323  }
2324 }
#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 1014 of file wizard.c.

1015 {
1016 #if 0
1017  TCHAR szLayoutPath[256];
1018  TCHAR szLocaleName[32];
1019  DWORD dwLocaleSize;
1020  HKEY hKey;
1021 
1023  _T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
1024  0,
1026  &hKey))
1027  return;
1028 
1029  dwValueSize = 16 * sizeof(TCHAR);
1030  if (RegQueryValueEx(hKey,
1031  NULL,
1032  NULL,
1033  NULL,
1034  szLocaleName,
1035  &dwLocaleSize))
1036  {
1037  RegCloseKey(hKey);
1038  return;
1039  }
1040 
1041  _tcscpy(szLayoutPath,
1042  _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"));
1043  _tcscat(szLayoutPath,
1044  szLocaleName);
1045 
1047  szLayoutPath,
1048  0,
1050  &hKey))
1051  return;
1052 
1053  dwValueSize = 32 * sizeof(TCHAR);
1054  if (RegQueryValueEx(hKey,
1055  _T("Layout Text"),
1056  NULL,
1057  NULL,
1058  szLocaleName,
1059  &dwLocaleSize))
1060  {
1061  RegCloseKey(hKey);
1062  return;
1063  }
1064 
1065  RegCloseKey(hKey);
1066 #endif
1067 }
#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 1564 of file wizard.c.

1565 {
1566  TIME_ZONE_INFORMATION TimeZoneInformation;
1568  DWORD dwIndex;
1569  DWORD i;
1570 
1571  dwIndex = SendMessage(hwnd,
1572  CB_GETCURSEL,
1573  0,
1574  0);
1575 
1576  i = 0;
1578  while (i < dwIndex)
1579  {
1580  if (Entry == NULL)
1581  return;
1582 
1583  i++;
1584  Entry = Entry->Next;
1585  }
1586 
1587  wcscpy(TimeZoneInformation.StandardName,
1588  Entry->StandardName);
1589  wcscpy(TimeZoneInformation.DaylightName,
1590  Entry->DaylightName);
1591 
1592  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1593  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1594  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1595 
1596  memcpy(&TimeZoneInformation.StandardDate,
1597  &Entry->TimezoneInfo.StandardDate,
1598  sizeof(SYSTEMTIME));
1599  memcpy(&TimeZoneInformation.DaylightDate,
1600  &Entry->TimezoneInfo.DaylightDate,
1601  sizeof(SYSTEMTIME));
1602 
1603  /* Set time zone information */
1604  SetTimeZoneInformation(&TimeZoneInformation);
1605 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:24
#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:1168
WCHAR DaylightName[32]
Definition: winbase.h:1170
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:70
#define SendMessage
Definition: winuser.h:5818
WCHAR StandardName[32]
Definition: winbase.h:1167
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1171

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1664 of file wizard.c.

1665 {
1666  BOOL Ret = FALSE;
1667 
1668  /*
1669  * Call SetLocalTime twice to ensure correct results
1670  */
1671  Ret = SetLocalTime(&SetupData->SystemTime) &&
1673 
1674  return Ret;
1675 }
unsigned int BOOL
Definition: ntddk_ex.h:94
SETUPDATA SetupData
Definition: reactos.c:41
SYSTEMTIME SystemTime
Definition: syssetup.h:69
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 1534 of file wizard.c.

1535 {
1537  DWORD dwIndex = 0;
1538  DWORD dwCount;
1539 
1540  GetTimeZoneListIndex(&dwEntryIndex);
1541 
1543  while (Entry != NULL)
1544  {
1545  dwCount = SendMessage(hwnd,
1546  CB_ADDSTRING,
1547  0,
1548  (LPARAM)Entry->Description);
1549 
1550  if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1551  dwIndex = dwCount;
1552 
1553  Entry = Entry->Next;
1554  }
1555 
1556  SendMessage(hwnd,
1557  CB_SETCURSEL,
1558  (WPARAM)dwIndex,
1559  0);
1560 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:24
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
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:70
static BOOL GetTimeZoneListIndex(LPDWORD lpIndex)
Definition: wizard.c:1422
#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 2125 of file wizard.c.

2126 {
2127  HANDLE RegistrationThread;
2128  LONG DllCount;
2130  WCHAR SectionName[512];
2131  PREGISTRATIONDATA RegistrationData;
2132 
2133  DllCount = -1;
2134  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
21