ReactOS 0.4.16-dev-976-g18fc5a1
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
43
44/* The partition where to perform the installation */
46// static PVOLENTRY InstallVolume = NULL;
47#define InstallVolume (InstallPartition->Volume)
48
49/* The system partition we will actually use */
51// static PVOLENTRY SystemVolume = NULL;
52#define SystemVolume (SystemPartition->Volume)
53
54/* UI elements */
56
57
58/* FUNCTIONS ****************************************************************/
59
60static VOID
62{
64 RECT rcParent;
65 RECT rcWindow;
66
68 if (hWndParent == NULL)
70
71 GetWindowRect(hWndParent, &rcParent);
72 GetWindowRect(hWnd, &rcWindow);
73
76 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
77 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
78 0,
79 0,
81}
82
87static HFONT
89 _In_opt_ HFONT hOrigFont,
90 _In_opt_ INT PointSize)
91{
92 LOGFONTW lf = {0};
93
94 if (hOrigFont)
95 {
96 GetObjectW(hOrigFont, sizeof(lf), &lf);
97 }
98 else
99 {
100 NONCLIENTMETRICSW ncm;
101 ncm.cbSize = sizeof(ncm);
102 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
103 lf = ncm.lfMessageFont;
104 }
105
106 /* Make the font bold, keeping the other attributes */
107 lf.lfWeight = FW_BOLD;
108
109 /* Determine the font height (logical units) if necessary */
110 if (PointSize)
111 {
112 HDC hdc = GetDC(NULL);
113 lf.lfHeight = -MulDiv(PointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
114 // lf.lfWidth = 0;
116 }
117
118 return CreateFontIndirect(&lf);
119}
120
121static inline HFONT
123 _In_opt_ HFONT hOrigFont)
124{
125 /* Title font is 12pt bold */
126 return CreateBoldFont(hOrigFont, 12);
127}
128
129INT
132 _In_ UINT uType,
133 _In_opt_ PCWSTR pszTitle,
134 _In_opt_ PCWSTR pszFormatMessage,
136{
137 INT iRes;
139 MSGBOXPARAMSW mb = {0};
141 size_t MsgLen;
142 WCHAR StaticBuffer[256];
143 LPWSTR Buffer = StaticBuffer; // Use the static buffer by default.
144
145 /* We need to retrieve the current module's instance handle if either
146 * the title or the format message is specified by a resource ID */
147 if ((pszTitle && IS_INTRESOURCE(pszTitle)) || IS_INTRESOURCE(pszFormatMessage))
148 hInstance = GetModuleHandleW(NULL); // SetupData.hInstance;
149
150 /* Retrieve the format message string if this is a resource */
151 if (pszFormatMessage && IS_INTRESOURCE(pszFormatMessage)) do
152 {
153 // LoadAllocStringW()
154 PCWSTR pStr;
155
156 /* Try to load the string from the resource */
157 MsgLen = LoadStringW(hInstance, PtrToUlong(pszFormatMessage), (LPWSTR)&pStr, 0);
158 if (MsgLen == 0)
159 {
160 /* No resource string was found, return NULL */
161 Format = NULL;
162 break;
163 }
164
165 /* Allocate a new buffer, adding a NULL-terminator */
166 Format = HeapAlloc(GetProcessHeap(), 0, (MsgLen + 1) * sizeof(WCHAR));
167 if (!Format)
168 {
169 MsgLen = 0;
170 break;
171 }
172
173 /* Copy the string, NULL-terminated */
174 StringCchCopyNW(Format, MsgLen + 1, pStr, MsgLen);
175 } while (0);
176 else
177 {
178 Format = (LPWSTR)pszFormatMessage;
179 }
180
181 if (Format)
182 {
183 /*
184 * Retrieve the message length. If it is too long, allocate
185 * an auxiliary buffer; otherwise use the static buffer.
186 * The string is built to be NULL-terminated.
187 */
188 MsgLen = _vscwprintf(Format, args);
189 if (MsgLen >= _countof(StaticBuffer))
190 {
191 Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (MsgLen + 1) * sizeof(WCHAR));
192 if (!Buffer)
193 {
194 /* Allocation failed, use the original format string verbatim */
195 Buffer = Format;
196 }
197 }
198 if (Buffer != Format)
199 {
200 /* Do the printf as we use the caller's format string */
201 StringCchVPrintfW(Buffer, MsgLen + 1, Format, args);
202 }
203 }
204 else
205 {
206 Format = (LPWSTR)pszFormatMessage;
207 Buffer = Format;
208 }
209
210 /* Display the message */
211 mb.cbSize = sizeof(mb);
212 mb.hwndOwner = hWnd;
213 mb.hInstance = hInstance;
214 mb.lpszText = Buffer;
215 mb.lpszCaption = pszTitle;
216 mb.dwStyle = uType;
218 iRes = MessageBoxIndirectW(&mb);
219
220 /* Free the buffers if needed */
221 if ((Buffer != StaticBuffer) && (Buffer != Format))
223
224 if (Format && (Format != pszFormatMessage))
226
227 return iRes;
228}
229
230INT
234 _In_ UINT uType,
235 _In_opt_ PCWSTR pszTitle,
236 _In_opt_ PCWSTR pszFormatMessage,
237 ...)
238{
239 INT iRes;
241
242 va_start(args, pszFormatMessage);
243 iRes = DisplayMessageV(hWnd, uType, pszTitle, pszFormatMessage, args);
244 va_end(args);
245
246 return iRes;
247}
248
249INT
253 _In_ UINT uIDTitle,
254 _In_ UINT uIDMessage,
255 ...)
256{
257 INT iRes;
259
260 va_start(args, uIDMessage);
262 MAKEINTRESOURCEW(uIDTitle),
263 MAKEINTRESOURCEW(uIDMessage),
264 args);
265 va_end(args);
266
267 return iRes;
268}
269
270VOID
272 _In_ HWND hWnd,
274 _In_ UINT uID)
275{
276 WCHAR szText[256];
277 LoadStringW(hInstance, uID, szText, _countof(szText));
278 SetWindowTextW(hWnd, szText);
279}
280
281VOID
283 _In_ HWND hWnd,
285 _In_ UINT uID,
287{
288 WCHAR ResBuffer[256];
289 WCHAR szText[256];
290
291 LoadStringW(hInstance, uID, ResBuffer, _countof(ResBuffer));
292 StringCchVPrintfW(szText, _countof(szText), ResBuffer, args);
293 SetWindowTextW(hWnd, szText);
294}
295
296VOID
299 _In_ HWND hWnd,
301 _In_ UINT uID,
302 ...)
303{
305
306 va_start(args, uID);
308 va_end(args);
309}
310
311static INT_PTR CALLBACK
313 IN HWND hwndDlg,
314 IN UINT uMsg,
317{
318 PSETUPDATA pSetupData;
319
320 /* Retrieve pointer to the global setup data */
321 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
322
323 switch (uMsg)
324 {
325 case WM_INITDIALOG:
326 {
327 /* Save pointer to the global setup data */
328 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
329 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
330
331 /* Set title font */
332 SetDlgItemFont(hwndDlg, IDC_STARTTITLE, pSetupData->hTitleFont, TRUE);
333
334 // TEMPTEMP: Set the ReactOS-Alpha information in bold.
335 // TODO: Remove once we reach 0.5/Beta :)
336 SetDlgItemFont(hwndDlg, IDC_WARNTEXT1, pSetupData->hBoldFont, TRUE);
337 SetDlgItemFont(hwndDlg, IDC_WARNTEXT2, pSetupData->hBoldFont, TRUE);
338 SetDlgItemFont(hwndDlg, IDC_WARNTEXT3, pSetupData->hBoldFont, TRUE);
339
340 /* Center the wizard window */
341 CenterWindow(GetParent(hwndDlg));
342 break;
343 }
344
345 case WM_NOTIFY:
346 {
347 LPNMHDR lpnm = (LPNMHDR)lParam;
348
349 switch (lpnm->code)
350 {
351 case PSN_SETACTIVE:
352 {
353 /* Only "Next" and "Cancel" for the first page and hide "Back" */
355 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
357 break;
358 }
359
360 case PSN_KILLACTIVE:
361 {
362 /* Show "Back" button */
363 // PropSheet_ShowWizButtons(GetParent(hwndDlg), PSWIZB_BACK, PSWIZB_BACK);
365 break;
366 }
367
368 default:
369 break;
370 }
371 }
372 break;
373
374 default:
375 break;
376
377 }
378
379 return FALSE;
380}
381
382static INT_PTR CALLBACK
384 IN HWND hwndDlg,
385 IN UINT uMsg,
388{
389 PSETUPDATA pSetupData;
390
391 /* Retrieve pointer to the global setup data */
392 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
393
394 switch (uMsg)
395 {
396 case WM_INITDIALOG:
397 {
398 /* Save pointer to the global setup data */
399 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
400 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
401
402 /* Set the options in bold */
403 SetDlgItemFont(hwndDlg, IDC_INSTALL, pSetupData->hBoldFont, TRUE);
404 SetDlgItemFont(hwndDlg, IDC_UPDATE, pSetupData->hBoldFont, TRUE);
405
406 /* Check the "Install" radio button */
408
409 /*
410 * Enable the "Update" radio button and text only if we have
411 * available NT installations, otherwise disable them.
412 */
413 if (pSetupData->NtOsInstallsList &&
414 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0)
415 {
418 }
419 else
420 {
423 }
424
425 break;
426 }
427
428 case WM_NOTIFY:
429 {
430 LPNMHDR lpnm = (LPNMHDR)lParam;
431
432 switch (lpnm->code)
433 {
434 case PSN_SETACTIVE:
436 break;
437
439 {
440 /* Focus on "Install ReactOS" */
442 return TRUE;
443 }
444
445 case PSN_QUERYCANCEL:
446 {
447 if (DisplayMessage(GetParent(hwndDlg),
451 {
452 /* Go to the Terminate page */
454 }
455
456 /* Do not close the wizard too soon */
458 return TRUE;
459 }
460
461 case PSN_WIZNEXT: /* Set the selected data */
462 {
463 /*
464 * Go update only if we have available NT installations
465 * and we choose to do so.
466 */
467 if (pSetupData->NtOsInstallsList &&
468 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
470 {
471 pSetupData->RepairUpdateFlag = TRUE;
472
473 /*
474 * Display the existing NT installations page only
475 * if we have more than one available NT installations.
476 */
477 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
478 {
479 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
480
481 /* Actually the best would be to dynamically insert the page only when needed */
483 }
484 else
485 {
486 /* Retrieve the current installation */
487 pSetupData->CurrentInstallation =
489
491 }
492 }
493 else
494 {
495 pSetupData->CurrentInstallation = NULL;
496 pSetupData->RepairUpdateFlag = FALSE;
498 }
499
500 return TRUE;
501 }
502
503 default:
504 break;
505 }
506 }
507 break;
508
509 default:
510 break;
511
512 }
513 return FALSE;
514}
515
516
517
518BOOL
521 IN HWND hWndListView,
522 IN const UINT* pIDs,
523 IN const INT* pColsWidth,
524 IN const INT* pColsAlign,
525 IN UINT nNumOfColumns)
526{
527 UINT i;
528 LVCOLUMN lvC;
529 WCHAR szText[50];
530
531 /* Create the columns */
532 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
533 lvC.pszText = szText;
534
535 /* Load the column labels from the resource file */
536 for (i = 0; i < nNumOfColumns; i++)
537 {
538 lvC.iSubItem = i;
539 lvC.cx = pColsWidth[i];
540 lvC.fmt = pColsAlign[i];
541
542 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
543
544 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
545 return FALSE;
546 }
547
548 return TRUE;
549}
550
551typedef VOID
555 IN SIZE_T cchBufferSize);
556
557VOID
561 IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
562{
563 INT Index, CurrentEntryIndex = 0;
564 PGENERIC_LIST_ENTRY ListEntry;
566 WCHAR CurrentItemText[256];
567
568 for (Entry = List->ListHead.Flink;
569 Entry != &List->ListHead;
570 Entry = Entry->Flink)
571 {
573
574 if (GetEntryDescriptionProc)
575 {
576 GetEntryDescriptionProc(ListEntry,
577 CurrentItemText,
578 ARRAYSIZE(CurrentItemText));
579 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
580 }
581 else
582 {
584 }
585
586 if (ListEntry == List->CurrentEntry)
587 CurrentEntryIndex = Index;
588
590 }
591
592 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
593}
594
595PVOID
598{
599 INT Index;
600
602 if (Index == CB_ERR)
603 return NULL;
604
606}
607
608typedef VOID
611 IN LVITEM* plvItem,
614 IN SIZE_T cchBufferSize);
615
616VOID
620 IN PADD_ENTRY_ITEM AddEntryItemProc)
621{
622 INT CurrentEntryIndex = 0;
623 LVITEM lvItem;
624 PGENERIC_LIST_ENTRY ListEntry;
626 WCHAR CurrentItemText[256];
627
628 for (Entry = List->ListHead.Flink;
629 Entry != &List->ListHead;
630 Entry = Entry->Flink)
631 {
633
634 if (!AddEntryItemProc)
635 continue;
636
637 AddEntryItemProc(hWndList,
638 &lvItem,
639 ListEntry,
640 CurrentItemText,
641 ARRAYSIZE(CurrentItemText));
642
643 if (ListEntry == List->CurrentEntry)
644 CurrentEntryIndex = lvItem.iItem;
645 }
646
647 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
648 ListView_SetItemState(hWndList, CurrentEntryIndex,
651}
652
653PVOID
656{
657 INT Index;
658 LVITEM item;
659
661 if (Index == LB_ERR)
662 return NULL;
663
664 item.mask = LVIF_PARAM;
665 item.iItem = Index;
667
668 return (PVOID)item.lParam;
669}
670
671
672static VOID
673NTAPI
677 IN SIZE_T cchBufferSize)
678{
679 StringCchCopyW(Buffer, cchBufferSize,
681}
682
683static VOID
684NTAPI
687 IN LVITEM* plvItem,
689 IN OUT PWSTR Buffer, // SystemRootPath
690 IN SIZE_T cchBufferSize)
691{
693 PVOLINFO VolInfo = (NtOsInstall->Volume ? &NtOsInstall->Volume->Info : NULL);
694
695 if (VolInfo && VolInfo->DriveLetter)
696 {
697 /* We have retrieved a partition that is mounted */
698 StringCchPrintfW(Buffer, cchBufferSize,
699 L"%c:%s",
700 VolInfo->DriveLetter,
701 NtOsInstall->PathComponent);
702 }
703 else
704 {
705 /* We failed somewhere, just show the NT path */
706 StringCchPrintfW(Buffer, cchBufferSize,
707 L"%wZ",
708 &NtOsInstall->SystemNtPath);
709 }
710
711 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
712 plvItem->iItem = 0;
713 plvItem->iSubItem = 0;
714 plvItem->lParam = (LPARAM)Entry;
715 plvItem->pszText = NtOsInstall->InstallationName;
716
717 /* Associate vendor icon */
718 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
719 {
720 plvItem->mask |= LVIF_IMAGE;
721 plvItem->iImage = 0;
722 }
723 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
724 {
725 plvItem->mask |= LVIF_IMAGE;
726 plvItem->iImage = 1;
727 }
728
729 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
730
731 plvItem->iSubItem = 1;
732 plvItem->pszText = Buffer; // SystemRootPath;
733 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
734
735 plvItem->iSubItem = 2;
736 plvItem->pszText = NtOsInstall->VendorName;
737 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
738}
739
740
741#define IDS_LIST_COLUMN_FIRST IDS_INSTALLATION_NAME
742#define IDS_LIST_COLUMN_LAST IDS_INSTALLATION_VENDOR
743
744#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
746static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100};
748
749static INT_PTR CALLBACK
751 IN HWND hwndDlg,
752 IN UINT uMsg,
755{
756 PSETUPDATA pSetupData;
757 HWND hList;
758 HIMAGELIST hSmall;
759
760 /* Retrieve pointer to the global setup data */
761 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
762
763 switch (uMsg)
764 {
765 case WM_INITDIALOG:
766 {
767 /* Save pointer to the global setup data */
768 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
769 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
770
771 /*
772 * Keep the "Next" button disabled. It will be enabled only
773 * when the user selects an installation to upgrade.
774 */
776
777 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
778
780
781 CreateListViewColumns(pSetupData->hInstance,
782 hList,
787
788 /* Create the ImageList */
791 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
792 1, 1);
793
794 /* Add event type icons to the ImageList */
795 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_ROSICON)));
796 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_WINICON)));
797
798 /* Assign the ImageList to the List View */
800
801 InitGenericListView(hList, pSetupData->NtOsInstallsList, AddNTOSInstallationItem);
802 break;
803 }
804
805 case WM_DESTROY:
806 {
807 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
810 ImageList_Destroy(hSmall);
811 return TRUE;
812 }
813
814 case WM_COMMAND:
815 switch (LOWORD(wParam))
816 {
817 case IDC_SKIPUPGRADE:
818 {
819 /* Skip the upgrade and do the usual new-installation workflow */
820 pSetupData->CurrentInstallation = NULL;
821 pSetupData->RepairUpdateFlag = FALSE;
823 return TRUE;
824 }
825 }
826 break;
827
828 case WM_NOTIFY:
829 {
830 LPNMHDR lpnm = (LPNMHDR)lParam;
831
832 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
833 {
835
836 if (pnmv->uChanged & LVIF_STATE) /* The state has changed */
837 {
838 /* The item has been (de)selected */
839 if (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED))
840 {
842 }
843 else
844 {
845 /*
846 * Keep the "Next" button disabled. It will be enabled only
847 * when the user selects an installation to upgrade.
848 */
850 }
851 }
852
853 break;
854 }
855
856 switch (lpnm->code)
857 {
858#if 0
859 case PSN_SETACTIVE:
860 {
861 /*
862 * Keep the "Next" button disabled. It will be enabled only
863 * when the user selects an installation to upgrade.
864 */
866 break;
867 }
868#endif
869
871 {
872 /* Give the focus on and select the first item */
873 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
876 return TRUE;
877 }
878
879 case PSN_QUERYCANCEL:
880 {
881 if (DisplayMessage(GetParent(hwndDlg),
885 {
886 /* Go to the Terminate page */
888 }
889
890 /* Do not close the wizard too soon */
892 return TRUE;
893 }
894
895 case PSN_WIZNEXT: /* Set the selected data */
896 {
897 /*
898 * Go update only if we have available NT installations
899 * and we choose to do so.
900 */
901 if (!pSetupData->NtOsInstallsList ||
903 {
904 pSetupData->CurrentInstallation = NULL;
905 pSetupData->RepairUpdateFlag = FALSE;
906 break;
907 }
908
909 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
912
913 /* Retrieve the current installation */
914 pSetupData->CurrentInstallation =
916
917 /* We perform an upgrade */
918 pSetupData->RepairUpdateFlag = TRUE;
919 return TRUE;
920 }
921
922 default:
923 break;
924 }
925 }
926 break;
927
928 default:
929 break;
930
931 }
932 return FALSE;
933}
934
935static INT_PTR CALLBACK
937 IN HWND hwndDlg,
938 IN UINT uMsg,
941{
942 PSETUPDATA pSetupData;
943 HWND hList;
944
945 /* Retrieve pointer to the global setup data */
946 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
947
948 switch (uMsg)
949 {
950 case WM_INITDIALOG:
951 {
952 /* Save pointer to the global setup data */
953 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
954 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
955
956 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
957 InitGenericComboList(hList, pSetupData->USetupData.ComputerList, GetSettingDescription);
958
959 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
960 InitGenericComboList(hList, pSetupData->USetupData.DisplayList, GetSettingDescription);
961
962 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
963 InitGenericComboList(hList, pSetupData->USetupData.KeyboardList, GetSettingDescription);
964
965 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
966 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
967
968 break;
969 }
970
971 case WM_NOTIFY:
972 {
973 LPNMHDR lpnm = (LPNMHDR)lParam;
974
975 switch (lpnm->code)
976 {
977 case PSN_SETACTIVE:
979 break;
980
982 {
983 /* Focus on "Computer" list */
985 return TRUE;
986 }
987
988 case PSN_QUERYCANCEL:
989 {
990 if (DisplayMessage(GetParent(hwndDlg),
994 {
995 /* Go to the Terminate page */
997 }
998
999 /* Do not close the wizard too soon */
1001 return TRUE;
1002 }
1003
1004 case PSN_WIZNEXT: /* Set the selected data */
1005 {
1006 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
1009
1010 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1013
1014 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1017
1018 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1019 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
1020 // GetSelectedComboListItem(hList));
1021
1022 return TRUE;
1023 }
1024
1025 default:
1026 break;
1027 }
1028 }
1029 break;
1030
1031 default:
1032 break;
1033
1034 }
1035 return FALSE;
1036}
1037
1038static INT_PTR CALLBACK
1040 IN HWND hwndDlg,
1041 IN UINT uMsg,
1044{
1045 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
1046
1047 PSETUPDATA pSetupData;
1048
1049 /* Retrieve pointer to the global setup data */
1050 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1051
1052 switch (uMsg)
1053 {
1054 case WM_INITDIALOG:
1055 {
1056 /* Save pointer to the global setup data */
1057 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1058 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1059 break;
1060 }
1061
1062 case WM_COMMAND:
1063 {
1065 {
1068 else
1070 }
1071 break;
1072 }
1073
1074 case WM_NOTIFY:
1075 {
1076 LPNMHDR lpnm = (LPNMHDR)lParam;
1077
1078 switch (lpnm->code)
1079 {
1080 case PSN_SETACTIVE:
1081 {
1082 WCHAR CurrentItemText[256];
1083
1085
1086 /* Show the current selected settings */
1087
1088 // FIXME! Localize
1089 if (pSetupData->RepairUpdateFlag)
1090 {
1091 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1092 L"Upgrading/Repairing \"%s\" from \"%s\"",
1094 pSetupData->CurrentInstallation->VendorName);
1095 }
1096 else
1097 {
1098 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1099 L"New ReactOS installation");
1100 }
1101 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
1102
1103 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
1104 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
1105
1107 CurrentItemText,
1108 ARRAYSIZE(CurrentItemText));
1109 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
1110
1112 CurrentItemText,
1113 ARRAYSIZE(CurrentItemText));
1114 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
1115
1117 CurrentItemText,
1118 ARRAYSIZE(CurrentItemText));
1119 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
1120
1121 if (InstallVolume->Info.DriveLetter)
1122 {
1123#if 0
1124 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1125 L"%c: \x2014 %wZ",
1126 InstallVolume->Info.DriveLetter,
1127 &pSetupData->USetupData.DestinationRootPath);
1128#else
1129 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1130 L"%c: \x2014 Harddisk %lu, Partition %lu",
1131 InstallVolume->Info.DriveLetter,
1132 InstallPartition->DiskEntry->DiskNumber,
1134#endif
1135 }
1136 else
1137 {
1138#if 0
1139 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1140 L"%wZ",
1141 &pSetupData->USetupData.DestinationRootPath);
1142#else
1143 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1144 L"Harddisk %lu, Partition %lu",
1145 InstallPartition->DiskEntry->DiskNumber,
1147#endif
1148 }
1149 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
1150
1151 SetDlgItemTextW(hwndDlg, IDC_PATH,
1153 /*pSetupData->USetupData.InstallPath.Buffer*/);
1154
1155
1156 /* Change the "Next" button text to "Install" */
1157 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
1159 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
1161 pSetupData->hInstance,
1163
1164 /*
1165 * Keep the "Next" button disabled. It will be enabled only
1166 * when the user clicks on the installation approval checkbox.
1167 */
1170 break;
1171 }
1172
1174 {
1175 /* Focus on the confirmation check-box */
1177 return TRUE;
1178 }
1179
1180 case PSN_KILLACTIVE:
1181 {
1182 /* Restore the original "Next" button text */
1183 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
1184 break;
1185 }
1186
1187 case PSN_QUERYCANCEL:
1188 {
1189 if (DisplayMessage(GetParent(hwndDlg),
1193 {
1194 /* Go to the Terminate page */
1196 }
1197
1198 /* Do not close the wizard too soon */
1200 return TRUE;
1201 }
1202
1203 default:
1204 break;
1205 }
1206 break;
1207 }
1208
1209 default:
1210 break;
1211 }
1212
1213 return FALSE;
1214}
1215
1216
1217typedef struct _FSVOL_CONTEXT
1218{
1220 // PAGE_NUMBER NextPageOnAbort;
1222
1223static
1224BOOLEAN
1225NTAPI
1228 _In_ ULONG Modifier,
1229 _In_ PVOID Argument)
1230{
1231 switch (Command)
1232 {
1233 case PROGRESS:
1234 {
1235 PULONG Percent = (PULONG)Argument;
1236 DPRINT("%lu percent completed\n", *Percent);
1238 break;
1239 }
1240
1241#if 0
1242 case OUTPUT:
1243 {
1244 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
1245 DPRINT("%s\n", output->Output);
1246 break;
1247 }
1248#endif
1249
1250 case DONE:
1251 {
1252#if 0
1253 PBOOLEAN Success = (PBOOLEAN)Argument;
1254 if (*Success == FALSE)
1255 {
1256 DPRINT("FormatEx was unable to complete successfully.\n\n");
1257 }
1258#endif
1259 DPRINT("Done\n");
1260 break;
1261 }
1262
1263 default:
1264 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1265 break;
1266 }
1267
1268 return TRUE;
1269}
1270
1271static
1272BOOLEAN
1273NTAPI
1276 _In_ ULONG Modifier,
1277 _In_ PVOID Argument)
1278{
1279 switch (Command)
1280 {
1281 default:
1282 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1283 break;
1284 }
1285
1286 return TRUE;
1287}
1288
1289// PFSVOL_CALLBACK
1290static FSVOL_OP
1294 _In_ FSVOLNOTIFY FormatStatus,
1295 _In_ ULONG_PTR Param1,
1296 _In_ ULONG_PTR Param2)
1297{
1298 PFSVOL_CONTEXT FsVolContext = (PFSVOL_CONTEXT)Context;
1299
1300 switch (FormatStatus)
1301 {
1302 // FIXME: Deprecate!
1304 {
1305 // PPARTENTRY SystemPartition = (PPARTENTRY)Param1;
1306
1307 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1308 // if (ChangeSystemPartitionPage(Ir, SystemPartition))
1309 // return FSVOL_DOIT;
1310 return FSVOL_ABORT;
1311 }
1312
1314 {
1315 switch (Param1)
1316 {
1318 {
1319 // ERROR_WRITE_PTABLE
1321 0, // Default to "Error"
1323 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1324 // TODO: Go back to the partitioning page?
1325 break;
1326 }
1327
1329 {
1330 /* FIXME: improve the error dialog */
1331 //
1332 // Error dialog should say that we cannot find a suitable
1333 // system partition and create one on the system. At this point,
1334 // it may be nice to ask the user whether he wants to continue,
1335 // or use an external drive as the system drive/partition
1336 // (e.g. floppy, USB drive, etc...)
1337 //
1339 0, // Default to "Error"
1341 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1342 // TODO: Go back to the partitioning page
1343 break;
1344 }
1345
1346 default:
1347 break;
1348 }
1349 return FSVOL_ABORT;
1350 }
1351
1354 // NOTE: If needed, clear progress gauges.
1355 return FSVOL_DOIT;
1356
1358 {
1359 if ((FSVOL_OP)Param1 == FSVOL_FORMAT)
1360 {
1361 /*
1362 * In case we just repair an existing installation, or make
1363 * an unattended setup without formatting, just go to the
1364 * filesystem check step.
1365 */
1366 if (FsVolContext->pSetupData->RepairUpdateFlag)
1367 return FSVOL_SKIP;
1370 return FSVOL_SKIP;
1372 /* Set status text */
1374 }
1375 else
1376 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1377 {
1378 /* Set status text */
1380
1381 /* Filechecking step: set progress marquee style and start it up */
1385 }
1386
1387 return FSVOL_DOIT;
1388 }
1389
1391 {
1392 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1393 {
1394 /* File-checking finished: stop the progress bar and restore its style */
1397 }
1398 return 0;
1399 }
1400
1402 {
1403 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1404
1405 // FIXME: See also FSVOLNOTIFY_PARTITIONERROR
1406 if (FmtInfo->ErrorStatus == STATUS_PARTITION_FAILURE)
1407 {
1408 // ERROR_WRITE_PTABLE
1410 0, // Default to "Error"
1412 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1413 // TODO: Go back to the partitioning page?
1414 return FSVOL_ABORT;
1415 }
1416 else
1418 {
1419 /* FIXME: show an error dialog */
1420 // MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
1422 0, // Default to "Error"
1424 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1425 return FSVOL_ABORT;
1426 }
1427 else
1428 if (FmtInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1429 {
1430 INT nRet;
1431
1433 NULL, // Default to "Error"
1435 FmtInfo->FileSystemName);
1436 if (nRet == IDCANCEL)
1437 {
1438 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1439 return FSVOL_ABORT;
1440 }
1441 else if (nRet == IDOK)
1442 {
1443 return FSVOL_RETRY;
1444 }
1445 }
1446 else if (!NT_SUCCESS(FmtInfo->ErrorStatus))
1447 {
1448 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1449
1450 DPRINT1("FormatPartition() failed with status 0x%08lx\n", FmtInfo->ErrorStatus);
1451
1452 // ERROR_FORMATTING_PARTITION
1454 0, // Default to "Error"
1456 FmtInfo->Volume->Info.DeviceName);
1457 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1458 return FSVOL_ABORT;
1459 }
1460
1461 return FSVOL_RETRY;
1462 }
1463
1465 {
1466 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1467
1468 if (ChkInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1469 {
1470 INT nRet;
1471
1473 NULL, // Default to "Error"
1475 ChkInfo->Volume->Info.FileSystem);
1476 if (nRet == IDCANCEL)
1477 {
1478 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1479 return FSVOL_ABORT;
1480 }
1481 else if (nRet == IDOK)
1482 {
1483 return FSVOL_SKIP;
1484 }
1485 }
1486 else if (!NT_SUCCESS(ChkInfo->ErrorStatus))
1487 {
1488 DPRINT1("ChkdskPartition() failed with status 0x%08lx\n", ChkInfo->ErrorStatus);
1489
1491 0, // Default to "Error"
1493 ChkInfo->ErrorStatus);
1494 return FSVOL_SKIP;
1495 }
1496
1497 return FSVOL_SKIP;
1498 }
1499
1501 {
1502 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1503 PVOL_CREATE_INFO VolCreate;
1504
1505 ASSERT((FSVOL_OP)Param2 == FSVOL_FORMAT);
1506
1507 /* Find the volume info in the partition TreeList UI.
1508 * If none, don't format it. */
1510 FmtInfo->Volume);
1511 if (!VolCreate)
1512 return FSVOL_SKIP;
1513 ASSERT(VolCreate->Volume == FmtInfo->Volume);
1514
1515 /* If there is no formatting information, skip it */
1516 if (!*VolCreate->FileSystemName)
1517 return FSVOL_SKIP;
1518
1519 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1520
1521 /* Set status text */
1522 if (FmtInfo->Volume->Info.DriveLetter)
1523 {
1526 IDS_FORMATTING_PROGRESS1, // L"Formatting volume %c: (%s) in %s..."
1527 FmtInfo->Volume->Info.DriveLetter,
1528 FmtInfo->Volume->Info.DeviceName,
1529 VolCreate->FileSystemName);
1530 }
1531 else
1532 {
1535 IDS_FORMATTING_PROGRESS2, // L"Formatting volume %s in %s..."
1536 FmtInfo->Volume->Info.DeviceName,
1537 VolCreate->FileSystemName);
1538 }
1539
1540 // StartFormat(FmtInfo, FileSystemList->Selected);
1541 FmtInfo->FileSystemName = VolCreate->FileSystemName;
1542 FmtInfo->MediaFlag = VolCreate->MediaFlag;
1543 FmtInfo->Label = VolCreate->Label;
1544 FmtInfo->QuickFormat = VolCreate->QuickFormat;
1545 FmtInfo->ClusterSize = VolCreate->ClusterSize;
1546 FmtInfo->Callback = FormatCallback;
1547
1548 /* Set up the progress bar */
1550 PBM_SETRANGE, 0, MAKELPARAM(0, 100));
1552 PBM_SETPOS, 0, 0);
1553
1554 return FSVOL_DOIT;
1555 }
1556
1558 {
1559 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1560
1561 // EndFormat(FmtInfo->ErrorStatus);
1562 if (FmtInfo->FileSystemName)
1563 *(PWSTR)FmtInfo->FileSystemName = UNICODE_NULL; // FIXME: HACK!
1564
1565 // /* Reset the file system list */
1566 // ResetFileSystemList();
1567 return 0;
1568 }
1569
1571 {
1572 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1573 PVOL_CREATE_INFO VolCreate;
1574
1575 ASSERT((FSVOL_OP)Param2 == FSVOL_CHECK);
1576
1577 /* Find the volume info in the partition TreeList UI.
1578 * If none, don't check it. */
1580 ChkInfo->Volume);
1581 if (!VolCreate)
1582 return FSVOL_SKIP;
1583 ASSERT(VolCreate->Volume == ChkInfo->Volume);
1584
1585 ASSERT(*ChkInfo->Volume->Info.DeviceName);
1586
1587 /* Set status text */
1588 if (ChkInfo->Volume->Info.DriveLetter)
1589 {
1592 IDS_CHECKING_PROGRESS1, // L"Checking volume %c: (%s)..."
1593 ChkInfo->Volume->Info.DriveLetter,
1594 ChkInfo->Volume->Info.DeviceName);
1595 }
1596 else
1597 {
1600 IDS_CHECKING_PROGRESS2, // L"Checking volume %s..."
1601 ChkInfo->Volume->Info.DeviceName);
1602 }
1603
1604 // StartCheck(ChkInfo);
1605 // TODO: Think about which values could be defaulted...
1606 ChkInfo->FixErrors = TRUE;
1607 ChkInfo->Verbose = FALSE;
1608 ChkInfo->CheckOnlyIfDirty = TRUE;
1609 ChkInfo->ScanDrive = FALSE;
1610 ChkInfo->Callback = ChkdskCallback;
1611
1612 return FSVOL_DOIT;
1613 }
1614
1616 {
1617 // PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1618 // EndCheck(ChkInfo->ErrorStatus);
1619 return 0;
1620 }
1621 }
1622
1623 return 0;
1624}
1625
1626
1627
1628typedef struct _COPYCONTEXT
1629{
1634
1635static UINT
1639 UINT_PTR Param1,
1640 UINT_PTR Param2)
1641{
1642 PCOPYCONTEXT CopyContext = (PCOPYCONTEXT)Context;
1643 PFILEPATHS_W FilePathInfo;
1644 PCWSTR SrcFileName, DstFileName;
1645
1647 if (CopyContext->pSetupData->bStopInstall)
1648 return FILEOP_ABORT; // Stop committing files
1649
1650 switch (Notification)
1651 {
1653 {
1654 CopyContext->TotalOperations = (ULONG)Param2;
1655 CopyContext->CompletedOperations = 0;
1656
1657 /* Set up the progress bar */
1659 PBM_SETRANGE, 0,
1660 MAKELPARAM(0, CopyContext->TotalOperations));
1662 PBM_SETSTEP, 1, 0);
1664 PBM_SETPOS, 0, 0);
1665 break;
1666 }
1667
1671 {
1672 FilePathInfo = (PFILEPATHS_W)Param1;
1673
1675 {
1676 /* Display delete message */
1677 ASSERT(Param2 == FILEOP_DELETE);
1678
1679 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1680 if (DstFileName) ++DstFileName;
1681 else DstFileName = FilePathInfo->Target;
1682
1685 IDS_DELETING, // STRING_DELETING
1686 DstFileName);
1687 }
1689 {
1690 UINT uMsgID;
1691
1692 /* Display move/rename message */
1693 ASSERT(Param2 == FILEOP_RENAME);
1694
1695 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1696 if (SrcFileName) ++SrcFileName;
1697 else SrcFileName = FilePathInfo->Source;
1698
1699 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1700 if (DstFileName) ++DstFileName;
1701 else DstFileName = FilePathInfo->Target;
1702
1703 if (!_wcsicmp(SrcFileName, DstFileName))
1704 uMsgID = IDS_MOVING; // STRING_MOVING
1705 else
1706 uMsgID = IDS_RENAMING; // STRING_RENAMING
1709 uMsgID,
1710 SrcFileName, DstFileName);
1711 }
1713 {
1714 /* Display copy message */
1715 ASSERT(Param2 == FILEOP_COPY);
1716
1717 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1718 if (DstFileName) ++DstFileName;
1719 else DstFileName = FilePathInfo->Target;
1720
1723 IDS_COPYING, // STRING_COPYING
1724 DstFileName);
1725 }
1726 break;
1727 }
1728
1730 {
1731 FilePathInfo = (PFILEPATHS_W)Param1;
1732
1733 DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
1734 FilePathInfo->Target, FilePathInfo->Win32Error);
1735 return FILEOP_SKIP;
1736 }
1737
1741 {
1742 CopyContext->CompletedOperations++;
1743
1744 /* SYSREG checkpoint */
1745 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1746 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1747
1749 break;
1750 }
1751 }
1752
1753 return FILEOP_DOIT;
1754}
1755
1756static VOID
1757__cdecl
1759{
1760 /* WARNING: Please keep this lookup table in sync with the resources! */
1761 static const UINT StringIDs[] =
1762 {
1763 IDS_REG_DONE, /* Success */
1764 IDS_REG_REGHIVEUPDATE, /* RegHiveUpdate */
1765 IDS_REG_IMPORTFILE, /* ImportRegHive */
1766 IDS_REG_DISPLAYSETTINGSUPDATE, /* DisplaySettingsUpdate */
1767 IDS_REG_LOCALESETTINGSUPDATE, /* LocaleSettingsUpdate */
1768 IDS_REG_ADDKBLAYOUTS, /* KeybLayouts */
1769 IDS_REG_KEYBOARDSETTINGSUPDATE, /* KeybSettingsUpdate */
1770 IDS_REG_CODEPAGEINFOUPDATE, /* CodePageInfoUpdate */
1771 };
1772
1773 if (RegStatus < _countof(StringIDs))
1774 {
1775 va_list args;
1776 va_start(args, RegStatus);
1778 va_end(args);
1779 }
1780 else
1781 {
1783 }
1784
1786}
1787
1793VOID
1795 _In_ HWND hWndWiz,
1797{
1798 EnableDlgItem(hWndWiz, IDCANCEL, Enable);
1799 // ShowDlgItem(hWndWiz, IDCANCEL, Enable ? SW_SHOW : SW_HIDE);
1801 SC_CLOSE,
1803}
1804
1805static DWORD
1806WINAPI
1808 IN LPVOID Param)
1809{
1810 PSETUPDATA pSetupData;
1811 HWND hwndDlg = (HWND)Param;
1812 HWND hWndProgress;
1813 LONG_PTR dwStyle;
1814 ERROR_NUMBER ErrorNumber;
1817 FSVOL_CONTEXT FsVolContext;
1818 COPYCONTEXT CopyContext;
1820
1821 /* Retrieve pointer to the global setup data */
1822 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1823
1824 /* Get the progress handle */
1825 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1826
1827 /* Setup global UI context */
1828 UiContext.hwndDlg = hwndDlg;
1830 UiContext.hWndProgress = hWndProgress;
1831 UiContext.dwPbStyle = 0;
1832
1833
1834 /* Disable the Close/Cancel buttons during all partition operations */
1835 // TODO: Consider, alternatively, to just show an info-box saying
1836 // that the installation process cannot be canceled at this stage?
1837 // PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
1839
1840
1841 /*
1842 * Find/Set the system partition, and apply all pending partition operations.
1843 */
1844
1845 /* Create context for the volume/partition operations */
1846 FsVolContext.pSetupData = pSetupData;
1847
1848 /* Set status text */
1850 pSetupData->hInstance,
1852 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1853
1854 /* Find or set the active system partition before starting formatting */
1859 &FsVolContext);
1860 // if (!Success)
1861 // return FsVolContext.NextPageOnAbort;
1862 //
1863 // FIXME?? If cannot use any system partition, install FreeLdr on floppy / removable media??
1864 //
1865 if (!Success)
1866 {
1867 /* Display an error if an unexpected failure happened */
1868 MessageBoxW(GetParent(hwndDlg), L"Failed to find or set the system partition!", L"Error", MB_ICONERROR);
1869
1870 /* Re-enable the Close/Cancel buttons */
1872
1873 /*
1874 * We failed due to an unexpected error, keep on the copy page to view the current state,
1875 * but enable the "Next" button to allow the user to continue to the terminate page.
1876 */
1878 return 1;
1879 }
1880
1881
1882 /* Set status text */
1884 pSetupData->hInstance,
1886 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1887
1888 /* Apply all pending operations on partitions: formatting and checking */
1893 &FsVolContext);
1894 if (!Success)
1895 {
1896 /* Display an error if an unexpected failure happened */
1897 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the partitions!", L"Error", MB_ICONERROR);
1898
1899 /* Re-enable the Close/Cancel buttons */
1901
1902 /*
1903 * We failed due to an unexpected error, keep on the copy page to view the current state,
1904 * but enable the "Next" button to allow the user to continue to the terminate page.
1905 */
1907 return 1;
1908 }
1909
1910
1911 /* Re-enable the Close/Cancel buttons */
1913
1914
1915
1916 /* Re-calculate the final destination paths */
1918 Status = InitDestinationPaths(&pSetupData->USetupData,
1919 NULL, // pSetupData->USetupData.InstallationDirectory,
1921 if (!NT_SUCCESS(Status))
1922 {
1923 DisplayMessage(GetParent(hwndDlg), MB_ICONERROR, L"Error", L"InitDestinationPaths() failed with status 0x%08lx\n", Status);
1924
1925 /*
1926 * We failed due to an unexpected error, keep on the copy page to view the current state,
1927 * but enable the "Next" button to allow the user to continue to the terminate page.
1928 */
1930 return 1;
1931 }
1932
1933
1934
1935 /*
1936 * Preparation of the list of files to be copied
1937 */
1938
1939 /* Set status text */
1941 pSetupData->hInstance,
1943 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1944
1945 /* Set progress marquee style and start it up */
1946 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
1947 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
1948 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
1949
1950 /* Prepare the list of files */
1951 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
1952
1953 /* Stop progress and restore its style */
1954 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1955 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1956
1957 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
1958 {
1959 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1960 if (!pSetupData->bStopInstall)
1961 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the list of files!", L"Error", MB_ICONERROR);
1962
1963 /*
1964 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1965 * but enable the "Next" button to allow the user to continue to the terminate page.
1966 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1967 */
1968 if (!pSetupData->bStopInstall)
1970 return 1;
1971 }
1972
1973
1974 /*
1975 * Perform the file copy
1976 */
1977
1978 /* Set status text */
1980 pSetupData->hInstance,
1982 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1983
1984 /* Create context for the copy process */
1985 CopyContext.pSetupData = pSetupData;
1986 CopyContext.TotalOperations = 0;
1987 CopyContext.CompletedOperations = 0;
1988
1989 /* Do the file copying - The callback handles whether or not we should stop file copying */
1990 if (!DoFileCopy(&pSetupData->USetupData, FileCopyCallback, &CopyContext))
1991 {
1992 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1993 if (!pSetupData->bStopInstall)
1994 MessageBoxW(GetParent(hwndDlg), L"Failed to copy the files!", L"Error", MB_ICONERROR);
1995
1996 /*
1997 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1998 * but enable the "Next" button to allow the user to continue to the terminate page.
1999 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
2000 */
2001 if (!pSetupData->bStopInstall)
2003 return 1;
2004 }
2005
2006 // /* Set status text */
2007 // SetWindowResTextW(GetDlgItem(hwndDlg, IDC_ACTIVITY),
2008 // pSetupData->hInstance,
2009 // IDS_INSTALL_FINALIZE);
2010 // SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2011
2012 /* Create the $winnt$.inf file */
2013 InstallSetupInfFile(&pSetupData->USetupData);
2014
2015
2016 /*
2017 * Create or update the registry hives
2018 */
2019
2020 /* Set status text */
2022 pSetupData->hInstance,
2025 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2026
2027 /* Set up the progress bar */
2028 SendMessageW(hWndProgress,
2029 PBM_SETRANGE, 0,
2030 MAKELPARAM(0, 8)); // FIXME: hardcoded number of steps, see StringIDs[] array in RegistryStatus()
2031 SendMessageW(hWndProgress,
2032 PBM_SETSTEP, 1, 0);
2033 SendMessageW(hWndProgress,
2034 PBM_SETPOS, 0, 0);
2035
2036 ErrorNumber = UpdateRegistry(&pSetupData->USetupData,
2037 pSetupData->RepairUpdateFlag,
2038 pSetupData->PartitionList,
2039 InstallVolume->Info.DriveLetter,
2040 pSetupData->SelectedLanguageId,
2042 NULL /* SubstSettings */);
2043 DBG_UNREFERENCED_PARAMETER(ErrorNumber);
2045
2046 /*
2047 * And finally, install the bootloader
2048 */
2049
2050 /* Set status text */
2052 pSetupData->hInstance,
2054 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2055
2057 StringCchPrintfW(PathBuffer, _countof(PathBuffer),
2058 L"%s\\", SystemPartition->DeviceName);
2059 RtlCreateUnicodeString(&pSetupData->USetupData.SystemRootPath, PathBuffer);
2060 DPRINT1("SystemRootPath: %wZ\n", &pSetupData->USetupData.SystemRootPath);
2061
2062 switch (pSetupData->USetupData.BootLoaderLocation)
2063 {
2064 /* Install on removable disk */
2065 case 1:
2066 {
2067 // TODO: So far SETUP only supports the 1st floppy.
2068 // Use a simple UI like comdlg32's DlgDirList* to show
2069 // a list of drives that the user could select.
2070 static const UNICODE_STRING FloppyDrive = RTL_CONSTANT_STRING(L"\\Device\\Floppy0\\");
2071 static const WCHAR DriveLetter = L'A';
2072
2073 INT nRet;
2074 RetryCancel:
2075 nRet = DisplayMessage(GetParent(hwndDlg),
2077 L"Bootloader installation",
2078 L"Please insert a blank floppy disk in drive %c: .\n"
2079 L"All data in the floppy disk will be erased!\n"
2080 L"\nClick on OK to continue."
2081 L"\nClick on CANCEL to skip bootloader installation.",
2082 DriveLetter);
2083 if (nRet != IDOK)
2084 break; /* Skip installation */
2085
2086 Retry:
2088 &FloppyDrive,
2089 &pSetupData->USetupData.SourceRootPath,
2090 &pSetupData->USetupData.DestinationArcPath);
2091 if (Status == STATUS_SUCCESS)
2092 break; /* Successful installation */
2093
2095 {
2096 // ERROR_NO_FLOPPY
2097 nRet = DisplayMessage(GetParent(hwndDlg),
2099 NULL, // Default to "Error"
2100 L"No disk detected in drive %c: .",
2101 DriveLetter);
2102 if (nRet == IDRETRY)
2103 goto Retry;
2104 }
2105 else if ((Status == ERROR_WRITE_BOOT) ||
2107 {
2108 /* Error when writing the boot code */
2109 DisplayError(GetParent(hwndDlg),
2110 0, // Default to "Error"
2112 }
2113 else if (!NT_SUCCESS(Status))
2114 {
2115 /* Any other NTSTATUS failure code */
2116 DPRINT1("InstallBootcodeToRemovable() failed: Status 0x%lx\n", Status);
2117 DisplayError(GetParent(hwndDlg),
2118 0, // Default to "Error"
2120 Status);
2121 }
2122 goto RetryCancel;
2123 }
2124
2125 /* Install on hard-disk */
2126 case 2: // System partition / MBR and VBR (on BIOS-based PC)
2127 case 3: // VBR only (on BIOS-based PC)
2128 {
2129 /* Copy FreeLoader to the disk and save the boot entries */
2131 pSetupData->USetupData.ArchType,
2132 &pSetupData->USetupData.SystemRootPath,
2133 &pSetupData->USetupData.SourceRootPath,
2134 &pSetupData->USetupData.DestinationArcPath,
2135 (pSetupData->USetupData.BootLoaderLocation == 2)
2136 ? 1 /* Install MBR and VBR */
2137 : 0 /* Install VBR only */);
2138 if (Status == STATUS_SUCCESS)
2139 break; /* Successful installation */
2140
2141 if (Status == ERROR_WRITE_BOOT)
2142 {
2143 /* Error when writing the VBR */
2144 DisplayError(GetParent(hwndDlg),
2145 0, // Default to "Error"
2147 SystemVolume->Info.FileSystem);
2148 }
2149 else if (Status == ERROR_INSTALL_BOOTCODE)
2150 {
2151 /* Error when writing the MBR */
2152 DisplayError(GetParent(hwndDlg),
2153 0, // Default to "Error"
2155 L"MBR");
2156 }
2157 else if (Status == STATUS_NOT_SUPPORTED)
2158 {
2159 DisplayError(GetParent(hwndDlg),
2160 0, // Default to "Error"
2162 }
2163 else if (!NT_SUCCESS(Status))
2164 {
2165 /* Any other NTSTATUS failure code */
2166 DPRINT1("InstallBootManagerAndBootEntries() failed: Status 0x%lx\n", Status);
2167 DisplayError(GetParent(hwndDlg),
2168 0, // Default to "Error"
2170 Status);
2171 }
2172 break;
2173 }
2174
2175 /* Skip installation */
2176 case 0:
2177 default:
2178 break;
2179 }
2180
2181
2182 /* We are done! Switch to the Terminate page */
2184 return 0;
2185}
2186
2187
2188static INT_PTR CALLBACK
2190 IN HWND hwndDlg,
2191 IN UINT uMsg,
2194{
2195 PSETUPDATA pSetupData;
2196
2197 /* Retrieve pointer to the global setup data */
2198 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2199
2200 switch (uMsg)
2201 {
2202 case WM_INITDIALOG:
2203 {
2204 /* Save pointer to the global setup data */
2205 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2206 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2207
2208 /* Reset status text */
2209 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
2210 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2211 break;
2212 }
2213
2214 case WM_NOTIFY:
2215 {
2216 LPNMHDR lpnm = (LPNMHDR)lParam;
2217
2218 switch (lpnm->code)
2219 {
2220 case PSN_SETACTIVE:
2221 {
2222 /* Create the file-copy halt (manual-reset) event */
2223 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
2224 if (!pSetupData->hHaltInstallEvent)
2225 break;
2226 pSetupData->bStopInstall = FALSE;
2227
2228 /* Start the prepare-and-copy files thread */
2229 pSetupData->hInstallThread =
2230 CreateThread(NULL, 0,
2232 (PVOID)hwndDlg,
2234 NULL);
2235 if (!pSetupData->hInstallThread)
2236 {
2237 CloseHandle(pSetupData->hHaltInstallEvent);
2238 pSetupData->hHaltInstallEvent = NULL;
2239
2240 MessageBoxW(GetParent(hwndDlg), L"Cannot create the prepare-and-copy files thread!", L"Error", MB_ICONERROR);
2241 break;
2242 }
2243
2244 /* Disable all buttons during installation process - buttons will be reenabled by the installation thread */
2246
2247 /* Resume the installation thread */
2248 ResumeThread(pSetupData->hInstallThread);
2249
2250 break;
2251 }
2252
2253 case PSN_QUERYCANCEL:
2254 {
2255 /* Halt the on-going file copy */
2256 ResetEvent(pSetupData->hHaltInstallEvent);
2257
2258 if (DisplayMessage(GetParent(hwndDlg),
2262 {
2263 /* Stop the file copy thread */
2264 pSetupData->bStopInstall = TRUE;
2265 SetEvent(pSetupData->hHaltInstallEvent);
2266
2267#if 0
2268 /* Wait for any pending installation */
2270 CloseHandle(pSetupData->hInstallThread);
2271 pSetupData->hInstallThread = NULL;
2272 CloseHandle(pSetupData->hHaltInstallEvent);
2273 pSetupData->hHaltInstallEvent = NULL;
2274#endif
2275
2276 // TODO: Unwind installation?!
2277
2278 /* Go to the Terminate page */
2280 }
2281 else
2282 {
2283 /* We don't stop installation, resume file copy */
2284 SetEvent(pSetupData->hHaltInstallEvent);
2285 }
2286
2287 /* Do not close the wizard too soon */
2289 return TRUE;
2290 }
2291
2292 default:
2293 break;
2294 }
2295 }
2296 break;
2297
2298 default:
2299 break;
2300
2301 }
2302
2303 return FALSE;
2304}
2305
2306static INT_PTR CALLBACK
2308 IN HWND hwndDlg,
2309 IN UINT uMsg,
2312{
2313 PSETUPDATA pSetupData;
2314
2315 /* Retrieve pointer to the global setup data */
2316 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2317
2318 switch (uMsg)
2319 {
2320 case WM_INITDIALOG:
2321 /* Save pointer to the global setup data */
2322 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2323 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2324
2325 /* Set title font */
2326 SetDlgItemFont(hwndDlg, IDC_FINISHTITLE, pSetupData->hTitleFont, TRUE);
2327 break;
2328
2329 case WM_TIMER:
2330 {
2331 INT Position;
2332 HWND hWndProgress;
2333
2334 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2335 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2336 if (Position == 300)
2337 {
2338 KillTimer(hwndDlg, 1);
2340 }
2341 else
2342 {
2343 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2344 }
2345 return TRUE;
2346 }
2347
2348 case WM_DESTROY:
2349 return TRUE;
2350
2351 case WM_NOTIFY:
2352 {
2353 LPNMHDR lpnm = (LPNMHDR)lParam;
2354
2355 switch (lpnm->code)
2356 {
2357 case PSN_SETACTIVE:
2358 {
2359 /* Only "Finish" for closing the wizard */
2362
2363 /* Set up the reboot progress bar */
2366 SetTimer(hwndDlg, 1, 50, NULL);
2367 break;
2368 }
2369
2370 default:
2371 break;
2372 }
2373 }
2374 break;
2375
2376 default:
2377 break;
2378
2379 }
2380
2381 return FALSE;
2382}
2383
2385 IN OUT PSETUPDATA pSetupData)
2386{
2387 pSetupData->PartitionList = CreatePartitionList();
2388 if (!pSetupData->PartitionList)
2389 {
2390 DPRINT1("Could not enumerate available disks; failing installation\n");
2391 return FALSE;
2392 }
2393
2394 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
2395 if (!pSetupData->NtOsInstallsList)
2396 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
2397
2398 /* Load the hardware, language and keyboard layout lists */
2399
2400 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
2401 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
2402 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
2403
2404 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
2405
2406 /* If not unattended, overwrite language and locale with
2407 * the current ones of the running ReactOS instance */
2408 if (!IsUnattendedSetup)
2409 {
2410 LCID LocaleID = GetUserDefaultLCID();
2411
2412 StringCchPrintfW(pSetupData->DefaultLanguage,
2413 _countof(pSetupData->DefaultLanguage),
2414 L"%08lx", LocaleID);
2415
2416 StringCchPrintfW(pSetupData->USetupData.LocaleID,
2417 _countof(pSetupData->USetupData.LocaleID),
2418 L"%08lx", LocaleID);
2419 }
2420
2421 /* new part */
2422 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
2423 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
2424 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
2425
2426 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
2427 pSetupData->SelectedLanguageId,
2428 pSetupData->DefaultKBLayout);
2429
2430 /* If not unattended, overwrite keyboard layout with
2431 * the current one of the running ReactOS instance */
2432 if (!IsUnattendedSetup)
2433 {
2434 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
2435 /* If the call fails, keep the default already stored in the buffer */
2436 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
2437 }
2438
2439 /* Change the default entries in the language and keyboard layout lists */
2440 {
2441 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
2442 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
2443 PGENERIC_LIST_ENTRY ListEntry;
2444
2445 /* Search for default language */
2446 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
2447 ListEntry = GetNextListEntry(ListEntry))
2448 {
2449 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2450 if (!_wcsicmp(pSetupData->DefaultLanguage, LocaleId))
2451 {
2452 DPRINT("found %S in LanguageList\n", LocaleId);
2453 SetCurrentListEntry(LanguageList, ListEntry);
2454 break;
2455 }
2456 }
2457
2458 /* Search for default layout */
2459 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
2460 ListEntry = GetNextListEntry(ListEntry))
2461 {
2462 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2463 if (!_wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
2464 {
2465 DPRINT("Found %S in LayoutList\n", pszLayoutId);
2466 SetCurrentListEntry(LayoutList, ListEntry);
2467 break;
2468 }
2469 }
2470 }
2471
2472 return TRUE;
2473}
2474
2475VOID
2478{
2479 InitializeListHead(&MappingList->List);
2480 MappingList->MappingsCount = 0;
2481}
2482
2483VOID
2486{
2487 PLIST_ENTRY ListEntry;
2488 PVOID Entry;
2489
2490 while (!IsListEmpty(&MappingList->List))
2491 {
2492 ListEntry = RemoveHeadList(&MappingList->List);
2493 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2495 }
2496
2497 MappingList->MappingsCount = 0;
2498}
2499
2500/*
2501 * Attempts to convert a pure NT file path into a corresponding Win32 path.
2502 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
2503 */
2504BOOL
2507 OUT PWSTR pwszPath,
2508 IN DWORD cchPathMax,
2509 IN PCWSTR pwszNTPath)
2510{
2511 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
2512 PLIST_ENTRY ListEntry;
2514 PCWSTR pwszNtPathToMap = pwszNTPath;
2515 PCWSTR pwszRemaining = NULL;
2516 DWORD cchDrives;
2517 PWCHAR pwszDrive;
2518 WCHAR wszDrives[512];
2519 WCHAR wszNTPath[MAX_PATH];
2520 WCHAR TargetPath[MAX_PATH];
2521
2522 *pwszPath = UNICODE_NULL;
2523
2524 /*
2525 * We find first a mapping inside the MappingList. If one is found, use it
2526 * to build the Win32 path. If there is none, we need to create one by
2527 * checking the Win32 drives (and possibly NT symlinks too).
2528 * In case of success, add the newly found mapping to the list and use it
2529 * to build the Win32 path.
2530 */
2531
2532 for (ListEntry = MappingList->List.Flink;
2533 ListEntry != &MappingList->List;
2534 ListEntry = ListEntry->Flink)
2535 {
2536 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2537
2538 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
2539
2540 /* Check whether the queried NT path prefixes the user-provided NT path */
2541 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
2542 if (FoundDrive)
2543 {
2544 /* Found it! */
2545
2546 /* Set the pointers and go build the Win32 path */
2547 pwszDrive = Entry->Win32Path;
2548 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
2549 goto Quit;
2550 }
2551 }
2552
2553 /*
2554 * No mapping exists for this path yet: try to find one now.
2555 */
2556
2557 /* Retrieve the mounted drives (available drive letters) */
2558 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2559 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2560 {
2561 /* Buffer too small or failure */
2562 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
2563 return FALSE;
2564 }
2565
2566/* We go back there once if RetryOnce == TRUE */
2567Retry:
2568
2569 /* Enumerate the mounted drives */
2570 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2571 {
2572 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2573 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2574 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2575 pwszDrive[2] = L'\\'; // Restore the backslash
2576
2577 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
2578
2579 /* Check whether the queried NT path prefixes the user-provided NT path */
2580 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2581 if (!FoundDrive)
2582 {
2583 PWCHAR ptr, ptr2;
2584
2585 /*
2586 * Check whether this was a network share that has a drive letter,
2587 * but the user-provided NT path points to this share without
2588 * mentioning the drive letter.
2589 *
2590 * The format is: \Device<network_redirector>\;X:<data>\share\path
2591 * The corresponding drive letter is 'X'.
2592 * A system-provided network redirector (LanManRedirector or Mup)
2593 * or a 3rd-party one may be used.
2594 *
2595 * We check whether the user-provided NT path has the form:
2596 * \Device<network_redirector><data>\share\path
2597 * as it obviously did not have the full form (the previous check
2598 * would have been OK otherwise).
2599 */
2600 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
2601 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
2602 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
2603 {
2604 /*
2605 * Normally the specified drive letter should correspond
2606 * to the one used for the mapping. But we will ignore
2607 * if it happens not to be the case.
2608 */
2609 if (pwszDrive[0] != ptr[1])
2610 {
2611 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
2612 pwszDrive[0], ptr[1]);
2613 }
2614
2615 /* Remove the drive letter from the NT network share path */
2616 ptr2 = ptr + 3;
2617 /* Swallow as many possible consecutive backslashes as there could be */
2618 while (*ptr2 == L'\\') ++ptr2;
2619
2620 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
2621
2622 /* Now do the check again */
2623 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2624 }
2625 }
2626 if (FoundDrive)
2627 {
2628 /* Found it! */
2629
2630 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
2631
2632 if (pwszNtPathToMap == pwszNTPath)
2633 {
2634 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
2635 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
2636 }
2637 break;
2638 }
2639 }
2640
2641 if (FoundDrive)
2642 {
2643 /* A mapping was found, add it to the cache */
2645 if (!Entry)
2646 {
2647 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
2648 return FALSE;
2649 }
2650 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
2651 pwszNTPath, pwszRemaining - pwszNTPath);
2652 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
2653
2654 /* Insert it as the most recent entry */
2655 InsertHeadList(&MappingList->List, &Entry->ListEntry);
2656 MappingList->MappingsCount++;
2657
2658 /* Set the pointers and go build the Win32 path */
2659 pwszDrive = Entry->Win32Path;
2660 goto Quit;
2661 }
2662
2663 /*
2664 * We failed, perhaps because the beginning of the NT path used a symlink.
2665 * Try to see whether this is the case by attempting to resolve it.
2666 * If the symlink resolution gives nothing, or we already failed once,
2667 * there is no hope in converting the path to Win32.
2668 * Otherwise, symlink resolution succeeds but we need to recheck again
2669 * the drives list.
2670 */
2671
2672 /*
2673 * In theory we would have to parse each element in the NT path and going
2674 * until finding a symlink object (otherwise we would fail straight away).
2675 * However here we can use guessing instead, since we know which kind of
2676 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
2677 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
2678 * are supported in setuplib\utils\arcname.c .
2679 *
2680 * But actually, all the supported names in arcname.c are real devices,
2681 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
2682 * just check for it.
2683 */
2684 if (!RetryOnce && !FoundDrive)
2685 {
2686 ULONG DiskNumber, PartitionNumber;
2687 INT Length;
2688
2691 HANDLE LinkHandle;
2692 UNICODE_STRING SymLink, Target;
2693
2694 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
2695 &DiskNumber, &PartitionNumber, &Length) != 2)
2696 {
2697 /* Definitively not a recognized path, bail out */
2698 return FALSE;
2699 }
2700
2701 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
2702 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
2703 SymLink.Length = SymLink.MaximumLength;
2704
2706 &SymLink,
2708 NULL,
2709 NULL);
2710 Status = NtOpenSymbolicLinkObject(&LinkHandle,
2713 if (!NT_SUCCESS(Status))
2714 {
2715 /* Not a symlink, or something else happened: bail out */
2716 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2717 &SymLink, Status);
2718 return FALSE;
2719 }
2720
2721 *TargetPath = UNICODE_NULL;
2722 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
2723
2724 /* Resolve the link and close its handle */
2726 NtClose(LinkHandle);
2727
2728 /* Check for success */
2729 if (!NT_SUCCESS(Status))
2730 {
2731 /* Not a symlink, or something else happened: bail out */
2732 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2733 &SymLink, Status);
2734 return FALSE;
2735 }
2736
2737 /* Set the pointers */
2738 pwszRemaining = pwszNTPath + Length;
2739 pwszNtPathToMap = TargetPath; // Point to our local buffer
2740
2741 /* Retry once */
2742 RetryOnce = TRUE;
2743 goto Retry;
2744 }
2745
2746 ASSERT(!FoundDrive);
2747
2748Quit:
2749 if (FoundDrive)
2750 {
2751 StringCchPrintfW(pwszPath, cchPathMax,
2752 L"%s%s",
2753 pwszDrive,
2754 pwszRemaining);
2755 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
2756 return TRUE;
2757 }
2758
2759 return FALSE;
2760}
2761
2762/* Used to enable and disable the shutdown privilege */
2763/* static */ BOOL
2765 IN LPCWSTR lpszPrivilegeName,
2766 IN BOOL bEnablePrivilege)
2767{
2768 BOOL Success;
2769 HANDLE hToken;
2771
2774 &hToken);
2775 if (!Success) return Success;
2776
2778 lpszPrivilegeName,
2779 &tp.Privileges[0].Luid);
2780 if (!Success) goto Quit;
2781
2782 tp.PrivilegeCount = 1;
2783 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
2784
2785 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
2786
2787Quit:
2788 CloseHandle(hToken);
2789 return Success;
2790}
2791
2792/* Copied from HotkeyThread() in dll/win32/syssetup/install.c */
2793static DWORD CALLBACK
2795{
2796 ATOM hotkey;
2797 MSG msg;
2798
2799 DPRINT("HotkeyThread start\n");
2800
2801 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
2802 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
2803 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
2804
2805 while (GetMessageW(&msg, NULL, 0, 0))
2806 {
2807 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
2808 {
2809 WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
2810 STARTUPINFOW si = { sizeof(si) };
2812
2813 if (CreateProcessW(NULL,
2814 CmdLine,
2815 NULL,
2816 NULL,
2817 FALSE,
2819 NULL,
2820 NULL,
2821 &si,
2822 &pi))
2823 {
2824 CloseHandle(pi.hProcess);
2825 CloseHandle(pi.hThread);
2826 }
2827 else
2828 {
2829 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
2830 }
2831 }
2832 }
2833
2834 UnregisterHotKey(NULL, hotkey);
2835 GlobalDeleteAtom(hotkey);
2836
2837 DPRINT("HotkeyThread terminate\n");
2838 return 0;
2839}
2840
2841int WINAPI
2843 HINSTANCE hPrevInstance,
2844 LPTSTR lpszCmdLine,
2845 int nCmdShow)
2846{
2847 ULONG Error;
2848 HANDLE hHotkeyThread;
2850 PROPSHEETHEADER psh;
2851 HPROPSHEETPAGE ahpsp[8];
2852 PROPSHEETPAGE psp = {0};
2853 UINT nPages = 0;
2854
2856
2861
2862 /* Initialize the NT to Win32 path prefix mapping list */
2864
2865 /* Initialize Setup */
2868 if (Error != ERROR_SUCCESS)
2869 {
2870 //
2871 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
2872 //
2874 MessageBoxW(NULL, L"GetSourcePaths failed!", L"Error", MB_ICONERROR);
2875 else if (Error == ERROR_LOAD_TXTSETUPSIF)
2877 else // FIXME!!
2878 MessageBoxW(NULL, L"Unknown error!", L"Error", MB_ICONERROR);
2879
2880 goto Quit;
2881 }
2882
2883 /* Retrieve any supplemental options from the unattend file */
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:298
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:61
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:1794
static INT_PTR CALLBACK ProcessDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2189
struct _FSVOL_CONTEXT FSVOL_CONTEXT
static VOID __cdecl RegistryStatus(IN REGISTRY_STATUS RegStatus,...)
Definition: reactos.c:1758
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:654
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1292
struct _COPYCONTEXT * PCOPYCONTEXT
static INT_PTR CALLBACK TypeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:383
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:746
#define SystemVolume
Definition: reactos.c:52
static INT_PTR CALLBACK RestartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2307
#define MAX_LIST_COLUMNS
Definition: reactos.c:744
#define InstallVolume
Definition: reactos.c:47
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: reactos.c:1226
static HFONT CreateBoldFont(_In_opt_ HFONT hOrigFont, _In_opt_ INT PointSize)
Create a bold font derived from the provided font.
Definition: reactos.c:88
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:2505
HANDLE ProcessHeap
Definition: reactos.c:40
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:2384
UI_CONTEXT UiContext
Definition: reactos.c:55
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:747
static INT_PTR CALLBACK UpgradeRepairDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:750
static HFONT CreateTitleFont(_In_opt_ HFONT hOrigFont)
Definition: reactos.c:122
PPARTENTRY InstallPartition
Definition: reactos.c:45
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:596
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:617
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:251
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:282
struct _FSVOL_CONTEXT * PFSVOL_CONTEXT
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2484
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:519
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:674
#define IDS_LIST_COLUMN_FIRST
Definition: reactos.c:741
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:609
static INT_PTR CALLBACK DeviceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:936
static INT_PTR CALLBACK SummaryDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1039
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:232
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2476
VOID(NTAPI * PGET_ENTRY_DESCRIPTION)(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:552
PPARTENTRY SystemPartition
Definition: reactos.c:50
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:271
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:685
static BOOLEAN IsUnattendedSetup
Definition: reactos.c:42
static INT_PTR CALLBACK StartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:312
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:130
SETUPDATA SetupData
Definition: reactos.c:41
struct _COPYCONTEXT COPYCONTEXT
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:2794
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:2764
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:745
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:558
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1807
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:1637
#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:1830
NTSTATUS NTAPI InstallBootManagerAndBootEntries(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ ULONG_PTR Options)
Installs FreeLoader on the system and configure the boot entries.
Definition: bootsup.c:1674
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:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#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:1612
_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:208
ERROR_NUMBER NTAPI InitializeSetup(_Inout_ PUSETUP_DATA pSetupData, _In_opt_ PSETUP_ERROR_ROUTINE ErrorRoutine, _In_ PSPFILE_EXPORTS pSpFileExports, _In_ PSPINF_EXPORTS pSpInfExports)
Definition: setuplib.c:1020
NTSTATUS NTAPI InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:864
BOOLEAN NTAPI InitSystemPartition(_In_ PPARTLIST PartitionList, _In_ PPARTENTRY InstallPartition, _Out_ PPARTENTRY *pSystemPartition, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Find or set the active system partition.
Definition: setuplib.c:679
BOOLEAN NTAPI CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:32
VOID NTAPI FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1104
ERROR_NUMBER NTAPI UpdateRegistry(IN OUT PUSETUP_DATA pSetupData, IN BOOLEAN RepairUpdateFlag, IN PPARTLIST PartitionList, IN WCHAR DestinationDriveLetter, IN PCWSTR SelectedLanguageId, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL)
Definition: setuplib.c:1155
#define ERROR_SYSTEM_PARTITION_NOT_FOUND
Definition: setuplib.h:188
enum _REGISTRY_STATUS REGISTRY_STATUS
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
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:3356
LPCWSTR lpszCaption
Definition: winuser.h:3351
HWND hwndOwner
Definition: winuser.h:3348
LPCWSTR lpszText
Definition: winuser.h:3350
HINSTANCE hInstance
Definition: winuser.h:3349
DWORD dwStyle
Definition: winuser.h:3352
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:1631
ULONG CompletedOperations
Definition: reactos.c:1632
PSETUPDATA pSetupData
Definition: reactos.c:1630
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:1219
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:139
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:124
PGENERIC_LIST ComputerList
Definition: setuplib.h:138
UNICODE_STRING SystemRootPath
Definition: setuplib.h:119
UNICODE_STRING SourceRootPath
Definition: setuplib.h:101
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:157
LONG BootLoaderLocation
Definition: setuplib.h:132
ARCHITECTURE_TYPE ArchType
Definition: setuplib.h:145
PGENERIC_LIST KeyboardList
Definition: setuplib.h:140
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:122
LONG FormatPartition
Definition: setuplib.h:133
VOLINFO Info
Definition: partlist.h:47
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskVolumeN".
Definition: volutil.h: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:3169
UINT code
Definition: winuser.h:3170
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:2443
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define CB_SETITEMDATA
Definition: winuser.h:1977
#define SW_HIDE
Definition: winuser.h:779
#define MF_BYCOMMAND
Definition: winuser.h:202
#define GetWindowLongPtrW
Definition: winuser.h:4840
#define WM_QUIT
Definition: winuser.h:1634
#define MAKELPARAM(l, h)
Definition: winuser.h:4019
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define KL_NAMELENGTH
Definition: winuser.h:122
#define IDCANCEL
Definition: winuser.h:842
#define VK_F10
Definition: winuser.h:2275
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:1751
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define CB_ERR
Definition: winuser.h:2446
#define CB_SETCURSEL
Definition: winuser.h:1972
#define SM_CYSMICON
Definition: winuser.h:1024
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define MB_RETRYCANCEL
Definition: winuser.h:816
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_INITDIALOG
Definition: winuser.h:1750
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MB_YESNO
Definition: winuser.h:828
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define MB_ICONERROR
Definition: winuser.h:798
#define MB_OKCANCEL
Definition: winuser.h:815
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1023
#define EWX_REBOOT
Definition: winuser.h:646
#define HWND_TOP
Definition: winuser.h:1218
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_TIMER
Definition: winuser.h:1753
#define CB_ADDSTRING
Definition: winuser.h:1947
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define SC_CLOSE
Definition: winuser.h:2603
#define MB_OK
Definition: winuser.h:801
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define MB_ICONWARNING
Definition: winuser.h:797
HWND WINAPI GetParent(_In_ HWND)
#define MB_ICONQUESTION
Definition: winuser.h:800
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define MB_ICONINFORMATION
Definition: winuser.h:813
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)
#define WM_HOTKEY
Definition: winuser.h:1890
#define BN_CLICKED
Definition: winuser.h:1936
#define SW_SHOW
Definition: winuser.h:786
#define WM_DESTROY
Definition: winuser.h:1620
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
#define IDRETRY
Definition: winuser.h:844
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5366
#define GWL_STYLE
Definition: winuser.h:863
#define SendDlgItemMessage
Definition: winuser.h:5862
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2412
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