ReactOS 0.4.16-dev-2206-gc56950d
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 * Oleg Dubinskiy <oleg.dubinskij30@gmail.com>
11 */
12
13/* INCLUDES *****************************************************************/
14
15#include "precomp.h"
16
17#include <stdlib.h>
18#include <time.h>
19#include <winnls.h>
20#include <windowsx.h>
21#include <wincon.h>
22#include <shlobj.h>
23#include <shlwapi.h>
24#include <tzlib.h>
25#include <strsafe.h>
26
27#define NDEBUG
28#include <debug.h>
29
30typedef struct _REGISTRATIONDATA
31{
38
39typedef struct _TIMEZONE_ENTRY
40{
41 struct _TIMEZONE_ENTRY *Prev;
42 struct _TIMEZONE_ENTRY *Next;
43 WCHAR Description[128]; /* 'Display' */
44 WCHAR StandardName[32]; /* 'Std' */
45 WCHAR DaylightName[32]; /* 'Dlt' */
46 REG_TZI_FORMAT TimezoneInfo; /* 'TZI' */
49
50
51/* FUNCTIONS ****************************************************************/
52
54
55static VOID
57{
59 RECT rcParent;
60 RECT rcWindow;
61
63 if (hWndParent == NULL)
65
66 GetWindowRect(hWndParent, &rcParent);
67 GetWindowRect(hWnd, &rcWindow);
68
71 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
72 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
73 0,
74 0,
76}
77
78
79static HFONT
81{
82 LOGFONTW LogFont = {0};
83 HDC hdc;
85
86 LogFont.lfWeight = FW_BOLD;
87 wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
88
89 hdc = GetDC(NULL);
90 LogFont.lfHeight = -MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
91
92 hFont = CreateFontIndirectW(&LogFont);
93
95
96 return hFont;
97}
98
99
100static HFONT
102{
103 LOGFONTW tmpFont = {0};
104 HFONT hBoldFont;
105 HDC hDc;
106
107 /* Grabs the Drawing Context */
108 hDc = GetDC(NULL);
109
110 tmpFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
111 tmpFont.lfWeight = FW_BOLD;
112 wcscpy(tmpFont.lfFaceName, L"MS Shell Dlg");
113
114 hBoldFont = CreateFontIndirectW(&tmpFont);
115
116 ReleaseDC(NULL, hDc);
117
118 return hBoldFont;
119}
120
121static INT_PTR CALLBACK
123 UINT uMsg,
126{
127 HRSRC GplTextResource;
128 HGLOBAL GplTextMem;
129 PVOID GplTextLocked;
130 PCHAR GplText;
131 DWORD Size;
132
133
134 switch (uMsg)
135 {
136 case WM_INITDIALOG:
137 GplTextResource = FindResourceW(hDllInstance, MAKEINTRESOURCE(IDR_GPL), L"RT_TEXT");
138 if (NULL == GplTextResource)
139 {
140 break;
141 }
142 Size = SizeofResource(hDllInstance, GplTextResource);
143 if (0 == Size)
144 {
145 break;
146 }
147 GplText = HeapAlloc(GetProcessHeap(), 0, Size + 1);
148 if (NULL == GplText)
149 {
150 break;
151 }
152 GplTextMem = LoadResource(hDllInstance, GplTextResource);
153 if (NULL == GplTextMem)
154 {
155 HeapFree(GetProcessHeap(), 0, GplText);
156 break;
157 }
158 GplTextLocked = LockResource(GplTextMem);
159 if (NULL == GplTextLocked)
160 {
161 HeapFree(GetProcessHeap(), 0, GplText);
162 break;
163 }
164 memcpy(GplText, GplTextLocked, Size);
165 GplText[Size] = '\0';
166 SendMessageA(GetDlgItem(hwndDlg, IDC_GPL_TEXT), WM_SETTEXT, 0, (LPARAM) GplText);
167 HeapFree(GetProcessHeap(), 0, GplText);
168 SetFocus(GetDlgItem(hwndDlg, IDOK));
169 return FALSE;
170
171 case WM_CLOSE:
172 EndDialog(hwndDlg, IDCANCEL);
173 break;
174
175 case WM_COMMAND:
176 if (HIWORD(wParam) == BN_CLICKED && IDOK == LOWORD(wParam))
177 {
178 EndDialog(hwndDlg, IDOK);
179 }
180 break;
181
182 default:
183 break;
184 }
185
186 return FALSE;
187}
188
189
190static INT_PTR CALLBACK
192 UINT uMsg,
195{
196 PSETUPDATA pSetupData;
197
198 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
199
200 switch (uMsg)
201 {
202 case WM_INITDIALOG:
203 {
204 HWND hwndControl;
205 DWORD dwStyle;
206
207 /* Get pointer to the global setup data */
208 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
209 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
210
211 hwndControl = GetParent(hwndDlg);
212
213 /* Center the wizard window */
214 CenterWindow (hwndControl);
215
216 /* Hide the system menu */
217 dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
218 SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
219
220 /* Hide and disable the 'Cancel' button */
221 hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
222 ShowWindow (hwndControl, SW_HIDE);
223 EnableWindow (hwndControl, FALSE);
224
225 /* Set title font */
226 SendDlgItemMessage(hwndDlg,
229 (WPARAM)pSetupData->hTitleFont,
230 (LPARAM)TRUE);
231 }
232 break;
233
234
235 case WM_NOTIFY:
236 {
237 LPNMHDR lpnm = (LPNMHDR)lParam;
238
239 switch (lpnm->code)
240 {
241 case PSN_SETACTIVE:
242 LogItem(L"BEGIN", L"WelcomePage");
243 /* Enable the Next button */
245 if (pSetupData->UnattendSetup)
246 {
248 return TRUE;
249 }
250 break;
251
252 case PSN_WIZNEXT:
253 LogItem(L"END", L"WelcomePage");
254 break;
255
256 case PSN_WIZBACK:
257 pSetupData->UnattendSetup = FALSE;
258 break;
259
260 default:
261 break;
262 }
263 }
264 break;
265
266 default:
267 break;
268 }
269
270 return FALSE;
271}
272
273
274static INT_PTR CALLBACK
276 UINT uMsg,
279{
280 LPNMHDR lpnm;
281 PWCHAR Projects;
282 PWCHAR End, CurrentProject;
283 INT ProjectsSize, ProjectsCount;
284 PSETUPDATA pSetupData;
285
286 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
287
288 switch (uMsg)
289 {
290 case WM_INITDIALOG:
291 {
292 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
293 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
294
295 Projects = NULL;
296 ProjectsSize = 256;
297 while (TRUE)
298 {
299 Projects = HeapAlloc(GetProcessHeap(), 0, ProjectsSize * sizeof(WCHAR));
300 if (NULL == Projects)
301 {
302 return FALSE;
303 }
304 ProjectsCount = LoadStringW(hDllInstance, IDS_ACKPROJECTS, Projects, ProjectsSize);
305 if (0 == ProjectsCount)
306 {
307 HeapFree(GetProcessHeap(), 0, Projects);
308 return FALSE;
309 }
310 if (ProjectsCount < ProjectsSize - 1)
311 {
312 break;
313 }
314 HeapFree(GetProcessHeap(), 0, Projects);
315 ProjectsSize *= 2;
316 }
317
318 CurrentProject = Projects;
319 while (*CurrentProject != L'\0')
320 {
321 End = wcschr(CurrentProject, L'\n');
322 if (NULL != End)
323 {
324 *End = L'\0';
325 }
326 (void)ListBox_AddString(GetDlgItem(hwndDlg, IDC_PROJECTS), CurrentProject);
327 if (NULL != End)
328 {
329 CurrentProject = End + 1;
330 }
331 else
332 {
333 CurrentProject += wcslen(CurrentProject);
334 }
335 }
336 HeapFree(GetProcessHeap(), 0, Projects);
337 }
338 break;
339
340 case WM_COMMAND:
342 {
345 }
346 break;
347
348 case WM_NOTIFY:
349 {
350 lpnm = (LPNMHDR)lParam;
351
352 switch (lpnm->code)
353 {
354 case PSN_SETACTIVE:
355 /* Enable the Back and Next buttons */
357 if (pSetupData->UnattendSetup)
358 {
360 return TRUE;
361 }
362 break;
363
364 case PSN_WIZBACK:
365 pSetupData->UnattendSetup = FALSE;
366 break;
367
368 default:
369 break;
370 }
371 }
372 break;
373
374 default:
375 break;
376 }
377
378 return FALSE;
379}
380
381static const WCHAR s_szProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
382static const WCHAR s_szRosVersion[] = L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version";
383static const WCHAR s_szControlWindows[] = L"SYSTEM\\CurrentControlSet\\Control\\Windows";
384static const WCHAR s_szWinlogon[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon";
385static const WCHAR s_szDefaultSoundEvents[] = L"AppEvents\\Schemes\\Apps\\.Default";
386static const WCHAR s_szExplorerSoundEvents[] = L"AppEvents\\Schemes\\Apps\\Explorer";
387
389{
396
398{
399 { L"Terminal Server\0", L"ServerNT", 0, 0x200, 0 },
400 { L"\0", L"WinNT", 1, 0x300, 1 }
401};
402
403static const WCHAR* s_DefaultSoundEvents[][2] =
404{
405 { L".Default", L"%SystemRoot%\\Media\\ReactOS_Default.wav" },
406 { L"AppGPFault", L"" },
407 { L"Close", L"" },
408 { L"CriticalBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Critical.wav" },
409 { L"DeviceConnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Insert.wav" },
410 { L"DeviceDisconnect", L"%SystemRoot%\\Media\\ReactOS_Hardware_Remove.wav" },
411 { L"DeviceFail", L"%SystemRoot%\\Media\\ReactOS_Hardware_Fail.wav" },
412 { L"LowBatteryAlarm", L"%SystemRoot%\\Media\\ReactOS_Battery_Low.wav" },
413 { L"MailBeep", L"%SystemRoot%\\Media\\ReactOS_Notify.wav" },
414 { L"Maximize", L"%SystemRoot%\\Media\\ReactOS_Restore.wav" },
415 { L"MenuCommand", L"%SystemRoot%\\Media\\ReactOS_Menu_Command.wav" },
416 { L"MenuPopup", L"" },
417 { L"Minimize", L"%SystemRoot%\\Media\\ReactOS_Minimize.wav" },
418 { L"Open", L"" },
419 { L"PrintComplete", L"%SystemRoot%\\Media\\ReactOS_Print_Complete.wav" },
420 { L"RestoreDown", L"" },
421 { L"RestoreUp", L"" },
422 { L"SystemAsterisk", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
423 { L"SystemExclamation", L"%SystemRoot%\\Media\\ReactOS_Exclamation.wav" },
424 { L"SystemExit", L"%SystemRoot%\\Media\\ReactOS_Shutdown.wav" },
425 { L"SystemHand", L"%SystemRoot%\\Media\\ReactOS_Critical_Stop.wav" },
426 { L"SystemNotification", L"%SystemRoot%\\Media\\ReactOS_Balloon.wav" },
427 { L"SystemQuestion", L"%SystemRoot%\\Media\\ReactOS_Ding.wav" },
428 { L"SystemStart", L"%SystemRoot%\\Media\\ReactOS_Startup.wav" },
429 { L"WindowsLogoff", L"%SystemRoot%\\Media\\ReactOS_LogOff.wav" }
430/* Logon sound is already set by default for both Server and Workstation */
431};
432
433static const WCHAR* s_ExplorerSoundEvents[][2] =
434{
435 { L"EmptyRecycleBin", L"%SystemRoot%\\Media\\ReactOS_Recycle.wav" },
436 { L"Navigating", L"%SystemRoot%\\Media\\ReactOS_Start.wav" }
437};
438
439static BOOL
441 LPCWSTR lpSubkey,
442 LPCWSTR lpEventsArray[][2],
444{
445 HKEY hRootKey, hEventKey, hDefaultKey;
446 LONG error;
447 ULONG i;
448 WCHAR szDest[MAX_PATH];
449 DWORD dwAttribs;
451
452 /* Open the sound events key */
453 error = RegOpenKeyExW(hKey, lpSubkey, 0, KEY_READ, &hRootKey);
454 if (error)
455 {
456 DPRINT1("RegOpenKeyExW failed\n");
457 goto Error;
458 }
459
460 /* Set each sound event */
461 for (i = 0; i < dwSize; i++)
462 {
463 /*
464 * Verify that the sound file exists and is an actual file.
465 */
466
467 /* Expand the sound file path */
468 if (!ExpandEnvironmentStringsW(lpEventsArray[i][1], szDest, _countof(szDest)))
469 {
470 /* Failed to expand, continue with the next sound event */
471 continue;
472 }
473
474 /* Check if the sound file exists and isn't a directory */
475 dwAttribs = GetFileAttributesW(szDest);
476 if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
477 (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
478 {
479 /* It does not, just continue with the next sound event */
480 continue;
481 }
482
483 /*
484 * Create the sound event entry.
485 */
486
487 /* Open the sound event subkey */
488 error = RegOpenKeyExW(hRootKey, lpEventsArray[i][0], 0, KEY_READ, &hEventKey);
489 if (error)
490 {
491 /* Failed to open, continue with next sound event */
492 continue;
493 }
494
495 /* Open .Default subkey */
496 error = RegOpenKeyExW(hEventKey, L".Default", 0, KEY_WRITE, &hDefaultKey);
497 RegCloseKey(hEventKey);
498 if (error)
499 {
500 /* Failed to open, continue with next sound event */
501 continue;
502 }
503
504 /* Associate the sound file to this sound event */
505 cbData = (lstrlenW(lpEventsArray[i][1]) + 1) * sizeof(WCHAR);
506 error = RegSetValueExW(hDefaultKey, NULL, 0, REG_EXPAND_SZ, (const BYTE *)lpEventsArray[i][1], cbData);
507 RegCloseKey(hDefaultKey);
508 if (error)
509 {
510 /* Failed to set the value, continue with next sound event */
511 continue;
512 }
513 }
514
515Error:
516 if (hRootKey)
517 RegCloseKey(hRootKey);
518
519 return error == ERROR_SUCCESS;
520}
521
522static BOOL
524{
525 HKEY hKey;
526 LONG error;
527 LPCWSTR pszData;
528 DWORD dwValue, cbData;
530 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
531
532 /* open ProductOptions key */
534 if (error)
535 {
536 DPRINT1("RegOpenKeyExW failed\n");
537 goto Error;
538 }
539
540 /* write ProductSuite */
541 pszData = pData->ProductSuite;
542 cbData = (lstrlenW(pszData) + 2) * sizeof(WCHAR);
543 error = RegSetValueExW(hKey, L"ProductSuite", 0, REG_MULTI_SZ, (const BYTE *)pszData, cbData);
544 if (error)
545 {
546 DPRINT1("RegSetValueExW failed\n");
547 goto Error;
548 }
549
550 /* write ProductType */
551 pszData = pData->ProductType;
552 cbData = (lstrlenW(pszData) + 1) * sizeof(WCHAR);
553 error = RegSetValueExW(hKey, L"ProductType", 0, REG_SZ, (const BYTE *)pszData, cbData);
554 if (error)
555 {
556 DPRINT1("RegSetValueExW failed\n");
557 goto Error;
558 }
559
561
562 /* open ReactOS version key */
564 if (error)
565 {
566 DPRINT1("RegOpenKeyExW failed\n");
567 goto Error;
568 }
569
570 /* write ReportAsWorkstation */
571 dwValue = pData->ReportAsWorkstation;
572 cbData = sizeof(dwValue);
573 error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
574 if (error)
575 {
576 DPRINT1("RegSetValueExW failed\n");
577 goto Error;
578 }
579
581
582 /* open Control Windows key */
584 if (error)
585 {
586 DPRINT1("RegOpenKeyExW failed\n");
587 goto Error;
588 }
589
590 /* write Control Windows CSDVersion */
591 dwValue = pData->CSDVersion;
592 cbData = sizeof(dwValue);
593 error = RegSetValueExW(hKey, L"CSDVersion", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
594 if (error)
595 {
596 DPRINT1("RegSetValueExW failed\n");
597 goto Error;
598 }
599
601
602 /* open Winlogon key */
604 if (error)
605 {
606 DPRINT1("RegOpenKeyExW failed\n");
607 goto Error;
608 }
609
610 /* write LogonType */
611 dwValue = pData->LogonType;
612 cbData = sizeof(dwValue);
613 error = RegSetValueExW(hKey, L"LogonType", 0, REG_DWORD, (const BYTE *)&dwValue, cbData);
614 if (error)
615 {
616 DPRINT1("RegSetValueExW failed\n");
617 goto Error;
618 }
619
620 if (nOption == PRODUCT_OPTION_WORKSTATION)
621 {
622 /* Write system sound events values for Workstation */
625 }
626
627Error:
628 if (hKey)
630
631 return error == ERROR_SUCCESS;
632}
633
634static void
636{
637 WCHAR szText[256];
638 ASSERT(0 <= nOption && nOption < _countof(s_ProductOptionData));
639
640 switch (nOption)
641 {
644 break;
645
648 break;
649
650 default:
651 return;
652 }
653
655}
656
657static INT_PTR CALLBACK
659{
660 LPNMHDR lpnm;
661 PSETUPDATA pSetupData;
662 INT iItem;
663 WCHAR szText[64], szDefault[64];
664 HICON hIcon;
665
666 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
667
668 switch (uMsg)
669 {
670 case WM_INITDIALOG:
671 {
672 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
673 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
674
675 LoadStringW(hDllInstance, IDS_DEFAULT, szDefault, _countof(szDefault));
676
679 {
680 StringCchCatW(szText, _countof(szText), L" ");
681 StringCchCatW(szText, _countof(szText), szDefault);
682 }
684
687 {
688 StringCchCatW(szText, _countof(szText), L" ");
689 StringCchCatW(szText, _countof(szText), szDefault);
690 }
692
695
698 return TRUE;
699 }
700
701 case WM_COMMAND:
703 {
705 OnChooseOption(hwndDlg, (PRODUCT_OPTION)iItem);
706 }
707 break;
708
709 case WM_NOTIFY:
710 {
711 lpnm = (LPNMHDR)lParam;
712
713 switch (lpnm->code)
714 {
715 case PSN_SETACTIVE:
716 /* Enable the Back and Next buttons */
718 if (pSetupData->UnattendSetup)
719 {
720 OnChooseOption(hwndDlg, pSetupData->ProductOption);
723 return TRUE;
724 }
725 break;
726
727 case PSN_WIZNEXT:
729 pSetupData->ProductOption = (PRODUCT_OPTION)iItem;
731 break;
732
733 case PSN_WIZBACK:
734 pSetupData->UnattendSetup = FALSE;
735 break;
736
737 default:
738 break;
739 }
740 }
741 break;
742
743 default:
744 break;
745 }
746
747 return FALSE;
748}
749
750static
751BOOL
753 WCHAR * OwnerOrganization)
754{
755 HKEY hKey;
756 LONG res;
757
759 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
760 0,
762 &hKey);
763
764 if (res != ERROR_SUCCESS)
765 {
766 return FALSE;
767 }
768
770 L"RegisteredOwner",
771 0,
772 REG_SZ,
773 (LPBYTE)OwnerName,
774 (wcslen(OwnerName) + 1) * sizeof(WCHAR));
775
776 if (res != ERROR_SUCCESS)
777 {
779 return FALSE;
780 }
781
783 L"RegisteredOrganization",
784 0,
785 REG_SZ,
786 (LPBYTE)OwnerOrganization,
787 (wcslen(OwnerOrganization) + 1) * sizeof(WCHAR));
788
790 return (res == ERROR_SUCCESS);
791}
792
793static INT_PTR CALLBACK
795 UINT uMsg,
798{
799 WCHAR OwnerName[51];
800 WCHAR OwnerOrganization[51];
801 WCHAR Title[64];
802 WCHAR ErrorName[256];
803 LPNMHDR lpnm;
804 PSETUPDATA pSetupData;
805
806 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
807
808 switch (uMsg)
809 {
810 case WM_INITDIALOG:
811 {
812 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
813 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
814
815 /* set a localized ('Owner') placeholder string as default */
816 if (LoadStringW(hDllInstance, IDS_MACHINE_OWNER_NAME, OwnerName, _countof(OwnerName)))
817 {
818 SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, WM_SETTEXT, 0, (LPARAM)OwnerName);
819 }
820
823
824 /* Set focus to owner name */
826
827 /* Select the default text to quickly overwrite it by typing */
829 }
830 break;
831
832
833 case WM_NOTIFY:
834 {
835 lpnm = (LPNMHDR)lParam;
836
837 switch (lpnm->code)
838 {
839 case PSN_SETACTIVE:
840 /* Enable the Back and Next buttons */
842 if (pSetupData->UnattendSetup)
843 {
844 SendMessage(GetDlgItem(hwndDlg, IDC_OWNERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->OwnerName);
846 if (WriteOwnerSettings(pSetupData->OwnerName, pSetupData->OwnerOrganization))
847 {
849 return TRUE;
850 }
851 }
852 break;
853
854 case PSN_WIZNEXT:
855 OwnerName[0] = 0;
856 if (GetDlgItemTextW(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
857 {
859 {
860 wcscpy(Title, L"ReactOS Setup");
861 }
862 if (0 == LoadStringW(hDllInstance, IDS_WZD_NAME, ErrorName, ARRAYSIZE(ErrorName)))
863 {
864 wcscpy(ErrorName, L"Setup cannot continue until you enter your name.");
865 }
866 MessageBoxW(hwndDlg, ErrorName, Title, MB_ICONERROR | MB_OK);
867
869 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
870
871 return TRUE;
872 }
873
874 OwnerOrganization[0] = 0;
875 GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
876
877 if (!WriteOwnerSettings(OwnerName, OwnerOrganization))
878 {
880 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
881 return TRUE;
882 }
883
884 case PSN_WIZBACK:
885 pSetupData->UnattendSetup = FALSE;
886 break;
887
888 default:
889 break;
890 }
891 }
892 break;
893
894 default:
895 break;
896 }
897
898 return FALSE;
899}
900
901static
902BOOL
903WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg)
904{
905 WCHAR Title[64];
906 WCHAR ErrorComputerName[256];
907 LONG lError;
908 HKEY hKey = NULL;
909
910 if (!SetComputerNameW(ComputerName))
911 {
912 if (hwndDlg != NULL)
913 {
915 {
916 wcscpy(Title, L"ReactOS Setup");
917 }
918 if (0 == LoadStringW(hDllInstance, IDS_WZD_SETCOMPUTERNAME, ErrorComputerName,
919 ARRAYSIZE(ErrorComputerName)))
920 {
921 wcscpy(ErrorComputerName, L"Setup failed to set the computer name.");
922 }
923 MessageBoxW(hwndDlg, ErrorComputerName, Title, MB_ICONERROR | MB_OK);
924 }
925
926 return FALSE;
927 }
928
929 /* Set the physical DNS domain */
930 SetComputerNameExW(ComputerNamePhysicalDnsDomain, L"");
931
932 /* Set the physical DNS hostname */
933 SetComputerNameExW(ComputerNamePhysicalDnsHostname, ComputerName);
934
935 /* Set the accounts domain name */
936 SetAccountsDomainSid(NULL, ComputerName);
937
938 /* Now we need to set the Hostname */
940 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
941 0,
942 NULL,
944 KEY_WRITE,
945 NULL,
946 &hKey,
947 NULL);
948 if (lError == ERROR_SUCCESS)
949 {
950 lError = RegSetValueEx(hKey,
951 L"Hostname",
952 0,
953 REG_SZ,
954 (LPBYTE)ComputerName,
955 (wcslen(ComputerName) + 1) * sizeof(WCHAR));
956 if (lError != ERROR_SUCCESS)
957 {
958 DPRINT1("RegSetValueEx(\"Hostname\") failed (%08lX)\n", lError);
959 }
960
962 }
963 else
964 {
965 DPRINT1("RegCreateKeyExW for Tcpip\\Parameters failed (%08lX)\n", lError);
966 }
967
968 return TRUE;
969}
970
971
972static
973BOOL
975{
976 WCHAR szAdministratorName[256];
977 HKEY hKey = NULL;
978 LONG lError;
979
982 szAdministratorName,
983 ARRAYSIZE(szAdministratorName)) == 0)
984 {
985 wcscpy(szAdministratorName, L"Administrator");
986 }
987
989 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
990 0,
992 &hKey);
993 if (lError != ERROR_SUCCESS)
994 return FALSE;
995
996 lError = RegSetValueEx(hKey,
997 L"DefaultDomainName",
998 0,
999 REG_SZ,
1000 (LPBYTE)Domain,
1001 (wcslen(Domain)+ 1) * sizeof(WCHAR));
1002 if (lError != ERROR_SUCCESS)
1003 {
1004 DPRINT1("RegSetValueEx(\"DefaultDomainName\") failed!\n");
1005 }
1006
1007 lError = RegSetValueEx(hKey,
1008 L"DefaultUserName",
1009 0,
1010 REG_SZ,
1011 (LPBYTE)szAdministratorName,
1012 (wcslen(szAdministratorName)+ 1) * sizeof(WCHAR));
1013 if (lError != ERROR_SUCCESS)
1014 {
1015 DPRINT1("RegSetValueEx(\"DefaultUserName\") failed!\n");
1016 }
1017
1019
1020 return TRUE;
1021}
1022
1023
1024/* lpBuffer will be filled with a 15-char string (plus the null terminator) */
1025static void
1027{
1028 static const WCHAR Chars[] = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1029 static const unsigned cChars = sizeof(Chars) / sizeof(WCHAR) - 1;
1030 unsigned i;
1031
1032 wcscpy(lpBuffer, L"REACTOS-");
1033
1035
1036 /* fill in 7 characters */
1037 for (i = 8; i < 15; i++)
1038 lpBuffer[i] = Chars[rand() % cChars];
1039
1040 lpBuffer[15] = UNICODE_NULL; /* NULL-terminate */
1041}
1042
1043static INT_PTR CALLBACK
1045 UINT uMsg,
1046 WPARAM wParam,
1047 LPARAM lParam)
1048{
1049 WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1050 WCHAR Password1[128];
1051 WCHAR Password2[128];
1053 WCHAR Title[64];
1054 WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256];
1055 LPNMHDR lpnm;
1056 PSETUPDATA pSetupData;
1057
1058 pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
1059
1061 {
1062 wcscpy(Title, L"ReactOS Setup");
1063 }
1064
1065 switch (uMsg)
1066 {
1067 case WM_INITDIALOG:
1068 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1069 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pSetupData);
1070
1071 /* Generate a new pseudo-random computer name */
1072 GenerateComputerName(ComputerName);
1073
1074 /* Display current computer name */
1075 SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
1076
1077 /* Set text limits */
1081
1082 /* Set focus to computer name */
1084 if (pSetupData->UnattendSetup)
1085 {
1086 SendMessage(GetDlgItem(hwndDlg, IDC_COMPUTERNAME), WM_SETTEXT, 0, (LPARAM)pSetupData->ComputerName);
1087 SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD1), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword);
1088 SendMessage(GetDlgItem(hwndDlg, IDC_ADMINPASSWORD2), WM_SETTEXT, 0, (LPARAM)pSetupData->AdminPassword);
1089 WriteComputerSettings(pSetupData->ComputerName, NULL);
1090 SetAdministratorPassword(pSetupData->AdminPassword);
1091 }
1092
1093 /* Store the administrator account name as the default user name */
1094 WriteDefaultLogonData(pSetupData->ComputerName);
1095 break;
1096
1097
1098 case WM_NOTIFY:
1099 {
1100 lpnm = (LPNMHDR)lParam;
1101
1102 switch (lpnm->code)
1103 {
1104 case PSN_SETACTIVE:
1105 /* Enable the Back and Next buttons */
1107 if (pSetupData->UnattendSetup && WriteComputerSettings(pSetupData->ComputerName, hwndDlg))
1108 {
1110 return TRUE;
1111 }
1112 break;
1113
1114 case PSN_WIZNEXT:
1115 if (0 == GetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName, MAX_COMPUTERNAME_LENGTH + 1))
1116 {
1117 if (0 == LoadStringW(hDllInstance, IDS_WZD_COMPUTERNAME, EmptyComputerName,
1118 ARRAYSIZE(EmptyComputerName)))
1119 {
1120 wcscpy(EmptyComputerName, L"Setup cannot continue until you enter the name of your computer.");
1121 }
1122 MessageBoxW(hwndDlg, EmptyComputerName, Title, MB_ICONERROR | MB_OK);
1124 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1125 return TRUE;
1126 }
1127
1128 /* No need to check computer name for invalid characters,
1129 * SetComputerName() will do it for us */
1130
1131 if (!WriteComputerSettings(ComputerName, hwndDlg))
1132 {
1134 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1135 return TRUE;
1136 }
1137
1138#ifdef PASSWORDS_MANDATORY
1139 /* Check if admin passwords have been entered */
1140 if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) ||
1141 (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0))
1142 {
1143 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword,
1144 ARRAYSIZE(EmptyPassword)))
1145 {
1146 wcscpy(EmptyPassword, L"You must enter a password !");
1147 }
1148 MessageBoxW(hwndDlg, EmptyPassword, Title, MB_ICONERROR | MB_OK);
1149 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1150 return TRUE;
1151 }
1152#else
1153 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128);
1154 GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128);
1155#endif
1156 /* Check if passwords match */
1157 if (wcscmp(Password1, Password2))
1158 {
1159 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDMATCH, NotMatchPassword,
1160 ARRAYSIZE(NotMatchPassword)))
1161 {
1162 wcscpy(NotMatchPassword, L"The passwords you entered do not match. Please enter the desired password again.");
1163 }
1164 MessageBoxW(hwndDlg, NotMatchPassword, Title, MB_ICONERROR | MB_OK);
1165 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1166 return TRUE;
1167 }
1168
1169 /* Check password for invalid characters */
1170 Password = (PWCHAR)Password1;
1171 while (*Password)
1172 {
1173 if (!isprint(*Password))
1174 {
1175 if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDCHAR, WrongPassword,
1176 ARRAYSIZE(WrongPassword)))
1177 {
1178 wcscpy(WrongPassword, L"The password you entered contains invalid characters. Please enter a cleaned password.");
1179 }
1180 MessageBoxW(hwndDlg, WrongPassword, Title, MB_ICONERROR | MB_OK);
1181 SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
1182 return TRUE;
1183 }
1184 Password++;
1185 }
1186
1187 /* Set admin password */
1188 SetAdministratorPassword(Password1);
1189 break;
1190
1191 case PSN_WIZBACK:
1192 pSetupData->UnattendSetup = FALSE;
1193 break;
1194
1195 default:
1196 break;
1197 }
1198 }
1199 break;
1200
1201 default:
1202 break;
1203 }
1204
1205 return FALSE;
1206}
1207
1208
1209static VOID
1211{
1212 WCHAR CurLocale[256] = L"";
1213 WCHAR CurGeo[256] = L"";
1214 WCHAR ResText[256] = L"";
1215 WCHAR LocaleText[256 * 2];
1216
1219
1220 LoadStringW(hDllInstance, IDS_LOCALETEXT, ResText, ARRAYSIZE(ResText));
1221 StringCchPrintfW(LocaleText, ARRAYSIZE(LocaleText), ResText, CurLocale, CurGeo);
1222
1223 SetWindowTextW(hwnd, LocaleText);
1224}
1225
1226static VOID
1228{
1229 HKL hkl;
1230 BOOL LayoutSpecial = FALSE;
1231 WCHAR LayoutPath[256];
1232 WCHAR LocaleName[32];
1233 WCHAR SpecialId[5] = L"";
1234 WCHAR ResText[256] = L"";
1235 DWORD dwValueSize;
1236 HKEY hKey;
1237 UINT i;
1238
1239 /* Get the default input language and method */
1240 if (!SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, 0, (LPDWORD)&hkl, 0))
1241 {
1243 }
1244
1245 if ((HIWORD(hkl) & 0xF000) == 0xF000)
1246 {
1247 /* Process keyboard layout with special id */
1248 StringCchPrintfW(SpecialId, ARRAYSIZE(SpecialId), L"%04x", (HIWORD(hkl) & 0x0FFF));
1249 LayoutSpecial = TRUE;
1250 }
1251
1252#define MAX_LAYOUTS_PER_LANGID 0x10000
1253 for (i = 0; i < (LayoutSpecial ? MAX_LAYOUTS_PER_LANGID : 1); i++)
1254 {
1255 /* Generate a hexadecimal identifier for keyboard layout registry key */
1257
1258 StringCchCopyW(LayoutPath, ARRAYSIZE(LayoutPath), L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\");
1259 StringCchCatW(LayoutPath, ARRAYSIZE(LayoutPath), LocaleName);
1261
1263 LayoutPath,
1264 0,
1266 &hKey) == ERROR_SUCCESS)
1267 {
1268 /* Make sure the keyboard layout key we opened is the one we need.
1269 * If the layout has no special id, just pass this check. */
1270 dwValueSize = sizeof(LocaleName);
1271 if (!LayoutSpecial ||
1273 L"Layout Id",
1274 NULL,
1275 NULL,
1276 (PVOID)&LocaleName,
1277 &dwValueSize) == ERROR_SUCCESS) &&
1278 (wcscmp(LocaleName, SpecialId) == 0)))
1279 {
1281 dwValueSize = sizeof(LocaleName);
1283 L"Layout Text",
1284 NULL,
1285 NULL,
1286 (PVOID)&LocaleName,
1287 &dwValueSize);
1288 /* Let the loop know where to stop */
1290 }
1292 }
1293 else
1294 {
1295 /* Keyboard layout registry keys are expected to go in order without gaps */
1296 break;
1297 }
1298 }
1299#undef MAX_LAYOUTS_PER_LANGID
1300
1301 LoadStringW(hDllInstance, IDS_LAYOUTTEXT, ResText, ARRAYSIZE(ResText));
1302 StringCchPrintfW(LayoutPath, ARRAYSIZE(LayoutPath), ResText, LocaleName);
1303
1304 SetWindowTextW(hwnd, LayoutPath);
1305}
1306
1307
1308static BOOL
1310{
1311 MSG msg;
1312 HWND MainWindow = GetParent(hwnd);
1313 STARTUPINFOW StartupInfo;
1314 PROCESS_INFORMATION ProcessInformation;
1315 WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
1316
1317 if (!pwszCPLParameters)
1318 {
1319 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1320 return FALSE;
1321 }
1322
1323 ZeroMemory(&StartupInfo, sizeof(StartupInfo));
1324 StartupInfo.cb = sizeof(StartupInfo);
1325 ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
1326
1327 ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
1328 wcscat(CmdLine, pwszCPLParameters);
1329
1330 if (!CreateProcessW(NULL,
1331 CmdLine,
1332 NULL,
1333 NULL,
1334 FALSE,
1335 0,
1336 NULL,
1337 NULL,
1338 &StartupInfo,
1339 &ProcessInformation))
1340 {
1341 MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR);
1342 return FALSE;
1343 }
1344
1345 /* Disable the Back and Next buttons and the main window
1346 * while we're interacting with the control panel applet */
1347 PropSheet_SetWizButtons(MainWindow, 0);
1348 EnableWindow(MainWindow, FALSE);
1349
1351 {
1352 /* We still need to process main window messages to avoid freeze */
1353 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
1354 {
1357 }
1358 }
1359 CloseHandle(ProcessInformation.hThread);
1360 CloseHandle(ProcessInformation.hProcess);
1361
1362 /* Enable the Back and Next buttons and the main window again */
1364 EnableWindow(MainWindow, TRUE);
1365
1366 return TRUE;
1367}
1368
1369
1370VOID
1373 _In_opt_ PCWSTR ThemeFile)
1374{
1375 enum { THEME_FILE, STYLE_FILE, UNKNOWN } fType;
1376 WCHAR szPath[MAX_PATH]; // Expanded path of the file to use.
1377 WCHAR szStyleFile[MAX_PATH];
1378
1379 fType = THEME_FILE; // Default to Classic theme.
1380 if (ThemeFile)
1381 {
1382 /* Expand the path if possible */
1383 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1384 ThemeFile = szPath;
1385
1386 /* Determine the file type from its extension */
1387 fType = UNKNOWN; {
1388 PCWSTR pszExt = wcsrchr(ThemeFile, L'.'); // PathFindExtensionW(ThemeFile);
1389 if (pszExt)
1390 {
1391 if (_wcsicmp(pszExt, L".theme") == 0)
1392 fType = THEME_FILE;
1393 else if (_wcsicmp(pszExt, L".msstyles") == 0)
1394 fType = STYLE_FILE;
1395 } }
1396 if (fType == UNKNOWN)
1397 {
1398 DPRINT1("EnableVisualTheme(): Unknown file '%S'\n", ThemeFile);
1399 return;
1400 }
1401 }
1402
1403 DPRINT1("Applying visual %s '%S'\n",
1404 (fType == THEME_FILE) ? "theme" : "style",
1405 ThemeFile ? ThemeFile : L"(Classic)");
1406
1407//
1408// TODO: Use instead uxtheme!SetSystemVisualStyle() once it is implemented,
1409// https://stackoverflow.com/a/1036903
1410// https://pinvoke.net/default.aspx/uxtheme.SetSystemVisualStyle
1411// or ApplyTheme(NULL, 0, NULL) for restoring the classic theme.
1412//
1413// NOTE: The '/Action:ActivateMSTheme' is ReactOS-specific.
1414//
1415
1416 if (ThemeFile && (fType == THEME_FILE))
1417 {
1418 /* Retrieve the visual style specified in the theme file.
1419 * If none, fall back to the classic theme. */
1420 if (GetPrivateProfileStringW(L"VisualStyles", L"Path", NULL,
1421 szStyleFile, _countof(szStyleFile), ThemeFile) && *szStyleFile)
1422 {
1423 /* Expand the path if possible */
1424 ThemeFile = szStyleFile;
1425 if (ExpandEnvironmentStringsW(ThemeFile, szPath, _countof(szPath)) != 0)
1426 ThemeFile = szPath;
1427 }
1428 else
1429 {
1430 ThemeFile = NULL;
1431 }
1432
1433 DPRINT1("--> Applying visual style '%S'\n",
1434 ThemeFile ? ThemeFile : L"(Classic)");
1435 }
1436
1437 if (ThemeFile)
1438 {
1439 WCHAR wszParams[1024];
1440 // FIXME: L"desk.cpl desk,@Appearance" regression, see commit 50d260a7f0
1441 PCWSTR format = L"desk.cpl,,2 /Action:ActivateMSTheme /file:\"%s\"";
1442
1443 StringCchPrintfW(wszParams, _countof(wszParams), format, ThemeFile);
1445 }
1446 else
1447 {
1448 RunControlPanelApplet(hwndParent, L"desk.cpl,,2 /Action:ActivateMSTheme");
1449 }
1450}
1451
1452
1453static VOID
1455{
1456 HKEY hKey;
1457 LCID lcid;
1458 WCHAR Locale[9] = L"0000";
1459
1461
1462 if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0)
1463 {
1464 if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
1467 {
1468 RegSetValueExW(hKey, L"Locale", 0, REG_SZ, (LPBYTE)Locale, (wcslen(Locale) + 1) * sizeof(WCHAR));
1470 }
1471 }
1472}
1473
1474static INT_PTR CALLBACK
1476 UINT uMsg,
1477 WPARAM wParam,
1478 LPARAM lParam)
1479{
1481
1482 /* Retrieve pointer to the global setup data */
1484
1485 switch (uMsg)
1486 {
1487 case WM_INITDIALOG:
1488 {
1489 /* Save pointer to the global setup data */
1493
1496 }
1497 break;
1498
1499 case WM_COMMAND:
1500 if (HIWORD(wParam) == BN_CLICKED)
1501 {
1502 switch (LOWORD(wParam))
1503 {
1504 case IDC_CUSTOMLOCALE:
1505 RunControlPanelApplet(hwndDlg, L"intl.cpl,,5");
1507 break;
1508
1509 case IDC_CUSTOMLAYOUT:
1510 RunControlPanelApplet(hwndDlg, L"input.dll,@1");
1512 break;
1513 }
1514 }
1515 break;
1516
1517 case WM_NOTIFY:
1518 {
1519 LPNMHDR lpnm = (LPNMHDR)lParam;
1520
1521 switch (lpnm->code)
1522 {
1523 case PSN_SETACTIVE:
1524 /* Enable the Back and Next buttons */
1527 {
1528 // if (!*SetupData->SourcePath)
1529 {
1530 RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"$winnt$.inf\""); // Should be in System32
1531 }
1532
1534 return TRUE;
1535 }
1536 break;
1537
1538 case PSN_WIZNEXT:
1539 break;
1540
1541 case PSN_WIZBACK:
1543 break;
1544
1545 default:
1546 break;
1547 }
1548 }
1549 break;
1550
1551 default:
1552 break;
1553 }
1554
1555 return FALSE;
1556}
1557
1558
1559static PTIMEZONE_ENTRY
1561{
1563
1565 while (Entry != NULL)
1566 {
1567 if (Entry->Index >= Index)
1568 return Entry;
1569
1570 Entry = Entry->Next;
1571 }
1572
1573 return NULL;
1574}
1575
1576static LONG
1578 IN HKEY hZoneKey,
1580{
1581 LONG lError;
1584 PTIMEZONE_ENTRY Current;
1585 ULONG DescriptionSize;
1586 ULONG StandardNameSize;
1587 ULONG DaylightNameSize;
1588
1590 if (Entry == NULL)
1591 {
1593 }
1594
1595 DescriptionSize = sizeof(Entry->Description);
1596 StandardNameSize = sizeof(Entry->StandardName);
1597 DaylightNameSize = sizeof(Entry->DaylightName);
1598
1599 lError = QueryTimeZoneData(hZoneKey,
1600 &Entry->Index,
1601 &Entry->TimezoneInfo,
1602 Entry->Description,
1603 &DescriptionSize,
1604 Entry->StandardName,
1605 &StandardNameSize,
1606 Entry->DaylightName,
1607 &DaylightNameSize);
1608 if (lError != ERROR_SUCCESS)
1609 {
1611 return lError;
1612 }
1613
1616 {
1617 Entry->Prev = NULL;
1618 Entry->Next = NULL;
1621 }
1622 else
1623 {
1624 Current = GetLargerTimeZoneEntry(SetupData, Entry->Index);
1625 if (Current != NULL)
1626 {
1627 if (Current == SetupData->TimeZoneListHead)
1628 {
1629 /* Prepend to head */
1630 Entry->Prev = NULL;
1634 }
1635 else
1636 {
1637 /* Insert before current */
1638 Entry->Prev = Current->Prev;
1639 Entry->Next = Current;
1640 Current->Prev->Next = Entry;
1641 Current->Prev = Entry;
1642 }
1643 }
1644 else
1645 {
1646 /* Append to tail */
1648 Entry->Next = NULL;
1651 }
1652 }
1653
1654 return ERROR_SUCCESS;
1655}
1656
1657static VOID
1659{
1661}
1662
1663static VOID
1665{
1667
1668 while (SetupData->TimeZoneListHead != NULL)
1669 {
1671
1674 {
1676 }
1677
1679 }
1680
1682}
1683
1684
1685static VOID
1687{
1689 DWORD dwIndex = 0;
1690 DWORD dwCount;
1691
1692 GetTimeZoneListIndex(&dwEntryIndex);
1693
1695 while (Entry != NULL)
1696 {
1697 dwCount = SendMessage(hwnd,
1699 0,
1700 (LPARAM)Entry->Description);
1701
1702 if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
1703 dwIndex = dwCount;
1704
1705 Entry = Entry->Next;
1706 }
1707
1710 (WPARAM)dwIndex,
1711 0);
1712}
1713
1714
1715static VOID
1717{
1718 TIME_ZONE_INFORMATION TimeZoneInformation;
1720 DWORD dwIndex;
1721 DWORD i;
1722
1723 dwIndex = SendMessage(hwnd,
1725 0,
1726 0);
1727
1728 i = 0;
1730 while (i < dwIndex)
1731 {
1732 if (Entry == NULL)
1733 return;
1734
1735 i++;
1736 Entry = Entry->Next;
1737 }
1738
1739 wcscpy(TimeZoneInformation.StandardName,
1740 Entry->StandardName);
1741 wcscpy(TimeZoneInformation.DaylightName,
1742 Entry->DaylightName);
1743
1744 TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
1745 TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
1746 TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
1747
1748 memcpy(&TimeZoneInformation.StandardDate,
1749 &Entry->TimezoneInfo.StandardDate,
1750 sizeof(SYSTEMTIME));
1751 memcpy(&TimeZoneInformation.DaylightDate,
1752 &Entry->TimezoneInfo.DaylightDate,
1753 sizeof(SYSTEMTIME));
1754
1755 /* Set time zone information */
1756 SetTimeZoneInformation(&TimeZoneInformation);
1757}
1758
1759
1760static BOOL
1762{
1763 SYSTEMTIME Date;
1765
1767 {
1768 return FALSE;
1769 }
1770
1772 {
1773 return FALSE;
1774 }
1775
1779 SetupData->SystemTime.wDay = Date.wDay;
1780 SetupData->SystemTime.wHour = Time.wHour;
1781 SetupData->SystemTime.wMinute = Time.wMinute;
1782 SetupData->SystemTime.wSecond = Time.wSecond;
1783 SetupData->SystemTime.wMilliseconds = Time.wMilliseconds;
1784
1785 return TRUE;
1786}
1787
1788
1789static BOOL
1791{
1792 BOOL Ret = FALSE;
1793
1794 /*
1795 * Call SetLocalTime twice to ensure correct results
1796 */
1799
1800 return Ret;
1801}
1802
1803
1804static VOID
1806{
1809}
1810
1811
1812static BOOL
1814{
1815 WCHAR Title[64];
1816 WCHAR ErrorLocalTime[256];
1817
1818 GetLocalSystemTime(hwndDlg, SetupData);
1820 SetupData);
1821
1823 BM_GETCHECK, 0, 0) != BST_UNCHECKED);
1824 if (!SetSystemLocalTime(hwndDlg, SetupData))
1825 {
1827 {
1828 wcscpy(Title, L"ReactOS Setup");
1829 }
1830 if (0 == LoadStringW(hDllInstance, IDS_WZD_LOCALTIME, ErrorLocalTime,
1831 ARRAYSIZE(ErrorLocalTime)))
1832 {
1833 wcscpy(ErrorLocalTime, L"Setup was unable to set the local time.");
1834 }
1835 MessageBoxW(hwndDlg, ErrorLocalTime, Title, MB_ICONWARNING | MB_OK);
1836 return FALSE;
1837 }
1838
1839 return TRUE;
1840}
1841
1842
1843static INT_PTR CALLBACK
1845 UINT uMsg,
1846 WPARAM wParam,
1847 LPARAM lParam)
1848{
1850
1851 /* Retrieve pointer to the global setup data */
1853
1854 switch (uMsg)
1855 {
1856 case WM_INITDIALOG:
1857 {
1858 /* Save pointer to the global setup data */
1861
1863
1865 {
1868
1870 {
1872 }
1873 }
1874 else
1875 {
1877 SetupData, -1);
1878
1880 }
1881 break;
1882 }
1883
1884 case WM_TIMER:
1885 {
1886 SYSTEMTIME LocalTime;
1887
1888 GetLocalTime(&LocalTime);
1889 UpdateLocalSystemTime(hwndDlg, LocalTime);
1890
1891 // Reset timeout.
1892 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1893 break;
1894 }
1895
1896 case WM_NOTIFY:
1897 switch (((LPNMHDR)lParam)->code)
1898 {
1899 case PSN_SETACTIVE:
1900 {
1901 SYSTEMTIME LocalTime;
1902
1903 GetLocalTime(&LocalTime);
1904 UpdateLocalSystemTime(hwndDlg, LocalTime);
1905
1906 /* Enable the Back and Next buttons */
1908
1910 {
1912 return TRUE;
1913 }
1914
1915 SetTimer(hwndDlg, 1, 1000 - LocalTime.wMilliseconds, NULL);
1916 break;
1917 }
1918
1919 case PSN_KILLACTIVE:
1920 case DTN_DATETIMECHANGE:
1921 // NB: Not re-set until changing page (PSN_SETACTIVE).
1922 KillTimer(hwndDlg, 1);
1923 break;
1924
1925 case PSN_WIZNEXT:
1927 break;
1928
1929 case PSN_WIZBACK:
1931 break;
1932
1933 default:
1934 break;
1935 }
1936 break;
1937
1938 case WM_DESTROY:
1940 break;
1941
1942 default:
1943 break;
1944 }
1945
1946 return FALSE;
1947}
1948
1949static struct ThemeInfo
1950{
1954
1955} Themes[] = {
1957 { MAKEINTRESOURCE(IDB_LAUTUS), IDS_LAUTUS, L"themes\\lautus\\lautus.msstyles" },
1958 { MAKEINTRESOURCE(IDB_LUNAR), IDS_LUNAR, L"themes\\lunar\\lunar.msstyles" },
1959 { MAKEINTRESOURCE(IDB_MIZU), IDS_MIZU, L"themes\\mizu\\mizu.msstyles"},
1961
1962static INT_PTR CALLBACK
1964 UINT uMsg,
1965 WPARAM wParam,
1966 LPARAM lParam)
1967{
1969 LPNMLISTVIEW pnmv;
1970
1971 /* Retrieve pointer to the global setup data */
1973
1974 switch (uMsg)
1975 {
1976 case WM_INITDIALOG:
1977 {
1978 HWND hListView;
1980 DWORD n;
1981 LVITEM lvi = {0};
1982
1983 /* Save pointer to the global setup data */
1986
1987 hListView = GetDlgItem(hwndDlg, IDC_THEMEPICKER);
1988
1989 /* Common */
1991 lvi.mask = LVIF_TEXT | LVIF_IMAGE |LVIF_STATE;
1992
1993 for (n = 0; n < ARRAYSIZE(Themes); ++n)
1994 {
1995 WCHAR DisplayName[100] = {0};
1996 /* Load the bitmap */
1998 ImageList_AddMasked(himl, image, RGB(255,0,255));
1999
2000 /* Load the string */
2001 LoadStringW(hDllInstance, Themes[n].DisplayName, DisplayName, ARRAYSIZE(DisplayName));
2002 DisplayName[ARRAYSIZE(DisplayName)-1] = UNICODE_NULL;
2003
2004 /* Add the listview item */
2005 lvi.iItem = n;
2006 lvi.iImage = n;
2007 lvi.pszText = DisplayName;
2008 ListView_InsertItem(hListView, &lvi);
2009 }
2010
2011 /* Register the imagelist */
2013 /* Transparent background */
2014 ListView_SetBkColor(hListView, CLR_NONE);
2016 /* Reduce the size between the items */
2017 ListView_SetIconSpacing(hListView, 190, 173);
2018 break;
2019 }
2020
2021 case WM_NOTIFY:
2022 switch (((LPNMHDR)lParam)->code)
2023 {
2024 //case LVN_ITEMCHANGING:
2025 case LVN_ITEMCHANGED:
2026 pnmv = (LPNMLISTVIEW)lParam;
2027 if ((pnmv->uChanged & LVIF_STATE) && (pnmv->uNewState & LVIS_SELECTED))
2028 {
2029 int iTheme = pnmv->iItem;
2030 DPRINT1("Selected theme: %u\n", Themes[iTheme].DisplayName);
2031
2032 if (Themes[iTheme].ThemeFile)
2033 {
2034 WCHAR wszTheme[MAX_PATH];
2035 SHGetFolderPathAndSubDirW(0, CSIDL_RESOURCES, NULL, SHGFP_TYPE_DEFAULT, Themes[iTheme].ThemeFile, wszTheme);
2036 EnableVisualTheme(hwndDlg, wszTheme);
2037 }
2038 else
2039 {
2040 EnableVisualTheme(hwndDlg, Themes[iTheme].ThemeFile);
2041 }
2042 }
2043 break;
2044 case PSN_SETACTIVE:
2045 /* Enable the Back and Next buttons */
2048 {
2050 return TRUE;
2051 }
2052 break;
2053
2054 case PSN_WIZNEXT:
2055 break;
2056
2057 case PSN_WIZBACK:
2059 break;
2060
2061 default:
2062 break;
2063 }
2064 break;
2065
2066 default:
2067 break;
2068 }
2069
2070 return FALSE;
2071}
2072
2073static UINT CALLBACK
2076 UINT_PTR Param1,
2077 UINT_PTR Param2)
2078{
2079 PREGISTRATIONDATA RegistrationData;
2082
2083 RegistrationData = (PREGISTRATIONDATA)Context;
2084
2087 {
2088 StatusInfo = (PSP_REGISTER_CONTROL_STATUSW) Param1;
2089 RegistrationData->pNotify->CurrentItem = wcsrchr(StatusInfo->FileName, L'\\');
2090 if (RegistrationData->pNotify->CurrentItem == NULL)
2091 {
2092 RegistrationData->pNotify->CurrentItem = StatusInfo->FileName;
2093 }
2094 else
2095 {
2096 RegistrationData->pNotify->CurrentItem++;
2097 }
2098
2100 {
2101 DPRINT("Received SPFILENOTIFY_STARTREGISTRATION notification for %S\n",
2102 StatusInfo->FileName);
2103 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2104
2105 DPRINT("RegisterDll: Start step %ld\n", RegistrationData->pNotify->Progress);
2106 SendMessage(RegistrationData->hwndDlg, PM_STEP_START, 0, (LPARAM)RegistrationData->pNotify);
2107 }
2108 else
2109 {
2110 DPRINT("Received SPFILENOTIFY_ENDREGISTRATION notification for %S\n",
2111 StatusInfo->FileName);
2112 DPRINT("Win32Error %u FailureCode %u\n", StatusInfo->Win32Error,
2113 StatusInfo->FailureCode);
2114 if (StatusInfo->FailureCode != SPREG_SUCCESS)
2115 {
2116 switch (StatusInfo->FailureCode)
2117 {
2118 case SPREG_LOADLIBRARY:
2120 break;
2121 case SPREG_GETPROCADDR:
2123 break;
2124 case SPREG_REGSVR:
2126 break;
2127 case SPREG_DLLINSTALL:
2129 break;
2130 case SPREG_TIMEOUT:
2132 break;
2133 default:
2135 break;
2136 }
2137
2138 RegistrationData->pNotify->MessageID = MessageID;
2139 RegistrationData->pNotify->LastError = StatusInfo->Win32Error;
2140 }
2141 else
2142 {
2143 RegistrationData->pNotify->MessageID = 0;
2144 RegistrationData->pNotify->LastError = ERROR_SUCCESS;
2145 }
2146
2147 if (RegistrationData->Registered < RegistrationData->DllCount)
2148 {
2149 RegistrationData->Registered++;
2150 }
2151
2152 RegistrationData->pNotify->Progress = RegistrationData->Registered;
2153 DPRINT("RegisterDll: End step %ld\n", RegistrationData->pNotify->Progress);
2154 SendMessage(RegistrationData->hwndDlg, PM_STEP_END, 0, (LPARAM)RegistrationData->pNotify);
2155 }
2156
2157 return FILEOP_DOIT;
2158 }
2159 else
2160 {
2161 DPRINT1("Received unexpected notification %u\n", Notification);
2162 return SetupDefaultQueueCallback(RegistrationData->DefaultContext,
2163 Notification, Param1, Param2);
2164 }
2165}
2166
2167
2168static
2169DWORD
2171 _In_ PITEMSDATA pItemsData,
2172 _In_ PREGISTRATIONNOTIFY pNotify)
2173{
2174 REGISTRATIONDATA RegistrationData;
2175 WCHAR SectionName[512];
2177 LONG DllCount = 0;
2179
2180 ZeroMemory(&RegistrationData, sizeof(REGISTRATIONDATA));
2181 RegistrationData.hwndDlg = pItemsData->hwndDlg;
2182 RegistrationData.Registered = 0;
2183
2184 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2185 L"RegisterDlls", &Context))
2186 {
2187 DPRINT1("No RegistrationPhase2 section found\n");
2188 return GetLastError();
2189 }
2190
2191 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2192 ARRAYSIZE(SectionName),
2193 NULL))
2194 {
2195 DPRINT1("Unable to retrieve section name\n");
2196 return GetLastError();
2197 }
2198
2199 DllCount = SetupGetLineCountW(hSysSetupInf, SectionName);
2200 DPRINT("SectionName %S DllCount %ld\n", SectionName, DllCount);
2201 if (DllCount < 0)
2202 {
2203 return STATUS_NOT_FOUND;
2204 }
2205
2206 RegistrationData.DllCount = (ULONG)DllCount;
2207 RegistrationData.DefaultContext = SetupInitDefaultQueueCallback(RegistrationData.hwndDlg);
2208 RegistrationData.pNotify = pNotify;
2209
2210 _SEH2_TRY
2211 {
2212 if (!SetupInstallFromInfSectionW(GetParent(RegistrationData.hwndDlg),
2214 L"RegistrationPhase2",
2215 SPINST_REGISTRY | SPINST_REGISTERCALLBACKAWARE | SPINST_REGSVR,
2216 0,
2217 NULL,
2218 0,
2220 &RegistrationData,
2221 NULL,
2222 NULL))
2223 {
2224 Error = GetLastError();
2225 }
2226 }
2228 {
2229 DPRINT("Catching exception\n");
2231 }
2232 _SEH2_END;
2233
2235
2236 return Error;
2237}
2238
2239static
2240VOID
2242 PITEMSDATA pItemsData)
2243{
2244 WCHAR SectionName[512];
2246 LONG Steps = 0;
2249
2250 ZeroMemory(&Notify, sizeof(Notify));
2251
2252 /* Count the 'RegisterDlls' steps */
2253 if (!SetupFindFirstLineW(hSysSetupInf, L"RegistrationPhase2",
2254 L"RegisterDlls", &Context))
2255 {
2256 DPRINT1("No RegistrationPhase2 section found\n");
2257 return;
2258 }
2259
2260 if (!SetupGetStringFieldW(&Context, 1, SectionName,
2261 ARRAYSIZE(SectionName),
2262 NULL))
2263 {
2264 DPRINT1("Unable to retrieve section name\n");
2265 return;
2266 }
2267
2268 Steps += SetupGetLineCountW(hSysSetupInf, SectionName);
2269
2270 /* Count the 'TypeLibratries' steps */
2271 Steps += SetupGetLineCountW(hSysSetupInf, L"TypeLibraries");
2272
2273 /* Start the item */
2274 DPRINT("Register Components: %ld Steps\n", Steps);
2275 SendMessage(pItemsData->hwndDlg, PM_ITEM_START, 0, (LPARAM)Steps);
2276
2277 Error = RegisterDlls(pItemsData, &Notify);
2278 if (Error == ERROR_SUCCESS)
2279 RegisterTypeLibraries(pItemsData, &Notify, hSysSetupInf, L"TypeLibraries");
2280
2281 /* End the item */
2282 DPRINT("Register Components: done\n");
2283 SendMessage(pItemsData->hwndDlg, PM_ITEM_END, 0, Error);
2284}
2285
2286
2287static
2288DWORD
2292{
2293 PITEMSDATA pItemsData;
2294 HWND hwndDlg;
2295
2296 pItemsData = (PITEMSDATA)Parameter;
2297 hwndDlg = pItemsData->hwndDlg;
2298
2299 /* Step 0 - Registering components */
2300 RegisterComponents(pItemsData);
2301
2302 /* Step 1 - Installing start menu items */
2303 InstallStartMenuItems(pItemsData);
2304
2305 /* FIXME: Add completion steps here! */
2306
2307 // FIXME: Move this call to a separate cleanup page!
2309
2310 /* Free the items data */
2311 HeapFree(GetProcessHeap(), 0, pItemsData);
2312
2313 /* Tell the wizard page that we are done */
2314 PostMessage(hwndDlg, PM_ITEMS_DONE, 0, 0);
2315
2316 return 0;
2317}
2318
2319
2320static
2321BOOL
2323 _In_ HWND hwndDlg)
2324{
2325 HANDLE hCompletionThread;
2326 PITEMSDATA pItemsData;
2327
2328 pItemsData = HeapAlloc(GetProcessHeap(), 0, sizeof(ITEMSDATA));
2329 if (pItemsData == NULL)
2330 return FALSE;
2331
2332 pItemsData->hwndDlg = hwndDlg;
2333
2334 hCompletionThread = CreateThread(NULL,
2335 0,
2337 pItemsData,
2338 0,
2339 NULL);
2340 if (hCompletionThread == NULL)
2341 {
2342 HeapFree(GetProcessHeap(), 0, pItemsData);
2343 }
2344 else
2345 {
2346 CloseHandle(hCompletionThread);
2347 return TRUE;
2348 }
2349
2350 return FALSE;
2351}
2352
2353static
2354VOID
2356 HWND hwndDlg,
2357 DWORD LastError)
2358{
2360 WCHAR UnknownError[84];
2361 WCHAR Title[64];
2362
2364 NULL, LastError, 0, ErrorMessage, 0, NULL) == 0)
2365 {
2367 UnknownError,
2368 ARRAYSIZE(UnknownError) - 20) == 0)
2369 {
2370 wcscpy(UnknownError, L"Unknown error");
2371 }
2372 wcscat(UnknownError, L" ");
2373 _ultow(LastError, UnknownError + wcslen(UnknownError), 10);
2374 ErrorMessage = UnknownError;
2375 }
2376
2377 if (ErrorMessage != NULL)
2378 {
2380 Title, ARRAYSIZE(Title)) == 0)
2381 {
2382 wcscpy(Title, L"ReactOS Setup");
2383 }
2384
2386 }
2387
2388 if (ErrorMessage != NULL &&
2389 ErrorMessage != UnknownError)
2390 {
2392 }
2393}
2394
2395
2396static
2397VOID
2399 HWND hwndDlg,
2400 PREGISTRATIONNOTIFY RegistrationNotify)
2401{
2402 WCHAR ErrorMessage[128];
2403 WCHAR Title[64];
2404
2405 if (LoadStringW(hDllInstance, RegistrationNotify->MessageID,
2407 ARRAYSIZE(ErrorMessage)) == 0)
2408 {
2409 ErrorMessage[0] = L'\0';
2410 }
2411
2412 if (RegistrationNotify->MessageID != IDS_TIMEOUT)
2413 {
2415 RegistrationNotify->LastError, 0,
2418 NULL);
2419 }
2420
2421 if (ErrorMessage[0] != L'\0')
2422 {
2424 Title, ARRAYSIZE(Title)) == 0)
2425 {
2426 wcscpy(Title, L"ReactOS Setup");
2427 }
2428
2429 MessageBoxW(hwndDlg, ErrorMessage,
2431 }
2432}
2433
2434
2435static INT_PTR CALLBACK
2437 UINT uMsg,
2438 WPARAM wParam,
2439 LPARAM lParam)
2440{
2442 PREGISTRATIONNOTIFY RegistrationNotify;
2443 static HICON s_hCheckIcon, s_hArrowIcon, s_hCrossIcon;
2444 static HFONT s_hNormalFont;
2445
2446 /* Retrieve pointer to the global setup data */
2448
2449 switch (uMsg)
2450 {
2451 case WM_INITDIALOG:
2452 /* Save pointer to the global setup data */
2459 s_hCheckIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CHECKICON), IMAGE_ICON, 16, 16, 0);
2460 s_hArrowIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_ARROWICON), IMAGE_ICON, 16, 16, 0);
2461 s_hCrossIcon = LoadImageW(hDllInstance, MAKEINTRESOURCEW(IDI_CROSSICON), IMAGE_ICON, 16, 16, 0);
2462 s_hNormalFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1, WM_GETFONT, 0, 0);
2463 break;
2464
2465 case WM_DESTROY:
2466 DestroyIcon(s_hCheckIcon);
2467 DestroyIcon(s_hArrowIcon);
2468 DestroyIcon(s_hCrossIcon);
2469 break;
2470
2471 case WM_NOTIFY:
2472 switch (((LPNMHDR)lParam)->code)
2473 {
2474 case PSN_SETACTIVE:
2475 LogItem(L"BEGIN", L"ProcessPage");
2476
2477 /* Disable the Back and Next buttons */
2479 RunItemCompletionThread(hwndDlg);
2480 break;
2481
2482 case PSN_WIZNEXT:
2483 LogItem(L"END", L"ProcessPage");
2484 break;
2485
2486 case PSN_WIZBACK:
2488 break;
2489
2490 default:
2491 break;
2492 }
2493 break;
2494
2495 case PM_ITEM_START:
2496 DPRINT("PM_ITEM_START %lu\n", (ULONG)lParam);
2501 break;
2502
2503 case PM_ITEM_END:
2504 DPRINT("PM_ITEM_END\n");
2505 SendDlgItemMessage(hwndDlg, IDC_TASKTEXT1 + wParam, WM_SETFONT, (WPARAM)s_hNormalFont, (LPARAM)TRUE);
2506 if (lParam == ERROR_SUCCESS)
2507 {
2509 }
2510 else
2511 {
2513 ShowItemError(hwndDlg, (DWORD)lParam);
2514 }
2515 break;
2516
2517 case PM_STEP_START:
2518 DPRINT("PM_STEP_START\n");
2519 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2521 (LPARAM)((RegistrationNotify->CurrentItem != NULL)? RegistrationNotify->CurrentItem : L""));
2522 break;
2523
2524 case PM_STEP_END:
2525 DPRINT("PM_STEP_END\n");
2526 RegistrationNotify = (PREGISTRATIONNOTIFY)lParam;
2527 SendDlgItemMessage(hwndDlg, IDC_PROCESSPROGRESS, PBM_SETPOS, RegistrationNotify->Progress, 0);
2528 if (RegistrationNotify->LastError != ERROR_SUCCESS)
2529 {
2530 ShowStepError(hwndDlg, RegistrationNotify);
2531 }
2532 break;
2533
2534 case PM_ITEMS_DONE:
2535 DPRINT("PM_ITEMS_DONE\n");
2536 /* Enable the Back and Next buttons */
2539 break;
2540
2541 default:
2542 break;
2543 }
2544
2545 return FALSE;
2546}
2547
2548
2549static VOID
2551{
2552 HKEY hKey = 0;
2553 DWORD InProgress = 0;
2554 DWORD InstallDate;
2555
2557 L"SYSTEM\\Setup",
2558 0,
2559 KEY_WRITE,
2560 &hKey ) == ERROR_SUCCESS)
2561 {
2562 RegSetValueExW( hKey, L"SystemSetupInProgress", 0, REG_DWORD, (LPBYTE)&InProgress, sizeof(InProgress) );
2563 RegCloseKey( hKey );
2564 }
2565
2567 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
2568 0,
2569 KEY_WRITE,
2570 &hKey ) == ERROR_SUCCESS)
2571 {
2572 InstallDate = (DWORD)time(NULL);
2573 RegSetValueExW( hKey, L"InstallDate", 0, REG_DWORD, (LPBYTE)&InstallDate, sizeof(InstallDate) );
2574 RegCloseKey( hKey );
2575 }
2576}
2577
2578static INT_PTR CALLBACK
2580 UINT uMsg,
2581 WPARAM wParam,
2582 LPARAM lParam)
2583{
2584
2585 switch (uMsg)
2586 {
2587 case WM_INITDIALOG:
2588 {
2589 /* Get pointer to the global setup data */
2591
2593 {
2594 /* Run the Wine Gecko prompt */
2595 Control_RunDLLW(hwndDlg, 0, L"appwiz.cpl,,install_gecko", SW_SHOW);
2596 }
2597
2598 /* Set title font */
2599 SendDlgItemMessage(hwndDlg,
2601 WM_SETFONT,
2603 (LPARAM)TRUE);
2605 {
2606 KillTimer(hwndDlg, 1);
2608 PostQuitMessage(0);
2609 }
2610 }
2611 break;
2612
2613 case WM_DESTROY:
2614 {
2616 PostQuitMessage(0);
2617 return TRUE;
2618 }
2619
2620 case WM_TIMER:
2621 {
2622 INT Position;
2623 HWND hWndProgress;
2624
2625 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2626 Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
2627 if (Position == 300)
2628 {
2629 KillTimer(hwndDlg, 1);
2631 }
2632 else
2633 {
2634 SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
2635 }
2636 }
2637 return TRUE;
2638
2639 case WM_NOTIFY:
2640 {
2641 LPNMHDR lpnm = (LPNMHDR)lParam;
2642
2643 switch (lpnm->code)
2644 {
2645 case PSN_SETACTIVE:
2646 /* Enable the correct buttons on for the active page */
2648
2650 MAKELPARAM(0, 300));
2652 SetTimer(hwndDlg, 1, 50, NULL);
2653 break;
2654
2655 case PSN_WIZFINISH:
2656 DestroyWindow(GetParent(hwndDlg));
2657 break;
2658
2659 default:
2660 break;
2661 }
2662 }
2663 break;
2664
2665 default:
2666 break;
2667 }
2668
2669 return FALSE;
2670}
2671
2672
2673/*
2674 * GetInstallSourceWin32 retrieves the path to the ReactOS installation medium
2675 * in Win32 format, for later use by syssetup and storage in the registry.
2676 */
2677static BOOL
2679 OUT PWSTR pwszPath,
2680 IN DWORD cchPathMax,
2681 IN PCWSTR pwszNTPath)
2682{
2683 WCHAR wszDrives[512];
2684 WCHAR wszNTPath[512]; // MAX_PATH ?
2685 DWORD cchDrives;
2686 PWCHAR pwszDrive;
2687
2688 *pwszPath = UNICODE_NULL;
2689
2690 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2691 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2692 {
2693 /* Buffer too small or failure */
2694 LogItem(NULL, L"GetLogicalDriveStringsW failed");
2695 return FALSE;
2696 }
2697
2698 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2699 {
2700 WCHAR wszBuf[MAX_PATH];
2701
2702 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2703 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2704 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2705 pwszDrive[2] = L'\\'; // Restore the backslash
2706
2707 wcscat(wszNTPath, L"\\"); // Concat a backslash
2708
2709 /* Logging */
2710 wsprintf(wszBuf, L"Testing '%s' --> '%s' %s a CD",
2711 pwszDrive, wszNTPath,
2712 (GetDriveTypeW(pwszDrive) == DRIVE_CDROM) ? L"is" : L"is not");
2713 LogItem(NULL, wszBuf);
2714
2715 /* Check whether the NT path corresponds to the NT installation source path */
2716 if (!_wcsicmp(wszNTPath, pwszNTPath))
2717 {
2718 /* Found it! */
2719 wcscpy(pwszPath, pwszDrive); // cchPathMax
2720
2721 /* Logging */
2722 wsprintf(wszBuf, L"GetInstallSourceWin32: %s", pwszPath);
2723 LogItem(NULL, wszBuf);
2724 wcscat(wszBuf, L"\n");
2725 OutputDebugStringW(wszBuf);
2726
2727 return TRUE;
2728 }
2729 }
2730
2731 return FALSE;
2732}
2733
2734VOID
2736 IN OUT PSETUPDATA pSetupData)
2737{
2738 INFCONTEXT InfContext;
2739 WCHAR szName[256];
2740 WCHAR szValue[MAX_PATH];
2741 DWORD LineLength;
2742 HKEY hKey;
2743
2744 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2745 L"Unattend",
2746 L"UnattendSetupEnabled",
2747 &InfContext))
2748 {
2749 DPRINT1("Error: Cannot find UnattendSetupEnabled Key! %d\n", GetLastError());
2750 return;
2751 }
2752
2753 if (!SetupGetStringFieldW(&InfContext,
2754 1,
2755 szValue,
2756 ARRAYSIZE(szValue),
2757 &LineLength))
2758 {
2759 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2760 return;
2761 }
2762
2763 if (_wcsicmp(szValue, L"yes") != 0)
2764 {
2765 DPRINT("Unattend setup was disabled by UnattendSetupEnabled key.\n");
2766 return;
2767 }
2768
2769 pSetupData->UnattendSetup = TRUE;
2770
2771 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
2772 L"Unattend",
2773 NULL,
2774 &InfContext))
2775 {
2776 DPRINT1("Error: SetupFindFirstLine failed %d\n", GetLastError());
2777 return;
2778 }
2779
2780 do
2781 {
2782 if (!SetupGetStringFieldW(&InfContext,
2783 0,
2784 szName,
2786 &LineLength))
2787 {
2788 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2789 return;
2790 }
2791
2792 if (!SetupGetStringFieldW(&InfContext,
2793 1,
2794 szValue,
2795 ARRAYSIZE(szValue),
2796 &LineLength))
2797 {
2798 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2799 return;
2800 }
2801 DPRINT1("Name %S Value %S\n", szName, szValue);
2802 if (!_wcsicmp(szName, L"FullName"))
2803 {
2804 if (ARRAYSIZE(pSetupData->OwnerName) > LineLength)
2805 {
2806 wcscpy(pSetupData->OwnerName, szValue);
2807 }
2808 }
2809 else if (!_wcsicmp(szName, L"OrgName"))
2810 {
2811 if (ARRAYSIZE(pSetupData->OwnerOrganization) > LineLength)
2812 {
2813 wcscpy(pSetupData->OwnerOrganization, szValue);
2814 }
2815 }
2816 else if (!_wcsicmp(szName, L"ComputerName"))
2817 {
2818 if (ARRAYSIZE(pSetupData->ComputerName) > LineLength)
2819 {
2820 wcscpy(pSetupData->ComputerName, szValue);
2821 }
2822 }
2823 else if (!_wcsicmp(szName, L"AdminPassword"))
2824 {
2825 if (ARRAYSIZE(pSetupData->AdminPassword) > LineLength)
2826 {
2827 wcscpy(pSetupData->AdminPassword, szValue);
2828 }
2829 }
2830 else if (!_wcsicmp(szName, L"TimeZoneIndex"))
2831 {
2832 pSetupData->TimeZoneIndex = _wtoi(szValue);
2833 }
2834 else if (!_wcsicmp(szName, L"DisableAutoDaylightTimeSet"))
2835 {
2836 pSetupData->DisableAutoDaylightTimeSet = _wtoi(szValue);
2837 }
2838 else if (!_wcsicmp(szName, L"DisableGeckoInst"))
2839 {
2840 if (!_wcsicmp(szValue, L"yes"))
2841 pSetupData->DisableGeckoInst = TRUE;
2842 else
2843 pSetupData->DisableGeckoInst = FALSE;
2844 }
2845 else if (!_wcsicmp(szName, L"ProductOption"))
2846 {
2847 pSetupData->ProductOption = (PRODUCT_OPTION)_wtoi(szValue);
2848 }
2849 } while (SetupFindNextLine(&InfContext, &InfContext));
2850
2851 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2852 L"Display",
2853 NULL,
2854 &InfContext))
2855 {
2856 DEVMODEW dm = { { 0 } };
2857 dm.dmSize = sizeof(dm);
2859 {
2860 do
2861 {
2862 int iValue;
2863 if (!SetupGetStringFieldW(&InfContext,
2864 0,
2865 szName,
2867 &LineLength))
2868 {
2869 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2870 return;
2871 }
2872
2873 if (!SetupGetStringFieldW(&InfContext,
2874 1,
2875 szValue,
2876 ARRAYSIZE(szValue),
2877 &LineLength))
2878 {
2879 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2880 return;
2881 }
2882 iValue = _wtoi(szValue);
2883 DPRINT1("Name %S Value %i\n", szName, iValue);
2884
2885 if (!iValue)
2886 continue;
2887
2888 if (!_wcsicmp(szName, L"BitsPerPel"))
2889 {
2890 dm.dmFields |= DM_BITSPERPEL;
2891 dm.dmBitsPerPel = iValue;
2892 }
2893 else if (!_wcsicmp(szName, L"XResolution"))
2894 {
2895 dm.dmFields |= DM_PELSWIDTH;
2896 dm.dmPelsWidth = iValue;
2897 }
2898 else if (!_wcsicmp(szName, L"YResolution"))
2899 {
2900 dm.dmFields |= DM_PELSHEIGHT;
2901 dm.dmPelsHeight = iValue;
2902 }
2903 else if (!_wcsicmp(szName, L"VRefresh"))
2904 {
2906 dm.dmDisplayFrequency = iValue;
2907 }
2908 } while (SetupFindNextLine(&InfContext, &InfContext));
2909
2911 }
2912 }
2913
2915 L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce",
2916 0,
2918 &hKey) != ERROR_SUCCESS)
2919 {
2920 DPRINT1("Error: failed to open HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\n");
2921 return;
2922 }
2923
2924 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2925 L"GuiRunOnce",
2926 NULL,
2927 &InfContext))
2928 {
2929 int i = 0;
2930 do
2931 {
2932 if (SetupGetStringFieldW(&InfContext,
2933 0,
2934 szValue,
2935 ARRAYSIZE(szValue),
2936 NULL))
2937 {
2939 swprintf(szName, L"%d", i);
2940 DPRINT("szName %S szValue %S\n", szName, szValue);
2941
2943 {
2944 DPRINT("value %S\n", szPath);
2945 if (RegSetValueExW(hKey,
2946 szName,
2947 0,
2948 REG_SZ,
2949 (const BYTE*)szPath,
2950 (wcslen(szPath) + 1) * sizeof(WCHAR)) == ERROR_SUCCESS)
2951 {
2952 i++;
2953 }
2954 }
2955 }
2956 } while (SetupFindNextLine(&InfContext, &InfContext));
2957 }
2958
2960
2961 if (SetupFindFirstLineW(pSetupData->hSetupInf,
2962 L"Env",
2963 NULL,
2964 &InfContext))
2965 {
2966 if (RegCreateKeyExW(
2967 HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment", 0, NULL,
2969 {
2970 DPRINT1("Error: failed to open HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\n");
2971 return;
2972 }
2973 do
2974 {
2975 if (!SetupGetStringFieldW(&InfContext,
2976 0,
2977 szName,
2979 &LineLength))
2980 {
2981 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2982 return;
2983 }
2984
2985 if (!SetupGetStringFieldW(&InfContext,
2986 1,
2987 szValue,
2988 ARRAYSIZE(szValue),
2989 &LineLength))
2990 {
2991 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
2992 return;
2993 }
2994 DPRINT1("[ENV] %S=%S\n", szName, szValue);
2995
2996 DWORD dwType = wcschr(szValue, '%') != NULL ? REG_EXPAND_SZ : REG_SZ;
2997
2998 if (RegSetValueExW(hKey, szName, 0, dwType, (const BYTE*)szValue, (DWORD)(wcslen(szValue) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
2999 {
3000 DPRINT1(" - Error %d\n", GetLastError());
3001 }
3002
3003 } while (SetupFindNextLine(&InfContext, &InfContext));
3004
3006 }
3007}
3008
3009static BOOL
3011 IN LPCWSTR lpPath1,
3012 IN LPCWSTR lpPath2)
3013{
3014 WCHAR szPath1[MAX_PATH];
3015 WCHAR szPath2[MAX_PATH];
3016
3017 /* If something goes wrong, better return TRUE,
3018 * so the calling function returns early.
3019 */
3020 if (!PathCanonicalizeW(szPath1, lpPath1))
3021 return TRUE;
3022
3023 if (!PathAddBackslashW(szPath1))
3024 return TRUE;
3025
3026 if (!PathCanonicalizeW(szPath2, lpPath2))
3027 return TRUE;
3028
3029 if (!PathAddBackslashW(szPath2))
3030 return TRUE;
3031
3032 return (_wcsicmp(szPath1, szPath2) == 0);
3033}
3034
3035static VOID
3037 IN HKEY hKey,
3038 IN LPWSTR lpPath)
3039{
3040 LONG res;
3041 DWORD dwRegType;
3042 DWORD dwPathLength = 0;
3043 DWORD dwNewLength = 0;
3044 LPWSTR Buffer = NULL;
3045 LPWSTR Path;
3046
3048 hKey,
3049 L"Installation Sources",
3050 NULL,
3051 &dwRegType,
3052 NULL,
3053 &dwPathLength);
3054
3055 if (res != ERROR_SUCCESS ||
3056 dwRegType != REG_MULTI_SZ ||
3057 dwPathLength == 0 ||
3058 dwPathLength % sizeof(WCHAR) != 0)
3059 {
3060 dwPathLength = 0;
3061 goto set;
3062 }
3063
3064 /* Reserve space for existing data + new string */
3065 dwNewLength = dwPathLength + (wcslen(lpPath) + 1) * sizeof(WCHAR);
3066 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3067 if (!Buffer)
3068 return;
3069
3070 ZeroMemory(Buffer, dwNewLength);
3071
3073 hKey,
3074 L"Installation Sources",
3075 NULL,
3076 NULL,
3077 (LPBYTE)Buffer,
3078 &dwPathLength);
3079
3080 if (res != ERROR_SUCCESS)
3081 {
3083 dwPathLength = 0;
3084 goto set;
3085 }
3086
3087 /* Sanity check, these should already be zeros */
3088 Buffer[dwPathLength / sizeof(WCHAR) - 2] = UNICODE_NULL;
3089 Buffer[dwPathLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3090
3091 for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
3092 {
3093 /* Check if path is already added */
3094 if (PathIsEqual(Path, lpPath))
3095 goto cleanup;
3096 }
3097
3098 Path = Buffer + dwPathLength / sizeof(WCHAR) - 1;
3099
3100set:
3101 if (dwPathLength == 0)
3102 {
3103 dwNewLength = (wcslen(lpPath) + 1 + 1) * sizeof(WCHAR);
3104 Buffer = HeapAlloc(GetProcessHeap(), 0, dwNewLength);
3105 if (!Buffer)
3106 return;
3107
3108 Path = Buffer;
3109 }
3110
3111 StringCbCopyW(Path, dwNewLength - (Path - Buffer) * sizeof(WCHAR), lpPath);
3112 Buffer[dwNewLength / sizeof(WCHAR) - 1] = UNICODE_NULL;
3113
3115 hKey,
3116 L"Installation Sources",
3117 0,
3119 (LPBYTE)Buffer,
3120 dwNewLength);
3121
3122cleanup:
3124}
3125
3126VOID
3128 IN OUT PSETUPDATA pSetupData)
3129{
3131 WCHAR szValue[MAX_PATH];
3132 INFCONTEXT InfContext;
3133 DWORD LineLength;
3134 HKEY hKey;
3135 LONG res;
3136
3137 pSetupData->hSetupInf = INVALID_HANDLE_VALUE;
3138
3139 /* Retrieve the path of the setup INF */
3141 wcscat(szPath, L"\\$winnt$.inf");
3142
3143 /* Open the setup INF */
3144 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3145 NULL,
3147 NULL);
3148 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3149 {
3150 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3151 return;
3152 }
3153
3154
3155 /* Retrieve the NT source path from which the 1st-stage installer was run */
3156 if (!SetupFindFirstLineW(pSetupData->hSetupInf,
3157 L"data",
3158 L"sourcepath",
3159 &InfContext))
3160 {
3161 DPRINT1("Error: Cannot find sourcepath Key! %d\n", GetLastError());
3162 return;
3163 }
3164
3165 if (!SetupGetStringFieldW(&InfContext,
3166 1,
3167 szValue,
3168 ARRAYSIZE(szValue),
3169 &LineLength))
3170 {
3171 DPRINT1("Error: SetupGetStringField failed with %d\n", GetLastError());
3172 return;
3173 }
3174
3175 *pSetupData->SourcePath = UNICODE_NULL;
3176
3177 /* Close the setup INF as we are going to modify it manually */
3178 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3179 SetupCloseInfFile(pSetupData->hSetupInf);
3180
3181
3182 /* Find the installation source path in Win32 format */
3183 if (!GetInstallSourceWin32(pSetupData->SourcePath,
3184 _countof(pSetupData->SourcePath),
3185 szValue))
3186 {
3187 *pSetupData->SourcePath = UNICODE_NULL;
3188 }
3189
3190 /* Save the path in Win32 format in the setup INF */
3191 swprintf(szValue, L"\"%s\"", pSetupData->SourcePath);
3192 WritePrivateProfileStringW(L"data", L"dospath", szValue, szPath);
3193
3194 /*
3195 * Save it also in the registry, in the following keys:
3196 * - HKLM\Software\Microsoft\Windows\CurrentVersion\Setup ,
3197 * values "SourcePath" and "ServicePackSourcePath" (REG_SZ);
3198 * - HKLM\Software\Microsoft\Windows NT\CurrentVersion ,
3199 * value "SourcePath" (REG_SZ); set to the full path (e.g. D:\I386).
3200 */
3201#if 0
3203 L"Software\\Microsoft\\Windows NT\\CurrentVersion",
3204 0,
3206 &hKey);
3207
3208 if (res != ERROR_SUCCESS)
3209 {
3210 return FALSE;
3211 }
3212#endif
3213
3215 L"Software\\Microsoft\\Windows\\CurrentVersion\\Setup",
3216 0, NULL,
3218 KEY_ALL_ACCESS, // KEY_WRITE
3219 NULL,
3220 &hKey,
3221 NULL);
3222 if (res == ERROR_SUCCESS)
3223 {
3224 AddInstallationSource(hKey, pSetupData->SourcePath);
3225
3227 L"SourcePath",
3228 0,
3229 REG_SZ,
3230 (LPBYTE)pSetupData->SourcePath,
3231 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3232
3234 L"ServicePackSourcePath",
3235 0,
3236 REG_SZ,
3237 (LPBYTE)pSetupData->SourcePath,
3238 (wcslen(pSetupData->SourcePath) + 1) * sizeof(WCHAR));
3239
3241 }
3242
3243
3244 /* Now, re-open the setup INF (this must succeed) */
3245 pSetupData->hSetupInf = SetupOpenInfFileW(szPath,
3246 NULL,
3248 NULL);
3249 if (pSetupData->hSetupInf == INVALID_HANDLE_VALUE)
3250 {
3251 DPRINT1("Error: Cannot open the setup information file %S with error %d\n", szPath, GetLastError());
3252 return;
3253 }
3254
3255 /* Process the unattended section of the setup file */
3256 ProcessUnattendSection(pSetupData);
3257}
3258
3260
3261VOID
3263{
3264 PROPSHEETHEADER psh = {0};
3265 HPROPSHEETPAGE *phpage = NULL;
3266 PROPSHEETPAGE psp = {0};
3267 UINT nPages = 0;
3268 HWND hWnd;
3269 MSG msg;
3270 PSETUPDATA pSetupData = NULL;
3271 HMODULE hNetShell = NULL;
3273 DWORD dwPageCount = 10, dwNetworkPageCount = 0;
3274
3275 LogItem(L"BEGIN_SECTION", L"InstallWizard");
3276
3277 /* Allocate setup data */
3278 pSetupData = HeapAlloc(GetProcessHeap(),
3280 sizeof(SETUPDATA));
3281 if (pSetupData == NULL)
3282 {
3283 LogItem(NULL, L"SetupData allocation failed!");
3285 L"Setup failed to allocate global data!",
3286 L"ReactOS Setup",
3288 goto done;
3289 }
3291
3292 hNetShell = LoadLibraryW(L"netshell.dll");
3293 if (hNetShell != NULL)
3294 {
3295 DPRINT("Netshell.dll loaded!\n");
3296
3297 pfn = (PFNREQUESTWIZARDPAGES)GetProcAddress(hNetShell,
3298 "NetSetupRequestWizardPages");
3299 if (pfn != NULL)
3300 {
3301 pfn(&dwNetworkPageCount, NULL, NULL);
3302 dwPageCount += dwNetworkPageCount;
3303 }
3304 }
3305
3306 DPRINT("PageCount: %lu\n", dwPageCount);
3307
3308 phpage = HeapAlloc(GetProcessHeap(),
3310 dwPageCount * sizeof(HPROPSHEETPAGE));
3311 if (phpage == NULL)
3312 {
3313 LogItem(NULL, L"Page array allocation failed!");
3315 L"Setup failed to allocate page array!",
3316 L"ReactOS Setup",
3318 goto done;
3319 }
3320
3321 /* Process the $winnt$.inf setup file */
3322 ProcessSetupInf(pSetupData);
3323
3324 /* Create the Welcome page */
3325 psp.dwSize = sizeof(PROPSHEETPAGE);
3326 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3327 psp.hInstance = hDllInstance;
3328 psp.lParam = (LPARAM)pSetupData;
3329 psp.pfnDlgProc = WelcomeDlgProc;
3330 psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
3331 phpage[nPages++] = CreatePropertySheetPage(&psp);
3332
3333 /* Create the Acknowledgements page */
3334 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3335 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ACKTITLE);
3336 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_ACKSUBTITLE);
3337 psp.pszTemplate = MAKEINTRESOURCE(IDD_ACKPAGE);
3338 psp.pfnDlgProc = AckPageDlgProc;
3339 phpage[nPages++] = CreatePropertySheetPage(&psp);
3340
3341 /* Create the Product page */
3342 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3343 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PRODUCTTITLE);
3344 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PRODUCTSUBTITLE);
3345 psp.pszTemplate = MAKEINTRESOURCE(IDD_PRODUCT);
3346 psp.pfnDlgProc = ProductPageDlgProc;
3347 phpage[nPages++] = CreatePropertySheetPage(&psp);
3348
3349 /* Create the Locale page */
3350 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3351 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_LOCALETITLE);
3352 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_LOCALESUBTITLE);
3353 psp.pfnDlgProc = LocalePageDlgProc;
3354 psp.pszTemplate = MAKEINTRESOURCE(IDD_LOCALEPAGE);
3355 phpage[nPages++] = CreatePropertySheetPage(&psp);
3356
3357 /* Create the Owner page */
3358 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3359 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_OWNERTITLE);
3360 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_OWNERSUBTITLE);
3361 psp.pszTemplate = MAKEINTRESOURCE(IDD_OWNERPAGE);
3362 psp.pfnDlgProc = OwnerPageDlgProc;
3363 phpage[nPages++] = CreatePropertySheetPage(&psp);
3364
3365 /* Create the Computer page */
3366 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3367 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_COMPUTERTITLE);
3368 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_COMPUTERSUBTITLE);
3369 psp.pfnDlgProc = ComputerPageDlgProc;
3370 psp.pszTemplate = MAKEINTRESOURCE(IDD_COMPUTERPAGE);
3371 phpage[nPages++] = CreatePropertySheetPage(&psp);
3372
3373 /* Create the DateTime page */
3374 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3375 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DATETIMETITLE);
3376 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DATETIMESUBTITLE);
3377 psp.pfnDlgProc = DateTimePageDlgProc;
3378 psp.pszTemplate = MAKEINTRESOURCE(IDD_DATETIMEPAGE);
3379 phpage[nPages++] = CreatePropertySheetPage(&psp);
3380
3381 /* Create the theme selection page */
3382 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3383 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONTITLE);
3384 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_THEMESELECTIONSUBTITLE);
3385 psp.pfnDlgProc = ThemePageDlgProc;
3386 psp.pszTemplate = MAKEINTRESOURCE(IDD_THEMEPAGE);
3387 phpage[nPages++] = CreatePropertySheetPage(&psp);
3388
3391
3392 if (pfn)
3393 {
3394 pfn(&dwNetworkPageCount, &phpage[nPages], pSetupData);
3395 nPages += dwNetworkPageCount;
3396 }
3397
3398 /* Create the Process page */
3399 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3400 psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
3401 psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
3402 psp.pfnDlgProc = ProcessPageDlgProc;
3403 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
3404 phpage[nPages++] = CreatePropertySheetPage(&psp);
3405
3406 /* Create the Finish page */
3407 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3408 psp.pfnDlgProc = FinishDlgProc;
3409 psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
3410 phpage[nPages++] = CreatePropertySheetPage(&psp);
3411
3412 ASSERT(nPages == dwPageCount);
3413
3414 /* Create the property sheet */
3415 psh.dwSize = sizeof(PROPSHEETHEADER);
3416 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS;
3417 psh.hInstance = hDllInstance;
3418 psh.hwndParent = NULL;
3419 psh.nPages = nPages;
3420 psh.nStartPage = 0;
3421 psh.phpage = phpage;
3422 psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
3423 psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
3424
3425 /* Create title font */
3426 pSetupData->hTitleFont = CreateTitleFont();
3427 pSetupData->hBoldFont = CreateBoldFont();
3428
3429 /* Display the wizard */
3430 hWnd = (HWND)PropertySheet(&psh);
3432
3433 while (GetMessage(&msg, NULL, 0, 0))
3434 {
3435 if (!IsDialogMessage(hWnd, &msg))
3436 {
3439 }
3440 }
3441
3442 DeleteObject(pSetupData->hBoldFont);
3443 DeleteObject(pSetupData->hTitleFont);
3444
3445 if (pSetupData->hSetupInf != INVALID_HANDLE_VALUE)
3446 SetupCloseInfFile(pSetupData->hSetupInf);
3447
3448done:
3449 if (phpage != NULL)
3450 HeapFree(GetProcessHeap(), 0, phpage);
3451
3452 if (hNetShell != NULL)
3453 FreeLibrary(hNetShell);
3454
3455 if (pSetupData != NULL)
3456 HeapFree(GetProcessHeap(), 0, pSetupData);
3457
3458 LogItem(L"END_SECTION", L"InstallWizard");
3459}
3460
3461/* EOF */
static _In_ LPCWSTR LocaleName
PRTL_UNICODE_STRING_BUFFER Path
#define isprint(c)
Definition: acclib.h:73
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
Definition: attrib.c:33
#define IDB_HEADER
Definition: resource.h:30
#define IDS_TIMEOUT
Definition: resource.h:14
#define DPRINT1
Definition: precomp.h:8
HFONT hFont
Definition: main.c:53
SETUPDATA SetupData
Definition: reactos.c:41
struct _SETUPDATA * PSETUPDATA
#define IDS_PROCESSSUBTITLE
Definition: resource.h:98
#define IDS_PROCESSTITLE
Definition: resource.h:97
#define IDC_PROCESSPROGRESS
Definition: resource.h:63
#define IDC_FINISHTITLE
Definition: resource.h:66
#define IDB_WATERMARK
Definition: resource.h:4
#define IDD_PROCESSPAGE
Definition: resource.h:60
#define IDC_ITEM
Definition: resource.h:62
#define IDC_RESTART_PROGRESS
Definition: resource.h:67
BOOL Error
Definition: chkdsk.c:66
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define RegCloseKey(hKey)
Definition: registry.h:49
HIMAGELIST himl
Definition: bufpool.h:45
Definition: _set.h:50
static HINSTANCE hDllInstance
Definition: clb.c:9
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI SetComputerNameW(LPCWSTR lpComputerName)
Definition: compname.c:616
BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer)
Definition: compname.c:648
static HWND hwndParent
Definition: cryptui.c:300
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI SHIM_OBJ_NAME() Notify(DWORD fdwReason, PVOID ptr)
#define IDD_FINISHPAGE
Definition: resource.h:34
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define IDD_DATETIMEPAGE
Definition: resource.h:5
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
#define IDC_TIMEPICKER
Definition: resource.h:11
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_REACTOS_SETUP
Definition: resource.h:140
#define IDC_CHECK1
Definition: resource.h:319
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:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:573
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
static const WCHAR Title[]
Definition: oid.c:1259
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define wcsrchr
Definition: compat.h:16
HANDLE HWND
Definition: compat.h:19
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define lstrlenW
Definition: compat.h:750
static void cleanup(void)
Definition: main.c:1335
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:520
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
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:4600
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:137
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
GEOID WINAPI GetUserGeoID(GEOCLASS GeoClass)
Definition: locale.c:4841
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang)
Definition: locale.c:5495
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
LCID WINAPI GetSystemDefaultLCID(void)
Definition: locale.c:1235
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
LCID lcid
Definition: locale.c:5656
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
_ACRTIMP wchar_t *__cdecl _ultow(__msvcrt_ulong, wchar_t *, int)
Definition: string.c:2199
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
Definition: wcs.c:2773
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
_ACRTIMP int __cdecl rand(void)
Definition: misc.c:59
_ACRTIMP void __cdecl srand(unsigned int)
Definition: misc.c:50
#define IDC_COMPUTERNAME
Definition: resource.h:15
#define IDC_WELCOMETITLE
Definition: resource.h:16
#define IDD_WELCOMEPAGE
Definition: resource.h:21
static const WCHAR CmdLine[]
Definition: install.c:48
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:1330
static const WCHAR RegisterDlls[]
Definition: install.c:118
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
LONG WINAPI SetupGetLineCountW(HINF hinf, PCWSTR section)
Definition: parser.c:1501
void WINAPI SetupTermDefaultQueueCallback(PVOID context)
Definition: queue.c:1656
PVOID WINAPI SetupInitDefaultQueueCallback(HWND owner)
Definition: queue.c:1629
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2781
NTSTATUS SetAdministratorPassword(LPCWSTR Password)
Definition: security.c:1609
struct _ITEMSDATA * PITEMSDATA
#define PM_ITEMS_DONE
Definition: globals.h:64
#define PM_STEP_START
Definition: globals.h:62
#define PM_ITEM_START
Definition: globals.h:52
#define PM_ITEM_END
Definition: globals.h:57
struct _REGISTRATIONNOTIFY * PREGISTRATIONNOTIFY
#define PM_STEP_END
Definition: globals.h:63
HINF hSysSetupInf
Definition: install.c:37
BOOL RegisterTypeLibraries(_In_ PITEMSDATA pItemsData, _In_ PREGISTRATIONNOTIFY pNotify, _In_ HINF hinf, _In_ LPCWSTR szSection)
Definition: install.c:539
VOID InstallStartMenuItems(_In_ PITEMSDATA pItemsData)
Definition: install.c:313
#define IDS_THEMESELECTIONTITLE
Definition: resource.h:134
#define IDC_TASKTEXT4
Definition: resource.h:75
#define IDC_OWNERORGANIZATION
Definition: resource.h:50
#define IDS_LOCALESUBTITLE
Definition: resource.h:124
#define IDD_PRODUCT
Definition: resource.h:109
#define IDD_ACKPAGE
Definition: resource.h:44
#define IDR_GPL
Definition: resource.h:181
#define IDC_VIEWGPL
Definition: resource.h:46
#define IDS_ACKTITLE
Definition: resource.h:114
#define IDC_ADMINPASSWORD2
Definition: resource.h:55
#define IDS_PRODUCTWORKSTATIONNAME
Definition: resource.h:176
#define IDS_LAUTUS
Definition: resource.h:169
#define IDC_PRODUCT_ICON
Definition: resource.h:110
#define IDS_PRODUCTTITLE
Definition: resource.h:173
#define IDS_DEFAULT
Definition: resource.h:179
#define IDS_DLLINSTALL_FAILED
Definition: resource.h:144
#define IDS_REGSVR_FAILED
Definition: resource.h:143
#define IDS_WZD_COMPUTERNAME
Definition: resource.h:152
#define IDD_OWNERPAGE
Definition: resource.h:48
#define IDS_LOADLIBRARY_FAILED
Definition: resource.h:141
#define IDB_LUNAR
Definition: resource.h:25
#define IDS_OWNERSUBTITLE
Definition: resource.h:118
#define IDS_GETPROCADDR_FAILED
Definition: resource.h:142
#define IDS_WZD_PASSWORDMATCH
Definition: resource.h:154
#define IDB_MIZU
Definition: resource.h:26
#define IDD_GPL
Definition: resource.h:92
#define IDS_COMPUTERSUBTITLE
Definition: resource.h:121
#define IDS_LAYOUTTEXT
Definition: resource.h:126
#define IDC_DATEPICKER
Definition: resource.h:64
#define IDC_PROJECTS
Definition: resource.h:45
#define IDC_LOCALETEXT
Definition: resource.h:58
#define IDC_TASKTEXT1
Definition: resource.h:72
#define IDS_CLASSIC
Definition: resource.h:168
#define IDS_LUNAR
Definition: resource.h:170
#define IDC_PRODUCT_OPTIONS
Definition: resource.h:111
#define IDS_WZD_PASSWORDCHAR
Definition: resource.h:155
#define IDC_PRODUCT_DESCRIPTION
Definition: resource.h:112
#define IDC_CHECK3
Definition: resource.h:82
#define IDS_DATETIMESUBTITLE
Definition: resource.h:129
#define IDI_ARROWICON
Definition: resource.h:36
#define IDS_LOCALETITLE
Definition: resource.h:123
#define IDS_PRODUCTWORKSTATIONINFO
Definition: resource.h:178
#define IDS_THEMESELECTIONSUBTITLE
Definition: resource.h:135
#define IDS_REASON_UNKNOWN
Definition: resource.h:146
#define IDS_LOCALETEXT
Definition: resource.h:125
#define IDS_PRODUCTSERVERNAME
Definition: resource.h:175
#define IDC_THEMEPICKER
Definition: resource.h:90
#define IDS_COMPUTERTITLE
Definition: resource.h:120
#define IDS_WZD_LOCALTIME
Definition: resource.h:156
#define IDS_ACKPROJECTS
Definition: resource.h:137
#define IDS_MACHINE_OWNER_NAME
Definition: resource.h:148
#define IDS_WZD_SETCOMPUTERNAME
Definition: resource.h:151
#define IDC_CHECK4
Definition: resource.h:83
#define IDS_MIZU
Definition: resource.h:171
#define IDD_THEMEPAGE
Definition: resource.h:89
#define IDB_LAUTUS
Definition: resource.h:24
#define IDS_WZD_PASSWORDEMPTY
Definition: resource.h:153
#define IDI_CHECKICON
Definition: resource.h:35
#define IDS_WZD_NAME
Definition: resource.h:150
#define IDD_COMPUTERPAGE
Definition: resource.h:52
#define IDC_ADMINPASSWORD1
Definition: resource.h:54
#define IDI_CROSSICON
Definition: resource.h:37
#define IDS_OWNERTITLE
Definition: resource.h:117
#define IDB_CLASSIC
Definition: resource.h:23
#define IDC_LAYOUTTEXT
Definition: resource.h:60
#define IDS_ACKSUBTITLE
Definition: resource.h:115
#define IDS_PRODUCTSUBTITLE
Definition: resource.h:174
#define IDC_TASKTEXT3
Definition: resource.h:74
#define IDS_PRODUCTSERVERINFO
Definition: resource.h:177
#define IDC_GPL_TEXT
Definition: resource.h:93
#define IDS_UNKNOWN_ERROR
Definition: resource.h:140
#define IDS_DATETIMETITLE
Definition: resource.h:128
#define IDS_ADMINISTRATOR_NAME
Definition: resource.h:147
#define IDC_CUSTOMLOCALE
Definition: resource.h:59
#define IDC_CUSTOMLAYOUT
Definition: resource.h:61
#define IDC_OWNERNAME
Definition: resource.h:49
NTSTATUS WINAPI SetAccountsDomainSid(PSID DomainSid, LPCWSTR DomainName)
Definition: security.c:28
#define swprintf
Definition: precomp.h:40
#define RGB(r, g, b)
Definition: precomp.h:67
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
HINSTANCE hInst
Definition: dxdiag.c:13
#define FILEOP_DOIT
Definition: fileqsup.h:48
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
pKey DeleteObject()
GLdouble n
Definition: glext.h:7729
GLuint res
Definition: glext.h:9613
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define INF_STYLE_OLDNT
Definition: infsupp.h:39
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
void * UNKNOWN
Definition: ks.h:2676
#define REG_SZ
Definition: layer.c:22
#define DRIVE_CDROM
Definition: machpc98.h:119
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
__u16 time
Definition: mkdosfs.c:8
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ASSERT(a)
Definition: mode.c:44
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static PLARGE_INTEGER Time
Definition: time.c:105
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
HICON hIcon
Definition: msconfig.c:44
HKL hkl
Definition: msctf.idl:632
UINT_PTR HKL
Definition: msctf.idl:125
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
unsigned int UINT
Definition: ndis.h:50
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1347
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:469
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1268
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
#define KEY_READ
Definition: nt_native.h:1026
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1060
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define KEY_WRITE
Definition: nt_native.h:1034
#define DWORD
Definition: nt_native.h:44
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define KEY_SET_VALUE
Definition: nt_native.h:1020
#define UNICODE_NULL
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
#define MAKEINTRESOURCE(i)
Definition: ntverrsrc.c:25
#define PathCanonicalizeW
Definition: pathcch.h:314
#define PathAddBackslashW
Definition: pathcch.h:302
#define LOWORD(l)
Definition: pedump.c:82
#define WS_SYSMENU
Definition: pedump.c:629
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_MODELESS
Definition: prsht.h:50
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSBTN_FINISH
Definition: prsht.h:148
#define PSWIZB_BACK
Definition: prsht.h:153
#define PSBTN_NEXT
Definition: prsht.h:147
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define PropertySheet
Definition: prsht.h:400
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZFINISH
Definition: prsht.h:122
#define PSN_WIZBACK
Definition: prsht.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define PROPSHEETPAGE
Definition: prsht.h:389
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2413
#define ListView_SetIconSpacing(hwndLV, cx, cy)
Definition: commctrl.h:2728
#define PBM_GETPOS
Definition: commctrl.h:2199
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define CLR_NONE
Definition: commctrl.h:319
#define ListView_SetBkColor(hwnd, clrBk)
Definition: commctrl.h:2299
#define ILC_COLOR32
Definition: commctrl.h:358
#define DateTime_SetSystemtime(hdp, gd, pst)
Definition: commctrl.h:4337
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4371
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVITEM
Definition: commctrl.h:2380
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVIF_TEXT
Definition: commctrl.h:2314
#define ILC_MASK
Definition: commctrl.h:351
#define GDT_VALID
Definition: commctrl.h:4465
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define ListView_SetTextBkColor(hwnd, clrTextBk)
Definition: commctrl.h:2668
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define DateTime_GetSystemtime(hdp, pst)
Definition: commctrl.h:4335
#define LVSIL_NORMAL
Definition: commctrl.h:2303
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define WM_NOTIFY
Definition: richedit.h:61
#define REG_DWORD
Definition: sdbapi.c:615
DWORD LCID
Definition: nls.h:13
wcscat
wcscpy
NTSTATUS NTAPI RtlCreateBootStatusDataFile(VOID)
Definition: bootdata.c:98
#define SPREG_GETPROCADDR
Definition: setupapi.h:655
#define SPREG_REGSVR
Definition: setupapi.h:656
#define SetupDefaultQueueCallback
Definition: setupapi.h:2573
#define SPFILENOTIFY_STARTREGISTRATION
Definition: setupapi.h:571
#define SPINST_REGSVR
Definition: setupapi.h:595
#define SPREG_SUCCESS
Definition: setupapi.h:653
struct _SP_REGISTER_CONTROL_STATUSW * PSP_REGISTER_CONTROL_STATUSW
#define SPREG_TIMEOUT
Definition: setupapi.h:658
#define SPINST_REGISTRY
Definition: setupapi.h:591
#define SPFILENOTIFY_ENDREGISTRATION
Definition: setupapi.h:572
#define SPREG_DLLINSTALL
Definition: setupapi.h:657
#define SPREG_LOADLIBRARY
Definition: setupapi.h:654
#define STATUS_NOT_FOUND
Definition: shellext.h:72
@ SHGFP_TYPE_DEFAULT
Definition: shlobj.h:2156
#define CSIDL_RESOURCES
Definition: shlobj.h:2231
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
base of all file and directory entries
Definition: entries.h:83
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LPCWSTR PreviewBitmap
Definition: wizard.c:1951
UINT DisplayName
Definition: wizard.c:1952
LPCWSTR ThemeFile
Definition: wizard.c:1953
HWND hwndDlg
Definition: globals.h:31
DWORD ReportAsWorkstation
Definition: wizard.c:392
LPCWSTR ProductSuite
Definition: wizard.c:390
LPCWSTR ProductType
Definition: wizard.c:391
PVOID DefaultContext
Definition: wizard.c:35
PREGISTRATIONNOTIFY pNotify
Definition: wizard.c:36
ULONG Registered
Definition: wizard.c:34
ULONG DllCount
Definition: wizard.c:33
LPCWSTR CurrentItem
Definition: globals.h:38
BOOL DisableGeckoInst
Definition: syssetup.h:47
DWORD TimeZoneIndex
Definition: syssetup.h:52
struct _TIMEZONE_ENTRY * TimeZoneListHead
Definition: syssetup.h:50
HFONT hBoldFont
Definition: reactos.h:140
PRODUCT_OPTION ProductOption
Definition: syssetup.h:61
UINT uPostNetworkWizardPage
Definition: syssetup.h:59
HFONT hTitleFont
Definition: reactos.h:139
WCHAR OwnerName[51]
Definition: syssetup.h:42
struct _TIMEZONE_ENTRY * TimeZoneListTail
Definition: syssetup.h:51
UINT uFirstNetworkWizardPage
Definition: syssetup.h:58
HINF hSetupInf
Definition: syssetup.h:56
BOOL UnattendSetup
Definition: syssetup.h:46
WCHAR OwnerOrganization[51]
Definition: syssetup.h:43
DWORD DisableAutoDaylightTimeSet
Definition: syssetup.h:53
SYSTEMTIME SystemTime
Definition: syssetup.h:49
WORD wMilliseconds
Definition: minwinbase.h:263
WORD wSecond
Definition: minwinbase.h:262
WORD wMinute
Definition: minwinbase.h:261
WORD wDayOfWeek
Definition: minwinbase.h:258
Definition: timezone.c:16
REG_TZI_FORMAT TimezoneInfo
Definition: timezone.c:22
WCHAR StandardName[33]
Definition: timezone.c:20
WCHAR DaylightName[33]
Definition: timezone.c:21
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:17
struct _TIMEZONE_ENTRY * Next
Definition: timezone.c:18
WCHAR Description[128]
Definition: timezone.c:19
ULONG Index
Definition: wizard.c:47
SYSTEMTIME DaylightDate
Definition: winbase.h:936
WCHAR DaylightName[32]
Definition: winbase.h:935
WCHAR StandardName[32]
Definition: winbase.h:932
SYSTEMTIME StandardDate
Definition: winbase.h:933
DWORD dmBitsPerPel
Definition: wingdi.h:2093
DWORD dmFields
Definition: wingdi.h:2068
DWORD dmPelsWidth
Definition: wingdi.h:2094
DWORD dmPelsHeight
Definition: wingdi.h:2095
DWORD dmDisplayFrequency
Definition: wingdi.h:2100
WORD dmSize
Definition: wingdi.h:2066
Definition: ftp_var.h:139
Definition: inflate.c:139
Definition: format.c:58
UINT code
Definition: winuser.h:3261
UINT uNewState
Definition: commctrl.h:3041
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
static COORD Position
Definition: mouse.c:34
static BOOL WriteOwnerSettings(WCHAR *OwnerName, WCHAR *OwnerOrganization)
Definition: wizard.c:752
static VOID RegisterComponents(PITEMSDATA pItemsData)
Definition: wizard.c:2241
static const WCHAR * s_ExplorerSoundEvents[][2]
Definition: wizard.c:433
static INT_PTR CALLBACK GplDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:122
static const PRODUCT_OPTION_DATA s_ProductOptionData[]
Definition: wizard.c:397
static BOOL DoWriteSoundEvents(HKEY hKey, LPCWSTR lpSubkey, LPCWSTR lpEventsArray[][2], DWORD dwSize)
Definition: wizard.c:440
struct _PRODUCT_OPTION_DATA PRODUCT_OPTION_DATA
static VOID ShowItemError(HWND hwndDlg, DWORD LastError)
Definition: wizard.c:2355
struct _REGISTRATIONDATA REGISTRATIONDATA
static BOOL GetInstallSourceWin32(OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: wizard.c:2678
static const WCHAR s_szRosVersion[]
Definition: wizard.c:382
static BOOL RunItemCompletionThread(_In_ HWND hwndDlg)
Definition: wizard.c:2322
static UINT CALLBACK RegistrationNotificationProc(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: wizard.c:2074
static VOID CreateTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1658
static VOID SetKeyboardLayoutName(HWND hwnd)
Definition: wizard.c:1227
static BOOL SetSystemLocalTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1790
static VOID WriteUserLocale(VOID)
Definition: wizard.c:1454
static BOOL DoWriteProductOption(PRODUCT_OPTION nOption)
Definition: wizard.c:523
static INT_PTR CALLBACK ComputerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1044
static BOOL PathIsEqual(IN LPCWSTR lpPath1, IN LPCWSTR lpPath2)
Definition: wizard.c:3010
static VOID UpdateLocalSystemTime(HWND hwnd, SYSTEMTIME LocalTime)
Definition: wizard.c:1805
static INT_PTR CALLBACK LocalePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1475
VOID EnableVisualTheme(_In_opt_ HWND hwndParent, _In_opt_ PCWSTR ThemeFile)
Definition: wizard.c:1371
static BOOL WriteDefaultLogonData(LPWSTR Domain)
Definition: wizard.c:974
static void GenerateComputerName(LPWSTR lpBuffer)
Definition: wizard.c:1026
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
Definition: wizard.c:1560
static VOID SetUserLocaleName(HWND hwnd)
Definition: wizard.c:1210
static INT_PTR CALLBACK OwnerPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:794
static BOOL WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
Definition: wizard.c:1813
#define MAX_LAYOUTS_PER_LANGID
static INT_PTR CALLBACK DateTimePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1844
static HFONT CreateBoldFont(VOID)
Definition: wizard.c:101
static BOOL WriteComputerSettings(WCHAR *ComputerName, HWND hwndDlg)
Definition: wizard.c:903
VOID ProcessSetupInf(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:3127
static VOID ShowStepError(HWND hwndDlg, PREGISTRATIONNOTIFY RegistrationNotify)
Definition: wizard.c:2398
static const WCHAR s_szWinlogon[]
Definition: wizard.c:384
static VOID DestroyTimeZoneList(PSETUPDATA SetupData)
Definition: wizard.c:1664
static const WCHAR * s_DefaultSoundEvents[][2]
Definition: wizard.c:403
static BOOL GetLocalSystemTime(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1761
static LONG RetrieveTimeZone(IN HKEY hZoneKey, IN PVOID Context)
Definition: wizard.c:1577
static struct ThemeInfo Themes[]
DWORD(WINAPI * PFNREQUESTWIZARDPAGES)(PDWORD, HPROPSHEETPAGE *, PSETUPDATA)
Definition: wizard.c:3259
void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
Definition: control.c:1177
struct _REGISTRATIONDATA * PREGISTRATIONDATA
static VOID SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
Definition: wizard.c:1716
static INT_PTR CALLBACK ThemePageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:1963
static void OnChooseOption(HWND hwndDlg, PRODUCT_OPTION nOption)
Definition: wizard.c:635
static INT_PTR CALLBACK AckPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:275
static DWORD CALLBACK ItemCompletionThread(LPVOID Parameter)
Definition: wizard.c:2290
static BOOL RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
Definition: wizard.c:1309
static VOID SetInstallationCompleted(VOID)
Definition: wizard.c:2550
static VOID AddInstallationSource(IN HKEY hKey, IN LPWSTR lpPath)
Definition: wizard.c:3036
struct _TIMEZONE_ENTRY * PTIMEZONE_ENTRY
static const WCHAR s_szExplorerSoundEvents[]
Definition: wizard.c:386
VOID ProcessUnattendSection(IN OUT PSETUPDATA pSetupData)
Definition: wizard.c:2735
VOID InstallWizard(VOID)
Definition: wizard.c:3262
struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
static const WCHAR s_szProductOptions[]
Definition: wizard.c:381
static const WCHAR s_szControlWindows[]
Definition: wizard.c:383
static VOID ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData, DWORD dwEntryIndex)
Definition: wizard.c:1686
static INT_PTR CALLBACK ProcessPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:2436
static INT_PTR CALLBACK ProductPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: wizard.c:658
static const WCHAR s_szDefaultSoundEvents[]
Definition: wizard.c:385
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98
enum _PRODUCT_OPTION PRODUCT_OPTION
@ PRODUCT_OPTION_WORKSTATION
Definition: syssetup.h:29
@ PRODUCT_OPTION_DEFAULT
Definition: syssetup.h:30
@ PRODUCT_OPTION_SERVER
Definition: syssetup.h:28
@ Password
Definition: telnetd.h:67
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
VOID EnumerateTimeZoneList(IN PENUM_TIMEZONE_CALLBACK Callback, IN PVOID Context OPTIONAL)
Definition: tzlib.c:223
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
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
BOOL GetTimeZoneListIndex(IN OUT PULONG pIndex)
Definition: tzlib.c:20
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
struct _THEME_FILE THEME_FILE
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_In_ ULONG MessageID
Definition: wdfinterrupt.h:92
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW lpDevMode, DWORD dwflags)
Definition: display.c:612
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:400
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:267
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define ListBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:472
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
@ GEO_FRIENDLYNAME
Definition: winnls.h:634
#define LOCALE_ILANGUAGE
Definition: winnls.h:30
#define LOCALE_SLANGUAGE
Definition: winnls.h:31
@ GEOCLASS_NATION
Definition: winnls.h:621
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegSetValueEx
Definition: winreg.h:540
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define SW_HIDE
Definition: winuser.h:779
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
#define WM_CLOSE
Definition: winuser.h:1649
#define EM_LIMITTEXT
Definition: winuser.h:2029
#define IMAGE_BITMAP
Definition: winuser.h:211
#define DWLP_USER
Definition: winuser.h:883
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define MAKELPARAM(l, h)
Definition: winuser.h:4110
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define STM_SETICON
Definition: winuser.h:2128
#define IDCANCEL
Definition: winuser.h:842
#define IsDialogMessage
Definition: winuser.h:5920
#define BST_UNCHECKED
Definition: winuser.h:199
#define IMAGE_ICON
Definition: winuser.h:212
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)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define GetDlgItemText
Definition: winuser.h:5896
#define LR_CREATEDIBSECTION
Definition: winuser.h:1109
#define WM_COMMAND
Definition: winuser.h:1768
BOOL WINAPI SetForegroundWindow(_In_ HWND)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2555
#define CB_SETCURSEL
Definition: winuser.h:1990
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:893
#define QS_ALLINPUT
Definition: winuser.h:914
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_INITDIALOG
Definition: winuser.h:1767
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define WM_GETFONT
Definition: winuser.h:1679
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define IDI_WINLOGO
Definition: winuser.h:717
#define STM_SETIMAGE
Definition: winuser.h:2129
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define BM_SETCHECK
Definition: winuser.h:1950
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define MB_ICONERROR
Definition: winuser.h:798
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define WM_SETTEXT
Definition: winuser.h:1645
#define GetMessage
Definition: winuser.h:5901
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179
#define HWND_TOP
Definition: winuser.h:1218
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define WM_SETFONT
Definition: winuser.h:1678
#define WM_TIMER
Definition: winuser.h:1770
#define PM_REMOVE
Definition: winuser.h:1207
#define CB_ADDSTRING
Definition: winuser.h:1965
#define LoadIcon
Definition: winuser.h:5924
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5954
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define EM_SETSEL
Definition: winuser.h:2047
#define MB_OK
Definition: winuser.h:801
#define wsprintf
Definition: winuser.h:5976
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define MB_ICONWARNING
Definition: winuser.h:797
#define PostMessage
Definition: winuser.h:5943
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define BN_CLICKED
Definition: winuser.h:1954
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
#define DispatchMessage
Definition: winuser.h:5876
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define CB_GETCURSEL
Definition: winuser.h:1972
#define GWL_STYLE
Definition: winuser.h:863
#define SendDlgItemMessage
Definition: winuser.h:5953
BOOL WINAPI DestroyWindow(_In_ HWND)
#define BST_CHECKED
Definition: winuser.h:197
#define DialogBox
Definition: winuser.h:5872
#define BM_GETCHECK
Definition: winuser.h:1947
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2405
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336
char TCHAR
Definition: xmlstorage.h:189
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193