ReactOS 0.4.16-dev-597-gdbf7844
reactos.c
Go to the documentation of this file.
1/*
2 * ReactOS applications
3 * Copyright (C) 2004-2008 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19/*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS GUI first stage setup application
22 * FILE: base/setup/reactos/reactos.c
23 * PROGRAMMERS: Matthias Kupfer
24 * Dmitry Chapyshev (dmitry@reactos.org)
25 */
26
27#include "reactos.h"
28#include <winnls.h> // For GetUserDefaultLCID()
29
30#define NTOS_MODE_USER
31#include <ndk/obfuncs.h>
32
33#include "resource.h"
34
35#define NDEBUG
36#include <debug.h>
37
38/* GLOBALS ******************************************************************/
39
42
43/* The partition where to perform the installation */
45// static PVOLENTRY InstallVolume = NULL;
46#define InstallVolume (InstallPartition->Volume)
47
48/* The system partition we will actually use */
50// static PVOLENTRY SystemVolume = NULL;
51#define SystemVolume (SystemPartition->Volume)
52
53/* UI elements */
55
56
57/* FUNCTIONS ****************************************************************/
58
59static VOID
61{
63 RECT rcParent;
64 RECT rcWindow;
65
67 if (hWndParent == NULL)
69
70 GetWindowRect(hWndParent, &rcParent);
71 GetWindowRect(hWnd, &rcWindow);
72
75 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
76 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
77 0,
78 0,
80}
81
86static HFONT
88 _In_opt_ HFONT hOrigFont,
89 _In_opt_ INT PointSize)
90{
91 LOGFONTW lf = {0};
92
93 if (hOrigFont)
94 {
95 GetObjectW(hOrigFont, sizeof(lf), &lf);
96 }
97 else
98 {
99 NONCLIENTMETRICSW ncm;
100 ncm.cbSize = sizeof(ncm);
101 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
102 lf = ncm.lfMessageFont;
103 }
104
105 /* Make the font bold, keeping the other attributes */
106 lf.lfWeight = FW_BOLD;
107
108 /* Determine the font height (logical units) if necessary */
109 if (PointSize)
110 {
111 HDC hdc = GetDC(NULL);
112 lf.lfHeight = -MulDiv(PointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
113 // lf.lfWidth = 0;
115 }
116
117 return CreateFontIndirect(&lf);
118}
119
120static inline HFONT
122 _In_opt_ HFONT hOrigFont)
123{
124 /* Title font is 12pt bold */
125 return CreateBoldFont(hOrigFont, 12);
126}
127
128INT
131 _In_ UINT uType,
132 _In_opt_ PCWSTR pszTitle,
133 _In_opt_ PCWSTR pszFormatMessage,
135{
136 INT iRes;
138 MSGBOXPARAMSW mb = {0};
140 size_t MsgLen;
141 WCHAR StaticBuffer[256];
142 LPWSTR Buffer = StaticBuffer; // Use the static buffer by default.
143
144 /* We need to retrieve the current module's instance handle if either
145 * the title or the format message is specified by a resource ID */
146 if ((pszTitle && IS_INTRESOURCE(pszTitle)) || IS_INTRESOURCE(pszFormatMessage))
147 hInstance = GetModuleHandleW(NULL); // SetupData.hInstance;
148
149 /* Retrieve the format message string if this is a resource */
150 if (pszFormatMessage && IS_INTRESOURCE(pszFormatMessage)) do
151 {
152 // LoadAllocStringW()
153 PCWSTR pStr;
154
155 /* Try to load the string from the resource */
156 MsgLen = LoadStringW(hInstance, PtrToUlong(pszFormatMessage), (LPWSTR)&pStr, 0);
157 if (MsgLen == 0)
158 {
159 /* No resource string was found, return NULL */
160 Format = NULL;
161 break;
162 }
163
164 /* Allocate a new buffer, adding a NULL-terminator */
165 Format = HeapAlloc(GetProcessHeap(), 0, (MsgLen + 1) * sizeof(WCHAR));
166 if (!Format)
167 {
168 MsgLen = 0;
169 break;
170 }
171
172 /* Copy the string, NULL-terminated */
173 StringCchCopyNW(Format, MsgLen + 1, pStr, MsgLen);
174 } while (0);
175 else
176 {
177 Format = (LPWSTR)pszFormatMessage;
178 }
179
180 if (Format)
181 {
182 /*
183 * Retrieve the message length. If it is too long, allocate
184 * an auxiliary buffer; otherwise use the static buffer.
185 * The string is built to be NULL-terminated.
186 */
187 MsgLen = _vscwprintf(Format, args);
188 if (MsgLen >= _countof(StaticBuffer))
189 {
190 Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (MsgLen + 1) * sizeof(WCHAR));
191 if (!Buffer)
192 {
193 /* Allocation failed, use the original format string verbatim */
194 Buffer = Format;
195 }
196 }
197 if (Buffer != Format)
198 {
199 /* Do the printf as we use the caller's format string */
200 StringCchVPrintfW(Buffer, MsgLen + 1, Format, args);
201 }
202 }
203 else
204 {
205 Format = (LPWSTR)pszFormatMessage;
206 Buffer = Format;
207 }
208
209 /* Display the message */
210 mb.cbSize = sizeof(mb);
211 mb.hwndOwner = hWnd;
212 mb.hInstance = hInstance;
213 mb.lpszText = Buffer;
214 mb.lpszCaption = pszTitle;
215 mb.dwStyle = uType;
217 iRes = MessageBoxIndirectW(&mb);
218
219 /* Free the buffers if needed */
220 if ((Buffer != StaticBuffer) && (Buffer != Format))
222
223 if (Format && (Format != pszFormatMessage))
225
226 return iRes;
227}
228
229INT
233 _In_ UINT uType,
234 _In_opt_ PCWSTR pszTitle,
235 _In_opt_ PCWSTR pszFormatMessage,
236 ...)
237{
238 INT iRes;
240
241 va_start(args, pszFormatMessage);
242 iRes = DisplayMessageV(hWnd, uType, pszTitle, pszFormatMessage, args);
243 va_end(args);
244
245 return iRes;
246}
247
248INT
252 _In_ UINT uIDTitle,
253 _In_ UINT uIDMessage,
254 ...)
255{
256 INT iRes;
258
259 va_start(args, uIDMessage);
261 MAKEINTRESOURCEW(uIDTitle),
262 MAKEINTRESOURCEW(uIDMessage),
263 args);
264 va_end(args);
265
266 return iRes;
267}
268
269VOID
271 _In_ HWND hWnd,
273 _In_ UINT uID)
274{
275 WCHAR szText[256];
276 LoadStringW(hInstance, uID, szText, _countof(szText));
277 SetWindowTextW(hWnd, szText);
278}
279
280VOID
282 _In_ HWND hWnd,
284 _In_ UINT uID,
286{
287 WCHAR ResBuffer[256];
288 WCHAR szText[256];
289
290 LoadStringW(hInstance, uID, ResBuffer, _countof(ResBuffer));
291 StringCchVPrintfW(szText, _countof(szText), ResBuffer, args);
292 SetWindowTextW(hWnd, szText);
293}
294
295VOID
298 _In_ HWND hWnd,
300 _In_ UINT uID,
301 ...)
302{
304
305 va_start(args, uID);
307 va_end(args);
308}
309
310static INT_PTR CALLBACK
312 IN HWND hwndDlg,
313 IN UINT uMsg,
316{
317 PSETUPDATA pSetupData;
318
319 /* Retrieve pointer to the global setup data */
320 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
321
322 switch (uMsg)
323 {
324 case WM_INITDIALOG:
325 {
326 /* Save pointer to the global setup data */
327 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
328 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
329
330 /* Set title font */
331 SetDlgItemFont(hwndDlg, IDC_STARTTITLE, pSetupData->hTitleFont, TRUE);
332
333 // TEMPTEMP: Set the ReactOS-Alpha information in bold.
334 // TODO: Remove once we reach 0.5/Beta :)
335 SetDlgItemFont(hwndDlg, IDC_WARNTEXT1, pSetupData->hBoldFont, TRUE);
336 SetDlgItemFont(hwndDlg, IDC_WARNTEXT2, pSetupData->hBoldFont, TRUE);
337 SetDlgItemFont(hwndDlg, IDC_WARNTEXT3, pSetupData->hBoldFont, TRUE);
338
339 /* Center the wizard window */
340 CenterWindow(GetParent(hwndDlg));
341 break;
342 }
343
344 case WM_NOTIFY:
345 {
346 LPNMHDR lpnm = (LPNMHDR)lParam;
347
348 switch (lpnm->code)
349 {
350 case PSN_SETACTIVE:
351 {
352 /* Only "Next" and "Cancel" for the first page and hide "Back" */
354 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
356 break;
357 }
358
359 case PSN_KILLACTIVE:
360 {
361 /* Show "Back" button */
362 // PropSheet_ShowWizButtons(GetParent(hwndDlg), PSWIZB_BACK, PSWIZB_BACK);
364 break;
365 }
366
367 default:
368 break;
369 }
370 }
371 break;
372
373 default:
374 break;
375
376 }
377
378 return FALSE;
379}
380
381static INT_PTR CALLBACK
383 IN HWND hwndDlg,
384 IN UINT uMsg,
387{
388 PSETUPDATA pSetupData;
389
390 /* Retrieve pointer to the global setup data */
391 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
392
393 switch (uMsg)
394 {
395 case WM_INITDIALOG:
396 {
397 /* Save pointer to the global setup data */
398 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
399 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
400
401 /* Set the options in bold */
402 SetDlgItemFont(hwndDlg, IDC_INSTALL, pSetupData->hBoldFont, TRUE);
403 SetDlgItemFont(hwndDlg, IDC_UPDATE, pSetupData->hBoldFont, TRUE);
404
405 /* Check the "Install" radio button */
407
408 /*
409 * Enable the "Update" radio button and text only if we have
410 * available NT installations, otherwise disable them.
411 */
412 if (pSetupData->NtOsInstallsList &&
413 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0)
414 {
417 }
418 else
419 {
422 }
423
424 break;
425 }
426
427 case WM_NOTIFY:
428 {
429 LPNMHDR lpnm = (LPNMHDR)lParam;
430
431 switch (lpnm->code)
432 {
433 case PSN_SETACTIVE:
435 break;
436
438 {
439 /* Focus on "Install ReactOS" */
441 return TRUE;
442 }
443
444 case PSN_QUERYCANCEL:
445 {
446 if (DisplayMessage(GetParent(hwndDlg),
450 {
451 /* Go to the Terminate page */
453 }
454
455 /* Do not close the wizard too soon */
457 return TRUE;
458 }
459
460 case PSN_WIZNEXT: /* Set the selected data */
461 {
462 /*
463 * Go update only if we have available NT installations
464 * and we choose to do so.
465 */
466 if (pSetupData->NtOsInstallsList &&
467 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
469 {
470 pSetupData->RepairUpdateFlag = TRUE;
471
472 /*
473 * Display the existing NT installations page only
474 * if we have more than one available NT installations.
475 */
476 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
477 {
478 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
479
480 /* Actually the best would be to dynamically insert the page only when needed */
482 }
483 else
484 {
485 /* Retrieve the current installation */
486 pSetupData->CurrentInstallation =
488
490 }
491 }
492 else
493 {
494 pSetupData->CurrentInstallation = NULL;
495 pSetupData->RepairUpdateFlag = FALSE;
497 }
498
499 return TRUE;
500 }
501
502 default:
503 break;
504 }
505 }
506 break;
507
508 default:
509 break;
510
511 }
512 return FALSE;
513}
514
515
516
517BOOL
520 IN HWND hWndListView,
521 IN const UINT* pIDs,
522 IN const INT* pColsWidth,
523 IN const INT* pColsAlign,
524 IN UINT nNumOfColumns)
525{
526 UINT i;
527 LVCOLUMN lvC;
528 WCHAR szText[50];
529
530 /* Create the columns */
531 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
532 lvC.pszText = szText;
533
534 /* Load the column labels from the resource file */
535 for (i = 0; i < nNumOfColumns; i++)
536 {
537 lvC.iSubItem = i;
538 lvC.cx = pColsWidth[i];
539 lvC.fmt = pColsAlign[i];
540
541 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
542
543 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
544 return FALSE;
545 }
546
547 return TRUE;
548}
549
550typedef VOID
554 IN SIZE_T cchBufferSize);
555
556VOID
560 IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
561{
562 INT Index, CurrentEntryIndex = 0;
563 PGENERIC_LIST_ENTRY ListEntry;
565 WCHAR CurrentItemText[256];
566
567 for (Entry = List->ListHead.Flink;
568 Entry != &List->ListHead;
569 Entry = Entry->Flink)
570 {
572
573 if (GetEntryDescriptionProc)
574 {
575 GetEntryDescriptionProc(ListEntry,
576 CurrentItemText,
577 ARRAYSIZE(CurrentItemText));
578 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
579 }
580 else
581 {
583 }
584
585 if (ListEntry == List->CurrentEntry)
586 CurrentEntryIndex = Index;
587
589 }
590
591 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
592}
593
594PVOID
597{
598 INT Index;
599
601 if (Index == CB_ERR)
602 return NULL;
603
605}
606
607typedef VOID
610 IN LVITEM* plvItem,
613 IN SIZE_T cchBufferSize);
614
615VOID
619 IN PADD_ENTRY_ITEM AddEntryItemProc)
620{
621 INT CurrentEntryIndex = 0;
622 LVITEM lvItem;
623 PGENERIC_LIST_ENTRY ListEntry;
625 WCHAR CurrentItemText[256];
626
627 for (Entry = List->ListHead.Flink;
628 Entry != &List->ListHead;
629 Entry = Entry->Flink)
630 {
632
633 if (!AddEntryItemProc)
634 continue;
635
636 AddEntryItemProc(hWndList,
637 &lvItem,
638 ListEntry,
639 CurrentItemText,
640 ARRAYSIZE(CurrentItemText));
641
642 if (ListEntry == List->CurrentEntry)
643 CurrentEntryIndex = lvItem.iItem;
644 }
645
646 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
647 ListView_SetItemState(hWndList, CurrentEntryIndex,
650}
651
652PVOID
655{
656 INT Index;
657 LVITEM item;
658
660 if (Index == LB_ERR)
661 return NULL;
662
663 item.mask = LVIF_PARAM;
664 item.iItem = Index;
666
667 return (PVOID)item.lParam;
668}
669
670
671static VOID
672NTAPI
676 IN SIZE_T cchBufferSize)
677{
678 StringCchCopyW(Buffer, cchBufferSize,
680}
681
682static VOID
683NTAPI
686 IN LVITEM* plvItem,
688 IN OUT PWSTR Buffer, // SystemRootPath
689 IN SIZE_T cchBufferSize)
690{
692 PVOLINFO VolInfo = (NtOsInstall->Volume ? &NtOsInstall->Volume->Info : NULL);
693
694 if (VolInfo && VolInfo->DriveLetter)
695 {
696 /* We have retrieved a partition that is mounted */
697 StringCchPrintfW(Buffer, cchBufferSize,
698 L"%c:%s",
699 VolInfo->DriveLetter,
700 NtOsInstall->PathComponent);
701 }
702 else
703 {
704 /* We failed somewhere, just show the NT path */
705 StringCchPrintfW(Buffer, cchBufferSize,
706 L"%wZ",
707 &NtOsInstall->SystemNtPath);
708 }
709
710 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
711 plvItem->iItem = 0;
712 plvItem->iSubItem = 0;
713 plvItem->lParam = (LPARAM)Entry;
714 plvItem->pszText = NtOsInstall->InstallationName;
715
716 /* Associate vendor icon */
717 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
718 {
719 plvItem->mask |= LVIF_IMAGE;
720 plvItem->iImage = 0;
721 }
722 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
723 {
724 plvItem->mask |= LVIF_IMAGE;
725 plvItem->iImage = 1;
726 }
727
728 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
729
730 plvItem->iSubItem = 1;
731 plvItem->pszText = Buffer; // SystemRootPath;
732 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
733
734 plvItem->iSubItem = 2;
735 plvItem->pszText = NtOsInstall->VendorName;
736 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
737}
738
739
740#define IDS_LIST_COLUMN_FIRST IDS_INSTALLATION_NAME
741#define IDS_LIST_COLUMN_LAST IDS_INSTALLATION_VENDOR
742
743#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
745static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100};
747
748static INT_PTR CALLBACK
750 IN HWND hwndDlg,
751 IN UINT uMsg,
754{
755 PSETUPDATA pSetupData;
756 HWND hList;
757 HIMAGELIST hSmall;
758
759 /* Retrieve pointer to the global setup data */
760 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
761
762 switch (uMsg)
763 {
764 case WM_INITDIALOG:
765 {
766 /* Save pointer to the global setup data */
767 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
768 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
769
770 /*
771 * Keep the "Next" button disabled. It will be enabled only
772 * when the user selects an installation to upgrade.
773 */
775
776 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
777
779
780 CreateListViewColumns(pSetupData->hInstance,
781 hList,
786
787 /* Create the ImageList */
790 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
791 1, 1);
792
793 /* Add event type icons to the ImageList */
794 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_ROSICON)));
795 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_WINICON)));
796
797 /* Assign the ImageList to the List View */
799
800 InitGenericListView(hList, pSetupData->NtOsInstallsList, AddNTOSInstallationItem);
801 break;
802 }
803
804 case WM_DESTROY:
805 {
806 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
809 ImageList_Destroy(hSmall);
810 return TRUE;
811 }
812
813 case WM_COMMAND:
814 switch (LOWORD(wParam))
815 {
816 case IDC_SKIPUPGRADE:
817 {
818 /* Skip the upgrade and do the usual new-installation workflow */
819 pSetupData->CurrentInstallation = NULL;
820 pSetupData->RepairUpdateFlag = FALSE;
822 return TRUE;
823 }
824 }
825 break;
826
827 case WM_NOTIFY:
828 {
829 LPNMHDR lpnm = (LPNMHDR)lParam;
830
831 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
832 {
834
835 if (pnmv->uChanged & LVIF_STATE) /* The state has changed */
836 {
837 /* The item has been (de)selected */
838 if (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED))
839 {
841 }
842 else
843 {
844 /*
845 * Keep the "Next" button disabled. It will be enabled only
846 * when the user selects an installation to upgrade.
847 */
849 }
850 }
851
852 break;
853 }
854
855 switch (lpnm->code)
856 {
857#if 0
858 case PSN_SETACTIVE:
859 {
860 /*
861 * Keep the "Next" button disabled. It will be enabled only
862 * when the user selects an installation to upgrade.
863 */
865 break;
866 }
867#endif
868
870 {
871 /* Give the focus on and select the first item */
872 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
875 return TRUE;
876 }
877
878 case PSN_QUERYCANCEL:
879 {
880 if (DisplayMessage(GetParent(hwndDlg),
884 {
885 /* Go to the Terminate page */
887 }
888
889 /* Do not close the wizard too soon */
891 return TRUE;
892 }
893
894 case PSN_WIZNEXT: /* Set the selected data */
895 {
896 /*
897 * Go update only if we have available NT installations
898 * and we choose to do so.
899 */
900 if (!pSetupData->NtOsInstallsList ||
902 {
903 pSetupData->CurrentInstallation = NULL;
904 pSetupData->RepairUpdateFlag = FALSE;
905 break;
906 }
907
908 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
911
912 /* Retrieve the current installation */
913 pSetupData->CurrentInstallation =
915
916 /* We perform an upgrade */
917 pSetupData->RepairUpdateFlag = TRUE;
918 return TRUE;
919 }
920
921 default:
922 break;
923 }
924 }
925 break;
926
927 default:
928 break;
929
930 }
931 return FALSE;
932}
933
934static INT_PTR CALLBACK
936 IN HWND hwndDlg,
937 IN UINT uMsg,
940{
941 PSETUPDATA pSetupData;
942 HWND hList;
943
944 /* Retrieve pointer to the global setup data */
945 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
946
947 switch (uMsg)
948 {
949 case WM_INITDIALOG:
950 {
951 /* Save pointer to the global setup data */
952 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
953 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
954
955 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
956 InitGenericComboList(hList, pSetupData->USetupData.ComputerList, GetSettingDescription);
957
958 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
959 InitGenericComboList(hList, pSetupData->USetupData.DisplayList, GetSettingDescription);
960
961 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
962 InitGenericComboList(hList, pSetupData->USetupData.KeyboardList, GetSettingDescription);
963
964 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
965 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
966
967 break;
968 }
969
970 case WM_NOTIFY:
971 {
972 LPNMHDR lpnm = (LPNMHDR)lParam;
973
974 switch (lpnm->code)
975 {
976 case PSN_SETACTIVE:
978 break;
979
981 {
982 /* Focus on "Computer" list */
984 return TRUE;
985 }
986
987 case PSN_QUERYCANCEL:
988 {
989 if (DisplayMessage(GetParent(hwndDlg),
993 {
994 /* Go to the Terminate page */
996 }
997
998 /* Do not close the wizard too soon */
1000 return TRUE;
1001 }
1002
1003 case PSN_WIZNEXT: /* Set the selected data */
1004 {
1005 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
1008
1009 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1012
1013 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1016
1017 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1018 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
1019 // GetSelectedComboListItem(hList));
1020
1021 return TRUE;
1022 }
1023
1024 default:
1025 break;
1026 }
1027 }
1028 break;
1029
1030 default:
1031 break;
1032
1033 }
1034 return FALSE;
1035}
1036
1037static INT_PTR CALLBACK
1039 IN HWND hwndDlg,
1040 IN UINT uMsg,
1043{
1044 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
1045
1046 PSETUPDATA pSetupData;
1047
1048 /* Retrieve pointer to the global setup data */
1049 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1050
1051 switch (uMsg)
1052 {
1053 case WM_INITDIALOG:
1054 {
1055 /* Save pointer to the global setup data */
1056 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1057 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1058 break;
1059 }
1060
1061 case WM_COMMAND:
1062 {
1064 {
1067 else
1069 }
1070 break;
1071 }
1072
1073 case WM_NOTIFY:
1074 {
1075 LPNMHDR lpnm = (LPNMHDR)lParam;
1076
1077 switch (lpnm->code)
1078 {
1079 case PSN_SETACTIVE:
1080 {
1081 WCHAR CurrentItemText[256];
1082
1084
1085 /* Show the current selected settings */
1086
1087 // FIXME! Localize
1088 if (pSetupData->RepairUpdateFlag)
1089 {
1090 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1091 L"Upgrading/Repairing \"%s\" from \"%s\"",
1093 pSetupData->CurrentInstallation->VendorName);
1094 }
1095 else
1096 {
1097 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1098 L"New ReactOS installation");
1099 }
1100 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
1101
1102 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
1103 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
1104
1106 CurrentItemText,
1107 ARRAYSIZE(CurrentItemText));
1108 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
1109
1111 CurrentItemText,
1112 ARRAYSIZE(CurrentItemText));
1113 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
1114
1116 CurrentItemText,
1117 ARRAYSIZE(CurrentItemText));
1118 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
1119
1120 if (InstallVolume->Info.DriveLetter)
1121 {
1122#if 0
1123 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1124 L"%c: \x2014 %wZ",
1125 InstallVolume->Info.DriveLetter,
1126 &pSetupData->USetupData.DestinationRootPath);
1127#else
1128 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1129 L"%c: \x2014 Harddisk %lu, Partition %lu",
1130 InstallVolume->Info.DriveLetter,
1131 InstallPartition->DiskEntry->DiskNumber,
1133#endif
1134 }
1135 else
1136 {
1137#if 0
1138 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1139 L"%wZ",
1140 &pSetupData->USetupData.DestinationRootPath);
1141#else
1142 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1143 L"Harddisk %lu, Partition %lu",
1144 InstallPartition->DiskEntry->DiskNumber,
1146#endif
1147 }
1148 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
1149
1150 SetDlgItemTextW(hwndDlg, IDC_PATH,
1152 /*pSetupData->USetupData.InstallPath.Buffer*/);
1153
1154
1155 /* Change the "Next" button text to "Install" */
1156 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
1158 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
1160 pSetupData->hInstance,
1162
1163 /*
1164 * Keep the "Next" button disabled. It will be enabled only
1165 * when the user clicks on the installation approval checkbox.
1166 */
1169 break;
1170 }
1171
1173 {
1174 /* Focus on the confirmation check-box */
1176 return TRUE;
1177 }
1178
1179 case PSN_KILLACTIVE:
1180 {
1181 /* Restore the original "Next" button text */
1182 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
1183 break;
1184 }
1185
1186 case PSN_QUERYCANCEL:
1187 {
1188 if (DisplayMessage(GetParent(hwndDlg),
1192 {
1193 /* Go to the Terminate page */
1195 }
1196
1197 /* Do not close the wizard too soon */
1199 return TRUE;
1200 }
1201
1202 default:
1203 break;
1204 }
1205 break;
1206 }
1207
1208 default:
1209 break;
1210 }
1211
1212 return FALSE;
1213}
1214
1215
1216typedef struct _FSVOL_CONTEXT
1217{
1219 // PAGE_NUMBER NextPageOnAbort;
1221
1222static
1223BOOLEAN
1224NTAPI
1227 _In_ ULONG Modifier,
1228 _In_ PVOID Argument)
1229{
1230 switch (Command)
1231 {
1232 case PROGRESS:
1233 {
1234 PULONG Percent = (PULONG)Argument;
1235 DPRINT("%lu percent completed\n", *Percent);
1237 break;
1238 }
1239
1240#if 0
1241 case OUTPUT:
1242 {
1243 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
1244 DPRINT("%s\n", output->Output);
1245 break;
1246 }
1247#endif
1248
1249 case DONE:
1250 {
1251#if 0
1252 PBOOLEAN Success = (PBOOLEAN)Argument;
1253 if (*Success == FALSE)
1254 {
1255 DPRINT("FormatEx was unable to complete successfully.\n\n");
1256 }
1257#endif
1258 DPRINT("Done\n");
1259 break;
1260 }
1261
1262 default:
1263 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1264 break;
1265 }
1266
1267 return TRUE;
1268}
1269
1270static
1271BOOLEAN
1272NTAPI
1275 _In_ ULONG Modifier,
1276 _In_ PVOID Argument)
1277{
1278 switch (Command)
1279 {
1280 default:
1281 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1282 break;
1283 }
1284
1285 return TRUE;
1286}
1287
1288// PFSVOL_CALLBACK
1289static FSVOL_OP
1293 _In_ FSVOLNOTIFY FormatStatus,
1294 _In_ ULONG_PTR Param1,
1295 _In_ ULONG_PTR Param2)
1296{
1297 PFSVOL_CONTEXT FsVolContext = (PFSVOL_CONTEXT)Context;
1298
1299 switch (FormatStatus)
1300 {
1301 // FIXME: Deprecate!
1303 {
1304 // PPARTENTRY SystemPartition = (PPARTENTRY)Param1;
1305
1306 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1307 // if (ChangeSystemPartitionPage(Ir, SystemPartition))
1308 // return FSVOL_DOIT;
1309 return FSVOL_ABORT;
1310 }
1311
1313 {
1314 switch (Param1)
1315 {
1317 {
1318 // ERROR_WRITE_PTABLE
1320 0, // Default to "Error"
1322 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1323 // TODO: Go back to the partitioning page?
1324 break;
1325 }
1326
1328 {
1329 /* FIXME: improve the error dialog */
1330 //
1331 // Error dialog should say that we cannot find a suitable
1332 // system partition and create one on the system. At this point,
1333 // it may be nice to ask the user whether he wants to continue,
1334 // or use an external drive as the system drive/partition
1335 // (e.g. floppy, USB drive, etc...)
1336 //
1338 0, // Default to "Error"
1340 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1341 // TODO: Go back to the partitioning page
1342 break;
1343 }
1344
1345 default:
1346 break;
1347 }
1348 return FSVOL_ABORT;
1349 }
1350
1353 // NOTE: If needed, clear progress gauges.
1354 return FSVOL_DOIT;
1355
1357 {
1358 if ((FSVOL_OP)Param1 == FSVOL_FORMAT)
1359 {
1360 /*
1361 * In case we just repair an existing installation, or make
1362 * an unattended setup without formatting, just go to the
1363 * filesystem check step.
1364 */
1365 if (FsVolContext->pSetupData->RepairUpdateFlag)
1366 return FSVOL_SKIP;
1369 return FSVOL_SKIP;
1371 /* Set status text */
1373 }
1374 else
1375 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1376 {
1377 /* Set status text */
1379
1380 /* Filechecking step: set progress marquee style and start it up */
1384 }
1385
1386 return FSVOL_DOIT;
1387 }
1388
1390 {
1391 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1392 {
1393 /* File-checking finished: stop the progress bar and restore its style */
1396 }
1397 return 0;
1398 }
1399
1401 {
1402 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1403
1404 // FIXME: See also FSVOLNOTIFY_PARTITIONERROR
1405 if (FmtInfo->ErrorStatus == STATUS_PARTITION_FAILURE)
1406 {
1407 // ERROR_WRITE_PTABLE
1409 0, // Default to "Error"
1411 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1412 // TODO: Go back to the partitioning page?
1413 return FSVOL_ABORT;
1414 }
1415 else
1417 {
1418 /* FIXME: show an error dialog */
1419 // MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
1421 0, // Default to "Error"
1423 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1424 return FSVOL_ABORT;
1425 }
1426 else
1427 if (FmtInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1428 {
1429 INT nRet;
1430
1432 NULL, // Default to "Error"
1434 FmtInfo->FileSystemName);
1435 if (nRet == IDCANCEL)
1436 {
1437 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1438 return FSVOL_ABORT;
1439 }
1440 else if (nRet == IDOK)
1441 {
1442 return FSVOL_RETRY;
1443 }
1444 }
1445 else if (!NT_SUCCESS(FmtInfo->ErrorStatus))
1446 {
1447 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1448
1449 DPRINT1("FormatPartition() failed with status 0x%08lx\n", FmtInfo->ErrorStatus);
1450
1451 // ERROR_FORMATTING_PARTITION
1453 0, // Default to "Error"
1455 FmtInfo->Volume->Info.DeviceName);
1456 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1457 return FSVOL_ABORT;
1458 }
1459
1460 return FSVOL_RETRY;
1461 }
1462
1464 {
1465 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1466
1467 if (ChkInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1468 {
1469 INT nRet;
1470
1472 NULL, // Default to "Error"
1474 ChkInfo->Volume->Info.FileSystem);
1475 if (nRet == IDCANCEL)
1476 {
1477 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1478 return FSVOL_ABORT;
1479 }
1480 else if (nRet == IDOK)
1481 {
1482 return FSVOL_SKIP;
1483 }
1484 }
1485 else if (!NT_SUCCESS(ChkInfo->ErrorStatus))
1486 {
1487 DPRINT1("ChkdskPartition() failed with status 0x%08lx\n", ChkInfo->ErrorStatus);
1488
1490 0, // Default to "Error"
1492 ChkInfo->ErrorStatus);
1493 return FSVOL_SKIP;
1494 }
1495
1496 return FSVOL_SKIP;
1497 }
1498
1500 {
1501 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1502 PVOL_CREATE_INFO VolCreate;
1503
1504 ASSERT((FSVOL_OP)Param2 == FSVOL_FORMAT);
1505
1506 /* Find the volume info in the partition TreeList UI.
1507 * If none, don't format it. */
1509 FmtInfo->Volume);
1510 if (!VolCreate)
1511 return FSVOL_SKIP;
1512 ASSERT(VolCreate->Volume == FmtInfo->Volume);
1513
1514 /* If there is no formatting information, skip it */
1515 if (!*VolCreate->FileSystemName)
1516 return FSVOL_SKIP;
1517
1518 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1519
1520 /* Set status text */
1521 if (FmtInfo->Volume->Info.DriveLetter)
1522 {
1525 IDS_FORMATTING_PROGRESS1, // L"Formatting volume %c: (%s) in %s..."
1526 FmtInfo->Volume->Info.DriveLetter,
1527 FmtInfo->Volume->Info.DeviceName,
1528 VolCreate->FileSystemName);
1529 }
1530 else
1531 {
1534 IDS_FORMATTING_PROGRESS2, // L"Formatting volume %s in %s..."
1535 FmtInfo->Volume->Info.DeviceName,
1536 VolCreate->FileSystemName);
1537 }
1538
1539 // StartFormat(FmtInfo, FileSystemList->Selected);
1540 FmtInfo->FileSystemName = VolCreate->FileSystemName;
1541 FmtInfo->MediaFlag = VolCreate->MediaFlag;
1542 FmtInfo->Label = VolCreate->Label;
1543 FmtInfo->QuickFormat = VolCreate->QuickFormat;
1544 FmtInfo->ClusterSize = VolCreate->ClusterSize;
1545 FmtInfo->Callback = FormatCallback;
1546
1547 /* Set up the progress bar */
1549 PBM_SETRANGE, 0, MAKELPARAM(0, 100));
1551 PBM_SETPOS, 0, 0);
1552
1553 return FSVOL_DOIT;
1554 }
1555
1557 {
1558 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1559
1560 // EndFormat(FmtInfo->ErrorStatus);
1561 if (FmtInfo->FileSystemName)
1562 *(PWSTR)FmtInfo->FileSystemName = UNICODE_NULL; // FIXME: HACK!
1563
1564 // /* Reset the file system list */
1565 // ResetFileSystemList();
1566 return 0;
1567 }
1568
1570 {
1571 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1572 PVOL_CREATE_INFO VolCreate;
1573
1574 ASSERT((FSVOL_OP)Param2 == FSVOL_CHECK);
1575
1576 /* Find the volume info in the partition TreeList UI.
1577 * If none, don't check it. */
1579 ChkInfo->Volume);
1580 if (!VolCreate)
1581 return FSVOL_SKIP;
1582 ASSERT(VolCreate->Volume == ChkInfo->Volume);
1583
1584 ASSERT(*ChkInfo->Volume->Info.DeviceName);
1585
1586 /* Set status text */
1587 if (ChkInfo->Volume->Info.DriveLetter)
1588 {
1591 IDS_CHECKING_PROGRESS1, // L"Checking volume %c: (%s)..."
1592 ChkInfo->Volume->Info.DriveLetter,
1593 ChkInfo->Volume->Info.DeviceName);
1594 }
1595 else
1596 {
1599 IDS_CHECKING_PROGRESS2, // L"Checking volume %s..."
1600 ChkInfo->Volume->Info.DeviceName);
1601 }
1602
1603 // StartCheck(ChkInfo);
1604 // TODO: Think about which values could be defaulted...
1605 ChkInfo->FixErrors = TRUE;
1606 ChkInfo->Verbose = FALSE;
1607 ChkInfo->CheckOnlyIfDirty = TRUE;
1608 ChkInfo->ScanDrive = FALSE;
1609 ChkInfo->Callback = ChkdskCallback;
1610
1611 return FSVOL_DOIT;
1612 }
1613
1615 {
1616 // PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1617 // EndCheck(ChkInfo->ErrorStatus);
1618 return 0;
1619 }
1620 }
1621
1622 return 0;
1623}
1624
1625
1626
1627typedef struct _COPYCONTEXT
1628{
1633
1634static UINT
1638 UINT_PTR Param1,
1639 UINT_PTR Param2)
1640{
1641 PCOPYCONTEXT CopyContext = (PCOPYCONTEXT)Context;
1642 PFILEPATHS_W FilePathInfo;
1643 PCWSTR SrcFileName, DstFileName;
1644
1646 if (CopyContext->pSetupData->bStopInstall)
1647 return FILEOP_ABORT; // Stop committing files
1648
1649 switch (Notification)
1650 {
1652 {
1653 CopyContext->TotalOperations = (ULONG)Param2;
1654 CopyContext->CompletedOperations = 0;
1655
1656 /* Set up the progress bar */
1658 PBM_SETRANGE, 0,
1659 MAKELPARAM(0, CopyContext->TotalOperations));
1661 PBM_SETSTEP, 1, 0);
1663 PBM_SETPOS, 0, 0);
1664 break;
1665 }
1666
1670 {
1671 FilePathInfo = (PFILEPATHS_W)Param1;
1672
1674 {
1675 /* Display delete message */
1676 ASSERT(Param2 == FILEOP_DELETE);
1677
1678 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1679 if (DstFileName) ++DstFileName;
1680 else DstFileName = FilePathInfo->Target;
1681
1684 IDS_DELETING, // STRING_DELETING
1685 DstFileName);
1686 }
1688 {
1689 UINT uMsgID;
1690
1691 /* Display move/rename message */
1692 ASSERT(Param2 == FILEOP_RENAME);
1693
1694 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1695 if (SrcFileName) ++SrcFileName;
1696 else SrcFileName = FilePathInfo->Source;
1697
1698 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1699 if (DstFileName) ++DstFileName;
1700 else DstFileName = FilePathInfo->Target;
1701
1702 if (!_wcsicmp(SrcFileName, DstFileName))
1703 uMsgID = IDS_MOVING; // STRING_MOVING
1704 else
1705 uMsgID = IDS_RENAMING; // STRING_RENAMING
1708 uMsgID,
1709 SrcFileName, DstFileName);
1710 }
1712 {
1713 /* Display copy message */
1714 ASSERT(Param2 == FILEOP_COPY);
1715
1716 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1717 if (DstFileName) ++DstFileName;
1718 else DstFileName = FilePathInfo->Target;
1719
1722 IDS_COPYING, // STRING_COPYING
1723 DstFileName);
1724 }
1725 break;
1726 }
1727
1729 {
1730 FilePathInfo = (PFILEPATHS_W)Param1;
1731
1732 DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
1733 FilePathInfo->Target, FilePathInfo->Win32Error);
1734 return FILEOP_SKIP;
1735 }
1736
1740 {
1741 CopyContext->CompletedOperations++;
1742
1743 /* SYSREG checkpoint */
1744 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1745 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1746
1748 break;
1749 }
1750 }
1751
1752 return FILEOP_DOIT;
1753}
1754
1755static VOID
1756__cdecl
1758{
1759 /* WARNING: Please keep this lookup table in sync with the resources! */
1760 static const UINT StringIDs[] =
1761 {
1762 IDS_REG_DONE, /* Success */
1763 IDS_REG_REGHIVEUPDATE, /* RegHiveUpdate */
1764 IDS_REG_IMPORTFILE, /* ImportRegHive */
1765 IDS_REG_DISPLAYSETTINGSUPDATE, /* DisplaySettingsUpdate */
1766 IDS_REG_LOCALESETTINGSUPDATE, /* LocaleSettingsUpdate */
1767 IDS_REG_ADDKBLAYOUTS, /* KeybLayouts */
1768 IDS_REG_KEYBOARDSETTINGSUPDATE, /* KeybSettingsUpdate */
1769 IDS_REG_CODEPAGEINFOUPDATE, /* CodePageInfoUpdate */
1770 };
1771
1772 if (RegStatus < _countof(StringIDs))
1773 {
1774 va_list args;
1775 va_start(args, RegStatus);
1777 va_end(args);
1778 }
1779 else
1780 {
1782 }
1783
1785}
1786
1792VOID
1794 _In_ HWND hWndWiz,
1796{
1797 EnableDlgItem(hWndWiz, IDCANCEL, Enable);
1798 // ShowDlgItem(hWndWiz, IDCANCEL, Enable ? SW_SHOW : SW_HIDE);
1800 SC_CLOSE,
1802}
1803
1804static DWORD
1805WINAPI
1807 IN LPVOID Param)
1808{
1809 PSETUPDATA pSetupData;
1810 HWND hwndDlg = (HWND)Param;
1811 HWND hWndProgress;
1812 LONG_PTR dwStyle;
1813 ERROR_NUMBER ErrorNumber;
1816 FSVOL_CONTEXT FsVolContext;
1817 COPYCONTEXT CopyContext;
1819
1820 /* Retrieve pointer to the global setup data */
1821 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1822
1823 /* Get the progress handle */
1824 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1825
1826 /* Setup global UI context */
1827 UiContext.hwndDlg = hwndDlg;
1829 UiContext.hWndProgress = hWndProgress;
1830 UiContext.dwPbStyle = 0;
1831
1832
1833 /* Disable the Close/Cancel buttons during all partition operations */
1834 // TODO: Consider, alternatively, to just show an info-box saying
1835 // that the installation process cannot be canceled at this stage?
1836 // PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
1838
1839
1840 /*
1841 * Find/Set the system partition, and apply all pending partition operations.
1842 */
1843
1844 /* Create context for the volume/partition operations */
1845 FsVolContext.pSetupData = pSetupData;
1846
1847 /* Set status text */
1849 pSetupData->hInstance,
1851 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1852
1853 /* Find or set the active system partition before starting formatting */
1858 &FsVolContext);
1859 // if (!Success)
1860 // return FsVolContext.NextPageOnAbort;
1861 //
1862 // FIXME?? If cannot use any system partition, install FreeLdr on floppy / removable media??
1863 //
1864 if (!Success)
1865 {
1866 /* Display an error if an unexpected failure happened */
1867 MessageBoxW(GetParent(hwndDlg), L"Failed to find or set the system partition!", L"Error", MB_ICONERROR);
1868
1869 /* Re-enable the Close/Cancel buttons */
1871
1872 /*
1873 * We failed due to an unexpected error, keep on the copy page to view the current state,
1874 * but enable the "Next" button to allow the user to continue to the terminate page.
1875 */
1877 return 1;
1878 }
1879
1880
1881 /* Set status text */
1883 pSetupData->hInstance,
1885 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1886
1887 /* Apply all pending operations on partitions: formatting and checking */
1892 &FsVolContext);
1893 if (!Success)
1894 {
1895 /* Display an error if an unexpected failure happened */
1896 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the partitions!", L"Error", MB_ICONERROR);
1897
1898 /* Re-enable the Close/Cancel buttons */
1900
1901 /*
1902 * We failed due to an unexpected error, keep on the copy page to view the current state,
1903 * but enable the "Next" button to allow the user to continue to the terminate page.
1904 */
1906 return 1;
1907 }
1908
1909
1910 /* Re-enable the Close/Cancel buttons */
1912
1913
1914
1915 /* Re-calculate the final destination paths */
1917 Status = InitDestinationPaths(&pSetupData->USetupData,
1918 NULL, // pSetupData->USetupData.InstallationDirectory,
1920 if (!NT_SUCCESS(Status))
1921 {
1922 DisplayMessage(GetParent(hwndDlg), MB_ICONERROR, L"Error", L"InitDestinationPaths() failed with status 0x%08lx\n", Status);
1923
1924 /*
1925 * We failed due to an unexpected error, keep on the copy page to view the current state,
1926 * but enable the "Next" button to allow the user to continue to the terminate page.
1927 */
1929 return 1;
1930 }
1931
1932
1933
1934 /*
1935 * Preparation of the list of files to be copied
1936 */
1937
1938 /* Set status text */
1940 pSetupData->hInstance,
1942 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1943
1944 /* Set progress marquee style and start it up */
1945 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
1946 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
1947 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
1948
1949 /* Prepare the list of files */
1950 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
1951
1952 /* Stop progress and restore its style */
1953 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1954 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1955
1956 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
1957 {
1958 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1959 if (!pSetupData->bStopInstall)
1960 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the list of files!", L"Error", MB_ICONERROR);
1961
1962 /*
1963 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1964 * but enable the "Next" button to allow the user to continue to the terminate page.
1965 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1966 */
1967 if (!pSetupData->bStopInstall)
1969 return 1;
1970 }
1971
1972
1973 /*
1974 * Perform the file copy
1975 */
1976
1977 /* Set status text */
1979 pSetupData->hInstance,
1981 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1982
1983 /* Create context for the copy process */
1984 CopyContext.pSetupData = pSetupData;
1985 CopyContext.TotalOperations = 0;
1986 CopyContext.CompletedOperations = 0;
1987
1988 /* Do the file copying - The callback handles whether or not we should stop file copying */
1989 if (!DoFileCopy(&pSetupData->USetupData, FileCopyCallback, &CopyContext))
1990 {
1991 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1992 if (!pSetupData->bStopInstall)
1993 MessageBoxW(GetParent(hwndDlg), L"Failed to copy the files!", L"Error", MB_ICONERROR);
1994
1995 /*
1996 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1997 * but enable the "Next" button to allow the user to continue to the terminate page.
1998 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1999 */
2000 if (!pSetupData->bStopInstall)
2002 return 1;
2003 }
2004
2005 // /* Set status text */
2006 // SetWindowResTextW(GetDlgItem(hwndDlg, IDC_ACTIVITY),
2007 // pSetupData->hInstance,
2008 // IDS_INSTALL_FINALIZE);
2009 // SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2010
2011 /* Create the $winnt$.inf file */
2012 InstallSetupInfFile(&pSetupData->USetupData);
2013
2014
2015 /*
2016 * Create or update the registry hives
2017 */
2018
2019 /* Set status text */
2021 pSetupData->hInstance,
2024 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2025
2026 /* Set up the progress bar */
2027 SendMessageW(hWndProgress,
2028 PBM_SETRANGE, 0,
2029 MAKELPARAM(0, 8)); // FIXME: hardcoded number of steps, see StringIDs[] array in RegistryStatus()
2030 SendMessageW(hWndProgress,
2031 PBM_SETSTEP, 1, 0);
2032 SendMessageW(hWndProgress,
2033 PBM_SETPOS, 0, 0);
2034
2035 ErrorNumber = UpdateRegistry(&pSetupData->USetupData,
2036 pSetupData->RepairUpdateFlag,
2037 pSetupData->PartitionList,
2038 InstallVolume->Info.DriveLetter,
2039 pSetupData->SelectedLanguageId,
2041 NULL /* SubstSettings */);
2042 DBG_UNREFERENCED_PARAMETER(ErrorNumber);
2044
2045 /*
2046 * And finally, install the bootloader
2047 */
2048
2049 /* Set status text */
2051 pSetupData->hInstance,
2053 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2054
2056 StringCchPrintfW(PathBuffer, _countof(PathBuffer),
2057 L"%s\\", SystemPartition->DeviceName);
2058 RtlCreateUnicodeString(&pSetupData->USetupData.SystemRootPath, PathBuffer);
2059 DPRINT1("SystemRootPath: %wZ\n", &pSetupData->USetupData.SystemRootPath);
2060
2061 switch (pSetupData->USetupData.BootLoaderLocation)
2062 {
2063 /* Install on removable disk */
2064 case 1:
2065 {
2066 // TODO: So far SETUP only supports the 1st floppy.
2067 // Use a simple UI like comdlg32's DlgDirList* to show
2068 // a list of drives that the user could select.
2069 static const UNICODE_STRING FloppyDrive = RTL_CONSTANT_STRING(L"\\Device\\Floppy0\\");
2070 static const WCHAR DriveLetter = L'A';
2071
2072 INT nRet;
2073 RetryCancel:
2074 nRet = DisplayMessage(GetParent(hwndDlg),
2076 L"Bootloader installation",
2077 L"Please insert a blank floppy disk in drive %c: .\n"
2078 L"All data in the floppy disk will be erased!\n"
2079 L"\nClick on OK to continue."
2080 L"\nClick on CANCEL to skip bootloader installation.",
2081 DriveLetter);
2082 if (nRet != IDOK)
2083 break; /* Skip installation */
2084
2085 Retry:
2087 &FloppyDrive,
2088 &pSetupData->USetupData.SourceRootPath,
2089 &pSetupData->USetupData.DestinationArcPath);
2090 if (Status == STATUS_SUCCESS)
2091 break; /* Successful installation */
2092
2094 {
2095 // ERROR_NO_FLOPPY
2096 nRet = DisplayMessage(GetParent(hwndDlg),
2098 NULL, // Default to "Error"
2099 L"No disk detected in drive %c: .",
2100 DriveLetter);
2101 if (nRet == IDRETRY)
2102 goto Retry;
2103 }
2104 else if ((Status == ERROR_WRITE_BOOT) ||
2106 {
2107 /* Error when writing the boot code */
2108 DisplayError(GetParent(hwndDlg),
2109 0, // Default to "Error"
2111 }
2112 else if (!NT_SUCCESS(Status))
2113 {
2114 /* Any other NTSTATUS failure code */
2115 DPRINT1("InstallBootcodeToRemovable() failed: Status 0x%lx\n", Status);
2116 DisplayError(GetParent(hwndDlg),
2117 0, // Default to "Error"
2119 Status);
2120 }
2121 goto RetryCancel;
2122 }
2123
2124 /* Install on hard-disk */
2125 case 2: // System partition / MBR and VBR (on BIOS-based PC)
2126 case 3: // VBR only (on BIOS-based PC)
2127 {
2128 /* Copy FreeLoader to the disk and save the boot entries */
2130 pSetupData->USetupData.ArchType,
2131 &pSetupData->USetupData.SystemRootPath,
2132 &pSetupData->USetupData.SourceRootPath,
2133 &pSetupData->USetupData.DestinationArcPath,
2134 (pSetupData->USetupData.BootLoaderLocation == 2)
2135 ? 1 /* Install MBR and VBR */
2136 : 0 /* Install VBR only */);
2137 if (Status == STATUS_SUCCESS)
2138 break; /* Successful installation */
2139
2140 if (Status == ERROR_WRITE_BOOT)
2141 {
2142 /* Error when writing the VBR */
2143 DisplayError(GetParent(hwndDlg),
2144 0, // Default to "Error"
2146 SystemVolume->Info.FileSystem);
2147 }
2148 else if (Status == ERROR_INSTALL_BOOTCODE)
2149 {
2150 /* Error when writing the MBR */
2151 DisplayError(GetParent(hwndDlg),
2152 0, // Default to "Error"
2154 L"MBR");
2155 }
2156 else if (Status == STATUS_NOT_SUPPORTED)
2157 {
2158 DisplayError(GetParent(hwndDlg),
2159 0, // Default to "Error"
2161 }
2162 else if (!NT_SUCCESS(Status))
2163 {
2164 /* Any other NTSTATUS failure code */
2165 DPRINT1("InstallBootManagerAndBootEntries() failed: Status 0x%lx\n", Status);
2166 DisplayError(GetParent(hwndDlg),
2167 0, // Default to "Error"
2169 Status);
2170 }
2171 break;
2172 }
2173
2174 /* Skip installation */
2175 case 0:
2176 default:
2177 break;
2178 }
2179
2180
2181 /* We are done! Switch to the Terminate page */
2183 return 0;
2184}
2185
2186
2187static INT_PTR CALLBACK
2189 IN HWND hwndDlg,
2190 IN UINT uMsg,
2193{
2194 PSETUPDATA pSetupData;
2195
2196 /* Retrieve pointer to the global setup data */
2197 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2198
2199 switch (uMsg)
2200 {
2201 case WM_INITDIALOG:
2202 {
2203 /* Save pointer to the global setup data */
2204 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2205 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2206
2207 /* Reset status text */
2208 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
2209 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2210 break;
2211 }
2212
2213 case WM_NOTIFY:
2214 {
2215 LPNMHDR lpnm = (LPNMHDR)lParam;
2216
2217 switch (lpnm->code)
2218 {
2219 case PSN_SETACTIVE:
2220 {
2221 /* Create the file-copy halt (manual-reset) event */
2222 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
2223 if (!pSetupData->hHaltInstallEvent)
2224 break;
2225 pSetupData->bStopInstall = FALSE;
2226
2227 /* Start the prepare-and-copy files thread */
2228 pSetupData->hInstallThread =
2229 CreateThread(NULL, 0,
2231 (PVOID)hwndDlg,
2233 NULL);
2234 if (!pSetupData->hInstallThread)
2235 {
2236 CloseHandle(pSetupData->hHaltInstallEvent);
2237 pSetupData->hHaltInstallEvent = NULL;
2238
2239 MessageBoxW(GetParent(hwndDlg), L"Cannot create the prepare-and-copy files thread!", L"Error", MB_ICONERROR);
2240 break;
2241 }
2242
2243 /* Disable all buttons during installation process - buttons will be reenabled by the installation thread */
2245
2246 /* Resume the installation thread */
2247 ResumeThread(pSetupData->hInstallThread);
2248
2249 break;
2250 }
2251
2252 case PSN_QUERYCANCEL:
2253 {
2254 /* Halt the on-going file copy */
2255 ResetEvent(pSetupData->hHaltInstallEvent);
2256
2257 if (DisplayMessage(GetParent(hwndDlg),
2261 {
2262 /* Stop the file copy thread */
2263 pSetupData->bStopInstall = TRUE;
2264 SetEvent(pSetupData->hHaltInstallEvent);
2265
2266#if 0
2267 /* Wait for any pending installation */
2269 CloseHandle(pSetupData->hInstallThread);
2270 pSetupData->hInstallThread = NULL;
2271 CloseHandle(pSetupData->hHaltInstallEvent);
2272 pSetupData->hHaltInstallEvent = NULL;
2273#endif
2274
2275 // TODO: Unwind installation?!
2276
2277 /* Go to the Terminate page */
2279 }
2280 else
2281 {
2282 /* We don't stop installation, resume file copy */
2283 SetEvent(pSetupData->hHaltInstallEvent);
2284 }
2285
2286 /* Do not close the wizard too soon */
2288 return TRUE;
2289 }
2290
2291 default:
2292 break;
2293 }
2294 }
2295 break;
2296
2297 default:
2298 break;
2299
2300 }
2301
2302 return FALSE;
2303}
2304
2305static INT_PTR CALLBACK
2307 IN HWND hwndDlg,
2308 IN UINT uMsg,
2311{
2312 PSETUPDATA pSetupData;
2313
2314 /* Retrieve pointer to the global setup data */
2315 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2316
2317 switch (uMsg)
2318 {
2319 case WM_INITDIALOG:
2320 /* Save pointer to the global setup data */
2321 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2322 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2323
2324 /* Set title font */
2325 SetDlgItemFont(hwndDlg, IDC_FINISHTITLE, pSetupData->hTitleFont, TRUE);
2326 break;
2327
2328 case WM_TIMER:
2329 {
2330 INT Position;
2331 HWND hWndProgress;
2332
2333 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2334 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2335 if (Position == 300)
2336 {
2337 KillTimer(hwndDlg, 1);
2339 }
2340 else
2341 {
2342 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2343 }
2344 return TRUE;
2345 }
2346
2347 case WM_DESTROY:
2348 return TRUE;
2349
2350 case WM_NOTIFY:
2351 {
2352 LPNMHDR lpnm = (LPNMHDR)lParam;
2353
2354 switch (lpnm->code)
2355 {
2356 case PSN_SETACTIVE:
2357 {
2358 /* Only "Finish" for closing the wizard */
2361
2362 /* Set up the reboot progress bar */
2365 SetTimer(hwndDlg, 1, 50, NULL);
2366 break;
2367 }
2368
2369 default:
2370 break;
2371 }
2372 }
2373 break;
2374
2375 default:
2376 break;
2377
2378 }
2379
2380 return FALSE;
2381}
2382
2384 IN OUT PSETUPDATA pSetupData)
2385{
2386 pSetupData->PartitionList = CreatePartitionList();
2387 if (!pSetupData->PartitionList)
2388 {
2389 DPRINT1("Could not enumerate available disks; failing installation\n");
2390 return FALSE;
2391 }
2392
2393 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
2394 if (!pSetupData->NtOsInstallsList)
2395 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
2396
2397 /* Load the hardware, language and keyboard layout lists */
2398
2399 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
2400 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
2401 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
2402
2403 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
2404
2405 /* If not unattended, overwrite language and locale with
2406 * the current ones of the running ReactOS instance */
2407 if (!IsUnattendedSetup)
2408 {
2409 LCID LocaleID = GetUserDefaultLCID();
2410
2411 StringCchPrintfW(pSetupData->DefaultLanguage,
2412 _countof(pSetupData->DefaultLanguage),
2413 L"%08lx", LocaleID);
2414
2415 StringCchPrintfW(pSetupData->USetupData.LocaleID,
2416 _countof(pSetupData->USetupData.LocaleID),
2417 L"%08lx", LocaleID);
2418 }
2419
2420 /* new part */
2421 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
2422 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
2423 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
2424
2425 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
2426 pSetupData->SelectedLanguageId,
2427 pSetupData->DefaultKBLayout);
2428
2429 /* If not unattended, overwrite keyboard layout with
2430 * the current one of the running ReactOS instance */
2431 if (!IsUnattendedSetup)
2432 {
2433 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
2434 /* If the call fails, keep the default already stored in the buffer */
2435 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
2436 }
2437
2438 /* Change the default entries in the language and keyboard layout lists */
2439 {
2440 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
2441 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
2442 PGENERIC_LIST_ENTRY ListEntry;
2443
2444 /* Search for default language */
2445 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
2446 ListEntry = GetNextListEntry(ListEntry))
2447 {
2448 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2449 if (!_wcsicmp(pSetupData->DefaultLanguage, LocaleId))
2450 {
2451 DPRINT("found %S in LanguageList\n", LocaleId);
2452 SetCurrentListEntry(LanguageList, ListEntry);
2453 break;
2454 }
2455 }
2456
2457 /* Search for default layout */
2458 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
2459 ListEntry = GetNextListEntry(ListEntry))
2460 {
2461 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2462 if (!_wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
2463 {
2464 DPRINT("Found %S in LayoutList\n", pszLayoutId);
2465 SetCurrentListEntry(LayoutList, ListEntry);
2466 break;
2467 }
2468 }
2469 }
2470
2471 return TRUE;
2472}
2473
2474VOID
2477{
2478 InitializeListHead(&MappingList->List);
2479 MappingList->MappingsCount = 0;
2480}
2481
2482VOID
2485{
2486 PLIST_ENTRY ListEntry;
2487 PVOID Entry;
2488
2489 while (!IsListEmpty(&MappingList->List))
2490 {
2491 ListEntry = RemoveHeadList(&MappingList->List);
2492 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2494 }
2495
2496 MappingList->MappingsCount = 0;
2497}
2498
2499/*
2500 * Attempts to convert a pure NT file path into a corresponding Win32 path.
2501 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
2502 */
2503BOOL
2506 OUT PWSTR pwszPath,
2507 IN DWORD cchPathMax,
2508 IN PCWSTR pwszNTPath)
2509{
2510 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
2511 PLIST_ENTRY ListEntry;
2513 PCWSTR pwszNtPathToMap = pwszNTPath;
2514 PCWSTR pwszRemaining = NULL;
2515 DWORD cchDrives;
2516 PWCHAR pwszDrive;
2517 WCHAR wszDrives[512];
2518 WCHAR wszNTPath[MAX_PATH];
2519 WCHAR TargetPath[MAX_PATH];
2520
2521 *pwszPath = UNICODE_NULL;
2522
2523 /*
2524 * We find first a mapping inside the MappingList. If one is found, use it
2525 * to build the Win32 path. If there is none, we need to create one by
2526 * checking the Win32 drives (and possibly NT symlinks too).
2527 * In case of success, add the newly found mapping to the list and use it
2528 * to build the Win32 path.
2529 */
2530
2531 for (ListEntry = MappingList->List.Flink;
2532 ListEntry != &MappingList->List;
2533 ListEntry = ListEntry->Flink)
2534 {
2535 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2536
2537 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
2538
2539 /* Check whether the queried NT path prefixes the user-provided NT path */
2540 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
2541 if (FoundDrive)
2542 {
2543 /* Found it! */
2544
2545 /* Set the pointers and go build the Win32 path */
2546 pwszDrive = Entry->Win32Path;
2547 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
2548 goto Quit;
2549 }
2550 }
2551
2552 /*
2553 * No mapping exists for this path yet: try to find one now.
2554 */
2555
2556 /* Retrieve the mounted drives (available drive letters) */
2557 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2558 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2559 {
2560 /* Buffer too small or failure */
2561 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
2562 return FALSE;
2563 }
2564
2565/* We go back there once if RetryOnce == TRUE */
2566Retry:
2567
2568 /* Enumerate the mounted drives */
2569 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2570 {
2571 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2572 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2573 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2574 pwszDrive[2] = L'\\'; // Restore the backslash
2575
2576 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
2577
2578 /* Check whether the queried NT path prefixes the user-provided NT path */
2579 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2580 if (!FoundDrive)
2581 {
2582 PWCHAR ptr, ptr2;
2583
2584 /*
2585 * Check whether this was a network share that has a drive letter,
2586 * but the user-provided NT path points to this share without
2587 * mentioning the drive letter.
2588 *
2589 * The format is: \Device<network_redirector>\;X:<data>\share\path
2590 * The corresponding drive letter is 'X'.
2591 * A system-provided network redirector (LanManRedirector or Mup)
2592 * or a 3rd-party one may be used.
2593 *
2594 * We check whether the user-provided NT path has the form:
2595 * \Device<network_redirector><data>\share\path
2596 * as it obviously did not have the full form (the previous check
2597 * would have been OK otherwise).
2598 */
2599 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
2600 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
2601 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
2602 {
2603 /*
2604 * Normally the specified drive letter should correspond
2605 * to the one used for the mapping. But we will ignore
2606 * if it happens not to be the case.
2607 */
2608 if (pwszDrive[0] != ptr[1])
2609 {
2610 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
2611 pwszDrive[0], ptr[1]);
2612 }
2613
2614 /* Remove the drive letter from the NT network share path */
2615 ptr2 = ptr + 3;
2616 /* Swallow as many possible consecutive backslashes as there could be */
2617 while (*ptr2 == L'\\') ++ptr2;
2618
2619 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
2620
2621 /* Now do the check again */
2622 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2623 }
2624 }
2625 if (FoundDrive)
2626 {
2627 /* Found it! */
2628
2629 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
2630
2631 if (pwszNtPathToMap == pwszNTPath)
2632 {
2633 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
2634 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
2635 }
2636 break;
2637 }
2638 }
2639
2640 if (FoundDrive)
2641 {
2642 /* A mapping was found, add it to the cache */
2644 if (!Entry)
2645 {
2646 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
2647 return FALSE;
2648 }
2649 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
2650 pwszNTPath, pwszRemaining - pwszNTPath);
2651 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
2652
2653 /* Insert it as the most recent entry */
2654 InsertHeadList(&MappingList->List, &Entry->ListEntry);
2655 MappingList->MappingsCount++;
2656
2657 /* Set the pointers and go build the Win32 path */
2658 pwszDrive = Entry->Win32Path;
2659 goto Quit;
2660 }
2661
2662 /*
2663 * We failed, perhaps because the beginning of the NT path used a symlink.
2664 * Try to see whether this is the case by attempting to resolve it.
2665 * If the symlink resolution gives nothing, or we already failed once,
2666 * there is no hope in converting the path to Win32.
2667 * Otherwise, symlink resolution succeeds but we need to recheck again
2668 * the drives list.
2669 */
2670
2671 /*
2672 * In theory we would have to parse each element in the NT path and going
2673 * until finding a symlink object (otherwise we would fail straight away).
2674 * However here we can use guessing instead, since we know which kind of
2675 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
2676 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
2677 * are supported in setuplib\utils\arcname.c .
2678 *
2679 * But actually, all the supported names in arcname.c are real devices,
2680 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
2681 * just check for it.
2682 */
2683 if (!RetryOnce && !FoundDrive)
2684 {
2685 ULONG DiskNumber, PartitionNumber;
2686 INT Length;
2687
2690 HANDLE LinkHandle;
2691 UNICODE_STRING SymLink, Target;
2692
2693 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
2694 &DiskNumber, &PartitionNumber, &Length) != 2)
2695 {
2696 /* Definitively not a recognized path, bail out */
2697 return FALSE;
2698 }
2699
2700 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
2701 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
2702 SymLink.Length = SymLink.MaximumLength;
2703
2705 &SymLink,
2707 NULL,
2708 NULL);
2709 Status = NtOpenSymbolicLinkObject(&LinkHandle,
2712 if (!NT_SUCCESS(Status))
2713 {
2714 /* Not a symlink, or something else happened: bail out */
2715 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2716 &SymLink, Status);
2717 return FALSE;
2718 }
2719
2720 *TargetPath = UNICODE_NULL;
2721 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
2722
2723 /* Resolve the link and close its handle */
2725 NtClose(LinkHandle);
2726
2727 /* Check for success */
2728 if (!NT_SUCCESS(Status))
2729 {
2730 /* Not a symlink, or something else happened: bail out */
2731 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2732 &SymLink, Status);
2733 return FALSE;
2734 }
2735
2736 /* Set the pointers */
2737 pwszRemaining = pwszNTPath + Length;
2738 pwszNtPathToMap = TargetPath; // Point to our local buffer
2739
2740 /* Retry once */
2741 RetryOnce = TRUE;
2742 goto Retry;
2743 }
2744
2745 ASSERT(!FoundDrive);
2746
2747Quit:
2748 if (FoundDrive)
2749 {
2750 StringCchPrintfW(pwszPath, cchPathMax,
2751 L"%s%s",
2752 pwszDrive,
2753 pwszRemaining);
2754 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
2755 return TRUE;
2756 }
2757
2758 return FALSE;
2759}
2760
2761/* Used to enable and disable the shutdown privilege */
2762/* static */ BOOL
2764 IN LPCWSTR lpszPrivilegeName,
2765 IN BOOL bEnablePrivilege)
2766{
2767 BOOL Success;
2768 HANDLE hToken;
2770
2773 &hToken);
2774 if (!Success) return Success;
2775
2777 lpszPrivilegeName,
2778 &tp.Privileges[0].Luid);
2779 if (!Success) goto Quit;
2780
2781 tp.PrivilegeCount = 1;
2782 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
2783
2784 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
2785
2786Quit:
2787 CloseHandle(hToken);
2788 return Success;
2789}
2790
2791/* Copied from HotkeyThread() in dll/win32/syssetup/install.c */
2792static DWORD CALLBACK
2794{
2795 ATOM hotkey;
2796 MSG msg;
2797
2798 DPRINT("HotkeyThread start\n");
2799
2800 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
2801 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
2802 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
2803
2804 while (GetMessageW(&msg, NULL, 0, 0))
2805 {
2806 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
2807 {
2808 WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
2809 STARTUPINFOW si = { sizeof(si) };
2811
2812 if (CreateProcessW(NULL,
2813 CmdLine,
2814 NULL,
2815 NULL,
2816 FALSE,
2818 NULL,
2819 NULL,
2820 &si,
2821 &pi))
2822 {
2823 CloseHandle(pi.hProcess);
2824 CloseHandle(pi.hThread);
2825 }
2826 else
2827 {
2828 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
2829 }
2830 }
2831 }
2832
2833 UnregisterHotKey(NULL, hotkey);
2834 GlobalDeleteAtom(hotkey);
2835
2836 DPRINT("HotkeyThread terminate\n");
2837 return 0;
2838}
2839
2840int WINAPI
2842 HINSTANCE hPrevInstance,
2843 LPTSTR lpszCmdLine,
2844 int nCmdShow)
2845{
2846 ULONG Error;
2847 HANDLE hHotkeyThread;
2849 PROPSHEETHEADER psh;
2850 HPROPSHEETPAGE ahpsp[8];
2851 PROPSHEETPAGE psp = {0};
2852 UINT nPages = 0;
2853
2855
2860
2861 /* Initialize the NT to Win32 path prefix mapping list */
2863
2864 /* Initialize Setup */
2867 if (Error != ERROR_SUCCESS)
2868 {
2869 //
2870 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
2871 //
2873 MessageBoxW(NULL, L"GetSourcePaths failed!", L"Error", MB_ICONERROR);
2874 else if (Error == ERROR_LOAD_TXTSETUPSIF)
2876 else // FIXME!!
2877 MessageBoxW(NULL, L"Unknown error!", L"Error", MB_ICONERROR);
2878
2879 goto Quit;
2880 }
2881
2882 /* Retrieve any supplemental options from the unattend file */
2884 SetupData.bUnattend = IsUnattendedSetup; // FIXME :-)
2885
2886 /* Load extra setup data (HW lists etc...) */
2887 if (!LoadSetupData(&SetupData))
2888 goto Quit;
2889
2890 hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
2891
2892 /* Whenever any of the common controls are used in your app,
2893 * you must call InitCommonControlsEx() to register the classes
2894 * for those controls. */
2895 iccx.dwSize = sizeof(iccx);
2897 InitCommonControlsEx(&iccx);
2898
2899 /* Register the TreeList control */
2900 // RegisterTreeListClass(hInst);
2902
2903 /* Create the title and bold fonts */
2906
2907 if (!SetupData.bUnattend)
2908 {
2909 /* Create the Start page, until setup is working */
2910 // NOTE: What does "until setup is working" mean??
2911 psp.dwSize = sizeof(PROPSHEETPAGE);
2912 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2913 psp.hInstance = hInst;
2914 psp.lParam = (LPARAM)&SetupData;
2915 psp.pfnDlgProc = StartDlgProc;
2916 psp.pszTemplate = MAKEINTRESOURCEW(IDD_STARTPAGE);
2917 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2918
2919 /* Create the install type selection page */
2920 psp.dwSize = sizeof(PROPSHEETPAGE);
2921 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2922 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
2923 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
2924 psp.hInstance = hInst;
2925 psp.lParam = (LPARAM)&SetupData;
2926 psp.pfnDlgProc = TypeDlgProc;
2927 psp.pszTemplate = MAKEINTRESOURCEW(IDD_TYPEPAGE);
2928 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2929
2930 /* Create the upgrade/repair selection page */
2931 psp.dwSize = sizeof(PROPSHEETPAGE);
2932 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2933 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_UPDATETITLE);
2934 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_UPDATESUBTITLE);
2935 psp.hInstance = hInst;
2936 psp.lParam = (LPARAM)&SetupData;
2937 psp.pfnDlgProc = UpgradeRepairDlgProc;
2938 psp.pszTemplate = MAKEINTRESOURCEW(IDD_UPDATEREPAIRPAGE);
2939 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2940
2941 /* Create the device settings page */
2942 psp.dwSize = sizeof(PROPSHEETPAGE);
2943 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2944 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DEVICETITLE);
2945 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DEVICESUBTITLE);
2946 psp.hInstance = hInst;
2947 psp.lParam = (LPARAM)&SetupData;
2948 psp.pfnDlgProc = DeviceDlgProc;
2949 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DEVICEPAGE);
2950 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2951
2952 /* Create the install device settings page / boot method / install directory */
2953 psp.dwSize = sizeof(PROPSHEETPAGE);
2954 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2955 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DRIVETITLE);
2956 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DRIVESUBTITLE);
2957 psp.hInstance = hInst;
2958 psp.lParam = (LPARAM)&SetupData;
2959 psp.pfnDlgProc = DriveDlgProc;
2960 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DRIVEPAGE);
2961 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2962
2963 /* Create the summary page */
2964 psp.dwSize = sizeof(PROPSHEETPAGE);
2965 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2966 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_SUMMARYTITLE);
2967 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_SUMMARYSUBTITLE);
2968 psp.hInstance = hInst;
2969 psp.lParam = (LPARAM)&SetupData;
2970 psp.pfnDlgProc = SummaryDlgProc;
2971 psp.pszTemplate = MAKEINTRESOURCEW(IDD_SUMMARYPAGE);
2972 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2973 }
2974
2975 /* Create the installation progress page */
2976 psp.dwSize = sizeof(PROPSHEETPAGE);
2977 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2978 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_PROCESSTITLE);
2979 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_PROCESSSUBTITLE);
2980 psp.hInstance = hInst;
2981 psp.lParam = (LPARAM)&SetupData;
2982 psp.pfnDlgProc = ProcessDlgProc;
2983 psp.pszTemplate = MAKEINTRESOURCEW(IDD_PROCESSPAGE);
2984 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2985
2986 /* Create the finish-and-reboot page */
2987 psp.dwSize = sizeof(PROPSHEETPAGE);
2988 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2989 psp.hInstance = hInst;
2990 psp.lParam = (LPARAM)&SetupData;
2991 psp.pfnDlgProc = RestartDlgProc;
2992 psp.pszTemplate = MAKEINTRESOURCEW(IDD_RESTARTPAGE);
2993 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2994
2995 /* Create the property sheet */
2996 psh.dwSize = sizeof(PROPSHEETHEADER);
2997 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
2998 psh.hInstance = hInst;
2999 psh.hwndParent = NULL;
3000 psh.nPages = nPages;
3001 psh.nStartPage = 0;
3002 psh.phpage = ahpsp;
3003 psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_WATERMARK);
3004 psh.pszbmHeader = MAKEINTRESOURCEW(IDB_HEADER);
3005
3006 /* Display the wizard */
3007 PropertySheet(&psh);
3008
3009 /* Wait for any pending installation */
3015
3016 if (SetupData.hBoldFont)
3020
3021 /* Unregister the TreeList control */
3022 // UnregisterTreeListClass(hInst);
3024
3025 if (hHotkeyThread)
3026 {
3027 PostThreadMessageW(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
3028 CloseHandle(hHotkeyThread);
3029 }
3030
3031Quit:
3032 /* Setup has finished */
3034
3035 /* Free the NT to Win32 path prefix mapping list */
3037
3038#if 0 // NOTE: Disabled for testing purposes only!
3042#endif
3043
3044 return 0;
3045}
3046
3047/* EOF */
DWORD Id
unsigned char BOOLEAN
static HWND hWndList[5+1]
Definition: SetParent.c:10
#define __cdecl
Definition: accygwin.h:79
#define VOID
Definition: acefi.h:82
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#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
VOID __cdecl SetWindowResPrintfW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
Definition: reactos.c:297
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:60
VOID PropSheet_SetCloseCancel(_In_ HWND hWndWiz, _In_ BOOL Enable)
Enables or disables the Cancel and the Close title-bar property-sheet window buttons.
Definition: reactos.c:1793
static INT_PTR CALLBACK ProcessDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2188
struct _FSVOL_CONTEXT FSVOL_CONTEXT
static VOID __cdecl RegistryStatus(IN REGISTRY_STATUS RegStatus,...)
Definition: reactos.c:1757
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:653
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1291
struct _COPYCONTEXT * PCOPYCONTEXT
static INT_PTR CALLBACK TypeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:382
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:745
#define SystemVolume
Definition: reactos.c:51
static INT_PTR CALLBACK RestartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2306
#define MAX_LIST_COLUMNS
Definition: reactos.c:743
#define InstallVolume
Definition: reactos.c:46
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: reactos.c:1225
static HFONT CreateBoldFont(_In_opt_ HFONT hOrigFont, _In_opt_ INT PointSize)
Create a bold font derived from the provided font.
Definition: reactos.c:87
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:2504
HANDLE ProcessHeap
Definition: reactos.c:40
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:2383
UI_CONTEXT UiContext
Definition: reactos.c:54
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:746
static INT_PTR CALLBACK UpgradeRepairDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:749
static HFONT CreateTitleFont(_In_opt_ HFONT hOrigFont)
Definition: reactos.c:121
PPARTENTRY InstallPartition
Definition: reactos.c:44
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:595
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:616
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:250
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:281
struct _FSVOL_CONTEXT * PFSVOL_CONTEXT
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2483
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:518
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:673
#define IDS_LIST_COLUMN_FIRST
Definition: reactos.c:740
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:608
static INT_PTR CALLBACK DeviceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:935
static INT_PTR CALLBACK SummaryDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1038
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:231
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2475
VOID(NTAPI * PGET_ENTRY_DESCRIPTION)(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:551
PPARTENTRY SystemPartition
Definition: reactos.c:49
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:270
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:684
static INT_PTR CALLBACK StartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:311
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:129
SETUPDATA SetupData
Definition: reactos.c:41
struct _COPYCONTEXT COPYCONTEXT
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:2793
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:2763
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:744
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:557
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1806
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:1636
#define ShowDlgItem(hDlg, nID, nCmdShow)
Definition: reactos.h:51
#define SetDlgItemFont(hDlg, nID, hFont, bRedraw)
Definition: reactos.h:54
#define ID_WIZNEXT
Definition: reactos.h:62
struct _SETUPDATA * PSETUPDATA
#define ID_WIZBACK
Definition: reactos.h:61
#define IDS_ERROR_SYSTEM_PARTITION
Definition: resource.h:174
#define IDC_KEYBOARD
Definition: resource.h:37
#define IDS_TYPETITLE
Definition: resource.h:87
#define IDD_DRIVEPAGE
Definition: resource.h:40
#define IDS_CONFIG_SYSTEM_PARTITION
Definition: resource.h:133
#define IDS_ERROR_FORMAT_UNRECOGNIZED_VOLUME
Definition: resource.h:177
#define IDS_DRIVESUBTITLE
Definition: resource.h:94
#define IDS_PROCESSSUBTITLE
Definition: resource.h:98
#define IDS_FORMATTING_PROGRESS1
Definition: resource.h:125
#define IDS_TYPESUBTITLE
Definition: resource.h:88
#define IDC_COMPUTER
Definition: resource.h:35
#define IDS_COPYING_FILES
Definition: resource.h:136
#define IDS_ERROR_BOOTLDR_FAILED
Definition: resource.h:199
#define IDI_WINICON
Definition: resource.h:10
#define IDS_UPDATETITLE
Definition: resource.h:89
#define IDS_ERROR_COULD_NOT_CHECK
Definition: resource.h:186
#define IDS_PROCESSTITLE
Definition: resource.h:97
#define IDC_UPDATE
Definition: resource.h:27
#define IDS_REG_REGHIVEUPDATE
Definition: resource.h:143
#define IDD_RESTARTPAGE
Definition: resource.h:65
#define IDI_ROSICON
Definition: resource.h:9
#define IDS_INSTALLBTN
Definition: resource.h:104
#define IDS_REG_CODEPAGEINFOUPDATE
Definition: resource.h:149
#define IDS_UPDATESUBTITLE
Definition: resource.h:90
#define IDS_DELETING
Definition: resource.h:132
#define IDC_UPDATETEXT
Definition: resource.h:28
#define IDS_PREPARE_FILES
Definition: resource.h:135
#define IDS_REG_DONE
Definition: resource.h:142
#define IDS_REG_IMPORTFILE
Definition: resource.h:144
#define IDS_PREPARE_PARTITIONS
Definition: resource.h:134
#define IDS_ERROR_CHECKING_PARTITION
Definition: resource.h:189
#define IDS_ERROR_BOOTLDR_ARCH_UNSUPPORTED
Definition: resource.h:197
#define IDS_REG_UNKNOWN
Definition: resource.h:150
#define IDS_ERROR_COULD_NOT_FORMAT
Definition: resource.h:180
#define IDS_MOVING
Definition: resource.h:130
#define IDS_REG_KEYBOARDSETTINGSUPDATE
Definition: resource.h:148
#define IDS_CAPTION
Definition: resource.h:86
#define IDC_PROCESSPROGRESS
Definition: resource.h:63
#define IDS_DEVICETITLE
Definition: resource.h:91
#define IDC_WARNTEXT2
Definition: resource.h:21
#define IDD_SUMMARYPAGE
Definition: resource.h:49
#define IDS_DRIVETITLE
Definition: resource.h:93
#define IDS_ERROR_INSTALL_BOOTCODE
Definition: resource.h:194
#define IDS_ERROR_WRITE_BOOT
Definition: resource.h:192
#define IDC_FINISHTITLE
Definition: resource.h:66
#define IDC_CONFIRM_INSTALL
Definition: resource.h:58
#define IDC_SKIPUPGRADE
Definition: resource.h:32
#define IDS_COPYING
Definition: resource.h:129
#define IDS_ERROR_INSTALL_BOOTCODE_REMOVABLE
Definition: resource.h:195
#define IDS_CHECKING_PROGRESS2
Definition: resource.h:128
#define IDS_RENAMING
Definition: resource.h:131
#define IDS_REG_ADDKBLAYOUTS
Definition: resource.h:147
#define IDS_CHECKING_PROGRESS1
Definition: resource.h:127
#define IDS_UPDATE_REGISTRY
Definition: resource.h:138
#define IDB_WATERMARK
Definition: resource.h:4
#define IDC_ARCHITECTURE
Definition: resource.h:52
#define IDC_PATH
Definition: resource.h:70
#define IDC_NTOSLIST
Definition: resource.h:31
#define IDD_PROCESSPAGE
Definition: resource.h:60
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:103
#define IDC_ACTIVITY
Definition: resource.h:61
#define IDC_WARNTEXT1
Definition: resource.h:20
#define IDS_REG_LOCALESETTINGSUPDATE
Definition: resource.h:146
#define IDC_WARNTEXT3
Definition: resource.h:22
#define IDD_UPDATEREPAIRPAGE
Definition: resource.h:30
#define IDC_ITEM
Definition: resource.h:62
#define IDS_SUMMARYTITLE
Definition: resource.h:95
#define IDS_DEVICESUBTITLE
Definition: resource.h:92
#define IDS_FORMATTING_PROGRESS2
Definition: resource.h:126
#define IDS_SUMMARYSUBTITLE
Definition: resource.h:96
#define IDS_ABORTSETUP2
Definition: resource.h:102
#define IDS_REG_DISPLAYSETTINGSUPDATE
Definition: resource.h:145
#define IDC_DESTDRIVE
Definition: resource.h:56
#define IDD_TYPEPAGE
Definition: resource.h:24
#define IDC_INSTALLTYPE
Definition: resource.h:50
#define IDS_INSTALL_BOOTLOADER
Definition: resource.h:140
#define IDC_STARTTITLE
Definition: resource.h:19
#define IDS_CREATE_REGISTRY
Definition: resource.h:137
#define IDC_INSTALLSOURCE
Definition: resource.h:51
#define IDC_RESTART_PROGRESS
Definition: resource.h:67
#define IDD_DEVICEPAGE
Definition: resource.h:34
#define IDS_ABORTSETUP
Definition: resource.h:101
#define IDS_ERROR_WRITE_PTABLE
Definition: resource.h:170
#define IDD_STARTPAGE
Definition: resource.h:18
#define IDS_ERROR_FORMATTING_PARTITION
Definition: resource.h:183
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:1818
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:1662
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:900
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
wcscpy
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#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
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define wcsrchr
Definition: compat.h:16
HANDLE HWND
Definition: compat.h:19
#define HeapAlloc
Definition: compat.h:733
#define GetCurrentProcess()
Definition: compat.h:759
#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:454
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
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
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:4598
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:1211
static const WCHAR CmdLine[]
Definition: install.c:48
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:852
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1634
_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 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:81
@ OUTPUT
Definition: fmifs.h:96
@ PROGRESS
Definition: fmifs.h:82
#define IDC_INSTALL
Definition: fontview.h:13
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MOD_SHIFT
Definition: imm.h:186
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define _tWinMain
Definition: tchar.h:498
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#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
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ASSERT(a)
Definition: mode.c:44
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
static refpint_t pi[]
Definition: server.c:96
static ATOM item
Definition: dde.c:856
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 _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define SYMBOLIC_LINK_QUERY
Definition: nt_native.h:1265
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define RTL_NUMBER_OF_FIELD(type, field)
Definition: ntbasedef.h:711
#define UNICODE_NULL
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:326
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define STATUS_PARTITION_FAILURE
Definition: ntstatus.h:604
#define L(x)
Definition: ntvdm.h:50
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
#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 PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#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
#define WM_NOTIFY
Definition: richedit.h:61
#define DONE
Definition: rnr20lib.h:14
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#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
#define args
Definition: format.c:66
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:1988
VOID NTAPI InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:207
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:1019
NTSTATUS NTAPI InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:863
VOID NTAPI CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:32
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:678
VOID NTAPI FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1103
BOOLEAN IsUnattendedSetup
Definition: setuplib.c:26
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:1154
#define ERROR_SYSTEM_PARTITION_NOT_FOUND
Definition: setuplib.h:190
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
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
Definition: shell.h:41
base of all file and directory entries
Definition: entries.h:83
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
DWORD dwLanguageId
Definition: winuser.h:3348
LPCWSTR lpszCaption
Definition: winuser.h:3343
HWND hwndOwner
Definition: winuser.h:3340
LPCWSTR lpszText
Definition: winuser.h:3342
HINSTANCE hInstance
Definition: winuser.h:3341
DWORD dwStyle
Definition: winuser.h:3344
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
ULONG TotalOperations
Definition: reactos.c:1630
ULONG CompletedOperations
Definition: reactos.c:1631
PSETUPDATA pSetupData
Definition: reactos.c:1629
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:1218
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
USETUP_DATA USetupData
Definition: reactos.h:148
HINSTANCE hInstance
Definition: reactos.h:136
HFONT hBoldFont
Definition: reactos.h:140
PCWSTR SelectedLanguageId
Definition: reactos.h:163
HFONT hTitleFont
Definition: reactos.h:139
BOOL bStopInstall
Definition: reactos.h:144
HANDLE hInstallThread
Definition: reactos.h:142
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:153
PPARTLIST PartitionList
Definition: reactos.h:152
HANDLE hHaltInstallEvent
Definition: reactos.h:143
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:154
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:146
BOOLEAN RepairUpdateFlag
Definition: reactos.h:150
BOOL bUnattend
Definition: reactos.h:137
HWND hWndItem
Definition: reactos.h:87
HWND hPartList
Definition: reactos.h:85
HWND hWndProgress
Definition: reactos.h:88
LONG_PTR dwPbStyle
Definition: reactos.h:89
HWND hwndDlg
Definition: reactos.h:86
USHORT MaximumLength
Definition: env_spec_w32.h:370
PGENERIC_LIST DisplayList
Definition: setuplib.h:141
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:126
PGENERIC_LIST ComputerList
Definition: setuplib.h:140
UNICODE_STRING SystemRootPath
Definition: setuplib.h:121
UNICODE_STRING SourceRootPath
Definition: setuplib.h:103
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:159
LONG BootLoaderLocation
Definition: setuplib.h:134
ARCHITECTURE_TYPE ArchType
Definition: setuplib.h:147
PGENERIC_LIST KeyboardList
Definition: setuplib.h:142
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:124
LONG FormatPartition
Definition: setuplib.h:135
VOLINFO Info
Definition: partlist.h:47
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskVolumeN".
Definition: volutil.h:13
WCHAR FileSystem[MAX_PATH+1]
Definition: volutil.h:17
WCHAR DriveLetter
Definition: volutil.h:15
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:179
ULONG ClusterSize
Definition: reactos.h:191
BOOLEAN QuickFormat
Definition: reactos.h:190
PVOLENTRY Volume
Definition: reactos.h:180
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:187
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:188
PCWSTR Label
Definition: reactos.h:189
Definition: match.c:390
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
UINT uNewState
Definition: commctrl.h:3041
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
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:651
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#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
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
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
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
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_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
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_SUSPENDED
Definition: winbase.h:181
#define CREATE_NEW_CONSOLE
Definition: winbase.h:183
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#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:4444
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:413
#define LB_ERR
Definition: winuser.h:2435
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define SW_HIDE
Definition: winuser.h:771
#define MF_BYCOMMAND
Definition: winuser.h:202
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define WM_QUIT
Definition: winuser.h:1626
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define KL_NAMELENGTH
Definition: winuser.h:122
#define IDCANCEL
Definition: winuser.h:834
#define VK_F10
Definition: winuser.h:2267
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)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
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:1743
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define CB_ERR
Definition: winuser.h:2438
#define CB_SETCURSEL
Definition: winuser.h:1964
#define SM_CYSMICON
Definition: winuser.h:1016
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define MB_RETRYCANCEL
Definition: winuser.h:808
#define SWP_NOSIZE
Definition: winuser.h:1248
#define WM_INITDIALOG
Definition: winuser.h:1742
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MB_YESNO
Definition: winuser.h:820
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:833
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define MB_ICONERROR
Definition: winuser.h:790
#define MB_OKCANCEL
Definition: winuser.h:807
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1015
#define EWX_REBOOT
Definition: winuser.h:638
#define HWND_TOP
Definition: winuser.h:1210
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_TIMER
Definition: winuser.h:1745
#define CB_ADDSTRING
Definition: winuser.h:1939
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define SC_CLOSE
Definition: winuser.h:2595
#define MB_OK
Definition: winuser.h:793
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define MB_ICONWARNING
Definition: winuser.h:789
HWND WINAPI GetParent(_In_ HWND)
#define MB_ICONQUESTION
Definition: winuser.h:792
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define DWLP_MSGRESULT
Definition: winuser.h:873
#define MB_ICONINFORMATION
Definition: winuser.h:805
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)
#define WM_HOTKEY
Definition: winuser.h:1882
#define BN_CLICKED
Definition: winuser.h:1928
#define SW_SHOW
Definition: winuser.h:778
#define WM_DESTROY
Definition: winuser.h:1612
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:838
#define IDRETRY
Definition: winuser.h:836
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5358
#define GWL_STYLE
Definition: winuser.h:855
#define SendDlgItemMessage
Definition: winuser.h:5854
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2161
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:930
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185