ReactOS  0.4.14-dev-49-gfb4591c
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 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 2656 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_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:54
#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:56
#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:3133
#define DialogBox
Definition: winuser.h:5662
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:395
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:112
static const WCHAR L[]
Definition: oid.c:1250
#define IDD_LOCALEPAGE
Definition: resource.h:13
#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:246
BOOL UnattendSetup
Definition: syssetup.h:60
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:394
#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:292
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
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:294
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 666 of file wizard.c.

670 {
671  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
672  WCHAR Password1[128];
673  WCHAR Password2[128];
675  WCHAR Title[64];
676  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
677  LPNMHDR lpnm;
678  PSETUPDATA pSetupData;
679 
680  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
681 
683  {
684  wcscpy(Title, L"ReactOS Setup");
685  }
686 
687  switch (uMsg)
688  {
689  case WM_INITDIALOG:
690  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
691  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
692 
693  /* Generate a new pseudo-random computer name */
694  GenerateComputerName(ComputerName);
695 
696  /* Display current computer name */
697  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
698 
699  /* Set text limits */
703 
704  /* Set focus to computer name */
706  if (pSetupData->UnattendSetup)
707  {
713  }
714 
715  /* Store the administrator account name as the default user name */
716  WriteDefaultLogonData(pSetupData->ComputerName);
717  break;
718 
719 
720  case WM_NOTIFY:
721  {
722  lpnm = (LPNMHDR)lParam;
723 
724  switch (lpnm->code)
725  {
726  case PSN_SETACTIVE:
727  /* Enable the Back and Next buttons */
729  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
730  {
732  return TRUE;
733  }
734  break;
735 
736  case PSN_WIZNEXT:
737  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
738  {
739  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
740  ARRAYSIZE(EmptyComputerName)))
741  {
742  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
743  }
744  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
746  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
747  return TRUE;
748  }
749 
750  /* No need to check computer name for invalid characters,
751  * SetComputerName() will do it for us */
752 
753  if (!WriteComputerSettings(ComputerName, hwndDlg))
754  {
756  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
757  return TRUE;
758  }
759 
760 #if 0
761  /* Check if admin passwords have been entered */
762  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
763  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
764  {
765  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
766  ARRAYSIZE(EmptyPassword)))
767  {
768  wcscpy(EmptyPassword, L"You must enter a password !");
769  }
770  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
771  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
772  return TRUE;
773  }
774 #else
775  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
776  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
777 #endif
778  /* Check if passwords match */
779  if (wcscmp(Password1, Password2))
780  {
781  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
782  ARRAYSIZE(NotMatchPassword)))
783  {
784  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
785  }
786  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
787  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
788  return TRUE;
789  }
790 
791  /* Check password for invalid characters */
792  Password = (PWCHAR)Password1;
793  while (*Password)
794  {
795  if (!isprint(*Password))
796  {
797  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
798  ARRAYSIZE(WrongPassword)))
799  {
800  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
801  }
802  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
803  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
804  return TRUE;
805  }
806  Password++;
807  }
808 
809  /* Set admin password */
810  SetAdministratorPassword(Password1);
811  break;
812 
813  case PSN_WIZBACK:
814  pSetupData->UnattendSetup = FALSE;
815  break;
816 
817  default:
818  break;
819  }
820  }
821  break;
822 
823  default:
824  break;
825  }
826 
827  return FALSE;
828 }
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:2208
#define TRUE
Definition: types.h:120
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:648
#define IDS_REACTOS_SETUP
Definition: resource.h:124
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:596
#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:5743
uint16_t * PWCHAR
Definition: typedefs.h:54
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:130
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:128
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:3133
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:58
#define LPPROPSHEETPAGE
Definition: prsht.h:372
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:339
#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:5686
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:533
#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:59
#define PSN_WIZBACK
Definition: prsht.h:120
#define isprint(c)
Definition: acclib.h:73
#define SendMessage
Definition: winuser.h:5744
BOOL UnattendSetup
Definition: syssetup.h:60
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:129
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:131
#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 1060 of file wizard.c.

1061 {
1062  WCHAR szKeyName[256];
1063  DWORD dwIndex;
1064  DWORD dwNameSize;
1065  DWORD dwValueSize;
1066  LONG lError;
1067  HKEY hZonesKey;
1068  HKEY hZoneKey;
1069 
1071  PTIMEZONE_ENTRY Current;
1072 
1074  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
1075  0,
1077  &hZonesKey))
1078  return;
1079 
1080  dwIndex = 0;
1081  while (TRUE)
1082  {
1083  dwNameSize = 256 * sizeof(WCHAR);
1084  lError = RegEnumKeyExW(hZonesKey,
1085  dwIndex,
1086  szKeyName,
1087  &dwNameSize,
1088  NULL,
1089  NULL,
1090  NULL,
1091  NULL);
1092  if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA)
1093  break;
1094 
1095  if (RegOpenKeyExW(hZonesKey,
1096  szKeyName,
1097  0,
1099  &hZoneKey))
1100  break;
1101 
1103  if (Entry == NULL)
1104  {
1105  RegCloseKey(hZoneKey);
1106  break;
1107  }
1108 
1109  dwValueSize = 64 * sizeof(WCHAR);
1110  if (RegQueryValueExW(hZoneKey,
1111  L"Display",
1112  NULL,
1113  NULL,
1114  (LPBYTE)&Entry->Description,
1115  &dwValueSize))
1116  {
1117  RegCloseKey(hZoneKey);
1118  break;
1119  }
1120 
1121  dwValueSize = 32 * sizeof(WCHAR);
1122  if (RegQueryValueExW(hZoneKey,
1123  L"Std",
1124  NULL,
1125  NULL,
1126  (LPBYTE)&Entry->StandardName,
1127  &dwValueSize))
1128  {
1129  RegCloseKey(hZoneKey);
1130  break;
1131  }
1132 
1133  dwValueSize = 32 * sizeof(WCHAR);
1134  if (RegQueryValueExW(hZoneKey,
1135  L"Dlt",
1136  NULL,
1137  NULL,
1138  (LPBYTE)&Entry->DaylightName,
1139  &dwValueSize))
1140  {
1141  RegCloseKey(hZoneKey);
1142  break;
1143  }
1144 
1145  dwValueSize = sizeof(DWORD);
1146  if (RegQueryValueExW(hZoneKey,
1147  L"Index",
1148  NULL,
1149  NULL,
1150  (LPBYTE)&Entry->Index,
1151  &dwValueSize))
1152  {
1153  RegCloseKey(hZoneKey);
1154  break;
1155  }
1156 
1157  dwValueSize = sizeof(TZ_INFO);
1158  if (RegQueryValueExW(hZoneKey,
1159  L"TZI",
1160  NULL,
1161  NULL,
1162  (LPBYTE)&Entry->TimezoneInfo,
1163  &dwValueSize))
1164  {
1165  RegCloseKey(hZoneKey);
1166  break;
1167  }
1168 
1169  RegCloseKey(hZoneKey);
1170 
1171  if (SetupData->TimeZoneListHead == NULL &&
1173  {
1174  Entry->Prev = NULL;
1175  Entry->Next = NULL;
1178  }
1179  else
1180  {
1181  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1182  if (Current != NULL)
1183  {
1184  if (Current == SetupData->TimeZoneListHead)
1185  {
1186  /* Prepend to head */
1187  Entry->Prev = NULL;
1188  Entry->Next = SetupData->TimeZoneListHead;
1191  }
1192  else
1193  {
1194  /* Insert before current */
1195  Entry->Prev = Current->Prev;
1196  Entry->Next = Current;
1197  Current->Prev->Next = Entry;
1198  Current->Prev = Entry;
1199  }
1200  }
1201  else
1202  {
1203  /* Append to tail */
1204  Entry->Prev = SetupData->TimeZoneListTail;
1205  Entry->Next = NULL;
1208  }
1209  }
1210 
1211  dwIndex++;
1212  }
1213 
1214  RegCloseKey(hZonesKey);
1215 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1042
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:52
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
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:64
#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:65
#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 1538 of file wizard.c.

1542 {
1544 
1545  /* Retrieve pointer to the global setup data */
1547 
1548  switch (uMsg)
1549  {
1550  case WM_INITDIALOG:
1551  /* Save pointer to the global setup data */
1554 
1556 
1557  if (SetupData->UnattendSetup)
1558  {
1561 
1563  {
1565  }
1566  }
1567  else
1568  {
1570  SetupData, -1);
1571 
1573  }
1574  break;
1575 
1576  case WM_TIMER:
1577  UpdateLocalSystemTime(hwndDlg);
1578  break;
1579 
1580  case WM_NOTIFY:
1581  switch (((LPNMHDR)lParam)->code)
1582  {
1583  case PSN_SETACTIVE:
1584  /* Enable the Back and Next buttons */
1587  {
1589  return TRUE;
1590  }
1591  SetTimer(hwndDlg, 1, 1000, NULL);
1592  break;
1593 
1594  case PSN_KILLACTIVE:
1595  case DTN_DATETIMECHANGE:
1596  KillTimer(hwndDlg, 1);
1597  break;
1598 
1599  case PSN_WIZNEXT:
1600  WriteDateTimeSettings(hwndDlg, SetupData);
1601  break;
1602 
1603  case PSN_WIZBACK:
1605  break;
1606 
1607  default:
1608  break;
1609  }
1610  break;
1611 
1612  case WM_DESTROY:
1614  break;
1615 
1616  default:
1617  break;
1618  }
1619 
1620  return FALSE;
1621 }
#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:1497
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5743
#define PSN_SETACTIVE
Definition: prsht.h:115
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:67
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1060
#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:1508
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1219
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
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:72
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
uint32_t DWORD_PTR
Definition: typedefs.h:63
DWORD TimeZoneIndex
Definition: syssetup.h:66
HWND WINAPI GetParent(_In_ HWND)
#define BST_CHECKED
Definition: winuser.h:197
#define PSN_WIZBACK
Definition: prsht.h:120
BOOL UnattendSetup
Definition: syssetup.h:60
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1352
#define GetWindowLongPtr
Definition: treelist.c:73
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4338
#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 1219 of file wizard.c.

1220 {
1222 
1223  while (SetupData->TimeZoneListHead != NULL)
1224  {
1226 
1227  SetupData->TimeZoneListHead = Entry->Next;
1229  {
1231  }
1232 
1233  HeapFree(GetProcessHeap(), 0, Entry);
1234  }
1235 
1237 }
struct _Entry Entry
Definition: kefuncs.h:640
Definition: timezone.c:24
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:26
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:64
#define HeapFree(x, y, z)
Definition: compat.h:394
base of all file and directory entries
Definition: entries.h:82
PTIMEZONE_ENTRY TimeZoneListTail
Definition: syssetup.h:65

Referenced by DateTimePageDlgProc().

◆ FinishDlgProc()

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

Definition at line 2145 of file wizard.c.

2149 {
2150 
2151  switch (uMsg)
2152  {
2153  case WM_INITDIALOG:
2154  {
2155  /* Get pointer to the global setup data */
2157 
2159  {
2160  /* Run the Wine Gecko prompt */
2161  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2162  }
2163 
2164  /* Set title font */
2165  SendDlgItemMessage(hwndDlg,
2167  WM_SETFONT,
2169  (LPARAM)TRUE);
2170  if (SetupData->UnattendSetup)
2171  {
2172  KillTimer(hwndDlg, 1);
2174  PostQuitMessage(0);
2175  }
2176  }
2177  break;
2178 
2179  case WM_DESTROY:
2180  {
2182  PostQuitMessage(0);
2183  return TRUE;
2184  }
2185 
2186  case WM_TIMER:
2187  {
2188  INT Position;
2189  HWND hWndProgress;
2190 
2191  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2192  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2193  if (Position == 300)
2194  {
2195  KillTimer(hwndDlg, 1);
2197  }
2198  else
2199  {
2200  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2201  }
2202  }
2203  return TRUE;
2204 
2205  case WM_NOTIFY:
2206  {
2207  LPNMHDR lpnm = (LPNMHDR)lParam;
2208 
2209  switch (lpnm->code)
2210  {
2211  case PSN_SETACTIVE:
2212  /* Enable the correct buttons on for the active page */
2214 
2216  MAKELPARAM(0, 300));
2218  SetTimer(hwndDlg, 1, 50, NULL);
2219  break;
2220 
2221  case PSN_WIZFINISH:
2222  DestroyWindow(GetParent(hwndDlg));
2223  break;
2224 
2225  default:
2226  break;
2227  }
2228  }
2229  break;
2230 
2231  default:
2232  break;
2233  }
2234 
2235  return FALSE;
2236 }
#define TRUE
Definition: types.h:120
static COORD Position
Definition: mouse.c:34
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define PBM_SETPOS
Definition: commctrl.h:2156
UINT_PTR WPARAM
Definition: windef.h:207
#define PSBTN_FINISH
Definition: prsht.h:148
#define SendDlgItemMessage
Definition: winuser.h:5743
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PSN_SETACTIVE
Definition: prsht.h:115
int32_t INT
Definition: typedefs.h:56
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3133
#define PBM_SETRANGE
Definition: commctrl.h:2155
#define PSN_WIZFINISH
Definition: prsht.h:122
#define LPPROPSHEETPAGE
Definition: prsht.h:372
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:339
BOOL DisableGeckoInst
Definition: syssetup.h:61
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:2116
#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:5744
BOOL UnattendSetup
Definition: syssetup.h:60
HFONT hTitleFont
Definition: reactos.h:117
#define PropSheet_PressButton(d, i)
Definition: prsht.h:330
#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:2166
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 648 of file wizard.c.

649 {
650  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
651  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
652  unsigned i;
653 
654  wcscpy(lpBuffer, L"REACTOS-");
655 
656  srand(GetTickCount());
657 
658  /* fill in 7 characters */
659  for (i = 8; i < 15; i++)
660  lpBuffer[i] = Chars[rand() % cChars];
661 
662  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
663 }
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
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 2244 of file wizard.c.

2248 {
2249  WCHAR wszDrives[512];
2250  WCHAR wszNTPath[512]; // MAX_PATH ?
2251  DWORD cchDrives;
2252  PWCHAR pwszDrive;
2253 
2254  *pwszPath = UNICODE_NULL;
2255 
2256  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2257  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2258  {
2259  /* Buffer too small or failure */
2260  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2261  return FALSE;
2262  }
2263 
2264  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2265  {
2266  WCHAR wszBuf[MAX_PATH];
2267 
2268  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2269  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2270  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2271  pwszDrive[2] = L'\\'; // Restore the backslash
2272 
2273  wcscat(wszNTPath, L"\\"); // Concat a backslash
2274 
2275  /* Logging */
2276  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2277  pwszDrive, wszNTPath,
2278  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2279  LogItem(NULL, wszBuf);
2280 
2281  /* Check whether the NT path corresponds to the NT installation source path */
2282  if (!_wcsicmp(wszNTPath, pwszNTPath))
2283  {
2284  /* Found it! */
2285  wcscpy(pwszPath, pwszDrive); // cchPathMax
2286 
2287  /* Logging */
2288  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2289  LogItem(NULL, wszBuf);
2290  wcscat(wszBuf, L"\n");
2291  OutputDebugStringW(wszBuf);
2292 
2293  return TRUE;
2294  }
2295  }
2296 
2297  return FALSE;
2298 }
#define TRUE
Definition: types.h:120
#define _countof(array)
Definition: fontsub.cpp:30
uint16_t * PWCHAR
Definition: typedefs.h:54
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:5766
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:110

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1042 of file wizard.c.

1043 {
1045 
1047  while (Entry != NULL)
1048  {
1049  if (Entry->Index >= Index)
1050  return Entry;
1051 
1052  Entry = Entry->Next;
1053  }
1054 
1055  return NULL;
1056 }
struct _Entry Entry
Definition: kefuncs.h:640
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:64
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 1427 of file wizard.c.

1428 {
1429  SYSTEMTIME Date;
1430  SYSTEMTIME Time;
1431 
1433  {
1434  return FALSE;
1435  }
1436 
1438  {
1439  return FALSE;
1440  }
1441 
1442  SetupData->SystemTime.wYear = Date.wYear;
1445  SetupData->SystemTime.wDay = Date.wDay;
1446  SetupData->SystemTime.wHour = Time.wHour;
1447  SetupData->SystemTime.wMinute = Time.wMinute;
1448  SetupData->SystemTime.wSecond = Time.wSecond;
1449  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1450 
1451  return TRUE;
1452 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD wMonth
Definition: winbase.h:871
WORD wDayOfWeek
Definition: winbase.h:872
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:870
WORD wMinute
Definition: winbase.h:875
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:876
WORD wMilliseconds
Definition: winbase.h:877
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4302
WORD wDay
Definition: winbase.h:873
#define GDT_VALID
Definition: commctrl.h:4432
#define IDC_DATEPICKER
Definition: resource.h:59
WORD wHour
Definition: winbase.h:874
SYSTEMTIME SystemTime
Definition: syssetup.h:63
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by WriteDateTimeSettings().

◆ GetTimeZoneListIndex()

static BOOL GetTimeZoneListIndex ( LPDWORD  lpIndex)
static

Definition at line 1240 of file wizard.c.

1241 {
1242  WCHAR szLanguageIdString[9];
1243  HKEY hKey;
1244  DWORD dwValueSize;
1245  DWORD Length;
1246  LPWSTR Buffer;
1247  LPWSTR Ptr;
1248  LPWSTR End;
1249  BOOL bFound = FALSE;
1250  unsigned long iLanguageID;
1251 
1252  if (*lpIndex == -1)
1253  {
1254  *lpIndex = 85; /* fallback to GMT time zone */
1255 
1257  L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Language",
1258  0,
1260  &hKey))
1261  return FALSE;
1262 
1263  dwValueSize = 9 * sizeof(WCHAR);
1264  if (RegQueryValueExW(hKey,
1265  L"Default",
1266  NULL,
1267  NULL,
1268  (LPBYTE)szLanguageIdString,
1269  &dwValueSize))
1270  {
1271  RegCloseKey(hKey);
1272  return FALSE;
1273  }
1274 
1275  iLanguageID = wcstoul(szLanguageIdString, NULL, 16);
1276  RegCloseKey(hKey);
1277  }
1278  else
1279  {
1280  iLanguageID = *lpIndex;
1281  }
1282 
1284  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
1285  0,
1287  &hKey))
1288  return FALSE;
1289 
1290  dwValueSize = 0;
1291  if (RegQueryValueExW(hKey,
1292  L"IndexMapping",
1293  NULL,
1294  NULL,
1295  NULL,
1296  &dwValueSize))
1297  {
1298  RegCloseKey(hKey);
1299  return FALSE;
1300  }
1301 
1302  Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize);
1303  if (Buffer == NULL)
1304  {
1305  RegCloseKey(hKey);
1306  return FALSE;
1307  }
1308 
1309  if (RegQueryValueExW(hKey,
1310  L"IndexMapping",
1311  NULL,
1312  NULL,
1313  (LPBYTE)Buffer,
1314  &dwValueSize))
1315  {
1317  RegCloseKey(hKey);
1318  return FALSE;
1319  }
1320 
1321  RegCloseKey(hKey);
1322 
1323  Ptr = Buffer;
1324  while (*Ptr != 0)
1325  {
1326  Length = wcslen(Ptr);
1327  if (wcstoul(Ptr, NULL, 16) == iLanguageID)
1328  bFound = TRUE;
1329 
1330  Ptr = Ptr + Length + 1;
1331  if (*Ptr == 0)
1332  break;
1333 
1334  if (bFound)
1335  {
1336  *lpIndex = wcstoul(Ptr, &End, 10);
1338  return TRUE;
1339  }
1340 
1341  Length = wcslen(Ptr);
1342  Ptr = Ptr + Length + 1;
1343  }
1344 
1346 
1347  return FALSE;
1348 }
#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:52
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define GetProcessHeap()
Definition: compat.h:395
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:394
#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:395
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:149
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define HIWORD(l)
Definition: typedefs.h:246
#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:394

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2659 of file wizard.c.

2660 {
2661  PROPSHEETHEADER psh;
2662  HPROPSHEETPAGE *phpage = NULL;
2663  PROPSHEETPAGE psp = {0};
2664  UINT nPages = 0;
2665  HWND hWnd;
2666  MSG msg;
2667  PSETUPDATA pSetupData = NULL;
2668  HMODULE hNetShell = NULL;
2670  DWORD dwPageCount = 9, dwNetworkPageCount = 0;
2671 
2672  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2673 
2674  /* Allocate setup data */
2675  pSetupData = HeapAlloc(GetProcessHeap(),
2677  sizeof(SETUPDATA));
2678  if (pSetupData == NULL)
2679  {
2680  LogItem(NULL, L"SetupData allocation failed!");
2681  MessageBoxW(NULL,
2682  L"Setup failed to allocate global data!",
2683  L"ReactOS Setup",
2684  MB_ICONERROR | MB_OK);
2685  goto done;
2686  }
2687 
2688  hNetShell = LoadLibraryW(L"netshell.dll");
2689  if (hNetShell != NULL)
2690  {
2691  DPRINT("Netshell.dll loaded!\n");
2692 
2693  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2694  "NetSetupRequestWizardPages");
2695  if (pfn != NULL)
2696  {
2697  pfn(&dwNetworkPageCount, NULL, NULL);
2698  dwPageCount += dwNetworkPageCount;
2699  }
2700  }
2701 
2702  DPRINT("PageCount: %lu\n", dwPageCount);
2703 
2704  phpage = HeapAlloc(GetProcessHeap(),
2706  dwPageCount * sizeof(HPROPSHEETPAGE));
2707  if (phpage == NULL)
2708  {
2709  LogItem(NULL, L"Page array allocation failed!");
2710  MessageBoxW(NULL,
2711  L"Setup failed to allocate page array!",
2712  L"ReactOS Setup",
2713  MB_ICONERROR | MB_OK);
2714  goto done;
2715  }
2716 
2717  /* Process the $winnt$.inf setup file */
2718  ProcessSetupInf(pSetupData);
2719 
2720  /* Create the Welcome page */
2721  psp.dwSize = sizeof(PROPSHEETPAGE);
2722  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2723  psp.hInstance = hDllInstance;
2724  psp.lParam = (LPARAM)pSetupData;
2725  psp.pfnDlgProc = WelcomeDlgProc;
2726  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2727  phpage[nPages++] = CreatePropertySheetPage(&psp);
2728 
2729  /* Create the Acknowledgements page */
2730  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2731  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2732  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2733  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2734  psp.pfnDlgProc = AckPageDlgProc;
2735  phpage[nPages++] = CreatePropertySheetPage(&psp);
2736 
2737  /* Create the Locale page */
2738  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2739  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2740  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2741  psp.pfnDlgProc = LocalePageDlgProc;
2742  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2743  phpage[nPages++] = CreatePropertySheetPage(&psp);
2744 
2745  /* Create the Owner page */
2746  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2747  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2748  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2749  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2750  psp.pfnDlgProc = OwnerPageDlgProc;
2751  phpage[nPages++] = CreatePropertySheetPage(&psp);
2752 
2753  /* Create the Computer page */
2754  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2755  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2756  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2757  psp.pfnDlgProc = ComputerPageDlgProc;
2758  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2759  phpage[nPages++] = CreatePropertySheetPage(&psp);
2760 
2761  /* Create the DateTime page */
2762  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2763  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2764  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2765  psp.pfnDlgProc = DateTimePageDlgProc;
2766  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2767  phpage[nPages++] = CreatePropertySheetPage(&psp);
2768 
2769  /* Create the theme selection page */
2770  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2771  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2772  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2773  psp.pfnDlgProc = ThemePageDlgProc;
2774  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2775  phpage[nPages++] = CreatePropertySheetPage(&psp);
2776 
2779 
2780  if (pfn)
2781  {
2782  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2783  nPages += dwNetworkPageCount;
2784  }
2785 
2786  /* Create the Process page */
2787  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2788  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2789  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2790  psp.pfnDlgProc = ProcessPageDlgProc;
2791  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2792  phpage[nPages++] = CreatePropertySheetPage(&psp);
2793 
2794  /* Create the Finish page */
2795  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2796  psp.pfnDlgProc = FinishDlgProc;
2797  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2798  phpage[nPages++] = CreatePropertySheetPage(&psp);
2799 
2800  ASSERT(nPages == dwPageCount);
2801 
2802  /* Create the property sheet */
2803  psh.dwSize = sizeof(PROPSHEETHEADER);
2804  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2805  psh.hInstance = hDllInstance;
2806  psh.hwndParent = NULL;
2807  psh.nPages = nPages;
2808  psh.nStartPage = 0;
2809  psh.phpage = phpage;
2810  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2811  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2812 
2813  /* Create title font */
2814  pSetupData->hTitleFont = CreateTitleFont();
2815  pSetupData->hBoldFont = CreateBoldFont();
2816 
2817  /* Display the wizard */
2818  hWnd = (HWND)PropertySheet(&psh);
2820 
2821  while (GetMessage(&msg, NULL, 0, 0))
2822  {
2823  if (!IsDialogMessage(hWnd, &msg))
2824  {
2826  DispatchMessage(&msg);
2827  }
2828  }
2829 
2830  DeleteObject(pSetupData->hBoldFont);
2831  DeleteObject(pSetupData->hTitleFont);
2832 
2833  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2834  SetupCloseInfFile(pSetupData->hSetupInf);
2835 
2836 done:
2837  if (phpage != NULL)
2838  HeapFree(GetProcessHeap(), 0, phpage);
2839 
2840  if (hNetShell != NULL)
2841  FreeLibrary(hNetShell);
2842 
2843  if (pSetupData != NULL)
2844  HeapFree(GetProcessHeap(), 0, pSetupData);
2845 
2846  LogItem(L"END_SECTION", L"InstallWizard");
2847 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2010
#define DispatchMessage
Definition: winuser.h:5666
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:95
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:190
#define IDS_ACKSUBTITLE
Definition: resource.h:92
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:959
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:274
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:110
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2526
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:666
HANDLE HWND
Definition: compat.h:13
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1637
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:104
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define IsDialogMessage
Definition: winuser.h:5710
#define IDB_HEADER
Definition: resource.h:30
#define IDD_OWNERPAGE
Definition: resource.h:43
HINF hSetupInf
Definition: syssetup.h:70
#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:2656
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:109
#define IDS_COMPUTERTITLE
Definition: resource.h:97
#define IDS_DATETIMETITLE
Definition: resource.h:103
#define IDS_ACKTITLE
Definition: resource.h:91
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1538
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
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:381
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:424
UINT uPostNetworkWizardPage
Definition: syssetup.h:73
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
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:72
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:2145
HFONT hBoldFont
Definition: syssetup.h:51
#define IDS_OWNERTITLE
Definition: resource.h:94
#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:5691
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:98
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:382
#define GetProcAddress(x, y)
Definition: compat.h:410
HFONT hTitleFont
Definition: reactos.h:117
#define IDS_LOCALESUBTITLE
Definition: resource.h:101
#define IDS_LOCALETITLE
Definition: resource.h:100
#define HeapFree(x, y, z)
Definition: compat.h:394
#define PROPSHEETPAGE
Definition: prsht.h:371
#define IDD_THEMEPAGE
Definition: resource.h:73
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:110

Referenced by InstallReactOS().

◆ LocalePageDlgProc()

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

Definition at line 959 of file wizard.c.

963 {
965 
966  /* Retrieve pointer to the global setup data */
968 
969  switch (uMsg)
970  {
971  case WM_INITDIALOG:
972  {
973  /* Save pointer to the global setup data */
976  WriteUserLocale();
977 
979  }
980  break;
981 
982  case WM_COMMAND:
983  if (HIWORD(wParam) == BN_CLICKED)
984  {
985  switch (LOWORD(wParam))
986  {
987  case IDC_CUSTOMLOCALE:
988  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
989  /* FIXME: Update input locale name */
990  break;
991 
992  case IDC_CUSTOMLAYOUT:
993  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
994  break;
995  }
996  }
997  break;
998 
999  case WM_NOTIFY:
1000  {
1001  LPNMHDR lpnm = (LPNMHDR)lParam;
1002 
1003  switch (lpnm->code)
1004  {
1005  case PSN_SETACTIVE:
1006  /* Enable the Back and Next buttons */
1008  if (SetupData->UnattendSetup)
1009  {
1010  // if (!*SetupData->SourcePath)
1011  {
1012  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1013  }
1014 
1016  return TRUE;
1017  }
1018  break;
1019 
1020  case PSN_WIZNEXT:
1021  break;
1022 
1023  case PSN_WIZBACK:
1025  break;
1026 
1027  default:
1028  break;
1029  }
1030  }
1031  break;
1032 
1033  default:
1034  break;
1035  }
1036 
1037  return FALSE;
1038 }
static VOID WriteUserLocale(VOID)
Definition: wizard.c:938
#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:3133
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:889
#define IDC_CUSTOMLOCALE
Definition: resource.h:54
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
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:63
HWND WINAPI GetParent(_In_ HWND)
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:832
#define IDC_CUSTOMLAYOUT
Definition: resource.h:56
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:246
BOOL UnattendSetup
Definition: syssetup.h:60
#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().

◆ OwnerPageDlgProc()

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

Definition at line 424 of file wizard.c.

428 {
429  WCHAR OwnerName[51];
430  WCHAR OwnerOrganization[51];
431  WCHAR Title[64];
432  WCHAR ErrorName[256];
433  LPNMHDR lpnm;
434  PSETUPDATA pSetupData;
435 
436  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
437 
438  switch (uMsg)
439  {
440  case WM_INITDIALOG:
441  {
442  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
443  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
444 
445  /* set a localized ('Owner') placeholder string as default */
446  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
447  {
448  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
449  }
450 
453 
454  /* Set focus to owner name */
455  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
456 
457  /* Select the default text to quickly overwrite it by typing */
458  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
459  }
460  break;
461 
462 
463  case WM_NOTIFY:
464  {
465  lpnm = (LPNMHDR)lParam;
466 
467  switch (lpnm->code)
468  {
469  case PSN_SETACTIVE:
470  /* Enable the Back and Next buttons */
472  if (pSetupData->UnattendSetup)
473  {
474  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
476  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
477  {
479  return TRUE;
480  }
481  }
482  break;
483 
484  case PSN_WIZNEXT:
485  OwnerName[0] = 0;
486  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
487  {
489  {
490  wcscpy(Title, L"ReactOS Setup");
491  }
492  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
493  {
494  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
495  }
496  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
497 
498  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
499  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
500 
501  return TRUE;
502  }
503 
504  OwnerOrganization[0] = 0;
505  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
506 
507  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
508  {
509  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
510  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
511  return TRUE;
512  }
513 
514  case PSN_WIZBACK:
515  pSetupData->UnattendSetup = FALSE;
516  break;
517 
518  default:
519  break;
520  }
521  }
522  break;
523 
524  default:
525  break;
526  }
527 
528  return FALSE;
529 }
#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:2208
#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:124
#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:5743
#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:3133
WCHAR OwnerOrganization[51]
Definition: syssetup.h:57
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#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:126
_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:56
#define PSN_WIZBACK
Definition: prsht.h:120
#define SendMessage
Definition: winuser.h:5744
BOOL UnattendSetup
Definition: syssetup.h:60
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:382
#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 2010 of file wizard.c.

2014 {
2016  PREGISTRATIONNOTIFY RegistrationNotify;
2017  static UINT oldActivityID = -1;
2018  WCHAR Title[64];
2019 
2020  /* Retrieve pointer to the global setup data */
2022 
2023  switch (uMsg)
2024  {
2025  case WM_INITDIALOG:
2026  {
2027  /* Save pointer to the global setup data */
2030  }
2031  break;
2032 
2033  case WM_NOTIFY:
2034  {
2035  LPNMHDR lpnm = (LPNMHDR)lParam;
2036  ULONG MaxProgress = 0;
2037 
2038  switch (lpnm->code)
2039  {
2040  case PSN_SETACTIVE:
2041  /* Disable the Back and Next buttons */
2042  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2043 
2044  StartComponentRegistration(hwndDlg, &MaxProgress);
2045 
2047  0, MAKELPARAM(0, MaxProgress));
2049  0, 0);
2050  break;
2051 
2052  case PSN_WIZNEXT:
2053  break;
2054 
2055  case PSN_WIZBACK:
2057  break;
2058 
2059  default:
2060  break;
2061  }
2062  }
2063  break;
2064 
2066  {
2067  WCHAR Activity[64];
2068  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2069  // update if necessary only
2070  if (oldActivityID != RegistrationNotify->ActivityID)
2071  {
2072  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2073  Activity,
2074  ARRAYSIZE(Activity)))
2075  {
2077  0, (LPARAM) Activity);
2078  }
2079  oldActivityID = RegistrationNotify->ActivityID;
2080  }
2082  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2083  L"" : RegistrationNotify->CurrentItem));
2085  RegistrationNotify->Progress, 0);
2086  if (NULL != RegistrationNotify->ErrorMessage)
2087  {
2089  Title, ARRAYSIZE(Title)))
2090  {
2091  wcscpy(Title, L"ReactOS Setup");
2092  }
2093  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2094  Title, MB_ICONERROR | MB_OK);
2095 
2096  }
2097 
2098  if (wParam)
2099  {
2100  /* Enable the Back and Next buttons */
2103  }
2104  }
2105  return TRUE;
2106 
2107  default:
2108  break;
2109  }
2110 
2111  return FALSE;
2112 }
#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:3947
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define PBM_SETPOS
Definition: commctrl.h:2156
#define SendDlgItemMessage
Definition: winuser.h:5743
#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:3133
#define PBM_SETRANGE
Definition: commctrl.h:2155
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:25
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
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:339
#define WM_SETTEXT
Definition: winuser.h:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
static BOOL StartComponentRegistration(HWND hwndDlg, PULONG MaxProgress)
Definition: wizard.c:1943
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:63
#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:60
LPCWSTR ErrorMessage
Definition: wizard.c:37
#define GetWindowLongPtr
Definition: treelist.c:73
#define PropSheet_PressButton(d, i)
Definition: prsht.h:330
#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 2526 of file wizard.c.

2528 {
2530  WCHAR szValue[MAX_PATH];
2531  INFCONTEXT InfContext;
2532  DWORD LineLength;
2533  HKEY hKey;
2534  LONG res;
2535 
2536  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2537 
2538  /* Retrieve the path of the setup INF */
2540  wcscat(szPath, L"\\$winnt$.inf");
2541 
2542  /* Open the setup INF */
2543  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2544  NULL,
2546  NULL);
2547  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2548  {
2549  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2550  return;
2551  }
2552 
2553 
2554  /* Retrieve the NT source path from which the 1st-stage installer was run */
2555  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2556  L"data",
2557  L"sourcepath",
2558  &InfContext))
2559  {
2560  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2561  return;
2562  }
2563 
2564  if (!SetupGetStringFieldW(&InfContext,
2565  1,
2566  szValue,
2567  ARRAYSIZE(szValue),
2568  &LineLength))
2569  {
2570  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2571  return;
2572  }
2573 
2574  *pSetupData->SourcePath = UNICODE_NULL;
2575 
2576  /* Close the setup INF as we are going to modify it manually */
2577  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2578  SetupCloseInfFile(pSetupData->hSetupInf);
2579 
2580 
2581  /* Find the installation source path in Win32 format */
2582  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2583  _countof(pSetupData->SourcePath),
2584  szValue))
2585  {
2586  *pSetupData->SourcePath = UNICODE_NULL;
2587  }
2588 
2589  /* Save the path in Win32 format in the setup INF */
2590  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2591  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2592 
2593  /*
2594  * Save it also in the registry, in the following keys:
2595  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2596  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2597  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2598  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2599  */
2600 #if 0
2602  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2603  0,
2605  &hKey);
2606 
2607  if (res != ERROR_SUCCESS)
2608  {
2609  return FALSE;
2610  }
2611 #endif
2612 
2614  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2615  0, NULL,
2617  KEY_ALL_ACCESS, // KEY_WRITE
2618  NULL,
2619  &hKey,
2620  NULL);
2621  if (res == ERROR_SUCCESS)
2622  {
2623  res = RegSetValueExW(hKey,
2624  L"SourcePath",
2625  0,
2626  REG_SZ,
2627  (LPBYTE)pSetupData->SourcePath,
2628  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2629 
2630  res = RegSetValueExW(hKey,
2631  L"ServicePackSourcePath",
2632  0,
2633  REG_SZ,
2634  (LPBYTE)pSetupData->SourcePath,
2635  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2636 
2637  RegCloseKey(hKey);
2638  }
2639 
2640 
2641  /* Now, re-open the setup INF (this must succeed) */
2642  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2643  NULL,
2645  NULL);
2646  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2647  {
2648  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2649  return;
2650  }
2651 
2652  /* Process the unattended section of the setup file */
2653  ProcessUnattendSection(pSetupData);
2654 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2244
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:391
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:52
#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:2301
_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 2301 of file wizard.c.

2303 {
2304  INFCONTEXT InfContext;
2305  WCHAR szName[256];
2306  WCHAR szValue[MAX_PATH];
2307  DWORD LineLength;
2308  HKEY hKey;
2309 
2310  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2311  L"Unattend",
2312  L"UnattendSetupEnabled",
2313  &InfContext))
2314  {
2315  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2316  return;
2317  }
2318 
2319  if (!SetupGetStringFieldW(&InfContext,
2320  1,
2321  szValue,
2322  ARRAYSIZE(szValue),
2323  &LineLength))
2324  {
2325  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2326  return;
2327  }
2328 
2329  if (_wcsicmp(szValue, L"yes") != 0)
2330  {
2331  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2332  return;
2333  }
2334 
2335  pSetupData->UnattendSetup = TRUE;
2336 
2337  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2338  L"Unattend",
2339  NULL,
2340  &InfContext))
2341  {
2342  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2343  return;
2344  }
2345 
2346  do
2347  {
2348  if (!SetupGetStringFieldW(&InfContext,
2349  0,
2350  szName,
2351  ARRAYSIZE(szName),
2352  &LineLength))
2353  {
2354  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2355  return;
2356  }
2357 
2358  if (!SetupGetStringFieldW(&InfContext,
2359  1,
2360  szValue,
2361  ARRAYSIZE(szValue),
2362  &LineLength))
2363  {
2364  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2365  return;
2366  }
2367  DPRINT1("Name %S Value %S\n", szName, szValue);
2368  if (!_wcsicmp(szName, L"FullName"))
2369  {
2370  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2371  {
2372  wcscpy(pSetupData->OwnerName, szValue);
2373  }
2374  }
2375  else if (!_wcsicmp(szName, L"OrgName"))
2376  {
2377  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2378  {
2379  wcscpy(pSetupData->OwnerOrganization, szValue);
2380  }
2381  }
2382  else if (!_wcsicmp(szName, L"ComputerName"))
2383  {
2384  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2385  {
2386  wcscpy(pSetupData->ComputerName, szValue);
2387  }
2388  }
2389  else if (!_wcsicmp(szName, L"AdminPassword"))
2390  {
2391  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2392  {
2393  wcscpy(pSetupData->AdminPassword, szValue);
2394  }
2395  }
2396  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2397  {
2398  pSetupData->TimeZoneIndex = _wtoi(szValue);
2399  }
2400  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2401  {
2402  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2403  }
2404  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2405  {
2406  if (!_wcsicmp(szValue, L"yes"))
2407  pSetupData->DisableGeckoInst = TRUE;
2408  else
2409  pSetupData->DisableGeckoInst = FALSE;
2410  }
2411 
2412  } while (SetupFindNextLine(&InfContext, &InfContext));
2413 
2414  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2415  L"Display",
2416  NULL,
2417  &InfContext))
2418  {
2419  DEVMODEW dm = { { 0 } };
2420  dm.dmSize = sizeof(dm);
2422  {
2423  do
2424  {
2425  int iValue;
2426  if (!SetupGetStringFieldW(&InfContext,
2427  0,
2428  szName,
2429  ARRAYSIZE(szName),
2430  &LineLength))
2431  {
2432  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2433  return;
2434  }
2435 
2436  if (!SetupGetStringFieldW(&InfContext,
2437  1,
2438  szValue,
2439  ARRAYSIZE(szValue),
2440  &LineLength))
2441  {
2442  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2443  return;
2444  }
2445  iValue = _wtoi(szValue);
2446  DPRINT1("Name %S Value %i\n", szName, iValue);
2447 
2448  if (!iValue)
2449  continue;
2450 
2451  if (!_wcsicmp(szName, L"BitsPerPel"))
2452  {
2453  dm.dmFields |= DM_BITSPERPEL;
2454  dm.dmBitsPerPel = iValue;
2455  }
2456  else if (!_wcsicmp(szName, L"XResolution"))
2457  {
2458  dm.dmFields |= DM_PELSWIDTH;
2459  dm.dmPelsWidth = iValue;
2460  }
2461  else if (!_wcsicmp(szName, L"YResolution"))
2462  {
2463  dm.dmFields |= DM_PELSHEIGHT;
2464  dm.dmPelsHeight = iValue;
2465  }
2466  else if (!_wcsicmp(szName, L"VRefresh"))
2467  {
2469  dm.dmDisplayFrequency = iValue;
2470  }
2471  } while (SetupFindNextLine(&InfContext, &InfContext));
2472 
2474  }
2475  }
2476 
2478  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2479  0,
2480  KEY_SET_VALUE,
2481  &hKey) != ERROR_SUCCESS)
2482  {
2483  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2484  return;
2485  }
2486 
2487  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2488  L"GuiRunOnce",
2489  NULL,
2490  &InfContext))
2491  {
2492  int i = 0;
2493  do
2494  {
2495  if (SetupGetStringFieldW(&InfContext,
2496  0,
2497  szValue,
2498  ARRAYSIZE(szValue),
2499  NULL))
2500  {
2502  swprintf(szName, L"%d", i);
2503  DPRINT("szName %S szValue %S\n", szName, szValue);
2504 
2505  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2506  {
2507  DPRINT("value %S\n", szPath);
2508  if (RegSetValueExW(hKey,
2509  szName,
2510  0,
2511  REG_SZ,
2512  (const BYTE*)szPath,
2513  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2514  {
2515  i++;
2516  }
2517  }
2518  }
2519  } while (SetupFindNextLine(&InfContext, &InfContext));
2520  }
2521 
2522  RegCloseKey(hKey);
2523 }
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:1617
_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:1642
#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:1615
#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:1643
_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:1649
#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:1644
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().

◆ RegistrationNotificationProc()

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

Definition at line 1751 of file wizard.c.

1755 {
1756  PREGISTRATIONDATA RegistrationData;
1757  REGISTRATIONNOTIFY RegistrationNotify;
1758  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1759  UINT MessageID;
1760  WCHAR ErrorMessage[128];
1761 
1762  RegistrationData = (PREGISTRATIONDATA) Context;
1763 
1764  if (SPFILENOTIFY_STARTREGISTRATION == Notification ||
1765  SPFILENOTIFY_ENDREGISTRATION == Notification)
1766  {
1767  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1768  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1769  if (NULL == RegistrationNotify.CurrentItem)
1770  {
1771  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1772  }
1773  else
1774  {
1775  RegistrationNotify.CurrentItem++;
1776  }
1777 
1778  if (SPFILENOTIFY_STARTREGISTRATION == Notification)
1779  {
1780  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1781  StatusInfo->FileName);
1782  RegistrationNotify.ErrorMessage = NULL;
1783  RegistrationNotify.Progress = RegistrationData->Registered;
1784  }
1785  else
1786  {
1787  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1788  StatusInfo->FileName);
1789  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1790  StatusInfo->FailureCode);
1791  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1792  {
1793  switch(StatusInfo->FailureCode)
1794  {
1795  case SPREG_LOADLIBRARY:
1797  break;
1798  case SPREG_GETPROCADDR:
1800  break;
1801  case SPREG_REGSVR:
1803  break;
1804  case SPREG_DLLINSTALL:
1806  break;
1807  case SPREG_TIMEOUT:
1809  break;
1810  default:
1812  break;
1813  }
1815  ErrorMessage,
1817  {
1818  ErrorMessage[0] = L'\0';
1819  }
1820  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
1821  {
1823  StatusInfo->Win32Error, 0,
1826  NULL);
1827  }
1828  RegistrationNotify.ErrorMessage = ErrorMessage;
1829  }
1830  else
1831  {
1832  RegistrationNotify.ErrorMessage = NULL;
1833  }
1834  if (RegistrationData->Registered < RegistrationData->DllCount)
1835  {
1836  RegistrationData->Registered++;
1837  }
1838  }
1839 
1840  RegistrationNotify.Progress = RegistrationData->Registered;
1841  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1842  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1843  0, (LPARAM) &RegistrationNotify);
1844 
1845  return FILEOP_DOIT;
1846  }
1847  else
1848  {
1849  DPRINT1("Received unexpected notification %u\n", Notification);
1850  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
1851  Notification, Param1, Param2);
1852  }
1853 }
LPCWSTR CurrentItem
Definition: wizard.c:36
ULONG DllCount
Definition: wizard.c:43
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:117
#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:116
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:120
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:118
#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:122
#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:5744
#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:119
#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 1857 of file wizard.c.

1858 {
1859  PREGISTRATIONDATA RegistrationData;
1860  REGISTRATIONNOTIFY RegistrationNotify;
1861  DWORD LastError = NO_ERROR;
1862  WCHAR UnknownError[84];
1863 
1864  RegistrationData = (PREGISTRATIONDATA) Parameter;
1865  RegistrationData->Registered = 0;
1866  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
1867 
1868  _SEH2_TRY
1869  {
1870  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
1871  hSysSetupInf,
1872  L"RegistrationPhase2",
1873  SPINST_REGISTRY |
1874  SPINST_REGISTERCALLBACKAWARE |
1875  SPINST_REGSVR,
1876  0,
1877  NULL,
1878  0,
1880  RegistrationData,
1881  NULL,
1882  NULL))
1883  {
1884  LastError = GetLastError();
1885  }
1886  }
1888  {
1889  DPRINT("Catching exception\n");
1891  }
1892  _SEH2_END;
1893 
1894  if (NO_ERROR == LastError)
1895  {
1896  RegistrationNotify.ErrorMessage = NULL;
1897  }
1898  else
1899  {
1900  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
1901  LastError);
1903  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
1904  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
1905  NULL))
1906  {
1908  UnknownError,
1909  ARRAYSIZE(UnknownError) - 20))
1910  {
1911  wcscpy(UnknownError, L"Unknown error");
1912  }
1913  wcscat(UnknownError, L" ");
1914  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
1915  RegistrationNotify.ErrorMessage = UnknownError;
1916  }
1917  }
1918 
1919  RegistrationNotify.Progress = RegistrationData->DllCount;
1920  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1921  RegistrationNotify.CurrentItem = NULL;
1922  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1923  1, (LPARAM) &RegistrationNotify);
1924  if (NULL != RegistrationNotify.ErrorMessage &&
1925  UnknownError != RegistrationNotify.ErrorMessage)
1926  {
1927  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
1928  }
1929 
1930  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
1931  HeapFree(GetProcessHeap(), 0, RegistrationData);
1932 
1933  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
1934 
1935  // FIXME: Move this call to a separate cleanup page!
1937 
1938  return 0;
1939 }
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:116
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1751
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:395
__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:1323
_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:115
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
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:5744
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:394

Referenced by StartComponentRegistration().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 889 of file wizard.c.

890 {
891  MSG msg;
892  STARTUPINFOW StartupInfo;
893  PROCESS_INFORMATION ProcessInformation;
894  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
895 
896  if (!pwszCPLParameters)
897  {
898  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
899  return FALSE;
900  }
901 
902  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
903  StartupInfo.cb = sizeof(StartupInfo);
904  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
905 
906  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
907  wcscat(CmdLine, pwszCPLParameters);
908 
909  if (!CreateProcessW(NULL,
910  CmdLine,
911  NULL,
912  NULL,
913  FALSE,
914  0,
915  NULL,
916  NULL,
917  &StartupInfo,
918  &ProcessInformation))
919  {
920  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
921  return FALSE;
922  }
923 
925  {
926  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
927  {
930  }
931  }
932  CloseHandle(ProcessInformation.hThread);
933  CloseHandle(ProcessInformation.hProcess);
934  return TRUE;
935 }
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:398
#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:1635
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:817
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 1456 of file wizard.c.

1457 {
1458  HKEY hKey;
1459  DWORD dwValue = 1;
1460 
1461  if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED)
1462  {
1464  L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
1465  0,
1466  KEY_SET_VALUE,
1467  &hKey))
1468  return;
1469 
1470  RegSetValueExW(hKey,
1471  L"DisableAutoDaylightTimeSet",
1472  0,
1473  REG_DWORD,
1474  (LPBYTE)&dwValue,
1475  sizeof(DWORD));
1476  RegCloseKey(hKey);
1477  }
1478 }
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:52
#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:5744
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 2116 of file wizard.c.

2117 {
2118  HKEY hKey = 0;
2119  DWORD InProgress = 0;
2120  DWORD InstallDate;
2121 
2123  L"SYSTEM\\Setup",
2124  0,
2125  KEY_WRITE,
2126  &hKey ) == ERROR_SUCCESS)
2127  {
2128  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2129  RegCloseKey( hKey );
2130  }
2131 
2133  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2134  0,
2135  KEY_WRITE,
2136  &hKey ) == ERROR_SUCCESS)
2137  {
2138  InstallDate = (DWORD)time(NULL);
2139  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2140  RegCloseKey( hKey );
2141  }
2142 }
#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:52
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 832 of file wizard.c.

833 {
834 #if 0
835  TCHAR szLayoutPath[256];
836  TCHAR szLocaleName[32];
837  DWORD dwLocaleSize;
838  HKEY hKey;
839 
841  _T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
842  0,
844  &hKey))
845  return;
846 
847  dwValueSize = 16 * sizeof(TCHAR);
848  if (RegQueryValueEx(hKey,
849  NULL,
850  NULL,
851  NULL,
852  szLocaleName,
853  &dwLocaleSize))
854  {
855  RegCloseKey(hKey);
856  return;
857  }
858 
859  _tcscpy(szLayoutPath,
860  _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"));
861  _tcscat(szLayoutPath,
862  szLocaleName);
863 
865  szLayoutPath,
866  0,
868  &hKey))
869  return;
870 
871  dwValueSize = 32 * sizeof(TCHAR);
872  if (RegQueryValueEx(hKey,
873  _T("Layout Text"),
874  NULL,
875  NULL,
876  szLocaleName,
877  &dwLocaleSize))
878  {
879  RegCloseKey(hKey);
880  return;
881  }
882 
883  RegCloseKey(hKey);
884 #endif
885 }
#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 1382 of file wizard.c.

1383 {
1384  TIME_ZONE_INFORMATION TimeZoneInformation;
1386  DWORD dwIndex;
1387  DWORD i;
1388 
1389  dwIndex = SendMessage(hwnd,
1390  CB_GETCURSEL,
1391  0,
1392  0);
1393 
1394  i = 0;
1396  while (i < dwIndex)
1397  {
1398  if (Entry == NULL)
1399  return;
1400 
1401  i++;
1402  Entry = Entry->Next;
1403  }
1404 
1405  wcscpy(TimeZoneInformation.StandardName,
1406  Entry->StandardName);
1407  wcscpy(TimeZoneInformation.DaylightName,
1408  Entry->DaylightName);
1409 
1410  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1411  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1412  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1413 
1414  memcpy(&TimeZoneInformation.StandardDate,
1415  &Entry->TimezoneInfo.StandardDate,
1416  sizeof(SYSTEMTIME));
1417  memcpy(&TimeZoneInformation.DaylightDate,
1418  &Entry->TimezoneInfo.DaylightDate,
1419  sizeof(SYSTEMTIME));
1420 
1421  /* Set time zone information */
1422  SetTimeZoneInformation(&TimeZoneInformation);
1423 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:640
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:1161
WCHAR DaylightName[32]
Definition: winbase.h:1163
PTIMEZONE_ENTRY TimeZoneListHead
Definition: syssetup.h:64
#define SendMessage
Definition: winuser.h:5744
WCHAR StandardName[32]
Definition: winbase.h:1160
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1164

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1482 of file wizard.c.

1483 {
1484  BOOL Ret = FALSE;
1485 
1486  /*
1487  * Call SetLocalTime twice to ensure correct results
1488  */
1489  Ret = SetLocalTime(&SetupData->SystemTime) &&
1491 
1492  return Ret;
1493 }
unsigned int BOOL
Definition: ntddk_ex.h:94
SETUPDATA SetupData
Definition: reactos.c:41
SYSTEMTIME SystemTime
Definition: syssetup.h:63
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:346

Referenced by WriteDateTimeSettings().

◆ ShowTimeZoneList()

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

Definition at line 1352 of file wizard.c.

1353 {
1355  DWORD dwIndex = 0;
1356  DWORD dwCount;
1357 
1358  GetTimeZoneListIndex(&dwEntryIndex);
1359 
1361  while (Entry != NULL)
1362  {
1363  dwCount = SendMessage(hwnd,
1364  CB_ADDSTRING,
1365  0,
1366  (LPARAM)Entry->Description);
1367 
1368  if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1369  dwIndex = dwCount;
1370 
1371  Entry = Entry->Next;
1372  }
1373 
1374  SendMessage(hwnd,
1375  CB_SETCURSEL,
1376  (WPARAM)dwIndex,
1377  0);
1378 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:640
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:64
static BOOL GetTimeZoneListIndex(LPDWORD lpIndex)
Definition: wizard.c:1240
#define SendMessage
Definition: winuser.h:5744
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 1943 of file wizard.c.

1944 {
1945  HANDLE RegistrationThread;
1946  LONG DllCount;
1948  WCHAR SectionName[512];
1949  PREGISTRATIONDATA RegistrationData;
1950 
1951  DllCount = -1;
1952  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
1953  L"RegisterDlls", &Context))
1954  {
1955  DPRINT1("No RegistrationPhase2 section found\n");
1956  return FALSE;
1957  }
1958  if (!SetupGetStringFieldW(&Context, 1, SectionName,
1959  ARRAYSIZE(SectionName),
1960  NULL))
1961  {
1962  DPRINT1("Unable to retrieve section name\n");
1963  return FALSE;
1964  }
1965  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
1966  DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
1967  if (DllCount < 0)
1968  {
1970  return FALSE;
1971  }
1972 
1973  *MaxProgress = (ULONG) DllCount;
1974 
1975  /*
1976  * Create a background thread to do the actual registrations, so the
1977  * main thread can just run its message loop.
1978  */
1979  RegistrationThread = NULL;
1980  RegistrationData = HeapAlloc(GetProcessHeap(), 0,
1981  sizeof(REGISTRATIONDATA));
1982  if (RegistrationData != NULL)
1983  {
1984  RegistrationData->hwndDlg = hwndDlg;
1985  RegistrationData->DllCount = DllCount;
1986  RegistrationThread = CreateThread(NULL, 0, RegistrationProc,
1987  RegistrationData, 0, NULL);
1988  if (RegistrationThread != NULL)
1989  {
1990  CloseHandle(RegistrationThread);
1991  }
1992  else
1993  {
1994  DPRINT1("CreateThread failed, error %u\n", GetLastError());
1995  HeapFree(GetProcessHeap(), 0, RegistrationData);
1996  return FALSE;
1997  }
1998  }
1999  else
2000  {
2001  DPRINT1("HeapAlloc() failed, error %u\n", GetLastError());
2002  return FALSE;
2003  }
2004 
2005  return TRUE;
2006 }
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 CloseHandle
Definition: compat.h:398
ULONG DllCount
Definition: wizard.c:43
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
long LONG
Definition: pedump.c:60
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_NOT_FOUND
Definition: shellext.h:67
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD CALLBACK RegistrationProc(LPVOID Parameter)
Definition: wizard.c:1857
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR L[]
Definition: oid.c:1250
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1024
unsigned int ULONG
Definition: retypes.h:1
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:394
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1494
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by ProcessPageDlgProc().

◆ ThemePageDlgProc()

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

Definition at line 1637 of file wizard.c.

1641 {
1643  LPNMLISTVIEW pnmv;
1644 
1645  /* Retrieve pointer to the global setup data */
1647 
1648  switch (uMsg)
1649  {
1650  case WM_INITDIALOG:
1651  {
1652  HWND hListView;
1653  HIMAGELIST himl;
1654  DWORD n;
1655  LVITEM lvi = {0};
1656 
1657  /* Save pointer to the global setup data */
1660 
1661  hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1662 
1663  /* Common */
1665  lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1666 
1667  for (n = 0; n < ARRAYSIZE(Themes); ++n)
1668  {
1669  WCHAR DisplayName[100] = {0};
1670  /* Load the bitmap */
1672  ImageList_AddMasked(himl, image, RGB(255,0,255));
1673 
1674  /* Load the string */
1675  LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
1676  DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
1677 
1678  /* Add the listview item */
1679  lvi.iItem = n;
1680  lvi.iImage = n;
1681  lvi.pszText = DisplayName;
1682  ListView_InsertItem(hListView, &lvi);
1683  }
1684 
1685  /* Register the imagelist */
1687  /* Transparant background */
1688  ListView_SetBkColor(hListView, CLR_NONE);
1689  ListView_SetTextBkColor(hListView, CLR_NONE);
1690  /* Reduce the size between the items */
1691  ListView_SetIconSpacing(hListView, 190, 173);
1692  break;
1693  }
1694  case WM_NOTIFY:
1695  switch (((LPNMHDR)lParam)->code)
1696  {
1697  //case LVN_ITEMCHANGING:
1698  case LVN_ITEMCHANGED:
1699  pnmv = (LPNMLISTVIEW)lParam;
1700  if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
1701  {
1702  int iTheme = pnmv->iItem;
1703  DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
1704 
1705  if (Themes[iTheme].ThemeFile)
1706  {
1707  WCHAR wszParams[1024];
1708  WCHAR wszTheme[MAX_PATH];
1709  WCHAR* format = L"desk.cpl desk,@Appearance /Action:ActivateMSTheme /file:\"%s\"";
1710 
1711  SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
1712  swprintf(wszParams, format, wszTheme);
1713  RunControlPanelApplet(hwndDlg, wszParams);
1714  }
1715  else
1716  {
1717  RunControlPanelApplet(hwndDlg, L"desk.cpl desk,@Appearance /Action:ActivateMSTheme");
1718  }
1719  }
1720  break;
1721  case PSN_SETACTIVE:
1722  /* Enable the Back and Next buttons */
1724  if (SetupData->UnattendSetup)
1725  {
1727  return TRUE;
1728  }
1729  break;
1730 
1731  case PSN_WIZNEXT:
1732  break;
1733 
1734  case PSN_WIZBACK:
1736  break;
1737 
1738  default:
1739  break;
1740  }
1741  break;
1742 
1743  default:
1744  break;
1745  }
1746 
1747  return FALSE;
1748 }
#define TRUE
Definition: types.h:120
UINT uNewState
Definition: commctrl.h:3008
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
GLdouble n
Definition: glext.h:7729
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2380
HIMAGELIST himl
#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
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define ILC_COLOR32
Definition: commctrl.h:343
#define LVIF_TEXT
Definition: commctrl.h:2281
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define UNICODE_NULL
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:889
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define GWLP_USERDATA
Definition: treelist.c:63
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2291
#define ListView_SetBkColor(hwnd, clrBk)
Definition: commctrl.h:2266
#define PSN_WIZNEXT
Definition: prsht.h:121
#define CLR_NONE
Definition: commctrl.h:304
#define IDC_THEMEPICKER
Definition: resource.h:74
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define ListView_SetIconSpacing(hwndLV, cx, cy)
Definition: commctrl.h:2695
static struct ThemeInfo Themes[]
static HINSTANCE hDllInstance
Definition: clb.c:30
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define MAX_PATH
Definition: compat.h:26
#define RGB(r, g, b)
Definition: wingdi.h:2935
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define LVIF_IMAGE
Definition: commctrl.h:2282
UINT uFirstNetworkWizardPage
Definition: syssetup.h:72
unsigned long DWORD
Definition: ntddk_ex.h:95
SETUPDATA SetupData
Definition: reactos.c:41
static const WCHAR L[]
Definition: oid.c:1250
#define ListView_SetTextBkColor(hwnd, clrTextBk)
Definition: commctrl.h:2635
#define ILC_MASK
Definition: commctrl.h:336
#define LVSIL_NORMAL
Definition: commctrl.h:2270
uint32_t DWORD_PTR
Definition: typedefs.h:63
HWND WINAPI GetParent(_In_ HWND)
#define CSIDL_RESOURCES
Definition: shlobj.h:2055
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LR_CREATEDIBSECTION
Definition: winuser.h:1088
#define IMAGE_BITMAP
Definition: winuser.h:211
#define DPRINT1
Definition: precomp.h:8
#define PSN_WIZBACK
Definition: prsht.h:120
#define LVITEM
Definition: commctrl.h:2347
BOOL UnattendSetup
Definition: syssetup.h:60
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
#define GetWindowLongPtr
Definition: treelist.c:73
#define LVIF_STATE
Definition: commctrl.h:2284
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2150
#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().

◆ UpdateLocalSystemTime()

static VOID UpdateLocalSystemTime ( HWND  hwnd)
static

Definition at line 1497 of file wizard.c.

1498 {
1499  SYSTEMTIME LocalTime;
1500 
1501  GetLocalTime(&LocalTime);
1504 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDC_TIMEPICKER
Definition: resource.h:11
#define DateTime_SetSystemtime(hdp, gd, pst)
Definition: commctrl.h:4304
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define GDT_VALID
Definition: commctrl.h:4432
#define IDC_DATEPICKER
Definition: resource.h:59

Referenced by DateTimePageDlgProc().

◆ WelcomeDlgProc()

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

Definition at line 190 of file wizard.c.

194 {
195  PSETUPDATA pSetupData;
196 
197  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
198 
199  switch (uMsg)
200  {
201  case WM_INITDIALOG:
202  {
203  HWND hwndControl;
204  DWORD dwStyle;
205 
206  /* Get pointer to the global setup data */
207  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
208  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
209 
210  hwndControl = GetParent(hwndDlg);
211 
212  /* Center the wizard window */
213  CenterWindow (hwndControl);
214 
215  /* Hide the system menu */
216  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
217  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
218 
219  /* Hide and disable the 'Cancel' button */
220  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
221  ShowWindow (hwndControl, SW_HIDE);
222  EnableWindow (hwndControl, FALSE);
223 
224  /* Set title font */
225  SendDlgItemMessage(hwndDlg,
227