ReactOS 0.4.17-dev-218-g5635d24
reactos.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS GUI first stage setup application
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Main file
5 * COPYRIGHT: Copyright 2008-2010 Matthias Kupfer <mkupfer@reactos.org>
6 * Copyright 2008-2009 Dmitry Chapyshev <dmitry@reactos.org>
7 * Copyright 2018-2024 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10#include "reactos.h"
11#include <winnls.h> // For GetUserDefaultLCID()
12
13#define NTOS_MODE_USER
14#include <ndk/obfuncs.h>
15
16#include "resource.h"
17
18#define NDEBUG
19#include <debug.h>
20
21/* GLOBALS ******************************************************************/
22
26
27/* The partition where to perform the installation */
29// static PVOLENTRY InstallVolume = NULL;
30#define InstallVolume (InstallPartition->Volume)
31
32/* The system partition we will actually use */
34// static PVOLENTRY SystemVolume = NULL;
35#define SystemVolume (SystemPartition->Volume)
36
37/* UI elements */
39
40
41/* FUNCTIONS ****************************************************************/
42
43static VOID
45{
47 RECT rcParent;
48 RECT rcWindow;
49
51 if (hWndParent == NULL)
53
54 GetWindowRect(hWndParent, &rcParent);
55 GetWindowRect(hWnd, &rcWindow);
56
59 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
60 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
61 0,
62 0,
64}
65
70static HFONT
72 _In_opt_ HFONT hOrigFont,
73 _In_opt_ INT PointSize)
74{
75 LOGFONTW lf = {0};
76
77 if (hOrigFont)
78 {
79 GetObjectW(hOrigFont, sizeof(lf), &lf);
80 }
81 else
82 {
83 NONCLIENTMETRICSW ncm;
84 ncm.cbSize = sizeof(ncm);
85 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
86 lf = ncm.lfMessageFont;
87 }
88
89 /* Make the font bold, keeping the other attributes */
90 lf.lfWeight = FW_BOLD;
91
92 /* Determine the font height (logical units) if necessary */
93 if (PointSize)
94 {
95 HDC hdc = GetDC(NULL);
96 lf.lfHeight = -MulDiv(PointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
97 // lf.lfWidth = 0;
99 }
100
101 return CreateFontIndirect(&lf);
102}
103
104static inline HFONT
106 _In_opt_ HFONT hOrigFont)
107{
108 /* Title font is 12pt bold */
109 return CreateBoldFont(hOrigFont, 12);
110}
111
112size_t
115 _In_ UINT uID,
117 _In_opt_ size_t cchBufferLen /*,
118 _In_opt_ PCWSTR pDefaultString*/)
119{
120 PCWSTR pStr;
121 size_t Length;
122
123 /* Try to load the string from the resource */
124 Length = LoadStringW(hInstance, uID, (PWSTR)&pStr, 0);
125 if (Length == 0)
126 {
127 /* No resource string was found, return NULL */
128 *pString = NULL;
129 return 0;
130 }
131
132 /* If the caller gave a pointer to a buffer on input, verify whether it
133 * is large enough to contain the string. If not, allocate a new buffer. */
134 if (!*pString || (cchBufferLen < Length + 1))
135 {
136 /* Allocate a new buffer, adding a NUL-terminator */
137 *pString = HeapAlloc(GetProcessHeap(), 0, (Length + 1) * sizeof(WCHAR));
138 if (!*pString)
139 return 0;
140 }
141
142 /* Copy the string, NUL-terminated */
143 StringCchCopyNW(*pString, Length + 1, pStr, Length);
144 return Length;
145}
146
147size_t
150 _In_opt_ size_t cchBufferLen,
151 _In_ PCWSTR pszFormat,
153{
154 size_t Length;
155
156 /* Retrieve the message length. If it is too long, allocate
157 * an auxiliary buffer; otherwise use the caller's buffer. */
158 Length = _vscwprintf(pszFormat, args); // Doesn't count the NUL-terminator.
159 if (!*pString || (Length >= cchBufferLen))
160 {
161 /* Allocate a new buffer, adding a NUL-terminator */
163 if (!*pString)
164 return 0;
165 }
166
167 /* Do the printf */
168 StringCchVPrintfW(*pString, Length + 1, pszFormat, args);
169 return Length;
170}
171
172INT
175 _In_ UINT uType,
176 _In_opt_ PCWSTR pszTitle,
177 _In_opt_ PCWSTR pszFormatMessage,
179{
180 INT iRes;
182 MSGBOXPARAMSW mb = {0};
184 WCHAR StaticBuffer[256];
185 PWSTR Buffer = StaticBuffer; // Use the static buffer by default.
186
187 /* We need to retrieve the current module's instance handle if either
188 * the title or the format message is specified by a resource ID */
189 if ((pszTitle && IS_INTRESOURCE(pszTitle)) || IS_INTRESOURCE(pszFormatMessage))
190 hInstance = GetModuleHandleW(NULL); // SetupData.hInstance;
191
192 /* Retrieve the format message string if this is a resource */
193 if (pszFormatMessage && IS_INTRESOURCE(pszFormatMessage))
194 {
195 Format = NULL;
196 (void)LoadAllocStringW(hInstance, PtrToUlong(pszFormatMessage), &Format, 0);
197 }
198 else
199 {
200 Format = (PWSTR)pszFormatMessage;
201 }
202
203 if (Format)
204 {
205 /* Format the message and retrieve its length. If it is too long,
206 * an auxiliary buffer is allocated; otherwise the static buffer
207 * is used. The string is built to be NUL-terminated. */
209 if (!Buffer)
210 {
211 /* Allocation failed, use the original format string verbatim */
212 Buffer = Format;
213 }
214 }
215 else
216 {
217 Format = (PWSTR)pszFormatMessage;
218 Buffer = Format;
219 }
220
221 /* Display the message */
222 mb.cbSize = sizeof(mb);
223 mb.hwndOwner = hWnd;
224 mb.hInstance = hInstance;
225 mb.lpszText = Buffer;
226 mb.lpszCaption = pszTitle;
227 mb.dwStyle = uType;
229 iRes = MessageBoxIndirectW(&mb);
230
231 /* Free the buffers if needed */
232 if ((Buffer != StaticBuffer) && (Buffer != Format))
234
235 if (Format && (Format != pszFormatMessage))
237
238 return iRes;
239}
240
241INT
245 _In_ UINT uType,
246 _In_opt_ PCWSTR pszTitle,
247 _In_opt_ PCWSTR pszFormatMessage,
248 ...)
249{
250 INT iRes;
252
253 va_start(args, pszFormatMessage);
254 iRes = DisplayMessageV(hWnd, uType, pszTitle, pszFormatMessage, args);
255 va_end(args);
256
257 return iRes;
258}
259
260INT
264 _In_ UINT uIDTitle,
265 _In_ UINT uIDMessage,
266 ...)
267{
268 INT iRes;
270
271 va_start(args, uIDMessage);
273 MAKEINTRESOURCEW(uIDTitle),
274 MAKEINTRESOURCEW(uIDMessage),
275 args);
276 va_end(args);
277
278 return iRes;
279}
280
281VOID
283 _In_ HWND hWnd,
285 _In_ UINT uID /*,
286 _In_opt_ PCWSTR pDefaultString*/)
287{
288 WCHAR szText[256];
289 PWSTR String = szText; // Use the static buffer by default.
290
291 /* Try to load the string from the resource */
293 if (!String)
294 return;
296 if (String != szText)
298}
299
300VOID
302 _In_ HWND hWnd,
304 _In_ UINT uID,
306{
307 WCHAR ResBuffer[256];
308 WCHAR szText[256];
309 PWSTR ResFmt = ResBuffer; // Use the static buffers by default.
310 PWSTR String = szText;
311
312 /* Try to load the string from the resource */
313 (void)LoadAllocStringW(hInstance, uID, &ResFmt, _countof(ResBuffer));
314 if (!ResFmt)
315 return;
316
317 /* Format the string and retrieve its length. If it is too long,
318 * an auxiliary buffer is allocated; otherwise the static buffer
319 * is used. The string is built to be NUL-terminated. */
320 (void)FormatAllocStringWV(&String, _countof(szText), ResFmt, args);
321 if (!String)
322 {
323 /* Allocation failed, use the original format string verbatim */
324 String = ResFmt;
325 }
326
328
329 /* Free the buffers if needed */
330 if ((String != szText) && (String != ResFmt))
332
333 if (ResFmt && (ResFmt != ResBuffer))
334 HeapFree(GetProcessHeap(), 0, ResFmt);
335}
336
337VOID
340 _In_ HWND hWnd,
342 _In_ UINT uID,
343 ...)
344{
346
347 va_start(args, uID);
349 va_end(args);
350}
351
352static INT_PTR CALLBACK
354 IN HWND hwndDlg,
355 IN UINT uMsg,
358{
359 PSETUPDATA pSetupData;
360
361 /* Retrieve pointer to the global setup data */
362 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
363
364 switch (uMsg)
365 {
366 case WM_INITDIALOG:
367 {
368 /* Save pointer to the global setup data */
369 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
370 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
371
372 /* Set title font */
373 SetDlgItemFont(hwndDlg, IDC_STARTTITLE, pSetupData->hTitleFont, TRUE);
374
375 // TEMPTEMP: Set the ReactOS-Alpha information in bold.
376 // TODO: Remove once we reach 0.5/Beta :)
377 SetDlgItemFont(hwndDlg, IDC_WARNTEXT1, pSetupData->hBoldFont, TRUE);
378 SetDlgItemFont(hwndDlg, IDC_WARNTEXT2, pSetupData->hBoldFont, TRUE);
379 SetDlgItemFont(hwndDlg, IDC_WARNTEXT3, pSetupData->hBoldFont, TRUE);
380
381 /* Center the wizard window */
382 CenterWindow(GetParent(hwndDlg));
383 break;
384 }
385
386 case WM_NOTIFY:
387 {
388 LPNMHDR lpnm = (LPNMHDR)lParam;
389
390 switch (lpnm->code)
391 {
392 case PSN_SETACTIVE:
393 {
394 /* Only "Next" and "Cancel" for the first page and hide "Back" */
396 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
398 break;
399 }
400
401 case PSN_KILLACTIVE:
402 {
403 /* Show "Back" button */
404 // PropSheet_ShowWizButtons(GetParent(hwndDlg), PSWIZB_BACK, PSWIZB_BACK);
406 break;
407 }
408
409 default:
410 break;
411 }
412 }
413 break;
414
415 default:
416 break;
417 }
418
419 return FALSE;
420}
421
422static INT_PTR CALLBACK
424 IN HWND hwndDlg,
425 IN UINT uMsg,
428{
429 PSETUPDATA pSetupData;
430
431 /* Retrieve pointer to the global setup data */
432 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
433
434 switch (uMsg)
435 {
436 case WM_INITDIALOG:
437 {
438 /* Save pointer to the global setup data */
439 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
440 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
441
442 /* Set the options in bold */
443 SetDlgItemFont(hwndDlg, IDC_INSTALL, pSetupData->hBoldFont, TRUE);
444 SetDlgItemFont(hwndDlg, IDC_UPDATE, pSetupData->hBoldFont, TRUE);
445
446 /* Check the "Install" radio button */
448
449 /*
450 * Enable the "Update" radio button and text only if we have
451 * available NT installations, otherwise disable them.
452 */
453 if (pSetupData->NtOsInstallsList &&
454 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0)
455 {
458 }
459 else
460 {
463 }
464
465 break;
466 }
467
468 case WM_NOTIFY:
469 {
470 LPNMHDR lpnm = (LPNMHDR)lParam;
471
472 switch (lpnm->code)
473 {
474 case PSN_SETACTIVE:
476 break;
477
479 {
480 /* Focus on "Install ReactOS" */
482 return TRUE;
483 }
484
485 case PSN_QUERYCANCEL:
486 {
487 if (DisplayMessage(GetParent(hwndDlg),
491 {
492 /* Go to the Abort page */
494 }
495
496 /* Do not close the wizard too soon */
498 return TRUE;
499 }
500
501 case PSN_WIZNEXT: /* Set the selected data */
502 {
503 /*
504 * Go update only if we have available NT installations
505 * and we choose to do so.
506 */
507 if (pSetupData->NtOsInstallsList &&
508 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
510 {
511 pSetupData->RepairUpdateFlag = TRUE;
512
513 /*
514 * Display the existing NT installations page only
515 * if we have more than one available NT installations.
516 */
517 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
518 {
519 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
520
521 /* Actually the best would be to dynamically insert the page only when needed */
523 }
524 else
525 {
526 /* Retrieve the current installation */
527 pSetupData->CurrentInstallation =
529
531 }
532 }
533 else
534 {
535 pSetupData->CurrentInstallation = NULL;
536 pSetupData->RepairUpdateFlag = FALSE;
538 }
539
540 return TRUE;
541 }
542
543 default:
544 break;
545 }
546 }
547 break;
548
549 default:
550 break;
551 }
552
553 return FALSE;
554}
555
556
557
558BOOL
561 IN HWND hWndListView,
562 IN const UINT* pIDs,
563 IN const INT* pColsWidth,
564 IN const INT* pColsAlign,
565 IN UINT nNumOfColumns)
566{
567 UINT i;
568 LVCOLUMN lvC;
569 WCHAR szText[50];
570
571 /* Create the columns */
572 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
573 lvC.pszText = szText;
574
575 /* Load the column labels from the resource file */
576 for (i = 0; i < nNumOfColumns; i++)
577 {
578 lvC.iSubItem = i;
579 lvC.cx = pColsWidth[i];
580 lvC.fmt = pColsAlign[i];
581
582 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
583
584 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
585 return FALSE;
586 }
587
588 return TRUE;
589}
590
591typedef VOID
595 IN SIZE_T cchBufferSize);
596
597VOID
601 IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
602{
603 INT Index, CurrentEntryIndex = 0;
604 PGENERIC_LIST_ENTRY ListEntry;
606 WCHAR CurrentItemText[256];
607
608 for (Entry = List->ListHead.Flink;
609 Entry != &List->ListHead;
610 Entry = Entry->Flink)
611 {
613
614 if (GetEntryDescriptionProc)
615 {
616 GetEntryDescriptionProc(ListEntry,
617 CurrentItemText,
618 ARRAYSIZE(CurrentItemText));
619 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
620 }
621 else
622 {
624 }
625
626 if (ListEntry == List->CurrentEntry)
627 CurrentEntryIndex = Index;
628
630 }
631
632 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
633}
634
635PVOID
638{
639 INT Index;
640
642 if (Index == CB_ERR)
643 return NULL;
644
646}
647
648typedef VOID
651 IN LVITEM* plvItem,
654 IN SIZE_T cchBufferSize);
655
656VOID
660 IN PADD_ENTRY_ITEM AddEntryItemProc)
661{
662 INT CurrentEntryIndex = 0;
663 LVITEM lvItem;
664 PGENERIC_LIST_ENTRY ListEntry;
666 WCHAR CurrentItemText[256];
667
668 for (Entry = List->ListHead.Flink;
669 Entry != &List->ListHead;
670 Entry = Entry->Flink)
671 {
673
674 if (!AddEntryItemProc)
675 continue;
676
677 AddEntryItemProc(hWndList,
678 &lvItem,
679 ListEntry,
680 CurrentItemText,
681 ARRAYSIZE(CurrentItemText));
682
683 if (ListEntry == List->CurrentEntry)
684 CurrentEntryIndex = lvItem.iItem;
685 }
686
687 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
688 ListView_SetItemState(hWndList, CurrentEntryIndex,
691}
692
693PVOID
696{
697 INT Index;
698 LVITEM item;
699
701 if (Index == LB_ERR)
702 return NULL;
703
704 item.mask = LVIF_PARAM;
705 item.iItem = Index;
707
708 return (PVOID)item.lParam;
709}
710
711
712static VOID
713NTAPI
717 IN SIZE_T cchBufferSize)
718{
719 StringCchCopyW(Buffer, cchBufferSize,
721}
722
723static VOID
724NTAPI
727 IN LVITEM* plvItem,
729 IN OUT PWSTR Buffer, // SystemRootPath
730 IN SIZE_T cchBufferSize)
731{
733 PVOLINFO VolInfo = (NtOsInstall->Volume ? &NtOsInstall->Volume->Info : NULL);
734
735 if (VolInfo && VolInfo->DriveLetter)
736 {
737 /* We have retrieved a partition that is mounted */
738 StringCchPrintfW(Buffer, cchBufferSize,
739 L"%c:%s",
740 VolInfo->DriveLetter,
741 NtOsInstall->PathComponent);
742 }
743 else
744 {
745 /* We failed somewhere, just show the NT path */
746 StringCchPrintfW(Buffer, cchBufferSize,
747 L"%wZ",
748 &NtOsInstall->SystemNtPath);
749 }
750
751 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
752 plvItem->iItem = 0;
753 plvItem->iSubItem = 0;
754 plvItem->lParam = (LPARAM)Entry;
755 plvItem->pszText = NtOsInstall->InstallationName;
756
757 /* Associate vendor icon */
758 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
759 {
760 plvItem->mask |= LVIF_IMAGE;
761 plvItem->iImage = 0;
762 }
763 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
764 {
765 plvItem->mask |= LVIF_IMAGE;
766 plvItem->iImage = 1;
767 }
768
769 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
770
771 plvItem->iSubItem = 1;
772 plvItem->pszText = Buffer; // SystemRootPath;
773 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
774
775 plvItem->iSubItem = 2;
776 plvItem->pszText = NtOsInstall->VendorName;
777 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
778}
779
780
781#define IDS_LIST_COLUMN_FIRST IDS_INSTALLATION_NAME
782#define IDS_LIST_COLUMN_LAST IDS_INSTALLATION_VENDOR
783
784#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
786static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100};
788
789static INT_PTR CALLBACK
791 IN HWND hwndDlg,
792 IN UINT uMsg,
795{
796 PSETUPDATA pSetupData;
797 HWND hList;
798 HIMAGELIST hSmall;
799
800 /* Retrieve pointer to the global setup data */
801 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
802
803 switch (uMsg)
804 {
805 case WM_INITDIALOG:
806 {
807 /* Save pointer to the global setup data */
808 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
809 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
810
811 /*
812 * Keep the "Next" button disabled. It will be enabled only
813 * when the user selects an installation to upgrade.
814 */
816
817 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
818
820
821 CreateListViewColumns(pSetupData->hInstance,
822 hList,
827
828 /* Create the ImageList */
831 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
832 1, 1);
833
834 /* Add event type icons to the ImageList */
835 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_ROSICON)));
836 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_WINICON)));
837
838 /* Assign the ImageList to the List View */
840
841 InitGenericListView(hList, pSetupData->NtOsInstallsList, AddNTOSInstallationItem);
842 break;
843 }
844
845 case WM_DESTROY:
846 {
847 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
850 ImageList_Destroy(hSmall);
851 return TRUE;
852 }
853
854 case WM_COMMAND:
855 switch (LOWORD(wParam))
856 {
857 case IDC_SKIPUPGRADE:
858 {
859 /* Skip the upgrade and do the usual new-installation workflow */
860 pSetupData->CurrentInstallation = NULL;
861 pSetupData->RepairUpdateFlag = FALSE;
863 return TRUE;
864 }
865 }
866 break;
867
868 case WM_NOTIFY:
869 {
870 LPNMHDR lpnm = (LPNMHDR)lParam;
871
872 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
873 {
875
876 if (pnmv->uChanged & LVIF_STATE) /* The state has changed */
877 {
878 /* The item has been (de)selected */
879 if (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED))
880 {
882 }
883 else
884 {
885 /*
886 * Keep the "Next" button disabled. It will be enabled only
887 * when the user selects an installation to upgrade.
888 */
890 }
891 }
892
893 break;
894 }
895
896 switch (lpnm->code)
897 {
898#if 0
899 case PSN_SETACTIVE:
900 {
901 /*
902 * Keep the "Next" button disabled. It will be enabled only
903 * when the user selects an installation to upgrade.
904 */
906 break;
907 }
908#endif
909
911 {
912 /* Give the focus on and select the first item */
913 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
916 return TRUE;
917 }
918
919 case PSN_QUERYCANCEL:
920 {
921 if (DisplayMessage(GetParent(hwndDlg),
925 {
926 /* Go to the Abort page */
928 }
929
930 /* Do not close the wizard too soon */
932 return TRUE;
933 }
934
935 case PSN_WIZNEXT: /* Set the selected data */
936 {
937 /*
938 * Go update only if we have available NT installations
939 * and we choose to do so.
940 */
941 if (!pSetupData->NtOsInstallsList ||
943 {
944 pSetupData->CurrentInstallation = NULL;
945 pSetupData->RepairUpdateFlag = FALSE;
946 break;
947 }
948
949 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
952
953 /* Retrieve the current installation */
954 pSetupData->CurrentInstallation =
956
957 /* We perform an upgrade */
958 pSetupData->RepairUpdateFlag = TRUE;
959 return TRUE;
960 }
961
962 default:
963 break;
964 }
965 }
966 break;
967
968 default:
969 break;
970 }
971
972 return FALSE;
973}
974
975static INT_PTR CALLBACK
977 IN HWND hwndDlg,
978 IN UINT uMsg,
981{
982 PSETUPDATA pSetupData;
983 HWND hList;
984
985 /* Retrieve pointer to the global setup data */
986 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
987
988 switch (uMsg)
989 {
990 case WM_INITDIALOG:
991 {
992 /* Save pointer to the global setup data */
993 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
994 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
995
996 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
997 InitGenericComboList(hList, pSetupData->USetupData.ComputerList, GetSettingDescription);
998
999 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1000 InitGenericComboList(hList, pSetupData->USetupData.DisplayList, GetSettingDescription);
1001
1002 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1003 InitGenericComboList(hList, pSetupData->USetupData.KeyboardList, GetSettingDescription);
1004
1005 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1006 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
1007
1008 break;
1009 }
1010
1011 case WM_NOTIFY:
1012 {
1013 LPNMHDR lpnm = (LPNMHDR)lParam;
1014
1015 switch (lpnm->code)
1016 {
1017 case PSN_SETACTIVE:
1019 break;
1020
1022 {
1023 /* Focus on "Computer" list */
1025 return TRUE;
1026 }
1027
1028 case PSN_QUERYCANCEL:
1029 {
1030 if (DisplayMessage(GetParent(hwndDlg),
1034 {
1035 /* Go to the Abort page */
1037 }
1038
1039 /* Do not close the wizard too soon */
1041 return TRUE;
1042 }
1043
1044 case PSN_WIZNEXT: /* Set the selected data */
1045 {
1046 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
1049
1050 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1053
1054 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1057
1058 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1059 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
1060 // GetSelectedComboListItem(hList));
1061
1062 return TRUE;
1063 }
1064
1065 default:
1066 break;
1067 }
1068 }
1069 break;
1070
1071 default:
1072 break;
1073 }
1074
1075 return FALSE;
1076}
1077
1078static INT_PTR CALLBACK
1080 IN HWND hwndDlg,
1081 IN UINT uMsg,
1084{
1085 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
1086
1087 PSETUPDATA pSetupData;
1088
1089 /* Retrieve pointer to the global setup data */
1090 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1091
1092 switch (uMsg)
1093 {
1094 case WM_INITDIALOG:
1095 {
1096 /* Save pointer to the global setup data */
1097 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1098 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1099 break;
1100 }
1101
1102 case WM_COMMAND:
1103 {
1105 {
1106 // Ideally we could add the PSWIZBF_ELEVATIONREQUIRED style.
1109 else
1111 }
1112 break;
1113 }
1114
1115 case WM_NOTIFY:
1116 {
1117 LPNMHDR lpnm = (LPNMHDR)lParam;
1118
1119 switch (lpnm->code)
1120 {
1121 case PSN_SETACTIVE:
1122 {
1123 WCHAR CurrentItemText[256];
1124
1126
1127 /* Show the current selected settings */
1128
1129 // FIXME! Localize
1130 if (pSetupData->RepairUpdateFlag)
1131 {
1132 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1133 L"Upgrading/Repairing \"%s\" from \"%s\"",
1135 pSetupData->CurrentInstallation->VendorName);
1136 }
1137 else
1138 {
1139 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1140 L"New ReactOS installation");
1141 }
1142 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
1143
1144 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
1145 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
1146
1148 CurrentItemText,
1149 ARRAYSIZE(CurrentItemText));
1150 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
1151
1153 CurrentItemText,
1154 ARRAYSIZE(CurrentItemText));
1155 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
1156
1158 CurrentItemText,
1159 ARRAYSIZE(CurrentItemText));
1160 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
1161
1162 if (InstallVolume->Info.DriveLetter)
1163 {
1164#if 0
1165 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1166 L"%c: \x2014 %wZ",
1167 InstallVolume->Info.DriveLetter,
1168 &pSetupData->USetupData.DestinationRootPath);
1169#else
1170 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1171 L"%c: \x2014 Harddisk %lu, Partition %lu",
1172 InstallVolume->Info.DriveLetter,
1173 InstallPartition->DiskEntry->DiskNumber,
1175#endif
1176 }
1177 else
1178 {
1179#if 0
1180 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1181 L"%wZ",
1182 &pSetupData->USetupData.DestinationRootPath);
1183#else
1184 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1185 L"Harddisk %lu, Partition %lu",
1186 InstallPartition->DiskEntry->DiskNumber,
1188#endif
1189 }
1190 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
1191
1192 SetDlgItemTextW(hwndDlg, IDC_PATH,
1194 /*pSetupData->USetupData.InstallPath.Buffer*/);
1195
1196
1197 /* Change the "Next" button text to "Install" */
1198 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
1200 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
1202 pSetupData->hInstance,
1204
1205 /*
1206 * Keep the "Next" button disabled. It will be enabled only
1207 * when the user clicks on the installation approval checkbox.
1208 */
1211 break;
1212 }
1213
1215 {
1216 /* Focus on the confirmation check-box */
1218 return TRUE;
1219 }
1220
1221 case PSN_KILLACTIVE:
1222 {
1223 /* Restore the original "Next" button text */
1224 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
1225 break;
1226 }
1227
1228 case PSN_QUERYCANCEL:
1229 {
1230 if (DisplayMessage(GetParent(hwndDlg),
1234 {
1235 /* Go to the Abort page */
1237 }
1238
1239 /* Do not close the wizard too soon */
1241 return TRUE;
1242 }
1243
1244 default:
1245 break;
1246 }
1247 break;
1248 }
1249
1250 default:
1251 break;
1252 }
1253
1254 return FALSE;
1255}
1256
1257
1258typedef struct _FSVOL_CONTEXT
1259{
1261 // PAGE_NUMBER NextPageOnAbort;
1263
1264static
1265BOOLEAN
1266NTAPI
1269 _In_ ULONG Modifier,
1270 _In_ PVOID Argument)
1271{
1272 switch (Command)
1273 {
1274 case PROGRESS:
1275 {
1276 PULONG Percent = (PULONG)Argument;
1277 DPRINT("%lu percent completed\n", *Percent);
1279 break;
1280 }
1281
1282#if 0
1283 case OUTPUT:
1284 {
1285 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
1286 DPRINT("%s\n", output->Output);
1287 break;
1288 }
1289#endif
1290
1291 case DONE:
1292 {
1293#if 0
1294 PBOOLEAN Success = (PBOOLEAN)Argument;
1295 if (*Success == FALSE)
1296 {
1297 DPRINT("FormatEx was unable to complete successfully.\n\n");
1298 }
1299#endif
1300 DPRINT("Done\n");
1301 break;
1302 }
1303
1304 default:
1305 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1306 break;
1307 }
1308
1309 return TRUE;
1310}
1311
1312static
1313BOOLEAN
1314NTAPI
1317 _In_ ULONG Modifier,
1318 _In_ PVOID Argument)
1319{
1320 switch (Command)
1321 {
1322 default:
1323 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1324 break;
1325 }
1326
1327 return TRUE;
1328}
1329
1330// PFSVOL_CALLBACK
1331static FSVOL_OP
1335 _In_ FSVOLNOTIFY FormatStatus,
1336 _In_ ULONG_PTR Param1,
1337 _In_ ULONG_PTR Param2)
1338{
1339 PFSVOL_CONTEXT FsVolContext = (PFSVOL_CONTEXT)Context;
1340
1341 switch (FormatStatus)
1342 {
1343 // FIXME: Deprecate!
1345 {
1346 // PPARTENTRY SystemPartition = (PPARTENTRY)Param1;
1347
1348 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1349 // if (ChangeSystemPartitionPage(Ir, SystemPartition))
1350 // return FSVOL_DOIT;
1351 return FSVOL_ABORT;
1352 }
1353
1355 {
1356 switch (Param1)
1357 {
1359 {
1360 // ERROR_WRITE_PTABLE
1362 0, // Default to "Error"
1364 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1365 // TODO: Go back to the partitioning page?
1366 break;
1367 }
1368
1370 {
1371 /* FIXME: improve the error dialog */
1372 //
1373 // Error dialog should say that we cannot find a suitable
1374 // system partition and create one on the system. At this point,
1375 // it may be nice to ask the user whether he wants to continue,
1376 // or use an external drive as the system drive/partition
1377 // (e.g. floppy, USB drive, etc...)
1378 //
1380 0, // Default to "Error"
1382 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1383 // TODO: Go back to the partitioning page
1384 break;
1385 }
1386
1387 default:
1388 break;
1389 }
1390 return FSVOL_ABORT;
1391 }
1392
1395 // NOTE: If needed, clear progress gauges.
1396 return FSVOL_DOIT;
1397
1399 {
1400 if ((FSVOL_OP)Param1 == FSVOL_FORMAT)
1401 {
1402 /*
1403 * In case we just repair an existing installation, or make
1404 * an unattended setup without formatting, just go to the
1405 * filesystem check step.
1406 */
1407 if (FsVolContext->pSetupData->RepairUpdateFlag)
1408 return FSVOL_SKIP;
1411 return FSVOL_SKIP;
1413 /* Set status text */
1415 }
1416 else
1417 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1418 {
1419 /* Set status text */
1421
1422 /* Filechecking step: set progress marquee style and start it up */
1426 }
1427
1428 return FSVOL_DOIT;
1429 }
1430
1432 {
1433 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1434 {
1435 /* File-checking finished: stop the progress bar and restore its style */
1438 }
1439 return 0;
1440 }
1441
1443 {
1444 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1445
1446 // FIXME: See also FSVOLNOTIFY_PARTITIONERROR
1447 if (FmtInfo->ErrorStatus == STATUS_PARTITION_FAILURE)
1448 {
1449 // ERROR_WRITE_PTABLE
1451 0, // Default to "Error"
1453 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1454 // TODO: Go back to the partitioning page?
1455 return FSVOL_ABORT;
1456 }
1457 else
1459 {
1460 /* FIXME: show an error dialog */
1461 // MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
1463 0, // Default to "Error"
1465 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1466 return FSVOL_ABORT;
1467 }
1468 else
1469 if (FmtInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1470 {
1471 INT nRet;
1472
1474 NULL, // Default to "Error"
1476 FmtInfo->FileSystemName);
1477 if (nRet == IDCANCEL)
1478 {
1479 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1480 return FSVOL_ABORT;
1481 }
1482 else if (nRet == IDOK)
1483 {
1484 return FSVOL_RETRY;
1485 }
1486 }
1487 else if (!NT_SUCCESS(FmtInfo->ErrorStatus))
1488 {
1489 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1490
1491 DPRINT1("FormatPartition() failed with status 0x%08lx\n", FmtInfo->ErrorStatus);
1492
1493 // ERROR_FORMATTING_PARTITION
1495 0, // Default to "Error"
1497 FmtInfo->Volume->Info.DeviceName);
1498 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1499 return FSVOL_ABORT;
1500 }
1501
1502 return FSVOL_RETRY;
1503 }
1504
1506 {
1507 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1508
1509 if (ChkInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1510 {
1511 INT nRet;
1512
1514 NULL, // Default to "Error"
1516 ChkInfo->Volume->Info.FileSystem);
1517 if (nRet == IDCANCEL)
1518 {
1519 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1520 return FSVOL_ABORT;
1521 }
1522 else if (nRet == IDOK)
1523 {
1524 return FSVOL_SKIP;
1525 }
1526 }
1527 else if (!NT_SUCCESS(ChkInfo->ErrorStatus))
1528 {
1529 DPRINT1("ChkdskPartition() failed with status 0x%08lx\n", ChkInfo->ErrorStatus);
1530
1532 0, // Default to "Error"
1534 ChkInfo->ErrorStatus);
1535 return FSVOL_SKIP;
1536 }
1537
1538 return FSVOL_SKIP;
1539 }
1540
1542 {
1543 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1544 PVOL_CREATE_INFO VolCreate;
1545
1546 ASSERT((FSVOL_OP)Param2 == FSVOL_FORMAT);
1547
1548 /* Find the volume info in the partition TreeList UI.
1549 * If none, don't format it. */
1551 FmtInfo->Volume);
1552 if (!VolCreate)
1553 return FSVOL_SKIP;
1554 ASSERT(VolCreate->Volume == FmtInfo->Volume);
1555
1556 /* If there is no formatting information, skip it */
1557 if (!*VolCreate->FileSystemName)
1558 return FSVOL_SKIP;
1559
1560 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1561
1562 /* Set status text */
1563 if (FmtInfo->Volume->Info.DriveLetter)
1564 {
1567 IDS_FORMATTING_PROGRESS1, // L"Formatting volume %c: (%s) in %s..."
1568 FmtInfo->Volume->Info.DriveLetter,
1569 FmtInfo->Volume->Info.DeviceName,
1570 VolCreate->FileSystemName);
1571 }
1572 else
1573 {
1576 IDS_FORMATTING_PROGRESS2, // L"Formatting volume %s in %s..."
1577 FmtInfo->Volume->Info.DeviceName,
1578 VolCreate->FileSystemName);
1579 }
1580
1581 // StartFormat(FmtInfo, FileSystemList->Selected);
1582 FmtInfo->FileSystemName = VolCreate->FileSystemName;
1583 FmtInfo->MediaFlag = VolCreate->MediaFlag;
1584 FmtInfo->Label = VolCreate->Label;
1585 FmtInfo->QuickFormat = VolCreate->QuickFormat;
1586 FmtInfo->ClusterSize = VolCreate->ClusterSize;
1587 FmtInfo->Callback = FormatCallback;
1588
1589 /* Set up the progress bar */
1591 PBM_SETRANGE, 0, MAKELPARAM(0, 100));
1593 PBM_SETPOS, 0, 0);
1594
1595 return FSVOL_DOIT;
1596 }
1597
1599 {
1600 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1601
1602 // EndFormat(FmtInfo->ErrorStatus);
1603 if (FmtInfo->FileSystemName)
1604 *(PWSTR)FmtInfo->FileSystemName = UNICODE_NULL; // FIXME: HACK!
1605
1606 // /* Reset the file system list */
1607 // ResetFileSystemList();
1608 return 0;
1609 }
1610
1612 {
1613 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1614 PVOL_CREATE_INFO VolCreate;
1615
1616 ASSERT((FSVOL_OP)Param2 == FSVOL_CHECK);
1617
1618 /* Find the volume info in the partition TreeList UI.
1619 * If none, don't check it. */
1621 ChkInfo->Volume);
1622 if (!VolCreate)
1623 return FSVOL_SKIP;
1624 ASSERT(VolCreate->Volume == ChkInfo->Volume);
1625
1626 ASSERT(*ChkInfo->Volume->Info.DeviceName);
1627
1628 /* Set status text */
1629 if (ChkInfo->Volume->Info.DriveLetter)
1630 {
1633 IDS_CHECKING_PROGRESS1, // L"Checking volume %c: (%s)..."
1634 ChkInfo->Volume->Info.DriveLetter,
1635 ChkInfo->Volume->Info.DeviceName);
1636 }
1637 else
1638 {
1641 IDS_CHECKING_PROGRESS2, // L"Checking volume %s..."
1642 ChkInfo->Volume->Info.DeviceName);
1643 }
1644
1645 // StartCheck(ChkInfo);
1646 // TODO: Think about which values could be defaulted...
1647 ChkInfo->FixErrors = TRUE;
1648 ChkInfo->Verbose = FALSE;
1649 ChkInfo->CheckOnlyIfDirty = TRUE;
1650 ChkInfo->ScanDrive = FALSE;
1651 ChkInfo->Callback = ChkdskCallback;
1652
1653 return FSVOL_DOIT;
1654 }
1655
1657 {
1658 // PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1659 // EndCheck(ChkInfo->ErrorStatus);
1660 return 0;
1661 }
1662 }
1663
1664 return 0;
1665}
1666
1667
1668
1669typedef struct _COPYCONTEXT
1670{
1675
1676static UINT
1680 UINT_PTR Param1,
1681 UINT_PTR Param2)
1682{
1684 PFILEPATHS_W FilePathInfo;
1685 PCWSTR SrcFileName, DstFileName;
1686
1687 WaitForSingleObject(CopyContext->pSetupData->hHaltInstallEvent, INFINITE);
1688 if (CopyContext->pSetupData->bStopInstall)
1689 return FILEOP_ABORT; // Stop committing files
1690
1691 switch (Notification)
1692 {
1694 {
1695 CopyContext->TotalOperations = (ULONG)Param2;
1696 CopyContext->CompletedOperations = 0;
1697
1698 /* Set up the progress bar */
1700 PBM_SETRANGE, 0,
1701 MAKELPARAM(0, CopyContext->TotalOperations));
1703 PBM_SETSTEP, 1, 0);
1705 PBM_SETPOS, 0, 0);
1706 break;
1707 }
1708
1712 {
1713 FilePathInfo = (PFILEPATHS_W)Param1;
1714
1716 {
1717 /* Display delete message */
1718 ASSERT(Param2 == FILEOP_DELETE);
1719
1720 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1721 if (DstFileName) ++DstFileName;
1722 else DstFileName = FilePathInfo->Target;
1723
1726 IDS_DELETING, // STRING_DELETING
1727 DstFileName);
1728 }
1730 {
1731 UINT uMsgID;
1732
1733 /* Display move/rename message */
1734 ASSERT(Param2 == FILEOP_RENAME);
1735
1736 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1737 if (SrcFileName) ++SrcFileName;
1738 else SrcFileName = FilePathInfo->Source;
1739
1740 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1741 if (DstFileName) ++DstFileName;
1742 else DstFileName = FilePathInfo->Target;
1743
1744 if (!_wcsicmp(SrcFileName, DstFileName))
1745 uMsgID = IDS_MOVING; // STRING_MOVING
1746 else
1747 uMsgID = IDS_RENAMING; // STRING_RENAMING
1750 uMsgID,
1751 SrcFileName, DstFileName);
1752 }
1754 {
1755 /* Display copy message */
1756 ASSERT(Param2 == FILEOP_COPY);
1757
1758 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1759 if (DstFileName) ++DstFileName;
1760 else DstFileName = FilePathInfo->Target;
1761
1764 IDS_COPYING, // STRING_COPYING
1765 DstFileName);
1766 }
1767 break;
1768 }
1769
1771 {
1772 FilePathInfo = (PFILEPATHS_W)Param1;
1773
1774 DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
1775 FilePathInfo->Target, FilePathInfo->Win32Error);
1776 return FILEOP_SKIP;
1777 }
1778
1782 {
1783 CopyContext->CompletedOperations++;
1784
1785 /* SYSREG checkpoint */
1786 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1787 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1788
1790 break;
1791 }
1792 }
1793
1794 return FILEOP_DOIT;
1795}
1796
1797static VOID
1798__cdecl
1800{
1801 /* WARNING: Please keep this lookup table in sync with the resources! */
1802 static const UINT StringIDs[] =
1803 {
1804 IDS_REG_DONE, /* Success */
1805 IDS_REG_REGHIVEUPDATE, /* RegHiveUpdate */
1806 IDS_REG_IMPORTFILE, /* ImportRegHive */
1807 IDS_REG_DISPLAYSETTINGSUPDATE, /* DisplaySettingsUpdate */
1808 IDS_REG_LOCALESETTINGSUPDATE, /* LocaleSettingsUpdate */
1809 IDS_REG_ADDKBLAYOUTS, /* KeybLayouts */
1810 IDS_REG_KEYBOARDSETTINGSUPDATE, /* KeybSettingsUpdate */
1811 IDS_REG_CODEPAGEINFOUPDATE, /* CodePageInfoUpdate */
1812 };
1813
1814 if (RegStatus < _countof(StringIDs))
1815 {
1816 va_list args;
1817 va_start(args, RegStatus);
1819 va_end(args);
1820 }
1821 else
1822 {
1824 }
1825
1827}
1828
1836VOID
1838 _In_ HWND hWndWiz,
1840{
1841 EnableDlgItem(hWndWiz, IDCANCEL, Enable);
1843 SC_CLOSE,
1845}
1846
1847static DWORD
1848WINAPI
1850 IN LPVOID Param)
1851{
1852 PSETUPDATA pSetupData;
1853 HWND hwndDlg = (HWND)Param;
1854 HWND hWndProgress;
1855 LONG_PTR dwStyle;
1856 ERROR_NUMBER ErrorNumber;
1859 FSVOL_CONTEXT FsVolContext;
1862
1863 /* Retrieve pointer to the global setup data */
1864 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1865
1866 /* Get the progress handle */
1867 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1868
1869 /* Setup global UI context */
1870 UiContext.hwndDlg = hwndDlg;
1872 UiContext.hWndProgress = hWndProgress;
1873 UiContext.dwPbStyle = 0;
1874
1875
1876 /* Disable the Close/Cancel buttons during all partition operations */
1877 // TODO: Consider, alternatively, to just show an info-box saying
1878 // that the installation process cannot be canceled at this stage?
1879 // PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
1881
1882
1883 /*
1884 * Find/Set the system partition, and apply all pending partition operations.
1885 */
1886
1887 /* Create context for the volume/partition operations */
1888 FsVolContext.pSetupData = pSetupData;
1889
1890 /* Set status text */
1892 pSetupData->hInstance,
1894 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1895
1896 /* Find or set the active system partition before starting formatting */
1901 &FsVolContext);
1902 // if (!Success)
1903 // return FsVolContext.NextPageOnAbort;
1904 //
1905 // FIXME?? If cannot use any system partition, install FreeLdr on floppy / removable media??
1906 //
1907 if (!Success)
1908 {
1909 /* Display an error if an unexpected failure happened */
1910 MessageBoxW(GetParent(hwndDlg), L"Failed to find or set the system partition!", L"Error", MB_ICONERROR);
1911
1912 /* Re-enable the Close/Cancel buttons */
1914
1915 /*
1916 * We failed due to an unexpected error, keep on the copy page to view the current state,
1917 * but enable the "Next" button to allow the user to continue to the Abort page.
1918 */
1920 return 1;
1921 }
1922
1923
1924 /* Set status text */
1926 pSetupData->hInstance,
1928 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1929
1930 /* Apply all pending operations on partitions: formatting and checking */
1935 &FsVolContext);
1936 if (!Success)
1937 {
1938 /* Display an error if an unexpected failure happened */
1939 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the partitions!", L"Error", MB_ICONERROR);
1940
1941 /* Re-enable the Close/Cancel buttons */
1943
1944 /*
1945 * We failed due to an unexpected error, keep on the copy page to view the current state,
1946 * but enable the "Next" button to allow the user to continue to the Abort page.
1947 */
1949 return 1;
1950 }
1951
1952
1953 /* Re-enable the Close/Cancel buttons */
1955
1956
1957
1958 /* Re-calculate the final destination paths */
1960 Status = InitDestinationPaths(&pSetupData->USetupData,
1961 NULL, // pSetupData->USetupData.InstallationDirectory,
1963 if (!NT_SUCCESS(Status))
1964 {
1965 DisplayMessage(GetParent(hwndDlg), MB_ICONERROR, L"Error", L"InitDestinationPaths() failed with status 0x%08lx\n", Status);
1966
1967 /*
1968 * We failed due to an unexpected error, keep on the copy page to view the current state,
1969 * but enable the "Next" button to allow the user to continue to the Abort page.
1970 */
1972 return 1;
1973 }
1974
1975
1976
1977 /*
1978 * Preparation of the list of files to be copied
1979 */
1980
1981 /* Set status text */
1983 pSetupData->hInstance,
1985 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1986
1987 /* Set progress marquee style and start it up */
1988 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
1989 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
1990 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
1991
1992 /* Prepare the list of files */
1993 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
1994
1995 /* Stop progress and restore its style */
1996 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1997 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1998
1999 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
2000 {
2001 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
2002 if (!pSetupData->bStopInstall)
2003 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the list of files!", L"Error", MB_ICONERROR);
2004
2005 /*
2006 * If we failed due to an unexpected error, keep on the copy page to view the current state,
2007 * but enable the "Next" button to allow the user to continue to the Abort page.
2008 * Otherwise we have been cancelled by the user, who has already switched to the Abort page.
2009 */
2010 if (!pSetupData->bStopInstall)
2012 return 1;
2013 }
2014
2015
2016 /*
2017 * Perform the file copy
2018 */
2019
2020 /* Set status text */
2022 pSetupData->hInstance,
2024 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2025
2026 /* Create context for the copy process */
2027 CopyContext.pSetupData = pSetupData;
2028 CopyContext.TotalOperations = 0;
2029 CopyContext.CompletedOperations = 0;
2030
2031 /* Do the file copying - The callback handles whether or not we should stop file copying */
2032 if (!DoFileCopy(&pSetupData->USetupData, FileCopyCallback, &CopyContext))
2033 {
2034 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
2035 if (!pSetupData->bStopInstall)
2036 MessageBoxW(GetParent(hwndDlg), L"Failed to copy the files!", L"Error", MB_ICONERROR);
2037
2038 /*
2039 * If we failed due to an unexpected error, keep on the copy page to view the current state,
2040 * but enable the "Next" button to allow the user to continue to the Abort page.
2041 * Otherwise we have been cancelled by the user, who has already switched to the Abort page.
2042 */
2043 if (!pSetupData->bStopInstall)
2045 return 1;
2046 }
2047
2048 // /* Set status text */
2049 // SetWindowResTextW(GetDlgItem(hwndDlg, IDC_ACTIVITY),
2050 // pSetupData->hInstance,
2051 // IDS_INSTALL_FINALIZE);
2052 // SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2053
2054 /* Create the $winnt$.inf file */
2055 InstallSetupInfFile(&pSetupData->USetupData);
2056
2057
2058 /*
2059 * Create or update the registry hives
2060 */
2061
2062 /* Set status text */
2064 pSetupData->hInstance,
2067 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2068
2069 /* Set up the progress bar */
2070 SendMessageW(hWndProgress,
2071 PBM_SETRANGE, 0,
2072 MAKELPARAM(0, 8)); // FIXME: hardcoded number of steps, see StringIDs[] array in RegistryStatus()
2073 SendMessageW(hWndProgress,
2074 PBM_SETSTEP, 1, 0);
2075 SendMessageW(hWndProgress,
2076 PBM_SETPOS, 0, 0);
2077
2078 ErrorNumber = UpdateRegistry(&pSetupData->USetupData,
2079 pSetupData->RepairUpdateFlag,
2080 pSetupData->PartitionList,
2081 InstallVolume->Info.DriveLetter,
2082 pSetupData->SelectedLanguageId,
2084 NULL /* SubstSettings */);
2085 DBG_UNREFERENCED_PARAMETER(ErrorNumber);
2087
2088 /*
2089 * And finally, install the bootloader
2090 */
2091
2092 /* Set status text */
2094 pSetupData->hInstance,
2096 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2097
2099 StringCchPrintfW(PathBuffer, _countof(PathBuffer),
2100 L"%s\\", SystemPartition->DeviceName);
2101 RtlCreateUnicodeString(&pSetupData->USetupData.SystemRootPath, PathBuffer);
2102 DPRINT1("SystemRootPath: %wZ\n", &pSetupData->USetupData.SystemRootPath);
2103
2104 switch (pSetupData->USetupData.BootLoaderLocation)
2105 {
2106 /* Install on removable disk */
2107 case 1:
2108 {
2109 // TODO: So far SETUP only supports the 1st floppy.
2110 // Use a simple UI like comdlg32's DlgDirList* to show
2111 // a list of drives that the user could select.
2112 static const UNICODE_STRING FloppyDrive = RTL_CONSTANT_STRING(L"\\Device\\Floppy0\\");
2113 static const WCHAR DriveLetter = L'A';
2114
2115 INT nRet;
2116 RetryCancel:
2117 nRet = DisplayMessage(GetParent(hwndDlg),
2119 L"Bootloader installation",
2120 L"Please insert a blank floppy disk in drive %c: .\n"
2121 L"All data in the floppy disk will be erased!\n"
2122 L"\nClick on OK to continue."
2123 L"\nClick on CANCEL to skip bootloader installation.",
2124 DriveLetter);
2125 if (nRet != IDOK)
2126 break; /* Skip installation */
2127
2128 Retry:
2130 &FloppyDrive,
2131 &pSetupData->USetupData.SourceRootPath,
2132 &pSetupData->USetupData.DestinationArcPath);
2133 if (Status == STATUS_SUCCESS)
2134 break; /* Successful installation */
2135
2137 {
2138 // ERROR_NO_FLOPPY
2139 nRet = DisplayMessage(GetParent(hwndDlg),
2141 NULL, // Default to "Error"
2142 L"No disk detected in drive %c: .",
2143 DriveLetter);
2144 if (nRet == IDRETRY)
2145 goto Retry;
2146 }
2147 else if ((Status == ERROR_WRITE_BOOT) ||
2149 {
2150 /* Error when writing the boot code */
2151 DisplayError(GetParent(hwndDlg),
2152 0, // Default to "Error"
2154 }
2155 else if (!NT_SUCCESS(Status))
2156 {
2157 /* Any other NTSTATUS failure code */
2158 DPRINT1("InstallBootcodeToRemovable() failed: Status 0x%lx\n", Status);
2159 DisplayError(GetParent(hwndDlg),
2160 0, // Default to "Error"
2162 Status);
2163 }
2164 goto RetryCancel;
2165 }
2166
2167 /* Install on hard-disk */
2168 case 2: // System partition / MBR and VBR (on BIOS-based PC)
2169 case 3: // VBR only (on BIOS-based PC)
2170 {
2171 /* Copy FreeLoader to the disk and save the boot entries */
2173 pSetupData->USetupData.ArchType,
2174 &pSetupData->USetupData.SystemRootPath,
2175 &pSetupData->USetupData.SourceRootPath,
2176 &pSetupData->USetupData.DestinationArcPath,
2177 (pSetupData->USetupData.BootLoaderLocation == 2)
2178 ? 1 /* Install MBR and VBR */
2179 : 0 /* Install VBR only */);
2180 if (Status == STATUS_SUCCESS)
2181 break; /* Successful installation */
2182
2183 if (Status == ERROR_WRITE_BOOT)
2184 {
2185 /* Error when writing the VBR */
2186 DisplayError(GetParent(hwndDlg),
2187 0, // Default to "Error"
2189 SystemVolume->Info.FileSystem);
2190 }
2191 else if (Status == ERROR_INSTALL_BOOTCODE)
2192 {
2193 /* Error when writing the MBR */
2194 DisplayError(GetParent(hwndDlg),
2195 0, // Default to "Error"
2197 L"MBR");
2198 }
2199 else if (Status == STATUS_NOT_SUPPORTED)
2200 {
2201 DisplayError(GetParent(hwndDlg),
2202 0, // Default to "Error"
2204 }
2205 else if (!NT_SUCCESS(Status))
2206 {
2207 /* Any other NTSTATUS failure code */
2208 DPRINT1("InstallBootManagerAndBootEntries() failed: Status 0x%lx\n", Status);
2209 DisplayError(GetParent(hwndDlg),
2210 0, // Default to "Error"
2212 Status);
2213 }
2214 break;
2215 }
2216
2217 /* Skip installation */
2218 case 0:
2219 default:
2220 break;
2221 }
2222
2223
2224 /* We are done! Switch to the Finish page */
2226 return 0;
2227}
2228
2229
2230static INT_PTR CALLBACK
2232 IN HWND hwndDlg,
2233 IN UINT uMsg,
2236{
2237 PSETUPDATA pSetupData;
2238
2239 /* Retrieve pointer to the global setup data */
2240 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2241
2242 switch (uMsg)
2243 {
2244 case WM_INITDIALOG:
2245 {
2246 /* Save pointer to the global setup data */
2247 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2248 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2249
2250 /* Reset status text */
2251 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
2252 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2253 break;
2254 }
2255
2256 case WM_NOTIFY:
2257 {
2258 LPNMHDR lpnm = (LPNMHDR)lParam;
2259
2260 switch (lpnm->code)
2261 {
2262 case PSN_SETACTIVE:
2263 {
2264 /* Create the file-copy halt (manual-reset) event */
2265 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
2266 if (!pSetupData->hHaltInstallEvent)
2267 break;
2268 pSetupData->bStopInstall = FALSE;
2269
2270 /* Start the prepare-and-copy files thread */
2271 pSetupData->hInstallThread =
2272 CreateThread(NULL, 0,
2274 (PVOID)hwndDlg,
2276 NULL);
2277 if (!pSetupData->hInstallThread)
2278 {
2279 CloseHandle(pSetupData->hHaltInstallEvent);
2280 pSetupData->hHaltInstallEvent = NULL;
2281
2282 MessageBoxW(GetParent(hwndDlg), L"Cannot create the prepare-and-copy files thread!", L"Error", MB_ICONERROR);
2283 break;
2284 }
2285
2286 /* Disable all buttons during installation, they will be
2287 * re-enabled by the installation thread; hide "Back" */
2289 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
2291
2292 /* Resume the installation thread */
2293 ResumeThread(pSetupData->hInstallThread);
2294 break;
2295 }
2296
2297 case PSN_QUERYCANCEL:
2298 {
2299 /* Halt the on-going file copy */
2300 ResetEvent(pSetupData->hHaltInstallEvent);
2301
2302 if (DisplayMessage(GetParent(hwndDlg),
2306 {
2307 /* Stop the file copy thread */
2308 pSetupData->bStopInstall = TRUE;
2309 SetEvent(pSetupData->hHaltInstallEvent);
2310
2311#if 0
2312 /* Wait for any pending installation */
2314 CloseHandle(pSetupData->hInstallThread);
2315 pSetupData->hInstallThread = NULL;
2316 CloseHandle(pSetupData->hHaltInstallEvent);
2317 pSetupData->hHaltInstallEvent = NULL;
2318#endif
2319
2320 // TODO: Unwind installation?!
2321
2322 /* Go to the Abort page */
2324 }
2325 else
2326 {
2327 /* We don't stop installation, resume file copy */
2328 SetEvent(pSetupData->hHaltInstallEvent);
2329 }
2330
2331 /* Do not close the wizard too soon */
2333 return TRUE;
2334 }
2335
2336 default:
2337 break;
2338 }
2339 break;
2340 }
2341
2342 default:
2343 break;
2344 }
2345
2346 return FALSE;
2347}
2348
2349
2353static BOOL
2355{
2356/* See reactos/undocuser.h */
2358
2359 /* Return success if a shell window is present, valid, and interactive */
2360 HWND hWndProgman = GetProgmanWindow();
2361 if (!(hWndProgman && IsWindow(hWndProgman) &&
2362 IsWindowEnabled(hWndProgman) && IsWindowVisible(hWndProgman)))
2363 {
2364 hWndProgman = GetShellWindow();
2365 }
2366 return (hWndProgman && IsWindow(hWndProgman) &&
2367 IsWindowEnabled(hWndProgman) && IsWindowVisible(hWndProgman));
2368}
2369
2371{
2375static BOOL
2378 _In_ HWND hWnd,
2380{
2382 HMENU hSysMenu;
2383 MENUITEMINFOW mii;
2384
2385 /* Skip the window to exclude */
2386 if (hWnd == pInfo->hWndExclude)
2387 return TRUE;
2388
2389 /* Skip non-interactive windows */
2391 return TRUE;
2392
2393 hSysMenu = GetSystemMenu(hWnd, FALSE);
2394 if (!hSysMenu)
2395 return TRUE; /* No menu: skip the window */
2396
2397 mii.cbSize = sizeof(mii);
2398 mii.fMask = MIIM_STATE;
2399 if (!GetMenuItemInfoW(hSysMenu, SC_CLOSE, FALSE, &mii))
2400 return TRUE; /* No close item: skip the window */
2401
2402 pInfo->Found |= !(mii.fState & MFS_DISABLED);
2403
2404 /* Continue enumeration (return TRUE) if no close item is enabled;
2405 * otherwise stop the enumeration (return FALSE) */
2406 return !pInfo->Found;
2407}
2411static BOOL
2413 _In_opt_ HWND hWndExclude)
2414{
2415 /* Return success if a shell is active */
2416 if (IsShellActive())
2417 {
2418 return TRUE;
2419 }
2420 /* Otherwise, check for user-interactive closable windows */
2421 else
2422 {
2423 CLOSABLE_WND_INFO Info = {hWndExclude, FALSE};
2425 return Info.Found;
2426 }
2427}
2428
2429static INT_PTR CALLBACK
2431 IN HWND hwndDlg,
2432 IN UINT uMsg,
2435{
2436 PSETUPDATA pSetupData;
2437
2438 /* Retrieve pointer to the global setup data */
2439 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2440
2441 switch (uMsg)
2442 {
2443 case WM_INITDIALOG:
2444 {
2446
2447 /* Save pointer to the global setup data */
2448 pSetupData = (PSETUPDATA)ppsp->lParam;
2449 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2450
2451 /* Set the stop-install flag if the user is aborting
2452 * the installation: TRUE if Abort, FALSE if Finish. */
2453 pSetupData->bStopInstall = (ppsp->pszTemplate == MAKEINTRESOURCEW(IDD_ABORTPAGE));
2454
2455 /* Set title font */
2456 SetDlgItemFont(hwndDlg, IDC_FINISHTITLE, pSetupData->hTitleFont, TRUE);
2457
2458 /* We need to reboot at the end of the installation if this is an
2459 * unattended setup, or if there is no shell active. If there are
2460 * other user-interactive windows opened, we pause in WM_ACTIVATE
2461 * the inevitable reboot countdown when the wizard is deactivated,
2462 * and restart it when the wizard is reactivated. */
2463 pSetupData->bMustReboot = SetupData.bUnattend;
2464 pSetupData->bMustReboot |= !IsShellActive();
2465
2466 /* If we must reboot, display the countdown gauge. In any
2467 * case, let the user restart now or postpone it to later. */
2468 if (pSetupData->bMustReboot)
2469 {
2470 /* "Setup will now restart your computer..." is shown */
2473 }
2474 else
2475 {
2476 /* We should not reboot automatically, change the finish
2477 * text to "Setup needs to restart your computer..." */
2478 UINT uMsgID = (!pSetupData->bStopInstall ? IDS_FINISH_NO_REBOOT
2481 pSetupData->hInstance,
2482 uMsgID);
2483
2484 /* Hide and disable the countdown gauge */
2487 }
2488
2489 /* If the installation is aborted, change the "Cancel" button text to "Close" */
2490 if (pSetupData->bStopInstall)
2491 {
2493 GetModuleHandleW(L"comctl32.dll"),
2494 IDS_CLOSE);
2495 }
2496
2497 /* Ensure that the installer wizard window is made visible and focused */
2498 ShowWindow(GetParent(hwndDlg), SW_SHOW);
2500 break;
2501 }
2502
2503 case WM_DESTROY:
2504 return TRUE;
2505
2506 case WM_ACTIVATE:
2507 {
2508 /* Only care about (de)activation only if we must reboot */
2509 if (!pSetupData->bMustReboot)
2510 break;
2511
2512 if (LOWORD(wParam) == WA_INACTIVE)
2513 {
2514 /* Wizard window is deactivated, check whether there are
2515 * interactive windows. If so, pause the countdown. */
2517 KillTimer(hwndDlg, 1);
2518 }
2519 else
2520 {
2521 /* Wizard window is reactivated, re-enable the countdown */
2522 SetTimer(hwndDlg, 1, 50, NULL);
2523 }
2524 break;
2525 }
2526
2527 case WM_TIMER:
2528 {
2529 HWND hWndProgress;
2530 INT Position;
2531
2532 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2533 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2534 if (Position == 300)
2535 {
2536 KillTimer(hwndDlg, 1);
2538 }
2539 else
2540 {
2541 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2542 }
2543 return TRUE;
2544 }
2545
2546 case WM_NOTIFY:
2547 {
2548 LPNMHDR lpnm = (LPNMHDR)lParam;
2549
2550 switch (lpnm->code)
2551 {
2552 case PSN_SETACTIVE:
2553 {
2554 HWND hWndParent = GetParent(hwndDlg);
2555
2556 /* Only "Finish" for closing the wizard, and hide "Back" and "Next" */
2558 // PropSheet_ShowWizButtons(hWndParent, 0, PSWIZB_BACK | PSWIZB_NEXT | PSWIZB_CANCEL);
2561
2562 /* Change the "Finish" button text to "Restart" */
2564 pSetupData->hInstance,
2566
2567 if (pSetupData->bMustReboot)
2568 {
2569 RECT rcBtn1, rcBtn2;
2570
2571 /* Move the "Finish"/"Restart" button to where the "Close"/"Cancel" button is */
2573 MapWindowPoints(HWND_DESKTOP /*NULL*/, hWndParent, (LPPOINT)&rcBtn1, sizeof(RECT)/sizeof(POINT));
2575 MapWindowPoints(HWND_DESKTOP /*NULL*/, hWndParent, (LPPOINT)&rcBtn2, sizeof(RECT)/sizeof(POINT));
2577 HWND_TOP,
2578 rcBtn1.left + (rcBtn2.right - rcBtn1.right),
2579 rcBtn1.top,
2580 0, 0,
2582
2583 /* Hide and disable also the "Close"/"Cancel" buttons since we can only finish now */
2586
2587 /* Set up the reboot progress bar and countdown timer.
2588 * 300 steps at 50 ms each: 15 seconds */
2591 SetTimer(hwndDlg, 1, 50, NULL);
2592 }
2593 else if (!pSetupData->bStopInstall)
2594 {
2595 /* Keep the "Cancel" button shown and change its text to "Postpone" */
2596 // PropSheet_ShowWizButtons(hWndParent, 0, PSWIZB_BACK | PSWIZB_NEXT);
2598 pSetupData->hInstance,
2600 }
2601
2602 break;
2603 }
2604
2605 case PSN_WIZNEXT:
2606 case PSN_WIZFINISH:
2607 {
2608 /* Press on "Finish"/"Restart" button */
2609 pSetupData->bMustReboot = TRUE;
2611 }
2612 case PSN_QUERYCANCEL:
2613 /* Press on "Cancel"/"Postpone" button */
2614 default:
2615 break;
2616 }
2617 break;
2618 }
2619
2620 default:
2621 break;
2622 }
2623
2624 return FALSE;
2625}
2626
2628 IN OUT PSETUPDATA pSetupData)
2629{
2630 pSetupData->PartitionList = CreatePartitionList();
2631 if (!pSetupData->PartitionList)
2632 {
2633 DPRINT1("Could not enumerate available disks; failing installation\n");
2634 return FALSE;
2635 }
2636
2637 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
2638 if (!pSetupData->NtOsInstallsList)
2639 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
2640
2641 /* Load the hardware, language and keyboard layout lists */
2642
2643 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
2644 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
2645 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
2646
2647 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
2648
2649 /* If not unattended, overwrite language and locale with
2650 * the current ones of the running ReactOS instance */
2651 if (!IsUnattendedSetup)
2652 {
2653 LCID LocaleID = GetUserDefaultLCID();
2654
2655 StringCchPrintfW(pSetupData->DefaultLanguage,
2656 _countof(pSetupData->DefaultLanguage),
2657 L"%08lx", LocaleID);
2658
2659 StringCchPrintfW(pSetupData->USetupData.LocaleID,
2660 _countof(pSetupData->USetupData.LocaleID),
2661 L"%08lx", LocaleID);
2662 }
2663
2664 /* new part */
2665 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
2666 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
2667 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
2668
2669 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
2670 pSetupData->SelectedLanguageId,
2671 pSetupData->DefaultKBLayout);
2672
2673 /* If not unattended, overwrite keyboard layout with
2674 * the current one of the running ReactOS instance */
2675 if (!IsUnattendedSetup)
2676 {
2677 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
2678 /* If the call fails, keep the default already stored in the buffer */
2679 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
2680 }
2681
2682 /* Change the default entries in the language and keyboard layout lists */
2683 {
2684 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
2685 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
2686 PGENERIC_LIST_ENTRY ListEntry;
2687
2688 /* Search for default language */
2689 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
2690 ListEntry = GetNextListEntry(ListEntry))
2691 {
2692 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2693 if (!_wcsicmp(pSetupData->DefaultLanguage, LocaleId))
2694 {
2695 DPRINT("found %S in LanguageList\n", LocaleId);
2696 SetCurrentListEntry(LanguageList, ListEntry);
2697 break;
2698 }
2699 }
2700
2701 /* Search for default layout */
2702 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
2703 ListEntry = GetNextListEntry(ListEntry))
2704 {
2705 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2706 if (!_wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
2707 {
2708 DPRINT("Found %S in LayoutList\n", pszLayoutId);
2709 SetCurrentListEntry(LayoutList, ListEntry);
2710 break;
2711 }
2712 }
2713 }
2714
2715 return TRUE;
2716}
2717
2718VOID
2721{
2722 InitializeListHead(&MappingList->List);
2723 MappingList->MappingsCount = 0;
2724}
2725
2726VOID
2729{
2730 PLIST_ENTRY ListEntry;
2731 PVOID Entry;
2732
2733 while (!IsListEmpty(&MappingList->List))
2734 {
2735 ListEntry = RemoveHeadList(&MappingList->List);
2736 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2738 }
2739
2740 MappingList->MappingsCount = 0;
2741}
2742
2743/*
2744 * Attempts to convert a pure NT file path into a corresponding Win32 path.
2745 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
2746 */
2747BOOL
2750 OUT PWSTR pwszPath,
2751 IN DWORD cchPathMax,
2752 IN PCWSTR pwszNTPath)
2753{
2754 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
2755 PLIST_ENTRY ListEntry;
2757 PCWSTR pwszNtPathToMap = pwszNTPath;
2758 PCWSTR pwszRemaining = NULL;
2759 DWORD cchDrives;
2760 PWCHAR pwszDrive;
2761 WCHAR wszDrives[512];
2762 WCHAR wszNTPath[MAX_PATH];
2763 WCHAR TargetPath[MAX_PATH];
2764
2765 *pwszPath = UNICODE_NULL;
2766
2767 /*
2768 * We find first a mapping inside the MappingList. If one is found, use it
2769 * to build the Win32 path. If there is none, we need to create one by
2770 * checking the Win32 drives (and possibly NT symlinks too).
2771 * In case of success, add the newly found mapping to the list and use it
2772 * to build the Win32 path.
2773 */
2774
2775 for (ListEntry = MappingList->List.Flink;
2776 ListEntry != &MappingList->List;
2777 ListEntry = ListEntry->Flink)
2778 {
2779 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2780
2781 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
2782
2783 /* Check whether the queried NT path prefixes the user-provided NT path */
2784 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
2785 if (FoundDrive)
2786 {
2787 /* Found it! */
2788
2789 /* Set the pointers and go build the Win32 path */
2790 pwszDrive = Entry->Win32Path;
2791 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
2792 goto Quit;
2793 }
2794 }
2795
2796 /*
2797 * No mapping exists for this path yet: try to find one now.
2798 */
2799
2800 /* Retrieve the mounted drives (available drive letters) */
2801 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2802 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2803 {
2804 /* Buffer too small or failure */
2805 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
2806 return FALSE;
2807 }
2808
2809/* We go back there once if RetryOnce == TRUE */
2810Retry:
2811
2812 /* Enumerate the mounted drives */
2813 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2814 {
2815 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2816 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2817 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2818 pwszDrive[2] = L'\\'; // Restore the backslash
2819
2820 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
2821
2822 /* Check whether the queried NT path prefixes the user-provided NT path */
2823 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2824 if (!FoundDrive)
2825 {
2826 PWCHAR ptr, ptr2;
2827
2828 /*
2829 * Check whether this was a network share that has a drive letter,
2830 * but the user-provided NT path points to this share without
2831 * mentioning the drive letter.
2832 *
2833 * The format is: \Device<network_redirector>\;X:<data>\share\path
2834 * The corresponding drive letter is 'X'.
2835 * A system-provided network redirector (LanManRedirector or Mup)
2836 * or a 3rd-party one may be used.
2837 *
2838 * We check whether the user-provided NT path has the form:
2839 * \Device<network_redirector><data>\share\path
2840 * as it obviously did not have the full form (the previous check
2841 * would have been OK otherwise).
2842 */
2843 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
2844 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
2845 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
2846 {
2847 /*
2848 * Normally the specified drive letter should correspond
2849 * to the one used for the mapping. But we will ignore
2850 * if it happens not to be the case.
2851 */
2852 if (pwszDrive[0] != ptr[1])
2853 {
2854 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
2855 pwszDrive[0], ptr[1]);
2856 }
2857
2858 /* Remove the drive letter from the NT network share path */
2859 ptr2 = ptr + 3;
2860 /* Swallow as many possible consecutive backslashes as there could be */
2861 while (*ptr2 == L'\\') ++ptr2;
2862
2863 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
2864
2865 /* Now do the check again */
2866 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2867 }
2868 }
2869 if (FoundDrive)
2870 {
2871 /* Found it! */
2872
2873 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
2874
2875 if (pwszNtPathToMap == pwszNTPath)
2876 {
2877 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
2878 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
2879 }
2880 break;
2881 }
2882 }
2883
2884 if (FoundDrive)
2885 {
2886 /* A mapping was found, add it to the cache */
2888 if (!Entry)
2889 {
2890 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
2891 return FALSE;
2892 }
2893 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
2894 pwszNTPath, pwszRemaining - pwszNTPath);
2895 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
2896
2897 /* Insert it as the most recent entry */
2898 InsertHeadList(&MappingList->List, &Entry->ListEntry);
2899 MappingList->MappingsCount++;
2900
2901 /* Set the pointers and go build the Win32 path */
2902 pwszDrive = Entry->Win32Path;
2903 goto Quit;
2904 }
2905
2906 /*
2907 * We failed, perhaps because the beginning of the NT path used a symlink.
2908 * Try to see whether this is the case by attempting to resolve it.
2909 * If the symlink resolution gives nothing, or we already failed once,
2910 * there is no hope in converting the path to Win32.
2911 * Otherwise, symlink resolution succeeds but we need to recheck again
2912 * the drives list.
2913 */
2914
2915 /*
2916 * In theory we would have to parse each element in the NT path and going
2917 * until finding a symlink object (otherwise we would fail straight away).
2918 * However here we can use guessing instead, since we know which kind of
2919 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
2920 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
2921 * are supported in setuplib\utils\arcname.c .
2922 *
2923 * But actually, all the supported names in arcname.c are real devices,
2924 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
2925 * just check for it.
2926 */
2927 if (!RetryOnce && !FoundDrive)
2928 {
2929 ULONG DiskNumber, PartitionNumber;
2930 INT Length;
2931
2934 HANDLE LinkHandle;
2935 UNICODE_STRING SymLink, Target;
2936
2937 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
2938 &DiskNumber, &PartitionNumber, &Length) != 2)
2939 {
2940 /* Definitively not a recognized path, bail out */
2941 return FALSE;
2942 }
2943
2944 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
2945 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
2946 SymLink.Length = SymLink.MaximumLength;
2947
2949 &SymLink,
2951 NULL,
2952 NULL);
2953 Status = NtOpenSymbolicLinkObject(&LinkHandle,
2956 if (!NT_SUCCESS(Status))
2957 {
2958 /* Not a symlink, or something else happened: bail out */
2959 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2960 &SymLink, Status);
2961 return FALSE;
2962 }
2963
2964 *TargetPath = UNICODE_NULL;
2965 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
2966
2967 /* Resolve the link and close its handle */
2969 NtClose(LinkHandle);
2970
2971 /* Check for success */
2972 if (!NT_SUCCESS(Status))
2973 {
2974 /* Not a symlink, or something else happened: bail out */
2975 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2976 &SymLink, Status);
2977 return FALSE;
2978 }
2979
2980 /* Set the pointers */
2981 pwszRemaining = pwszNTPath + Length;
2982 pwszNtPathToMap = TargetPath; // Point to our local buffer
2983
2984 /* Retry once */
2985 RetryOnce = TRUE;
2986 goto Retry;
2987 }
2988
2989 ASSERT(!FoundDrive);
2990
2991Quit:
2992 if (FoundDrive)
2993 {
2994 StringCchPrintfW(pwszPath, cchPathMax,
2995 L"%s%s",
2996 pwszDrive,
2997 pwszRemaining);
2998 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
2999 return TRUE;
3000 }
3001
3002 return FALSE;
3003}
3004
3005/* Used to enable and disable the shutdown privilege */
3006/* static */ BOOL
3008 IN LPCWSTR lpszPrivilegeName,
3009 IN BOOL bEnablePrivilege)
3010{
3011 BOOL Success;
3012 HANDLE hToken;
3014
3017 &hToken);
3018 if (!Success) return Success;
3019
3021 lpszPrivilegeName,
3022 &tp.Privileges[0].Luid);
3023 if (!Success) goto Quit;
3024
3025 tp.PrivilegeCount = 1;
3026 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
3027
3028 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
3029
3030Quit:
3031 CloseHandle(hToken);
3032 return Success;
3033}
3034
3035/* Copied from HotkeyThread() in dll/win32/syssetup/install.c */
3036static DWORD CALLBACK
3038{
3039 ATOM hotkey;
3040 MSG msg;
3041
3042 DPRINT("HotkeyThread start\n");
3043
3044 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
3045 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
3046 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
3047
3048 while (GetMessageW(&msg, NULL, 0, 0))
3049 {
3050 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
3051 {
3052 WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
3053 STARTUPINFOW si = { sizeof(si) };
3055
3056 if (CreateProcessW(NULL,
3057 CmdLine,
3058 NULL,
3059 NULL,
3060 FALSE,
3062 NULL,
3063 NULL,
3064 &si,
3065 &pi))
3066 {
3069 }
3070 else
3071 {
3072 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
3073 }
3074 }
3075 }
3076
3077 UnregisterHotKey(NULL, hotkey);
3078 GlobalDeleteAtom(hotkey);
3079
3080 DPRINT("HotkeyThread terminate\n");
3081 return 0;
3082}
3083
3084
3085static PCWSTR
3087{
3088 static WCHAR SetupDllPath[MAX_PATH] = L"";
3089 static BOOL Init = FALSE;
3090 BOOL Success;
3091 DWORD PathSize;
3092
3093 /* Don't rebuild the path if we did it already */
3094 if (Init)
3095 return SetupDllPath;
3096 Init = TRUE;
3097
3098 /*
3099 * Retrieve the full path of the current running Setup instance.
3100 * From this we build the suitable path to the Setup DLL.
3101 */
3102 PathSize = GetModuleFileNameW(NULL, SetupDllPath, _countof(SetupDllPath));
3103 SetupDllPath[_countof(SetupDllPath) - 1] = UNICODE_NULL; // Ensure NUL-termination (see WinXP bug)
3104
3105 Success = ((PathSize != 0) && (PathSize < _countof(SetupDllPath)) &&
3107 if (Success)
3108 {
3109 /* Find the last path separator, remove it as well as the file name */
3110 PWCHAR pch = wcsrchr(SetupDllPath, L'\\');
3111 if (!pch)
3112 pch = SetupDllPath;
3113
3114 /* The Setup DLL is inside the System32 sub-directory */
3115 PathSize = _countof(SetupDllPath) - (pch - SetupDllPath);
3116 Success = SUCCEEDED(StringCchCopyW(pch, PathSize, L"\\system32"));
3117 }
3118 if (!Success)
3119 {
3120 /* Failure: invalidate the path; the DLL won't be found and delay-loaded */
3121 *SetupDllPath = UNICODE_NULL;
3122 }
3123
3124 return SetupDllPath;
3125}
3126
3127#ifndef DECLARE_UNICODE_STRING_SIZE
3128#define DECLARE_UNICODE_STRING_SIZE(_var, _size) \
3129 WCHAR _var ## _buffer[_size]; \
3130 UNICODE_STRING _var = { 0, (_size) * sizeof(WCHAR) , _var ## _buffer }
3131#endif
3132#include <ndk/exfuncs.h> // For NtRaiseHardError()
3133#define DELAYIMP_INSECURE_WRITABLE_HOOKS
3134#include <delayimp.h>
3135
3144static FARPROC
3145WINAPI setupDelayHook(unsigned dliNotify, PDelayLoadInfo pdli)
3146{
3147 static CHAR dllPath[MAX_PATH];
3148 static PCWSTR setupDllPath = NULL;
3149
3150 switch (dliNotify)
3151 {
3153 {
3154 // NOTE: Add any other needed setup-specific DLLs there.
3155 if (_stricmp(pdli->szDll, "setuplib.dll") == 0)
3156 {
3157 if (!setupDllPath)
3158 setupDllPath = GetLocalSetupDllPath();
3159 if (setupDllPath && *setupDllPath &&
3160 SUCCEEDED(StringCchPrintfA(dllPath, _countof(dllPath), "%S\\%s",
3161 setupDllPath, pdli->szDll)))
3162 {
3163 pdli->szDll = dllPath; /* Set szDll to the new path */
3164 }
3165 }
3166 break; /* Load the DLL using the modified path */
3167 }
3168
3169 case dliFailLoadLib:
3170 {
3171 /*
3172 * Library loading failed.
3173 * Raise a hard error instead of the default
3174 * exception, and "cleanly" kill the process.
3175 */
3176 ANSI_STRING DllPathA;
3178 ULONG_PTR Parameters[] = {(ULONG_PTR)&DllPathU};
3180
3181 RtlInitAnsiString(&DllPathA, pdli->szDll);
3182 RtlAnsiStringToUnicodeString(&DllPathU, &DllPathA, FALSE);
3185 0x1,
3186 Parameters,
3187 OptionOk,
3188 &Response);
3189 ExitProcess(-1);
3190 break;
3191 }
3192
3193 default:
3194 break;
3195 }
3196
3197 return NULL;
3198}
3199
3204// NOTE: MSVC 2015 Update 3 makes this a const variable.
3205// #if (_MSC_VER > 1900) || (_MSC_VER == 1900 && _MSC_FULL_VER >= 190024210) ...
3208
3209
3210int WINAPI
3212 HINSTANCE hPrevInstance,
3213 LPTSTR lpszCmdLine,
3214 int nCmdShow)
3215{
3216 ULONG Error;
3217 HANDLE hHotkeyThread;
3219 PROPSHEETHEADER psh;
3220 HPROPSHEETPAGE ahpsp[9];
3221 PROPSHEETPAGE psp = {0};
3222 UINT nPages = 0;
3223
3225
3230
3231 /* Initialize the NT to Win32 path prefix mapping list */
3233
3234 /* Initialize Setup */
3237 if (Error != ERROR_SUCCESS)
3238 {
3239 //
3240 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
3241 //
3243 MessageBoxW(NULL, L"GetSourcePaths failed!", L"Error", MB_ICONERROR);
3244 else if (Error == ERROR_LOAD_TXTSETUPSIF)
3246 else // FIXME!!
3247 MessageBoxW(NULL, L"Unknown error!", L"Error", MB_ICONERROR);
3248
3249 goto Quit;
3250 }
3251
3252 /* Retrieve any supplemental options from the unattend file */
3254
3255 /* Load extra setup data (HW lists etc...) */
3256 if (!LoadSetupData(&SetupData))
3257 goto Quit;
3258
3259 hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
3260
3261 /* Whenever any of the common controls are used in your app,
3262 * you must call InitCommonControlsEx() to register the classes
3263 * for those controls. */
3264 iccx.dwSize = sizeof(iccx);
3266 InitCommonControlsEx(&iccx);
3267
3268 /* Register the TreeList control */
3269 // RegisterTreeListClass(hInst);
3271
3272 /* Create the title and bold fonts */
3275
3276 if (!SetupData.bUnattend)
3277 {
3278 /* Create the Start page */
3279 psp.dwSize = sizeof(psp);
3280 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3281 psp.hInstance = hInst;
3282 psp.lParam = (LPARAM)&SetupData;
3283 psp.pfnDlgProc = StartDlgProc;
3284 psp.pszTemplate = MAKEINTRESOURCEW(IDD_STARTPAGE);
3285 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3286
3287 /* Create the Install type selection page */
3288 psp.dwSize = sizeof(psp);
3289 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3290 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
3291 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
3292 psp.hInstance = hInst;
3293 psp.lParam = (LPARAM)&SetupData;
3294 psp.pfnDlgProc = TypeDlgProc;
3295 psp.pszTemplate = MAKEINTRESOURCEW(IDD_TYPEPAGE);
3296 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3297
3298 /* Create the Upgrade/Repair selection page */
3299 psp.dwSize = sizeof(psp);
3300 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3301 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_UPDATETITLE);
3302 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_UPDATESUBTITLE);
3303 psp.hInstance = hInst;
3304 psp.lParam = (LPARAM)&SetupData;
3305 psp.pfnDlgProc = UpgradeRepairDlgProc;
3306 psp.pszTemplate = MAKEINTRESOURCEW(IDD_UPDATEREPAIRPAGE);
3307 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3308
3309 /* Create the Device Settings page */
3310 psp.dwSize = sizeof(psp);
3311 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3312 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DEVICETITLE);
3313 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DEVICESUBTITLE);
3314 psp.hInstance = hInst;
3315 psp.lParam = (LPARAM)&SetupData;
3316 psp.pfnDlgProc = DeviceDlgProc;
3317 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DEVICEPAGE);
3318 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3319
3320 /* Create the Install device settings page / boot method / install directory */
3321 psp.dwSize = sizeof(psp);
3322 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3323 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DRIVETITLE);
3324 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DRIVESUBTITLE);
3325 psp.hInstance = hInst;
3326 psp.lParam = (LPARAM)&SetupData;
3327 psp.pfnDlgProc = DriveDlgProc;
3328 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DRIVEPAGE);
3329 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3330
3331 /* Create the Summary page */
3332 psp.dwSize = sizeof(psp);
3333 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3334 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_SUMMARYTITLE);
3335 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_SUMMARYSUBTITLE);
3336 psp.hInstance = hInst;
3337 psp.lParam = (LPARAM)&SetupData;
3338 psp.pfnDlgProc = SummaryDlgProc;
3339 psp.pszTemplate = MAKEINTRESOURCEW(IDD_SUMMARYPAGE);
3340 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3341 }
3342
3343 /* Create the Installation Progress page */
3344 psp.dwSize = sizeof(psp);
3345 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
3346 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_PROCESSTITLE);
3347 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_PROCESSSUBTITLE);
3348 psp.hInstance = hInst;
3349 psp.lParam = (LPARAM)&SetupData;
3350 psp.pfnDlgProc = ProcessDlgProc;
3351 psp.pszTemplate = MAKEINTRESOURCEW(IDD_PROCESSPAGE);
3352 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3353
3354 /* Create the Finish page */
3355 psp.dwSize = sizeof(psp);
3356 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3357 psp.hInstance = hInst;
3358 psp.lParam = (LPARAM)&SetupData;
3359 psp.pfnDlgProc = FinishDlgProc;
3360 psp.pszTemplate = MAKEINTRESOURCEW(IDD_FINISHPAGE);
3361 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3362
3363 /* Create the Abort page */
3364 psp.dwSize = sizeof(psp);
3365 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
3366 psp.hInstance = hInst;
3367 psp.lParam = (LPARAM)&SetupData;
3368 psp.pfnDlgProc = FinishDlgProc; // Same dialog procedure as the Finish page.
3369 psp.pszTemplate = MAKEINTRESOURCEW(IDD_ABORTPAGE);
3370 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3371
3372 /* Create the property sheet */
3373 psh.dwSize = sizeof(psh);
3374 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
3375 psh.hInstance = hInst;
3376 psh.hwndParent = NULL;
3377 psh.nPages = nPages;
3378 psh.nStartPage = 0;
3379 psh.phpage = ahpsp;
3380 psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_WATERMARK);
3381 psh.pszbmHeader = MAKEINTRESOURCEW(IDB_HEADER);
3382
3383 /* Display the wizard */
3384 PropertySheet(&psh);
3385
3386 /* Wait for any pending installation */
3392
3393 if (SetupData.hBoldFont)
3397
3398 /* Unregister the TreeList control */
3399 // UnregisterTreeListClass(hInst);
3401
3402 if (hHotkeyThread)
3403 {
3404 PostThreadMessageW(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
3405 CloseHandle(hHotkeyThread);
3406 }
3407
3408Quit:
3409 /* Setup has finished */
3411
3412 /* Free the NT to Win32 path prefix mapping list */
3414
3415 /* Force reboot if there are no other user-interactive windows opened */
3417
3418 /* System rebooting will be done by Winlogon if necessary */
3420 {
3421#if 1 // TESTING: Disable for testing the installer locally.
3425#else
3426 DisplayMessage(NULL, MB_ICONWARNING, L"Restarting", L"Setup is now restarting your computer!");
3427#endif
3428 }
3429 return 0;
3430}
3431
3432/* EOF */
DWORD Id
static HWND hWndList[5+1]
Definition: SetParent.c:10
#define VOID
Definition: acefi.h:82
unsigned char BOOLEAN
Definition: actypes.h:127
#define msg(x)
Definition: auth_time.c:54
#define IDC_DISPLAY
Definition: resource.h:19
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
#define IDB_HEADER
Definition: resource.h:30
#define DPRINT1
Definition: precomp.h:8
BOOLEAN NTAPI PrepareFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL)
Definition: install.c:685
BOOLEAN NTAPI DoFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PSP_FILE_CALLBACK_W MsgHandler, IN PVOID Context OPTIONAL)
Definition: install.c:828
PGENERIC_LIST CreateKeyboardDriverList(IN HINF InfFile)
Definition: settings.c:1072
PGENERIC_LIST CreateComputerTypeList(IN HINF InfFile)
Definition: settings.c:524
PGENERIC_LIST CreateDisplayDriverList(IN HINF InfFile)
Definition: settings.c:708
PGENERIC_LIST CreateKeyboardLayoutList(IN HINF InfFile, IN PCWSTR LanguageId, OUT PWSTR DefaultKBLayout)
Definition: settings.c:1209
PGENERIC_LIST CreateLanguageList(IN HINF InfFile, OUT PWSTR DefaultLanguage)
Definition: settings.c:1159
struct _GENENTRY * PGENENTRY
PfnDliHook __pfnDliFailureHook2
Definition: reactos.c:3207
VOID __cdecl SetWindowResPrintfW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
Definition: reactos.c:339
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:44
VOID PropSheet_SetCloseCancel(_In_ HWND hWndWiz, _In_ BOOL Enable)
Enable or disable the Cancel and the Close title-bar property-sheet buttons.
Definition: reactos.c:1837
static INT_PTR CALLBACK ProcessDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2231
struct _FSVOL_CONTEXT FSVOL_CONTEXT
static VOID __cdecl RegistryStatus(IN REGISTRY_STATUS RegStatus,...)
Definition: reactos.c:1799
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:694
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1333
struct _COPYCONTEXT * PCOPYCONTEXT
static BOOL IsShellActive(VOID)
Detects whether a Windows shell is active.
Definition: reactos.c:2354
static INT_PTR CALLBACK TypeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:423
static FARPROC WINAPI setupDelayHook(unsigned dliNotify, PDelayLoadInfo pdli)
Controls the delay-loading of Setup DLLs from a suitable path.
Definition: reactos.c:3145
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:786
#define SystemVolume
Definition: reactos.c:35
#define DECLARE_UNICODE_STRING_SIZE(_var, _size)
Definition: reactos.c:3128
#define MAX_LIST_COLUMNS
Definition: reactos.c:784
#define InstallVolume
Definition: reactos.c:30
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: reactos.c:1267
PfnDliHook __pfnDliNotifyHook2
Custom delay-loading hooks for loading the Setup DLLs from a suitable path.
Definition: reactos.c:3206
static PCWSTR GetLocalSetupDllPath(VOID)
Definition: reactos.c:3086
static HFONT CreateBoldFont(_In_opt_ HFONT hOrigFont, _In_opt_ INT PointSize)
Create a bold font derived from the provided font.
Definition: reactos.c:71
static BOOL AreThereInteractiveWindows(_In_opt_ HWND hWndExclude)
Detects whether there exist interactive closable windows opened.
Definition: reactos.c:2412
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:2748
HANDLE ProcessHeap
Definition: reactos.c:23
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:2627
UI_CONTEXT UiContext
Definition: reactos.c:38
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:787
static INT_PTR CALLBACK UpgradeRepairDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:790
static HFONT CreateTitleFont(_In_opt_ HFONT hOrigFont)
Definition: reactos.c:105
PPARTENTRY InstallPartition
Definition: reactos.c:28
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:636
size_t LoadAllocStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen)
Definition: reactos.c:113
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:657
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:262
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:301
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2430
struct _FSVOL_CONTEXT * PFSVOL_CONTEXT
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2727
BOOL CreateListViewColumns(IN HINSTANCE hInstance, IN HWND hWndListView, IN const UINT *pIDs, IN const INT *pColsWidth, IN const INT *pColsAlign, IN UINT nNumOfColumns)
Definition: reactos.c:559
struct _CLOSABLE_WND_INFO CLOSABLE_WND_INFO
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:714
#define IDS_LIST_COLUMN_FIRST
Definition: reactos.c:781
VOID(NTAPI * PADD_ENTRY_ITEM)(IN HWND hWndList, IN LVITEM *plvItem, IN PGENERIC_LIST_ENTRY Entry, IN OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:649
static INT_PTR CALLBACK DeviceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:976
static INT_PTR CALLBACK SummaryDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1079
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:243
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2719
VOID(NTAPI * PGET_ENTRY_DESCRIPTION)(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:592
size_t FormatAllocStringWV(_In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen, _In_ PCWSTR pszFormat, _In_ va_list args)
Definition: reactos.c:148
PPARTENTRY SystemPartition
Definition: reactos.c:33
struct _CLOSABLE_WND_INFO * PCLOSABLE_WND_INFO
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:282
static VOID NTAPI AddNTOSInstallationItem(IN HWND hWndList, IN LVITEM *plvItem, IN PGENERIC_LIST_ENTRY Entry, IN OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:725
static BOOLEAN IsUnattendedSetup
Definition: reactos.c:25
static INT_PTR CALLBACK StartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:353
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:173
SETUPDATA SetupData
Definition: reactos.c:24
struct _COPYCONTEXT COPYCONTEXT
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:3037
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:3007
static BOOL CALLBACK FindUserClosableWindowProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: reactos.c:2377
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:785
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:598
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1849
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:1678
#define IDS_CLOSE
Definition: reactos.h:41
#define ShowDlgItem(hDlg, nID, nCmdShow)
Definition: reactos.h:34
#define ID_WIZFINISH
Definition: reactos.h:48
#define SetDlgItemFont(hDlg, nID, hFont, bRedraw)
Definition: reactos.h:37
#define ID_WIZNEXT
Definition: reactos.h:47
struct _SETUPDATA * PSETUPDATA
#define ID_WIZBACK
Definition: reactos.h:46
#define IDS_ERROR_SYSTEM_PARTITION
Definition: resource.h:187
#define IDC_KEYBOARD
Definition: resource.h:46
#define IDS_TYPETITLE
Definition: resource.h:98
#define IDS_RESTARTBTN
Definition: resource.h:116
#define IDS_ABORT_NO_REBOOT
Definition: resource.h:114
#define IDC_FINISHTEXT
Definition: resource.h:76
#define IDD_DRIVEPAGE
Definition: resource.h:49
#define IDS_CONFIG_SYSTEM_PARTITION
Definition: resource.h:146
#define IDS_ERROR_FORMAT_UNRECOGNIZED_VOLUME
Definition: resource.h:190
#define IDS_DRIVESUBTITLE
Definition: resource.h:105
#define IDS_PROCESSSUBTITLE
Definition: resource.h:109
#define IDS_FORMATTING_PROGRESS1
Definition: resource.h:138
#define IDS_TYPESUBTITLE
Definition: resource.h:99
#define IDC_COMPUTER
Definition: resource.h:44
#define IDS_COPYING_FILES
Definition: resource.h:149
#define IDS_ERROR_BOOTLDR_FAILED
Definition: resource.h:212
#define IDI_WINICON
Definition: resource.h:19
#define IDS_UPDATETITLE
Definition: resource.h:100
#define IDS_ERROR_COULD_NOT_CHECK
Definition: resource.h:199
#define IDS_PROCESSTITLE
Definition: resource.h:108
#define IDC_UPDATE
Definition: resource.h:36
#define IDS_REG_REGHIVEUPDATE
Definition: resource.h:156
#define IDI_ROSICON
Definition: resource.h:18
#define IDS_INSTALLBTN
Definition: resource.h:115
#define IDS_REG_CODEPAGEINFOUPDATE
Definition: resource.h:162
#define IDS_UPDATESUBTITLE
Definition: resource.h:101
#define IDS_DELETING
Definition: resource.h:145
#define IDC_UPDATETEXT
Definition: resource.h:37
#define IDS_PREPARE_FILES
Definition: resource.h:148
#define IDS_REG_DONE
Definition: resource.h:155
#define IDS_REG_IMPORTFILE
Definition: resource.h:157
#define IDS_PREPARE_PARTITIONS
Definition: resource.h:147
#define IDS_ERROR_CHECKING_PARTITION
Definition: resource.h:202
#define IDS_ERROR_BOOTLDR_ARCH_UNSUPPORTED
Definition: resource.h:210
#define IDS_REG_UNKNOWN
Definition: resource.h:163
#define IDS_ERROR_COULD_NOT_FORMAT
Definition: resource.h:193
#define IDS_MOVING
Definition: resource.h:143
#define IDS_REG_KEYBOARDSETTINGSUPDATE
Definition: resource.h:161
#define IDS_CAPTION
Definition: resource.h:97
#define IDC_PROCESSPROGRESS
Definition: resource.h:72
#define IDS_DEVICETITLE
Definition: resource.h:102
#define IDC_WARNTEXT2
Definition: resource.h:30
#define IDD_ABORTPAGE
Definition: resource.h:78
#define IDD_SUMMARYPAGE
Definition: resource.h:58
#define IDS_DRIVETITLE
Definition: resource.h:104
#define IDS_ERROR_INSTALL_BOOTCODE
Definition: resource.h:207
#define IDS_ERROR_WRITE_BOOT
Definition: resource.h:205
#define IDC_FINISHTITLE
Definition: resource.h:75
#define IDC_CONFIRM_INSTALL
Definition: resource.h:67
#define IDC_SKIPUPGRADE
Definition: resource.h:41
#define IDS_COPYING
Definition: resource.h:142
#define IDS_ERROR_INSTALL_BOOTCODE_REMOVABLE
Definition: resource.h:208
#define IDS_CHECKING_PROGRESS2
Definition: resource.h:141
#define IDS_RENAMING
Definition: resource.h:144
#define IDS_REG_ADDKBLAYOUTS
Definition: resource.h:160
#define IDS_CHECKING_PROGRESS1
Definition: resource.h:140
#define IDS_UPDATE_REGISTRY
Definition: resource.h:151
#define IDS_POSTPONEBTN
Definition: resource.h:117
#define IDB_WATERMARK
Definition: resource.h:13
#define IDC_ARCHITECTURE
Definition: resource.h:61
#define IDC_PATH
Definition: resource.h:81
#define IDC_NTOSLIST
Definition: resource.h:40
#define IDD_PROCESSPAGE
Definition: resource.h:69
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:112
#define IDC_ACTIVITY
Definition: resource.h:70
#define IDC_WARNTEXT1
Definition: resource.h:29
#define IDS_REG_LOCALESETTINGSUPDATE
Definition: resource.h:159
#define IDC_WARNTEXT3
Definition: resource.h:31
#define IDD_UPDATEREPAIRPAGE
Definition: resource.h:39
#define IDC_ITEM
Definition: resource.h:71
#define IDS_SUMMARYTITLE
Definition: resource.h:106
#define IDS_DEVICESUBTITLE
Definition: resource.h:103
#define IDD_FINISHPAGE
Definition: resource.h:74
#define IDS_FORMATTING_PROGRESS2
Definition: resource.h:139
#define IDS_SUMMARYSUBTITLE
Definition: resource.h:107
#define IDS_ABORTSETUP2
Definition: resource.h:111
#define IDS_REG_DISPLAYSETTINGSUPDATE
Definition: resource.h:158
#define IDC_DESTDRIVE
Definition: resource.h:65
#define IDD_TYPEPAGE
Definition: resource.h:33
#define IDC_INSTALLTYPE
Definition: resource.h:59
#define IDS_FINISH_NO_REBOOT
Definition: resource.h:113
#define IDS_INSTALL_BOOTLOADER
Definition: resource.h:153
#define IDC_STARTTITLE
Definition: resource.h:28
#define IDS_CREATE_REGISTRY
Definition: resource.h:150
#define IDC_INSTALLSOURCE
Definition: resource.h:60
#define IDC_RESTART_PROGRESS
Definition: resource.h:77
#define IDD_DEVICEPAGE
Definition: resource.h:43
#define IDS_ABORTSETUP
Definition: resource.h:110
#define IDS_ERROR_WRITE_PTABLE
Definition: resource.h:183
#define IDD_STARTPAGE
Definition: resource.h:27
#define IDS_ERROR_FORMATTING_PARTITION
Definition: resource.h:196
BOOL Error
Definition: chkdsk.c:66
NTSTATUS NTAPI InstallBootcodeToRemovable(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING RemovableRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath)
Definition: bootsup.c:1830
NTSTATUS NTAPI InstallBootManagerAndBootEntries(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ ULONG_PTR Options)
Installs FreeLoader on the system and configure the boot entries.
Definition: bootsup.c:1674
#define _stricmp
Definition: cat.c:22
HINSTANCE hInstance
Definition: charmap.c:19
Definition: bufpool.h:45
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:904
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
@ dliFailLoadLib
Definition: delayimp.h:37
@ dliNotePreLoadLibrary
Definition: delayimp.h:35
FARPROC(WINAPI * PfnDliHook)(unsigned, PDelayLoadInfo)
Definition: delayimp.h:77
#define ERROR_SUCCESS
Definition: deptool.c:10
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
int(* FARPROC)()
Definition: compat.h:36
#define wcsrchr
Definition: compat.h:16
#define HeapAlloc
Definition: compat.h:733
#define GetCurrentProcess()
Definition: compat.h:759
HANDLE HWND
Definition: compat.h:19
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:444
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:434
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
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:4441
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1330
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
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
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:913
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
#define IS_INTRESOURCE(x)
Definition: loader.c:613
#define OUTPUT(ch)
BOOL WINAPI CopyContext(CONTEXT *dst, DWORD context_flags, CONTEXT *src)
Definition: memory.c:1633
#define SYMBOLIC_LINK_QUERY
Definition: volume.c:47
#define __cdecl
Definition: corecrt.h:121
_ACRTIMP int __cdecl _vscwprintf(const wchar_t *, va_list)
Definition: wcs.c:1782
_ACRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *,...)
Definition: scanf.c:438
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2747
_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 _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:195
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
static const WCHAR CmdLine[]
Definition: install.c:48
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:835
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1595
#define L(x)
Definition: resources.c:13
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
#define INFINITE
Definition: serial.h:102
#define ULONG_PTR
Definition: config.h:101
#define PtrToUlong(u)
Definition: config.h:107
static PDISK_IMAGE FloppyDrive[2]
Definition: dskbios32.c:36
HINSTANCE hInst
Definition: dxdiag.c:13
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
enum _ERROR_NUMBER ERROR_NUMBER
@ ERROR_WRITE_BOOT
Definition: errorcode.h:28
@ ERROR_LOAD_TXTSETUPSIF
Definition: errorcode.h:24
@ ERROR_NO_SOURCE_DRIVE
Definition: errorcode.h:23
@ ERROR_INSTALL_BOOTCODE
Definition: errorcode.h:35
@ Success
Definition: eventcreate.c:712
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
#define SPFILENOTIFY_ENDDELETE
Definition: fileqsup.h:28
#define FILEOP_COPY
Definition: fileqsup.h:42
struct _FILEPATHS_W * PFILEPATHS_W
#define FILEOP_SKIP
Definition: fileqsup.h:49
#define SPFILENOTIFY_STARTDELETE
Definition: fileqsup.h:27
#define SPFILENOTIFY_STARTSUBQUEUE
Definition: fileqsup.h:24
#define FILEOP_DOIT
Definition: fileqsup.h:48
#define SPFILENOTIFY_ENDCOPY
Definition: fileqsup.h:36
#define SPFILENOTIFY_STARTCOPY
Definition: fileqsup.h:35
#define SPFILENOTIFY_COPYERROR
Definition: fileqsup.h:37
#define FILEOP_RENAME
Definition: fileqsup.h:43
#define SPFILENOTIFY_STARTRENAME
Definition: fileqsup.h:31
#define SPFILENOTIFY_ENDRENAME
Definition: fileqsup.h:32
#define FILEOP_DELETE
Definition: fileqsup.h:44
#define FILEOP_ABORT
Definition: fileqsup.h:47
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
struct TEXTOUTPUT * PTEXTOUTPUT
CALLBACKCOMMAND
Definition: fmifs.h:82
@ PROGRESS
Definition: fmifs.h:83
#define IDC_INSTALL
Definition: fontview.h:13
FxString * pString
Status
Definition: gdiplustypes.h:24
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
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:551
#define MOD_SHIFT
Definition: imm.h:186
#define _tWinMain
Definition: tchar.h:498
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define C_ASSERT(e)
Definition: intsafe.h:73
USHORT LANGID
Definition: mui.h:9
SPFILE_EXPORTS SpFileExports
Definition: fileqsup.c:23
SPINF_EXPORTS SpInfExports
Definition: infsupp.c:24
ULONG NTAPI GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:149
VOID NTAPI SetCurrentListEntry(IN PGENERIC_LIST List, IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:91
PGENERIC_LIST_ENTRY NTAPI GetFirstListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:110
PGENERIC_LIST_ENTRY NTAPI GetNextListEntry(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:121
PGENERIC_LIST_ENTRY NTAPI GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:102
PVOID NTAPI GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:134
HWND hList
Definition: livecd.c:10
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#define pch(ap)
Definition: match.c:418
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ASSERT(a)
Definition: mode.c:44
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPSTR LPTSTR
Definition: ms-dtyp.idl:131
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
#define HARDERROR_OVERRIDE_ERRORMODE
Definition: extypes.h:146
@ OptionOk
Definition: extypes.h:187
#define _Outptr_
Definition: no_sal2.h:262
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define RTL_NUMBER_OF_FIELD(type, field)
Definition: ntbasedef.h:715
#define UNICODE_NULL
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:330
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:639
#define STATUS_PARTITION_FAILURE
Definition: ntstatus.h:698
PGENERIC_LIST NTAPI CreateNTOSInstallationsList(_In_ PPARTLIST PartList)
Create a list of available NT OS installations on the computer, by searching for recognized ones on e...
Definition: osdetect.c:768
#define VENDOR_MICROSOFT
Definition: osdetect.h:13
struct _NTOS_INSTALLATION * PNTOS_INSTALLATION
#define VENDOR_REACTOS
Definition: osdetect.h:12
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
char CHAR
Definition: pedump.c:57
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#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 PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define PropertySheet
Definition: prsht.h:400
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_QUERYINITIALFOCUS
Definition: prsht.h:126
#define PSN_WIZFINISH
Definition: prsht.h:122
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
#define PSN_SETACTIVE
Definition: prsht.h:115
#define PROPSHEETPAGE
Definition: prsht.h:389
#define LVSIL_SMALL
Definition: commctrl.h:2304
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2692
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2678
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2731
#define PBM_SETSTEP
Definition: commctrl.h:2191
#define PBM_GETPOS
Definition: commctrl.h:2199
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2641
#define PBS_MARQUEE
Definition: commctrl.h:2203
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define ListView_GetImageList(hwnd, iImageList)
Definition: commctrl.h:2301
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2794
#define LVITEM
Definition: commctrl.h:2380
#define PBM_STEPIT
Definition: commctrl.h:2192
#define LVIF_PARAM
Definition: commctrl.h:2316
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVCF_FMT
Definition: commctrl.h:2591
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define ILC_MASK
Definition: commctrl.h:351
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2399
#define PBM_SETMARQUEE
Definition: commctrl.h:2204
#define LVCOLUMN
Definition: commctrl.h:2586
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2524
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
_In_ UINT uID
Definition: shlwapi.h:156
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define WM_NOTIFY
Definition: richedit.h:61
#define DONE
Definition: rnr20lib.h:14
#define __fallthrough
Definition: sal_old.h:314
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
DWORD LCID
Definition: nls.h:13
wcscpy
#define LoadStringW
Definition: utils.h:64
#define args
Definition: format.c:66
Entry
Definition: section.c:5216
BOOLEAN NTAPI FsVolCommitOpsQueue(_In_ PPARTLIST PartitionList, _In_ PVOLENTRY SystemVolume, _In_ PVOLENTRY InstallVolume, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Definition: fsutil.c:1097
@ FSVOLNOTIFY_STARTCHECK
Definition: fsutil.h:153
@ FSVOLNOTIFY_ENDQUEUE
Definition: fsutil.h:145
@ FSVOLNOTIFY_STARTSUBQUEUE
Definition: fsutil.h:146
@ FSVOLNOTIFY_ENDFORMAT
Definition: fsutil.h:151
@ FSVOLNOTIFY_STARTFORMAT
Definition: fsutil.h:150
@ FSVOLNOTIFY_STARTQUEUE
Definition: fsutil.h:144
@ FSVOLNOTIFY_ENDSUBQUEUE
Definition: fsutil.h:147
@ FSVOLNOTIFY_PARTITIONERROR
Definition: fsutil.h:149
@ FSVOLNOTIFY_CHECKERROR
Definition: fsutil.h:155
@ ChangeSystemPartition
Definition: fsutil.h:156
@ FSVOLNOTIFY_FORMATERROR
Definition: fsutil.h:152
@ FSVOLNOTIFY_ENDCHECK
Definition: fsutil.h:154
enum _FSVOL_OP FSVOL_OP
struct _FORMAT_VOLUME_INFO * PFORMAT_VOLUME_INFO
@ FSVOL_FORMAT
Definition: fsutil.h:162
@ FSVOL_CHECK
Definition: fsutil.h:163
@ FSVOL_DOIT
Definition: fsutil.h:166
@ FSVOL_ABORT
Definition: fsutil.h:165
@ FSVOL_RETRY
Definition: fsutil.h:167
@ FSVOL_SKIP
Definition: fsutil.h:168
enum _FSVOLNOTIFY FSVOLNOTIFY
struct _CHECK_VOLUME_INFO * PCHECK_VOLUME_INFO
PPARTLIST NTAPI CreatePartitionList(VOID)
Definition: partlist.c:2043
VOID NTAPI InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:208
ERROR_NUMBER NTAPI InitializeSetup(_Inout_ PUSETUP_DATA pSetupData, _In_opt_ PSETUP_ERROR_ROUTINE ErrorRoutine, _In_ PSPFILE_EXPORTS pSpFileExports, _In_ PSPINF_EXPORTS pSpInfExports)
Definition: setuplib.c:1020
NTSTATUS NTAPI InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:864
BOOLEAN NTAPI InitSystemPartition(_In_ PPARTLIST PartitionList, _In_ PPARTENTRY InstallPartition, _Out_ PPARTENTRY *pSystemPartition, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Find or set the active system partition.
Definition: setuplib.c:679
BOOLEAN NTAPI CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:32
VOID NTAPI FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1104
ERROR_NUMBER NTAPI UpdateRegistry(IN OUT PUSETUP_DATA pSetupData, IN BOOLEAN RepairUpdateFlag, IN PPARTLIST PartitionList, IN WCHAR DestinationDriveLetter, IN PCWSTR SelectedLanguageId, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL)
Definition: setuplib.c:1155
#define ERROR_SYSTEM_PARTITION_NOT_FOUND
Definition: setuplib.h:188
enum _REGISTRY_STATUS REGISTRY_STATUS
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
_In_ PVOID Context
Definition: storport.h:2269
LPTSTR FindSubStrI(LPCTSTR str, LPCTSTR strSearch)
Definition: stringutils.c:183
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchVPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:490
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520
Definition: shell.h:41
LPCSTR szDll
Definition: delayimp.h:70
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
DWORD dwLanguageId
Definition: winuser.h:3453
LPCWSTR lpszCaption
Definition: winuser.h:3448
HWND hwndOwner
Definition: winuser.h:3445
LPCWSTR lpszText
Definition: winuser.h:3447
HINSTANCE hInstance
Definition: winuser.h:3446
DWORD dwStyle
Definition: winuser.h:3449
Definition: ncftp.h:89
PCHAR Output
Definition: fmifs.h:33
BOOLEAN Verbose
Definition: fsutil.h:195
NTSTATUS ErrorStatus
Definition: fsutil.h:191
PVOLENTRY Volume
Definition: fsutil.h:189
PFMIFSCALLBACK Callback
Definition: fsutil.h:198
BOOLEAN CheckOnlyIfDirty
Definition: fsutil.h:196
BOOLEAN FixErrors
Definition: fsutil.h:194
BOOLEAN ScanDrive
Definition: fsutil.h:197
BOOL Found
TRUE if a closable window was found; FALSE if not.
Definition: reactos.c:2373
HWND hWndExclude
Window to exclude from search.
Definition: reactos.c:2372
ULONG TotalOperations
Definition: reactos.c:1672
ULONG CompletedOperations
Definition: reactos.c:1673
PSETUPDATA pSetupData
Definition: reactos.c:1671
UINT Win32Error
Definition: fileqsup.h:62
PCWSTR Source
Definition: fileqsup.h:61
PCWSTR Target
Definition: fileqsup.h:60
PFMIFSCALLBACK Callback
Definition: fsutil.h:183
BOOLEAN QuickFormat
Definition: fsutil.h:181
NTSTATUS ErrorStatus
Definition: fsutil.h:175
PVOLENTRY Volume
Definition: fsutil.h:173
FMIFS_MEDIA_FLAG MediaFlag
Definition: fsutil.h:179
PCWSTR FileSystemName
Definition: fsutil.h:178
PSETUPDATA pSetupData
Definition: reactos.c:1260
Definition: genlist.h:11
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
WCHAR InstallationName[MAX_PATH]
Definition: osdetect.h:26
UNICODE_STRING SystemNtPath
Definition: osdetect.h:21
WCHAR VendorName[MAX_PATH]
Definition: osdetect.h:27
PVOLENTRY Volume
Definition: osdetect.h:25
PCWSTR PathComponent
Definition: osdetect.h:22
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskM\PartitionN".
Definition: partlist.h:77
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
ULONG OnDiskPartitionNumber
Definition: partlist.h:74
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTemplate
Definition: prsht.h:218
USETUP_DATA USetupData
Definition: reactos.h:134
HINSTANCE hInstance
Definition: reactos.h:121
HFONT hBoldFont
Definition: reactos.h:126
PCWSTR SelectedLanguageId
Definition: reactos.h:149
HFONT hTitleFont
Definition: reactos.h:125
BOOL bStopInstall
Definition: reactos.h:130
HANDLE hInstallThread
Definition: reactos.h:128
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:139
BOOL bMustReboot
Definition: reactos.h:123
PPARTLIST PartitionList
Definition: reactos.h:138
HANDLE hHaltInstallEvent
Definition: reactos.h:129
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:140
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:132
BOOLEAN RepairUpdateFlag
Definition: reactos.h:136
BOOL bUnattend
Definition: reactos.h:122
HWND hWndItem
Definition: reactos.h:72
HWND hPartList
Definition: reactos.h:70
HWND hWndProgress
Definition: reactos.h:73
LONG_PTR dwPbStyle
Definition: reactos.h:74
HWND hwndDlg
Definition: reactos.h:71
USHORT MaximumLength
Definition: env_spec_w32.h:370
PGENERIC_LIST DisplayList
Definition: setuplib.h:139
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:124
PGENERIC_LIST ComputerList
Definition: setuplib.h:138
UNICODE_STRING SystemRootPath
Definition: setuplib.h:119
UNICODE_STRING SourceRootPath
Definition: setuplib.h:101
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:157
LONG BootLoaderLocation
Definition: setuplib.h:132
ARCHITECTURE_TYPE ArchType
Definition: setuplib.h:145
PGENERIC_LIST KeyboardList
Definition: setuplib.h:140
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:122
LONG FormatPartition
Definition: setuplib.h:133
VOLINFO Info
Definition: partlist.h:47
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskVolumeN".
Definition: volutil.h:18
WCHAR FileSystem[MAX_PATH+1]
Definition: volutil.h:22
WCHAR DriveLetter
Definition: volutil.h:20
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:165
ULONG ClusterSize
Definition: reactos.h:177
BOOLEAN QuickFormat
Definition: reactos.h:176
PVOLENTRY Volume
Definition: reactos.h:166
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:173
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:174
PCWSTR Label
Definition: reactos.h:175
Definition: match.c:390
UINT_PTR idFrom
Definition: winuser.h:3266
UINT code
Definition: winuser.h:3267
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
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:650
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
int TreeListRegister(HINSTANCE hInstance)
Definition: treelist.c:394
BOOL TreeListUnregister(HINSTANCE hInstance)
Definition: treelist.c:429
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
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define OUT
Definition: typedefs.h:40
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_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_ WDFSTRING String
Definition: wdfdevice.h:2439
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
Definition: wdfpdo.h:437
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
HWND WINAPI GetProgmanWindow(void)
Definition: input.c:992
HWND WINAPI GetShellWindow(void)
Definition: input.c:974
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_SUSPENDED
Definition: winbase.h:182
#define CREATE_NEW_CONSOLE
Definition: winbase.h:184
#define WINAPI
Definition: msvc.h:6
#define DeleteFont(hfont)
Definition: windowsx.h:78
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:54
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
#define CreateFontIndirect
Definition: wingdi.h:4890
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:427
#define LB_ERR
Definition: winuser.h:2468
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define CB_SETITEMDATA
Definition: winuser.h:1995
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:779
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define MF_BYCOMMAND
Definition: winuser.h:202
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define WM_QUIT
Definition: winuser.h:1651
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define KL_NAMELENGTH
Definition: winuser.h:122
#define IDCANCEL
Definition: winuser.h:842
#define VK_F10
Definition: winuser.h:2300
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
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)
BOOL WINAPI UnregisterHotKey(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1768
#define CB_ERR
Definition: winuser.h:2471
#define CB_SETCURSEL
Definition: winuser.h:1990
#define SM_CYSMICON
Definition: winuser.h:1024
#define MFS_DISABLED
Definition: winuser.h:760
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define MB_RETRYCANCEL
Definition: winuser.h:816
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WA_INACTIVE
Definition: winuser.h:2664
#define WM_INITDIALOG
Definition: winuser.h:1767
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MB_YESNO
Definition: winuser.h:828
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
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 MIIM_STATE
Definition: winuser.h:732
#define HWND_DESKTOP
Definition: winuser.h:1220
#define WM_ACTIVATE
Definition: winuser.h:1640
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define MB_ICONERROR
Definition: winuser.h:798
#define MB_OKCANCEL
Definition: winuser.h:815
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1023
#define EWX_REBOOT
Definition: winuser.h:646
#define HWND_TOP
Definition: winuser.h:1218
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_TIMER
Definition: winuser.h:1770
#define CB_ADDSTRING
Definition: winuser.h:1965
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define SC_CLOSE
Definition: winuser.h:2628
#define MB_OK
Definition: winuser.h:801
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
BOOL WINAPI IsWindowEnabled(_In_ HWND)
#define MB_ICONWARNING
Definition: winuser.h:797
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define MB_ICONQUESTION
Definition: winuser.h:800
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define MB_ICONINFORMATION
Definition: winuser.h:813
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)
#define WM_HOTKEY
Definition: winuser.h:1907
#define BN_CLICKED
Definition: winuser.h:1954
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1637
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
#define SWP_NOZORDER
Definition: winuser.h:1258
#define IDRETRY
Definition: winuser.h:844
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5512
#define GWL_STYLE
Definition: winuser.h:863
#define SendDlgItemMessage
Definition: winuser.h:6008
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define MF_GRAYED
Definition: winuser.h:129
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2061
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:942
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63