ReactOS  0.4.15-dev-344-g6808e40
wizard.c File Reference
#include "precomp.h"
#include <stdlib.h>
#include <time.h>
#include <winnls.h>
#include <windowsx.h>
#include <wincon.h>
#include <shlobj.h>
#include <tzlib.h>
#include <strsafe.h>
#include <debug.h>
Include dependency graph for wizard.c:

Go to the source code of this file.

Classes

struct  _REGISTRATIONNOTIFY
 
struct  _REGISTRATIONDATA
 
struct  _TIMEZONE_ENTRY
 
struct  _PRODUCT_OPTION_DATA
 
struct  ThemeInfo
 

Macros

#define NDEBUG
 
#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)
 

Typedefs

typedef struct _REGISTRATIONNOTIFY REGISTRATIONNOTIFY
 
typedef struct _REGISTRATIONNOTIFYPREGISTRATIONNOTIFY
 
typedef struct _REGISTRATIONDATA REGISTRATIONDATA
 
typedef struct _REGISTRATIONDATAPREGISTRATIONDATA
 
typedef struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
 
typedef struct _TIMEZONE_ENTRYPTIMEZONE_ENTRY
 
typedef struct _PRODUCT_OPTION_DATA PRODUCT_OPTION_DATA
 
typedef DWORD(WINAPIPFNREQUESTWIZARDPAGES) (PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
 

Functions

void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 
static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateTitleFont (VOID)
 
static HFONT CreateBoldFont (VOID)
 
static INT_PTR CALLBACK GplDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK WelcomeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK AckPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL DoWriteProductOption (PRODUCT_OPTION nOption)
 
static void OnChooseOption (HWND hwndDlg, PRODUCT_OPTION nOption)
 
static INT_PTR CALLBACK ProductPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteOwnerSettings (WCHAR *OwnerName, WCHAR *OwnerOrganization)
 
static INT_PTR CALLBACK OwnerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL WriteComputerSettings (WCHAR *ComputerName, HWND hwndDlg)
 
static BOOL WriteDefaultLogonData (LPWSTR Domain)
 
static void GenerateComputerName (LPWSTR lpBuffer)
 
static INT_PTR CALLBACK ComputerPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetKeyboardLayoutName (HWND hwnd)
 
static BOOL RunControlPanelApplet (HWND hwnd, PCWSTR pwszCPLParameters)
 
static VOID WriteUserLocale (VOID)
 
static INT_PTR CALLBACK LocalePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry (PSETUPDATA SetupData, DWORD Index)
 
static LONG RetrieveTimeZone (IN HKEY hZoneKey, IN PVOID Context)
 
static VOID CreateTimeZoneList (PSETUPDATA SetupData)
 
static VOID DestroyTimeZoneList (PSETUPDATA SetupData)
 
static VOID ShowTimeZoneList (HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
 
static VOID SetLocalTimeZone (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL GetLocalSystemTime (HWND hwnd, PSETUPDATA SetupData)
 
static BOOL SetSystemLocalTime (HWND hwnd, PSETUPDATA SetupData)
 
static VOID UpdateLocalSystemTime (HWND hwnd)
 
static BOOL WriteDateTimeSettings (HWND hwndDlg, PSETUPDATA SetupData)
 
static INT_PTR CALLBACK DateTimePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK ThemePageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static UINT CALLBACK RegistrationNotificationProc (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
static DWORD CALLBACK RegistrationProc (LPVOID Parameter)
 
static BOOL StartComponentRegistration (HWND hwndDlg, PULONG MaxProgress)
 
static INT_PTR CALLBACK ProcessPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID SetInstallationCompleted (VOID)
 
static INT_PTR CALLBACK FinishDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static BOOL GetInstallSourceWin32 (OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
 
VOID ProcessUnattendSection (IN OUT PSETUPDATA pSetupData)
 
VOID ProcessSetupInf (IN OUT PSETUPDATA pSetupData)
 
VOID InstallWizard (VOID)
 

Variables

static const WCHAR s_szProductOptions [] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions"
 
static const WCHAR s_szRosVersion [] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version"
 
static const WCHAR s_szControlWindows [] = L"SYSTEM\\CurrentControlSet\\Control\\Windows"
 
static const PRODUCT_OPTION_DATA s_ProductOptionData []
 
static struct ThemeInfo Themes []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 25 of file wizard.c.

◆ PM_REGISTRATION_NOTIFY

#define PM_REGISTRATION_NOTIFY   (WM_APP + 1)

Definition at line 28 of file wizard.c.

Typedef Documentation

◆ PFNREQUESTWIZARDPAGES

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

Definition at line 2688 of file wizard.c.

◆ PREGISTRATIONDATA

◆ PREGISTRATIONNOTIFY

◆ PRODUCT_OPTION_DATA

◆ PTIMEZONE_ENTRY

◆ REGISTRATIONDATA

◆ REGISTRATIONNOTIFY

◆ TIMEZONE_ENTRY

Function Documentation

◆ AckPageDlgProc()

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

Definition at line 288 of file wizard.c.

292 {
293  LPNMHDR lpnm;
294  PWCHAR Projects;
295  PWCHAR End, CurrentProject;
296  INT ProjectsSize, ProjectsCount;
297  PSETUPDATA pSetupData;
298 
299  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
300 
301  switch (uMsg)
302  {
303  case WM_INITDIALOG:
304  {
305  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
306  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
307 
308  Projects = NULL;
309  ProjectsSize = 256;
310  while (TRUE)
311  {
312  Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
313  if (NULL == Projects)
314  {
315  return FALSE;
316  }
317  ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
318  if (0 == ProjectsCount)
319  {
320  HeapFree(GetProcessHeap(), 0, Projects);
321  return FALSE;
322  }
323  if (ProjectsCount < ProjectsSize - 1)
324  {
325  break;
326  }
327  HeapFree(GetProcessHeap(), 0, Projects);
328  ProjectsSize *= 2;
329  }
330 
331  CurrentProject = Projects;
332  while (*CurrentProject != L'\0')
333  {
334  End = wcschr(CurrentProject, L'\n');
335  if (NULL != End)
336  {
337  *End = L'\0';
338  }
339  (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
340  if (NULL != End)
341  {
342  CurrentProject = End + 1;
343  }
344  else
345  {
346  CurrentProject += wcslen(CurrentProject);
347  }
348  }
349  HeapFree(GetProcessHeap(), 0, Projects);
350  }
351  break;
352 
353  case WM_COMMAND:
355  {
357  SetForegroundWindow(GetParent(hwndDlg));
358  }
359  break;
360 
361  case WM_NOTIFY:
362  {
363  lpnm = (LPNMHDR)lParam;
364 
365  switch (lpnm->code)
366  {
367  case PSN_SETACTIVE:
368  /* Enable the Back and Next buttons */
370  if (pSetupData->UnattendSetup)
371  {
373  return TRUE;
374  }
375  break;
376 
377  case PSN_WIZBACK:
378  pSetupData->UnattendSetup = FALSE;
379  break;
380 
381  default:
382  break;
383  }
384  }
385  break;
386 
387  default:
388  break;
389  }
390 
391  return FALSE;
392 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define IDC_PROJECTS
Definition: resource.h:40
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDD_PRODUCT
Definition: resource.h:92
#define IDD_GPL
Definition: resource.h:76
#define IDC_VIEWGPL
Definition: resource.h:41
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:447
uint16_t * PWCHAR
Definition: typedefs.h:55
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:57
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
#define DialogBox
Definition: winuser.h:5736
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define BN_CLICKED
Definition: winuser.h:1907
#define IDS_ACKPROJECTS
Definition: resource.h:118
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:135
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:246
BOOL UnattendSetup
Definition: syssetup.h:46
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:403
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 69 of file wizard.c.

70 {
72  RECT rcParent;
73  RECT rcWindow;
74 
76  if (hWndParent == NULL)
78 
79  GetWindowRect(hWndParent, &rcParent);
80  GetWindowRect(hWnd, &rcWindow);
81 
83  HWND_TOP,
84  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
85  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
86  0,
87  0,
88  SWP_NOSIZE);
89 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SWP_NOSIZE
Definition: winuser.h:1230
HWND WINAPI GetParent(_In_ HWND)
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by WelcomeDlgProc().

◆ ComputerPageDlgProc()

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

Definition at line 902 of file wizard.c.

906 {
907  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
908  WCHAR Password1[128];
909  WCHAR Password2[128];
911  WCHAR Title[64];
912  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
913  LPNMHDR lpnm;
914  PSETUPDATA pSetupData;
915 
916  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
917 
919  {
920  wcscpy(Title, L"ReactOS Setup");
921  }
922 
923  switch (uMsg)
924  {
925  case WM_INITDIALOG:
926  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
927  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
928 
929  /* Generate a new pseudo-random computer name */
930  GenerateComputerName(ComputerName);
931 
932  /* Display current computer name */
933  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
934 
935  /* Set text limits */
939 
940  /* Set focus to computer name */
942  if (pSetupData->UnattendSetup)
943  {
949  }
950 
951  /* Store the administrator account name as the default user name */
952  WriteDefaultLogonData(pSetupData->ComputerName);
953  break;
954 
955 
956  case WM_NOTIFY:
957  {
958  lpnm = (LPNMHDR)lParam;
959 
960  switch (lpnm->code)
961  {
962  case PSN_SETACTIVE:
963  /* Enable the Back and Next buttons */
965  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
966  {
968  return TRUE;
969  }
970  break;
971 
972  case PSN_WIZNEXT:
973  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
974  {
975  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
976  ARRAYSIZE(EmptyComputerName)))
977  {
978  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
979  }
980  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
982  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
983  return TRUE;
984  }
985 
986  /* No need to check computer name for invalid characters,
987  * SetComputerName() will do it for us */
988 
989  if (!WriteComputerSettings(ComputerName, hwndDlg))
990  {
992  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
993  return TRUE;
994  }
995 
996 #ifdef PASSWORDS_MANDATORY
997  /* Check if admin passwords have been entered */
998  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
999  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1000  {
1001  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1002  ARRAYSIZE(EmptyPassword)))
1003  {
1004  wcscpy(EmptyPassword, L"You must enter a password !");
1005  }
1006  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1007  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1008  return TRUE;
1009  }
1010 #else
1011  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1012  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1013 #endif
1014  /* Check if passwords match */
1015  if (wcscmp(Password1, Password2))
1016  {
1017  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1018  ARRAYSIZE(NotMatchPassword)))
1019  {
1020  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1021  }
1022  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1023  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1024  return TRUE;
1025  }
1026 
1027  /* Check password for invalid characters */
1028  Password = (PWCHAR)Password1;
1029  while (*Password)
1030  {
1031  if (!isprint(*Password))
1032  {
1033  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1034  ARRAYSIZE(WrongPassword)))
1035  {
1036  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1037  }
1038  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1039  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1040  return TRUE;
1041  }
1042  Password++;
1043  }
1044 
1045  /* Set admin password */
1046  SetAdministratorPassword(Password1);
1047  break;
1048 
1049  case PSN_WIZBACK:
1050  pSetupData->UnattendSetup = FALSE;
1051  break;
1052 
1053  default:
1054  break;
1055  }
1056  }
1057  break;
1058 
1059  default:
1060  break;
1061  }
1062 
1063  return FALSE;
1064 }
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:620
#define EM_LIMITTEXT
Definition: winuser.h:1982
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2271
#define TRUE
Definition: types.h:120
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:884
#define IDS_REACTOS_SETUP
Definition: resource.h:124
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:832
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendDlgItemMessage
Definition: winuser.h:5817
uint16_t * PWCHAR
Definition: typedefs.h:55
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:136
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:134
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
UINT code
Definition: winuser.h:3134
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1]
Definition: syssetup.h:44
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define IDC_ADMINPASSWORD2
Definition: resource.h:50
#define WM_SETTEXT
Definition: winuser.h:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetDlgItemText
Definition: winuser.h:5760
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define IDC_COMPUTERNAME
Definition: resource.h:15
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:766
#define IDC_ADMINPASSWORD1
Definition: resource.h:49
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
WCHAR AdminPassword[128]
Definition: syssetup.h:45
#define PSN_WIZBACK
Definition: prsht.h:120
#define isprint(c)
Definition: acclib.h:73
#define SendMessage
Definition: winuser.h:5818
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:135
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:137
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
#define IDD_THEMEPAGE
Definition: resource.h:73
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ Control_RunDLLW()

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

Definition at line 873 of file control.c.

874 {
875  CPanel panel;
876 
877  TRACE("(%p, %p, %s, 0x%08x)\n",
878  hWnd, hInst, debugstr_w(cmd), nCmdShow);
879 
880 #ifndef __REACTOS__
881  memset(&panel, 0, sizeof(panel));
882  list_init( &panel.applets );
883 #endif
884 
885  if (!cmd || !*cmd) {
886  Control_DoWindow(&panel, hWnd, hInst);
887  } else {
888  Control_DoLaunch(&panel, hWnd, cmd);
889  }
890 }
Definition: ftp_var.h:139
HWND hWnd
Definition: settings.c:17
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:742
struct list applets
Definition: cpanel.h:57
Definition: cpanel.h:56
HINSTANCE hInst
Definition: dxdiag.c:13
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:698
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define memset(x, y, z)
Definition: compat.h:39

Referenced by FinishDlgProc().

◆ CreateBoldFont()

static HFONT CreateBoldFont ( VOID  )
static

Definition at line 114 of file wizard.c.

115 {
116  LOGFONTW tmpFont = {0};
117  HFONT hBoldFont;
118  HDC hDc;
119 
120  /* Grabs the Drawing Context */
121  hDc = GetDC(NULL);
122 
123  tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
124  tmpFont.lfWeight = FW_BOLD;
125  wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
126 
127  hBoldFont = CreateFontIndirectW(&tmpFont);
128 
129  ReleaseDC(NULL, hDc);
130 
131  return hBoldFont;
132 }
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
static HDC
Definition: imagelist.c:92
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:718
LONG lfWeight
Definition: dimm.idl:63
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by InstallWizard().

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1376 of file wizard.c.

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

Referenced by DateTimePageDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 93 of file wizard.c.

94 {
95  LOGFONTW LogFont = {0};
96  HDC hdc;
97  HFONT hFont;
98 
99  LogFont.lfWeight = FW_BOLD;
100  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
101 
102  hdc = GetDC(NULL);
103  LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
104 
105  hFont = CreateFontIndirectW(&LogFont);
106 
107  ReleaseDC(NULL, hdc);
108 
109  return hFont;
110 }
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
static HDC
Definition: imagelist.c:92
HFONT hFont
Definition: main.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:718
LONG lfWeight
Definition: dimm.idl:63
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by InstallWizard().

◆ DateTimePageDlgProc()

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

Definition at line 1565 of file wizard.c.

1569 {
1571 
1572  /* Retrieve pointer to the global setup data */
1574 
1575  switch (uMsg)
1576  {
1577  case WM_INITDIALOG:
1578  {
1579  /* Save pointer to the global setup data */
1582 
1584 
1585  if (SetupData->UnattendSetup)
1586  {
1589 
1591  {
1593  }
1594  }
1595  else
1596  {
1598  SetupData, -1);
1599 
1601  }
1602  break;
1603  }
1604 
1605  case WM_TIMER:
1606  UpdateLocalSystemTime(hwndDlg);
1607  break;
1608 
1609  case WM_NOTIFY:
1610  switch (((LPNMHDR)lParam)->code)
1611  {
1612  case PSN_SETACTIVE:
1613  /* Enable the Back and Next buttons */
1616  {
1618  return TRUE;
1619  }
1620  SetTimer(hwndDlg, 1, 1000, NULL);
1621  break;
1622 
1623  case PSN_KILLACTIVE:
1624  case DTN_DATETIMECHANGE:
1625  KillTimer(hwndDlg, 1);
1626  break;
1627 
1628  case PSN_WIZNEXT:
1629  WriteDateTimeSettings(hwndDlg, SetupData);
1630  break;
1631 
1632  case PSN_WIZBACK:
1634  break;
1635 
1636  default:
1637  break;
1638  }
1639  break;
1640 
1641  case WM_DESTROY:
1643  break;
1644 
1645  default:
1646  break;
1647  }
1648 
1649  return FALSE;
1650 }
#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:1523
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
#define PSN_SETACTIVE
Definition: prsht.h:115
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1376
#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:1534
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1382
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
#define BM_SETCHECK
Definition: winuser.h:1903
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define WM_TIMER
Definition: winuser.h:1724
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
uint32_t DWORD_PTR
Definition: typedefs.h:64
DWORD TimeZoneIndex
Definition: syssetup.h:52
HWND WINAPI GetParent(_In_ HWND)
#define BST_CHECKED
Definition: winuser.h:197
#define PSN_WIZBACK
Definition: prsht.h:120
BOOL UnattendSetup
Definition: syssetup.h:46
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1404
#define GetWindowLongPtr
Definition: treelist.c:73
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4362
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( PSETUPDATA  SetupData)
static

Definition at line 1382 of file wizard.c.

1383 {
1385 
1386  while (SetupData->TimeZoneListHead != NULL)
1387  {
1389 
1390  SetupData->TimeZoneListHead = Entry->Next;
1392  {
1393  SetupData->TimeZoneListHead->Prev = NULL;
1394  }
1395 
1396  HeapFree(GetProcessHeap(), 0, Entry);
1397  }
1398 
1400 }
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define HeapFree(x, y, z)
Definition: compat.h:403
base of all file and directory entries
Definition: entries.h:82

Referenced by DateTimePageDlgProc().

◆ DoWriteProductOption()

static BOOL DoWriteProductOption ( PRODUCT_OPTION  nOption)
static

Definition at line 413 of file wizard.c.

414 {
415  HKEY hKey;
416  LONG error;
417  LPCWSTR pszData;
418  DWORD dwValue, cbData;
419  const PRODUCT_OPTION_DATA *pData = &s_ProductOptionData[nOption];
420  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
421 
422  /* open ProductOptions key */
424  if (error)
425  {
426  DPRINT1("RegOpenKeyExW failed\n");
427  goto Error;
428  }
429 
430  /* write ProductSuite */
431  pszData = pData->ProductSuite;
432  cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
433  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
434  if (error)
435  {
436  DPRINT1("RegSetValueExW failed\n");
437  goto Error;
438  }
439 
440  /* write ProductType */
441  pszData = pData->ProductType;
442  cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
443  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
444  if (error)
445  {
446  DPRINT1("RegSetValueExW failed\n");
447  goto Error;
448  }
449 
450  RegCloseKey(hKey);
451 
452  /* open ReactOS version key */
454  if (error)
455  {
456  DPRINT1("RegOpenKeyExW failed\n");
457  goto Error;
458  }
459 
460  /* write ReportAsWorkstation */
461  dwValue = pData->ReportAsWorkstation;
462  cbData = sizeof(dwValue);
463  error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
464  if (error)
465  {
466  DPRINT1("RegSetValueExW failed\n");
467  goto Error;
468  }
469 
470  RegCloseKey(hKey);
471 
472  /* open Control Windows key */
474  if (error)
475  {
476  DPRINT1("RegOpenKeyExW failed\n");
477  goto Error;
478  }
479 
480  /* write Control Windows CSDVersion */
481  dwValue = pData->CSDVersion;
482  cbData = sizeof(dwValue);
483  error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
484  if (error)
485  {
486  DPRINT1("RegSetValueExW failed\n");
487  goto Error;
488  }
489 
490 Error:
491  if (hKey)
492  RegCloseKey(hKey);
493 
494  return error == ERROR_SUCCESS;
495 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:406
#define lstrlenW
Definition: compat.h:416
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static const WCHAR s_szRosVersion[]
Definition: wizard.c:395
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: xxhash.c:193
static const WCHAR s_szControlWindows[]
Definition: wizard.c:396
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define REG_DWORD
Definition: sdbapi.c:596
static const WCHAR s_szProductOptions[]
Definition: wizard.c:394
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by ProductPageDlgProc().

◆ FinishDlgProc()

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

Definition at line 2174 of file wizard.c.

2178 {
2179 
2180  switch (uMsg)
2181  {
2182  case WM_INITDIALOG:
2183  {
2184  /* Get pointer to the global setup data */
2186 
2188  {
2189  /* Run the Wine Gecko prompt */
2190  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2191  }
2192 
2193  /* Set title font */
2194  SendDlgItemMessage(hwndDlg,
2196  WM_SETFONT,
2198  (LPARAM)TRUE);
2199  if (SetupData->UnattendSetup)
2200  {
2201  KillTimer(hwndDlg, 1);
2203  PostQuitMessage(0);
2204  }
2205  }
2206  break;
2207 
2208  case WM_DESTROY:
2209  {
2211  PostQuitMessage(0);
2212  return TRUE;
2213  }
2214 
2215  case WM_TIMER:
2216  {
2217  INT Position;
2218  HWND hWndProgress;
2219 
2220  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2221  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2222  if (Position == 300)
2223  {
2224  KillTimer(hwndDlg, 1);
2226  }
2227  else
2228  {
2229  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2230  }
2231  }
2232  return TRUE;
2233 
2234  case WM_NOTIFY:
2235  {
2236  LPNMHDR lpnm = (LPNMHDR)lParam;
2237 
2238  switch (lpnm->code)
2239  {
2240  case PSN_SETACTIVE:
2241  /* Enable the correct buttons on for the active page */
2243 
2245  MAKELPARAM(0, 300));
2247  SetTimer(hwndDlg, 1, 50, NULL);
2248  break;
2249 
2250  case PSN_WIZFINISH:
2251  DestroyWindow(GetParent(hwndDlg));
2252  break;
2253 
2254  default:
2255  break;
2256  }
2257  }
2258  break;
2259 
2260  default:
2261  break;
2262  }
2263 
2264  return FALSE;
2265 }
#define TRUE
Definition: types.h:120
static COORD Position
Definition: mouse.c:34
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define PBM_SETPOS
Definition: commctrl.h:2180
UINT_PTR WPARAM
Definition: windef.h:207
#define PSBTN_FINISH
Definition: prsht.h:148
#define SendDlgItemMessage
Definition: winuser.h:5817
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PSN_SETACTIVE
Definition: prsht.h:115
int32_t INT
Definition: typedefs.h:57
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
#define PBM_SETRANGE
Definition: commctrl.h:2179
#define PSN_WIZFINISH
Definition: prsht.h:122
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_RESTART_PROGRESS
Definition: resource.h:61
#define SW_SHOW
Definition: winuser.h:769
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
BOOL DisableGeckoInst
Definition: syssetup.h:47
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1591
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2145
#define WM_TIMER
Definition: winuser.h:1724
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:873
SETUPDATA SetupData
Definition: reactos.c:41
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
static const WCHAR L[]
Definition: oid.c:1250
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define SendMessage
Definition: winuser.h:5818
BOOL UnattendSetup
Definition: syssetup.h:46
HFONT hTitleFont
Definition: reactos.h:117
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define PBM_GETPOS
Definition: commctrl.h:2190
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ GenerateComputerName()

static void GenerateComputerName ( LPWSTR  lpBuffer)
static

Definition at line 884 of file wizard.c.

885 {
886  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
887  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
888  unsigned i;
889 
890  wcscpy(lpBuffer, L"REACTOS-");
891 
892  srand(GetTickCount());
893 
894  /* fill in 7 characters */
895  for (i = 8; i < 15; i++)
896  lpBuffer[i] = Chars[rand() % cChars];
897 
898  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
899 }
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
void __cdecl srand(_In_ unsigned int _Seed)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UNICODE_NULL
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__wchar_t WCHAR
Definition: xmlstorage.h:180
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250

Referenced by ComputerPageDlgProc().

◆ GetInstallSourceWin32()

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

Definition at line 2273 of file wizard.c.

2277 {
2278  WCHAR wszDrives[512];
2279  WCHAR wszNTPath[512]; // MAX_PATH ?
2280  DWORD cchDrives;
2281  PWCHAR pwszDrive;
2282 
2283  *pwszPath = UNICODE_NULL;
2284 
2285  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2286  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2287  {
2288  /* Buffer too small or failure */
2289  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2290  return FALSE;
2291  }
2292 
2293  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2294  {
2295  WCHAR wszBuf[MAX_PATH];
2296 
2297  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2298  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2299  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2300  pwszDrive[2] = L'\\'; // Restore the backslash
2301 
2302  wcscat(wszNTPath, L"\\"); // Concat a backslash
2303 
2304  /* Logging */
2305  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2306  pwszDrive, wszNTPath,
2307  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2308  LogItem(NULL, wszBuf);
2309 
2310  /* Check whether the NT path corresponds to the NT installation source path */
2311  if (!_wcsicmp(wszNTPath, pwszNTPath))
2312  {
2313  /* Found it! */
2314  wcscpy(pwszPath, pwszDrive); // cchPathMax
2315 
2316  /* Logging */
2317  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2318  LogItem(NULL, wszBuf);
2319  wcscat(wszBuf, L"\n");
2320  OutputDebugStringW(wszBuf);
2321 
2322  return TRUE;
2323  }
2324  }
2325 
2326  return FALSE;
2327 }
#define TRUE
Definition: types.h:120
uint16_t * PWCHAR
Definition: typedefs.h:55
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define DRIVE_CDROM
Definition: machpc98.h:115
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h: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
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define wsprintf
Definition: winuser.h:5840
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by ProcessSetupInf().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( PSETUPDATA  SetupData,
DWORD  Index 
)
static

Definition at line 1278 of file wizard.c.

1279 {
1281 
1283  while (Entry != NULL)
1284  {
1285  if (Entry->Index >= Index)
1286  return Entry;
1287 
1288  Entry = Entry->Next;
1289  }
1290 
1291  return NULL;
1292 }
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
base of all file and directory entries
Definition: entries.h:82

Referenced by RetrieveTimeZone().

◆ GetLocalSystemTime()

static BOOL GetLocalSystemTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1479 of file wizard.c.

1480 {
1481  SYSTEMTIME Date;
1482  SYSTEMTIME Time;
1483 
1485  {
1486  return FALSE;
1487  }
1488 
1490  {
1491  return FALSE;
1492  }
1493 
1494  SetupData->SystemTime.wYear = Date.wYear;
1497  SetupData->SystemTime.wDay = Date.wDay;
1498  SetupData->SystemTime.wHour = Time.wHour;
1499  SetupData->SystemTime.wMinute = Time.wMinute;
1500  SetupData->SystemTime.wSecond = Time.wSecond;
1501  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1502 
1503  return TRUE;
1504 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
WORD wMonth
Definition: winbase.h:884
WORD wDayOfWeek
Definition: winbase.h:885
#define IDC_TIMEPICKER
Definition: resource.h:11
WORD wYear
Definition: winbase.h:883
WORD wMinute
Definition: winbase.h:888
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SETUPDATA SetupData
Definition: reactos.c:41
WORD wSecond
Definition: winbase.h:889
WORD wMilliseconds
Definition: winbase.h:890
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4326
WORD wDay
Definition: winbase.h:886
#define GDT_VALID
Definition: commctrl.h:4456
#define IDC_DATEPICKER
Definition: resource.h:59
WORD wHour
Definition: winbase.h:887
SYSTEMTIME SystemTime
Definition: syssetup.h:49
static PLARGE_INTEGER Time
Definition: time.c:105

Referenced by WriteDateTimeSettings().

◆ GplDlgProc()

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

Definition at line 135 of file wizard.c.

139 {
140  HRSRC GplTextResource;
141  HGLOBAL GplTextMem;
142  PVOID GplTextLocked;
143  PCHAR GplText;
144  DWORD Size;
145 
146 
147  switch (uMsg)
148  {
149  case WM_INITDIALOG:
150  GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
151  if (NULL == GplTextResource)
152  {
153  break;
154  }
155  Size = SizeofResource(hDllInstance, GplTextResource);
156  if (0 == Size)
157  {
158  break;
159  }
160  GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
161  if (NULL == GplText)
162  {
163  break;
164  }
165  GplTextMem = LoadResource(hDllInstance, GplTextResource);
166  if (NULL == GplTextMem)
167  {
168  HeapFree(GetProcessHeap(), 0, GplText);
169  break;
170  }
171  GplTextLocked = LockResource(GplTextMem);
172  if (NULL == GplTextLocked)
173  {
174  HeapFree(GetProcessHeap(), 0, GplText);
175  break;
176  }
177  memcpy(GplText, GplTextLocked, Size);
178  GplText[Size] = '\0';
179  SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
180  HeapFree(GetProcessHeap(), 0, GplText);
181  SetFocus(GetDlgItem(hwndDlg, IDOK));
182  return FALSE;
183 
184  case WM_CLOSE:
185  EndDialog(hwndDlg, IDCANCEL);
186  break;
187 
188  case WM_COMMAND:
189  if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
190  {
191  EndDialog(hwndDlg, IDOK);
192  }
193  break;
194 
195  default:
196  break;
197  }
198 
199  return FALSE;
200 }
signed char * PCHAR
Definition: retypes.h:7
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDOK
Definition: winuser.h:824
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDC_GPL_TEXT
Definition: resource.h:77
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HWND WINAPI SetFocus(_In_opt_ HWND)
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
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:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_CLOSE
Definition: winuser.h:1603
#define BN_CLICKED
Definition: winuser.h:1907
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WM_COMMAND
Definition: winuser.h:1722
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define IDR_GPL
Definition: resource.h:163
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define HIWORD(l)
Definition: typedefs.h: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:403

Referenced by AckPageDlgProc().

◆ InstallWizard()

VOID InstallWizard ( VOID  )

Definition at line 2691 of file wizard.c.

2692 {
2693  PROPSHEETHEADER psh = {0};
2694  HPROPSHEETPAGE *phpage = NULL;
2695  PROPSHEETPAGE psp = {0};
2696  UINT nPages = 0;
2697  HWND hWnd;
2698  MSG msg;
2699  PSETUPDATA pSetupData = NULL;
2700  HMODULE hNetShell = NULL;
2702  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2703 
2704  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2705 
2706  /* Allocate setup data */
2707  pSetupData = HeapAlloc(GetProcessHeap(),
2709  sizeof(SETUPDATA));
2710  if (pSetupData == NULL)
2711  {
2712  LogItem(NULL, L"SetupData allocation failed!");
2713  MessageBoxW(NULL,
2714  L"Setup failed to allocate global data!",
2715  L"ReactOS Setup",
2716  MB_ICONERROR | MB_OK);
2717  goto done;
2718  }
2719  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
2720 
2721  hNetShell = LoadLibraryW(L"netshell.dll");
2722  if (hNetShell != NULL)
2723  {
2724  DPRINT("Netshell.dll loaded!\n");
2725 
2726  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2727  "NetSetupRequestWizardPages");
2728  if (pfn != NULL)
2729  {
2730  pfn(&dwNetworkPageCount, NULL, NULL);
2731  dwPageCount += dwNetworkPageCount;
2732  }
2733  }
2734 
2735  DPRINT("PageCount: %lu\n", dwPageCount);
2736 
2737  phpage = HeapAlloc(GetProcessHeap(),
2739  dwPageCount * sizeof(HPROPSHEETPAGE));
2740  if (phpage == NULL)
2741  {
2742  LogItem(NULL, L"Page array allocation failed!");
2743  MessageBoxW(NULL,
2744  L"Setup failed to allocate page array!",
2745  L"ReactOS Setup",
2746  MB_ICONERROR | MB_OK);
2747  goto done;
2748  }
2749 
2750  /* Process the $winnt$.inf setup file */
2751  ProcessSetupInf(pSetupData);
2752 
2753  /* Create the Welcome page */
2754  psp.dwSize = sizeof(PROPSHEETPAGE);
2755  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2756  psp.hInstance = hDllInstance;
2757  psp.lParam = (LPARAM)pSetupData;
2758  psp.pfnDlgProc = WelcomeDlgProc;
2759  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2760  phpage[nPages++] = CreatePropertySheetPage(&psp);
2761 
2762  /* Create the Acknowledgements page */
2763  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2764  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2765  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2766  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2767  psp.pfnDlgProc = AckPageDlgProc;
2768  phpage[nPages++] = CreatePropertySheetPage(&psp);
2769 
2770  /* Create the Product page */
2771  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2772  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2773  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2774  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2775  psp.pfnDlgProc = ProductPageDlgProc;
2776  phpage[nPages++] = CreatePropertySheetPage(&psp);
2777 
2778  /* Create the Locale page */
2779  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2780  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2781  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2782  psp.pfnDlgProc = LocalePageDlgProc;
2783  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2784  phpage[nPages++] = CreatePropertySheetPage(&psp);
2785 
2786  /* Create the Owner page */
2787  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2788  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2789  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2790  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2791  psp.pfnDlgProc = OwnerPageDlgProc;
2792  phpage[nPages++] = CreatePropertySheetPage(&psp);
2793 
2794  /* Create the Computer page */
2795  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2796  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2797  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2798  psp.pfnDlgProc = ComputerPageDlgProc;
2799  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2800  phpage[nPages++] = CreatePropertySheetPage(&psp);
2801 
2802  /* Create the DateTime page */
2803  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2804  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2805  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2806  psp.pfnDlgProc = DateTimePageDlgProc;
2807  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2808  phpage[nPages++] = CreatePropertySheetPage(&psp);
2809 
2810  /* Create the theme selection page */
2811  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2812  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2813  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2814  psp.pfnDlgProc = ThemePageDlgProc;
2815  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2816  phpage[nPages++] = CreatePropertySheetPage(&psp);
2817 
2820 
2821  if (pfn)
2822  {
2823  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2824  nPages += dwNetworkPageCount;
2825  }
2826 
2827  /* Create the Process page */
2828  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2829  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2830  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2831  psp.pfnDlgProc = ProcessPageDlgProc;
2832  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2833  phpage[nPages++] = CreatePropertySheetPage(&psp);
2834 
2835  /* Create the Finish page */
2836  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2837  psp.pfnDlgProc = FinishDlgProc;
2838  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2839  phpage[nPages++] = CreatePropertySheetPage(&psp);
2840 
2841  ASSERT(nPages == dwPageCount);
2842 
2843  /* Create the property sheet */
2844  psh.dwSize = sizeof(PROPSHEETHEADER);
2845  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2846  psh.hInstance = hDllInstance;
2847  psh.hwndParent = NULL;
2848  psh.nPages = nPages;
2849  psh.nStartPage = 0;
2850  psh.phpage = phpage;
2851  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2852  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2853 
2854  /* Create title font */
2855  pSetupData->hTitleFont = CreateTitleFont();
2856  pSetupData->hBoldFont = CreateBoldFont();
2857 
2858  /* Display the wizard */
2859  hWnd = (HWND)PropertySheet(&psh);
2861 
2862  while (GetMessage(&msg, NULL, 0, 0))
2863  {
2864  if (!IsDialogMessage(hWnd, &msg))
2865  {
2867  DispatchMessage(&msg);
2868  }
2869  }
2870 
2871  DeleteObject(pSetupData->hBoldFont);
2872  DeleteObject(pSetupData->hTitleFont);
2873 
2874  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2875  SetupCloseInfFile(pSetupData->hSetupInf);
2876 
2877 done:
2878  if (phpage != NULL)
2879  HeapFree(GetProcessHeap(), 0, phpage);
2880 
2881  if (hNetShell != NULL)
2882  FreeLibrary(hNetShell);
2883 
2884  if (pSetupData != NULL)
2885  HeapFree(GetProcessHeap(), 0, pSetupData);
2886 
2887  LogItem(L"END_SECTION", L"InstallWizard");
2888 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2039
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define IDS_OWNERSUBTITLE
Definition: resource.h:101
#define IDD_PRODUCT
Definition: resource.h:92
#define IDS_PROCESSTITLE
Definition: resource.h:84
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:204
#define IDS_ACKSUBTITLE
Definition: resource.h:98
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:93
#define IDD_COMPUTERPAGE
Definition: resource.h:47
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1195
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:288
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:116
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2558
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:902
HANDLE HWND
Definition: compat.h:13
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1666
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDS_DATETIMESUBTITLE
Definition: resource.h:110
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define IsDialogMessage
Definition: winuser.h:5784
#define IDB_HEADER
Definition: resource.h:30
#define IDD_OWNERPAGE
Definition: resource.h:43
HINF hSetupInf
Definition: syssetup.h:56
#define IDD_PROCESSPAGE
Definition: resource.h:54
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:2688
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:115
#define IDS_COMPUTERTITLE
Definition: resource.h:103
#define IDS_DATETIMETITLE
Definition: resource.h:109
#define IDS_ACKTITLE
Definition: resource.h:97
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:156
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1565
#define LoadLibraryW(x)
Definition: compat.h:413
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define SW_SHOW
Definition: winuser.h:769
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:114
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
static HINSTANCE hDllInstance
Definition: clb.c:30
#define PSP_DEFAULT
Definition: prsht.h:22
#define IDD_ACKPAGE
Definition: resource.h:39
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:657
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
#define FreeLibrary(x)
Definition: compat.h:414
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define MB_ICONERROR
Definition: winuser.h:781
#define IDD_FINISHPAGE
Definition: resource.h:34
static INT_PTR CALLBACK FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2174
#define IDS_PRODUCTTITLE
Definition: resource.h:155
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:521
HFONT hBoldFont
Definition: syssetup.h:37
#define IDS_OWNERTITLE
Definition: resource.h:100
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
#define GetMessage
Definition: winuser.h:5765
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:104
#define msg(x)
Definition: auth_time.c:54
#define PropertySheet
Definition: prsht.h:400
#define GetProcAddress(x, y)
Definition: compat.h:419
HFONT hTitleFont
Definition: reactos.h:117
#define IDS_LOCALESUBTITLE
Definition: resource.h:107
#define IDS_LOCALETITLE
Definition: resource.h:106
#define HeapFree(x, y, z)
Definition: compat.h:403
#define PROPSHEETPAGE
Definition: prsht.h:389
#define IDD_THEMEPAGE
Definition: resource.h:73
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by InstallReactOS().

◆ LocalePageDlgProc()

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

Definition at line 1195 of file wizard.c.

1199 {
1201 
1202  /* Retrieve pointer to the global setup data */
1204 
1205  switch (uMsg)
1206  {
1207  case WM_INITDIALOG:
1208  {
1209  /* Save pointer to the global setup data */
1212  WriteUserLocale();
1213 
1215  }
1216  break;
1217 
1218  case WM_COMMAND:
1219  if (HIWORD(wParam) == BN_CLICKED)
1220  {
1221  switch (LOWORD(wParam))
1222  {
1223  case IDC_CUSTOMLOCALE:
1224  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1225  /* FIXME: Update input locale name */
1226  break;
1227 
1228  case IDC_CUSTOMLAYOUT:
1229  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1230  break;
1231  }
1232  }
1233  break;
1234 
1235  case WM_NOTIFY:
1236  {
1237  LPNMHDR lpnm = (LPNMHDR)lParam;
1238 
1239  switch (lpnm->code)
1240  {
1241  case PSN_SETACTIVE:
1242  /* Enable the Back and Next buttons */
1244  if (SetupData->UnattendSetup)
1245  {
1246  // if (!*SetupData->SourcePath)
1247  {
1248  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1249  }
1250 
1252  return TRUE;
1253  }
1254  break;
1255 
1256  case PSN_WIZNEXT:
1257  break;
1258 
1259  case PSN_WIZBACK:
1261  break;
1262 
1263  default:
1264  break;
1265  }
1266  }
1267  break;
1268 
1269  default:
1270  break;
1271  }
1272 
1273  return FALSE;
1274 }
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1174
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDD_OWNERPAGE
Definition: resource.h:43
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1125
#define IDC_CUSTOMLOCALE
Definition: resource.h:54
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define BN_CLICKED
Definition: winuser.h:1907
SETUPDATA SetupData
Definition: reactos.c:41
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1722
uint32_t DWORD_PTR
Definition: typedefs.h:64
HWND WINAPI GetParent(_In_ HWND)
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1068
#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:46
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_LAYOUTTEXT
Definition: resource.h:55
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ OnChooseOption()

static void OnChooseOption ( HWND  hwndDlg,
PRODUCT_OPTION  nOption 
)
static

Definition at line 498 of file wizard.c.

499 {
500  WCHAR szText[256];
501  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
502 
503  switch (nOption)
504  {
507  break;
508 
511  break;
512 
513  default:
514  return;
515  }
516 
518 }
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:160
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:406
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:159
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
static const WCHAR szText[]
Definition: dialog.c:139
static HINSTANCE hDllInstance
Definition: clb.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:95

Referenced by ProductPageDlgProc().

◆ OwnerPageDlgProc()

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

Definition at line 657 of file wizard.c.

661 {
662  WCHAR OwnerName[51];
663  WCHAR OwnerOrganization[51];
664  WCHAR Title[64];
665  WCHAR ErrorName[256];
666  LPNMHDR lpnm;
667  PSETUPDATA pSetupData;
668 
669  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
670 
671  switch (uMsg)
672  {
673  case WM_INITDIALOG:
674  {
675  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
676  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
677 
678  /* set a localized ('Owner') placeholder string as default */
679  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
680  {
681  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
682  }
683 
686 
687  /* Set focus to owner name */
688  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
689 
690  /* Select the default text to quickly overwrite it by typing */
691  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
692  }
693  break;
694 
695 
696  case WM_NOTIFY:
697  {
698  lpnm = (LPNMHDR)lParam;
699 
700  switch (lpnm->code)
701  {
702  case PSN_SETACTIVE:
703  /* Enable the Back and Next buttons */
705  if (pSetupData->UnattendSetup)
706  {
707  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
709  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
710  {
712  return TRUE;
713  }
714  }
715  break;
716 
717  case PSN_WIZNEXT:
718  OwnerName[0] = 0;
719  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
720  {
722  {
723  wcscpy(Title, L"ReactOS Setup");
724  }
725  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
726  {
727  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
728  }
729  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
730 
731  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
732  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
733 
734  return TRUE;
735  }
736 
737  OwnerOrganization[0] = 0;
738  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
739 
740  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
741  {
742  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
743  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
744  return TRUE;
745  }
746 
747  case PSN_WIZBACK:
748  pSetupData->UnattendSetup = FALSE;
749  break;
750 
751  default:
752  break;
753  }
754  }
755  break;
756 
757  default:
758  break;
759  }
760 
761  return FALSE;
762 }
#define EM_LIMITTEXT
Definition: winuser.h:1982
#define IDC_OWNERNAME
Definition: resource.h:44
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2271
#define TRUE
Definition: types.h:120
#define IDD_COMPUTERPAGE
Definition: resource.h:47
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:130
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND WINAPI SetFocus(_In_opt_ HWND)
#define SendDlgItemMessage
Definition: winuser.h:5817
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3134
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_OWNERORGANIZATION
Definition: resource.h:45
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define _countof(array)
Definition: sndvol32.h:68
#define EM_SETSEL
Definition: winuser.h:2000
#define IDS_WZD_NAME
Definition: resource.h:132
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
HWND WINAPI GetParent(_In_ HWND)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define MB_OK
Definition: winuser.h:784
WCHAR OwnerName[51]
Definition: syssetup.h:42
#define PSN_WIZBACK
Definition: prsht.h:120
#define SendMessage
Definition: winuser.h:5818
BOOL UnattendSetup
Definition: syssetup.h:46
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:615
#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 2039 of file wizard.c.

2043 {
2045  PREGISTRATIONNOTIFY RegistrationNotify;
2046  static UINT oldActivityID = -1;
2047  WCHAR Title[64];
2048 
2049  /* Retrieve pointer to the global setup data */
2051 
2052  switch (uMsg)
2053  {
2054  case WM_INITDIALOG:
2055  {
2056  /* Save pointer to the global setup data */
2059  }
2060  break;
2061 
2062  case WM_NOTIFY:
2063  {
2064  LPNMHDR lpnm = (LPNMHDR)lParam;
2065  ULONG MaxProgress = 0;
2066 
2067  switch (lpnm->code)
2068  {
2069  case PSN_SETACTIVE:
2070  /* Disable the Back and Next buttons */
2071  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2072 
2073  StartComponentRegistration(hwndDlg, &MaxProgress);
2074 
2076  0, MAKELPARAM(0, MaxProgress));
2078  0, 0);
2079  break;
2080 
2081  case PSN_WIZNEXT:
2082  break;
2083 
2084  case PSN_WIZBACK:
2086  break;
2087 
2088  default:
2089  break;
2090  }
2091  }
2092  break;
2093 
2095  {
2096  WCHAR Activity[64];
2097  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2098  // update if necessary only
2099  if (oldActivityID != RegistrationNotify->ActivityID)
2100  {
2101  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2102  Activity,
2103  ARRAYSIZE(Activity)))
2104  {
2106  0, (LPARAM) Activity);
2107  }
2108  oldActivityID = RegistrationNotify->ActivityID;
2109  }
2111  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2112  L"" : RegistrationNotify->CurrentItem));
2114  RegistrationNotify->Progress, 0);
2115  if (NULL != RegistrationNotify->ErrorMessage)
2116  {
2118  Title, ARRAYSIZE(Title)))
2119  {
2120  wcscpy(Title, L"ReactOS Setup");
2121  }
2122  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2123  Title, MB_ICONERROR | MB_OK);
2124 
2125  }
2126 
2127  if (wParam)
2128  {
2129  /* Enable the Back and Next buttons */
2132  }
2133  }
2134  return TRUE;
2135 
2136  default:
2137  break;
2138  }
2139 
2140  return FALSE;
2141 }
#define IDC_ITEM
Definition: resource.h:56
LPCWSTR CurrentItem
Definition: wizard.c:39
#define TRUE
Definition: types.h:120
#define IDS_REACTOS_SETUP
Definition: resource.h:124
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define PBM_SETPOS
Definition: commctrl.h:2180
#define SendDlgItemMessage
Definition: winuser.h:5817
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
#define IDC_PROCESSPROGRESS
Definition: resource.h:57
UINT code
Definition: winuser.h:3134
#define PBM_SETRANGE
Definition: commctrl.h:2179
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1599
static HINSTANCE hDllInstance
Definition: clb.c:30
static BOOL StartComponentRegistration(HWND hwndDlg, PULONG MaxProgress)
Definition: wizard.c:1972
static const WCHAR Title[]
Definition: oid.c:1259
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SETUPDATA SetupData
Definition: reactos.c:41
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define MB_ICONERROR
Definition: winuser.h:781
uint32_t DWORD_PTR
Definition: typedefs.h:64
#define PSBTN_NEXT
Definition: prsht.h:147
HWND WINAPI GetParent(_In_ HWND)
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
#define PSN_WIZBACK
Definition: prsht.h:120
unsigned int ULONG
Definition: retypes.h:1
BOOL UnattendSetup
Definition: syssetup.h:46
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define GetWindowLongPtr
Definition: treelist.c:73
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define IDC_ACTIVITY
Definition: resource.h:55
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ ProcessSetupInf()

VOID ProcessSetupInf ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2558 of file wizard.c.

2560 {
2562  WCHAR szValue[MAX_PATH];
2563  INFCONTEXT InfContext;
2564  DWORD LineLength;
2565  HKEY hKey;
2566  LONG res;
2567 
2568  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2569 
2570  /* Retrieve the path of the setup INF */
2572  wcscat(szPath, L"\\$winnt$.inf");
2573 
2574  /* Open the setup INF */
2575  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2576  NULL,
2578  NULL);
2579  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2580  {
2581  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2582  return;
2583  }
2584 
2585 
2586  /* Retrieve the NT source path from which the 1st-stage installer was run */
2587  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2588  L"data",
2589  L"sourcepath",
2590  &InfContext))
2591  {
2592  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2593  return;
2594  }
2595 
2596  if (!SetupGetStringFieldW(&InfContext,
2597  1,
2598  szValue,
2599  ARRAYSIZE(szValue),
2600  &LineLength))
2601  {
2602  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2603  return;
2604  }
2605 
2606  *pSetupData->SourcePath = UNICODE_NULL;
2607 
2608  /* Close the setup INF as we are going to modify it manually */
2609  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2610  SetupCloseInfFile(pSetupData->hSetupInf);
2611 
2612 
2613  /* Find the installation source path in Win32 format */
2614  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2615  _countof(pSetupData->SourcePath),
2616  szValue))
2617  {
2618  *pSetupData->SourcePath = UNICODE_NULL;
2619  }
2620 
2621  /* Save the path in Win32 format in the setup INF */
2622  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2623  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2624 
2625  /*
2626  * Save it also in the registry, in the following keys:
2627  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2628  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2629  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2630  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2631  */
2632 #if 0
2634  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2635  0,
2637  &hKey);
2638 
2639  if (res != ERROR_SUCCESS)
2640  {
2641  return FALSE;
2642  }
2643 #endif
2644 
2646  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2647  0, NULL,
2649  KEY_ALL_ACCESS, // KEY_WRITE
2650  NULL,
2651  &hKey,
2652  NULL);
2653  if (res == ERROR_SUCCESS)
2654  {
2655  res = RegSetValueExW(hKey,
2656  L"SourcePath",
2657  0,
2658  REG_SZ,
2659  (LPBYTE)pSetupData->SourcePath,
2660  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2661 
2662  res = RegSetValueExW(hKey,
2663  L"ServicePackSourcePath",
2664  0,
2665  REG_SZ,
2666  (LPBYTE)pSetupData->SourcePath,
2667  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2668 
2669  RegCloseKey(hKey);
2670  }
2671 
2672 
2673  /* Now, re-open the setup INF (this must succeed) */
2674  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2675  NULL,
2677  NULL);
2678  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2679  {
2680  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2681  return;
2682  }
2683 
2684  /* Process the unattended section of the setup file */
2685  ProcessUnattendSection(pSetupData);
2686 }
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2273
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define ERROR_SUCCESS
Definition: deptool.c:10
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#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:2330
_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 2330 of file wizard.c.

2332 {
2333  INFCONTEXT InfContext;
2334  WCHAR szName[256];
2335  WCHAR szValue[MAX_PATH];
2336  DWORD LineLength;
2337  HKEY hKey;
2338 
2339  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2340  L"Unattend",
2341  L"UnattendSetupEnabled",
2342  &InfContext))
2343  {
2344  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2345  return;
2346  }
2347 
2348  if (!SetupGetStringFieldW(&InfContext,
2349  1,
2350  szValue,
2351  ARRAYSIZE(szValue),
2352  &LineLength))
2353  {
2354  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2355  return;
2356  }
2357 
2358  if (_wcsicmp(szValue, L"yes") != 0)
2359  {
2360  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2361  return;
2362  }
2363 
2364  pSetupData->UnattendSetup = TRUE;
2365 
2366  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2367  L"Unattend",
2368  NULL,
2369  &InfContext))
2370  {
2371  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2372  return;
2373  }
2374 
2375  do
2376  {
2377  if (!SetupGetStringFieldW(&InfContext,
2378  0,
2379  szName,
2380  ARRAYSIZE(szName),
2381  &LineLength))
2382  {
2383  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2384  return;
2385  }
2386 
2387  if (!SetupGetStringFieldW(&InfContext,
2388  1,
2389  szValue,
2390  ARRAYSIZE(szValue),
2391  &LineLength))
2392  {
2393  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2394  return;
2395  }
2396  DPRINT1("Name %S Value %S\n", szName, szValue);
2397  if (!_wcsicmp(szName, L"FullName"))
2398  {
2399  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2400  {
2401  wcscpy(pSetupData->OwnerName, szValue);
2402  }
2403  }
2404  else if (!_wcsicmp(szName, L"OrgName"))
2405  {
2406  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2407  {
2408  wcscpy(pSetupData->OwnerOrganization, szValue);
2409  }
2410  }
2411  else if (!_wcsicmp(szName, L"ComputerName"))
2412  {
2413  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2414  {
2415  wcscpy(pSetupData->ComputerName, szValue);
2416  }
2417  }
2418  else if (!_wcsicmp(szName, L"AdminPassword"))
2419  {
2420  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2421  {
2422  wcscpy(pSetupData->AdminPassword, szValue);
2423  }
2424  }
2425  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2426  {
2427  pSetupData->TimeZoneIndex = _wtoi(szValue);
2428  }
2429  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2430  {
2431  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2432  }
2433  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2434  {
2435  if (!_wcsicmp(szValue, L"yes"))
2436  pSetupData->DisableGeckoInst = TRUE;
2437  else
2438  pSetupData->DisableGeckoInst = FALSE;
2439  }
2440  else if (!_wcsicmp(szName, L"ProductOption"))
2441  {
2442  pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2443  }
2444  } while (SetupFindNextLine(&InfContext, &InfContext));
2445 
2446  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2447  L"Display",
2448  NULL,
2449  &InfContext))
2450  {
2451  DEVMODEW dm = { { 0 } };
2452  dm.dmSize = sizeof(dm);
2454  {
2455  do
2456  {
2457  int iValue;
2458  if (!SetupGetStringFieldW(&InfContext,
2459  0,
2460  szName,
2461  ARRAYSIZE(szName),
2462  &LineLength))
2463  {
2464  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2465  return;
2466  }
2467 
2468  if (!SetupGetStringFieldW(&InfContext,
2469  1,
2470  szValue,
2471  ARRAYSIZE(szValue),
2472  &LineLength))
2473  {
2474  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2475  return;
2476  }
2477  iValue = _wtoi(szValue);
2478  DPRINT1("Name %S Value %i\n", szName, iValue);
2479 
2480  if (!iValue)
2481  continue;
2482 
2483  if (!_wcsicmp(szName, L"BitsPerPel"))
2484  {
2485  dm.dmFields |= DM_BITSPERPEL;
2486  dm.dmBitsPerPel = iValue;
2487  }
2488  else if (!_wcsicmp(szName, L"XResolution"))
2489  {
2490  dm.dmFields |= DM_PELSWIDTH;
2491  dm.dmPelsWidth = iValue;
2492  }
2493  else if (!_wcsicmp(szName, L"YResolution"))
2494  {
2495  dm.dmFields |= DM_PELSHEIGHT;
2496  dm.dmPelsHeight = iValue;
2497  }
2498  else if (!_wcsicmp(szName, L"VRefresh"))
2499  {
2501  dm.dmDisplayFrequency = iValue;
2502  }
2503  } while (SetupFindNextLine(&InfContext, &InfContext));
2504 
2506  }
2507  }
2508 
2510  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2511  0,
2512  KEY_SET_VALUE,
2513  &hKey) != ERROR_SUCCESS)
2514  {
2515  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2516  return;
2517  }
2518 
2519  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2520  L"GuiRunOnce",
2521  NULL,
2522  &InfContext))
2523  {
2524  int i = 0;
2525  do
2526  {
2527  if (SetupGetStringFieldW(&InfContext,
2528  0,
2529  szValue,
2530  ARRAYSIZE(szValue),
2531  NULL))
2532  {
2534  swprintf(szName, L"%d", i);
2535  DPRINT("szName %S szValue %S\n", szName, szValue);
2536 
2537  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2538  {
2539  DPRINT("value %S\n", szPath);
2540  if (RegSetValueExW(hKey,
2541  szName,
2542  0,
2543  REG_SZ,
2544  (const BYTE*)szPath,
2545  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2546  {
2547  i++;
2548  }
2549  }
2550  }
2551  } while (SetupFindNextLine(&InfContext, &InfContext));
2552  }
2553 
2554  RegCloseKey(hKey);
2555 }
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
DWORD dmFields
Definition: wingdi.h:1621
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD dmBitsPerPel
Definition: wingdi.h:1646
enum _PRODUCT_OPTION PRODUCT_OPTION
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define DM_PELSWIDTH
Definition: wingdi.h:1268
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
WORD dmSize
Definition: wingdi.h:1619
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dmPelsWidth
Definition: wingdi.h:1647
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1271
unsigned char BYTE
Definition: xxhash.c:193
DWORD dmDisplayFrequency
Definition: wingdi.h:1653
#define DM_PELSHEIGHT
Definition: wingdi.h:1269
LPCWSTR szPath
Definition: env.c:35
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
#define DPRINT1
Definition: precomp.h:8
DWORD dmPelsHeight
Definition: wingdi.h:1648
static const WCHAR szName[]
Definition: msipriv.h:1194
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define DM_BITSPERPEL
Definition: wingdi.h:1267
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by ProcessSetupInf().

◆ ProductPageDlgProc()

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

Definition at line 521 of file wizard.c.

522 {
523  LPNMHDR lpnm;
524  PSETUPDATA pSetupData;
525  INT iItem;
526  WCHAR szText[64], szDefault[64];
527  HICON hIcon;
528 
529  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
530 
531  switch (uMsg)
532  {
533  case WM_INITDIALOG:
534  {
535  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
536  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
537 
538  LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
539 
542  {
544  StringCchCatW(szText, _countof(szText), szDefault);
545  }
547 
550  {
552  StringCchCatW(szText, _countof(szText), szDefault);
553  }
555 
558 
561  return TRUE;
562  }
563 
564  case WM_COMMAND:
566  {
567  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
568  OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
569  }
570  break;
571 
572  case WM_NOTIFY:
573  {
574  lpnm = (LPNMHDR)lParam;
575 
576  switch (lpnm->code)
577  {
578  case PSN_SETACTIVE:
579  /* Enable the Back and Next buttons */
581  if (pSetupData->UnattendSetup)
582  {
583  OnChooseOption(hwndDlg, pSetupData->ProductOption);
584  DoWriteProductOption(pSetupData->ProductOption);
586  return TRUE;
587  }
588  break;
589 
590  case PSN_WIZNEXT:
591  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
592  pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
593  DoWriteProductOption(pSetupData->ProductOption);
594  break;
595 
596  case PSN_WIZBACK:
597  pSetupData->UnattendSetup = FALSE;
598  break;
599 
600  default:
601  break;
602  }
603  }
604  break;
605 
606  default:
607  break;
608  }
609 
610  return FALSE;
611 }
#define STM_SETICON
Definition: winuser.h:2074
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:57
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1925
WPARAM wParam
Definition: combotst.c:138
enum _PRODUCT_OPTION PRODUCT_OPTION
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
UINT code
Definition: winuser.h:3134
static const WCHAR szText[]
Definition: dialog.c:139
#define CB_ADDSTRING
Definition: winuser.h:1918
#define LPPROPSHEETPAGE
Definition: prsht.h:390
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define IDC_PRODUCT_ICON
Definition: resource.h:93
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static HINSTANCE hDllInstance
Definition: clb.c:30
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:498
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:94
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:413
#define _countof(array)
Definition: sndvol32.h:68
#define IDI_WINLOGO
Definition: winuser.h:704
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const WCHAR L[]
Definition: oid.c:1250
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define DWLP_USER
Definition: winuser.h:866
#define CB_SETCURSEL
Definition: winuser.h:1943
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
#define CBN_SELCHANGE
Definition: winuser.h:1961
#define PSN_WIZBACK
Definition: prsht.h:120
#define HIWORD(l)
Definition: typedefs.h:246
BOOL UnattendSetup
Definition: syssetup.h:46
#define LoadIcon
Definition: winuser.h:5788
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:158
#define IDS_DEFAULT
Definition: resource.h:161
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:157
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA

Referenced by InstallWizard().

◆ RegistrationNotificationProc()

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

Definition at line 1780 of file wizard.c.

1784 {
1785  PREGISTRATIONDATA RegistrationData;
1786  REGISTRATIONNOTIFY RegistrationNotify;
1787  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1788  UINT MessageID;
1789  WCHAR ErrorMessage[128];
1790 
1791  RegistrationData = (PREGISTRATIONDATA) Context;
1792 
1793  if (SPFILENOTIFY_STARTREGISTRATION == Notification ||
1794  SPFILENOTIFY_ENDREGISTRATION == Notification)
1795  {
1796  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1797  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1798  if (NULL == RegistrationNotify.CurrentItem)
1799  {
1800  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1801  }
1802  else
1803  {
1804  RegistrationNotify.CurrentItem++;
1805  }
1806 
1807  if (SPFILENOTIFY_STARTREGISTRATION == Notification)
1808  {
1809  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1810  StatusInfo->FileName);
1811  RegistrationNotify.ErrorMessage = NULL;
1812  RegistrationNotify.Progress = RegistrationData->Registered;
1813  }
1814  else
1815  {
1816  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1817  StatusInfo->FileName);
1818  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1819  StatusInfo->FailureCode);
1820  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1821  {
1822  switch(StatusInfo->FailureCode)
1823  {
1824  case SPREG_LOADLIBRARY:
1826  break;
1827  case SPREG_GETPROCADDR:
1829  break;
1830  case SPREG_REGSVR:
1832  break;
1833  case SPREG_DLLINSTALL:
1835  break;
1836  case SPREG_TIMEOUT:
1838  break;
1839  default:
1841  break;
1842  }
1844  ErrorMessage,
1846  {
1847  ErrorMessage[0] = L'\0';
1848  }
1849  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
1850  {
1852  StatusInfo->Win32Error, 0,
1855  NULL);
1856  }
1857  RegistrationNotify.ErrorMessage = ErrorMessage;
1858  }
1859  else
1860  {
1861  RegistrationNotify.ErrorMessage = NULL;
1862  }
1863  if (RegistrationData->Registered < RegistrationData->DllCount)
1864  {
1865  RegistrationData->Registered++;
1866  }
1867  }
1868 
1869  RegistrationNotify.Progress = RegistrationData->Registered;
1870  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1871  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1872  0, (LPARAM) &RegistrationNotify);
1873 
1874  return FILEOP_DOIT;
1875  }
1876  else
1877  {
1878  DPRINT1("Received unexpected notification %u\n", Notification);
1879  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
1880  Notification, Param1, Param2);
1881  }
1882 }
LPCWSTR CurrentItem
Definition: wizard.c:39
ULONG DllCount
Definition: wizard.c:46
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:123
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:565
static VOID ErrorMessage(DWORD dwErrorCode, LPWSTR szFormat,...)
Definition: attrib.c:51
#define IDS_TIMEOUT
Definition: resource.h:14
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define SPREG_GETPROCADDR
Definition: setupapi.h:649
ULONG Registered
Definition: wizard.c:47
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:122
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SetupDefaultQueueCallback
Definition: setupapi.h:2567
PVOID DefaultContext
Definition: wizard.c:48
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
_In_ PVOID _In_ ULONG MessageID
Definition: ketypes.h:507
#define SPREG_REGSVR
Definition: setupapi.h:650
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:126
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
_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:124
#define FILEOP_DOIT
Definition: fileqsup.h:48
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_REASON_UNKNOWN
Definition: resource.h:128
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:566
struct _REGISTRATIONDATA * PREGISTRATIONDATA
unsigned int UINT
Definition: ndis.h:50
#define DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5818
#define SPREG_DLLINSTALL
Definition: setupapi.h:651
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define SPREG_TIMEOUT
Definition: setupapi.h:652
#define IDS_REGSVR_FAILED
Definition: resource.h:125
#define SPREG_LOADLIBRARY
Definition: setupapi.h:648
#define SPREG_SUCCESS
Definition: setupapi.h:647
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by RegistrationProc().

◆ RegistrationProc()

static DWORD CALLBACK RegistrationProc ( LPVOID  Parameter)
static

Definition at line 1886 of file wizard.c.

1887 {
1888  PREGISTRATIONDATA RegistrationData;
1889  REGISTRATIONNOTIFY RegistrationNotify;
1890  DWORD LastError = NO_ERROR;
1891  WCHAR UnknownError[84];
1892 
1893  RegistrationData = (PREGISTRATIONDATA) Parameter;
1894  RegistrationData->Registered = 0;
1895  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
1896 
1897  _SEH2_TRY
1898  {
1899  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
1900  hSysSetupInf,
1901  L"RegistrationPhase2",
1902  SPINST_REGISTRY |
1903  SPINST_REGISTERCALLBACKAWARE |
1904  SPINST_REGSVR,
1905  0,
1906  NULL,
1907  0,
1909  RegistrationData,
1910  NULL,
1911  NULL))
1912  {
1913  LastError = GetLastError();
1914  }
1915  }
1917  {
1918  DPRINT("Catching exception\n");
1920  }
1921  _SEH2_END;
1922 
1923  if (NO_ERROR == LastError)
1924  {
1925  RegistrationNotify.ErrorMessage = NULL;
1926  }
1927  else
1928  {
1929  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
1930  LastError);
1932  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
1933  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
1934  NULL))
1935  {
1937  UnknownError,
1938  ARRAYSIZE(UnknownError) - 20))
1939  {
1940  wcscpy(UnknownError, L"Unknown error");
1941  }
1942  wcscat(UnknownError, L" ");
1943  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
1944  RegistrationNotify.ErrorMessage = UnknownError;
1945  }
1946  }
1947 
1948  RegistrationNotify.Progress = RegistrationData->DllCount;
1949  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1950  RegistrationNotify.CurrentItem = NULL;
1951  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1952  1, (LPARAM) &RegistrationNotify);
1953  if (NULL != RegistrationNotify.ErrorMessage &&
1954  UnknownError != RegistrationNotify.ErrorMessage)
1955  {
1956  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
1957  }
1958 
1959  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
1960  HeapFree(GetProcessHeap(), 0, RegistrationData);
1961 
1962  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
1963 
1964  // FIXME: Move this call to a separate cleanup page!
1966 
1967  return 0;
1968 }
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:423
LPCWSTR CurrentItem
Definition: wizard.c:39
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
ULONG DllCount
Definition: wizard.c:46
#define SPINST_REGSVR
Definition: setupapi.h:589
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
ULONG Registered
Definition: wizard.c:47
_In_ PVOID Parameter
Definition: ldrtypes.h:241
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define NO_ERROR
Definition: dderror.h:5
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
_SEH2_TRY
Definition: create.c:4250
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:122
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1780
PVOID DefaultContext
Definition: wizard.c:48
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define SPINST_REGISTRY
Definition: setupapi.h:585
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
static HINSTANCE hDllInstance
Definition: clb.c:30
#define GetProcessHeap()
Definition: compat.h:404
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1327
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_UNKNOWN_ERROR
Definition: resource.h:121
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
HWND WINAPI GetParent(_In_ HWND)
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
_SEH2_END
Definition: create.c:4424
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1677
struct _REGISTRATIONDATA * PREGISTRATIONDATA
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DPRINT1
Definition: precomp.h:8
#define SendMessage
Definition: winuser.h:5818
LPCWSTR ErrorMessage
Definition: wizard.c:40
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HINF hSysSetupInf
Definition: install.c:37
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:403

Referenced by StartComponentRegistration().

◆ RetrieveTimeZone()

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

Definition at line 1295 of file wizard.c.

1298 {
1299  LONG lError;
1302  PTIMEZONE_ENTRY Current;
1303  ULONG DescriptionSize;
1304  ULONG StandardNameSize;
1305  ULONG DaylightNameSize;
1306 
1308  if (Entry == NULL)
1309  {
1310  return ERROR_NOT_ENOUGH_MEMORY;
1311  }
1312 
1313  DescriptionSize = sizeof(Entry->Description);
1314  StandardNameSize = sizeof(Entry->StandardName);
1315  DaylightNameSize = sizeof(Entry->DaylightName);
1316 
1317  lError = QueryTimeZoneData(hZoneKey,
1318  &Entry->Index,
1319  &Entry->TimezoneInfo,
1320  Entry->Description,
1321  &DescriptionSize,
1322  Entry->StandardName,
1323  &StandardNameSize,
1324  Entry->DaylightName,
1325  &DaylightNameSize);
1326  if (lError != ERROR_SUCCESS)
1327  {
1328  HeapFree(GetProcessHeap(), 0, Entry);
1329  return lError;
1330  }
1331 
1332  if (SetupData->TimeZoneListHead == NULL &&
1334  {
1335  Entry->Prev = NULL;
1336  Entry->Next = NULL;
1339  }
1340  else
1341  {
1342  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1343  if (Current != NULL)
1344  {
1345  if (Current == SetupData->TimeZoneListHead)
1346  {
1347  /* Prepend to head */
1348  Entry->Prev = NULL;
1349  Entry->Next = SetupData->TimeZoneListHead;
1350  SetupData->TimeZoneListHead->Prev = Entry;
1352  }
1353  else
1354  {
1355  /* Insert before current */
1356  Entry->Prev = Current->Prev;
1357  Entry->Next = Current;
1358  Current->Prev->Next = Entry;
1359  Current->Prev = Entry;
1360  }
1361  }
1362  else
1363  {
1364  /* Append to tail */
1365  Entry->Prev = SetupData->TimeZoneListTail;
1366  Entry->Next = NULL;
1369  }
1370  }
1371 
1372  return ERROR_SUCCESS;
1373 }
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:627
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1278
Definition: timezone.c:15
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
SETUPDATA SetupData
Definition: reactos.c:41
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:403
base of all file and directory entries
Definition: entries.h:82
LONG QueryTimeZoneData(IN HKEY hZoneKey, OUT PULONG Index OPTIONAL, OUT PREG_TZI_FORMAT TimeZoneInfo, OUT PWCHAR Description OPTIONAL, IN OUT PULONG DescriptionSize OPTIONAL, OUT PWCHAR StandardName OPTIONAL, IN OUT PULONG StandardNameSize OPTIONAL, OUT PWCHAR DaylightName OPTIONAL, IN OUT PULONG DaylightNameSize OPTIONAL)
Definition: tzlib.c:141
struct _SETUPDATA * PSETUPDATA

Referenced by CreateTimeZoneList().

◆ RunControlPanelApplet()

static BOOL RunControlPanelApplet ( HWND  hwnd,
PCWSTR  pwszCPLParameters 
)
static

Definition at line 1125 of file wizard.c.

1126 {
1127  MSG msg;
1128  STARTUPINFOW StartupInfo;
1129  PROCESS_INFORMATION ProcessInformation;
1130  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1131 
1132  if (!pwszCPLParameters)
1133  {
1134  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1135  return FALSE;
1136  }
1137 
1138  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1139  StartupInfo.cb = sizeof(StartupInfo);
1140  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1141 
1142  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1143  wcscat(CmdLine, pwszCPLParameters);
1144 
1145  if (!CreateProcessW(NULL,
1146  CmdLine,
1147  NULL,
1148  NULL,
1149  FALSE,
1150  0,
1151  NULL,
1152  NULL,
1153  &StartupInfo,
1154  &ProcessInformation))
1155  {
1156  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1157  return FALSE;
1158  }
1159 
1161  {
1162  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1163  {
1166  }
1167  }
1168  CloseHandle(ProcessInformation.hThread);
1169  CloseHandle(ProcessInformation.hProcess);
1170  return TRUE;
1171 }
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:407
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define ZeroMemory
Definition: winbase.h:1648
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4595
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:830
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h: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().

◆ SetInstallationCompleted()

static VOID SetInstallationCompleted ( VOID  )
static

Definition at line 2145 of file wizard.c.

2146 {
2147  HKEY hKey = 0;
2148  DWORD InProgress = 0;
2149  DWORD InstallDate;
2150 
2152  L"SYSTEM\\Setup",
2153  0,
2154  KEY_WRITE,
2155  &hKey ) == ERROR_SUCCESS)
2156  {
2157  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2158  RegCloseKey( hKey );
2159  }
2160 
2162  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2163  0,
2164  KEY_WRITE,
2165  &hKey ) == ERROR_SUCCESS)
2166  {
2167  InstallDate = (DWORD)time(NULL);
2168  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2169  RegCloseKey( hKey );
2170  }
2171 }
#define ERROR_SUCCESS
Definition: deptool.c:10
__u16 time
Definition: mkdosfs.c:366
#define DWORD
Definition: nt_native.h:44
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
smooth NULL
Definition: ftsmooth.c:416
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by FinishDlgProc().

◆ SetKeyboardLayoutName()

static VOID SetKeyboardLayoutName ( HWND  hwnd)
static

Definition at line 1068 of file wizard.c.

1069 {
1070 #if 0
1071  TCHAR szLayoutPath[256];
1072  TCHAR szLocaleName[32];
1073  DWORD dwLocaleSize;
1074  HKEY hKey;
1075 
1077  _T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
1078  0,
1080  &hKey))
1081  return;
1082 
1083  dwValueSize = 16 * sizeof(TCHAR);
1084  if (RegQueryValueEx(hKey,
1085  NULL,
1086  NULL,
1087  NULL,
1088  szLocaleName,
1089  &dwLocaleSize))
1090  {
1091  RegCloseKey(hKey);
1092  return;
1093  }
1094 
1095  _tcscpy(szLayoutPath,
1096  _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"));
1097  _tcscat(szLayoutPath,
1098  szLocaleName);
1099 
1101  szLayoutPath,
1102  0,
1104  &hKey))
1105  return;
1106 
1107  dwValueSize = 32 * sizeof(TCHAR);
1108  if (RegQueryValueEx(hKey,
1109  _T("Layout Text"),
1110  NULL,
1111  NULL,
1112  szLocaleName,
1113  &dwLocaleSize))
1114  {
1115  RegCloseKey(hKey);
1116  return;
1117  }
1118 
1119  RegCloseKey(hKey);
1120 #endif
1121 }
#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 1434 of file wizard.c.

1435 {
1436  TIME_ZONE_INFORMATION TimeZoneInformation;
1438  DWORD dwIndex;
1439  DWORD i;
1440 
1441  dwIndex = SendMessage(hwnd,
1442  CB_GETCURSEL,
1443  0,
1444  0);
1445 
1446  i = 0;
1448  while (i < dwIndex)
1449  {
1450  if (Entry == NULL)
1451  return;
1452 
1453  i++;
1454  Entry = Entry->Next;
1455  }
1456 
1457  wcscpy(TimeZoneInformation.StandardName,
1458  Entry->StandardName);
1459  wcscpy(TimeZoneInformation.DaylightName,
1460  Entry->DaylightName);
1461 
1462  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1463  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1464  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1465 
1466  memcpy(&TimeZoneInformation.StandardDate,
1467  &Entry->TimezoneInfo.StandardDate,
1468  sizeof(SYSTEMTIME));
1469  memcpy(&TimeZoneInformation.DaylightDate,
1470  &Entry->TimezoneInfo.DaylightDate,
1471  sizeof(SYSTEMTIME));
1472 
1473  /* Set time zone information */
1474  SetTimeZoneInformation(&TimeZoneInformation);
1475 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
#define CB_GETCURSEL
Definition: winuser.h:1925
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
SETUPDATA SetupData
Definition: reactos.c:41
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
SYSTEMTIME StandardDate
Definition: winbase.h:1174
WCHAR DaylightName[32]
Definition: winbase.h:1176
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define SendMessage
Definition: winuser.h:5818
WCHAR StandardName[32]
Definition: winbase.h:1173
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1177

Referenced by WriteDateTimeSettings().

◆ SetSystemLocalTime()

static BOOL SetSystemLocalTime ( HWND  hwnd,
PSETUPDATA  SetupData 
)
static

Definition at line 1508 of file wizard.c.

1509 {
1510  BOOL Ret = FALSE;
1511 
1512  /*
1513  * Call SetLocalTime twice to ensure correct results
1514  */
1515  Ret = SetLocalTime(&SetupData->SystemTime) &&
1517 
1518  return Ret;
1519 }
unsigned int BOOL
Definition: ntddk_ex.h:94
SETUPDATA SetupData
Definition: reactos.c:41
SYSTEMTIME SystemTime
Definition: syssetup.h:49
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356

Referenced by WriteDateTimeSettings().

◆ ShowTimeZoneList()

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

Definition at line 1404 of file wizard.c.

1405 {
1407  DWORD dwIndex = 0;
1408  DWORD dwCount;
1409 
1410  GetTimeZoneListIndex(&dwEntryIndex);
1411 
1413  while (Entry != NULL)
1414  {
1415  dwCount = SendMessage(hwnd,
1416  CB_ADDSTRING,
1417  0,
1418  (LPARAM)Entry->Description);
1419 
1420  if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1421  dwIndex = dwCount;
1422 
1423  Entry = Entry->Next;
1424  }
1425 
1426  SendMessage(hwnd,
1427  CB_SETCURSEL,
1428  (WPARAM)dwIndex,
1429  0);
1430 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:627
Definition: timezone.c:15
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
UINT_PTR WPARAM
Definition: windef.h:207
#define CB_ADDSTRING
Definition: winuser.h:1918
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
unsigned long DWORD
Definition: ntddk_ex.h:95
SETUPDATA SetupData
Definition: reactos.c:41
#define CB_SETCURSEL
Definition: winuser.h:1943
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define SendMessage
Definition: winuser.h:5818
base of all file and directory entries
Definition: entries.h:82

Referenced by DateTimePageDlgProc().

◆ StartComponentRegistration()

static BOOL StartComponentRegistration ( HWND  hwndDlg,
PULONG  MaxProgress 
)
static

Definition at line 1972 of file wizard.c.

1973 {
1974  HANDLE RegistrationThread;
1975  LONG DllCount;
1977  WCHAR SectionName[512];
1978  PREGISTRATIONDATA RegistrationData;
1979 
1980  DllCount = -1;
1981  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
1982  L"RegisterDlls", &Context))
1983  {
1984  DPRINT1("No RegistrationPhase2 section found\n");
1985  return FALSE;
1986  }
1987  if (!SetupGetStringFieldW(&Context, 1, SectionName,
1988  ARRAYSIZE(SectionName),
1989  NULL))
1990  {
1991  DPRINT1("Unable to retrieve section name\n");
1992  return FALSE;
1993  }
1994  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
1995  DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
1996  if (DllCount < 0)
1997  {
1999  return FALSE;
2000  }
2001 
2002  *MaxProgress = (ULONG) DllCount;
2003 
2004  /*
2005  * Create a background thread to do the actual registrations, so the
2006  * main thread can just run its message loop.
2007  */
2008  RegistrationThread = NULL;
2009  RegistrationData = HeapAlloc(GetProcessHeap(), 0,
2010  sizeof(REGISTRATIONDATA));
2011  if (RegistrationData != NULL)
2012  {
2013  RegistrationData->hwndDlg = hwndDlg;
2014  RegistrationData->DllCount = DllCount;
2015  RegistrationThread = CreateThread(NULL, 0, RegistrationProc,
2016  RegistrationData, 0, NULL);
2017  if (RegistrationThread != NULL)
2018  {
2019  CloseHandle(RegistrationThread);
2020  }
2021  else
2022  {
2023  DPRINT1("CreateThread failed, error %u\n", GetLastError());
2024  HeapFree(GetProcessHeap(), 0, RegistrationData);
2025  return FALSE;
2026  }
2027  }
2028  else
2029  {
2030  DPRINT1("HeapAlloc() failed, error %u\n", GetLastError());
2031  return FALSE;
2032  }
2033 
2034  return TRUE;
2035 }
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:407
ULONG DllCount
Definition: wizard.c:46
#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:72
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD CALLBACK RegistrationProc(LPVOID Parameter)
Definition: wizard.c:1886
#define SetLastError(x)
Definition: compat.h:418
static const WCHAR L[]
Definition: oid.c:1250
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1034
unsigned int ULONG
Definition: retypes.h:1
HINF hSysSetupInf
Definition: install.c:37
#define HeapFree(x, y, z)
Definition: compat.h:403
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 1666 of file wizard.c.

1670 {
1672  LPNMLISTVIEW pnmv;
1673 
1674  /* Retrieve pointer to the global setup data */
1676 
1677  switch (uMsg)
1678  {
1679  case WM_INITDIALOG:
1680  {
1681  HWND hListView;
1682  HIMAGELIST himl;
1683  DWORD n;
1684  LVITEM lvi = {0};
1685 
1686  /* Save pointer to the global setup data */
1689 
1690  hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1691 
1692  /* Common */
1694  lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1695 
1696  for (n = 0; n < ARRAYSIZE(Themes); ++n)
1697  {
1698  WCHAR DisplayName[100] = {0};
1699  /* Load the bitmap */
1701  ImageList_AddMasked(himl, image, RGB(255,0,255));
1702 
1703  /* Load the string */
1704  LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
1705  DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
1706 
1707  /* Add the listview item */
1708  lvi.iItem = n;
1709  lvi.iImage = n;
1710  lvi.pszText = DisplayName;
1711  ListView_InsertItem(hListView, &lvi);
1712  }
1713 
1714  /* Register the imagelist */
1716  /* Transparant background */
1717  ListView_SetBkColor(hListView, CLR_NONE);
1718  ListView_SetTextBkColor(hListView, CLR_NONE);
1719  /* Reduce the size between the items */
1720  ListView_SetIconSpacing(hListView, 190, 173);
1721  break;
1722  }
1723  case WM_NOTIFY:
1724  switch (((LPNMHDR)lParam)->code)
1725  {
1726  //case LVN_ITEMCHANGING:
1727  case LVN_ITEMCHANGED:
1728  pnmv = (LPNMLISTVIEW)lParam;
1729  if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
1730  {
1731  int iTheme = pnmv->iItem;
1732  DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
1733 
1734  if (Themes[iTheme].ThemeFile)
1735  {
1736  WCHAR wszParams[1024];
1737  WCHAR wszTheme[MAX_PATH];
1738  WCHAR* format = L"desk.cpl desk,@Appearance /Action:ActivateMSTheme /file:\"%s\"";
1739 
1740  SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
1741  swprintf(wszParams, format, wszTheme);
1742  RunControlPanelApplet(hwndDlg, wszParams);
1743  }
1744  else
1745  {
1746  RunControlPanelApplet(hwndDlg, L"desk.cpl desk,@Appearance /Action:ActivateMSTheme");
1747  }
1748  }
1749  break;
1750