ReactOS 0.4.15-dev-8102-g108db8f
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
45/* FUNCTIONS ****************************************************************/
46
47static VOID
49{
51 RECT rcParent;
52 RECT rcWindow;
53
55 if (hWndParent == NULL)
57
58 GetWindowRect(hWndParent, &rcParent);
59 GetWindowRect(hWnd, &rcWindow);
60
63 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
64 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
65 0,
66 0,
68}
69
70static HFONT
72{
73 NONCLIENTMETRICS ncm;
74 LOGFONT LogFont;
75 HDC hdc;
76 INT FontSize;
78
79 ncm.cbSize = sizeof(NONCLIENTMETRICS);
80 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
81
82 LogFont = ncm.lfMessageFont;
83 LogFont.lfWeight = FW_BOLD;
84 _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg"));
85
86 hdc = GetDC(NULL);
87 FontSize = 12;
88 LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
89 hFont = CreateFontIndirect(&LogFont);
91
92 return hFont;
93}
94
96 IN HWND hParentWnd OPTIONAL,
97 IN UINT uIDTitle,
98 IN UINT uIDMessage)
99{
100 WCHAR message[512], caption[64];
101
103 LoadStringW(SetupData.hInstance, uIDTitle, caption, ARRAYSIZE(caption));
104
105 return MessageBoxW(hParentWnd, message, caption, MB_OK | MB_ICONERROR);
106}
107
108static INT_PTR CALLBACK
110 IN HWND hwndDlg,
111 IN UINT uMsg,
114{
115 PSETUPDATA pSetupData;
116
117 /* Retrieve pointer to the global setup data */
118 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
119
120 switch (uMsg)
121 {
122 case WM_INITDIALOG:
123 {
124 /* Save pointer to the global setup data */
125 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
126 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
127
128 /* Set title font */
129 SendDlgItemMessage(hwndDlg,
132 (WPARAM)pSetupData->hTitleFont,
133 (LPARAM)TRUE);
134
135 /* Center the wizard window */
136 CenterWindow(GetParent(hwndDlg));
137 break;
138 }
139
140 case WM_NOTIFY:
141 {
142 LPNMHDR lpnm = (LPNMHDR)lParam;
143
144 switch (lpnm->code)
145 {
146 case PSN_SETACTIVE:
148 break;
149
150 default:
151 break;
152 }
153 }
154 break;
155
156 default:
157 break;
158
159 }
160
161 return FALSE;
162}
163
164static INT_PTR CALLBACK
166 IN HWND hwndDlg,
167 IN UINT uMsg,
170{
171 PSETUPDATA pSetupData;
172
173 /* Retrieve pointer to the global setup data */
174 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
175
176 switch (uMsg)
177 {
178 case WM_INITDIALOG:
179 {
180 /* Save pointer to the global setup data */
181 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
182 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
183
184 /* Check the 'install' radio button */
186
187 /*
188 * Enable the 'update' radio button and text only if we have
189 * available NT installations, otherwise disable them.
190 */
191 if (pSetupData->NtOsInstallsList &&
192 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0)
193 {
196 }
197 else
198 {
201 }
202
203 break;
204 }
205
206 case WM_NOTIFY:
207 {
208 LPNMHDR lpnm = (LPNMHDR)lParam;
209
210 switch (lpnm->code)
211 {
212 case PSN_SETACTIVE:
214 break;
215
217 {
218 /* Focus on "Install ReactOS" */
220 return TRUE;
221 }
222
223 case PSN_QUERYCANCEL:
224 {
225 if (MessageBoxW(GetParent(hwndDlg),
226 pSetupData->szAbortMessage,
227 pSetupData->szAbortTitle,
229 {
230 /* Go to the Terminate page */
232 }
233
234 /* Do not close the wizard too soon */
236 return TRUE;
237 }
238
239 case PSN_WIZNEXT: /* Set the selected data */
240 {
241 /*
242 * Go update only if we have available NT installations
243 * and we choose to do so.
244 */
245 if (pSetupData->NtOsInstallsList &&
246 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
248 {
249 pSetupData->RepairUpdateFlag = TRUE;
250
251 /*
252 * Display the existing NT installations page only
253 * if we have more than one available NT installations.
254 */
255 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
256 {
257 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
258
259 /* Actually the best would be to dynamically insert the page only when needed */
261 }
262 else
263 {
264 /* Retrieve the current installation */
265 pSetupData->CurrentInstallation =
267
269 }
270 }
271 else
272 {
273 pSetupData->CurrentInstallation = NULL;
274 pSetupData->RepairUpdateFlag = FALSE;
276 }
277
278 return TRUE;
279 }
280
281 default:
282 break;
283 }
284 }
285 break;
286
287 default:
288 break;
289
290 }
291 return FALSE;
292}
293
294
295
296BOOL
299 IN HWND hWndListView,
300 IN const UINT* pIDs,
301 IN const INT* pColsWidth,
302 IN const INT* pColsAlign,
303 IN UINT nNumOfColumns)
304{
305 UINT i;
306 LVCOLUMN lvC;
307 WCHAR szText[50];
308
309 /* Create the columns */
310 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
311 lvC.pszText = szText;
312
313 /* Load the column labels from the resource file */
314 for (i = 0; i < nNumOfColumns; i++)
315 {
316 lvC.iSubItem = i;
317 lvC.cx = pColsWidth[i];
318 lvC.fmt = pColsAlign[i];
319
320 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
321
322 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
323 return FALSE;
324 }
325
326 return TRUE;
327}
328
329typedef VOID
333 IN SIZE_T cchBufferSize);
334
335VOID
339 IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
340{
341 INT Index, CurrentEntryIndex = 0;
342 PGENERIC_LIST_ENTRY ListEntry;
344 WCHAR CurrentItemText[256];
345
346 for (Entry = List->ListHead.Flink;
347 Entry != &List->ListHead;
348 Entry = Entry->Flink)
349 {
351
352 if (GetEntryDescriptionProc)
353 {
354 GetEntryDescriptionProc(ListEntry,
355 CurrentItemText,
356 ARRAYSIZE(CurrentItemText));
357 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
358 }
359 else
360 {
362 }
363
364 if (ListEntry == List->CurrentEntry)
365 CurrentEntryIndex = Index;
366
368 }
369
370 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
371}
372
373PVOID
376{
377 INT Index;
378
380 if (Index == CB_ERR)
381 return NULL;
382
384}
385
386typedef VOID
389 IN LVITEM* plvItem,
392 IN SIZE_T cchBufferSize);
393
394VOID
398 IN PADD_ENTRY_ITEM AddEntryItemProc)
399{
400 INT CurrentEntryIndex = 0;
401 LVITEM lvItem;
402 PGENERIC_LIST_ENTRY ListEntry;
404 WCHAR CurrentItemText[256];
405
406 for (Entry = List->ListHead.Flink;
407 Entry != &List->ListHead;
408 Entry = Entry->Flink)
409 {
411
412 if (!AddEntryItemProc)
413 continue;
414
415 AddEntryItemProc(hWndList,
416 &lvItem,
417 ListEntry,
418 CurrentItemText,
419 ARRAYSIZE(CurrentItemText));
420
421 if (ListEntry == List->CurrentEntry)
422 CurrentEntryIndex = lvItem.iItem;
423 }
424
425 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
426 ListView_SetItemState(hWndList, CurrentEntryIndex,
429}
430
431PVOID
434{
435 INT Index;
436 LVITEM item;
437
439 if (Index == LB_ERR)
440 return NULL;
441
442 item.mask = LVIF_PARAM;
443 item.iItem = Index;
445
446 return (PVOID)item.lParam;
447}
448
449
450static VOID
451NTAPI
455 IN SIZE_T cchBufferSize)
456{
457 StringCchCopyW(Buffer, cchBufferSize,
459}
460
461static VOID
462NTAPI
465 IN LVITEM* plvItem,
467 IN OUT PWSTR Buffer, // SystemRootPath
468 IN SIZE_T cchBufferSize)
469{
471 PPARTENTRY PartEntry = NtOsInstall->PartEntry;
472
473 if (PartEntry && PartEntry->DriveLetter)
474 {
475 /* We have retrieved a partition that is mounted */
476 StringCchPrintfW(Buffer, cchBufferSize,
477 L"%c:%s",
478 PartEntry->DriveLetter,
479 NtOsInstall->PathComponent);
480 }
481 else
482 {
483 /* We failed somewhere, just show the NT path */
484 StringCchPrintfW(Buffer, cchBufferSize,
485 L"%wZ",
486 &NtOsInstall->SystemNtPath);
487 }
488
489 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
490 plvItem->iItem = 0;
491 plvItem->iSubItem = 0;
492 plvItem->lParam = (LPARAM)Entry;
493 plvItem->pszText = NtOsInstall->InstallationName;
494
495 /* Associate vendor icon */
496 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
497 {
498 plvItem->mask |= LVIF_IMAGE;
499 plvItem->iImage = 0;
500 }
501 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
502 {
503 plvItem->mask |= LVIF_IMAGE;
504 plvItem->iImage = 1;
505 }
506
507 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
508
509 plvItem->iSubItem = 1;
510 plvItem->pszText = Buffer; // SystemRootPath;
511 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
512
513 plvItem->iSubItem = 2;
514 plvItem->pszText = NtOsInstall->VendorName;
515 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
516}
517
518
519#define IDS_LIST_COLUMN_FIRST IDS_INSTALLATION_NAME
520#define IDS_LIST_COLUMN_LAST IDS_INSTALLATION_VENDOR
521
522#define MAX_LIST_COLUMNS (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
524static const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100};
526
527static INT_PTR CALLBACK
529 IN HWND hwndDlg,
530 IN UINT uMsg,
533{
534 PSETUPDATA pSetupData;
535 HWND hList;
536 HIMAGELIST hSmall;
537
538 /* Retrieve pointer to the global setup data */
539 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
540
541 switch (uMsg)
542 {
543 case WM_INITDIALOG:
544 {
545 /* Save pointer to the global setup data */
546 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
547 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
548
549 /*
550 * Keep the "Next" button disabled. It will be enabled only
551 * when the user selects an installation to upgrade.
552 */
554
555 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
556
558
559 CreateListViewColumns(pSetupData->hInstance,
560 hList,
565
566 /* Create the ImageList */
569 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
570 1, 1);
571
572 /* Add event type icons to the ImageList */
573 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_ROSICON)));
574 ImageList_AddIcon(hSmall, LoadIconW(pSetupData->hInstance, MAKEINTRESOURCEW(IDI_WINICON)));
575
576 /* Assign the ImageList to the List View */
578
579 InitGenericListView(hList, pSetupData->NtOsInstallsList, AddNTOSInstallationItem);
580 break;
581 }
582
583 case WM_DESTROY:
584 {
585 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
588 ImageList_Destroy(hSmall);
589 return TRUE;
590 }
591
592 case WM_COMMAND:
593 switch (LOWORD(wParam))
594 {
595 case IDC_SKIPUPGRADE:
596 {
597 /* Skip the upgrade and do the usual new-installation workflow */
598 pSetupData->CurrentInstallation = NULL;
599 pSetupData->RepairUpdateFlag = FALSE;
601 return TRUE;
602 }
603 }
604 break;
605
606 case WM_NOTIFY:
607 {
608 LPNMHDR lpnm = (LPNMHDR)lParam;
609
610 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
611 {
613
614 if (pnmv->uChanged & LVIF_STATE) /* The state has changed */
615 {
616 /* The item has been (de)selected */
617 if (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED))
618 {
620 }
621 else
622 {
623 /*
624 * Keep the "Next" button disabled. It will be enabled only
625 * when the user selects an installation to upgrade.
626 */
628 }
629 }
630
631 break;
632 }
633
634 switch (lpnm->code)
635 {
636#if 0
637 case PSN_SETACTIVE:
638 {
639 /*
640 * Keep the "Next" button disabled. It will be enabled only
641 * when the user selects an installation to upgrade.
642 */
644 break;
645 }
646#endif
647
649 {
650 /* Give the focus on and select the first item */
651 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
654 return TRUE;
655 }
656
657 case PSN_QUERYCANCEL:
658 {
659 if (MessageBoxW(GetParent(hwndDlg),
660 pSetupData->szAbortMessage,
661 pSetupData->szAbortTitle,
663 {
664 /* Go to the Terminate page */
666 }
667
668 /* Do not close the wizard too soon */
670 return TRUE;
671 }
672
673 case PSN_WIZNEXT: /* Set the selected data */
674 {
675 /*
676 * Go update only if we have available NT installations
677 * and we choose to do so.
678 */
679 if (!pSetupData->NtOsInstallsList ||
681 {
682 pSetupData->CurrentInstallation = NULL;
683 pSetupData->RepairUpdateFlag = FALSE;
684 break;
685 }
686
687 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
690
691 /* Retrieve the current installation */
692 pSetupData->CurrentInstallation =
694
695 /* We perform an upgrade */
696 pSetupData->RepairUpdateFlag = TRUE;
697 return TRUE;
698 }
699
700 default:
701 break;
702 }
703 }
704 break;
705
706 default:
707 break;
708
709 }
710 return FALSE;
711}
712
713static INT_PTR CALLBACK
715 IN HWND hwndDlg,
716 IN UINT uMsg,
719{
720 PSETUPDATA pSetupData;
721 HWND hList;
722
723 /* Retrieve pointer to the global setup data */
724 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
725
726 switch (uMsg)
727 {
728 case WM_INITDIALOG:
729 {
730 /* Save pointer to the global setup data */
731 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
732 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
733
734 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
735 InitGenericComboList(hList, pSetupData->USetupData.ComputerList, GetSettingDescription);
736
737 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
738 InitGenericComboList(hList, pSetupData->USetupData.DisplayList, GetSettingDescription);
739
740 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
741 InitGenericComboList(hList, pSetupData->USetupData.KeyboardList, GetSettingDescription);
742
743 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
744 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
745
746 break;
747 }
748
749 case WM_NOTIFY:
750 {
751 LPNMHDR lpnm = (LPNMHDR)lParam;
752
753 switch (lpnm->code)
754 {
755 case PSN_SETACTIVE:
757 break;
758
760 {
761 /* Focus on "Computer" list */
763 return TRUE;
764 }
765
766 case PSN_QUERYCANCEL:
767 {
768 if (MessageBoxW(GetParent(hwndDlg),
769 pSetupData->szAbortMessage,
770 pSetupData->szAbortTitle,
772 {
773 /* Go to the Terminate page */
775 }
776
777 /* Do not close the wizard too soon */
779 return TRUE;
780 }
781
782 case PSN_WIZNEXT: /* Set the selected data */
783 {
784 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
787
788 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
791
792 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
795
796 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
797 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
798 // GetSelectedComboListItem(hList));
799
800 return TRUE;
801 }
802
803 default:
804 break;
805 }
806 }
807 break;
808
809 default:
810 break;
811
812 }
813 return FALSE;
814}
815
816static INT_PTR CALLBACK
818 IN HWND hwndDlg,
819 IN UINT uMsg,
822{
823 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
824
825 PSETUPDATA pSetupData;
826
827 /* Retrieve pointer to the global setup data */
828 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
829
830 switch (uMsg)
831 {
832 case WM_INITDIALOG:
833 {
834 /* Save pointer to the global setup data */
835 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
836 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
837 break;
838 }
839
840 case WM_COMMAND:
841 {
843 {
846 else
848 }
849 break;
850 }
851
852 case WM_NOTIFY:
853 {
854 LPNMHDR lpnm = (LPNMHDR)lParam;
855
856 switch (lpnm->code)
857 {
858 case PSN_SETACTIVE:
859 {
860 WCHAR CurrentItemText[256];
861
862 /* Show the current selected settings */
863
864 // FIXME! Localize
865 if (pSetupData->RepairUpdateFlag)
866 {
867 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
868 L"Upgrading/Repairing \"%s\" from \"%s\"",
870 pSetupData->CurrentInstallation->VendorName);
871 }
872 else
873 {
874 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
875 L"New ReactOS installation");
876 }
877 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
878
879 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
880 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
881
883 CurrentItemText,
884 ARRAYSIZE(CurrentItemText));
885 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
886
888 CurrentItemText,
889 ARRAYSIZE(CurrentItemText));
890 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
891
893 CurrentItemText,
894 ARRAYSIZE(CurrentItemText));
895 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
896
897 if (L'C') // FIXME!
898 {
899 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
900 L"%c: \x2014 %wZ",
901 L'C', // FIXME!
902 &pSetupData->USetupData.DestinationRootPath);
903 }
904 else
905 {
906 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
907 L"%wZ",
908 &pSetupData->USetupData.DestinationRootPath);
909 }
910 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
911
912 SetDlgItemTextW(hwndDlg, IDC_PATH,
913 /*pSetupData->USetupData.InstallationDirectory*/
914 pSetupData->USetupData.InstallPath.Buffer);
915
916
917 /* Change the "Next" button text to "Install" */
918 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
920 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
921 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, L"Install"); // FIXME: Localize!
922
923 /*
924 * Keep the "Next" button disabled. It will be enabled only
925 * when the user clicks on the installation approval checkbox.
926 */
929 break;
930 }
931
933 {
934 /* Focus on the confirmation check-box */
936 return TRUE;
937 }
938
939 case PSN_KILLACTIVE:
940 {
941 /* Restore the original "Next" button text */
942 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
943 break;
944 }
945
946 case PSN_QUERYCANCEL:
947 {
948 if (MessageBoxW(GetParent(hwndDlg),
949 pSetupData->szAbortMessage,
950 pSetupData->szAbortTitle,
952 {
953 /* Go to the Terminate page */
955 }
956
957 /* Do not close the wizard too soon */
959 return TRUE;
960 }
961
962 default:
963 break;
964 }
965 break;
966 }
967
968 default:
969 break;
970 }
971
972 return FALSE;
973}
974
975
976typedef struct _COPYCONTEXT
977{
984
985static UINT
989 UINT_PTR Param1,
990 UINT_PTR Param2)
991{
992 PCOPYCONTEXT CopyContext = (PCOPYCONTEXT)Context;
993 PFILEPATHS_W FilePathInfo;
994 PCWSTR SrcFileName, DstFileName;
995 WCHAR Status[1024];
996
998 if (CopyContext->pSetupData->bStopInstall)
999 return FILEOP_ABORT; // Stop committing files
1000
1001 switch (Notification)
1002 {
1004 {
1005 CopyContext->TotalOperations = (ULONG)Param2;
1006 CopyContext->CompletedOperations = 0;
1007
1008 SendMessageW(CopyContext->hWndProgress,
1009 PBM_SETRANGE, 0,
1010 MAKELPARAM(0, CopyContext->TotalOperations));
1011 SendMessageW(CopyContext->hWndProgress,
1012 PBM_SETSTEP, 1, 0);
1013 break;
1014 }
1015
1019 {
1020 FilePathInfo = (PFILEPATHS_W)Param1;
1021
1023 {
1024 /* Display delete message */
1025 ASSERT(Param2 == FILEOP_DELETE);
1026
1027 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1028 if (DstFileName) ++DstFileName;
1029 else DstFileName = FilePathInfo->Target;
1030
1031 // STRING_DELETING
1032 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Deleting %s", DstFileName);
1033 SetWindowTextW(CopyContext->hWndItem, Status);
1034 }
1036 {
1037 /* Display move/rename message */
1038 ASSERT(Param2 == FILEOP_RENAME);
1039
1040 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1041 if (SrcFileName) ++SrcFileName;
1042 else SrcFileName = FilePathInfo->Source;
1043
1044 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1045 if (DstFileName) ++DstFileName;
1046 else DstFileName = FilePathInfo->Target;
1047
1048 // STRING_MOVING or STRING_RENAMING
1049 if (!wcsicmp(SrcFileName, DstFileName))
1050 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Moving %s to %s", SrcFileName, DstFileName);
1051 else
1052 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Renaming %s to %s", SrcFileName, DstFileName);
1053
1054 SetWindowTextW(CopyContext->hWndItem, Status);
1055 }
1057 {
1058 /* Display copy message */
1059 ASSERT(Param2 == FILEOP_COPY);
1060
1061 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1062 if (DstFileName) ++DstFileName;
1063 else DstFileName = FilePathInfo->Target;
1064
1065 // STRING_COPYING
1066 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Copying %s", DstFileName);
1067 SetWindowTextW(CopyContext->hWndItem, Status);
1068 }
1069 break;
1070 }
1071
1075 {
1076 CopyContext->CompletedOperations++;
1077
1078 /* SYSREG checkpoint */
1079 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1080 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1081
1082 SendMessageW(CopyContext->hWndProgress, PBM_STEPIT, 0, 0);
1083 break;
1084 }
1085 }
1086
1087 return FILEOP_DOIT;
1088}
1089
1090static DWORD
1091WINAPI
1093 IN LPVOID Param)
1094{
1095 PSETUPDATA pSetupData;
1096 HWND hwndDlg = (HWND)Param;
1097 HWND hWndProgress;
1098 LONG_PTR dwStyle;
1099 // ERROR_NUMBER ErrorNumber;
1101 COPYCONTEXT CopyContext;
1102
1103 /* Retrieve pointer to the global setup data */
1104 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1105
1106 /* Get the progress handle */
1107 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1108
1109
1110 /*
1111 * Preparation of the list of files to be copied
1112 */
1113
1114 /* Set status text */
1115 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Preparing the list of files to be copied, please wait...");
1116 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1117
1118 /* Set progress marquee style */
1119 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
1120 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
1121
1122 /* Start it up */
1123 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
1124
1125 /* Prepare the list of files */
1126 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
1127 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
1128 {
1129 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1130 if (!pSetupData->bStopInstall)
1131 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the list of files!", L"Error", MB_ICONERROR);
1132
1133 /* Stop it */
1134 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1135
1136 /* Restore progress style */
1137 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1138
1139 /*
1140 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1141 * but enable the "Next" button to allow the user to continue to the terminate page.
1142 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1143 */
1144 if (!pSetupData->bStopInstall)
1146 return 1;
1147 }
1148
1149 /* Stop it */
1150 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1151
1152 /* Restore progress style */
1153 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1154
1155
1156 /*
1157 * Perform the file copy
1158 */
1159
1160 /* Set status text */
1161 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Copying the files...");
1162 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1163
1164 /* Create context for the copy process */
1165 CopyContext.pSetupData = pSetupData;
1166 CopyContext.hWndItem = GetDlgItem(hwndDlg, IDC_ITEM);
1167 CopyContext.hWndProgress = hWndProgress;
1168 CopyContext.TotalOperations = 0;
1169 CopyContext.CompletedOperations = 0;
1170
1171 /* Do the file copying - The callback handles whether or not we should stop file copying */
1172 if (!DoFileCopy(&pSetupData->USetupData, FileCopyCallback, &CopyContext))
1173 {
1174 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1175 if (!pSetupData->bStopInstall)
1176 MessageBoxW(GetParent(hwndDlg), L"Failed to copy the files!", L"Error", MB_ICONERROR);
1177
1178 /*
1179 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1180 * but enable the "Next" button to allow the user to continue to the terminate page.
1181 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1182 */
1183 if (!pSetupData->bStopInstall)
1185 return 1;
1186 }
1187
1188 /* Set status text */
1189 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Finalizing the installation...");
1190 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1191
1192 /* Create the $winnt$.inf file */
1193 InstallSetupInfFile(&pSetupData->USetupData);
1194
1195 /* We are done! Switch to the Terminate page */
1197 return 0;
1198}
1199
1200
1201static INT_PTR CALLBACK
1203 IN HWND hwndDlg,
1204 IN UINT uMsg,
1207{
1208 PSETUPDATA pSetupData;
1209
1210 /* Retrieve pointer to the global setup data */
1211 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1212
1213 switch (uMsg)
1214 {
1215 case WM_INITDIALOG:
1216 {
1217 /* Save pointer to the global setup data */
1218 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1219 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1220
1221 /* Reset status text */
1222 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
1223 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1224
1225 break;
1226 }
1227
1228 case WM_NOTIFY:
1229 {
1230 LPNMHDR lpnm = (LPNMHDR)lParam;
1231
1232 switch (lpnm->code)
1233 {
1234 case PSN_SETACTIVE:
1235 {
1236 /* Create the file-copy halt (manual-reset) event */
1237 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
1238 if (!pSetupData->hHaltInstallEvent)
1239 break;
1240 pSetupData->bStopInstall = FALSE;
1241
1242 /* Start the prepare-and-copy files thread */
1243 pSetupData->hInstallThread =
1244 CreateThread(NULL, 0,
1246 (PVOID)hwndDlg,
1248 NULL);
1249 if (!pSetupData->hInstallThread)
1250 {
1251 CloseHandle(pSetupData->hHaltInstallEvent);
1252 pSetupData->hHaltInstallEvent = NULL;
1253
1254 MessageBoxW(GetParent(hwndDlg), L"Cannot create the prepare-and-copy files thread!", L"Error", MB_ICONERROR);
1255 break;
1256 }
1257
1258 /* Disable all buttons during installation process - buttons will be reenabled by the installation thread */
1260
1261 /* Resume the installation thread */
1262 ResumeThread(pSetupData->hInstallThread);
1263
1264 break;
1265 }
1266
1267 case PSN_QUERYCANCEL:
1268 {
1269 /* Halt the on-going file copy */
1270 ResetEvent(pSetupData->hHaltInstallEvent);
1271
1272 if (MessageBoxW(GetParent(hwndDlg),
1273 pSetupData->szAbortMessage,
1274 pSetupData->szAbortTitle,
1276 {
1277 /* Stop the file copy thread */
1278 pSetupData->bStopInstall = TRUE;
1279 SetEvent(pSetupData->hHaltInstallEvent);
1280
1281#if 0
1282 /* Wait for any pending installation */
1284 CloseHandle(pSetupData->hInstallThread);
1285 pSetupData->hInstallThread = NULL;
1286 CloseHandle(pSetupData->hHaltInstallEvent);
1287 pSetupData->hHaltInstallEvent = NULL;
1288#endif
1289
1290 // TODO: Unwind installation?!
1291
1292 /* Go to the Terminate page */
1294 }
1295 else
1296 {
1297 /* We don't stop installation, resume file copy */
1298 SetEvent(pSetupData->hHaltInstallEvent);
1299 }
1300
1301 /* Do not close the wizard too soon */
1303 return TRUE;
1304 }
1305
1306 default:
1307 break;
1308 }
1309 }
1310 break;
1311
1312 default:
1313 break;
1314
1315 }
1316
1317 return FALSE;
1318}
1319
1320static INT_PTR CALLBACK
1322 IN HWND hwndDlg,
1323 IN UINT uMsg,
1326{
1327 PSETUPDATA pSetupData;
1328
1329 /* Retrieve pointer to the global setup data */
1330 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1331
1332 switch (uMsg)
1333 {
1334 case WM_INITDIALOG:
1335 /* Save pointer to the global setup data */
1336 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1337 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1338
1339 /* Set title font */
1340 SendDlgItemMessage(hwndDlg,
1342 WM_SETFONT,
1343 (WPARAM)pSetupData->hTitleFont,
1344 (LPARAM)TRUE);
1345 break;
1346
1347 case WM_TIMER:
1348 {
1349 INT Position;
1350 HWND hWndProgress;
1351
1352 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
1353 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
1354 if (Position == 300)
1355 {
1356 KillTimer(hwndDlg, 1);
1358 }
1359 else
1360 {
1361 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
1362 }
1363 return TRUE;
1364 }
1365
1366 case WM_DESTROY:
1367 return TRUE;
1368
1369 case WM_NOTIFY:
1370 {
1371 LPNMHDR lpnm = (LPNMHDR)lParam;
1372
1373 switch (lpnm->code)
1374 {
1375 case PSN_SETACTIVE:
1376 {
1377 /* Only "Finish" for closing the wizard */
1380
1381 /* Set up the reboot progress bar */
1384 SetTimer(hwndDlg, 1, 50, NULL);
1385 break;
1386 }
1387
1388 default:
1389 break;
1390 }
1391 }
1392 break;
1393
1394 default:
1395 break;
1396
1397 }
1398
1399 return FALSE;
1400}
1401
1403 IN OUT PSETUPDATA pSetupData)
1404{
1405 pSetupData->PartitionList = CreatePartitionList();
1406 if (!pSetupData->PartitionList)
1407 {
1408 DPRINT1("Could not enumerate available disks; failing installation\n");
1409 return FALSE;
1410 }
1411
1412 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
1413 if (!pSetupData->NtOsInstallsList)
1414 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
1415
1416 /* Load the hardware, language and keyboard layout lists */
1417
1418 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
1419 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
1420 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
1421
1422 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
1423
1424 /* If not unattended, overwrite language and locale with
1425 * the current ones of the running ReactOS instance */
1426 if (!IsUnattendedSetup)
1427 {
1428 LCID LocaleID = GetUserDefaultLCID();
1429
1430 StringCchPrintfW(pSetupData->DefaultLanguage,
1431 _countof(pSetupData->DefaultLanguage),
1432 L"%08lx", LocaleID);
1433
1434 StringCchPrintfW(pSetupData->USetupData.LocaleID,
1435 _countof(pSetupData->USetupData.LocaleID),
1436 L"%08lx", LocaleID);
1437 }
1438
1439 /* new part */
1440 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
1441 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
1442 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
1443
1444 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
1445 pSetupData->SelectedLanguageId,
1446 pSetupData->DefaultKBLayout);
1447
1448 /* If not unattended, overwrite keyboard layout with
1449 * the current one of the running ReactOS instance */
1450 if (!IsUnattendedSetup)
1451 {
1452 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
1453 /* If the call fails, keep the default already stored in the buffer */
1454 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
1455 }
1456
1457 /* Change the default entries in the language and keyboard layout lists */
1458 {
1459 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
1460 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
1461 PGENERIC_LIST_ENTRY ListEntry;
1462
1463 /* Search for default language */
1464 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
1465 ListEntry = GetNextListEntry(ListEntry))
1466 {
1467 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
1468 if (!wcsicmp(pSetupData->DefaultLanguage, LocaleId))
1469 {
1470 DPRINT("found %S in LanguageList\n", LocaleId);
1471 SetCurrentListEntry(LanguageList, ListEntry);
1472 break;
1473 }
1474 }
1475
1476 /* Search for default layout */
1477 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
1478 ListEntry = GetNextListEntry(ListEntry))
1479 {
1480 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
1481 if (!wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
1482 {
1483 DPRINT("Found %S in LayoutList\n", pszLayoutId);
1484 SetCurrentListEntry(LayoutList, ListEntry);
1485 break;
1486 }
1487 }
1488 }
1489
1490 return TRUE;
1491}
1492
1493VOID
1496{
1497 InitializeListHead(&MappingList->List);
1498 MappingList->MappingsCount = 0;
1499}
1500
1501VOID
1504{
1505 PLIST_ENTRY ListEntry;
1506 PVOID Entry;
1507
1508 while (!IsListEmpty(&MappingList->List))
1509 {
1510 ListEntry = RemoveHeadList(&MappingList->List);
1511 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
1513 }
1514
1515 MappingList->MappingsCount = 0;
1516}
1517
1518/*
1519 * Attempts to convert a pure NT file path into a corresponding Win32 path.
1520 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
1521 */
1522BOOL
1525 OUT PWSTR pwszPath,
1526 IN DWORD cchPathMax,
1527 IN PCWSTR pwszNTPath)
1528{
1529 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
1530 PLIST_ENTRY ListEntry;
1532 PCWSTR pwszNtPathToMap = pwszNTPath;
1533 PCWSTR pwszRemaining = NULL;
1534 DWORD cchDrives;
1535 PWCHAR pwszDrive;
1536 WCHAR wszDrives[512];
1537 WCHAR wszNTPath[MAX_PATH];
1538 WCHAR TargetPath[MAX_PATH];
1539
1540 *pwszPath = UNICODE_NULL;
1541
1542 /*
1543 * We find first a mapping inside the MappingList. If one is found, use it
1544 * to build the Win32 path. If there is none, we need to create one by
1545 * checking the Win32 drives (and possibly NT symlinks too).
1546 * In case of success, add the newly found mapping to the list and use it
1547 * to build the Win32 path.
1548 */
1549
1550 for (ListEntry = MappingList->List.Flink;
1551 ListEntry != &MappingList->List;
1552 ListEntry = ListEntry->Flink)
1553 {
1554 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
1555
1556 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
1557
1558 /* Check whether the queried NT path prefixes the user-provided NT path */
1559 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
1560 if (FoundDrive)
1561 {
1562 /* Found it! */
1563
1564 /* Set the pointers and go build the Win32 path */
1565 pwszDrive = Entry->Win32Path;
1566 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
1567 goto Quit;
1568 }
1569 }
1570
1571 /*
1572 * No mapping exists for this path yet: try to find one now.
1573 */
1574
1575 /* Retrieve the mounted drives (available drive letters) */
1576 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
1577 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
1578 {
1579 /* Buffer too small or failure */
1580 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
1581 return FALSE;
1582 }
1583
1584/* We go back there once if RetryOnce == TRUE */
1585Retry:
1586
1587 /* Enumerate the mounted drives */
1588 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
1589 {
1590 /* Retrieve the NT path corresponding to the current Win32 DOS path */
1591 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
1592 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
1593 pwszDrive[2] = L'\\'; // Restore the backslash
1594
1595 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
1596
1597 /* Check whether the queried NT path prefixes the user-provided NT path */
1598 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1599 if (!FoundDrive)
1600 {
1601 PWCHAR ptr, ptr2;
1602
1603 /*
1604 * Check whether this was a network share that has a drive letter,
1605 * but the user-provided NT path points to this share without
1606 * mentioning the drive letter.
1607 *
1608 * The format is: \Device<network_redirector>\;X:<data>\share\path
1609 * The corresponding drive letter is 'X'.
1610 * A system-provided network redirector (LanManRedirector or Mup)
1611 * or a 3rd-party one may be used.
1612 *
1613 * We check whether the user-provided NT path has the form:
1614 * \Device<network_redirector><data>\share\path
1615 * as it obviously did not have the full form (the previous check
1616 * would have been OK otherwise).
1617 */
1618 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
1619 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
1620 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
1621 {
1622 /*
1623 * Normally the specified drive letter should correspond
1624 * to the one used for the mapping. But we will ignore
1625 * if it happens not to be the case.
1626 */
1627 if (pwszDrive[0] != ptr[1])
1628 {
1629 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
1630 pwszDrive[0], ptr[1]);
1631 }
1632
1633 /* Remove the drive letter from the NT network share path */
1634 ptr2 = ptr + 3;
1635 /* Swallow as many possible consecutive backslashes as there could be */
1636 while (*ptr2 == L'\\') ++ptr2;
1637
1638 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
1639
1640 /* Now do the check again */
1641 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1642 }
1643 }
1644 if (FoundDrive)
1645 {
1646 /* Found it! */
1647
1648 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
1649
1650 if (pwszNtPathToMap == pwszNTPath)
1651 {
1652 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
1653 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
1654 }
1655 break;
1656 }
1657 }
1658
1659 if (FoundDrive)
1660 {
1661 /* A mapping was found, add it to the cache */
1663 if (!Entry)
1664 {
1665 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
1666 return FALSE;
1667 }
1668 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
1669 pwszNTPath, pwszRemaining - pwszNTPath);
1670 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
1671
1672 /* Insert it as the most recent entry */
1673 InsertHeadList(&MappingList->List, &Entry->ListEntry);
1674 MappingList->MappingsCount++;
1675
1676 /* Set the pointers and go build the Win32 path */
1677 pwszDrive = Entry->Win32Path;
1678 goto Quit;
1679 }
1680
1681 /*
1682 * We failed, perhaps because the beginning of the NT path used a symlink.
1683 * Try to see whether this is the case by attempting to resolve it.
1684 * If the symlink resolution gives nothing, or we already failed once,
1685 * there is no hope in converting the path to Win32.
1686 * Otherwise, symlink resolution succeeds but we need to recheck again
1687 * the drives list.
1688 */
1689
1690 /*
1691 * In theory we would have to parse each element in the NT path and going
1692 * until finding a symlink object (otherwise we would fail straight away).
1693 * However here we can use guessing instead, since we know which kind of
1694 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
1695 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
1696 * are supported in setuplib\utils\arcname.c .
1697 *
1698 * But actually, all the supported names in arcname.c are real devices,
1699 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
1700 * just check for it.
1701 */
1702 if (!RetryOnce && !FoundDrive)
1703 {
1704 ULONG DiskNumber, PartitionNumber;
1705 INT Length;
1706
1709 HANDLE LinkHandle;
1710 UNICODE_STRING SymLink, Target;
1711
1712 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
1713 &DiskNumber, &PartitionNumber, &Length) != 2)
1714 {
1715 /* Definitively not a recognized path, bail out */
1716 return FALSE;
1717 }
1718
1719 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
1720 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
1721 SymLink.Length = SymLink.MaximumLength;
1722
1724 &SymLink,
1726 NULL,
1727 NULL);
1728 Status = NtOpenSymbolicLinkObject(&LinkHandle,
1731 if (!NT_SUCCESS(Status))
1732 {
1733 /* Not a symlink, or something else happened: bail out */
1734 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1735 &SymLink, Status);
1736 return FALSE;
1737 }
1738
1739 *TargetPath = UNICODE_NULL;
1740 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
1741
1742 /* Resolve the link and close its handle */
1744 NtClose(LinkHandle);
1745
1746 /* Check for success */
1747 if (!NT_SUCCESS(Status))
1748 {
1749 /* Not a symlink, or something else happened: bail out */
1750 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1751 &SymLink, Status);
1752 return FALSE;
1753 }
1754
1755 /* Set the pointers */
1756 pwszRemaining = pwszNTPath + Length;
1757 pwszNtPathToMap = TargetPath; // Point to our local buffer
1758
1759 /* Retry once */
1760 RetryOnce = TRUE;
1761 goto Retry;
1762 }
1763
1764 ASSERT(!FoundDrive);
1765
1766Quit:
1767 if (FoundDrive)
1768 {
1769 StringCchPrintfW(pwszPath, cchPathMax,
1770 L"%s%s",
1771 pwszDrive,
1772 pwszRemaining);
1773 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
1774 return TRUE;
1775 }
1776
1777 return FALSE;
1778}
1779
1780/* Used to enable and disable the shutdown privilege */
1781/* static */ BOOL
1783 IN LPCWSTR lpszPrivilegeName,
1784 IN BOOL bEnablePrivilege)
1785{
1786 BOOL Success;
1787 HANDLE hToken;
1789
1792 &hToken);
1793 if (!Success) return Success;
1794
1796 lpszPrivilegeName,
1797 &tp.Privileges[0].Luid);
1798 if (!Success) goto Quit;
1799
1800 tp.PrivilegeCount = 1;
1801 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
1802
1803 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
1804
1805Quit:
1806 CloseHandle(hToken);
1807 return Success;
1808}
1809
1810/* Copied from HotkeyThread() in dll/win32/syssetup/install.c */
1811static DWORD CALLBACK
1813{
1814 ATOM hotkey;
1815 MSG msg;
1816
1817 DPRINT("HotkeyThread start\n");
1818
1819 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
1820
1821 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
1822 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
1823
1824 while (GetMessageW(&msg, NULL, 0, 0))
1825 {
1826 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
1827 {
1828 STARTUPINFOW si = { sizeof(si) };
1830
1831 if (CreateProcessW(L"cmd.exe",
1832 NULL,
1833 NULL,
1834 NULL,
1835 FALSE,
1837 NULL,
1838 NULL,
1839 &si,
1840 &pi))
1841 {
1842 CloseHandle(pi.hProcess);
1843 CloseHandle(pi.hThread);
1844 }
1845 else
1846 {
1847 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
1848 }
1849 }
1850 }
1851
1852 UnregisterHotKey(NULL, hotkey);
1853 GlobalDeleteAtom(hotkey);
1854
1855 DPRINT("HotkeyThread terminate\n");
1856 return 0;
1857}
1858
1859int WINAPI
1861 HINSTANCE hPrevInstance,
1862 LPTSTR lpszCmdLine,
1863 int nCmdShow)
1864{
1865 ULONG Error;
1866 HANDLE hHotkeyThread;
1868 PROPSHEETHEADER psh;
1869 HPROPSHEETPAGE ahpsp[8];
1870 PROPSHEETPAGE psp = {0};
1871 UINT nPages = 0;
1872
1874
1879
1880 /* Initialize the NT to Win32 path prefix mapping list */
1882
1883 /* Initialize Setup, phase 0 */
1885
1886 /* Initialize Setup, phase 1 */
1888 if (Error != ERROR_SUCCESS)
1889 {
1890 //
1891 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
1892 //
1894 MessageBoxW(NULL, L"GetSourcePaths failed!", L"Error", MB_ICONERROR);
1895 else if (Error == ERROR_LOAD_TXTSETUPSIF)
1897 else // FIXME!!
1898 MessageBoxW(NULL, L"Unknown error!", L"Error", MB_ICONERROR);
1899
1900 goto Quit;
1901 }
1902
1903 /* Retrieve any supplemental options from the unattend file */
1905 SetupData.bUnattend = IsUnattendedSetup; // FIXME :-)
1906
1907 /* Load extra setup data (HW lists etc...) */
1908 if (!LoadSetupData(&SetupData))
1909 goto Quit;
1910
1911 hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
1912
1913 /* Cache commonly-used strings */
1916
1917 /* Whenever any of the common controls are used in your app,
1918 * you must call InitCommonControlsEx() to register the classes
1919 * for those controls. */
1920 iccx.dwSize = sizeof(iccx);
1922 InitCommonControlsEx(&iccx);
1923
1924 /* Register the TreeList control */
1925 // RegisterTreeListClass(hInst);
1927
1928 /* Create title font */
1930
1931 if (!SetupData.bUnattend)
1932 {
1933 /* Create the Start page, until setup is working */
1934 // NOTE: What does "until setup is working" mean??
1935 psp.dwSize = sizeof(PROPSHEETPAGE);
1936 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
1937 psp.hInstance = hInst;
1938 psp.lParam = (LPARAM)&SetupData;
1939 psp.pfnDlgProc = StartDlgProc;
1940 psp.pszTemplate = MAKEINTRESOURCEW(IDD_STARTPAGE);
1941 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1942
1943 /* Create the install type selection page */
1944 psp.dwSize = sizeof(PROPSHEETPAGE);
1945 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
1946 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
1947 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
1948 psp.hInstance = hInst;
1949 psp.lParam = (LPARAM)&SetupData;
1950 psp.pfnDlgProc = TypeDlgProc;
1951 psp.pszTemplate = MAKEINTRESOURCEW(IDD_TYPEPAGE);
1952 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1953
1954 /* Create the upgrade/repair selection page */
1955 psp.dwSize = sizeof(PROPSHEETPAGE);
1956 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
1957 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
1958 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
1959 psp.hInstance = hInst;
1960 psp.lParam = (LPARAM)&SetupData;
1961 psp.pfnDlgProc = UpgradeRepairDlgProc;
1962 psp.pszTemplate = MAKEINTRESOURCEW(IDD_UPDATEREPAIRPAGE);
1963 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1964
1965 /* Create the device settings page */
1966 psp.dwSize = sizeof(PROPSHEETPAGE);
1967 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
1968 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DEVICETITLE);
1969 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DEVICESUBTITLE);
1970 psp.hInstance = hInst;
1971 psp.lParam = (LPARAM)&SetupData;
1972 psp.pfnDlgProc = DeviceDlgProc;
1973 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DEVICEPAGE);
1974 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1975
1976 /* Create the install device settings page / boot method / install directory */
1977 psp.dwSize = sizeof(PROPSHEETPAGE);
1978 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
1979 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DRIVETITLE);
1980 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DRIVESUBTITLE);
1981 psp.hInstance = hInst;
1982 psp.lParam = (LPARAM)&SetupData;
1983 psp.pfnDlgProc = DriveDlgProc;
1984 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DRIVEPAGE);
1985 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1986
1987 /* Create the summary page */
1988 psp.dwSize = sizeof(PROPSHEETPAGE);
1989 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
1990 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_SUMMARYTITLE);
1991 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_SUMMARYSUBTITLE);
1992 psp.hInstance = hInst;
1993 psp.lParam = (LPARAM)&SetupData;
1994 psp.pfnDlgProc = SummaryDlgProc;
1995 psp.pszTemplate = MAKEINTRESOURCEW(IDD_SUMMARYPAGE);
1996 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
1997 }
1998
1999 /* Create the installation progress page */
2000 psp.dwSize = sizeof(PROPSHEETPAGE);
2001 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2002 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_PROCESSTITLE);
2003 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_PROCESSSUBTITLE);
2004 psp.hInstance = hInst;
2005 psp.lParam = (LPARAM)&SetupData;
2006 psp.pfnDlgProc = ProcessDlgProc;
2007 psp.pszTemplate = MAKEINTRESOURCEW(IDD_PROCESSPAGE);
2008 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2009
2010 /* Create the finish-and-reboot page */
2011 psp.dwSize = sizeof(PROPSHEETPAGE);
2012 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2013 psp.hInstance = hInst;
2014 psp.lParam = (LPARAM)&SetupData;
2015 psp.pfnDlgProc = RestartDlgProc;
2016 psp.pszTemplate = MAKEINTRESOURCEW(IDD_RESTARTPAGE);
2017 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2018
2019 /* Create the property sheet */
2020 psh.dwSize = sizeof(PROPSHEETHEADER);
2021 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
2022 psh.hInstance = hInst;
2023 psh.hwndParent = NULL;
2024 psh.nPages = nPages;
2025 psh.nStartPage = 0;
2026 psh.phpage = ahpsp;
2027 psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_WATERMARK);
2028 psh.pszbmHeader = MAKEINTRESOURCEW(IDB_HEADER);
2029
2030 /* Display the wizard */
2031 PropertySheet(&psh);
2032
2033 /* Wait for any pending installation */
2039
2042
2043 /* Unregister the TreeList control */
2044 // UnregisterTreeListClass(hInst);
2046
2047 if (hHotkeyThread)
2048 {
2049 PostThreadMessageW(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
2050 CloseHandle(hHotkeyThread);
2051 }
2052
2053Quit:
2054 /* Setup has finished */
2056
2057 /* Free the NT to Win32 path prefix mapping list */
2059
2060#if 0 // NOTE: Disabled for testing purposes only!
2064#endif
2065
2066 return 0;
2067}
2068
2069/* EOF */
DWORD Id
unsigned char BOOLEAN
static HWND hWndList[5+1]
Definition: SetParent.c:10
#define VOID
Definition: acefi.h:82
#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
HFONT hFont
Definition: main.c:53
BOOLEAN DoFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PSP_FILE_CALLBACK_W MsgHandler, IN PVOID Context OPTIONAL)
Definition: install.c:826
BOOLEAN PrepareFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL)
Definition: install.c:684
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
static HFONT CreateTitleFont(VOID)
Definition: reactos.c:71
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:48
static INT_PTR CALLBACK ProcessDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1202
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:432
struct _COPYCONTEXT * PCOPYCONTEXT
static INT_PTR CALLBACK TypeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:165
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:524
static INT_PTR CALLBACK RestartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1321
#define MAX_LIST_COLUMNS
Definition: reactos.c:522
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1523
HANDLE ProcessHeap
Definition: reactos.c:40
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:1402
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:525
static INT_PTR CALLBACK UpgradeRepairDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:528
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:374
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:395
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:1502
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:297
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:452
#define IDS_LIST_COLUMN_FIRST
Definition: reactos.c:519
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:387
static INT_PTR CALLBACK DeviceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:714
static INT_PTR CALLBACK SummaryDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:817
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:1494
VOID(NTAPI * PGET_ENTRY_DESCRIPTION)(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:330
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:463
BOOLEAN IsUnattendedSetup
Definition: reactos.c:41
static INT_PTR CALLBACK StartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:109
SETUPDATA SetupData
Definition: reactos.c:42
struct _COPYCONTEXT COPYCONTEXT
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:1812
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:1782
INT DisplayError(IN HWND hParentWnd OPTIONAL, IN UINT uIDTitle, IN UINT uIDMessage)
Definition: reactos.c:95
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:523
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:336
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1092
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:987
#define ID_WIZNEXT
Definition: reactos.h:53
struct _SETUPDATA * PSETUPDATA
#define IDC_KEYBOARD
Definition: resource.h:34
#define IDS_TYPETITLE
Definition: resource.h:78
#define IDD_DRIVEPAGE
Definition: resource.h:37
#define IDS_DRIVESUBTITLE
Definition: resource.h:83
#define IDS_PROCESSSUBTITLE
Definition: resource.h:85
#define IDS_TYPESUBTITLE
Definition: resource.h:79
#define IDC_COMPUTER
Definition: resource.h:32
#define IDI_WINICON
Definition: resource.h:10
#define IDS_PROCESSTITLE
Definition: resource.h:84
#define IDC_UPDATE
Definition: resource.h:24
#define IDD_RESTARTPAGE
Definition: resource.h:59
#define IDI_ROSICON
Definition: resource.h:9
#define IDC_UPDATETEXT
Definition: resource.h:25
#define IDS_CAPTION
Definition: resource.h:93
#define IDC_PROCESSPROGRESS
Definition: resource.h:57
#define IDS_DEVICETITLE
Definition: resource.h:80
#define IDD_SUMMARYPAGE
Definition: resource.h:43
#define IDS_DRIVETITLE
Definition: resource.h:82
#define IDC_FINISHTITLE
Definition: resource.h:60
#define IDC_CONFIRM_INSTALL
Definition: resource.h:52
#define IDC_SKIPUPGRADE
Definition: resource.h:29
#define IDB_WATERMARK
Definition: resource.h:4
#define IDC_ARCHITECTURE
Definition: resource.h:46
#define IDC_PATH
Definition: resource.h:65
#define IDC_NTOSLIST
Definition: resource.h:28
#define IDD_PROCESSPAGE
Definition: resource.h:54
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:92
#define IDC_ACTIVITY
Definition: resource.h:55
#define IDD_UPDATEREPAIRPAGE
Definition: resource.h:27
#define IDC_ITEM
Definition: resource.h:56
#define IDS_SUMMARYTITLE
Definition: resource.h:90
#define IDS_DEVICESUBTITLE
Definition: resource.h:81
#define IDS_SUMMARYSUBTITLE
Definition: resource.h:91
#define IDS_ABORTSETUP2
Definition: resource.h:89
#define IDC_DESTDRIVE
Definition: resource.h:50
#define IDD_TYPEPAGE
Definition: resource.h:21
#define IDC_INSTALLTYPE
Definition: resource.h:44
#define IDC_STARTTITLE
Definition: resource.h:19
#define IDC_INSTALLSOURCE
Definition: resource.h:45
#define IDC_RESTART_PROGRESS
Definition: resource.h:61
#define IDD_DEVICEPAGE
Definition: resource.h:31
#define IDS_ABORTSETUP
Definition: resource.h:88
#define IDD_STARTPAGE
Definition: resource.h:18
BOOL Error
Definition: chkdsk.c:66
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:893
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#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:32
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetProcessHeap()
Definition: compat.h:736
#define wcsrchr
Definition: compat.h:16
HANDLE HWND
Definition: compat.h:19
#define HeapAlloc
Definition: compat.h:733
#define GetCurrentProcess()
Definition: compat.h:759
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define wcsicmp
Definition: compat.h:15
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
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:4592
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:1210
INT_PTR CALLBACK DriveDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drivepage.c:613
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
#define INFINITE
Definition: serial.h:102
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
@ ERROR_LOAD_TXTSETUPSIF
Definition: errorcode.h:24
@ ERROR_NO_SOURCE_DRIVE
Definition: errorcode.h:23
@ Success
Definition: eventcreate.c:712
#define SPFILENOTIFY_ENDDELETE
Definition: fileqsup.h:28
#define FILEOP_COPY
Definition: fileqsup.h:42
struct _FILEPATHS_W * PFILEPATHS_W
#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 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
#define IDC_INSTALL
Definition: fontview.h:13
pKey DeleteObject()
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_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define _tcscpy
Definition: tchar.h:623
#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
VOID SetCurrentListEntry(IN PGENERIC_LIST List, IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:87
PGENERIC_LIST_ENTRY GetFirstListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:104
PGENERIC_LIST_ENTRY GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:97
ULONG GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:140
PVOID GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:126
PGENERIC_LIST_ENTRY GetNextListEntry(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:114
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:92
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
unsigned int UINT
Definition: ndis.h:50
#define SYMBOLIC_LINK_QUERY
Definition: nt_native.h:1265
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
PGENERIC_LIST CreateNTOSInstallationsList(IN PPARTLIST PartList)
Definition: osdetect.c:778
#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:2299
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2687
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2673
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2726
#define PBM_SETSTEP
Definition: commctrl.h:2186
#define PBM_GETPOS
Definition: commctrl.h:2194
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define PBS_MARQUEE
Definition: commctrl.h:2198
#define LVIF_STATE
Definition: commctrl.h:2312
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2304
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define ListView_GetImageList(hwnd, iImageList)
Definition: commctrl.h:2296
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734
#define PBM_SETPOS
Definition: commctrl.h:2184
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define LVIS_SELECTED
Definition: commctrl.h:2319
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2789
#define LVITEM
Definition: commctrl.h:2375
#define PBM_STEPIT
Definition: commctrl.h:2187
#define LVIF_PARAM
Definition: commctrl.h:2311
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVCF_FMT
Definition: commctrl.h:2586
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define LVIF_IMAGE
Definition: commctrl.h:2310
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
#define LVM_INSERTITEMW
Definition: commctrl.h:2404
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVIS_FOCUSED
Definition: commctrl.h:2318
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2394
#define PBM_SETMARQUEE
Definition: commctrl.h:2199
#define LVCOLUMN
Definition: commctrl.h:2581
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2519
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define WM_NOTIFY
Definition: richedit.h:61
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_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)
DWORD LCID
Definition: nls.h:13
PPARTLIST CreatePartitionList(VOID)
Definition: partlist.c:1867
VOID FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:857
VOID CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:28
VOID InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:214
ERROR_NUMBER InitializeSetup(IN OUT PUSETUP_DATA pSetupData, IN ULONG InitPhase)
Definition: setuplib.c:780
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
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 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
base of all file and directory entries
Definition: entries.h:83
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
HWND hWndProgress
Definition: reactos.c:980
HWND hWndItem
Definition: reactos.c:979
ULONG TotalOperations
Definition: reactos.c:981
ULONG CompletedOperations
Definition: reactos.c:982
PSETUPDATA pSetupData
Definition: reactos.c:978
PCWSTR Source
Definition: fileqsup.h:61
PCWSTR Target
Definition: fileqsup.h:60
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
PPARTENTRY PartEntry
Definition: osdetect.h:25
PCWSTR PathComponent
Definition: osdetect.h:22
WCHAR DriveLetter
Definition: partlist.h:58
USETUP_DATA USetupData
Definition: reactos.h:128
HINSTANCE hInstance
Definition: reactos.h:114
HFONT hTitleFont
Definition: reactos.h:117
BOOL bStopInstall
Definition: reactos.h:121
HANDLE hInstallThread
Definition: reactos.h:119
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:133
TCHAR szAbortMessage[512]
Definition: reactos.h:123
HANDLE hHaltInstallEvent
Definition: reactos.h:120
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:134
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
BOOLEAN RepairUpdateFlag
Definition: reactos.h:130
BOOL bUnattend
Definition: reactos.h:115
TCHAR szAbortTitle[64]
Definition: reactos.h:124
USHORT MaximumLength
Definition: env_spec_w32.h:370
PGENERIC_LIST DisplayList
Definition: setuplib.h:120
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:105
PGENERIC_LIST ComputerList
Definition: setuplib.h:119
UNICODE_STRING InstallPath
Definition: setuplib.h:108
PGENERIC_LIST KeyboardList
Definition: setuplib.h:121
Definition: tftpd.h:60
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
UINT uNewState
Definition: commctrl.h:3036
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
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
#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
#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 _T(x)
Definition: vfdio.h:22
_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_ 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:178
#define CREATE_NEW_CONSOLE
Definition: winbase.h:180
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:54
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
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:384
#define LB_ERR
Definition: winuser.h:2432
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define SW_HIDE
Definition: winuser.h:768
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define WM_QUIT
Definition: winuser.h:1623
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define KL_NAMELENGTH
Definition: winuser.h:122
#define IDCANCEL
Definition: winuser.h:831
#define VK_F10
Definition: winuser.h:2264
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:1740
#define CB_ERR
Definition: winuser.h:2435
#define CB_SETCURSEL
Definition: winuser.h:1961
#define SM_CYSMICON
Definition: winuser.h:1013
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define SWP_NOSIZE
Definition: winuser.h:1245
#define WM_INITDIALOG
Definition: winuser.h:1739
#define MB_YESNO
Definition: winuser.h:817
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)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define MB_ICONERROR
Definition: winuser.h:787
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1012
#define EWX_REBOOT
Definition: winuser.h:638
#define HWND_TOP
Definition: winuser.h:1207
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFONT
Definition: winuser.h:1650
#define WM_TIMER
Definition: winuser.h:1742
#define CB_ADDSTRING
Definition: winuser.h:1936
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define MB_OK
Definition: winuser.h:790
HWND WINAPI GetParent(_In_ HWND)
#define MB_ICONQUESTION
Definition: winuser.h:789
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define WM_HOTKEY
Definition: winuser.h:1879
#define BN_CLICKED
Definition: winuser.h:1925
#define WM_DESTROY
Definition: winuser.h:1609
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SystemParametersInfo
Definition: winuser.h:5858
#define SetWindowLongPtrW
Definition: winuser.h:5346
#define GWL_STYLE
Definition: winuser.h:852
#define SendDlgItemMessage
Definition: winuser.h:5842
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2106
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2061
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
__wchar_t WCHAR
Definition: xmlstorage.h:180
CHAR * LPTSTR
Definition: xmlstorage.h:192
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185