ReactOS 0.4.16-dev-91-g764881a
reactos.c File Reference
#include "reactos.h"
#include <winnls.h>
#include <ndk/obfuncs.h>
#include "resource.h"
#include <debug.h>
Include dependency graph for reactos.c:

Go to the source code of this file.

Classes

struct  _FSVOL_CONTEXT
 
struct  _COPYCONTEXT
 

Macros

#define NTOS_MODE_USER
 
#define NDEBUG
 
#define InstallVolume   (InstallPartition->Volume)
 
#define SystemVolume   (SystemPartition->Volume)
 
#define IDS_LIST_COLUMN_FIRST   IDS_INSTALLATION_NAME
 
#define IDS_LIST_COLUMN_LAST   IDS_INSTALLATION_VENDOR
 
#define MAX_LIST_COLUMNS   (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)
 

Typedefs

typedef VOID(NTAPIPGET_ENTRY_DESCRIPTION) (IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
 
typedef VOID(NTAPIPADD_ENTRY_ITEM) (IN HWND hWndList, IN LVITEM *plvItem, IN PGENERIC_LIST_ENTRY Entry, IN OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
 
typedef struct _FSVOL_CONTEXT FSVOL_CONTEXT
 
typedef struct _FSVOL_CONTEXTPFSVOL_CONTEXT
 
typedef struct _COPYCONTEXT COPYCONTEXT
 
typedef struct _COPYCONTEXTPCOPYCONTEXT
 

Functions

static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateTitleFont (VOID)
 
INT DisplayMessageV (_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
 
INT __cdecl DisplayMessage (_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
 
INT __cdecl DisplayError (_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
 
VOID SetWindowResTextW (_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
 
VOID SetWindowResPrintfVW (_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
 
VOID __cdecl SetWindowResPrintfW (_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
 
static INT_PTR CALLBACK StartDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK TypeDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
BOOL CreateListViewColumns (IN HINSTANCE hInstance, IN HWND hWndListView, IN const UINT *pIDs, IN const INT *pColsWidth, IN const INT *pColsAlign, IN UINT nNumOfColumns)
 
VOID InitGenericComboList (IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
 
PVOID GetSelectedComboListItem (IN HWND hWndList)
 
VOID InitGenericListView (IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
 
PVOID GetSelectedListViewItem (IN HWND hWndList)
 
static VOID NTAPI GetSettingDescription (IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
 
static VOID NTAPI AddNTOSInstallationItem (IN HWND hWndList, IN LVITEM *plvItem, IN PGENERIC_LIST_ENTRY Entry, IN OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
 
static INT_PTR CALLBACK UpgradeRepairDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK DeviceDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK SummaryDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static BOOLEAN NTAPI FormatCallback (_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
 
static BOOLEAN NTAPI ChkdskCallback (_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
 
static FSVOL_OP CALLBACK FsVolCallback (_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
 
static UINT CALLBACK FileCopyCallback (PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
 
static VOID __cdecl RegistryStatus (IN REGISTRY_STATUS RegStatus,...)
 
VOID PropSheet_SetCloseCancel (_In_ HWND hWndWiz, _In_ BOOL Enable)
 Enables or disables the Cancel and the Close title-bar property-sheet window buttons.
 
static DWORD WINAPI PrepareAndDoCopyThread (IN LPVOID Param)
 
static INT_PTR CALLBACK ProcessDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK RestartDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
BOOL LoadSetupData (IN OUT PSETUPDATA pSetupData)
 
VOID InitNtToWin32PathMappingList (IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
 
VOID FreeNtToWin32PathMappingList (IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
 
BOOL ConvertNtPathToWin32Path (IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
 
BOOL EnablePrivilege (IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
 
static DWORD CALLBACK HotkeyThread (LPVOID Parameter)
 
int WINAPI _tWinMain (HINSTANCE hInst, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
 

Variables

HANDLE ProcessHeap
 
BOOLEAN IsUnattendedSetup = FALSE
 
SETUPDATA SetupData
 
PPARTENTRY InstallPartition = NULL
 
PPARTENTRY SystemPartition = NULL
 
UI_CONTEXT UiContext
 
static const UINT column_ids [MAX_LIST_COLUMNS] = {IDS_LIST_COLUMN_FIRST, IDS_LIST_COLUMN_FIRST + 1, IDS_LIST_COLUMN_FIRST + 2}
 
static const INT column_widths [MAX_LIST_COLUMNS] = {200, 150, 100}
 
static const INT column_alignment [MAX_LIST_COLUMNS] = {LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT}
 

Macro Definition Documentation

◆ IDS_LIST_COLUMN_FIRST

#define IDS_LIST_COLUMN_FIRST   IDS_INSTALLATION_NAME

Definition at line 701 of file reactos.c.

◆ IDS_LIST_COLUMN_LAST

#define IDS_LIST_COLUMN_LAST   IDS_INSTALLATION_VENDOR

Definition at line 702 of file reactos.c.

◆ InstallVolume

#define InstallVolume   (InstallPartition->Volume)

Definition at line 47 of file reactos.c.

◆ MAX_LIST_COLUMNS

#define MAX_LIST_COLUMNS   (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)

Definition at line 704 of file reactos.c.

◆ NDEBUG

#define NDEBUG

Definition at line 35 of file reactos.c.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 30 of file reactos.c.

◆ SystemVolume

#define SystemVolume   (SystemPartition->Volume)

Definition at line 52 of file reactos.c.

Typedef Documentation

◆ COPYCONTEXT

◆ FSVOL_CONTEXT

◆ PADD_ENTRY_ITEM

typedef 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 at line 568 of file reactos.c.

◆ PCOPYCONTEXT

◆ PFSVOL_CONTEXT

◆ PGET_ENTRY_DESCRIPTION

typedef VOID(NTAPI * PGET_ENTRY_DESCRIPTION) (IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)

Definition at line 511 of file reactos.c.

Function Documentation

◆ _tWinMain()

int WINAPI _tWinMain ( HINSTANCE  hInst,
HINSTANCE  hPrevInstance,
LPTSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 2655 of file reactos.c.

2659{
2660 ULONG Error;
2661 HANDLE hHotkeyThread;
2663 PROPSHEETHEADER psh;
2664 HPROPSHEETPAGE ahpsp[8];
2665 PROPSHEETPAGE psp = {0};
2666 UINT nPages = 0;
2667
2669
2674
2675 /* Initialize the NT to Win32 path prefix mapping list */
2677
2678 /* Initialize Setup, phase 0 */
2680
2681 /* Initialize Setup, phase 1 */
2683 if (Error != ERROR_SUCCESS)
2684 {
2685 //
2686 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
2687 //
2689 MessageBoxW(NULL, L"GetSourcePaths failed!", L"Error", MB_ICONERROR);
2690 else if (Error == ERROR_LOAD_TXTSETUPSIF)
2692 else // FIXME!!
2693 MessageBoxW(NULL, L"Unknown error!", L"Error", MB_ICONERROR);
2694
2695 goto Quit;
2696 }
2697
2698 /* Retrieve any supplemental options from the unattend file */
2700 SetupData.bUnattend = IsUnattendedSetup; // FIXME :-)
2701
2702 /* Load extra setup data (HW lists etc...) */
2703 if (!LoadSetupData(&SetupData))
2704 goto Quit;
2705
2706 hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
2707
2708 /* Whenever any of the common controls are used in your app,
2709 * you must call InitCommonControlsEx() to register the classes
2710 * for those controls. */
2711 iccx.dwSize = sizeof(iccx);
2713 InitCommonControlsEx(&iccx);
2714
2715 /* Register the TreeList control */
2716 // RegisterTreeListClass(hInst);
2718
2719 /* Create title font */
2721
2722 if (!SetupData.bUnattend)
2723 {
2724 /* Create the Start page, until setup is working */
2725 // NOTE: What does "until setup is working" mean??
2726 psp.dwSize = sizeof(PROPSHEETPAGE);
2727 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2728 psp.hInstance = hInst;
2729 psp.lParam = (LPARAM)&SetupData;
2730 psp.pfnDlgProc = StartDlgProc;
2731 psp.pszTemplate = MAKEINTRESOURCEW(IDD_STARTPAGE);
2732 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2733
2734 /* Create the install type selection page */
2735 psp.dwSize = sizeof(PROPSHEETPAGE);
2736 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2737 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
2738 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
2739 psp.hInstance = hInst;
2740 psp.lParam = (LPARAM)&SetupData;
2741 psp.pfnDlgProc = TypeDlgProc;
2742 psp.pszTemplate = MAKEINTRESOURCEW(IDD_TYPEPAGE);
2743 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2744
2745 /* Create the upgrade/repair selection page */
2746 psp.dwSize = sizeof(PROPSHEETPAGE);
2747 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2748 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_TYPETITLE);
2749 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_TYPESUBTITLE);
2750 psp.hInstance = hInst;
2751 psp.lParam = (LPARAM)&SetupData;
2752 psp.pfnDlgProc = UpgradeRepairDlgProc;
2753 psp.pszTemplate = MAKEINTRESOURCEW(IDD_UPDATEREPAIRPAGE);
2754 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2755
2756 /* Create the device settings page */
2757 psp.dwSize = sizeof(PROPSHEETPAGE);
2758 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2759 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DEVICETITLE);
2760 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DEVICESUBTITLE);
2761 psp.hInstance = hInst;
2762 psp.lParam = (LPARAM)&SetupData;
2763 psp.pfnDlgProc = DeviceDlgProc;
2764 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DEVICEPAGE);
2765 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2766
2767 /* Create the install device settings page / boot method / install directory */
2768 psp.dwSize = sizeof(PROPSHEETPAGE);
2769 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2770 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_DRIVETITLE);
2771 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_DRIVESUBTITLE);
2772 psp.hInstance = hInst;
2773 psp.lParam = (LPARAM)&SetupData;
2774 psp.pfnDlgProc = DriveDlgProc;
2775 psp.pszTemplate = MAKEINTRESOURCEW(IDD_DRIVEPAGE);
2776 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2777
2778 /* Create the summary page */
2779 psp.dwSize = sizeof(PROPSHEETPAGE);
2780 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2781 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_SUMMARYTITLE);
2782 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_SUMMARYSUBTITLE);
2783 psp.hInstance = hInst;
2784 psp.lParam = (LPARAM)&SetupData;
2785 psp.pfnDlgProc = SummaryDlgProc;
2786 psp.pszTemplate = MAKEINTRESOURCEW(IDD_SUMMARYPAGE);
2787 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2788 }
2789
2790 /* Create the installation progress page */
2791 psp.dwSize = sizeof(PROPSHEETPAGE);
2792 psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
2793 psp.pszHeaderTitle = MAKEINTRESOURCEW(IDS_PROCESSTITLE);
2794 psp.pszHeaderSubTitle = MAKEINTRESOURCEW(IDS_PROCESSSUBTITLE);
2795 psp.hInstance = hInst;
2796 psp.lParam = (LPARAM)&SetupData;
2797 psp.pfnDlgProc = ProcessDlgProc;
2798 psp.pszTemplate = MAKEINTRESOURCEW(IDD_PROCESSPAGE);
2799 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2800
2801 /* Create the finish-and-reboot page */
2802 psp.dwSize = sizeof(PROPSHEETPAGE);
2803 psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
2804 psp.hInstance = hInst;
2805 psp.lParam = (LPARAM)&SetupData;
2806 psp.pfnDlgProc = RestartDlgProc;
2807 psp.pszTemplate = MAKEINTRESOURCEW(IDD_RESTARTPAGE);
2808 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
2809
2810 /* Create the property sheet */
2811 psh.dwSize = sizeof(PROPSHEETHEADER);
2812 psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
2813 psh.hInstance = hInst;
2814 psh.hwndParent = NULL;
2815 psh.nPages = nPages;
2816 psh.nStartPage = 0;
2817 psh.phpage = ahpsp;
2818 psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_WATERMARK);
2819 psh.pszbmHeader = MAKEINTRESOURCEW(IDB_HEADER);
2820
2821 /* Display the wizard */
2822 PropertySheet(&psh);
2823
2824 /* Wait for any pending installation */
2830
2833
2834 /* Unregister the TreeList control */
2835 // UnregisterTreeListClass(hInst);
2837
2838 if (hHotkeyThread)
2839 {
2840 PostThreadMessageW(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
2841 CloseHandle(hHotkeyThread);
2842 }
2843
2844Quit:
2845 /* Setup has finished */
2847
2848 /* Free the NT to Win32 path prefix mapping list */
2850
2851#if 0 // NOTE: Disabled for testing purposes only!
2855#endif
2856
2857 return 0;
2858}
#define IDB_HEADER
Definition: resource.h:30
static HFONT CreateTitleFont(VOID)
Definition: reactos.c:84
static INT_PTR CALLBACK ProcessDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:1997
static INT_PTR CALLBACK TypeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:347
static INT_PTR CALLBACK RestartDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:2116
HANDLE ProcessHeap
Definition: reactos.c:40
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:2197
static INT_PTR CALLBACK UpgradeRepairDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:710
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:230
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2297
static INT_PTR CALLBACK DeviceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:896
static INT_PTR CALLBACK SummaryDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: reactos.c:999
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:2289
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:291
SETUPDATA SetupData
Definition: reactos.c:42
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:2607
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:2577
#define IDS_TYPETITLE
Definition: resource.h:83
#define IDD_DRIVEPAGE
Definition: resource.h:37
#define IDS_DRIVESUBTITLE
Definition: resource.h:88
#define IDS_PROCESSSUBTITLE
Definition: resource.h:90
#define IDS_TYPESUBTITLE
Definition: resource.h:84
#define IDS_PROCESSTITLE
Definition: resource.h:89
#define IDD_RESTARTPAGE
Definition: resource.h:62
#define IDS_CAPTION
Definition: resource.h:98
#define IDS_DEVICETITLE
Definition: resource.h:85
#define IDD_SUMMARYPAGE
Definition: resource.h:46
#define IDS_DRIVETITLE
Definition: resource.h:87
#define IDB_WATERMARK
Definition: resource.h:4
#define IDD_PROCESSPAGE
Definition: resource.h:57
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:97
#define IDD_UPDATEREPAIRPAGE
Definition: resource.h:27
#define IDS_SUMMARYTITLE
Definition: resource.h:95
#define IDS_DEVICESUBTITLE
Definition: resource.h:86
#define IDS_SUMMARYSUBTITLE
Definition: resource.h:96
#define IDD_TYPEPAGE
Definition: resource.h:21
#define IDD_DEVICEPAGE
Definition: resource.h:31
#define IDD_STARTPAGE
Definition: resource.h:18
BOOL Error
Definition: chkdsk.c:66
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
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
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1634
#define INFINITE
Definition: serial.h:102
HINSTANCE hInst
Definition: dxdiag.c:13
@ ERROR_LOAD_TXTSETUPSIF
Definition: errorcode.h:24
@ ERROR_NO_SOURCE_DRIVE
Definition: errorcode.h:23
pKey DeleteObject()
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define PROPSHEETHEADER
Definition: prsht.h:392
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
#define PropertySheet
Definition: prsht.h:400
#define PROPSHEETPAGE
Definition: prsht.h:389
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
VOID FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1048
VOID CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:28
ERROR_NUMBER InitializeSetup(IN OUT PUSETUP_DATA pSetupData, IN ULONG InitPhase)
Definition: setuplib.c:952
USETUP_DATA USetupData
Definition: reactos.h:144
HINSTANCE hInstance
Definition: reactos.h:133
HFONT hTitleFont
Definition: reactos.h:136
BOOL bStopInstall
Definition: reactos.h:140
HANDLE hInstallThread
Definition: reactos.h:138
HANDLE hHaltInstallEvent
Definition: reactos.h:139
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:142
BOOL bUnattend
Definition: reactos.h:134
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
int TreeListRegister(HINSTANCE hInstance)
Definition: treelist.c:394
BOOL TreeListUnregister(HINSTANCE hInstance)
Definition: treelist.c:429
uint32_t ULONG
Definition: typedefs.h:59
LONG_PTR LPARAM
Definition: windef.h:208
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:384
#define WM_QUIT
Definition: winuser.h:1626
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:790
#define EWX_REBOOT
Definition: winuser.h:638
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ AddNTOSInstallationItem()

static VOID NTAPI AddNTOSInstallationItem ( IN HWND  hWndList,
IN LVITEM plvItem,
IN PGENERIC_LIST_ENTRY  Entry,
IN OUT PWSTR  Buffer,
IN SIZE_T  cchBufferSize 
)
static

Definition at line 645 of file reactos.c.

651{
653 PVOLINFO VolInfo = (NtOsInstall->Volume ? &NtOsInstall->Volume->Info : NULL);
654
655 if (VolInfo && VolInfo->DriveLetter)
656 {
657 /* We have retrieved a partition that is mounted */
658 StringCchPrintfW(Buffer, cchBufferSize,
659 L"%c:%s",
660 VolInfo->DriveLetter,
661 NtOsInstall->PathComponent);
662 }
663 else
664 {
665 /* We failed somewhere, just show the NT path */
666 StringCchPrintfW(Buffer, cchBufferSize,
667 L"%wZ",
668 &NtOsInstall->SystemNtPath);
669 }
670
671 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
672 plvItem->iItem = 0;
673 plvItem->iSubItem = 0;
674 plvItem->lParam = (LPARAM)Entry;
675 plvItem->pszText = NtOsInstall->InstallationName;
676
677 /* Associate vendor icon */
678 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
679 {
680 plvItem->mask |= LVIF_IMAGE;
681 plvItem->iImage = 0;
682 }
683 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
684 {
685 plvItem->mask |= LVIF_IMAGE;
686 plvItem->iImage = 1;
687 }
688
689 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
690
691 plvItem->iSubItem = 1;
692 plvItem->pszText = Buffer; // SystemRootPath;
693 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
694
695 plvItem->iSubItem = 2;
696 plvItem->pszText = NtOsInstall->VendorName;
697 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
698}
static HWND hWndList[5+1]
Definition: SetParent.c:10
Definition: bufpool.h:45
PVOID GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:126
#define VENDOR_MICROSOFT
Definition: osdetect.h:13
struct _NTOS_INSTALLATION * PNTOS_INSTALLATION
#define VENDOR_REACTOS
Definition: osdetect.h:12
#define LVM_SETITEMTEXTW
Definition: commctrl.h:2692
#define LVIF_PARAM
Definition: commctrl.h:2316
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVIF_IMAGE
Definition: commctrl.h:2315
#define LVM_INSERTITEMW
Definition: commctrl.h:2409
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
base of all file and directory entries
Definition: entries.h:83
WCHAR InstallationName[MAX_PATH]
Definition: osdetect.h:26
UNICODE_STRING SystemNtPath
Definition: osdetect.h:21
WCHAR VendorName[MAX_PATH]
Definition: osdetect.h:27
PVOLENTRY Volume
Definition: osdetect.h:25
PCWSTR PathComponent
Definition: osdetect.h:22
VOLINFO Info
Definition: partlist.h:47
WCHAR DriveLetter
Definition: volutil.h:15
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by UpgradeRepairDlgProc().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 61 of file reactos.c.

62{
64 RECT rcParent;
65 RECT rcWindow;
66
68 if (hWndParent == NULL)
70
71 GetWindowRect(hWndParent, &rcParent);
72 GetWindowRect(hWnd, &rcWindow);
73
76 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
77 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
78 0,
79 0,
81}
HWND hWnd
Definition: settings.c:17
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1248
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1210
HWND WINAPI GetParent(_In_ HWND)

Referenced by ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), MdiSdiDlg::MdiSdiDlg(), CEditCompatModes::OnInitDialog(), CConfirmReplace::OnInitDialog(), CZipPassword::OnInitDialog(), and StartDlgProc().

◆ ChkdskCallback()

static BOOLEAN NTAPI ChkdskCallback ( _In_ CALLBACKCOMMAND  Command,
_In_ ULONG  Modifier,
_In_ PVOID  Argument 
)
static

Definition at line 1232 of file reactos.c.

1236{
1237 switch (Command)
1238 {
1239 default:
1240 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1241 break;
1242 }
1243
1244 return TRUE;
1245}
#define DPRINT
Definition: sndvol32.h:73
Definition: shell.h:41

◆ ConvertNtPathToWin32Path()

BOOL ConvertNtPathToWin32Path ( IN OUT PNT_WIN32_PATH_MAPPING_LIST  MappingList,
OUT PWSTR  pwszPath,
IN DWORD  cchPathMax,
IN PCWSTR  pwszNTPath 
)

Definition at line 2318 of file reactos.c.

2323{
2324 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
2325 PLIST_ENTRY ListEntry;
2327 PCWSTR pwszNtPathToMap = pwszNTPath;
2328 PCWSTR pwszRemaining = NULL;
2329 DWORD cchDrives;
2330 PWCHAR pwszDrive;
2331 WCHAR wszDrives[512];
2332 WCHAR wszNTPath[MAX_PATH];
2333 WCHAR TargetPath[MAX_PATH];
2334
2335 *pwszPath = UNICODE_NULL;
2336
2337 /*
2338 * We find first a mapping inside the MappingList. If one is found, use it
2339 * to build the Win32 path. If there is none, we need to create one by
2340 * checking the Win32 drives (and possibly NT symlinks too).
2341 * In case of success, add the newly found mapping to the list and use it
2342 * to build the Win32 path.
2343 */
2344
2345 for (ListEntry = MappingList->List.Flink;
2346 ListEntry != &MappingList->List;
2347 ListEntry = ListEntry->Flink)
2348 {
2349 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2350
2351 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
2352
2353 /* Check whether the queried NT path prefixes the user-provided NT path */
2354 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
2355 if (FoundDrive)
2356 {
2357 /* Found it! */
2358
2359 /* Set the pointers and go build the Win32 path */
2360 pwszDrive = Entry->Win32Path;
2361 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
2362 goto Quit;
2363 }
2364 }
2365
2366 /*
2367 * No mapping exists for this path yet: try to find one now.
2368 */
2369
2370 /* Retrieve the mounted drives (available drive letters) */
2371 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
2372 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
2373 {
2374 /* Buffer too small or failure */
2375 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
2376 return FALSE;
2377 }
2378
2379/* We go back there once if RetryOnce == TRUE */
2380Retry:
2381
2382 /* Enumerate the mounted drives */
2383 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
2384 {
2385 /* Retrieve the NT path corresponding to the current Win32 DOS path */
2386 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
2387 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
2388 pwszDrive[2] = L'\\'; // Restore the backslash
2389
2390 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
2391
2392 /* Check whether the queried NT path prefixes the user-provided NT path */
2393 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2394 if (!FoundDrive)
2395 {
2396 PWCHAR ptr, ptr2;
2397
2398 /*
2399 * Check whether this was a network share that has a drive letter,
2400 * but the user-provided NT path points to this share without
2401 * mentioning the drive letter.
2402 *
2403 * The format is: \Device<network_redirector>\;X:<data>\share\path
2404 * The corresponding drive letter is 'X'.
2405 * A system-provided network redirector (LanManRedirector or Mup)
2406 * or a 3rd-party one may be used.
2407 *
2408 * We check whether the user-provided NT path has the form:
2409 * \Device<network_redirector><data>\share\path
2410 * as it obviously did not have the full form (the previous check
2411 * would have been OK otherwise).
2412 */
2413 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
2414 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
2415 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
2416 {
2417 /*
2418 * Normally the specified drive letter should correspond
2419 * to the one used for the mapping. But we will ignore
2420 * if it happens not to be the case.
2421 */
2422 if (pwszDrive[0] != ptr[1])
2423 {
2424 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
2425 pwszDrive[0], ptr[1]);
2426 }
2427
2428 /* Remove the drive letter from the NT network share path */
2429 ptr2 = ptr + 3;
2430 /* Swallow as many possible consecutive backslashes as there could be */
2431 while (*ptr2 == L'\\') ++ptr2;
2432
2433 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
2434
2435 /* Now do the check again */
2436 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
2437 }
2438 }
2439 if (FoundDrive)
2440 {
2441 /* Found it! */
2442
2443 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
2444
2445 if (pwszNtPathToMap == pwszNTPath)
2446 {
2447 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
2448 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
2449 }
2450 break;
2451 }
2452 }
2453
2454 if (FoundDrive)
2455 {
2456 /* A mapping was found, add it to the cache */
2458 if (!Entry)
2459 {
2460 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
2461 return FALSE;
2462 }
2463 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
2464 pwszNTPath, pwszRemaining - pwszNTPath);
2465 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
2466
2467 /* Insert it as the most recent entry */
2468 InsertHeadList(&MappingList->List, &Entry->ListEntry);
2469 MappingList->MappingsCount++;
2470
2471 /* Set the pointers and go build the Win32 path */
2472 pwszDrive = Entry->Win32Path;
2473 goto Quit;
2474 }
2475
2476 /*
2477 * We failed, perhaps because the beginning of the NT path used a symlink.
2478 * Try to see whether this is the case by attempting to resolve it.
2479 * If the symlink resolution gives nothing, or we already failed once,
2480 * there is no hope in converting the path to Win32.
2481 * Otherwise, symlink resolution succeeds but we need to recheck again
2482 * the drives list.
2483 */
2484
2485 /*
2486 * In theory we would have to parse each element in the NT path and going
2487 * until finding a symlink object (otherwise we would fail straight away).
2488 * However here we can use guessing instead, since we know which kind of
2489 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
2490 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
2491 * are supported in setuplib\utils\arcname.c .
2492 *
2493 * But actually, all the supported names in arcname.c are real devices,
2494 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
2495 * just check for it.
2496 */
2497 if (!RetryOnce && !FoundDrive)
2498 {
2499 ULONG DiskNumber, PartitionNumber;
2500 INT Length;
2501
2504 HANDLE LinkHandle;
2505 UNICODE_STRING SymLink, Target;
2506
2507 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
2508 &DiskNumber, &PartitionNumber, &Length) != 2)
2509 {
2510 /* Definitively not a recognized path, bail out */
2511 return FALSE;
2512 }
2513
2514 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
2515 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
2516 SymLink.Length = SymLink.MaximumLength;
2517
2519 &SymLink,
2521 NULL,
2522 NULL);
2523 Status = NtOpenSymbolicLinkObject(&LinkHandle,
2526 if (!NT_SUCCESS(Status))
2527 {
2528 /* Not a symlink, or something else happened: bail out */
2529 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2530 &SymLink, Status);
2531 return FALSE;
2532 }
2533
2534 *TargetPath = UNICODE_NULL;
2535 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
2536
2537 /* Resolve the link and close its handle */
2539 NtClose(LinkHandle);
2540
2541 /* Check for success */
2542 if (!NT_SUCCESS(Status))
2543 {
2544 /* Not a symlink, or something else happened: bail out */
2545 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
2546 &SymLink, Status);
2547 return FALSE;
2548 }
2549
2550 /* Set the pointers */
2551 pwszRemaining = pwszNTPath + Length;
2552 pwszNtPathToMap = TargetPath; // Point to our local buffer
2553
2554 /* Retry once */
2555 RetryOnce = TRUE;
2556 goto Retry;
2557 }
2558
2559 ASSERT(!FoundDrive);
2560
2561Quit:
2562 if (FoundDrive)
2563 {
2564 StringCchPrintfW(pwszPath, cchPathMax,
2565 L"%s%s",
2566 pwszDrive,
2567 pwszRemaining);
2568 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
2569 return TRUE;
2570 }
2571
2572 return FALSE;
2573}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define wcschr
Definition: compat.h:17
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
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
#define InsertHeadList(ListHead, Entry)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ASSERT(a)
Definition: mode.c:44
static PVOID ptr
Definition: dispmode.c:27
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#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
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
USHORT MaximumLength
Definition: env_spec_w32.h:370
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2061
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by SetupOpenInfFileExW().

◆ CreateListViewColumns()

BOOL CreateListViewColumns ( IN HINSTANCE  hInstance,
IN HWND  hWndListView,
IN const UINT pIDs,
IN const INT pColsWidth,
IN const INT pColsAlign,
IN UINT  nNumOfColumns 
)

Definition at line 479 of file reactos.c.

486{
487 UINT i;
488 LVCOLUMN lvC;
489 WCHAR szText[50];
490
491 /* Create the columns */
492 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
493 lvC.pszText = szText;
494
495 /* Load the column labels from the resource file */
496 for (i = 0; i < nNumOfColumns; i++)
497 {
498 lvC.iSubItem = i;
499 lvC.cx = pColsWidth[i];
500 lvC.fmt = pColsAlign[i];
501
502 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
503
504 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
505 return FALSE;
506 }
507
508 return TRUE;
509}
HINSTANCE hInstance
Definition: charmap.c:19
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
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 ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2641
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCF_TEXT
Definition: commctrl.h:2593
#define LVCOLUMN
Definition: commctrl.h:2586
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by UpgradeRepairDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 84 of file reactos.c.

85{
86 NONCLIENTMETRICS ncm;
87 LOGFONT LogFont;
88 HDC hdc;
89 INT FontSize;
91
92 ncm.cbSize = sizeof(NONCLIENTMETRICS);
93 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
94
95 LogFont = ncm.lfMessageFont;
96 LogFont.lfWeight = FW_BOLD;
97 _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg"));
98
99 hdc = GetDC(NULL);
100 FontSize = 12;
101 LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
102 hFont = CreateFontIndirect(&LogFont);
104
105 return hFont;
106}
HFONT hFont
Definition: main.c:53
#define _tcscpy
Definition: tchar.h:623
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define _T(x)
Definition: vfdio.h:22
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
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
#define SystemParametersInfo
Definition: winuser.h:5870

Referenced by _tWinMain().

◆ DeviceDlgProc()

static INT_PTR CALLBACK DeviceDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 896 of file reactos.c.

901{
902 PSETUPDATA pSetupData;
903 HWND hList;
904
905 /* Retrieve pointer to the global setup data */
906 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
907
908 switch (uMsg)
909 {
910 case WM_INITDIALOG:
911 {
912 /* Save pointer to the global setup data */
913 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
914 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
915
916 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
918
919 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
921
922 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
924
925 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
926 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
927
928 break;
929 }
930
931 case WM_NOTIFY:
932 {
933 LPNMHDR lpnm = (LPNMHDR)lParam;
934
935 switch (lpnm->code)
936 {
937 case PSN_SETACTIVE:
939 break;
940
942 {
943 /* Focus on "Computer" list */
945 return TRUE;
946 }
947
948 case PSN_QUERYCANCEL:
949 {
950 if (DisplayMessage(GetParent(hwndDlg),
954 {
955 /* Go to the Terminate page */
957 }
958
959 /* Do not close the wizard too soon */
961 return TRUE;
962 }
963
964 case PSN_WIZNEXT: /* Set the selected data */
965 {
966 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
969
970 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
973
974 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
977
978 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
979 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
980 // GetSelectedComboListItem(hList));
981
982 return TRUE;
983 }
984
985 default:
986 break;
987 }
988 }
989 break;
990
991 default:
992 break;
993
994 }
995 return FALSE;
996}
#define IDC_DISPLAY
Definition: resource.h:19
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:556
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:634
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:211
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:518
struct _SETUPDATA * PSETUPDATA
#define IDC_KEYBOARD
Definition: resource.h:34
#define IDC_COMPUTER
Definition: resource.h:32
#define IDS_ABORTSETUP2
Definition: resource.h:94
#define IDS_ABORTSETUP
Definition: resource.h:93
LPARAM lParam
Definition: combotst.c:139
VOID SetCurrentListEntry(IN PGENERIC_LIST List, IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:87
HWND hList
Definition: livecd.c:10
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_BACK
Definition: prsht.h:153
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
PGENERIC_LIST DisplayList
Definition: setuplib.h:130
PGENERIC_LIST ComputerList
Definition: setuplib.h:129
PGENERIC_LIST KeyboardList
Definition: setuplib.h:131
UINT code
Definition: winuser.h:3162
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define WM_INITDIALOG
Definition: winuser.h:1742
#define MB_YESNO
Definition: winuser.h:820
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
#define MB_ICONQUESTION
Definition: winuser.h:792
#define DWLP_MSGRESULT
Definition: winuser.h:873
#define IDYES
Definition: winuser.h:838
#define SetWindowLongPtrW
Definition: winuser.h:5358

Referenced by _tWinMain().

◆ DisplayError()

INT __cdecl DisplayError ( _In_opt_ HWND  hWnd,
_In_ UINT  uIDTitle,
_In_ UINT  uIDMessage,
  ... 
)

Definition at line 230 of file reactos.c.

235{
236 INT iRes;
238
239 va_start(args, uIDMessage);
241 MAKEINTRESOURCEW(uIDTitle),
242 MAKEINTRESOURCEW(uIDMessage),
243 args);
244 va_end(args);
245
246 return iRes;
247}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:109
#define args
Definition: format.c:66
Definition: match.c:390
#define MB_OK
Definition: winuser.h:793

Referenced by _tWinMain(), and FsVolCallback().

◆ DisplayMessage()

◆ DisplayMessageV()

INT DisplayMessageV ( _In_opt_ HWND  hWnd,
_In_ UINT  uType,
_In_opt_ PCWSTR  pszTitle,
_In_opt_ PCWSTR  pszFormatMessage,
_In_ va_list  args 
)

Definition at line 109 of file reactos.c.

115{
116 INT iRes;
118 MSGBOXPARAMSW mb = {0};
120 size_t MsgLen;
121 WCHAR StaticBuffer[256];
122 LPWSTR Buffer = StaticBuffer; // Use the static buffer by default.
123
124 /* We need to retrieve the current module's instance handle if either
125 * the title or the format message is specified by a resource ID */
126 if ((pszTitle && IS_INTRESOURCE(pszTitle)) || IS_INTRESOURCE(pszFormatMessage))
127 hInstance = GetModuleHandleW(NULL); // SetupData.hInstance;
128
129 /* Retrieve the format message string if this is a resource */
130 if (pszFormatMessage && IS_INTRESOURCE(pszFormatMessage)) do
131 {
132 // LoadAllocStringW()
133 PCWSTR pStr;
134
135 /* Try to load the string from the resource */
136 MsgLen = LoadStringW(hInstance, PtrToUlong(pszFormatMessage), (LPWSTR)&pStr, 0);
137 if (MsgLen == 0)
138 {
139 /* No resource string was found, return NULL */
140 Format = NULL;
141 break;
142 }
143
144 /* Allocate a new buffer, adding a NULL-terminator */
145 Format = HeapAlloc(GetProcessHeap(), 0, (MsgLen + 1) * sizeof(WCHAR));
146 if (!Format)
147 {
148 MsgLen = 0;
149 break;
150 }
151
152 /* Copy the string, NULL-terminated */
153 StringCchCopyNW(Format, MsgLen + 1, pStr, MsgLen);
154 } while (0);
155 else
156 {
157 Format = (LPWSTR)pszFormatMessage;
158 }
159
160 if (Format)
161 {
162 /*
163 * Retrieve the message length. If it is too long, allocate
164 * an auxiliary buffer; otherwise use the static buffer.
165 * The string is built to be NULL-terminated.
166 */
167 MsgLen = _vscwprintf(Format, args);
168 if (MsgLen >= _countof(StaticBuffer))
169 {
170 Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (MsgLen + 1) * sizeof(WCHAR));
171 if (!Buffer)
172 {
173 /* Allocation failed, use the original format string verbatim */
174 Buffer = Format;
175 }
176 }
177 if (Buffer != Format)
178 {
179 /* Do the printf as we use the caller's format string */
180 StringCchVPrintfW(Buffer, MsgLen + 1, Format, args);
181 }
182 }
183 else
184 {
185 Format = (LPWSTR)pszFormatMessage;
186 Buffer = Format;
187 }
188
189 /* Display the message */
190 mb.cbSize = sizeof(mb);
191 mb.hwndOwner = hWnd;
192 mb.hInstance = hInstance;
193 mb.lpszText = Buffer;
194 mb.lpszCaption = pszTitle;
195 mb.dwStyle = uType;
197 iRes = MessageBoxIndirectW(&mb);
198
199 /* Free the buffers if needed */
200 if ((Buffer != StaticBuffer) && (Buffer != Format))
202
203 if (Format && (Format != pszFormatMessage))
205
206 return iRes;
207}
#define HeapFree(x, y, z)
Definition: compat.h:735
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define PtrToUlong(u)
Definition: config.h:107
_Check_return_ _CRTIMP int __cdecl _vscwprintf(_In_z_ _Printf_format_string_ const wchar_t *_Format, va_list _ArgList)
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
STRSAFEAPI StringCchVPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:490
DWORD dwLanguageId
Definition: winuser.h:3348
LPCWSTR lpszCaption
Definition: winuser.h:3343
HWND hwndOwner
Definition: winuser.h:3340
LPCWSTR lpszText
Definition: winuser.h:3342
HINSTANCE hInstance
Definition: winuser.h:3341
DWORD dwStyle
Definition: winuser.h:3344
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DisplayError(), and DisplayMessage().

◆ EnablePrivilege()

BOOL EnablePrivilege ( IN LPCWSTR  lpszPrivilegeName,
IN BOOL  bEnablePrivilege 
)

Definition at line 2577 of file reactos.c.

2580{
2581 BOOL Success;
2582 HANDLE hToken;
2584
2587 &hToken);
2588 if (!Success) return Success;
2589
2591 lpszPrivilegeName,
2592 &tp.Privileges[0].Luid);
2593 if (!Success) goto Quit;
2594
2595 tp.PrivilegeCount = 1;
2596 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
2597
2598 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
2599
2600Quit:
2601 CloseHandle(hToken);
2602 return Success;
2603}
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define GetCurrentProcess()
Definition: compat.h:759
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2996
@ Success
Definition: eventcreate.c:712
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63

Referenced by _tWinMain().

◆ FileCopyCallback()

static UINT CALLBACK FileCopyCallback ( PVOID  Context,
UINT  Notification,
UINT_PTR  Param1,
UINT_PTR  Param2 
)
static

Definition at line 1594 of file reactos.c.

1598{
1599 PCOPYCONTEXT CopyContext = (PCOPYCONTEXT)Context;
1600 PFILEPATHS_W FilePathInfo;
1601 PCWSTR SrcFileName, DstFileName;
1602 WCHAR Status[1024];
1603
1605 if (CopyContext->pSetupData->bStopInstall)
1606 return FILEOP_ABORT; // Stop committing files
1607
1608 switch (Notification)
1609 {
1611 {
1612 CopyContext->TotalOperations = (ULONG)Param2;
1613 CopyContext->CompletedOperations = 0;
1614
1615 /* Set up the progress bar */
1617 PBM_SETRANGE, 0,
1618 MAKELPARAM(0, CopyContext->TotalOperations));
1620 PBM_SETSTEP, 1, 0);
1622 PBM_SETPOS, 0, 0);
1623 break;
1624 }
1625
1629 {
1630 FilePathInfo = (PFILEPATHS_W)Param1;
1631
1633 {
1634 /* Display delete message */
1635 ASSERT(Param2 == FILEOP_DELETE);
1636
1637 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1638 if (DstFileName) ++DstFileName;
1639 else DstFileName = FilePathInfo->Target;
1640
1641 // STRING_DELETING
1642 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Deleting %s", DstFileName);
1644 }
1646 {
1647 /* Display move/rename message */
1648 ASSERT(Param2 == FILEOP_RENAME);
1649
1650 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1651 if (SrcFileName) ++SrcFileName;
1652 else SrcFileName = FilePathInfo->Source;
1653
1654 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1655 if (DstFileName) ++DstFileName;
1656 else DstFileName = FilePathInfo->Target;
1657
1658 // STRING_MOVING or STRING_RENAMING
1659 if (!wcsicmp(SrcFileName, DstFileName))
1660 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Moving %s to %s", SrcFileName, DstFileName);
1661 else
1662 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Renaming %s to %s", SrcFileName, DstFileName);
1663
1665 }
1667 {
1668 /* Display copy message */
1669 ASSERT(Param2 == FILEOP_COPY);
1670
1671 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1672 if (DstFileName) ++DstFileName;
1673 else DstFileName = FilePathInfo->Target;
1674
1675 // STRING_COPYING
1676 StringCchPrintfW(Status, ARRAYSIZE(Status), L"Copying %s", DstFileName);
1678 }
1679 break;
1680 }
1681
1683 {
1684 FilePathInfo = (PFILEPATHS_W)Param1;
1685
1686 DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
1687 FilePathInfo->Target, FilePathInfo->Win32Error);
1688 return FILEOP_SKIP;
1689 }
1690
1694 {
1695 CopyContext->CompletedOperations++;
1696
1697 /* SYSREG checkpoint */
1698 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1699 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1700
1702 break;
1703 }
1704 }
1705
1706 return FILEOP_DOIT;
1707}
struct _COPYCONTEXT * PCOPYCONTEXT
UI_CONTEXT UiContext
Definition: reactos.c:55
#define wcsrchr
Definition: compat.h:16
#define wcsicmp
Definition: compat.h:15
#define SPFILENOTIFY_ENDDELETE
Definition: fileqsup.h:28
#define FILEOP_COPY
Definition: fileqsup.h:42
struct _FILEPATHS_W * PFILEPATHS_W
#define FILEOP_SKIP
Definition: fileqsup.h:49
#define SPFILENOTIFY_STARTDELETE
Definition: fileqsup.h:27
#define SPFILENOTIFY_STARTSUBQUEUE
Definition: fileqsup.h:24
#define FILEOP_DOIT
Definition: fileqsup.h:48
#define SPFILENOTIFY_ENDCOPY
Definition: fileqsup.h:36
#define SPFILENOTIFY_STARTCOPY
Definition: fileqsup.h:35
#define SPFILENOTIFY_COPYERROR
Definition: fileqsup.h:37
#define FILEOP_RENAME
Definition: fileqsup.h:43
#define SPFILENOTIFY_STARTRENAME
Definition: fileqsup.h:31
#define SPFILENOTIFY_ENDRENAME
Definition: fileqsup.h:32
#define FILEOP_DELETE
Definition: fileqsup.h:44
#define FILEOP_ABORT
Definition: fileqsup.h:47
#define PBM_SETSTEP
Definition: commctrl.h:2191
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define PBM_STEPIT
Definition: commctrl.h:2192
ULONG TotalOperations
Definition: reactos.c:1588
ULONG CompletedOperations
Definition: reactos.c:1589
PSETUPDATA pSetupData
Definition: reactos.c:1587
UINT Win32Error
Definition: fileqsup.h:62
PCWSTR Source
Definition: fileqsup.h:61
PCWSTR Target
Definition: fileqsup.h:60
HWND hWndItem
Definition: reactos.h:84
HWND hWndProgress
Definition: reactos.h:85
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)

Referenced by PrepareAndDoCopyThread().

◆ FormatCallback()

static BOOLEAN NTAPI FormatCallback ( _In_ CALLBACKCOMMAND  Command,
_In_ ULONG  Modifier,
_In_ PVOID  Argument 
)
static

Definition at line 1184 of file reactos.c.

1188{
1189 switch (Command)
1190 {
1191 case PROGRESS:
1192 {
1193 PULONG Percent = (PULONG)Argument;
1194 DPRINT("%lu percent completed\n", *Percent);
1196 break;
1197 }
1198
1199#if 0
1200 case OUTPUT:
1201 {
1202 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
1203 DPRINT("%s\n", output->Output);
1204 break;
1205 }
1206#endif
1207
1208 case DONE:
1209 {
1210#if 0
1211 PBOOLEAN Success = (PBOOLEAN)Argument;
1212 if (*Success == FALSE)
1213 {
1214 DPRINT("FormatEx was unable to complete successfully.\n\n");
1215 }
1216#endif
1217 DPRINT("Done\n");
1218 break;
1219 }
1220
1221 default:
1222 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1223 break;
1224 }
1225
1226 return TRUE;
1227}
struct TEXTOUTPUT * PTEXTOUTPUT
@ OUTPUT
Definition: fmifs.h:82
@ PROGRESS
Definition: fmifs.h:68
#define DONE
Definition: rnr20lib.h:14
PCHAR Output
Definition: fmifs.h:33
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53

Referenced by FsVolCallback().

◆ FreeNtToWin32PathMappingList()

VOID FreeNtToWin32PathMappingList ( IN OUT PNT_WIN32_PATH_MAPPING_LIST  MappingList)

Definition at line 2297 of file reactos.c.

2299{
2300 PLIST_ENTRY ListEntry;
2301 PVOID Entry;
2302
2303 while (!IsListEmpty(&MappingList->List))
2304 {
2305 ListEntry = RemoveHeadList(&MappingList->List);
2306 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
2308 }
2309
2310 MappingList->MappingsCount = 0;
2311}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
void * PVOID
Definition: typedefs.h:50

Referenced by _tWinMain().

◆ FsVolCallback()

static FSVOL_OP CALLBACK FsVolCallback ( _In_opt_ PVOID  Context,
_In_ FSVOLNOTIFY  FormatStatus,
_In_ ULONG_PTR  Param1,
_In_ ULONG_PTR  Param2 
)
static

HACK!!

HACK!!

Definition at line 1250 of file reactos.c.

1255{
1256 PFSVOL_CONTEXT FsVolContext = (PFSVOL_CONTEXT)Context;
1258
1259 switch (FormatStatus)
1260 {
1261 // FIXME: Deprecate!
1263 {
1264 // PPARTENTRY SystemPartition = (PPARTENTRY)Param1;
1265
1266 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1267 // if (ChangeSystemPartitionPage(Ir, SystemPartition))
1268 // return FSVOL_DOIT;
1269 return FSVOL_ABORT;
1270 }
1271
1273 {
1274 switch (Param1)
1275 {
1277 {
1278 // ERROR_WRITE_PTABLE
1280 0, // Default to "Error"
1282 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1283 // TODO: Go back to the partitioning page?
1284 break;
1285 }
1286
1288 {
1289 /* FIXME: improve the error dialog */
1290 //
1291 // Error dialog should say that we cannot find a suitable
1292 // system partition and create one on the system. At this point,
1293 // it may be nice to ask the user whether he wants to continue,
1294 // or use an external drive as the system drive/partition
1295 // (e.g. floppy, USB drive, etc...)
1296 //
1298 0, // Default to "Error"
1300 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1301 // TODO: Go back to the partitioning page
1302 break;
1303 }
1304
1305 default:
1306 break;
1307 }
1308 return FSVOL_ABORT;
1309 }
1310
1313 // NOTE: If needed, clear progress gauges.
1314 return FSVOL_DOIT;
1315
1317 {
1318 if ((FSVOL_OP)Param1 == FSVOL_FORMAT)
1319 {
1320 /*
1321 * In case we just repair an existing installation, or make
1322 * an unattended setup without formatting, just go to the
1323 * filesystem check step.
1324 */
1325 if (FsVolContext->pSetupData->RepairUpdateFlag)
1326 return FSVOL_SKIP;
1329 return FSVOL_SKIP;
1331 /* Set status text */
1333 }
1334 else
1335 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1336 {
1337 /* Set status text */
1339
1340 /* Filechecking step: set progress marquee style and start it up */
1344 }
1345
1346 return FSVOL_DOIT;
1347 }
1348
1350 {
1351 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1352 {
1353 /* File-checking finished: stop the progress bar and restore its style */
1356 }
1357 return 0;
1358 }
1359
1361 {
1362 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1363
1364 // FIXME: See also FSVOLNOTIFY_PARTITIONERROR
1365 if (FmtInfo->ErrorStatus == STATUS_PARTITION_FAILURE)
1366 {
1367 // ERROR_WRITE_PTABLE
1369 0, // Default to "Error"
1371 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1372 // TODO: Go back to the partitioning page?
1373 return FSVOL_ABORT;
1374 }
1375 else
1377 {
1378 /* FIXME: show an error dialog */
1379 // MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
1381 0, // Default to "Error"
1383 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1384 return FSVOL_ABORT;
1385 }
1386 else
1387 if (FmtInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1388 {
1389 INT nRet;
1390
1392 NULL, // Default to "Error"
1394 FmtInfo->FileSystemName);
1395 if (nRet == IDCANCEL)
1396 {
1397 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1398 return FSVOL_ABORT;
1399 }
1400 else if (nRet == IDOK)
1401 {
1402 return FSVOL_RETRY;
1403 }
1404 }
1405 else if (!NT_SUCCESS(FmtInfo->ErrorStatus))
1406 {
1407 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1408
1409 DPRINT1("FormatPartition() failed with status 0x%08lx\n", FmtInfo->ErrorStatus);
1410
1411 // ERROR_FORMATTING_PARTITION
1413 0, // Default to "Error"
1415 FmtInfo->Volume->Info.DeviceName);
1416 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1417 return FSVOL_ABORT;
1418 }
1419
1420 return FSVOL_RETRY;
1421 }
1422
1424 {
1425 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1426
1427 if (ChkInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1428 {
1429 INT nRet;
1430
1432 NULL, // Default to "Error"
1434 ChkInfo->Volume->Info.FileSystem);
1435 if (nRet == IDCANCEL)
1436 {
1437 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1438 return FSVOL_ABORT;
1439 }
1440 else if (nRet == IDOK)
1441 {
1442 return FSVOL_SKIP;
1443 }
1444 }
1445 else if (!NT_SUCCESS(ChkInfo->ErrorStatus))
1446 {
1447 DPRINT1("ChkdskPartition() failed with status 0x%08lx\n", ChkInfo->ErrorStatus);
1448
1450 0, // Default to "Error"
1452 ChkInfo->ErrorStatus);
1453 return FSVOL_SKIP;
1454 }
1455
1456 return FSVOL_SKIP;
1457 }
1458
1460 {
1461 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1462 PVOL_CREATE_INFO VolCreate;
1463
1464 ASSERT((FSVOL_OP)Param2 == FSVOL_FORMAT);
1465
1466 /* Find the volume info in the partition TreeList UI.
1467 * If none, don't format it. */
1469 FmtInfo->Volume);
1470 if (!VolCreate)
1471 return FSVOL_SKIP;
1472 ASSERT(VolCreate->Volume == FmtInfo->Volume);
1473
1474 /* If there is no formatting information, skip it */
1475 if (!*VolCreate->FileSystemName)
1476 return FSVOL_SKIP;
1477
1478 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1479
1480 /* Set status text */
1481 if (FmtInfo->Volume->Info.DriveLetter)
1482 {
1484 L"Formatting volume %c: (%s) in %s...", // IDS_FORMATTING_PROGRESS1
1485 FmtInfo->Volume->Info.DriveLetter,
1486 FmtInfo->Volume->Info.DeviceName,
1487 VolCreate->FileSystemName);
1488 }
1489 else
1490 {
1492 L"Formatting volume %s in %s...", // IDS_FORMATTING_PROGRESS2
1493 FmtInfo->Volume->Info.DeviceName,
1494 VolCreate->FileSystemName);
1495 }
1497
1498 // StartFormat(FmtInfo, FileSystemList->Selected);
1499 FmtInfo->FileSystemName = VolCreate->FileSystemName;
1500 FmtInfo->MediaFlag = VolCreate->MediaFlag;
1501 FmtInfo->Label = VolCreate->Label;
1502 FmtInfo->QuickFormat = VolCreate->QuickFormat;
1503 FmtInfo->ClusterSize = VolCreate->ClusterSize;
1504 FmtInfo->Callback = FormatCallback;
1505
1506 /* Set up the progress bar */
1508 PBM_SETRANGE, 0, MAKELPARAM(0, 100));
1510 PBM_SETPOS, 0, 0);
1511
1512 return FSVOL_DOIT;
1513 }
1514
1516 {
1517 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1518
1519 // EndFormat(FmtInfo->ErrorStatus);
1520 if (FmtInfo->FileSystemName)
1521 *(PWSTR)FmtInfo->FileSystemName = UNICODE_NULL; // FIXME: HACK!
1522
1523 // /* Reset the file system list */
1524 // ResetFileSystemList();
1525 return 0;
1526 }
1527
1529 {
1530 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1531 PVOL_CREATE_INFO VolCreate;
1532
1533 ASSERT((FSVOL_OP)Param2 == FSVOL_CHECK);
1534
1535 /* Find the volume info in the partition TreeList UI.
1536 * If none, don't check it. */
1538 ChkInfo->Volume);
1539 if (!VolCreate)
1540 return FSVOL_SKIP;
1541 ASSERT(VolCreate->Volume == ChkInfo->Volume);
1542
1543 ASSERT(*ChkInfo->Volume->Info.DeviceName);
1544
1545 /* Set status text */
1546 if (ChkInfo->Volume->Info.DriveLetter)
1547 {
1549 L"Checking volume %c: (%s)...", // IDS_CHECKING_PROGRESS1
1550 ChkInfo->Volume->Info.DriveLetter,
1551 ChkInfo->Volume->Info.DeviceName);
1552 }
1553 else
1554 {
1556 L"Checking volume %s...", // IDS_CHECKING_PROGRESS2
1557 ChkInfo->Volume->Info.DeviceName);
1558 }
1560
1561 // StartCheck(ChkInfo);
1562 // TODO: Think about which values could be defaulted...
1563 ChkInfo->FixErrors = TRUE;
1564 ChkInfo->Verbose = FALSE;
1565 ChkInfo->CheckOnlyIfDirty = TRUE;
1566 ChkInfo->ScanDrive = FALSE;
1567 ChkInfo->Callback = ChkdskCallback;
1568
1569 return FSVOL_DOIT;
1570 }
1571
1573 {
1574 // PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1575 // EndCheck(ChkInfo->ErrorStatus);
1576 return 0;
1577 }
1578 }
1579
1580 return 0;
1581}
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: reactos.c:1184
struct _FSVOL_CONTEXT * PFSVOL_CONTEXT
#define IDS_ERROR_SYSTEM_PARTITION
Definition: resource.h:165
#define IDS_ERROR_FORMAT_UNRECOGNIZED_VOLUME
Definition: resource.h:168
#define IDS_ERROR_COULD_NOT_CHECK
Definition: resource.h:177
#define IDS_ERROR_CHECKING_PARTITION
Definition: resource.h:180
#define IDS_ERROR_COULD_NOT_FORMAT
Definition: resource.h:171
#define IDC_ITEM
Definition: resource.h:59
#define IDS_ERROR_WRITE_PTABLE
Definition: resource.h:161
#define IDS_ERROR_FORMATTING_PARTITION
Definition: resource.h:174
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:852
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_PARTITION_FAILURE
Definition: ntstatus.h:604
#define PBS_MARQUEE
Definition: commctrl.h:2203
#define PBM_SETMARQUEE
Definition: commctrl.h:2204
@ FSVOLNOTIFY_STARTCHECK
Definition: fsutil.h:146
@ FSVOLNOTIFY_ENDQUEUE
Definition: fsutil.h:138
@ FSVOLNOTIFY_STARTSUBQUEUE
Definition: fsutil.h:139
@ FSVOLNOTIFY_ENDFORMAT
Definition: fsutil.h:144
@ FSVOLNOTIFY_STARTFORMAT
Definition: fsutil.h:143
@ FSVOLNOTIFY_STARTQUEUE
Definition: fsutil.h:137
@ FSVOLNOTIFY_ENDSUBQUEUE
Definition: fsutil.h:140
@ FSVOLNOTIFY_PARTITIONERROR
Definition: fsutil.h:142
@ FSVOLNOTIFY_CHECKERROR
Definition: fsutil.h:148
@ ChangeSystemPartition
Definition: fsutil.h:149
@ FSVOLNOTIFY_FORMATERROR
Definition: fsutil.h:145
@ FSVOLNOTIFY_ENDCHECK
Definition: fsutil.h:147
enum _FSVOL_OP FSVOL_OP
struct _FORMAT_VOLUME_INFO * PFORMAT_VOLUME_INFO
@ FSVOL_FORMAT
Definition: fsutil.h:155
@ FSVOL_CHECK
Definition: fsutil.h:156
@ FSVOL_DOIT
Definition: fsutil.h:159
@ FSVOL_ABORT
Definition: fsutil.h:158
@ FSVOL_RETRY
Definition: fsutil.h:160
@ FSVOL_SKIP
Definition: fsutil.h:161
struct _CHECK_VOLUME_INFO * PCHECK_VOLUME_INFO
#define ERROR_SYSTEM_PARTITION_NOT_FOUND
Definition: setuplib.h:181
BOOLEAN Verbose
Definition: fsutil.h:188
NTSTATUS ErrorStatus
Definition: fsutil.h:184
PVOLENTRY Volume
Definition: fsutil.h:182
PFMIFSCALLBACK Callback
Definition: fsutil.h:191
BOOLEAN CheckOnlyIfDirty
Definition: fsutil.h:189
BOOLEAN FixErrors
Definition: fsutil.h:187
BOOLEAN ScanDrive
Definition: fsutil.h:190
PFMIFSCALLBACK Callback
Definition: fsutil.h:176
BOOLEAN QuickFormat
Definition: fsutil.h:174
NTSTATUS ErrorStatus
Definition: fsutil.h:168
PVOLENTRY Volume
Definition: fsutil.h:166
FMIFS_MEDIA_FLAG MediaFlag
Definition: fsutil.h:172
PCWSTR FileSystemName
Definition: fsutil.h:171
PSETUPDATA pSetupData
Definition: reactos.c:1177
BOOLEAN RepairUpdateFlag
Definition: reactos.h:146
HWND hPartList
Definition: reactos.h:82
LONG_PTR dwPbStyle
Definition: reactos.h:86
HWND hwndDlg
Definition: reactos.h:83
LONG FormatPartition
Definition: setuplib.h:124
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskVolumeN".
Definition: volutil.h:13
WCHAR FileSystem[MAX_PATH+1]
Definition: volutil.h:17
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:177
ULONG ClusterSize
Definition: reactos.h:189
BOOLEAN QuickFormat
Definition: reactos.h:188
PVOLENTRY Volume
Definition: reactos.h:178
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:185
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:186
PCWSTR Label
Definition: reactos.h:187
uint16_t * PWSTR
Definition: typedefs.h:56
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43
#define IDCANCEL
Definition: winuser.h:834
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDOK
Definition: winuser.h:833
#define MB_OKCANCEL
Definition: winuser.h:807
#define GWL_STYLE
Definition: winuser.h:855

Referenced by DoChecking(), DoFormatting(), FsVolCommitOpsQueue(), InitSystemPartition(), and PrepareAndDoCopyThread().

◆ GetSelectedComboListItem()

PVOID GetSelectedComboListItem ( IN HWND  hWndList)

Definition at line 556 of file reactos.c.

558{
559 INT Index;
560
562 if (Index == CB_ERR)
563 return NULL;
564
566}
_In_ WDFCOLLECTION _In_ ULONG Index
#define ComboBox_GetItemData(hwndCtl, index)
Definition: windowsx.h:54
#define ComboBox_GetCurSel(hwndCtl)
Definition: windowsx.h:49
#define CB_ERR
Definition: winuser.h:2438

Referenced by DeviceDlgProc().

◆ GetSelectedListViewItem()

PVOID GetSelectedListViewItem ( IN HWND  hWndList)

Definition at line 614 of file reactos.c.

616{
617 INT Index;
618 LVITEM item;
619
621 if (Index == LB_ERR)
622 return NULL;
623
624 item.mask = LVIF_PARAM;
625 item.iItem = Index;
627
628 return (PVOID)item.lParam;
629}
static ATOM item
Definition: dde.c:856
#define ListView_GetSelectionMark(hwnd)
Definition: commctrl.h:2794
#define LVITEM
Definition: commctrl.h:2380
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2399
#define LB_ERR
Definition: winuser.h:2435

Referenced by UpgradeRepairDlgProc().

◆ GetSettingDescription()

static VOID NTAPI GetSettingDescription ( IN PGENERIC_LIST_ENTRY  Entry,
OUT PWSTR  Buffer,
IN SIZE_T  cchBufferSize 
)
static

Definition at line 634 of file reactos.c.

638{
639 StringCchCopyW(Buffer, cchBufferSize,
641}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by DeviceDlgProc(), and SummaryDlgProc().

◆ HotkeyThread()

static DWORD CALLBACK HotkeyThread ( LPVOID  Parameter)
static

Definition at line 2607 of file reactos.c.

2608{
2609 ATOM hotkey;
2610 MSG msg;
2611
2612 DPRINT("HotkeyThread start\n");
2613
2614 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
2615
2616 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
2617 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
2618
2619 while (GetMessageW(&msg, NULL, 0, 0))
2620 {
2621 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
2622 {
2623 STARTUPINFOW si = { sizeof(si) };
2625
2626 if (CreateProcessW(L"cmd.exe",
2627 NULL,
2628 NULL,
2629 NULL,
2630 FALSE,
2632 NULL,
2633 NULL,
2634 &si,
2635 &pi))
2636 {
2637 CloseHandle(pi.hProcess);
2638 CloseHandle(pi.hThread);
2639 }
2640 else
2641 {
2642 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
2643 }
2644 }
2645 }
2646
2647 UnregisterHotKey(NULL, hotkey);
2648 GlobalDeleteAtom(hotkey);
2649
2650 DPRINT("HotkeyThread terminate\n");
2651 return 0;
2652}
#define msg(x)
Definition: auth_time.c:54
WORD ATOM
Definition: dimm.idl:113
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4598
#define MOD_SHIFT
Definition: imm.h:186
static refpint_t pi[]
Definition: server.c:96
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CREATE_NEW_CONSOLE
Definition: winbase.h:180
#define VK_F10
Definition: winuser.h:2267
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI UnregisterHotKey(_In_opt_ HWND, _In_ int)
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define WM_HOTKEY
Definition: winuser.h:1882

Referenced by _tWinMain().

◆ InitGenericComboList()

VOID InitGenericComboList ( IN HWND  hWndList,
IN PGENERIC_LIST  List,
IN PGET_ENTRY_DESCRIPTION  GetEntryDescriptionProc 
)

Definition at line 518 of file reactos.c.

522{
523 INT Index, CurrentEntryIndex = 0;
524 PGENERIC_LIST_ENTRY ListEntry;
526 WCHAR CurrentItemText[256];
527
528 for (Entry = List->ListHead.Flink;
529 Entry != &List->ListHead;
530 Entry = Entry->Flink)
531 {
533
534 if (GetEntryDescriptionProc)
535 {
536 GetEntryDescriptionProc(ListEntry,
537 CurrentItemText,
538 ARRAYSIZE(CurrentItemText));
539 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
540 }
541 else
542 {
544 }
545
546 if (ListEntry == List->CurrentEntry)
547 CurrentEntryIndex = Index;
548
550 }
551
552 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
553}
Definition: genlist.h:11
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define CB_SETCURSEL
Definition: winuser.h:1964
#define CB_ADDSTRING
Definition: winuser.h:1939

Referenced by DeviceDlgProc().

◆ InitGenericListView()

VOID InitGenericListView ( IN HWND  hWndList,
IN PGENERIC_LIST  List,
IN PADD_ENTRY_ITEM  AddEntryItemProc 
)

Definition at line 577 of file reactos.c.

581{
582 INT CurrentEntryIndex = 0;
583 LVITEM lvItem;
584 PGENERIC_LIST_ENTRY ListEntry;
586 WCHAR CurrentItemText[256];
587
588 for (Entry = List->ListHead.Flink;
589 Entry != &List->ListHead;
590 Entry = Entry->Flink)
591 {
593
594 if (!AddEntryItemProc)
595 continue;
596
597 AddEntryItemProc(hWndList,
598 &lvItem,
599 ListEntry,
600 CurrentItemText,
601 ARRAYSIZE(CurrentItemText));
602
603 if (ListEntry == List->CurrentEntry)
604 CurrentEntryIndex = lvItem.iItem;
605 }
606
607 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
608 ListView_SetItemState(hWndList, CurrentEntryIndex,
611}
#define ListView_SetItemState(hwndLV, i, data, mask)
Definition: commctrl.h:2678
#define LVIS_SELECTED
Definition: commctrl.h:2324
#define LVIS_FOCUSED
Definition: commctrl.h:2323
#define ListView_EnsureVisible(hwndLV, i, fPartialOK)
Definition: commctrl.h:2524

Referenced by UpgradeRepairDlgProc().

◆ InitNtToWin32PathMappingList()

VOID InitNtToWin32PathMappingList ( IN OUT PNT_WIN32_PATH_MAPPING_LIST  MappingList)

Definition at line 2289 of file reactos.c.

2291{
2292 InitializeListHead(&MappingList->List);
2293 MappingList->MappingsCount = 0;
2294}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

Referenced by _tWinMain().

◆ LoadSetupData()

BOOL LoadSetupData ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2197 of file reactos.c.

2199{
2200 pSetupData->PartitionList = CreatePartitionList();
2201 if (!pSetupData->PartitionList)
2202 {
2203 DPRINT1("Could not enumerate available disks; failing installation\n");
2204 return FALSE;
2205 }
2206
2207 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
2208 if (!pSetupData->NtOsInstallsList)
2209 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
2210
2211 /* Load the hardware, language and keyboard layout lists */
2212
2213 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
2214 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
2215 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
2216
2217 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
2218
2219 /* If not unattended, overwrite language and locale with
2220 * the current ones of the running ReactOS instance */
2221 if (!IsUnattendedSetup)
2222 {
2223 LCID LocaleID = GetUserDefaultLCID();
2224
2225 StringCchPrintfW(pSetupData->DefaultLanguage,
2226 _countof(pSetupData->DefaultLanguage),
2227 L"%08lx", LocaleID);
2228
2229 StringCchPrintfW(pSetupData->USetupData.LocaleID,
2230 _countof(pSetupData->USetupData.LocaleID),
2231 L"%08lx", LocaleID);
2232 }
2233
2234 /* new part */
2235 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
2236 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
2237 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
2238
2239 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
2240 pSetupData->SelectedLanguageId,
2241 pSetupData->DefaultKBLayout);
2242
2243 /* If not unattended, overwrite keyboard layout with
2244 * the current one of the running ReactOS instance */
2245 if (!IsUnattendedSetup)
2246 {
2247 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
2248 /* If the call fails, keep the default already stored in the buffer */
2249 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
2250 }
2251
2252 /* Change the default entries in the language and keyboard layout lists */
2253 {
2254 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
2255 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
2256 PGENERIC_LIST_ENTRY ListEntry;
2257
2258 /* Search for default language */
2259 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
2260 ListEntry = GetNextListEntry(ListEntry))
2261 {
2262 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2263 if (!wcsicmp(pSetupData->DefaultLanguage, LocaleId))
2264 {
2265 DPRINT("found %S in LanguageList\n", LocaleId);
2266 SetCurrentListEntry(LanguageList, ListEntry);
2267 break;
2268 }
2269 }
2270
2271 /* Search for default layout */
2272 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
2273 ListEntry = GetNextListEntry(ListEntry))
2274 {
2275 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2276 if (!wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
2277 {
2278 DPRINT("Found %S in LayoutList\n", pszLayoutId);
2279 SetCurrentListEntry(LayoutList, ListEntry);
2280 break;
2281 }
2282 }
2283 }
2284
2285 return TRUE;
2286}
DWORD Id
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
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1210
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define C_ASSERT(e)
Definition: intsafe.h:73
USHORT LANGID
Definition: mui.h:9
PGENERIC_LIST_ENTRY GetFirstListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:104
PGENERIC_LIST_ENTRY GetNextListEntry(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:114
PGENERIC_LIST CreateNTOSInstallationsList(_In_ PPARTLIST PartList)
Create a list of available NT OS installations on the computer, by searching for recognized ones on e...
Definition: osdetect.c:763
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
DWORD LCID
Definition: nls.h:13
PPARTLIST CreatePartitionList(VOID)
Definition: partlist.c:1925
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
Definition: wdfpdo.h:437
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define KL_NAMELENGTH
Definition: winuser.h:122

Referenced by _tWinMain().

◆ PrepareAndDoCopyThread()

static DWORD WINAPI PrepareAndDoCopyThread ( IN LPVOID  Param)
static

Definition at line 1760 of file reactos.c.

1762{
1763 PSETUPDATA pSetupData;
1764 HWND hwndDlg = (HWND)Param;
1765 HWND hWndProgress;
1766 LONG_PTR dwStyle;
1767 ERROR_NUMBER ErrorNumber;
1770 FSVOL_CONTEXT FsVolContext;
1771 COPYCONTEXT CopyContext;
1772 // WCHAR PathBuffer[MAX_PATH];
1773
1774 /* Retrieve pointer to the global setup data */
1775 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1776
1777 /* Get the progress handle */
1778 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1779
1780 /* Setup global UI context */
1781 UiContext.hwndDlg = hwndDlg;
1783 UiContext.hWndProgress = hWndProgress;
1784 UiContext.dwPbStyle = 0;
1785
1786
1787 /* Disable the Close/Cancel buttons during all partition operations */
1788 // TODO: Consider, alternatively, to just show an info-box saying
1789 // that the installation process cannot be canceled at this stage?
1790 // PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
1792
1793
1794 /*
1795 * Find/Set the system partition, and apply all pending partition operations.
1796 */
1797
1798 /* Create context for the volume/partition operations */
1799 FsVolContext.pSetupData = pSetupData;
1800
1801 /* Set status text */
1802 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Setting the system partition...");
1803 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1804
1805 /* Find or set the active system partition before starting formatting */
1810 &FsVolContext);
1811 // if (!Success)
1812 // return FsVolContext.NextPageOnAbort;
1813 //
1814 // FIXME?? If cannot use any system partition, install FreeLdr on floppy / removable media??
1815 //
1816 if (!Success)
1817 {
1818 /* Display an error if an unexpected failure happened */
1819 MessageBoxW(GetParent(hwndDlg), L"Failed to find or set the system partition!", L"Error", MB_ICONERROR);
1820
1821 /* Re-enable the Close/Cancel buttons */
1823
1824 /*
1825 * We failed due to an unexpected error, keep on the copy page to view the current state,
1826 * but enable the "Next" button to allow the user to continue to the terminate page.
1827 */
1829 return 1;
1830 }
1831
1832
1833 /* Set status text */
1834 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Preparing partitions...");
1835 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1836
1837 /* Apply all pending operations on partitions: formatting and checking */
1842 &FsVolContext);
1843 if (!Success)
1844 {
1845 /* Display an error if an unexpected failure happened */
1846 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the partitions!", L"Error", MB_ICONERROR);
1847
1848 /* Re-enable the Close/Cancel buttons */
1850
1851 /*
1852 * We failed due to an unexpected error, keep on the copy page to view the current state,
1853 * but enable the "Next" button to allow the user to continue to the terminate page.
1854 */
1856 return 1;
1857 }
1858
1859
1860 /* Re-enable the Close/Cancel buttons */
1862
1863
1864
1865 /* Re-calculate the final destination paths */
1867 Status = InitDestinationPaths(&pSetupData->USetupData,
1868 NULL, // pSetupData->USetupData.InstallationDirectory,
1870 if (!NT_SUCCESS(Status))
1871 {
1872 DisplayMessage(GetParent(hwndDlg), MB_ICONERROR, L"Error", L"InitDestinationPaths() failed with status 0x%08lx\n", Status);
1873
1874 /*
1875 * We failed due to an unexpected error, keep on the copy page to view the current state,
1876 * but enable the "Next" button to allow the user to continue to the terminate page.
1877 */
1879 return 1;
1880 }
1881
1882
1883
1884 /*
1885 * Preparation of the list of files to be copied
1886 */
1887
1888 /* Set status text */
1889 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Preparing the list of files to be copied, please wait...");
1890 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1891
1892 /* Set progress marquee style and start it up */
1893 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
1894 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
1895 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
1896
1897 /* Prepare the list of files */
1898 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
1899
1900 /* Stop progress and restore its style */
1901 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
1902 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
1903
1904 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
1905 {
1906 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1907 if (!pSetupData->bStopInstall)
1908 MessageBoxW(GetParent(hwndDlg), L"Failed to prepare the list of files!", L"Error", MB_ICONERROR);
1909
1910 /*
1911 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1912 * but enable the "Next" button to allow the user to continue to the terminate page.
1913 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1914 */
1915 if (!pSetupData->bStopInstall)
1917 return 1;
1918 }
1919
1920
1921 /*
1922 * Perform the file copy
1923 */
1924
1925 /* Set status text */
1926 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Copying the files...");
1927 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1928
1929 /* Create context for the copy process */
1930 CopyContext.pSetupData = pSetupData;
1931 CopyContext.TotalOperations = 0;
1932 CopyContext.CompletedOperations = 0;
1933
1934 /* Do the file copying - The callback handles whether or not we should stop file copying */
1935 if (!DoFileCopy(&pSetupData->USetupData, FileCopyCallback, &CopyContext))
1936 {
1937 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
1938 if (!pSetupData->bStopInstall)
1939 MessageBoxW(GetParent(hwndDlg), L"Failed to copy the files!", L"Error", MB_ICONERROR);
1940
1941 /*
1942 * If we failed due to an unexpected error, keep on the copy page to view the current state,
1943 * but enable the "Next" button to allow the user to continue to the terminate page.
1944 * Otherwise we have been cancelled by the user, who has already switched to the Terminate page.
1945 */
1946 if (!pSetupData->bStopInstall)
1948 return 1;
1949 }
1950
1951 // /* Set status text */
1952 // SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"Finalizing the installation...");
1953 // SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1954
1955 /* Create the $winnt$.inf file */
1956 InstallSetupInfFile(&pSetupData->USetupData);
1957
1958
1959 /*
1960 * Create or update the registry hives
1961 */
1962
1963 /* Set status text */
1965 pSetupData->hInstance,
1968 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
1969
1970 /* Set up the progress bar */
1971 SendMessageW(hWndProgress,
1972 PBM_SETRANGE, 0,
1973 MAKELPARAM(0, 8)); // FIXME: hardcoded number of steps, see StringIDs[] array in RegistryStatus()
1974 SendMessageW(hWndProgress,
1975 PBM_SETSTEP, 1, 0);
1976 SendMessageW(hWndProgress,
1977 PBM_SETPOS, 0, 0);
1978
1979 ErrorNumber = UpdateRegistry(&pSetupData->USetupData,
1980 pSetupData->RepairUpdateFlag,
1981 pSetupData->PartitionList,
1982 InstallVolume->Info.DriveLetter,
1983 pSetupData->SelectedLanguageId,
1985 NULL /* SubstSettings */);
1986 DBG_UNREFERENCED_PARAMETER(ErrorNumber);
1988
1989
1990 /* We are done! Switch to the Terminate page */
1992 return 0;
1993}
unsigned char BOOLEAN
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
VOID PropSheet_SetCloseCancel(_In_ HWND hWndWiz, _In_ BOOL Enable)
Enables or disables the Cancel and the Close title-bar property-sheet window buttons.
Definition: reactos.c:1747
static VOID __cdecl RegistryStatus(IN REGISTRY_STATUS RegStatus,...)
Definition: reactos.c:1711
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1250
#define SystemVolume
Definition: reactos.c:52
#define InstallVolume
Definition: reactos.c:47
PPARTENTRY InstallPartition
Definition: reactos.c:45
PPARTENTRY SystemPartition
Definition: reactos.c:50
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:250
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:1594
#define IDC_PROCESSPROGRESS
Definition: resource.h:60
#define IDS_UPDATE_REGISTRY
Definition: resource.h:131
#define IDC_ACTIVITY
Definition: resource.h:58
#define IDS_CREATE_REGISTRY
Definition: resource.h:130
HANDLE HWND
Definition: compat.h:19
enum _ERROR_NUMBER ERROR_NUMBER
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:318
BOOLEAN FsVolCommitOpsQueue(_In_ PPARTLIST PartitionList, _In_ PVOLENTRY SystemVolume, _In_ PVOLENTRY InstallVolume, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Definition: fsutil.c:1087
NTSTATUS InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:797
BOOLEAN InitSystemPartition(_In_ PPARTLIST PartitionList, _In_ PPARTENTRY InstallPartition, _Out_ PPARTENTRY *pSystemPartition, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Find or set the active system partition.
Definition: setuplib.c:614
ERROR_NUMBER UpdateRegistry(IN OUT PUSETUP_DATA pSetupData, IN BOOLEAN RepairUpdateFlag, IN PPARTLIST PartitionList, IN WCHAR DestinationDriveLetter, IN PCWSTR SelectedLanguageId, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL)
Definition: setuplib.c:1098
VOID InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:202
PCWSTR SelectedLanguageId
Definition: reactos.h:159
PPARTLIST PartitionList
Definition: reactos.h:148

Referenced by ProcessDlgProc().

◆ ProcessDlgProc()

static INT_PTR CALLBACK ProcessDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1997 of file reactos.c.

2002{
2003 PSETUPDATA pSetupData;
2004
2005 /* Retrieve pointer to the global setup data */
2006 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2007
2008 switch (uMsg)
2009 {
2010 case WM_INITDIALOG:
2011 {
2012 /* Save pointer to the global setup data */
2013 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2014 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2015
2016 /* Reset status text */
2017 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
2018 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2019
2020 break;
2021 }
2022
2023 case WM_NOTIFY:
2024 {
2025 LPNMHDR lpnm = (LPNMHDR)lParam;
2026
2027 switch (lpnm->code)
2028 {
2029 case PSN_SETACTIVE:
2030 {
2031 /* Create the file-copy halt (manual-reset) event */
2032 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
2033 if (!pSetupData->hHaltInstallEvent)
2034 break;
2035 pSetupData->bStopInstall = FALSE;
2036
2037 /* Start the prepare-and-copy files thread */
2038 pSetupData->hInstallThread =
2039 CreateThread(NULL, 0,
2041 (PVOID)hwndDlg,
2043 NULL);
2044 if (!pSetupData->hInstallThread)
2045 {
2046 CloseHandle(pSetupData->hHaltInstallEvent);
2047 pSetupData->hHaltInstallEvent = NULL;
2048
2049 MessageBoxW(GetParent(hwndDlg), L"Cannot create the prepare-and-copy files thread!", L"Error", MB_ICONERROR);
2050 break;
2051 }
2052
2053 /* Disable all buttons during installation process - buttons will be reenabled by the installation thread */
2055
2056 /* Resume the installation thread */
2057 ResumeThread(pSetupData->hInstallThread);
2058
2059 break;
2060 }
2061
2062 case PSN_QUERYCANCEL:
2063 {
2064 /* Halt the on-going file copy */
2065 ResetEvent(pSetupData->hHaltInstallEvent);
2066
2067 if (DisplayMessage(GetParent(hwndDlg),
2071 {
2072 /* Stop the file copy thread */
2073 pSetupData->bStopInstall = TRUE;
2074 SetEvent(pSetupData->hHaltInstallEvent);
2075
2076#if 0
2077 /* Wait for any pending installation */
2079 CloseHandle(pSetupData->hInstallThread);
2080 pSetupData->hInstallThread = NULL;
2081 CloseHandle(pSetupData->hHaltInstallEvent);
2082 pSetupData->hHaltInstallEvent = NULL;
2083#endif
2084
2085 // TODO: Unwind installation?!
2086
2087 /* Go to the Terminate page */
2089 }
2090 else
2091 {
2092 /* We don't stop installation, resume file copy */
2093 SetEvent(pSetupData->hHaltInstallEvent);
2094 }
2095
2096 /* Do not close the wizard too soon */
2098 return TRUE;
2099 }
2100
2101 default:
2102 break;
2103 }
2104 }
2105 break;
2106
2107 default:
2108 break;
2109
2110 }
2111
2112 return FALSE;
2113}
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1760
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
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 CREATE_SUSPENDED
Definition: winbase.h:178

Referenced by _tWinMain().

◆ PropSheet_SetCloseCancel()

VOID PropSheet_SetCloseCancel ( _In_ HWND  hWndWiz,
_In_ BOOL  Enable 
)

Enables or disables the Cancel and the Close title-bar property-sheet window buttons.

Definition at line 1747 of file reactos.c.

1750{
1751 EnableDlgItem(hWndWiz, IDCANCEL, Enable);
1752 // ShowDlgItem(hWndWiz, IDCANCEL, Enable ? SW_SHOW : SW_HIDE);
1754 SC_CLOSE,
1756}
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define MF_BYCOMMAND
Definition: winuser.h:202
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MF_ENABLED
Definition: winuser.h:128
#define SC_CLOSE
Definition: winuser.h:2595
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_GRAYED
Definition: winuser.h:129

Referenced by PrepareAndDoCopyThread().

◆ RegistryStatus()

static VOID __cdecl RegistryStatus ( IN REGISTRY_STATUS  RegStatus,
  ... 
)
static

Definition at line 1711 of file reactos.c.

1712{
1713 /* WARNING: Please keep this lookup table in sync with the resources! */
1714 static const UINT StringIDs[] =
1715 {
1716 IDS_REG_DONE, /* Success */
1717 IDS_REG_REGHIVEUPDATE, /* RegHiveUpdate */
1718 IDS_REG_IMPORTFILE, /* ImportRegHive */
1719 IDS_REG_DISPLAYSETTINGSUPDATE, /* DisplaySettingsUpdate */
1720 IDS_REG_LOCALESETTINGSUPDATE, /* LocaleSettingsUpdate */
1721 IDS_REG_ADDKBLAYOUTS, /* KeybLayouts */
1722 IDS_REG_KEYBOARDSETTINGSUPDATE, /* KeybSettingsUpdate */
1723 IDS_REG_CODEPAGEINFOUPDATE, /* CodePageInfoUpdate */
1724 };
1725
1726 if (RegStatus < _countof(StringIDs))
1727 {
1728 va_list args;
1729 va_start(args, RegStatus);
1731 va_end(args);
1732 }
1733 else
1734 {
1736 }
1737
1739}
VOID __cdecl SetWindowResPrintfW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
Definition: reactos.c:277
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:261
#define IDS_REG_REGHIVEUPDATE
Definition: resource.h:134
#define IDS_REG_CODEPAGEINFOUPDATE
Definition: resource.h:140
#define IDS_REG_DONE
Definition: resource.h:133
#define IDS_REG_IMPORTFILE
Definition: resource.h:135
#define IDS_REG_UNKNOWN
Definition: resource.h:141
#define IDS_REG_KEYBOARDSETTINGSUPDATE
Definition: resource.h:139
#define IDS_REG_ADDKBLAYOUTS
Definition: resource.h:138
#define IDS_REG_LOCALESETTINGSUPDATE
Definition: resource.h:137
#define IDS_REG_DISPLAYSETTINGSUPDATE
Definition: resource.h:136

Referenced by PrepareAndDoCopyThread().

◆ RestartDlgProc()

static INT_PTR CALLBACK RestartDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 2116 of file reactos.c.

2121{
2122 PSETUPDATA pSetupData;
2123
2124 /* Retrieve pointer to the global setup data */
2125 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2126
2127 switch (uMsg)
2128 {
2129 case WM_INITDIALOG:
2130 /* Save pointer to the global setup data */
2131 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
2132 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2133
2134 /* Set title font */
2135 SendDlgItemMessage(hwndDlg,
2137 WM_SETFONT,
2138 (WPARAM)pSetupData->hTitleFont,
2139 (LPARAM)TRUE);
2140 break;
2141
2142 case WM_TIMER:
2143 {
2144 INT Position;
2145 HWND hWndProgress;
2146
2147 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2148 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2149 if (Position == 300)
2150 {
2151 KillTimer(hwndDlg, 1);
2153 }
2154 else
2155 {
2156 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2157 }
2158 return TRUE;
2159 }
2160
2161 case WM_DESTROY:
2162 return TRUE;
2163
2164 case WM_NOTIFY:
2165 {
2166 LPNMHDR lpnm = (LPNMHDR)lParam;
2167
2168 switch (lpnm->code)
2169 {
2170 case PSN_SETACTIVE:
2171 {
2172 /* Only "Finish" for closing the wizard */
2175
2176 /* Set up the reboot progress bar */
2179 SetTimer(hwndDlg, 1, 50, NULL);
2180 break;
2181 }
2182
2183 default:
2184 break;
2185 }
2186 }
2187 break;
2188
2189 default:
2190 break;
2191
2192 }
2193
2194 return FALSE;
2195}
#define ShowDlgItem(hDlg, nID, nCmdShow)
Definition: reactos.h:51
#define IDC_FINISHTITLE
Definition: resource.h:63
#define IDC_RESTART_PROGRESS
Definition: resource.h:64
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSBTN_FINISH
Definition: prsht.h:148
#define PBM_GETPOS
Definition: commctrl.h:2199
static COORD Position
Definition: mouse.c:34
UINT_PTR WPARAM
Definition: windef.h:207
#define SW_HIDE
Definition: winuser.h:771
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_SETFONT
Definition: winuser.h:1653
#define WM_TIMER
Definition: winuser.h:1745
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SendDlgItemMessage
Definition: winuser.h:5854

Referenced by _tWinMain().

◆ SetWindowResPrintfVW()

VOID SetWindowResPrintfVW ( _In_ HWND  hWnd,
_In_opt_ HINSTANCE  hInstance,
_In_ UINT  uID,
_In_ va_list  args 
)

Definition at line 261 of file reactos.c.

266{
267 WCHAR ResBuffer[256];
268 WCHAR szText[256];
269
270 LoadStringW(hInstance, uID, ResBuffer, _countof(ResBuffer));
271 StringCchVPrintfW(szText, _countof(szText), ResBuffer, args);
272 SetWindowTextW(hWnd, szText);
273}

Referenced by RegistryStatus(), and SetWindowResPrintfW().

◆ SetWindowResPrintfW()

VOID __cdecl SetWindowResPrintfW ( _In_ HWND  hWnd,
_In_opt_ HINSTANCE  hInstance,
_In_ UINT  uID,
  ... 
)

Definition at line 277 of file reactos.c.

282{
284
285 va_start(args, uID);
287 va_end(args);
288}

Referenced by RegistryStatus().

◆ SetWindowResTextW()

VOID SetWindowResTextW ( _In_ HWND  hWnd,
_In_opt_ HINSTANCE  hInstance,
_In_ UINT  uID 
)

Definition at line 250 of file reactos.c.

254{
255 WCHAR szText[256];
256 LoadStringW(hInstance, uID, szText, _countof(szText));
257 SetWindowTextW(hWnd, szText);
258}

Referenced by PrepareAndDoCopyThread().

◆ StartDlgProc()

static INT_PTR CALLBACK StartDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 291 of file reactos.c.

296{
297 PSETUPDATA pSetupData;
298
299 /* Retrieve pointer to the global setup data */
300 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
301
302 switch (uMsg)
303 {
304 case WM_INITDIALOG:
305 {
306 /* Save pointer to the global setup data */
307 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
308 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
309
310 /* Set title font */
311 SendDlgItemMessage(hwndDlg,
314 (WPARAM)pSetupData->hTitleFont,
315 (LPARAM)TRUE);
316
317 /* Center the wizard window */
318 CenterWindow(GetParent(hwndDlg));
319 break;
320 }
321
322 case WM_NOTIFY:
323 {
324 LPNMHDR lpnm = (LPNMHDR)lParam;
325
326 switch (lpnm->code)
327 {
328 case PSN_SETACTIVE:
330 break;
331
332 default:
333 break;
334 }
335 }
336 break;
337
338 default:
339 break;
340
341 }
342
343 return FALSE;
344}
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:61
#define IDC_STARTTITLE
Definition: resource.h:19

Referenced by _tWinMain().

◆ SummaryDlgProc()

static INT_PTR CALLBACK SummaryDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 999 of file reactos.c.

1004{
1005 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
1006
1007 PSETUPDATA pSetupData;
1008
1009 /* Retrieve pointer to the global setup data */
1010 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1011
1012 switch (uMsg)
1013 {
1014 case WM_INITDIALOG:
1015 {
1016 /* Save pointer to the global setup data */
1017 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1018 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1019 break;
1020 }
1021
1022 case WM_COMMAND:
1023 {
1025 {
1028 else
1030 }
1031 break;
1032 }
1033
1034 case WM_NOTIFY:
1035 {
1036 LPNMHDR lpnm = (LPNMHDR)lParam;
1037
1038 switch (lpnm->code)
1039 {
1040 case PSN_SETACTIVE:
1041 {
1042 WCHAR CurrentItemText[256];
1043
1045
1046 /* Show the current selected settings */
1047
1048 // FIXME! Localize
1049 if (pSetupData->RepairUpdateFlag)
1050 {
1051 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1052 L"Upgrading/Repairing \"%s\" from \"%s\"",
1054 pSetupData->CurrentInstallation->VendorName);
1055 }
1056 else
1057 {
1058 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1059 L"New ReactOS installation");
1060 }
1061 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
1062
1063 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
1064 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
1065
1067 CurrentItemText,
1068 ARRAYSIZE(CurrentItemText));
1069 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
1070
1072 CurrentItemText,
1073 ARRAYSIZE(CurrentItemText));
1074 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
1075
1077 CurrentItemText,
1078 ARRAYSIZE(CurrentItemText));
1079 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
1080
1081 if (InstallVolume->Info.DriveLetter)
1082 {
1083#if 0
1084 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1085 L"%c: \x2014 %wZ",
1086 InstallVolume->Info.DriveLetter,
1087 &pSetupData->USetupData.DestinationRootPath);
1088#else
1089 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1090 L"%c: \x2014 Harddisk %lu, Partition %lu",
1091 InstallVolume->Info.DriveLetter,
1092 InstallPartition->DiskEntry->DiskNumber,
1094#endif
1095 }
1096 else
1097 {
1098#if 0
1099 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1100 L"%wZ",
1101 &pSetupData->USetupData.DestinationRootPath);
1102#else
1103 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1104 L"Harddisk %lu, Partition %lu",
1105 InstallPartition->DiskEntry->DiskNumber,
1107#endif
1108 }
1109 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
1110
1111 SetDlgItemTextW(hwndDlg, IDC_PATH,
1113 /*pSetupData->USetupData.InstallPath.Buffer*/);
1114
1115
1116 /* Change the "Next" button text to "Install" */
1117 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
1119 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
1120 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, L"Install"); // FIXME: Localize!
1121
1122 /*
1123 * Keep the "Next" button disabled. It will be enabled only
1124 * when the user clicks on the installation approval checkbox.
1125 */
1128 break;
1129 }
1130
1132 {
1133 /* Focus on the confirmation check-box */
1135 return TRUE;
1136 }
1137
1138 case PSN_KILLACTIVE:
1139 {
1140 /* Restore the original "Next" button text */
1141 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
1142 break;
1143 }
1144
1145 case PSN_QUERYCANCEL:
1146 {
1147 if (DisplayMessage(GetParent(hwndDlg),
1151 {
1152 /* Go to the Terminate page */
1154 }
1155
1156 /* Do not close the wizard too soon */
1158 return TRUE;
1159 }
1160
1161 default:
1162 break;
1163 }
1164 break;
1165 }
1166
1167 default:
1168 break;
1169 }
1170
1171 return FALSE;
1172}
#define ID_WIZNEXT
Definition: reactos.h:59
#define IDC_CONFIRM_INSTALL
Definition: resource.h:55
#define IDC_ARCHITECTURE
Definition: resource.h:49
#define IDC_PATH
Definition: resource.h:67
#define IDC_DESTDRIVE
Definition: resource.h:53
#define IDC_INSTALLTYPE
Definition: resource.h:47
#define IDC_INSTALLSOURCE
Definition: resource.h:48
WPARAM wParam
Definition: combotst.c:138
PGENERIC_LIST_ENTRY GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:97
#define LOWORD(l)
Definition: pedump.c:82
#define PSN_KILLACTIVE
Definition: prsht.h:116
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
ULONG OnDiskPartitionNumber
Definition: partlist.h:74
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:149
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:115
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:148
#define HIWORD(l)
Definition: typedefs.h:247
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define WM_COMMAND
Definition: winuser.h:1743
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1928
#define BST_CHECKED
Definition: winuser.h:197

Referenced by _tWinMain().

◆ TypeDlgProc()

static INT_PTR CALLBACK TypeDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 347 of file reactos.c.

352{
353 PSETUPDATA pSetupData;
354
355 /* Retrieve pointer to the global setup data */
356 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
357
358 switch (uMsg)
359 {
360 case WM_INITDIALOG:
361 {
362 /* Save pointer to the global setup data */
363 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
364 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
365
366 /* Check the 'install' radio button */
368
369 /*
370 * Enable the 'update' radio button and text only if we have
371 * available NT installations, otherwise disable them.
372 */
373 if (pSetupData->NtOsInstallsList &&
375 {
378 }
379 else
380 {
383 }
384
385 break;
386 }
387
388 case WM_NOTIFY:
389 {
390 LPNMHDR lpnm = (LPNMHDR)lParam;
391
392 switch (lpnm->code)
393 {
394 case PSN_SETACTIVE:
396 break;
397
399 {
400 /* Focus on "Install ReactOS" */
402 return TRUE;
403 }
404
405 case PSN_QUERYCANCEL:
406 {
407 if (DisplayMessage(GetParent(hwndDlg),
411 {
412 /* Go to the Terminate page */
414 }
415
416 /* Do not close the wizard too soon */
418 return TRUE;
419 }
420
421 case PSN_WIZNEXT: /* Set the selected data */
422 {
423 /*
424 * Go update only if we have available NT installations
425 * and we choose to do so.
426 */
427 if (pSetupData->NtOsInstallsList &&
428 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
430 {
431 pSetupData->RepairUpdateFlag = TRUE;
432
433 /*
434 * Display the existing NT installations page only
435 * if we have more than one available NT installations.
436 */
437 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
438 {
439 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
440
441 /* Actually the best would be to dynamically insert the page only when needed */
443 }
444 else
445 {
446 /* Retrieve the current installation */
447 pSetupData->CurrentInstallation =
449
451 }
452 }
453 else
454 {
455 pSetupData->CurrentInstallation = NULL;
456 pSetupData->RepairUpdateFlag = FALSE;
458 }
459
460 return TRUE;
461 }
462
463 default:
464 break;
465 }
466 }
467 break;
468
469 default:
470 break;
471
472 }
473 return FALSE;
474}
#define IDC_UPDATE
Definition: resource.h:24
#define IDC_UPDATETEXT
Definition: resource.h:25
#define IDC_INSTALL
Definition: fontview.h:13
ULONG GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:140
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:150
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)

Referenced by _tWinMain().

◆ UpgradeRepairDlgProc()

static INT_PTR CALLBACK UpgradeRepairDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 710 of file reactos.c.

715{
716 PSETUPDATA pSetupData;
717 HWND hList;
718 HIMAGELIST hSmall;
719
720 /* Retrieve pointer to the global setup data */
721 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
722
723 switch (uMsg)
724 {
725 case WM_INITDIALOG:
726 {
727 /* Save pointer to the global setup data */
728 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
729 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
730
731 /*
732 * Keep the "Next" button disabled. It will be enabled only
733 * when the user selects an installation to upgrade.
734 */
736
737 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
738
740
742 hList,
747
748 /* Create the ImageList */
751 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
752 1, 1);
753
754 /* Add event type icons to the ImageList */
757
758 /* Assign the ImageList to the List View */
760
762 break;
763 }
764
765 case WM_DESTROY:
766 {
767 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
770 ImageList_Destroy(hSmall);
771 return TRUE;
772 }
773
774 case WM_COMMAND:
775 switch (LOWORD(wParam))
776 {
777 case IDC_SKIPUPGRADE:
778 {
779 /* Skip the upgrade and do the usual new-installation workflow */
780 pSetupData->CurrentInstallation = NULL;
781 pSetupData->RepairUpdateFlag = FALSE;
783 return TRUE;
784 }
785 }
786 break;
787
788 case WM_NOTIFY:
789 {
790 LPNMHDR lpnm = (LPNMHDR)lParam;
791
792 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
793 {
795
796 if (pnmv->uChanged & LVIF_STATE) /* The state has changed */
797 {
798 /* The item has been (de)selected */
799 if (pnmv->uNewState & (LVIS_FOCUSED | LVIS_SELECTED))
800 {
802 }
803 else
804 {
805 /*
806 * Keep the "Next" button disabled. It will be enabled only
807 * when the user selects an installation to upgrade.
808 */
810 }
811 }
812
813 break;
814 }
815
816 switch (lpnm->code)
817 {
818#if 0
819 case PSN_SETACTIVE:
820 {
821 /*
822 * Keep the "Next" button disabled. It will be enabled only
823 * when the user selects an installation to upgrade.
824 */
826 break;
827 }
828#endif
829
831 {
832 /* Give the focus on and select the first item */
833 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
836 return TRUE;
837 }
838
839 case PSN_QUERYCANCEL:
840 {
841 if (DisplayMessage(GetParent(hwndDlg),
845 {
846 /* Go to the Terminate page */
848 }
849
850 /* Do not close the wizard too soon */
852 return TRUE;
853 }
854
855 case PSN_WIZNEXT: /* Set the selected data */
856 {
857 /*
858 * Go update only if we have available NT installations
859 * and we choose to do so.
860 */
861 if (!pSetupData->NtOsInstallsList ||
863 {
864 pSetupData->CurrentInstallation = NULL;
865 pSetupData->RepairUpdateFlag = FALSE;
866 break;
867 }
868
869 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
872
873 /* Retrieve the current installation */
874 pSetupData->CurrentInstallation =
876
877 /* We perform an upgrade */
878 pSetupData->RepairUpdateFlag = TRUE;
879 return TRUE;
880 }
881
882 default:
883 break;
884 }
885 }
886 break;
887
888 default:
889 break;
890
891 }
892 return FALSE;
893}
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:614
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:706
#define MAX_LIST_COLUMNS
Definition: reactos.c:704
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:707
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:577
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:479
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:645
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:705
#define IDI_WINICON
Definition: resource.h:10
#define IDI_ROSICON
Definition: resource.h:9
#define IDC_SKIPUPGRADE
Definition: resource.h:29
#define IDC_NTOSLIST
Definition: resource.h:28
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 LVSIL_SMALL
Definition: commctrl.h:2304
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2731
#define LVIF_STATE
Definition: commctrl.h:2317
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2309
#define ListView_GetImageList(hwnd, iImageList)
Definition: commctrl.h:2301
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739
struct tagNMLISTVIEW * LPNMLISTVIEW
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_MASK
Definition: commctrl.h:351
#define LVN_ITEMCHANGED
Definition: commctrl.h:3136
UINT_PTR idFrom
Definition: winuser.h:3161
UINT uNewState
Definition: commctrl.h:3041
#define SM_CYSMICON
Definition: winuser.h:1016
#define SM_CXSMICON
Definition: winuser.h:1015
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2119
int WINAPI GetSystemMetrics(_In_ int)

Referenced by _tWinMain().

Variable Documentation

◆ column_alignment

const INT column_alignment[MAX_LIST_COLUMNS] = {LVCFMT_LEFT, LVCFMT_LEFT, LVCFMT_LEFT}
static

Definition at line 707 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ column_ids

Definition at line 705 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ column_widths

const INT column_widths[MAX_LIST_COLUMNS] = {200, 150, 100}
static

Definition at line 706 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ InstallPartition

PPARTENTRY InstallPartition = NULL

◆ IsUnattendedSetup

BOOLEAN IsUnattendedSetup = FALSE

Definition at line 41 of file reactos.c.

Referenced by _tWinMain(), FsVolCallback(), and LoadSetupData().

◆ ProcessHeap

HANDLE ProcessHeap
  • Internal Headers *‍/

Definition at line 40 of file reactos.c.

Referenced by _tWinMain(), ConvertNtPathToWin32Path(), and FreeNtToWin32PathMappingList().

◆ SetupData

◆ SystemPartition

◆ UiContext