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