ReactOS  0.4.15-dev-3295-gaa8fc87
wizard.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: System setup
4  * FILE: dll/win32/syssetup/wizard.c
5  * PURPOSE: GUI controls
6  * PROGRAMMERS: Eric Kohl
7  * Pierre Schweitzer <heis_spiter@hotmail.com>
8  * Ismael Ferreras Morezuelas <swyterzone+ros@gmail.com>
9  * Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
10  */
11 
12 /* INCLUDES *****************************************************************/
13 
14 #include "precomp.h"
15 
16 #include <stdlib.h>
17 #include <time.h>
18 #include <winnls.h>
19 #include <windowsx.h>
20 #include <wincon.h>
21 #include <shlobj.h>
22 #include <tzlib.h>
23 #include <strsafe.h>
24 
25 #define NDEBUG
26 #include <debug.h>
27 
28 #define PM_REGISTRATION_NOTIFY (WM_APP + 1)
29 /* Private Message used to communicate progress from the background
30  registration thread to the main thread.
31  wParam = 0 Registration in progress
32  = 1 Registration completed
33  lParam = Pointer to a REGISTRATIONNOTIFY structure */
34 
35 typedef struct _REGISTRATIONNOTIFY
36 {
42 
43 typedef struct _REGISTRATIONDATA
44 {
50 
51 typedef struct _TIMEZONE_ENTRY
52 {
53  struct _TIMEZONE_ENTRY *Prev;
54  struct _TIMEZONE_ENTRY *Next;
55  WCHAR Description[128]; /* 'Display' */
56  WCHAR StandardName[32]; /* 'Std' */
57  WCHAR DaylightName[32]; /* 'Dlt' */
58  REG_TZI_FORMAT TimezoneInfo; /* 'TZI' */
61 
62 
63 /* FUNCTIONS ****************************************************************/
64 
65 extern void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow);
66 
67 
68 static VOID
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 }
90 
91 
92 static HFONT
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 }
111 
112 
113 static HFONT
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 }
133 
134 static INT_PTR CALLBACK
135 GplDlgProc(HWND hwndDlg,
136  UINT uMsg,
137  WPARAM wParam,
138  LPARAM lParam)
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 }
201 
202 
203 static INT_PTR CALLBACK
205  UINT uMsg,
206  WPARAM wParam,
207  LPARAM lParam)
208 {
209  PSETUPDATA pSetupData;
210 
211  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
212 
213  switch (uMsg)
214  {
215  case WM_INITDIALOG:
216  {
217  HWND hwndControl;
218  DWORD dwStyle;
219 
220  /* Get pointer to the global setup data */
221  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
222  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
223 
224  hwndControl = GetParent(hwndDlg);
225 
226  /* Center the wizard window */
227  CenterWindow (hwndControl);
228 
229  /* Hide the system menu */
230  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
231  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
232 
233  /* Hide and disable the 'Cancel' button */
234  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
235  ShowWindow (hwndControl, SW_HIDE);
236  EnableWindow (hwndControl, FALSE);
237 
238  /* Set title font */
239  SendDlgItemMessage(hwndDlg,
241  WM_SETFONT,
242  (WPARAM)pSetupData->hTitleFont,
243  (LPARAM)TRUE);
244  }
245  break;
246 
247 
248  case WM_NOTIFY:
249  {
250  LPNMHDR lpnm = (LPNMHDR)lParam;
251 
252  switch (lpnm->code)
253  {
254  case PSN_SETACTIVE:
255  LogItem(L"BEGIN", L"WelcomePage");
256  /* Enable the Next button */
258  if (pSetupData->UnattendSetup)
259  {
261  return TRUE;
262  }
263  break;
264 
265  case PSN_WIZNEXT:
266  LogItem(L"END", L"WelcomePage");
267  break;
268 
269  case PSN_WIZBACK:
270  pSetupData->UnattendSetup = FALSE;
271  break;
272 
273  default:
274  break;
275  }
276  }
277  break;
278 
279  default:
280  break;
281  }
282 
283  return FALSE;
284 }
285 
286 
287 static INT_PTR CALLBACK
289  UINT uMsg,
290  WPARAM wParam,
291  LPARAM lParam)
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 }
393 
394 static const WCHAR s_szProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
395 static const WCHAR s_szRosVersion[] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version";
396 static const WCHAR s_szControlWindows[] = L"SYSTEM\\CurrentControlSet\\Control\\Windows";
397 static const WCHAR s_szWinlogon[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon";
398 
399 typedef struct _PRODUCT_OPTION_DATA
400 {
407 
409 {
410  { L"Terminal Server\0", L"ServerNT", 0, 0x200, 0 },
411  { L"\0", L"WinNT", 1, 0x300, 1 }
412 };
413 
414 static BOOL
416 {
417  HKEY hKey;
418  LONG error;
419  LPCWSTR pszData;
420  DWORD dwValue, cbData;
421  const PRODUCT_OPTION_DATA *pData = &s_ProductOptionData[nOption];
422  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
423 
424  /* open ProductOptions key */
426  if (error)
427  {
428  DPRINT1("RegOpenKeyExW failed\n");
429  goto Error;
430  }
431 
432  /* write ProductSuite */
433  pszData = pData->ProductSuite;
434  cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
435  error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
436  if (error)
437  {
438  DPRINT1("RegSetValueExW failed\n");
439  goto Error;
440  }
441 
442  /* write ProductType */
443  pszData = pData->ProductType;
444  cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
445  error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
446  if (error)
447  {
448  DPRINT1("RegSetValueExW failed\n");
449  goto Error;
450  }
451 
452  RegCloseKey(hKey);
453 
454  /* open ReactOS version key */
456  if (error)
457  {
458  DPRINT1("RegOpenKeyExW failed\n");
459  goto Error;
460  }
461 
462  /* write ReportAsWorkstation */
463  dwValue = pData->ReportAsWorkstation;
464  cbData = sizeof(dwValue);
465  error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
466  if (error)
467  {
468  DPRINT1("RegSetValueExW failed\n");
469  goto Error;
470  }
471 
472  RegCloseKey(hKey);
473 
474  /* open Control Windows key */
476  if (error)
477  {
478  DPRINT1("RegOpenKeyExW failed\n");
479  goto Error;
480  }
481 
482  /* write Control Windows CSDVersion */
483  dwValue = pData->CSDVersion;
484  cbData = sizeof(dwValue);
485  error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
486  if (error)
487  {
488  DPRINT1("RegSetValueExW failed\n");
489  goto Error;
490  }
491 
492  RegCloseKey(hKey);
493 
494  /* open Winlogon key */
496  if (error)
497  {
498  DPRINT1("RegOpenKeyExW failed\n");
499  goto Error;
500  }
501 
502  /* write LogonType */
503  dwValue = pData->LogonType;
504  cbData = sizeof(dwValue);
505  error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
506  if (error)
507  {
508  DPRINT1("RegSetValueExW failed\n");
509  goto Error;
510  }
511 
512 Error:
513  if (hKey)
514  RegCloseKey(hKey);
515 
516  return error == ERROR_SUCCESS;
517 }
518 
519 static void
521 {
522  WCHAR szText[256];
523  ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
524 
525  switch (nOption)
526  {
529  break;
530 
533  break;
534 
535  default:
536  return;
537  }
538 
540 }
541 
542 static INT_PTR CALLBACK
544 {
545  LPNMHDR lpnm;
546  PSETUPDATA pSetupData;
547  INT iItem;
548  WCHAR szText[64], szDefault[64];
549  HICON hIcon;
550 
551  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
552 
553  switch (uMsg)
554  {
555  case WM_INITDIALOG:
556  {
557  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
558  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
559 
560  LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
561 
564  {
566  StringCchCatW(szText, _countof(szText), szDefault);
567  }
569 
572  {
574  StringCchCatW(szText, _countof(szText), szDefault);
575  }
577 
580 
583  return TRUE;
584  }
585 
586  case WM_COMMAND:
588  {
589  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
590  OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
591  }
592  break;
593 
594  case WM_NOTIFY:
595  {
596  lpnm = (LPNMHDR)lParam;
597 
598  switch (lpnm->code)
599  {
600  case PSN_SETACTIVE:
601  /* Enable the Back and Next buttons */
603  if (pSetupData->UnattendSetup)
604  {
605  OnChooseOption(hwndDlg, pSetupData->ProductOption);
606  DoWriteProductOption(pSetupData->ProductOption);
608  return TRUE;
609  }
610  break;
611 
612  case PSN_WIZNEXT:
613  iItem = SendDlgItemMessageW(hwndDlg, IDC_PRODUCT_OPTIONS, CB_GETCURSEL, 0, 0);
614  pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
615  DoWriteProductOption(pSetupData->ProductOption);
616  break;
617 
618  case PSN_WIZBACK:
619  pSetupData->UnattendSetup = FALSE;
620  break;
621 
622  default:
623  break;
624  }
625  }
626  break;
627 
628  default:
629  break;
630  }
631 
632  return FALSE;
633 }
634 
635 static
636 BOOL
638  WCHAR * OwnerOrganization)
639 {
640  HKEY hKey;
641  LONG res;
642 
644  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
645  0,
647  &hKey);
648 
649  if (res != ERROR_SUCCESS)
650  {
651  return FALSE;
652  }
653 
655  L"RegisteredOwner",
656  0,
657  REG_SZ,
658  (LPBYTE)OwnerName,
659  (wcslen(OwnerName) + 1) * sizeof(WCHAR));
660 
661  if (res != ERROR_SUCCESS)
662  {
663  RegCloseKey(hKey);
664  return FALSE;
665  }
666 
668  L"RegisteredOrganization",
669  0,
670  REG_SZ,
671  (LPBYTE)OwnerOrganization,
672  (wcslen(OwnerOrganization) + 1) * sizeof(WCHAR));
673 
674  RegCloseKey(hKey);
675  return (res == ERROR_SUCCESS);
676 }
677 
678 static INT_PTR CALLBACK
680  UINT uMsg,
681  WPARAM wParam,
682  LPARAM lParam)
683 {
684  WCHAR OwnerName[51];
685  WCHAR OwnerOrganization[51];
686  WCHAR Title[64];
687  WCHAR ErrorName[256];
688  LPNMHDR lpnm;
689  PSETUPDATA pSetupData;
690 
691  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
692 
693  switch (uMsg)
694  {
695  case WM_INITDIALOG:
696  {
697  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
698  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
699 
700  /* set a localized ('Owner') placeholder string as default */
701  if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
702  {
703  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
704  }
705 
708 
709  /* Set focus to owner name */
710  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
711 
712  /* Select the default text to quickly overwrite it by typing */
713  SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_SETSEL, 0, -1);
714  }
715  break;
716 
717 
718  case WM_NOTIFY:
719  {
720  lpnm = (LPNMHDR)lParam;
721 
722  switch (lpnm->code)
723  {
724  case PSN_SETACTIVE:
725  /* Enable the Back and Next buttons */
727  if (pSetupData->UnattendSetup)
728  {
729  SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
731  if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
732  {
734  return TRUE;
735  }
736  }
737  break;
738 
739  case PSN_WIZNEXT:
740  OwnerName[0] = 0;
741  if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
742  {
744  {
745  wcscpy(Title, L"ReactOS Setup");
746  }
747  if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
748  {
749  wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
750  }
751  MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
752 
753  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
754  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
755 
756  return TRUE;
757  }
758 
759  OwnerOrganization[0] = 0;
760  GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
761 
762  if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
763  {
764  SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
765  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
766  return TRUE;
767  }
768 
769  case PSN_WIZBACK:
770  pSetupData->UnattendSetup = FALSE;
771  break;
772 
773  default:
774  break;
775  }
776  }
777  break;
778 
779  default:
780  break;
781  }
782 
783  return FALSE;
784 }
785 
786 static
787 BOOL
788 WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg)
789 {
790  WCHAR Title[64];
791  WCHAR ErrorComputerName[256];
792  LONG lError;
793  HKEY hKey = NULL;
794 
795  if (!SetComputerNameW(ComputerName))
796  {
797  if (hwndDlg != NULL)
798  {
800  {
801  wcscpy(Title, L"ReactOS Setup");
802  }
803  if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName,
804  ARRAYSIZE(ErrorComputerName)))
805  {
806  wcscpy(ErrorComputerName, L"Setup failed to set the computer name.");
807  }
808  MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
809  }
810 
811  return FALSE;
812  }
813 
814  /* Set the physical DNS domain */
815  SetComputerNameExW(ComputerNamePhysicalDnsDomain, L"");
816 
817  /* Set the physical DNS hostname */
818  SetComputerNameExW(ComputerNamePhysicalDnsHostname, ComputerName);
819 
820  /* Set the accounts domain name */
821  SetAccountsDomainSid(NULL, ComputerName);
822 
823  /* Now we need to set the Hostname */
825  L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
826  0,
828  &hKey);
829  if (lError != ERROR_SUCCESS)
830  {
831  DPRINT1("RegOpenKeyExW for Tcpip\\Parameters failed (%08lX)\n", lError);
832  return TRUE;
833  }
834 
835  lError = RegSetValueEx(hKey,
836  L"Hostname",
837  0,
838  REG_SZ,
839  (LPBYTE)ComputerName,
840  (wcslen(ComputerName) + 1) * sizeof(WCHAR));
841  if (lError != ERROR_SUCCESS)
842  {
843  DPRINT1("RegSetValueEx(\"Hostname\") failed (%08lX)\n", lError);
844  }
845 
846  RegCloseKey(hKey);
847 
848  return TRUE;
849 }
850 
851 
852 static
853 BOOL
855 {
856  WCHAR szAdministratorName[256];
857  HKEY hKey = NULL;
858  LONG lError;
859 
862  szAdministratorName,
863  ARRAYSIZE(szAdministratorName)) == 0)
864  {
865  wcscpy(szAdministratorName, L"Administrator");
866  }
867 
869  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
870  0,
872  &hKey);
873  if (lError != ERROR_SUCCESS)
874  return FALSE;
875 
876  lError = RegSetValueEx(hKey,
877  L"DefaultDomainName",
878  0,
879  REG_SZ,
880  (LPBYTE)Domain,
881  (wcslen(Domain)+ 1) * sizeof(WCHAR));
882  if (lError != ERROR_SUCCESS)
883  {
884  DPRINT1("RegSetValueEx(\"DefaultDomainName\") failed!\n");
885  }
886 
887  lError = RegSetValueEx(hKey,
888  L"DefaultUserName",
889  0,
890  REG_SZ,
891  (LPBYTE)szAdministratorName,
892  (wcslen(szAdministratorName)+ 1) * sizeof(WCHAR));
893  if (lError != ERROR_SUCCESS)
894  {
895  DPRINT1("RegSetValueEx(\"DefaultUserName\") failed!\n");
896  }
897 
898  RegCloseKey(hKey);
899 
900  return TRUE;
901 }
902 
903 
904 /* lpBuffer will be filled with a 15-char string (plus the null terminator) */
905 static void
907 {
908  static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
909  static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
910  unsigned i;
911 
912  wcscpy(lpBuffer, L"REACTOS-");
913 
914  srand(GetTickCount());
915 
916  /* fill in 7 characters */
917  for (i = 8; i < 15; i++)
918  lpBuffer[i] = Chars[rand() % cChars];
919 
920  lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
921 }
922 
923 static INT_PTR CALLBACK
925  UINT uMsg,
926  WPARAM wParam,
927  LPARAM lParam)
928 {
929  WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
930  WCHAR Password1[128];
931  WCHAR Password2[128];
933  WCHAR Title[64];
934  WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
935  LPNMHDR lpnm;
936  PSETUPDATA pSetupData;
937 
938  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
939 
941  {
942  wcscpy(Title, L"ReactOS Setup");
943  }
944 
945  switch (uMsg)
946  {
947  case WM_INITDIALOG:
948  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
949  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
950 
951  /* Generate a new pseudo-random computer name */
952  GenerateComputerName(ComputerName);
953 
954  /* Display current computer name */
955  SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
956 
957  /* Set text limits */
961 
962  /* Set focus to computer name */
964  if (pSetupData->UnattendSetup)
965  {
966  SendMessage(GetDlgItem(hwndDlg, IDC_COMPUTERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->ComputerName);
967  SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD1), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword);
968  SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD2), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword);
969  WriteComputerSettings(pSetupData->ComputerName, NULL);
970  SetAdministratorPassword(pSetupData->AdminPassword);
971  }
972 
973  /* Store the administrator account name as the default user name */
974  WriteDefaultLogonData(pSetupData->ComputerName);
975  break;
976 
977 
978  case WM_NOTIFY:
979  {
980  lpnm = (LPNMHDR)lParam;
981 
982  switch (lpnm->code)
983  {
984  case PSN_SETACTIVE:
985  /* Enable the Back and Next buttons */
987  if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
988  {
990  return TRUE;
991  }
992  break;
993 
994  case PSN_WIZNEXT:
995  if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
996  {
997  if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
998  ARRAYSIZE(EmptyComputerName)))
999  {
1000  wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1001  }
1002  MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1004  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1005  return TRUE;
1006  }
1007 
1008  /* No need to check computer name for invalid characters,
1009  * SetComputerName() will do it for us */
1010 
1011  if (!WriteComputerSettings(ComputerName, hwndDlg))
1012  {
1014  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1015  return TRUE;
1016  }
1017 
1018 #ifdef PASSWORDS_MANDATORY
1019  /* Check if admin passwords have been entered */
1020  if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1021  (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1022  {
1023  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1024  ARRAYSIZE(EmptyPassword)))
1025  {
1026  wcscpy(EmptyPassword, L"You must enter a password !");
1027  }
1028  MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1029  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1030  return TRUE;
1031  }
1032 #else
1033  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1034  GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1035 #endif
1036  /* Check if passwords match */
1037  if (wcscmp(Password1, Password2))
1038  {
1039  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1040  ARRAYSIZE(NotMatchPassword)))
1041  {
1042  wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1043  }
1044  MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1045  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1046  return TRUE;
1047  }
1048 
1049  /* Check password for invalid characters */
1050  Password = (PWCHAR)Password1;
1051  while (*Password)
1052  {
1053  if (!isprint(*Password))
1054  {
1055  if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1056  ARRAYSIZE(WrongPassword)))
1057  {
1058  wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1059  }
1060  MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1061  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1062  return TRUE;
1063  }
1064  Password++;
1065  }
1066 
1067  /* Set admin password */
1068  SetAdministratorPassword(Password1);
1069  break;
1070 
1071  case PSN_WIZBACK:
1072  pSetupData->UnattendSetup = FALSE;
1073  break;
1074 
1075  default:
1076  break;
1077  }
1078  }
1079  break;
1080 
1081  default:
1082  break;
1083  }
1084 
1085  return FALSE;
1086 }
1087 
1088 
1089 static VOID
1091 {
1092 #if 0
1093  TCHAR szLayoutPath[256];
1094  TCHAR szLocaleName[32];
1095  DWORD dwLocaleSize;
1096  HKEY hKey;
1097 
1099  _T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
1100  0,
1102  &hKey))
1103  return;
1104 
1105  dwValueSize = 16 * sizeof(TCHAR);
1106  if (RegQueryValueEx(hKey,
1107  NULL,
1108  NULL,
1109  NULL,
1110  szLocaleName,
1111  &dwLocaleSize))
1112  {
1113  RegCloseKey(hKey);
1114  return;
1115  }
1116 
1117  _tcscpy(szLayoutPath,
1118  _T("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"));
1119  _tcscat(szLayoutPath,
1120  szLocaleName);
1121 
1123  szLayoutPath,
1124  0,
1126  &hKey))
1127  return;
1128 
1129  dwValueSize = 32 * sizeof(TCHAR);
1130  if (RegQueryValueEx(hKey,
1131  _T("Layout Text"),
1132  NULL,
1133  NULL,
1134  szLocaleName,
1135  &dwLocaleSize))
1136  {
1137  RegCloseKey(hKey);
1138  return;
1139  }
1140 
1141  RegCloseKey(hKey);
1142 #endif
1143 }
1144 
1145 
1146 static BOOL
1148 {
1149  MSG msg;
1150  STARTUPINFOW StartupInfo;
1151  PROCESS_INFORMATION ProcessInformation;
1152  WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1153 
1154  if (!pwszCPLParameters)
1155  {
1156  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1157  return FALSE;
1158  }
1159 
1160  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1161  StartupInfo.cb = sizeof(StartupInfo);
1162  ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1163 
1164  ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1165  wcscat(CmdLine, pwszCPLParameters);
1166 
1167  if (!CreateProcessW(NULL,
1168  CmdLine,
1169  NULL,
1170  NULL,
1171  FALSE,
1172  0,
1173  NULL,
1174  NULL,
1175  &StartupInfo,
1176  &ProcessInformation))
1177  {
1178  MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1179  return FALSE;
1180  }
1181 
1183  {
1184  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1185  {
1188  }
1189  }
1190  CloseHandle(ProcessInformation.hThread);
1191  CloseHandle(ProcessInformation.hProcess);
1192  return TRUE;
1193 }
1194 
1195 static VOID
1197 {
1198  HKEY hKey;
1199  LCID lcid;
1200  WCHAR Locale[12];
1201 
1202  lcid = GetSystemDefaultLCID();
1203 
1204  if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, ARRAYSIZE(Locale)) != 0)
1205  {
1206  if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
1209  {
1210  RegSetValueExW(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (wcslen(Locale) + 1) * sizeof(WCHAR));
1211  RegCloseKey(hKey);
1212  }
1213  }
1214 }
1215 
1216 static INT_PTR CALLBACK
1218  UINT uMsg,
1219  WPARAM wParam,
1220  LPARAM lParam)
1221 {
1223 
1224  /* Retrieve pointer to the global setup data */
1226 
1227  switch (uMsg)
1228  {
1229  case WM_INITDIALOG:
1230  {
1231  /* Save pointer to the global setup data */
1234  WriteUserLocale();
1235 
1237  }
1238  break;
1239 
1240  case WM_COMMAND:
1241  if (HIWORD(wParam) == BN_CLICKED)
1242  {
1243  switch (LOWORD(wParam))
1244  {
1245  case IDC_CUSTOMLOCALE:
1246  RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1247  /* FIXME: Update input locale name */
1248  break;
1249 
1250  case IDC_CUSTOMLAYOUT:
1251  RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1252  break;
1253  }
1254  }
1255  break;
1256 
1257  case WM_NOTIFY:
1258  {
1259  LPNMHDR lpnm = (LPNMHDR)lParam;
1260 
1261  switch (lpnm->code)
1262  {
1263  case PSN_SETACTIVE:
1264  /* Enable the Back and Next buttons */
1266  if (SetupData->UnattendSetup)
1267  {
1268  // if (!*SetupData->SourcePath)
1269  {
1270  RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1271  }
1272 
1274  return TRUE;
1275  }
1276  break;
1277 
1278  case PSN_WIZNEXT:
1279  break;
1280 
1281  case PSN_WIZBACK:
1283  break;
1284 
1285  default:
1286  break;
1287  }
1288  }
1289  break;
1290 
1291  default:
1292  break;
1293  }
1294 
1295  return FALSE;
1296 }
1297 
1298 
1299 static PTIMEZONE_ENTRY
1301 {
1303 
1305  while (Entry != NULL)
1306  {
1307  if (Entry->Index >= Index)
1308  return Entry;
1309 
1310  Entry = Entry->Next;
1311  }
1312 
1313  return NULL;
1314 }
1315 
1316 static LONG
1318  IN HKEY hZoneKey,
1319  IN PVOID Context)
1320 {
1321  LONG lError;
1324  PTIMEZONE_ENTRY Current;
1325  ULONG DescriptionSize;
1326  ULONG StandardNameSize;
1327  ULONG DaylightNameSize;
1328 
1330  if (Entry == NULL)
1331  {
1332  return ERROR_NOT_ENOUGH_MEMORY;
1333  }
1334 
1335  DescriptionSize = sizeof(Entry->Description);
1336  StandardNameSize = sizeof(Entry->StandardName);
1337  DaylightNameSize = sizeof(Entry->DaylightName);
1338 
1339  lError = QueryTimeZoneData(hZoneKey,
1340  &Entry->Index,
1341  &Entry->TimezoneInfo,
1342  Entry->Description,
1343  &DescriptionSize,
1344  Entry->StandardName,
1345  &StandardNameSize,
1346  Entry->DaylightName,
1347  &DaylightNameSize);
1348  if (lError != ERROR_SUCCESS)
1349  {
1350  HeapFree(GetProcessHeap(), 0, Entry);
1351  return lError;
1352  }
1353 
1354  if (SetupData->TimeZoneListHead == NULL &&
1356  {
1357  Entry->Prev = NULL;
1358  Entry->Next = NULL;
1361  }
1362  else
1363  {
1364  Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1365  if (Current != NULL)
1366  {
1367  if (Current == SetupData->TimeZoneListHead)
1368  {
1369  /* Prepend to head */
1370  Entry->Prev = NULL;
1371  Entry->Next = SetupData->TimeZoneListHead;
1372  SetupData->TimeZoneListHead->Prev = Entry;
1374  }
1375  else
1376  {
1377  /* Insert before current */
1378  Entry->Prev = Current->Prev;
1379  Entry->Next = Current;
1380  Current->Prev->Next = Entry;
1381  Current->Prev = Entry;
1382  }
1383  }
1384  else
1385  {
1386  /* Append to tail */
1387  Entry->Prev = SetupData->TimeZoneListTail;
1388  Entry->Next = NULL;
1391  }
1392  }
1393 
1394  return ERROR_SUCCESS;
1395 }
1396 
1397 static VOID
1399 {
1401 }
1402 
1403 static VOID
1405 {
1407 
1408  while (SetupData->TimeZoneListHead != NULL)
1409  {
1411 
1412  SetupData->TimeZoneListHead = Entry->Next;
1414  {
1415  SetupData->TimeZoneListHead->Prev = NULL;
1416  }
1417 
1418  HeapFree(GetProcessHeap(), 0, Entry);
1419  }
1420 
1422 }
1423 
1424 
1425 static VOID
1427 {
1429  DWORD dwIndex = 0;
1430  DWORD dwCount;
1431 
1432  GetTimeZoneListIndex(&dwEntryIndex);
1433 
1435  while (Entry != NULL)
1436  {
1437  dwCount = SendMessage(hwnd,
1438  CB_ADDSTRING,
1439  0,
1440  (LPARAM)Entry->Description);
1441 
1442  if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1443  dwIndex = dwCount;
1444 
1445  Entry = Entry->Next;
1446  }
1447 
1448  SendMessage(hwnd,
1449  CB_SETCURSEL,
1450  (WPARAM)dwIndex,
1451  0);
1452 }
1453 
1454 
1455 static VOID
1457 {
1458  TIME_ZONE_INFORMATION TimeZoneInformation;
1460  DWORD dwIndex;
1461  DWORD i;
1462 
1463  dwIndex = SendMessage(hwnd,
1464  CB_GETCURSEL,
1465  0,
1466  0);
1467 
1468  i = 0;
1470  while (i < dwIndex)
1471  {
1472  if (Entry == NULL)
1473  return;
1474 
1475  i++;
1476  Entry = Entry->Next;
1477  }
1478 
1479  wcscpy(TimeZoneInformation.StandardName,
1480  Entry->StandardName);
1481  wcscpy(TimeZoneInformation.DaylightName,
1482  Entry->DaylightName);
1483 
1484  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1485  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1486  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1487 
1488  memcpy(&TimeZoneInformation.StandardDate,
1489  &Entry->TimezoneInfo.StandardDate,
1490  sizeof(SYSTEMTIME));
1491  memcpy(&TimeZoneInformation.DaylightDate,
1492  &Entry->TimezoneInfo.DaylightDate,
1493  sizeof(SYSTEMTIME));
1494 
1495  /* Set time zone information */
1496  SetTimeZoneInformation(&TimeZoneInformation);
1497 }
1498 
1499 
1500 static BOOL
1502 {
1503  SYSTEMTIME Date;
1504  SYSTEMTIME Time;
1505 
1507  {
1508  return FALSE;
1509  }
1510 
1512  {
1513  return FALSE;
1514  }
1515 
1516  SetupData->SystemTime.wYear = Date.wYear;
1519  SetupData->SystemTime.wDay = Date.wDay;
1520  SetupData->SystemTime.wHour = Time.wHour;
1521  SetupData->SystemTime.wMinute = Time.wMinute;
1522  SetupData->SystemTime.wSecond = Time.wSecond;
1523  SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1524 
1525  return TRUE;
1526 }
1527 
1528 
1529 static BOOL
1531 {
1532  BOOL Ret = FALSE;
1533 
1534  /*
1535  * Call SetLocalTime twice to ensure correct results
1536  */
1537  Ret = SetLocalTime(&SetupData->SystemTime) &&
1539 
1540  return Ret;
1541 }
1542 
1543 
1544 static VOID
1546 {
1549 }
1550 
1551 
1552 static BOOL
1554 {
1555  WCHAR Title[64];
1556  WCHAR ErrorLocalTime[256];
1557 
1558  GetLocalSystemTime(hwndDlg, SetupData);
1560  SetupData);
1561 
1563  BM_GETCHECK, 0, 0) != BST_UNCHECKED);
1564  if (!SetSystemLocalTime(hwndDlg, SetupData))
1565  {
1567  {
1568  wcscpy(Title, L"ReactOS Setup");
1569  }
1570  if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
1571  ARRAYSIZE(ErrorLocalTime)))
1572  {
1573  wcscpy(ErrorLocalTime, L"Setup was unable to set the local time.");
1574  }
1575  MessageBoxW(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
1576  return FALSE;
1577  }
1578 
1579  return TRUE;
1580 }
1581 
1582 
1583 static INT_PTR CALLBACK
1585  UINT uMsg,
1586  WPARAM wParam,
1587  LPARAM lParam)
1588 {
1590 
1591  /* Retrieve pointer to the global setup data */
1593 
1594  switch (uMsg)
1595  {
1596  case WM_INITDIALOG:
1597  {
1598  /* Save pointer to the global setup data */
1601 
1603 
1604  if (SetupData->UnattendSetup)
1605  {
1608 
1610  {
1612  }
1613  }
1614  else
1615  {
1617  SetupData, -1);
1618 
1620  }
1621  break;
1622  }
1623 
1624  case WM_TIMER:
1625  {
1626  SYSTEMTIME LocalTime;
1627 
1628  GetLocalTime(&LocalTime);
1629  UpdateLocalSystemTime(hwndDlg, LocalTime);
1630 
1631  // Reset timeout.
1632  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1633  break;
1634  }
1635 
1636  case WM_NOTIFY:
1637  switch (((LPNMHDR)lParam)->code)
1638  {
1639  case PSN_SETACTIVE:
1640  {
1641  SYSTEMTIME LocalTime;
1642 
1643  GetLocalTime(&LocalTime);
1644  UpdateLocalSystemTime(hwndDlg, LocalTime);
1645 
1646  /* Enable the Back and Next buttons */
1648 
1650  {
1652  return TRUE;
1653  }
1654 
1655  SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1656  break;
1657  }
1658 
1659  case PSN_KILLACTIVE:
1660  case DTN_DATETIMECHANGE:
1661  // NB: Not re-set until changing page (PSN_SETACTIVE).
1662  KillTimer(hwndDlg, 1);
1663  break;
1664 
1665  case PSN_WIZNEXT:
1666  WriteDateTimeSettings(hwndDlg, SetupData);
1667  break;
1668 
1669  case PSN_WIZBACK:
1671  break;
1672 
1673  default:
1674  break;
1675  }
1676  break;
1677 
1678  case WM_DESTROY:
1680  break;
1681 
1682  default:
1683  break;
1684  }
1685 
1686  return FALSE;
1687 }
1688 
1689 static struct ThemeInfo
1690 {
1694 
1695 } Themes[] = {
1697  { MAKEINTRESOURCE(IDB_LAUTUS), IDS_LAUTUS, L"themes\\lautus\\lautus.msstyles" },
1698  { MAKEINTRESOURCE(IDB_LUNAR), IDS_LUNAR, L"themes\\lunar\\lunar.msstyles" },
1699  { MAKEINTRESOURCE(IDB_MIZU), IDS_MIZU, L"themes\\mizu\\mizu.msstyles"},
1700 };
1701 
1702 static INT_PTR CALLBACK
1704  UINT uMsg,
1705  WPARAM wParam,
1706  LPARAM lParam)
1707 {
1709  LPNMLISTVIEW pnmv;
1710 
1711  /* Retrieve pointer to the global setup data */
1713 
1714  switch (uMsg)
1715  {
1716  case WM_INITDIALOG:
1717  {
1718  HWND hListView;
1719  HIMAGELIST himl;
1720  DWORD n;
1721  LVITEM lvi = {0};
1722 
1723  /* Save pointer to the global setup data */
1726 
1727  hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1728 
1729  /* Common */
1731  lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1732 
1733  for (n = 0; n < ARRAYSIZE(Themes); ++n)
1734  {
1735  WCHAR DisplayName[100] = {0};
1736  /* Load the bitmap */
1738  ImageList_AddMasked(himl, image, RGB(255,0,255));
1739 
1740  /* Load the string */
1741  LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
1742  DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
1743 
1744  /* Add the listview item */
1745  lvi.iItem = n;
1746  lvi.iImage = n;
1747  lvi.pszText = DisplayName;
1748  ListView_InsertItem(hListView, &lvi);
1749  }
1750 
1751  /* Register the imagelist */
1753  /* Transparant background */
1754  ListView_SetBkColor(hListView, CLR_NONE);
1755  ListView_SetTextBkColor(hListView, CLR_NONE);
1756  /* Reduce the size between the items */
1757  ListView_SetIconSpacing(hListView, 190, 173);
1758  break;
1759  }
1760  case WM_NOTIFY:
1761  switch (((LPNMHDR)lParam)->code)
1762  {
1763  //case LVN_ITEMCHANGING:
1764  case LVN_ITEMCHANGED:
1765  pnmv = (LPNMLISTVIEW)lParam;
1766  if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
1767  {
1768  int iTheme = pnmv->iItem;
1769  DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
1770 
1771  if (Themes[iTheme].ThemeFile)
1772  {
1773  WCHAR wszParams[1024];
1774  WCHAR wszTheme[MAX_PATH];
1775  WCHAR* format = L"desk.cpl desk,@Appearance /Action:ActivateMSTheme /file:\"%s\"";
1776 
1777  SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
1778  swprintf(wszParams, format, wszTheme);
1779  RunControlPanelApplet(hwndDlg, wszParams);
1780  }
1781  else
1782  {
1783  RunControlPanelApplet(hwndDlg, L"desk.cpl desk,@Appearance /Action:ActivateMSTheme");
1784  }
1785  }
1786  break;
1787  case PSN_SETACTIVE:
1788  /* Enable the Back and Next buttons */
1790  if (SetupData->UnattendSetup)
1791  {
1793  return TRUE;
1794  }
1795  break;
1796 
1797  case PSN_WIZNEXT:
1798  break;
1799 
1800  case PSN_WIZBACK:
1802  break;
1803 
1804  default:
1805  break;
1806  }
1807  break;
1808 
1809  default:
1810  break;
1811  }
1812 
1813  return FALSE;
1814 }
1815 
1816 static UINT CALLBACK
1819  UINT_PTR Param1,
1820  UINT_PTR Param2)
1821 {
1822  PREGISTRATIONDATA RegistrationData;
1823  REGISTRATIONNOTIFY RegistrationNotify;
1824  PSP_REGISTER_CONTROL_STATUSW StatusInfo;
1825  UINT MessageID;
1826  WCHAR ErrorMessage[128];
1827 
1828  RegistrationData = (PREGISTRATIONDATA) Context;
1829 
1832  {
1833  StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
1834  RegistrationNotify.CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
1835  if (NULL == RegistrationNotify.CurrentItem)
1836  {
1837  RegistrationNotify.CurrentItem = StatusInfo->FileName;
1838  }
1839  else
1840  {
1841  RegistrationNotify.CurrentItem++;
1842  }
1843 
1845  {
1846  DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
1847  StatusInfo->FileName);
1848  RegistrationNotify.ErrorMessage = NULL;
1849  RegistrationNotify.Progress = RegistrationData->Registered;
1850  }
1851  else
1852  {
1853  DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
1854  StatusInfo->FileName);
1855  DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
1856  StatusInfo->FailureCode);
1857  if (SPREG_SUCCESS != StatusInfo->FailureCode)
1858  {
1859  switch(StatusInfo->FailureCode)
1860  {
1861  case SPREG_LOADLIBRARY:
1863  break;
1864  case SPREG_GETPROCADDR:
1866  break;
1867  case SPREG_REGSVR:
1869  break;
1870  case SPREG_DLLINSTALL:
1872  break;
1873  case SPREG_TIMEOUT:
1875  break;
1876  default:
1878  break;
1879  }
1881  ErrorMessage,
1883  {
1884  ErrorMessage[0] = L'\0';
1885  }
1886  if (SPREG_TIMEOUT != StatusInfo->FailureCode)
1887  {
1889  StatusInfo->Win32Error, 0,
1892  NULL);
1893  }
1894  RegistrationNotify.ErrorMessage = ErrorMessage;
1895  }
1896  else
1897  {
1898  RegistrationNotify.ErrorMessage = NULL;
1899  }
1900  if (RegistrationData->Registered < RegistrationData->DllCount)
1901  {
1902  RegistrationData->Registered++;
1903  }
1904  }
1905 
1906  RegistrationNotify.Progress = RegistrationData->Registered;
1907  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1908  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1909  0, (LPARAM) &RegistrationNotify);
1910 
1911  return FILEOP_DOIT;
1912  }
1913  else
1914  {
1915  DPRINT1("Received unexpected notification %u\n", Notification);
1916  return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
1917  Notification, Param1, Param2);
1918  }
1919 }
1920 
1921 
1922 static DWORD CALLBACK
1924 {
1925  PREGISTRATIONDATA RegistrationData;
1926  REGISTRATIONNOTIFY RegistrationNotify;
1927  DWORD LastError = NO_ERROR;
1928  WCHAR UnknownError[84];
1929 
1930  RegistrationData = (PREGISTRATIONDATA) Parameter;
1931  RegistrationData->Registered = 0;
1932  RegistrationData->DefaultContext = SetupInitDefaultQueueCallback(RegistrationData->hwndDlg);
1933 
1934  _SEH2_TRY
1935  {
1936  if (!SetupInstallFromInfSectionW(GetParent(RegistrationData->hwndDlg),
1937  hSysSetupInf,
1938  L"RegistrationPhase2",
1939  SPINST_REGISTRY |
1940  SPINST_REGISTERCALLBACKAWARE |
1941  SPINST_REGSVR,
1942  0,
1943  NULL,
1944  0,
1946  RegistrationData,
1947  NULL,
1948  NULL))
1949  {
1950  LastError = GetLastError();
1951  }
1952  }
1954  {
1955  DPRINT("Catching exception\n");
1957  }
1958  _SEH2_END;
1959 
1960  if (NO_ERROR == LastError)
1961  {
1962  RegistrationNotify.ErrorMessage = NULL;
1963  }
1964  else
1965  {
1966  DPRINT1("SetupInstallFromInfSection failed with error %u\n",
1967  LastError);
1969  FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, 0,
1970  (LPWSTR) &RegistrationNotify.ErrorMessage, 0,
1971  NULL))
1972  {
1974  UnknownError,
1975  ARRAYSIZE(UnknownError) - 20))
1976  {
1977  wcscpy(UnknownError, L"Unknown error");
1978  }
1979  wcscat(UnknownError, L" ");
1980  _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
1981  RegistrationNotify.ErrorMessage = UnknownError;
1982  }
1983  }
1984 
1985  RegistrationNotify.Progress = RegistrationData->DllCount;
1986  RegistrationNotify.ActivityID = IDS_REGISTERING_COMPONENTS;
1987  RegistrationNotify.CurrentItem = NULL;
1988  SendMessage(RegistrationData->hwndDlg, PM_REGISTRATION_NOTIFY,
1989  1, (LPARAM) &RegistrationNotify);
1990  if (NULL != RegistrationNotify.ErrorMessage &&
1991  UnknownError != RegistrationNotify.ErrorMessage)
1992  {
1993  LocalFree((PVOID) RegistrationNotify.ErrorMessage);
1994  }
1995 
1996  SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
1997  HeapFree(GetProcessHeap(), 0, RegistrationData);
1998 
1999  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
2000 
2001  // FIXME: Move this call to a separate cleanup page!
2003 
2004  return 0;
2005 }
2006 
2007 
2008 static BOOL
2010 {
2011  HANDLE RegistrationThread;
2012  LONG DllCount;
2014  WCHAR SectionName[512];
2015  PREGISTRATIONDATA RegistrationData;
2016 
2017  DllCount = -1;
2018  if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2019  L"RegisterDlls", &Context))
2020  {
2021  DPRINT1("No RegistrationPhase2 section found\n");
2022  return FALSE;
2023  }
2024  if (!SetupGetStringFieldW(&Context, 1, SectionName,
2025  ARRAYSIZE(SectionName),
2026  NULL))
2027  {
2028  DPRINT1("Unable to retrieve section name\n");
2029  return FALSE;
2030  }
2031  DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2032  DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2033  if (DllCount < 0)
2034  {
2036  return FALSE;
2037  }
2038 
2039  *MaxProgress = (ULONG) DllCount;
2040 
2041  /*
2042  * Create a background thread to do the actual registrations, so the
2043  * main thread can just run its message loop.
2044  */
2045  RegistrationThread = NULL;
2046  RegistrationData = HeapAlloc(GetProcessHeap(), 0,
2047  sizeof(REGISTRATIONDATA));
2048  if (RegistrationData != NULL)
2049  {
2050  RegistrationData->hwndDlg = hwndDlg;
2051  RegistrationData->DllCount = DllCount;
2052  RegistrationThread = CreateThread(NULL, 0, RegistrationProc,
2053  RegistrationData, 0, NULL);
2054  if (RegistrationThread != NULL)
2055  {
2056  CloseHandle(RegistrationThread);
2057  }
2058  else
2059  {
2060  DPRINT1("CreateThread failed, error %u\n", GetLastError());
2061  HeapFree(GetProcessHeap(), 0, RegistrationData);
2062  return FALSE;
2063  }
2064  }
2065  else
2066  {
2067  DPRINT1("HeapAlloc() failed, error %u\n", GetLastError());
2068  return FALSE;
2069  }
2070 
2071  return TRUE;
2072 }
2073 
2074 
2075 static INT_PTR CALLBACK
2077  UINT uMsg,
2078  WPARAM wParam,
2079  LPARAM lParam)
2080 {
2082  PREGISTRATIONNOTIFY RegistrationNotify;
2083  static UINT oldActivityID = -1;
2084  WCHAR Title[64];
2085 
2086  /* Retrieve pointer to the global setup data */
2088 
2089  switch (uMsg)
2090  {
2091  case WM_INITDIALOG:
2092  {
2093  /* Save pointer to the global setup data */
2096  }
2097  break;
2098 
2099  case WM_NOTIFY:
2100  {
2101  LPNMHDR lpnm = (LPNMHDR)lParam;
2102  ULONG MaxProgress = 0;
2103 
2104  switch (lpnm->code)
2105  {
2106  case PSN_SETACTIVE:
2107  /* Disable the Back and Next buttons */
2108  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
2109 
2110  StartComponentRegistration(hwndDlg, &MaxProgress);
2111 
2113  0, MAKELPARAM(0, MaxProgress));
2115  0, 0);
2116  break;
2117 
2118  case PSN_WIZNEXT:
2119  break;
2120 
2121  case PSN_WIZBACK:
2123  break;
2124 
2125  default:
2126  break;
2127  }
2128  }
2129  break;
2130 
2132  {
2133  WCHAR Activity[64];
2134  RegistrationNotify = (PREGISTRATIONNOTIFY) lParam;
2135  // update if necessary only
2136  if (oldActivityID != RegistrationNotify->ActivityID)
2137  {
2138  if (0 != LoadStringW(hDllInstance, RegistrationNotify->ActivityID,
2139  Activity,
2140  ARRAYSIZE(Activity)))
2141  {
2143  0, (LPARAM) Activity);
2144  }
2145  oldActivityID = RegistrationNotify->ActivityID;
2146  }
2148  (LPARAM)(NULL == RegistrationNotify->CurrentItem ?
2149  L"" : RegistrationNotify->CurrentItem));
2151  RegistrationNotify->Progress, 0);
2152  if (NULL != RegistrationNotify->ErrorMessage)
2153  {
2155  Title, ARRAYSIZE(Title)))
2156  {
2157  wcscpy(Title, L"ReactOS Setup");
2158  }
2159  MessageBoxW(hwndDlg, RegistrationNotify->ErrorMessage,
2160  Title, MB_ICONERROR | MB_OK);
2161 
2162  }
2163 
2164  if (wParam)
2165  {
2166  /* Enable the Back and Next buttons */
2169  }
2170  }
2171  return TRUE;
2172 
2173  default:
2174  break;
2175  }
2176 
2177  return FALSE;
2178 }
2179 
2180 
2181 static VOID
2183 {
2184  HKEY hKey = 0;
2185  DWORD InProgress = 0;
2186  DWORD InstallDate;
2187 
2189  L"SYSTEM\\Setup",
2190  0,
2191  KEY_WRITE,
2192  &hKey ) == ERROR_SUCCESS)
2193  {
2194  RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2195  RegCloseKey( hKey );
2196  }
2197 
2199  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2200  0,
2201  KEY_WRITE,
2202  &hKey ) == ERROR_SUCCESS)
2203  {
2204  InstallDate = (DWORD)time(NULL);
2205  RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2206  RegCloseKey( hKey );
2207  }
2208 }
2209 
2210 static INT_PTR CALLBACK
2212  UINT uMsg,
2213  WPARAM wParam,
2214  LPARAM lParam)
2215 {
2216 
2217  switch (uMsg)
2218  {
2219  case WM_INITDIALOG:
2220  {
2221  /* Get pointer to the global setup data */
2223 
2225  {
2226  /* Run the Wine Gecko prompt */
2227  Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl install_gecko", SW_SHOW);
2228  }
2229 
2230  /* Set title font */
2231  SendDlgItemMessage(hwndDlg,
2233  WM_SETFONT,
2235  (LPARAM)TRUE);
2236  if (SetupData->UnattendSetup)
2237  {
2238  KillTimer(hwndDlg, 1);
2240  PostQuitMessage(0);
2241  }
2242  }
2243  break;
2244 
2245  case WM_DESTROY:
2246  {
2248  PostQuitMessage(0);
2249  return TRUE;
2250  }
2251 
2252  case WM_TIMER:
2253  {
2254  INT Position;
2255  HWND hWndProgress;
2256 
2257  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2258  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2259  if (Position == 300)
2260  {
2261  KillTimer(hwndDlg, 1);
2263  }
2264  else
2265  {
2266  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2267  }
2268  }
2269  return TRUE;
2270 
2271  case WM_NOTIFY:
2272  {
2273  LPNMHDR lpnm = (LPNMHDR)lParam;
2274 
2275  switch (lpnm->code)
2276  {
2277  case PSN_SETACTIVE:
2278  /* Enable the correct buttons on for the active page */
2280 
2282  MAKELPARAM(0, 300));
2284  SetTimer(hwndDlg, 1, 50, NULL);
2285  break;
2286 
2287  case PSN_WIZFINISH:
2288  DestroyWindow(GetParent(hwndDlg));
2289  break;
2290 
2291  default:
2292  break;
2293  }
2294  }
2295  break;
2296 
2297  default:
2298  break;
2299  }
2300 
2301  return FALSE;
2302 }
2303 
2304 
2305 /*
2306  * GetInstallSourceWin32 retrieves the path to the ReactOS installation medium
2307  * in Win32 format, for later use by syssetup and storage in the registry.
2308  */
2309 static BOOL
2311  OUT PWSTR pwszPath,
2312  IN DWORD cchPathMax,
2313  IN PCWSTR pwszNTPath)
2314 {
2315  WCHAR wszDrives[512];
2316  WCHAR wszNTPath[512]; // MAX_PATH ?
2317  DWORD cchDrives;
2318  PWCHAR pwszDrive;
2319 
2320  *pwszPath = UNICODE_NULL;
2321 
2322  cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2323  if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2324  {
2325  /* Buffer too small or failure */
2326  LogItem(NULL, L"GetLogicalDriveStringsW failed");
2327  return FALSE;
2328  }
2329 
2330  for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2331  {
2332  WCHAR wszBuf[MAX_PATH];
2333 
2334  /* Retrieve the NT path corresponding to the current Win32 DOS path */
2335  pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2336  QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2337  pwszDrive[2] = L'\\'; // Restore the backslash
2338 
2339  wcscat(wszNTPath, L"\\"); // Concat a backslash
2340 
2341  /* Logging */
2342  wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2343  pwszDrive, wszNTPath,
2344  (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2345  LogItem(NULL, wszBuf);
2346 
2347  /* Check whether the NT path corresponds to the NT installation source path */
2348  if (!_wcsicmp(wszNTPath, pwszNTPath))
2349  {
2350  /* Found it! */
2351  wcscpy(pwszPath, pwszDrive); // cchPathMax
2352 
2353  /* Logging */
2354  wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2355  LogItem(NULL, wszBuf);
2356  wcscat(wszBuf, L"\n");
2357  OutputDebugStringW(wszBuf);
2358 
2359  return TRUE;
2360  }
2361  }
2362 
2363  return FALSE;
2364 }
2365 
2366 VOID
2368  IN OUT PSETUPDATA pSetupData)
2369 {
2370  INFCONTEXT InfContext;
2371  WCHAR szName[256];
2372  WCHAR szValue[MAX_PATH];
2373  DWORD LineLength;
2374  HKEY hKey;
2375 
2376  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2377  L"Unattend",
2378  L"UnattendSetupEnabled",
2379  &InfContext))
2380  {
2381  DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2382  return;
2383  }
2384 
2385  if (!SetupGetStringFieldW(&InfContext,
2386  1,
2387  szValue,
2388  ARRAYSIZE(szValue),
2389  &LineLength))
2390  {
2391  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2392  return;
2393  }
2394 
2395  if (_wcsicmp(szValue, L"yes") != 0)
2396  {
2397  DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2398  return;
2399  }
2400 
2401  pSetupData->UnattendSetup = TRUE;
2402 
2403  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2404  L"Unattend",
2405  NULL,
2406  &InfContext))
2407  {
2408  DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2409  return;
2410  }
2411 
2412  do
2413  {
2414  if (!SetupGetStringFieldW(&InfContext,
2415  0,
2416  szName,
2417  ARRAYSIZE(szName),
2418  &LineLength))
2419  {
2420  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2421  return;
2422  }
2423 
2424  if (!SetupGetStringFieldW(&InfContext,
2425  1,
2426  szValue,
2427  ARRAYSIZE(szValue),
2428  &LineLength))
2429  {
2430  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2431  return;
2432  }
2433  DPRINT1("Name %S Value %S\n", szName, szValue);
2434  if (!_wcsicmp(szName, L"FullName"))
2435  {
2436  if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2437  {
2438  wcscpy(pSetupData->OwnerName, szValue);
2439  }
2440  }
2441  else if (!_wcsicmp(szName, L"OrgName"))
2442  {
2443  if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2444  {
2445  wcscpy(pSetupData->OwnerOrganization, szValue);
2446  }
2447  }
2448  else if (!_wcsicmp(szName, L"ComputerName"))
2449  {
2450  if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2451  {
2452  wcscpy(pSetupData->ComputerName, szValue);
2453  }
2454  }
2455  else if (!_wcsicmp(szName, L"AdminPassword"))
2456  {
2457  if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2458  {
2459  wcscpy(pSetupData->AdminPassword, szValue);
2460  }
2461  }
2462  else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2463  {
2464  pSetupData->TimeZoneIndex = _wtoi(szValue);
2465  }
2466  else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2467  {
2468  pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2469  }
2470  else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2471  {
2472  if (!_wcsicmp(szValue, L"yes"))
2473  pSetupData->DisableGeckoInst = TRUE;
2474  else
2475  pSetupData->DisableGeckoInst = FALSE;
2476  }
2477  else if (!_wcsicmp(szName, L"ProductOption"))
2478  {
2479  pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2480  }
2481  } while (SetupFindNextLine(&InfContext, &InfContext));
2482 
2483  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2484  L"Display",
2485  NULL,
2486  &InfContext))
2487  {
2488  DEVMODEW dm = { { 0 } };
2489  dm.dmSize = sizeof(dm);
2491  {
2492  do
2493  {
2494  int iValue;
2495  if (!SetupGetStringFieldW(&InfContext,
2496  0,
2497  szName,
2498  ARRAYSIZE(szName),
2499  &LineLength))
2500  {
2501  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2502  return;
2503  }
2504 
2505  if (!SetupGetStringFieldW(&InfContext,
2506  1,
2507  szValue,
2508  ARRAYSIZE(szValue),
2509  &LineLength))
2510  {
2511  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2512  return;
2513  }
2514  iValue = _wtoi(szValue);
2515  DPRINT1("Name %S Value %i\n", szName, iValue);
2516 
2517  if (!iValue)
2518  continue;
2519 
2520  if (!_wcsicmp(szName, L"BitsPerPel"))
2521  {
2522  dm.dmFields |= DM_BITSPERPEL;
2523  dm.dmBitsPerPel = iValue;
2524  }
2525  else if (!_wcsicmp(szName, L"XResolution"))
2526  {
2527  dm.dmFields |= DM_PELSWIDTH;
2528  dm.dmPelsWidth = iValue;
2529  }
2530  else if (!_wcsicmp(szName, L"YResolution"))
2531  {
2532  dm.dmFields |= DM_PELSHEIGHT;
2533  dm.dmPelsHeight = iValue;
2534  }
2535  else if (!_wcsicmp(szName, L"VRefresh"))
2536  {
2538  dm.dmDisplayFrequency = iValue;
2539  }
2540  } while (SetupFindNextLine(&InfContext, &InfContext));
2541 
2543  }
2544  }
2545 
2547  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2548  0,
2549  KEY_SET_VALUE,
2550  &hKey) != ERROR_SUCCESS)
2551  {
2552  DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2553  return;
2554  }
2555 
2556  if (SetupFindFirstLineW(pSetupData->hSetupInf,
2557  L"GuiRunOnce",
2558  NULL,
2559  &InfContext))
2560  {
2561  int i = 0;
2562  do
2563  {
2564  if (SetupGetStringFieldW(&InfContext,
2565  0,
2566  szValue,
2567  ARRAYSIZE(szValue),
2568  NULL))
2569  {
2571  swprintf(szName, L"%d", i);
2572  DPRINT("szName %S szValue %S\n", szName, szValue);
2573 
2574  if (ExpandEnvironmentStringsW(szValue, szPath, MAX_PATH))
2575  {
2576  DPRINT("value %S\n", szPath);
2577  if (RegSetValueExW(hKey,
2578  szName,
2579  0,
2580  REG_SZ,
2581  (const BYTE*)szPath,
2582  (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2583  {
2584  i++;
2585  }
2586  }
2587  }
2588  } while (SetupFindNextLine(&InfContext, &InfContext));
2589  }
2590 
2591  RegCloseKey(hKey);
2592 }
2593 
2594 VOID
2596  IN OUT PSETUPDATA pSetupData)
2597 {
2599  WCHAR szValue[MAX_PATH];
2600  INFCONTEXT InfContext;
2601  DWORD LineLength;
2602  HKEY hKey;
2603  LONG res;
2604 
2605  pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
2606 
2607  /* Retrieve the path of the setup INF */
2609  wcscat(szPath, L"\\$winnt$.inf");
2610 
2611  /* Open the setup INF */
2612  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2613  NULL,
2615  NULL);
2616  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2617  {
2618  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2619  return;
2620  }
2621 
2622 
2623  /* Retrieve the NT source path from which the 1st-stage installer was run */
2624  if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2625  L"data",
2626  L"sourcepath",
2627  &InfContext))
2628  {
2629  DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
2630  return;
2631  }
2632 
2633  if (!SetupGetStringFieldW(&InfContext,
2634  1,
2635  szValue,
2636  ARRAYSIZE(szValue),
2637  &LineLength))
2638  {
2639  DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2640  return;
2641  }
2642 
2643  *pSetupData->SourcePath = UNICODE_NULL;
2644 
2645  /* Close the setup INF as we are going to modify it manually */
2646  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2647  SetupCloseInfFile(pSetupData->hSetupInf);
2648 
2649 
2650  /* Find the installation source path in Win32 format */
2651  if (!GetInstallSourceWin32(pSetupData->SourcePath,
2652  _countof(pSetupData->SourcePath),
2653  szValue))
2654  {
2655  *pSetupData->SourcePath = UNICODE_NULL;
2656  }
2657 
2658  /* Save the path in Win32 format in the setup INF */
2659  swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
2660  WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
2661 
2662  /*
2663  * Save it also in the registry, in the following keys:
2664  * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
2665  * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
2666  * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
2667  * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
2668  */
2669 #if 0
2671  L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2672  0,
2674  &hKey);
2675 
2676  if (res != ERROR_SUCCESS)
2677  {
2678  return FALSE;
2679  }
2680 #endif
2681 
2683  L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
2684  0, NULL,
2686  KEY_ALL_ACCESS, // KEY_WRITE
2687  NULL,
2688  &hKey,
2689  NULL);
2690  if (res == ERROR_SUCCESS)
2691  {
2693  L"SourcePath",
2694  0,
2695  REG_SZ,
2696  (LPBYTE)pSetupData->SourcePath,
2697  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2698 
2700  L"ServicePackSourcePath",
2701  0,
2702  REG_SZ,
2703  (LPBYTE)pSetupData->SourcePath,
2704  (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
2705 
2706  RegCloseKey(hKey);
2707  }
2708 
2709 
2710  /* Now, re-open the setup INF (this must succeed) */
2711  pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
2712  NULL,
2714  NULL);
2715  if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
2716  {
2717  DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
2718  return;
2719  }
2720 
2721  /* Process the unattended section of the setup file */
2722  ProcessUnattendSection(pSetupData);
2723 }
2724 
2726 
2727 VOID
2729 {
2730  PROPSHEETHEADER psh = {0};
2731  HPROPSHEETPAGE *phpage = NULL;
2732  PROPSHEETPAGE psp = {0};
2733  UINT nPages = 0;
2734  HWND hWnd;
2735  MSG msg;
2736  PSETUPDATA pSetupData = NULL;
2737  HMODULE hNetShell = NULL;
2739  DWORD dwPageCount = 10, dwNetworkPageCount = 0;
2740 
2741  LogItem(L"BEGIN_SECTION", L"InstallWizard");
2742 
2743  /* Allocate setup data */
2744  pSetupData = HeapAlloc(GetProcessHeap(),
2746  sizeof(SETUPDATA));
2747  if (pSetupData == NULL)
2748  {
2749  LogItem(NULL, L"SetupData allocation failed!");
2750  MessageBoxW(NULL,
2751  L"Setup failed to allocate global data!",
2752  L"ReactOS Setup",
2753  MB_ICONERROR | MB_OK);
2754  goto done;
2755  }
2756  pSetupData->ProductOption = PRODUCT_OPTION_DEFAULT;
2757 
2758  hNetShell = LoadLibraryW(L"netshell.dll");
2759  if (hNetShell != NULL)
2760  {
2761  DPRINT("Netshell.dll loaded!\n");
2762 
2763  pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
2764  "NetSetupRequestWizardPages");
2765  if (pfn != NULL)
2766  {
2767  pfn(&dwNetworkPageCount, NULL, NULL);
2768  dwPageCount += dwNetworkPageCount;
2769  }
2770  }
2771 
2772  DPRINT("PageCount: %lu\n", dwPageCount);
2773 
2774  phpage = HeapAlloc(GetProcessHeap(),
2776  dwPageCount * sizeof(HPROPSHEETPAGE));
2777  if (phpage == NULL)
2778  {
2779  LogItem(NULL, L"Page array allocation failed!");
2780  MessageBoxW(NULL,
2781  L"Setup failed to allocate page array!",
2782  L"ReactOS Setup",
2783  MB_ICONERROR | MB_OK);
2784  goto done;
2785  }
2786 
2787  /* Process the $winnt$.inf setup file */
2788  ProcessSetupInf(pSetupData);
2789 
2790  /* Create the Welcome page */
2791  psp.dwSize = sizeof(PROPSHEETPAGE);
2792  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2793  psp.hInstance = hDllInstance;
2794  psp.lParam = (LPARAM)pSetupData;
2795  psp.pfnDlgProc = WelcomeDlgProc;
2796  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
2797  phpage[nPages++] = CreatePropertySheetPage(&psp);
2798 
2799  /* Create the Acknowledgements page */
2800  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2801  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
2802  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
2803  psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
2804  psp.pfnDlgProc = AckPageDlgProc;
2805  phpage[nPages++] = CreatePropertySheetPage(&psp);
2806 
2807  /* Create the Product page */
2808  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2809  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
2810  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
2811  psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
2812  psp.pfnDlgProc = ProductPageDlgProc;
2813  phpage[nPages++] = CreatePropertySheetPage(&psp);
2814 
2815  /* Create the Locale page */
2816  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2817  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
2818  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
2819  psp.pfnDlgProc = LocalePageDlgProc;
2820  psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
2821  phpage[nPages++] = CreatePropertySheetPage(&psp);
2822 
2823  /* Create the Owner page */
2824  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2825  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
2826  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
2827  psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
2828  psp.pfnDlgProc = OwnerPageDlgProc;
2829  phpage[nPages++] = CreatePropertySheetPage(&psp);
2830 
2831  /* Create the Computer page */
2832  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2833  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
2834  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
2835  psp.pfnDlgProc = ComputerPageDlgProc;
2836  psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
2837  phpage[nPages++] = CreatePropertySheetPage(&psp);
2838 
2839  /* Create the DateTime page */
2840  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2841  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
2842  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
2843  psp.pfnDlgProc = DateTimePageDlgProc;
2844  psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
2845  phpage[nPages++] = CreatePropertySheetPage(&psp);
2846 
2847  /* Create the theme selection page */
2848  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2849  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
2850  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
2851  psp.pfnDlgProc = ThemePageDlgProc;
2852  psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
2853  phpage[nPages++] = CreatePropertySheetPage(&psp);
2854 
2857 
2858  if (pfn)
2859  {
2860  pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
2861  nPages += dwNetworkPageCount;
2862  }
2863 
2864  /* Create the Process page */
2865  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2866  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
2867  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
2868  psp.pfnDlgProc = ProcessPageDlgProc;
2869  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
2870  phpage[nPages++] = CreatePropertySheetPage(&psp);
2871 
2872  /* Create the Finish page */
2873  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2874  psp.pfnDlgProc = FinishDlgProc;
2875  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
2876  phpage[nPages++] = CreatePropertySheetPage(&psp);
2877 
2878  ASSERT(nPages == dwPageCount);
2879 
2880  /* Create the property sheet */
2881  psh.dwSize = sizeof(PROPSHEETHEADER);
2882  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
2883  psh.hInstance = hDllInstance;
2884  psh.hwndParent = NULL;
2885  psh.nPages = nPages;
2886  psh.nStartPage = 0;
2887  psh.phpage = phpage;
2888  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
2889  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
2890 
2891  /* Create title font */
2892  pSetupData->hTitleFont = CreateTitleFont();
2893  pSetupData->hBoldFont = CreateBoldFont();
2894 
2895  /* Display the wizard */
2896  hWnd = (HWND)PropertySheet(&psh);
2898 
2899  while (GetMessage(&msg, NULL, 0, 0))
2900  {
2901  if (!IsDialogMessage(hWnd, &msg))
2902  {
2904  DispatchMessage(&msg);
2905  }
2906  }
2907 
2908  DeleteObject(pSetupData->hBoldFont);
2909  DeleteObject(pSetupData->hTitleFont);
2910 
2911  if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
2912  SetupCloseInfFile(pSetupData->hSetupInf);
2913 
2914 done:
2915  if (phpage != NULL)
2916  HeapFree(GetProcessHeap(), 0, phpage);
2917 
2918  if (hNetShell != NULL)
2919  FreeLibrary(hNetShell);
2920 
2921  if (pSetupData != NULL)
2922  HeapFree(GetProcessHeap(), 0, pSetupData);
2923 
2924  LogItem(L"END_SECTION", L"InstallWizard");
2925 }
2926 
2927 /* EOF */
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1609
#define EM_LIMITTEXT
Definition: winuser.h:1983
#define RegQueryValueEx
Definition: winreg.h:524
#define IDB_LUNAR
Definition: resource.h:25
signed char * PCHAR
Definition: retypes.h:7
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
UINT DisplayName
Definition: wizard.c:1692
static BOOL GetLocalSystemTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1501
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2310
#define IDC_OWNERNAME
Definition: resource.h:46
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:433
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1196
#define IDC_ITEM
Definition: resource.h:56
#define STM_SETICON
Definition: winuser.h:2075
#define MAKEINTRESOURCE
Definition: winuser.h:591
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2076
#define MAKELCID(lgid, srtid)
#define DispatchMessage
Definition: winuser.h:5741
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)
struct _REGISTRATIONDATA REGISTRATIONDATA
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
LPCWSTR PreviewBitmap
Definition: wizard.c:1691
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define IDOK
Definition: winuser.h:824
#define IDS_OWNERSUBTITLE
Definition: resource.h:104
#define CloseHandle
Definition: compat.h:598
#define IDC_PROJECTS
Definition: resource.h:42
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDD_PRODUCT
Definition: resource.h:95
#define IDS_PROCESSTITLE
Definition: resource.h:84
REG_TZI_FORMAT TimezoneInfo
Definition: timezone.c:22
static INT_PTR CALLBACK WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:204
#define ERROR_SUCCESS
Definition: deptool.c:10
ULONG DllCount
Definition: wizard.c:46
UINT uNewState
Definition: commctrl.h:3036
#define IDS_MIZU
Definition: resource.h:156
BOOL WINAPI SetComputerNameW(LPCWSTR lpComputerName)
Definition: compname.c:616
#define error(str)
Definition: mkdosfs.c:1605
struct _Entry Entry
Definition: kefuncs.h:627
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define SPINST_REGSVR
Definition: setupapi.h:594
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define IDS_ACKSUBTITLE
Definition: resource.h:101
DWORD dmFields
Definition: wingdi.h:1622
#define RGB(r, g, b)
Definition: precomp.h:62
#define IDD_COMPUTERPAGE
Definition: resource.h:49
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:93
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:906
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:126
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:570
VOID InstallWizard(VOID)
Definition: wizard.c:2728
WORD wMonth
Definition: winbase.h:900
HDC WINAPI GetDC(_In_opt_ HWND)
struct _PRODUCT_OPTION_DATA PRODUCT_OPTION_DATA
Definition: ftp_var.h:139
#define IDD_GPL
Definition: resource.h:78
#define TRUE
Definition: types.h:120
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:876
#define SW_HIDE
Definition: winuser.h:762
#define IDC_TIMEZONELIST
Definition: resource.h:16
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint16_t * PWSTR
Definition: typedefs.h:56
#define IDC_GPL_TEXT
Definition: resource.h:79
#define IDS_REACTOS_SETUP
Definition: resource.h:124
WORD wDayOfWeek
Definition: winbase.h:901
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static VOID ErrorMessage(DWORD dwErrorCode, LPWSTR szFormat,...)
Definition: attrib.c:51
static COORD Position
Definition: mouse.c:34
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1300
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1217
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:133
#define MAKELPARAM(l, h)
Definition: winuser.h:3984
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:288
LONG lfHeight
Definition: dimm.idl:59
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:163
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:854
#define IDS_TIMEOUT
Definition: resource.h:14
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:119
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
Definition: timezone.c:15
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:408
HWND hWnd
Definition: settings.c:17
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2595
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:924
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define IDC_VIEWGPL
Definition: resource.h:43
void __cdecl srand(_In_ unsigned int _Seed)
GLdouble n
Definition: glext.h:7729
LONG top
Definition: windef.h:307
#define PSWIZB_NEXT
Definition: prsht.h:154
HANDLE HWND
Definition: compat.h:19
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1703
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:447
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ZeroMemory
Definition: winbase.h:1664
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
#define HWND_TOP
Definition: winuser.h:1193
#define PBM_SETPOS
Definition: commctrl.h:2184
HWND WINAPI SetFocus(_In_opt_ HWND)
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define SPREG_GETPROCADDR
Definition: setupapi.h:654
#define IDS_DATETIMESUBTITLE
Definition: resource.h:113
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:162
#define PSBTN_FINISH
Definition: prsht.h:148
#define SendDlgItemMessage
Definition: winuser.h:5818
#define LOCALE_ILANGUAGE
Definition: winnls.h:25
uint16_t * PWCHAR
Definition: typedefs.h:56
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2408
__u16 time
Definition: mkdosfs.c:366
ULONG Registered
Definition: wizard.c:47
LONG left
Definition: windef.h:306
#define swprintf
Definition: precomp.h:40
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
DWORD dmBitsPerPel
Definition: wingdi.h:1647
_In_ PVOID Parameter
Definition: ldrtypes.h:241
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
int32_t INT_PTR
Definition: typedefs.h:64
#define PSH_MODELESS
Definition: prsht.h:50
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define IsDialogMessage
Definition: winuser.h:5785
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LONG right
Definition: windef.h:308
#define NO_ERROR
Definition: dderror.h:5
#define IDB_HEADER
Definition: resource.h:30
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:139
#define lstrlenW
Definition: compat.h:609
HIMAGELIST himl
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PSN_SETACTIVE
Definition: prsht.h:115
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
struct _TIMEZONE_ENTRY * PTIMEZONE_ENTRY
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:137
#define IDD_OWNERPAGE
Definition: resource.h:45
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINF hSetupInf
Definition: syssetup.h:56
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1398
#define SetWindowLongPtr
Definition: treelist.c:70
#define CB_GETCURSEL
Definition: winuser.h:1926
#define IDD_PROCESSPAGE
Definition: resource.h:54
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
enum _PRODUCT_OPTION PRODUCT_OPTION
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define IDC_TIMEPICKER
Definition: resource.h:11
HFONT hFont
Definition: main.c:53
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1317
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
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
#define MB_ICONWARNING
Definition: winuser.h:780
_SEH2_TRY
Definition: create.c:4226
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
LPCWSTR ThemeFile
Definition: wizard.c:1693
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define ILC_COLOR32
Definition: commctrl.h:358
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:2725
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define LVIF_TEXT
Definition: commctrl.h:2309
#define IDS_REGISTERING_COMPONENTS
Definition: resource.h:125
#define IDC_PROCESSPROGRESS
Definition: resource.h:57
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
UINT code
Definition: winuser.h:3135
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:118
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define IDS_COMPUTERTITLE
Definition: resource.h:106
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define DialogBox
Definition: winuser.h:5737
#define IDS_DATETIMETITLE
Definition: resource.h:112
LPCWSTR ProductType
Definition: wizard.c:402
struct _REGISTRATIONNOTIFY REGISTRATIONNOTIFY
#define IDS_ACKTITLE
Definition: resource.h:100
WORD wYear
Definition: winbase.h:899
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
static const WCHAR CmdLine[]
Definition: install.c:48
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:1817
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned char * LPBYTE
Definition: typedefs.h:53
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define DRIVE_CDROM
Definition: machpc98.h:115
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
#define PSN_WIZFINISH
Definition: prsht.h:122
static const WCHAR szText[]
Definition: dialog.c:139
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SetupDefaultQueueCallback
Definition: setupapi.h:2572
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:159
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1147
unsigned int BOOL
Definition: ntddk_ex.h:94
PVOID DefaultContext
Definition: wizard.c:48
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1553
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
#define REG_MULTI_SZ
Definition: nt_native.h:1501
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PM_REGISTRATION_NOTIFY
Definition: wizard.c:28
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1584
VOID EnumerateTimeZoneList(IN PENUM_TIMEZONE_CALLBACK Callback, IN PVOID Context OPTIONAL)
Definition: tzlib.c:223
#define IDC_CUSTOMLOCALE
Definition: resource.h:56
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static const WCHAR s_szRosVersion[]
Definition: wizard.c:395
#define SPREG_REGSVR
Definition: setupapi.h:655
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define DateTime_SetSystemtime(hdp, gd, pst)
Definition: commctrl.h:4332
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1404
#define GWLP_USERDATA
Definition: treelist.c:63
#define CB_ADDSTRING
Definition: winuser.h:1919
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
WORD wMinute
Definition: winbase.h:904
#define SPINST_REGISTRY
Definition: setupapi.h:590
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:129
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define LoadLibraryW(x)
Definition: compat.h:606
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define LVIS_SELECTED
Definition: commctrl.h:2319
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define PROPSHEETHEADER
Definition: prsht.h:392
#define ListView_SetBkColor(hwnd, clrBk)
Definition: commctrl.h:2294
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:787
#define IDC_PRODUCT_ICON
Definition: resource.h:96
#define BM_GETCHECK
Definition: winuser.h:1901
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
#define IDB_LAUTUS
Definition: resource.h:24
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1545
#define CLR_NONE
Definition: commctrl.h:319
#define IDC_RESTART_PROGRESS
Definition: resource.h:61
#define SW_SHOW
Definition: winuser.h:769
#define IDC_THEMEPICKER
Definition: resource.h:76
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define ListView_SetIconSpacing(hwndLV, cx, cy)
Definition: commctrl.h:2723
#define IDC_ADMINPASSWORD2
Definition: resource.h:52
WCHAR DaylightName[33]
Definition: timezone.c:21
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:114
#define WM_SETTEXT
Definition: winuser.h:1600
BOOL DisableGeckoInst
Definition: syssetup.h:47
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static struct ThemeInfo Themes[]
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
#define WM_DESTROY
Definition: winuser.h:1592
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4594
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
#define IDS_ADMINISTRATOR_NAME
Definition: resource.h:132
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:520
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
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define IDC_OWNERORGANIZATION
Definition: resource.h:47
char TCHAR
Definition: xmlstorage.h:189
static BOOL StartComponentRegistration(HWND hwndDlg, PULONG MaxProgress)
Definition: wizard.c:2009
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:127
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define PSP_DEFAULT
Definition: prsht.h:22
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:97
#define IDD_ACKPAGE
Definition: resource.h:41
#define BM_SETCHECK
Definition: winuser.h:1904
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:679
#define FILEOP_DOIT
Definition: fileqsup.h:48
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:607
#define WAIT_OBJECT_0
Definition: winbase.h:403
#define IDS_LUNAR
Definition: resource.h:155
#define GetDlgItemText
Definition: winuser.h:5761
static const WCHAR Title[]
Definition: oid.c:1259
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORD cb
Definition: winbase.h:846
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define ASSERT(a)
Definition: mode.c:44
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
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:415
#define SORT_DEFAULT
_In_ WDFCOLLECTION _In_ ULONG Index
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _countof(array)
Definition: sndvol32.h:68
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2182
#define WM_TIMER
Definition: winuser.h:1725
static DWORD CALLBACK RegistrationProc(LPVOID Parameter)
Definition: wizard.c:1923
#define IDB_CLASSIC
Definition: resource.h:23
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:873
#define WM_CLOSE
Definition: winuser.h:1604
WORD dmSize
Definition: wingdi.h:1620
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define EM_SETSEL
Definition: winuser.h:2001
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define IDI_WINLOGO
Definition: winuser.h:704
#define IDS_WZD_NAME
Definition: resource.h:135
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
#define BN_CLICKED
Definition: winuser.h:1908
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
BOOL Error
Definition: chkdsk.c:66
#define SetLastError(x)
Definition: compat.h:611
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
SETUPDATA SetupData
Definition: reactos.c:41
#define IDS_ACKPROJECTS
Definition: resource.h:121
DWORD dmPelsWidth
Definition: wingdi.h:1648
WORD wSecond
Definition: winbase.h:905
WORD wMilliseconds
Definition: winbase.h:906
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
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
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
ULONG Index
Definition: wizard.c:59
#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 ListView_SetTextBkColor(hwnd, clrTextBk)
Definition: commctrl.h:2663
HDC hdc
Definition: main.c:9
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define IDS_REASON_UNKNOWN
Definition: resource.h:131
#define DWLP_USER
Definition: winuser.h:866
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
#define MB_ICONERROR
Definition: winuser.h:781
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
#define IDD_FINISHPAGE
Definition: resource.h:34
#define ILC_MASK
Definition: commctrl.h:351
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4330
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IDS_UNKNOWN_ERROR
Definition: resource.h:124
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:788
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1704
SYSTEMTIME StandardDate
Definition: winbase.h:1190
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:135
#define LVSIL_NORMAL
Definition: commctrl.h:2298
#define CB_SETCURSEL
Definition: winuser.h:1944
#define WM_COMMAND
Definition: winuser.h:1723
#define wcsrchr
Definition: compat.h:16
static INT_PTR CALLBACK FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2211
Definition: inflate.c:139
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
#define IDC_ADMINPASSWORD1
Definition: resource.h:51
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define BST_UNCHECKED
Definition: winuser.h:199
#define PSBTN_NEXT
Definition: prsht.h:147
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:113
unsigned char BYTE
Definition: xxhash.c:193
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
#define IDS_PRODUCTTITLE
Definition: resource.h:158
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDS_WZD_SETCOMPUTERNAME
Definition: resource.h:136
#define IDC_WELCOMETITLE
Definition: resource.h:16
#define IDR_GPL
Definition: resource.h:166
#define SWP_NOSIZE
Definition: winuser.h:1231
#define IDS_LAUTUS
Definition: resource.h:154
#define GWL_STYLE
Definition: winuser.h:846
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
WORD wDay
Definition: winbase.h:902
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
DWORD TimeZoneIndex
Definition: syssetup.h:52
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND WINAPI GetParent(_In_ HWND)
static VOID CenterWindow(HWND hWnd)
Definition: wizard.c:69
#define RegOpenKeyEx
Definition: winreg.h:520
#define CSIDL_RESOURCES
Definition: shlobj.h:2064
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:571
static const WCHAR s_szControlWindows[]
Definition: wizard.c:396
_SEH2_END
Definition: create.c:4400
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDB_MIZU
Definition: resource.h:26
DWORD ReportAsWorkstation
Definition: wizard.c:403
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:543
HFONT hBoldFont
Definition: syssetup.h:37
#define FW_BOLD
Definition: wingdi.h:378
struct _TIMEZONE_ENTRY * Next
Definition: timezone.c:18
WCHAR DaylightName[32]
Definition: winbase.h:1192
#define GDT_VALID
Definition: commctrl.h:4460
WCHAR StandardName[33]
Definition: timezone.c:20
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 IDC_DATEPICKER
Definition: resource.h:61
struct tagNMLISTVIEW * LPNMLISTVIEW
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
HICON hIcon
Definition: msconfig.c:44
FxAutoRegKey hKey
LPCWSTR szPath
Definition: env.c:37
#define IDS_OWNERTITLE
Definition: resource.h:103
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1677
#define QS_ALLINPUT
Definition: winuser.h:874
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
#define LR_CREATEDIBSECTION
Definition: winuser.h:1088
WORD wHour
Definition: winbase.h:903
WCHAR Description[128]
Definition: timezone.c:19
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
struct _REGISTRATIONDATA * PREGISTRATIONDATA
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2367
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1090
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_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 IDC_PRODUCT_DESCRIPTION
Definition: resource.h:98
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
#define MB_OK
Definition: winuser.h:784
#define IMAGE_BITMAP
Definition: winuser.h:211
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define GetMessage
Definition: winuser.h:5766
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define CBN_SELCHANGE
Definition: winuser.h:1962
SYSTEMTIME SystemTime
Definition: syssetup.h:49
DWORD * PDWORD
Definition: pedump.c:68
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IDC_CUSTOMLAYOUT
Definition: resource.h:58
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:107
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1633
WCHAR OwnerName[51]
Definition: syssetup.h:42
#define IDS_CLASSIC
Definition: resource.h:153
#define DPRINT1
Definition: precomp.h:8
#define PSN_WIZBACK
Definition: prsht.h:120
DWORD dmPelsHeight
Definition: wingdi.h:1649
#define isprint(c)
Definition: acclib.h:73
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
static const WCHAR szName[]
Definition: msipriv.h:1194
struct tagContext Context
Definition: acpixf.h:1034
#define SendMessage
Definition: winuser.h:5819
_TCHAR * _tcscat(_TCHAR *s, const _TCHAR *append)
Definition: tcscat.h:8
#define OUT
Definition: typedefs.h:40
#define PropertySheet
Definition: prsht.h:400
GLuint res
Definition: glext.h:9613
#define LVITEM
Definition: commctrl.h:2375
static const WCHAR s_szWinlogon[]
Definition: wizard.c:397
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define HIWORD(l)
Definition: typedefs.h:247
#define SPREG_DLLINSTALL
Definition: setupapi.h:656
unsigned int ULONG
Definition: retypes.h:1
BOOL UnattendSetup
Definition: syssetup.h:46
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1426
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:309
#define GetProcAddress(x, y)
Definition: compat.h:612
#define LOGPIXELSY
Definition: wingdi.h:719
#define DM_BITSPERPEL
Definition: wingdi.h:1268
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)
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:563
LPCWSTR ErrorMessage
Definition: wizard.c:40
static BOOL SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1530
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define LoadIcon
Definition: winuser.h:5789
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define GetWindowLongPtr
Definition: treelist.c:73
LONG lfWeight
Definition: dimm.idl:63
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
HFONT hTitleFont
Definition: reactos.h:117
#define DPRINT
Definition: sndvol32.h:71
#define IDS_WZD_LOCALTIME
Definition: resource.h:141
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define LVIF_STATE
Definition: commctrl.h:2312
#define SPREG_TIMEOUT
Definition: setupapi.h:657
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define IDS_LOCALESUBTITLE
Definition: resource.h:110
#define wsprintf
Definition: winuser.h:5841
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:138
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2512
#define INFINITE
Definition: serial.h:102
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:161
#define IDC_ACTIVITY
Definition: resource.h:55
#define IDS_REGSVR_FAILED
Definition: resource.h:128
#define SPREG_LOADLIBRARY
Definition: setupapi.h:653
#define IDS_LOCALETITLE
Definition: resource.h:109
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356
HINF hSysSetupInf
Definition: install.c:37
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:140
#define WS_SYSMENU
Definition: pedump.c:629
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4366
#define REG_DWORD
Definition: sdbapi.c:596
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:637
#define IDS_DEFAULT
Definition: resource.h:164
NTSTATUS WINAPI SetAccountsDomainSid(PSID DomainSid, LPCWSTR DomainName)
Definition: security.c:28
#define WM_INITDIALOG
Definition: winuser.h:1722
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SPREG_SUCCESS
Definition: setupapi.h:652
struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
#define HeapFree(x, y, z)
Definition: compat.h:594
BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer)
Definition: compname.c:648
WCHAR StandardName[32]
Definition: winbase.h:1189
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define RegSetValueEx
Definition: winreg.h:533
#define IDC_LAYOUTTEXT
Definition: resource.h:57
#define PBM_GETPOS
Definition: commctrl.h:2194
static PLARGE_INTEGER Time
Definition: time.c:105
base of all file and directory entries
Definition: entries.h:82
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define PROPSHEETPAGE
Definition: prsht.h:389
static VOID SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1456
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:160
#define WM_NOTIFY
Definition: richedit.h:61
SYSTEMTIME DaylightDate
Definition: winbase.h:1193
LPCWSTR ProductSuite
Definition: wizard.c:401
static const WCHAR s_szProductOptions[]
Definition: wizard.c:394
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
#define IDD_THEMEPAGE
Definition: resource.h:75
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
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
struct _SETUPDATA * PSETUPDATA
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1494
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98
#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