ReactOS 0.4.17-dev-650-gd0e71de
reactos.c File Reference
#include "reactos.h"
#include <winnls.h>
#include <ndk/obfuncs.h>
#include "resource.h"
#include <debug.h>
#include <ndk/exfuncs.h>
#include <delayimp.h>
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for reactos.c:

Go to the source code of this file.

Classes

struct  _FSVOL_CONTEXT
 
struct  _COPYCONTEXT
 
struct  _CLOSABLE_WND_INFO
 
struct  DLGTEMPLATEEX
 

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)
 
#define PM_INSTALL_START   (WM_APP + 1)
 
#define PM_INSTALL_DONE   (WM_APP + 2)
 
#define DECLARE_UNICODE_STRING_SIZE(_var, _size)
 
#define DELAYIMP_INSECURE_WRITABLE_HOOKS
 
#define REACTOS_SETUP_MUTEX   L"__ReactOS_Setup__"
 

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
 
typedef struct _CLOSABLE_WND_INFO CLOSABLE_WND_INFO
 
typedef struct _CLOSABLE_WND_INFOPCLOSABLE_WND_INFO
 
typedef struct DLGTEMPLATEEX DLGTEMPLATEEX
 
typedef struct DLGTEMPLATEEXLPDLGTEMPLATEEX
 

Functions

static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateBoldFont (_In_opt_ HFONT hOrigFont, _In_opt_ INT PointSize)
 Create a bold font derived from the provided font.
 
static HFONT CreateTitleFont (_In_opt_ HFONT hOrigFont)
 
size_t LoadAllocStringW (_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen)
 
size_t FormatAllocStringWV (_In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen, _In_ PCWSTR pszFormat, _In_ va_list args)
 
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)
 Enable or disable the Cancel and the Close title-bar property-sheet 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 BOOL IsShellActive (VOID)
 Detects whether a Windows shell is active.
 
static BOOL CALLBACK FindUserClosableWindowProc (_In_ HWND hWnd, _In_ LPARAM lParam)
 
static BOOL AreThereInteractiveWindows (_In_opt_ HWND hWndExclude)
 Detects whether there exist interactive closable windows opened.
 
static INT_PTR CALLBACK FinishDlgProc (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)
 
static PCWSTR GetLocalSetupDllPath (VOID)
 
static FARPROC WINAPI setupDelayHook (unsigned dliNotify, PDelayLoadInfo pdli)
 Controls the delay-loading of Setup DLLs from a suitable path.
 
static LRESULT CALLBACK PrshtWndProc (HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
 
static int CALLBACK PropSheetCallback (_In_ HWND hDlg, _In_ UINT message, _In_ LPARAM lParam)
 
static HANDLE CheckForOtherInstance (_In_ HINSTANCE hInstance)
 Ensure only one ReactOS Setup instance is running. If another instance already exists, find and activate its window.
 
int WINAPI _tWinMain (HINSTANCE hInst, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
 

Variables

HANDLE ProcessHeap
 
SETUPDATA SetupData
 
PPARTENTRY InstallPartition = NULL
 
PPARTENTRY SystemPartition = NULL
 
UI_CONTEXT UiContext
 
HCURSOR hWaitCursor
 
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}
 
PfnDliHook __pfnDliNotifyHook2 = setupDelayHook
 Custom delay-loading hooks for loading the Setup DLLs from a suitable path.
 
PfnDliHook __pfnDliFailureHook2 = setupDelayHook
 
WNDPROC wpOrgPrshtProc = NULL
 
struct {
   BOOL   IncludeForUnattended
 
   DWORD   dwFlags
 
   PCWSTR   pszTemplate
 
   PCWSTR   pszHeaderTitle
 
   PCWSTR   pszHeaderSubTitle
 
   DLGPROC   pfnDlgProc
 
WizardPages []
 

Macro Definition Documentation

◆ DECLARE_UNICODE_STRING_SIZE

#define DECLARE_UNICODE_STRING_SIZE (   _var,
  _size 
)
Value:
WCHAR _var ## _buffer[_size]; \
UNICODE_STRING _var = { 0, (_size) * sizeof(WCHAR) , _var ## _buffer }
short WCHAR
Definition: pedump.c:58

Definition at line 3423 of file reactos.c.

◆ DELAYIMP_INSECURE_WRITABLE_HOOKS

#define DELAYIMP_INSECURE_WRITABLE_HOOKS

Definition at line 3428 of file reactos.c.

◆ IDS_LIST_COLUMN_FIRST

#define IDS_LIST_COLUMN_FIRST   IDS_INSTALLATION_NAME

Definition at line 820 of file reactos.c.

◆ IDS_LIST_COLUMN_LAST

#define IDS_LIST_COLUMN_LAST   IDS_INSTALLATION_VENDOR

Definition at line 821 of file reactos.c.

◆ InstallVolume

#define InstallVolume   (InstallPartition->Volume)

Definition at line 29 of file reactos.c.

◆ MAX_LIST_COLUMNS

#define MAX_LIST_COLUMNS   (IDS_LIST_COLUMN_LAST - IDS_LIST_COLUMN_FIRST + 1)

Definition at line 823 of file reactos.c.

◆ NDEBUG

#define NDEBUG

Definition at line 18 of file reactos.c.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 13 of file reactos.c.

◆ PM_INSTALL_DONE

#define PM_INSTALL_DONE   (WM_APP + 2)

Definition at line 1950 of file reactos.c.

◆ PM_INSTALL_START

#define PM_INSTALL_START   (WM_APP + 1)

Definition at line 1949 of file reactos.c.

◆ REACTOS_SETUP_MUTEX

#define REACTOS_SETUP_MUTEX   L"__ReactOS_Setup__"

◆ SystemVolume

#define SystemVolume   (SystemPartition->Volume)

Definition at line 34 of file reactos.c.

Typedef Documentation

◆ CLOSABLE_WND_INFO

◆ COPYCONTEXT

◆ DLGTEMPLATEEX

◆ FSVOL_CONTEXT

◆ LPDLGTEMPLATEEX

◆ 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 687 of file reactos.c.

◆ PCLOSABLE_WND_INFO

◆ 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 630 of file reactos.c.

Function Documentation

◆ _tWinMain()

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

Definition at line 3758 of file reactos.c.

3762{
3763 ULONG Error;
3764 HANDLE hHotkeyThread;
3766 PROPSHEETHEADERW psh = {0};
3767 PROPSHEETPAGEW psp = {0};
3769 UINT nPages, i;
3770
3771 /* Ensure only one instance is running */
3773 return 0;
3774
3776
3781
3782 /* Initialize the NT to Win32 path prefix mapping list */
3784
3785 /* Initialize Setup */
3788 if (Error != ERROR_SUCCESS)
3789 {
3790 //
3791 // TODO: Write an error mapper (much like the MUIDisplayError of USETUP)
3792 //
3794 MessageBoxW(NULL, L"GetSourcePaths failed!", NULL, MB_ICONERROR);
3795 else if (Error == ERROR_LOAD_TXTSETUPSIF)
3797 else // FIXME!!
3798 MessageBoxW(NULL, L"Unknown error!", NULL, MB_ICONERROR);
3799
3800 goto Quit;
3801 }
3802
3803 /* Retrieve any supplemental options from the unattend file */
3805
3806 /* Load extra setup data (HW lists etc...) */
3807 if (!LoadSetupData(&SetupData))
3808 goto Quit;
3809
3810 hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
3811
3812 /* Whenever any of the common controls are used in your app,
3813 * you must call InitCommonControlsEx() to register the classes
3814 * for those controls. */
3815 iccx.dwSize = sizeof(iccx);
3817 InitCommonControlsEx(&iccx);
3818
3819 /* Register the TreeList control */
3820 // RegisterTreeListClass(hInst);
3822
3823 /* Create the title and bold fonts */
3826
3827 /* Create each page */
3828 psp.dwSize = sizeof(psp);
3829 psp.hInstance = hInst;
3830 psp.lParam = (LPARAM)&SetupData;
3831 for (nPages = 0, i = 0; i < _countof(WizardPages); ++i)
3832 {
3833 /* Skip pages that don't apply to unattended mode */
3834 if (SetupData.bUnattend && !WizardPages[i].IncludeForUnattended)
3835 continue;
3836
3837 psp.dwFlags = PSP_DEFAULT | WizardPages[i].dwFlags;
3838 psp.pszTemplate = WizardPages[i].pszTemplate;
3839#if 1
3840 // FIXME: HACK: Wine comctl32 propsheet.c doesn't correctly set the wizard
3841 // dialog title when the pages don't have captions, even if the user sends
3842 // an initial PSM_SETTITLE message via the callback -- see CORE-20687.
3843 // To avert this problem, force-set the same title to each page, before
3844 // creating the wizard.
3845 psp.dwFlags |= PSP_USETITLE;
3847#endif
3848 psp.pfnDlgProc = WizardPages[i].pfnDlgProc;
3849 psp.pszHeaderTitle = WizardPages[i].pszHeaderTitle;
3850 psp.pszHeaderSubTitle = WizardPages[i].pszHeaderSubTitle;
3851 ahpsp[nPages++] = CreatePropertySheetPage(&psp);
3852 }
3853
3854 /* Create the property sheet */
3855 psh.dwSize = sizeof(psh);
3856 psh.dwFlags = PSH_WIZARD97 | PSH_USEICONID | PSH_USECALLBACK | PSH_WATERMARK | PSH_HEADER;
3857 psh.hInstance = hInst;
3858 psh.hwndParent = NULL;
3860 psh.nPages = nPages;
3861 psh.nStartPage = 0;
3862 psh.phpage = ahpsp;
3864 psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_WATERMARK);
3865 psh.pszbmHeader = MAKEINTRESOURCEW(IDB_HEADER);
3866
3867 /* Display the wizard */
3868 PropertySheetW(&psh);
3869
3870 if (SetupData.hBoldFont)
3874
3875 /* Unregister the TreeList control */
3876 // UnregisterTreeListClass(hInst);
3878
3879 if (hHotkeyThread)
3880 {
3881 PostThreadMessageW(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
3882 CloseHandle(hHotkeyThread);
3883 }
3884
3885Quit:
3886 /* Setup has finished */
3888
3889 /* Free the NT to Win32 path prefix mapping list */
3891
3892 /* Force reboot if there are no other user-interactive windows opened */
3894
3895 /* System rebooting will be done by Winlogon if necessary */
3897 {
3898#if 1 // TESTING: Disable for testing the installer locally.
3902#else
3903 DisplayMessage(NULL, MB_ICONWARNING, L"Restarting", L"Setup is now restarting your computer!");
3904#endif
3905 }
3906 return 0;
3907}
#define IDI_MAIN
Definition: resource.h:4
#define IDB_HEADER
Definition: resource.h:30
static HFONT CreateBoldFont(_In_opt_ HFONT hOrigFont, _In_opt_ INT PointSize)
Create a bold font derived from the provided font.
Definition: reactos.c:72
static BOOL AreThereInteractiveWindows(_In_opt_ HWND hWndExclude)
Detects whether there exist interactive closable windows opened.
Definition: reactos.c:2676
HANDLE ProcessHeap
Definition: reactos.c:23
BOOL LoadSetupData(IN OUT PSETUPDATA pSetupData)
Definition: reactos.c:2919
static HFONT CreateTitleFont(_In_opt_ HFONT hOrigFont)
Definition: reactos.c:106
static int CALLBACK PropSheetCallback(_In_ HWND hDlg, _In_ UINT message, _In_ LPARAM lParam)
Definition: reactos.c:3569
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:263
VOID FreeNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:3022
static const struct @76 WizardPages[]
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:244
VOID InitNtToWin32PathMappingList(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList)
Definition: reactos.c:3014
static HANDLE CheckForOtherInstance(_In_ HINSTANCE hInstance)
Ensure only one ReactOS Setup instance is running. If another instance already exists,...
Definition: reactos.c:3704
SETUPDATA SetupData
Definition: reactos.c:24
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: reactos.c:3332
BOOL EnablePrivilege(IN LPCWSTR lpszPrivilegeName, IN BOOL bEnablePrivilege)
Definition: reactos.c:3302
#define IDS_CAPTION
Definition: resource.h:97
#define IDB_WATERMARK
Definition: resource.h:13
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:112
BOOL Error
Definition: chkdsk.c:66
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:904
#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
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2950
#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
#define L(x)
Definition: resources.c:13
HINSTANCE hInst
Definition: dxdiag.c:13
@ ERROR_LOAD_TXTSETUPSIF
Definition: errorcode.h:24
@ ERROR_NO_SOURCE_DRIVE
Definition: errorcode.h:23
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
unsigned int UINT
Definition: sysinfo.c:13
SPFILE_EXPORTS SpFileExports
Definition: fileqsup.c:23
SPINF_EXPORTS SpInfExports
Definition: infsupp.c:24
LONG_PTR LPARAM
Definition: minwindef.h:175
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSP_USETITLE
Definition: prsht.h:26
#define PSP_DEFAULT
Definition: prsht.h:22
#define PSH_USEICONID
Definition: prsht.h:42
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
ERROR_NUMBER NTAPI InitializeSetup(_Inout_ PUSETUP_DATA pSetupData, _In_opt_ PSETUP_ERROR_ROUTINE ErrorRoutine, _In_ PSPFILE_EXPORTS pSpFileExports, _In_ PSPINF_EXPORTS pSpInfExports)
Definition: setuplib.c:1022
BOOLEAN NTAPI CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:32
VOID NTAPI FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1106
#define _countof(array)
Definition: sndvol32.h:70
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
UINT nStartPage
Definition: prsht.h:304
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPARAM lParam
Definition: prsht.h:227
LPCWSTR pszTemplate
Definition: prsht.h:218
LPCWSTR pszTitle
Definition: prsht.h:225
HINSTANCE hInstance
Definition: prsht.h:216
BOOLEAN bStopInstall
Definition: reactos.h:151
USETUP_DATA USetupData
Definition: reactos.h:156
HINSTANCE hInstance
Definition: reactos.h:127
HFONT hBoldFont
Definition: reactos.h:132
HFONT hTitleFont
Definition: reactos.h:131
HANDLE hInstallThread
Definition: reactos.h:134
BOOL bMustReboot
Definition: reactos.h:129
HANDLE hHaltInstallEvent
Definition: reactos.h:135
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:154
BOOL bUnattend
Definition: reactos.h:128
int TreeListRegister(HINSTANCE hInstance)
Definition: treelist.c:394
BOOL TreeListUnregister(HINSTANCE hInstance)
Definition: treelist.c:429
uint32_t ULONG
Definition: typedefs.h:59
#define DeleteFont(hfont)
Definition: windowsx.h:78
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:427
#define WM_QUIT
Definition: winuser.h:1651
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:798
#define EWX_REBOOT
Definition: winuser.h:646
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_ICONWARNING
Definition: winuser.h:797
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 764 of file reactos.c.

770{
772 PVOLINFO VolInfo = (NtOsInstall->Volume ? &NtOsInstall->Volume->Info : NULL);
773
774 if (VolInfo && VolInfo->DriveLetter)
775 {
776 /* We have retrieved a partition that is mounted */
777 StringCchPrintfW(Buffer, cchBufferSize,
778 L"%c:%s",
779 VolInfo->DriveLetter,
780 NtOsInstall->PathComponent);
781 }
782 else
783 {
784 /* We failed somewhere, just show the NT path */
785 StringCchPrintfW(Buffer, cchBufferSize,
786 L"%wZ",
787 &NtOsInstall->SystemNtPath);
788 }
789
790 plvItem->mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
791 plvItem->iItem = 0;
792 plvItem->iSubItem = 0;
793 plvItem->lParam = (LPARAM)Entry;
794 plvItem->pszText = NtOsInstall->InstallationName;
795
796 /* Associate vendor icon */
797 if (FindSubStrI(NtOsInstall->VendorName, VENDOR_REACTOS))
798 {
799 plvItem->mask |= LVIF_IMAGE;
800 plvItem->iImage = 0;
801 }
802 else if (FindSubStrI(NtOsInstall->VendorName, VENDOR_MICROSOFT))
803 {
804 plvItem->mask |= LVIF_IMAGE;
805 plvItem->iImage = 1;
806 }
807
808 plvItem->iItem = SendMessageW(hWndList, LVM_INSERTITEMW, 0, (LPARAM)plvItem);
809
810 plvItem->iSubItem = 1;
811 plvItem->pszText = Buffer; // SystemRootPath;
812 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
813
814 plvItem->iSubItem = 2;
815 plvItem->pszText = NtOsInstall->VendorName;
816 SendMessageW(hWndList, LVM_SETITEMTEXTW, plvItem->iItem, (LPARAM)plvItem);
817}
static HWND hWndList[5+1]
Definition: SetParent.c:10
Definition: bufpool.h:45
PVOID NTAPI GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:134
#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
Entry
Definition: section.c:5216
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
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:20
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by UpgradeRepairDlgProc().

◆ AreThereInteractiveWindows()

static BOOL AreThereInteractiveWindows ( _In_opt_ HWND  hWndExclude)
static

Detects whether there exist interactive closable windows opened.

Definition at line 2676 of file reactos.c.

2678{
2679 /* Return success if a shell is active */
2680 if (IsShellActive())
2681 {
2682 return TRUE;
2683 }
2684 /* Otherwise, check for user-interactive closable windows */
2685 else
2686 {
2687 CLOSABLE_WND_INFO Info = {hWndExclude, FALSE};
2689 return Info.Found;
2690 }
2691}
static BOOL IsShellActive(VOID)
Detects whether a Windows shell is active.
Definition: reactos.c:2618
static BOOL CALLBACK FindUserClosableWindowProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: reactos.c:2641
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)

Referenced by _tWinMain(), and FinishDlgProc().

◆ CenterWindow()

static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 45 of file reactos.c.

46{
48 RECT rcParent;
49 RECT rcWindow;
50
52 if (hWndParent == NULL)
54
55 GetWindowRect(hWndParent, &rcParent);
56 GetWindowRect(hWnd, &rcWindow);
57
60 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
61 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
62 0,
63 0,
65}
HWND hWnd
Definition: settings.c:17
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
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:1256
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1218
HWND WINAPI GetParent(_In_ HWND)

Referenced by FinishDlgProc(), CEditCompatModes::OnInitDialog(), CConfirmReplace::OnInitDialog(), CZipPassword::OnInitDialog(), and PrshtWndProc().

◆ CheckForOtherInstance()

static HANDLE CheckForOtherInstance ( _In_ HINSTANCE  hInstance)
static

Ensure only one ReactOS Setup instance is running. If another instance already exists, find and activate its window.

Returns
A handle to the instance mutex if this is the first instance, or NULL if another running instance already exists.

Definition at line 3704 of file reactos.c.

3706{
3707#define REACTOS_SETUP_MUTEX L"__ReactOS_Setup__"
3708
3709 static HANDLE s_hMutex = NULL;
3710
3711 /* If we are already running an instance, just return it */
3712 if (s_hMutex)
3713 return s_hMutex;
3714
3715 /* Try to create or open the mutex. Use the Global namespace
3716 * if it exists; otherwise fall back to the default one. */
3717 s_hMutex = CreateMutexW(NULL, FALSE, L"Global\\" REACTOS_SETUP_MUTEX);
3718 if (!s_hMutex && (GetLastError() == ERROR_PATH_NOT_FOUND))
3720 if (!s_hMutex)
3721 return NULL; /* Failed to create the mutex */
3722
3724 {
3725 /* The mutex was created by another instance */
3726 WCHAR szCaption[128];
3727 PWSTR Title = szCaption; // Use the static buffer by default.
3728 HWND hWnd = NULL;
3729
3730 /* Find and activate its window */
3732 if (Title)
3733 {
3734 /* Locate the window (PropertySheetW uses the dialog class)
3735 * and retrieve the last popup it may have open */
3736 HWND hWndMain = FindWindowW(L"#32770", Title);
3738 if (!hWnd) hWnd = hWndMain;
3739
3740 if (Title != szCaption)
3742 }
3743 if (hWnd)
3744 {
3747 }
3748
3749 CloseHandle(s_hMutex);
3750 return NULL;
3751 }
3752
3753 /* We are the first instance */
3754 return s_hMutex;
3755}
#define REACTOS_SETUP_MUTEX
size_t LoadAllocStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen)
Definition: reactos.c:114
HINSTANCE hInstance
Definition: charmap.c:19
static CHAR Title[MAX_PATH]
Definition: dem.c:257
#define HeapFree(x, y, z)
Definition: compat.h:735
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:525
uint16_t * PWSTR
Definition: typedefs.h:56
HWND hWndMain
Definition: welcome.c:60
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetLastActivePopup(_In_ HWND)
#define SW_SHOWNA
Definition: winuser.h:789
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)

Referenced by _tWinMain().

◆ ChkdskCallback()

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

Definition at line 1412 of file reactos.c.

1416{
1417 switch (Command)
1418 {
1419 default:
1420 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1421 break;
1422 }
1423
1424 return TRUE;
1425}
#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 3043 of file reactos.c.

3048{
3049 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
3050 PLIST_ENTRY ListEntry;
3052 PCWSTR pwszNtPathToMap = pwszNTPath;
3053 PCWSTR pwszRemaining = NULL;
3054 DWORD cchDrives;
3055 PWCHAR pwszDrive;
3056 WCHAR wszDrives[512];
3057 WCHAR wszNTPath[MAX_PATH];
3058 WCHAR TargetPath[MAX_PATH];
3059
3060 *pwszPath = UNICODE_NULL;
3061
3062 /*
3063 * We find first a mapping inside the MappingList. If one is found, use it
3064 * to build the Win32 path. If there is none, we need to create one by
3065 * checking the Win32 drives (and possibly NT symlinks too).
3066 * In case of success, add the newly found mapping to the list and use it
3067 * to build the Win32 path.
3068 */
3069
3070 for (ListEntry = MappingList->List.Flink;
3071 ListEntry != &MappingList->List;
3072 ListEntry = ListEntry->Flink)
3073 {
3074 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
3075
3076 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
3077
3078 /* Check whether the queried NT path prefixes the user-provided NT path */
3079 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
3080 if (FoundDrive)
3081 {
3082 /* Found it! */
3083
3084 /* Set the pointers and go build the Win32 path */
3085 pwszDrive = Entry->Win32Path;
3086 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
3087 goto Quit;
3088 }
3089 }
3090
3091 /*
3092 * No mapping exists for this path yet: try to find one now.
3093 */
3094
3095 /* Retrieve the mounted drives (available drive letters) */
3096 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
3097 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
3098 {
3099 /* Buffer too small or failure */
3100 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
3101 return FALSE;
3102 }
3103
3104/* We go back there once if RetryOnce == TRUE */
3105Retry:
3106
3107 /* Enumerate the mounted drives */
3108 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
3109 {
3110 /* Retrieve the NT path corresponding to the current Win32 DOS path */
3111 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
3112 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
3113 pwszDrive[2] = L'\\'; // Restore the backslash
3114
3115 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
3116
3117 /* Check whether the queried NT path prefixes the user-provided NT path */
3118 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
3119 if (!FoundDrive)
3120 {
3121 PWCHAR ptr, ptr2;
3122
3123 /*
3124 * Check whether this was a network share that has a drive letter,
3125 * but the user-provided NT path points to this share without
3126 * mentioning the drive letter.
3127 *
3128 * The format is: \Device<network_redirector>\;X:<data>\share\path
3129 * The corresponding drive letter is 'X'.
3130 * A system-provided network redirector (LanManRedirector or Mup)
3131 * or a 3rd-party one may be used.
3132 *
3133 * We check whether the user-provided NT path has the form:
3134 * \Device<network_redirector><data>\share\path
3135 * as it obviously did not have the full form (the previous check
3136 * would have been OK otherwise).
3137 */
3138 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
3139 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
3140 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
3141 {
3142 /*
3143 * Normally the specified drive letter should correspond
3144 * to the one used for the mapping. But we will ignore
3145 * if it happens not to be the case.
3146 */
3147 if (pwszDrive[0] != ptr[1])
3148 {
3149 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
3150 pwszDrive[0], ptr[1]);
3151 }
3152
3153 /* Remove the drive letter from the NT network share path */
3154 ptr2 = ptr + 3;
3155 /* Swallow as many possible consecutive backslashes as there could be */
3156 while (*ptr2 == L'\\') ++ptr2;
3157
3158 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
3159
3160 /* Now do the check again */
3161 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
3162 }
3163 }
3164 if (FoundDrive)
3165 {
3166 /* Found it! */
3167
3168 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
3169
3170 if (pwszNtPathToMap == pwszNTPath)
3171 {
3172 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
3173 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
3174 }
3175 break;
3176 }
3177 }
3178
3179 if (FoundDrive)
3180 {
3181 /* A mapping was found, add it to the cache */
3183 if (!Entry)
3184 {
3185 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
3186 return FALSE;
3187 }
3188 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
3189 pwszNTPath, pwszRemaining - pwszNTPath);
3190 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
3191
3192 /* Insert it as the most recent entry */
3193 InsertHeadList(&MappingList->List, &Entry->ListEntry);
3194 MappingList->MappingsCount++;
3195
3196 /* Set the pointers and go build the Win32 path */
3197 pwszDrive = Entry->Win32Path;
3198 goto Quit;
3199 }
3200
3201 /*
3202 * We failed, perhaps because the beginning of the NT path used a symlink.
3203 * Try to see whether this is the case by attempting to resolve it.
3204 * If the symlink resolution gives nothing, or we already failed once,
3205 * there is no hope in converting the path to Win32.
3206 * Otherwise, symlink resolution succeeds but we need to recheck again
3207 * the drives list.
3208 */
3209
3210 /*
3211 * In theory we would have to parse each element in the NT path and going
3212 * until finding a symlink object (otherwise we would fail straight away).
3213 * However here we can use guessing instead, since we know which kind of
3214 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
3215 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
3216 * are supported in setuplib\utils\arcname.c .
3217 *
3218 * But actually, all the supported names in arcname.c are real devices,
3219 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
3220 * just check for it.
3221 */
3222 if (!RetryOnce && !FoundDrive)
3223 {
3224 ULONG DiskNumber, PartitionNumber;
3225 INT Length;
3226
3229 HANDLE LinkHandle;
3230 UNICODE_STRING SymLink, Target;
3231
3232 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
3233 &DiskNumber, &PartitionNumber, &Length) != 2)
3234 {
3235 /* Definitively not a recognized path, bail out */
3236 return FALSE;
3237 }
3238
3239 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
3240 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
3241 SymLink.Length = SymLink.MaximumLength;
3242
3244 &SymLink,
3246 NULL,
3247 NULL);
3248 Status = NtOpenSymbolicLinkObject(&LinkHandle,
3251 if (!NT_SUCCESS(Status))
3252 {
3253 /* Not a symlink, or something else happened: bail out */
3254 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
3255 &SymLink, Status);
3256 return FALSE;
3257 }
3258
3259 *TargetPath = UNICODE_NULL;
3260 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
3261
3262 /* Resolve the link and close its handle */
3264 NtClose(LinkHandle);
3265
3266 /* Check for success */
3267 if (!NT_SUCCESS(Status))
3268 {
3269 /* Not a symlink, or something else happened: bail out */
3270 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
3271 &SymLink, Status);
3272 return FALSE;
3273 }
3274
3275 /* Set the pointers */
3276 pwszRemaining = pwszNTPath + Length;
3277 pwszNtPathToMap = TargetPath; // Point to our local buffer
3278
3279 /* Retry once */
3280 RetryOnce = TRUE;
3281 goto Retry;
3282 }
3283
3284 ASSERT(!FoundDrive);
3285
3286Quit:
3287 if (FoundDrive)
3288 {
3289 StringCchPrintfW(pwszPath, cchPathMax,
3290 L"%s%s",
3291 pwszDrive,
3292 pwszRemaining);
3293 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
3294 return TRUE;
3295 }
3296
3297 return FALSE;
3298}
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 SYMBOLIC_LINK_QUERY
Definition: volume.c:47
_ACRTIMP int __cdecl swscanf(const wchar_t *, const wchar_t *,...)
Definition: scanf.c:438
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:200
#define InsertHeadList(ListHead, Entry)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:24
#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:115
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3419
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
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

Referenced by SetupOpenInfFileExW().

◆ CreateBoldFont()

static HFONT CreateBoldFont ( _In_opt_ HFONT  hOrigFont,
_In_opt_ INT  PointSize 
)
static

Create a bold font derived from the provided font.

Definition at line 72 of file reactos.c.

75{
76 LOGFONTW lf = {0};
77
78 if (hOrigFont)
79 {
80 GetObjectW(hOrigFont, sizeof(lf), &lf);
81 }
82 else
83 {
84 NONCLIENTMETRICSW ncm;
85 ncm.cbSize = sizeof(ncm);
86 SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
87 lf = ncm.lfMessageFont;
88 }
89
90 /* Make the font bold, keeping the other attributes */
91 lf.lfWeight = FW_BOLD;
92
93 /* Determine the font height (logical units) if necessary */
94 if (PointSize)
95 {
96 HDC hdc = GetDC(NULL);
97 lf.lfHeight = -MulDiv(PointSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
98 // lf.lfWidth = 0;
100 }
101
102 return CreateFontIndirect(&lf);
103}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
#define CreateFontIndirect
Definition: wingdi.h:4890
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by _tWinMain(), CreateTitleFont(), and ProgressDlg::ProcessWindowMessage().

◆ 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 598 of file reactos.c.

605{
606 UINT i;
607 LVCOLUMN lvC;
608 WCHAR szText[50];
609
610 /* Create the columns */
611 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
612 lvC.pszText = szText;
613
614 /* Load the column labels from the resource file */
615 for (i = 0; i < nNumOfColumns; i++)
616 {
617 lvC.iSubItem = i;
618 lvC.cx = pColsWidth[i];
619 lvC.fmt = pColsAlign[i];
620
621 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
622
623 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
624 return FALSE;
625 }
626
627 return TRUE;
628}
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#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
#define LoadStringW
Definition: utils.h:64

Referenced by UpgradeRepairDlgProc().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( _In_opt_ HFONT  hOrigFont)
inlinestatic

Definition at line 106 of file reactos.c.

108{
109 /* Title font is 12pt bold */
110 return CreateBoldFont(hOrigFont, 12);
111}

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 1029 of file reactos.c.

1034{
1035 PSETUPDATA pSetupData;
1036 HWND hList;
1037
1038 /* Retrieve pointer to the global setup data */
1039 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1040
1041 switch (uMsg)
1042 {
1043 case WM_INITDIALOG:
1044 {
1045 /* Save pointer to the global setup data */
1046 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
1047 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1048
1049 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
1051
1052 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1054
1055 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1057
1058 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1059 // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription);
1060
1061 return TRUE;
1062 }
1063
1064 case WM_NOTIFY:
1065 {
1066 LPNMHDR lpnm = (LPNMHDR)lParam;
1067
1068 switch (lpnm->code)
1069 {
1070 case PSN_SETACTIVE:
1071 {
1072 /* In unattended mode, don't allow going backwards further, i.e.
1073 * back to the Upgrade/Repair, the Install type, or the Start pages,
1074 * in case the setup is interrupted and the user manually goes back. */
1075 if (pSetupData->bUnattend)
1077 else
1079
1080 /* In unattended mode, switch directly to the next page.
1081 * TODO: *UNLESS* there are inconsistencies in the data,
1082 * in which case we should stay on the page! */
1083 if (pSetupData->bUnattend)
1084 {
1085 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, -1);
1086 return TRUE;
1087 }
1088 break;
1089 }
1090
1091 case PSN_QUERYCANCEL:
1092 {
1093 if (DisplayMessage(GetParent(hwndDlg),
1097 {
1098 /* Go to the Abort page */
1100 }
1101
1102 /* Do not close the wizard too soon */
1104 return TRUE;
1105 }
1106
1107 case PSN_WIZNEXT: /* Set the selected data */
1108 {
1109 hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
1112
1113 hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
1116
1117 hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
1120
1121 // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT);
1122 // SetCurrentListEntry(pSetupData->USetupData.LayoutList,
1123 // GetSelectedComboListItem(hList));
1124
1125 return TRUE;
1126 }
1127
1128 case PSN_WIZBACK:
1129 {
1130 /* Return to the Install type selection page instead of the Repair/Upgrade page */
1132 return TRUE;
1133 }
1134
1135 default:
1136 break;
1137 }
1138 break;
1139 }
1140
1141 default:
1142 break;
1143 }
1144
1145 return FALSE;
1146}
#define IDC_DISPLAY
Definition: resource.h:19
PVOID GetSelectedComboListItem(IN HWND hWndList)
Definition: reactos.c:675
static VOID NTAPI GetSettingDescription(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
Definition: reactos.c:753
VOID InitGenericComboList(IN HWND hWndList, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
Definition: reactos.c:637
struct _SETUPDATA * PSETUPDATA
#define IDC_KEYBOARD
Definition: resource.h:46
#define IDC_COMPUTER
Definition: resource.h:44
#define IDD_ABORTPAGE
Definition: resource.h:78
#define IDS_ABORTSETUP2
Definition: resource.h:111
#define IDD_TYPEPAGE
Definition: resource.h:33
#define IDS_ABORTSETUP
Definition: resource.h:110
LPARAM lParam
Definition: combotst.c:139
VOID NTAPI SetCurrentListEntry(IN PGENERIC_LIST List, IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:91
HWND hList
Definition: livecd.c:10
#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 PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define PSN_WIZBACK
Definition: prsht.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define WM_NOTIFY
Definition: richedit.h:61
PGENERIC_LIST DisplayList
Definition: setuplib.h:139
PGENERIC_LIST ComputerList
Definition: setuplib.h:138
PGENERIC_LIST KeyboardList
Definition: setuplib.h:140
UINT code
Definition: winuser.h:3267
#define GWLP_USERDATA
Definition: treelist.c:63
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define GetWindowLongPtrW
Definition: winuser.h:4983
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define WM_INITDIALOG
Definition: winuser.h:1767
#define MB_YESNO
Definition: winuser.h:828
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
struct tagNMHDR * LPNMHDR
#define MB_ICONQUESTION
Definition: winuser.h:800
#define DWLP_MSGRESULT
Definition: winuser.h:881
#define MB_DEFBUTTON2
Definition: winuser.h:810
#define IDYES
Definition: winuser.h:846
#define SetWindowLongPtrW
Definition: winuser.h:5512

◆ DisplayError()

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

Definition at line 263 of file reactos.c.

268{
269 INT iRes;
271
272 va_start(args, uIDMessage);
274 MAKEINTRESOURCEW(uIDTitle),
275 MAKEINTRESOURCEW(uIDMessage),
276 args);
277 va_end(args);
278
279 return iRes;
280}
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:174
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
#define args
Definition: format.c:66
Definition: match.c:390
#define MB_OK
Definition: winuser.h:801

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

◆ 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 174 of file reactos.c.

180{
181 INT iRes;
183 MSGBOXPARAMSW mb = {0};
185 WCHAR StaticBuffer[256];
186 PWSTR Buffer = StaticBuffer; // Use the static buffer by default.
187
188 /* We need to retrieve the current module's instance handle if either
189 * the title or the format message is specified by a resource ID */
190 if ((pszTitle && IS_INTRESOURCE(pszTitle)) || IS_INTRESOURCE(pszFormatMessage))
191 hInstance = GetModuleHandleW(NULL); // SetupData.hInstance;
192
193 /* Retrieve the format message string if this is a resource */
194 if (pszFormatMessage && IS_INTRESOURCE(pszFormatMessage))
195 {
196 Format = NULL;
197 (void)LoadAllocStringW(hInstance, PtrToUlong(pszFormatMessage), &Format, 0);
198 }
199 else
200 {
201 Format = (PWSTR)pszFormatMessage;
202 }
203
204 if (Format)
205 {
206 /* Format the message and retrieve its length. If it is too long,
207 * an auxiliary buffer is allocated; otherwise the static buffer
208 * is used. The string is built to be NUL-terminated. */
210 if (!Buffer)
211 {
212 /* Allocation failed, use the original format string verbatim */
213 Buffer = Format;
214 }
215 }
216 else
217 {
218 Format = (PWSTR)pszFormatMessage;
219 Buffer = Format;
220 }
221
222 /* Display the message */
223 mb.cbSize = sizeof(mb);
224 mb.hwndOwner = hWnd;
225 mb.hInstance = hInstance;
226 mb.lpszText = Buffer;
227 mb.lpszCaption = pszTitle;
228 mb.dwStyle = uType;
230 iRes = MessageBoxIndirectW(&mb);
231
232 /* Free the buffers if needed */
233 if ((Buffer != StaticBuffer) && (Buffer != Format))
235
236 if (Format && (Format != pszFormatMessage))
238
239 return iRes;
240}
size_t FormatAllocStringWV(_In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen, _In_ PCWSTR pszFormat, _In_ va_list args)
Definition: reactos.c:149
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define IS_INTRESOURCE(x)
Definition: loader.c:613
#define PtrToUlong(u)
Definition: config.h:107
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
DWORD dwLanguageId
Definition: winuser.h:3453
LPCWSTR lpszCaption
Definition: winuser.h:3448
HWND hwndOwner
Definition: winuser.h:3445
LPCWSTR lpszText
Definition: winuser.h:3447
HINSTANCE hInstance
Definition: winuser.h:3446
DWORD dwStyle
Definition: winuser.h:3449
int WINAPI MessageBoxIndirectW(_In_ CONST MSGBOXPARAMSW *lpmbp)

Referenced by DisplayError(), and DisplayMessage().

◆ EnablePrivilege()

BOOL EnablePrivilege ( IN LPCWSTR  lpszPrivilegeName,
IN BOOL  bEnablePrivilege 
)

Definition at line 3302 of file reactos.c.

3305{
3306 BOOL Success;
3307 HANDLE hToken;
3309
3312 &hToken);
3313 if (!Success) return Success;
3314
3316 lpszPrivilegeName,
3317 &tp.Privileges[0].Luid);
3318 if (!Success) goto Quit;
3319
3320 tp.PrivilegeCount = 1;
3321 tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
3322
3323 Success = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
3324
3325Quit:
3326 CloseHandle(hToken);
3327 return Success;
3328}
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:942
#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 1769 of file reactos.c.

1773{
1775 PFILEPATHS_W FilePathInfo;
1776 PCWSTR SrcFileName, DstFileName;
1777
1778 WaitForSingleObject(CopyContext->pSetupData->hHaltInstallEvent, INFINITE);
1779 if (CopyContext->pSetupData->bAbortInstall)
1780 return FILEOP_ABORT; // Stop committing files
1781
1782 switch (Notification)
1783 {
1785 {
1786 CopyContext->TotalOperations = (ULONG)Param2;
1787 CopyContext->CompletedOperations = 0;
1788
1789 /* Set up the progress bar */
1791 PBM_SETRANGE, 0,
1792 MAKELPARAM(0, CopyContext->TotalOperations));
1794 PBM_SETSTEP, 1, 0);
1796 PBM_SETPOS, 0, 0);
1797 break;
1798 }
1799
1803 {
1804 FilePathInfo = (PFILEPATHS_W)Param1;
1805
1807 {
1808 /* Display delete message */
1809 ASSERT(Param2 == FILEOP_DELETE);
1810
1811 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1812 if (DstFileName) ++DstFileName;
1813 else DstFileName = FilePathInfo->Target;
1814
1817 IDS_DELETING, // STRING_DELETING
1818 DstFileName);
1819 }
1821 {
1822 UINT uMsgID;
1823
1824 /* Display move/rename message */
1825 ASSERT(Param2 == FILEOP_RENAME);
1826
1827 SrcFileName = wcsrchr(FilePathInfo->Source, L'\\');
1828 if (SrcFileName) ++SrcFileName;
1829 else SrcFileName = FilePathInfo->Source;
1830
1831 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1832 if (DstFileName) ++DstFileName;
1833 else DstFileName = FilePathInfo->Target;
1834
1835 if (!_wcsicmp(SrcFileName, DstFileName))
1836 uMsgID = IDS_MOVING; // STRING_MOVING
1837 else
1838 uMsgID = IDS_RENAMING; // STRING_RENAMING
1841 uMsgID,
1842 SrcFileName, DstFileName);
1843 }
1845 {
1846 /* Display copy message */
1847 ASSERT(Param2 == FILEOP_COPY);
1848
1849 DstFileName = wcsrchr(FilePathInfo->Target, L'\\');
1850 if (DstFileName) ++DstFileName;
1851 else DstFileName = FilePathInfo->Target;
1852
1853 /* Whereas the repair/upgrade procedure may move, rename, or
1854 * delete files, the regular installation only copies files.
1855 * Therefore, display only the file name instead of the full
1856 * "Copying..." message in this case. */
1858 {
1861 IDS_COPYING, // STRING_COPYING
1862 DstFileName);
1863 }
1864 else
1865 {
1866 SetWindowTextW(UiContext.hWndItem, DstFileName);
1867 }
1868 }
1869 break;
1870 }
1871
1873 {
1874 FilePathInfo = (PFILEPATHS_W)Param1;
1875
1876 DPRINT1("An error happened while trying to copy file '%S' (error 0x%08lx), skipping it...\n",
1877 FilePathInfo->Target, FilePathInfo->Win32Error);
1878 return FILEOP_SKIP;
1879 }
1880
1884 {
1885 CopyContext->CompletedOperations++;
1886
1887 /* SYSREG checkpoint */
1888 if (CopyContext->TotalOperations >> 1 == CopyContext->CompletedOperations)
1889 DPRINT1("CHECKPOINT:HALF_COPIED\n");
1890
1892 break;
1893 }
1894 }
1895
1896 return FILEOP_DOIT;
1897}
VOID __cdecl SetWindowResPrintfW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
Definition: reactos.c:340
struct _COPYCONTEXT * PCOPYCONTEXT
UI_CONTEXT UiContext
Definition: reactos.c:37
#define IDS_DELETING
Definition: resource.h:145
#define IDS_MOVING
Definition: resource.h:143
#define IDS_COPYING
Definition: resource.h:142
#define IDS_RENAMING
Definition: resource.h:144
#define wcsrchr
Definition: compat.h:16
BOOL WINAPI CopyContext(CONTEXT *dst, DWORD context_flags, CONTEXT *src)
Definition: memory.c:1633
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
#define INFINITE
Definition: serial.h:102
#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
_In_ PVOID Context
Definition: storport.h:2269
UINT Win32Error
Definition: fileqsup.h:62
PCWSTR Source
Definition: fileqsup.h:61
PCWSTR Target
Definition: fileqsup.h:60
BOOLEAN RepairUpdateFlag
Definition: reactos.h:158
HWND hWndItem
Definition: reactos.h:72
HWND hWndProgress
Definition: reactos.h:73
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
Definition: wdfcontrol.h:115
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)

Referenced by PrepareAndDoCopyThread().

◆ FindUserClosableWindowProc()

static BOOL CALLBACK FindUserClosableWindowProc ( _In_ HWND  hWnd,
_In_ LPARAM  lParam 
)
static

Definition at line 2641 of file reactos.c.

2644{
2646 HMENU hSysMenu;
2647 MENUITEMINFOW mii;
2648
2649 /* Skip the window to exclude */
2650 if (hWnd == pInfo->hWndExclude)
2651 return TRUE;
2652
2653 /* Skip non-interactive windows */
2655 return TRUE;
2656
2657 hSysMenu = GetSystemMenu(hWnd, FALSE);
2658 if (!hSysMenu)
2659 return TRUE; /* No menu: skip the window */
2660
2661 mii.cbSize = sizeof(mii);
2662 mii.fMask = MIIM_STATE;
2663 if (!GetMenuItemInfoW(hSysMenu, SC_CLOSE, FALSE, &mii))
2664 return TRUE; /* No close item: skip the window */
2665
2666 pInfo->Found |= !(mii.fState & MFS_DISABLED);
2667
2668 /* Continue enumeration (return TRUE) if no close item is enabled;
2669 * otherwise stop the enumeration (return FALSE) */
2670 return !pInfo->Found;
2671}
struct _CLOSABLE_WND_INFO * PCLOSABLE_WND_INFO
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL Found
TRUE if a closable window was found; FALSE if not.
Definition: reactos.c:2637
HWND hWndExclude
Window to exclude from search.
Definition: reactos.c:2636
#define MFS_DISABLED
Definition: winuser.h:760
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define MIIM_STATE
Definition: winuser.h:732
#define SC_CLOSE
Definition: winuser.h:2628
BOOL WINAPI IsWindowEnabled(_In_ HWND)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
BOOL WINAPI IsWindowVisible(_In_ HWND)

Referenced by AreThereInteractiveWindows().

◆ FinishDlgProc()

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

Definition at line 2694 of file reactos.c.

2699{
2700 PSETUPDATA pSetupData;
2701
2702 /* Retrieve pointer to the global setup data */
2703 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2704
2705 switch (uMsg)
2706 {
2707 case WM_INITDIALOG:
2708 {
2709 HWND hWndParent = GetParent(hwndDlg);
2711
2712 /* Save pointer to the global setup data */
2713 pSetupData = (PSETUPDATA)ppsp->lParam;
2714 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2715
2716 /* Set the stop-install flag if the user is aborting
2717 * the installation: TRUE if Abort, FALSE if Finish. */
2718 pSetupData->bStopInstall = (ppsp->pszTemplate == MAKEINTRESOURCEW(IDD_ABORTPAGE));
2719
2720 /* Set title font */
2721 SetDlgItemFont(hwndDlg, IDC_FINISHTITLE, pSetupData->hTitleFont, TRUE);
2722
2723 /* We need to reboot at the end of the installation if this is an
2724 * unattended setup, or if there is no shell active. If there are
2725 * other user-interactive windows opened, we pause in WM_ACTIVATE
2726 * the inevitable reboot countdown when the wizard is deactivated,
2727 * and restart it when the wizard is reactivated. */
2728 pSetupData->bMustReboot = SetupData.bUnattend;
2729 pSetupData->bMustReboot |= !IsShellActive();
2730
2731 /* If we must reboot, display the countdown gauge. In any
2732 * case, let the user restart now or postpone it to later. */
2733 if (pSetupData->bMustReboot)
2734 {
2735 /* "Setup will now restart your computer..." is shown */
2738 }
2739 else
2740 {
2741 /* We should not reboot automatically, change the finish
2742 * text to "Setup needs to restart your computer..." */
2743 UINT uMsgID = (!pSetupData->bStopInstall ? IDS_FINISH_NO_REBOOT
2746 pSetupData->hInstance,
2747 uMsgID);
2748
2749 /* Hide and disable the countdown gauge */
2752 }
2753
2754 /* Ensure that the wizard window is centered, made visible, and focused */
2758 return TRUE;
2759 }
2760
2761 case WM_ACTIVATE:
2762 {
2763 /* Only care about (de)activation only if we must reboot */
2764 if (!pSetupData->bMustReboot)
2765 break;
2766
2767 if (LOWORD(wParam) == WA_INACTIVE)
2768 {
2769 /* Wizard window is deactivated, check whether there are
2770 * interactive windows. If so, pause the countdown. */
2772 KillTimer(hwndDlg, 1);
2773 }
2774 else
2775 {
2776 /* Wizard window is reactivated, re-enable the countdown */
2777 SetTimer(hwndDlg, 1, 50, NULL);
2778 }
2779 break;
2780 }
2781
2782 case WM_TIMER:
2783 {
2784 HWND hWndProgress;
2785 INT Position;
2786
2787 hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
2788 Position = SendMessageW(hWndProgress, PBM_GETPOS, 0, 0);
2789 if (Position == 300)
2790 {
2791 KillTimer(hwndDlg, 1);
2793 }
2794 else
2795 {
2796 SendMessageW(hWndProgress, PBM_SETPOS, Position + 1, 0);
2797 }
2798 return TRUE;
2799 }
2800
2801 case WM_NOTIFY:
2802 {
2803 LPNMHDR lpnm = (LPNMHDR)lParam;
2804
2805 switch (lpnm->code)
2806 {
2807 case PSN_SETACTIVE:
2808 {
2809 HWND hWndParent = GetParent(hwndDlg);
2810
2811 /*
2812 * Only "Finish" for closing the wizard, and hide "Back" and "Next".
2813 * Don't use the PropSheet_SetWizButtons() macro, because its
2814 * posted message would be handled after hiding the buttons.
2815 * The message would then interfere with the hidden buttons
2816 * (when both "Back" and "Next" are hidden, "Next" gets forcefully shown).
2817 */
2819 // PropSheet_ShowWizButtons(hWndParent, 0, PSWIZB_BACK | PSWIZB_NEXT | PSWIZB_CANCEL);
2822
2823 /* Change the "Finish" button text to "Restart" */
2825 pSetupData->hInstance,
2827
2828 /* Skip the Finish page in unattended setup */
2829 if (pSetupData->bUnattend /*&& !pSetupData->bStopInstall*/)
2830 {
2831 // FIXME: The macro should use PostMessageW, but our
2832 // prsht.h is wrong and uses SendMessageW instead...
2833 //PropSheet_PressButton(hWndParent, PSBTN_FINISH);
2835 /* We need to "stay" on the page so that we can
2836 * receive the PSN_WIZFINISH notification */
2837 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, 0);
2838 return TRUE;
2839 }
2840
2841 /* Re-enable the Close/Cancel buttons if we won't reboot */
2842 if (!pSetupData->bMustReboot)
2844
2845 if (pSetupData->bMustReboot)
2846 {
2847 RECT rcBtn1, rcBtn2;
2848
2849 /* Move the "Finish"/"Restart" button to where the "Cancel" button is */
2851 MapWindowPoints(HWND_DESKTOP /*NULL*/, hWndParent, (LPPOINT)&rcBtn1, sizeof(RECT)/sizeof(POINT));
2853 MapWindowPoints(HWND_DESKTOP /*NULL*/, hWndParent, (LPPOINT)&rcBtn2, sizeof(RECT)/sizeof(POINT));
2855 HWND_TOP,
2856 rcBtn1.left + (rcBtn2.right - rcBtn1.right),
2857 rcBtn1.top,
2858 0, 0,
2860
2861 /* Hide and disable also the "Cancel" buttons since we can only finish now */
2864
2865 /* Set up the reboot progress bar and countdown timer.
2866 * 300 steps at 50 ms each: 15 seconds */
2869 SetTimer(hwndDlg, 1, 50, NULL);
2870 }
2871 else if (!pSetupData->bStopInstall)
2872 {
2873 /* Keep the "Cancel" button shown and change its text to "Postpone" */
2875 pSetupData->hInstance,
2877 }
2878 else // (!bMustReboot && bStopInstall)
2879 {
2880 /* The installation is aborted, change the "Cancel" button text to "Close" */
2882 GetModuleHandleW(L"comctl32.dll"),
2883 IDS_CLOSE);
2884 }
2885 break;
2886 }
2887
2888 case PSN_KILLACTIVE:
2889 KillTimer(hwndDlg, 1);
2890 break;
2891
2892 case PSN_WIZBACK:
2893 /* Always disable going back */
2894 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, -1);
2895 return TRUE;
2896
2897 case PSN_WIZNEXT:
2898 case PSN_WIZFINISH:
2899 {
2900 /* Press on "Finish"/"Restart" button */
2901 pSetupData->bMustReboot = TRUE;
2903 }
2904 case PSN_QUERYCANCEL:
2905 /* Press on "Cancel"/"Postpone" button */
2906 default:
2907 break;
2908 }
2909 break;
2910 }
2911
2912 default:
2913 break;
2914 }
2915
2916 return FALSE;
2917}
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:45
VOID PropSheet_SetCloseCancel(_In_ HWND hWndWiz, _In_ BOOL Enable)
Enable or disable the Cancel and the Close title-bar property-sheet buttons.
Definition: reactos.c:1939
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:283
#define IDS_CLOSE
Definition: reactos.h:41
#define ShowDlgItem(hDlg, nID, nCmdShow)
Definition: reactos.h:34
#define ID_WIZFINISH
Definition: reactos.h:48
#define SetDlgItemFont(hDlg, nID, hFont, bRedraw)
Definition: reactos.h:37
#define ID_WIZNEXT
Definition: reactos.h:47
#define ID_WIZBACK
Definition: reactos.h:46
#define IDS_RESTARTBTN
Definition: resource.h:116
#define IDS_ABORT_NO_REBOOT
Definition: resource.h:114
#define IDC_FINISHTEXT
Definition: resource.h:76
#define IDC_FINISHTITLE
Definition: resource.h:75
#define IDS_POSTPONEBTN
Definition: resource.h:117
#define IDS_FINISH_NO_REBOOT
Definition: resource.h:113
#define IDC_RESTART_PROGRESS
Definition: resource.h:77
WPARAM wParam
Definition: combotst.c:138
#define EnableDlgItem(hDlg, nID, bEnable)
Definition: eventvwr.h:55
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_PressButton(d, i)
Definition: prsht.h:348
#define PSM_SETWIZBUTTONS
Definition: prsht.h:157
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSBTN_FINISH
Definition: prsht.h:148
#define PSN_WIZFINISH
Definition: prsht.h:122
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
#define PSM_PRESSBUTTON
Definition: prsht.h:100
#define PBM_GETPOS
Definition: commctrl.h:2199
#define __fallthrough
Definition: sal_old.h:314
static COORD Position
Definition: mouse.c:34
#define SW_HIDE
Definition: winuser.h:779
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WA_INACTIVE
Definition: winuser.h:2664
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define HWND_DESKTOP
Definition: winuser.h:1220
#define WM_ACTIVATE
Definition: winuser.h:1640
#define WM_TIMER
Definition: winuser.h:1770
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define SW_SHOW
Definition: winuser.h:786
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SendDlgItemMessage
Definition: winuser.h:6008

◆ FormatAllocStringWV()

size_t FormatAllocStringWV ( _In_opt_ _Outptr_ PWSTR pString,
_In_opt_ size_t  cchBufferLen,
_In_ PCWSTR  pszFormat,
_In_ va_list  args 
)

Definition at line 149 of file reactos.c.

154{
155 size_t Length;
156
157 /* Retrieve the message length. If it is too long, allocate
158 * an auxiliary buffer; otherwise use the caller's buffer. */
159 Length = _vscwprintf(pszFormat, args); // Doesn't count the NUL-terminator.
160 if (!*pString || (Length >= cchBufferLen))
161 {
162 /* Allocate a new buffer, adding a NUL-terminator */
164 if (!*pString)
165 return 0;
166 }
167
168 /* Do the printf */
169 StringCchVPrintfW(*pString, Length + 1, pszFormat, args);
170 return Length;
171}
_ACRTIMP int __cdecl _vscwprintf(const wchar_t *, va_list)
Definition: wcs.c:1787
FxString * pString
STRSAFEAPI StringCchVPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, va_list argList)
Definition: strsafe.h:490

Referenced by DisplayMessageV(), and SetWindowResPrintfVW().

◆ FormatCallback()

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

Definition at line 1364 of file reactos.c.

1368{
1369 switch (Command)
1370 {
1371 case PROGRESS:
1372 {
1373 PULONG Percent = (PULONG)Argument;
1374 DPRINT("%lu percent completed\n", *Percent);
1376 break;
1377 }
1378
1379#if 0
1380 case OUTPUT:
1381 {
1382 PTEXTOUTPUT output = (PTEXTOUTPUT)Argument;
1383 DPRINT("%s\n", output->Output);
1384 break;
1385 }
1386#endif
1387
1388 case DONE:
1389 {
1390#if 0
1391 PBOOLEAN Success = (PBOOLEAN)Argument;
1392 if (*Success == FALSE)
1393 {
1394 DPRINT("FormatEx was unable to complete successfully.\n\n");
1395 }
1396#endif
1397 DPRINT("Done\n");
1398 break;
1399 }
1400
1401 default:
1402 DPRINT("Unknown callback %lu\n", (ULONG)Command);
1403 break;
1404 }
1405
1406 return TRUE;
1407}
#define OUTPUT(ch)
struct TEXTOUTPUT * PTEXTOUTPUT
@ PROGRESS
Definition: fmifs.h:83
#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 3022 of file reactos.c.

3024{
3025 PLIST_ENTRY ListEntry;
3026 PVOID Entry;
3027
3028 while (!IsListEmpty(&MappingList->List))
3029 {
3030 ListEntry = RemoveHeadList(&MappingList->List);
3031 Entry = (PVOID)CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
3033 }
3034
3035 MappingList->MappingsCount = 0;
3036}
#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!!

Definition at line 1430 of file reactos.c.

1435{
1436 PFSVOL_CONTEXT FsVolContext = (PFSVOL_CONTEXT)Context;
1437
1438 switch (FormatStatus)
1439 {
1440 // FIXME: Deprecate!
1442 {
1443 // PPARTENTRY SystemPartition = (PPARTENTRY)Param1;
1444
1445 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1446 // if (ChangeSystemPartitionPage(Ir, SystemPartition))
1447 // return FSVOL_DOIT;
1448 return FSVOL_ABORT;
1449 }
1450
1452 {
1453 switch (Param1)
1454 {
1456 {
1457 // ERROR_WRITE_PTABLE
1459 0, // Default to "Error"
1461 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1462 // TODO: Go back to the partitioning page?
1463 break;
1464 }
1465
1467 {
1468 /* FIXME: improve the error dialog */
1469 //
1470 // Error dialog should say that we cannot find a suitable
1471 // system partition and create one on the system. At this point,
1472 // it may be nice to ask the user whether he wants to continue,
1473 // or use an external drive as the system drive/partition
1474 // (e.g. floppy, USB drive, etc...)
1475 //
1477 0, // Default to "Error"
1479 // FsVolContext->NextPageOnAbort = SELECT_PARTITION_PAGE;
1480 // TODO: Go back to the partitioning page
1481 break;
1482 }
1483
1484 default:
1485 break;
1486 }
1487 return FSVOL_ABORT;
1488 }
1489
1492 // NOTE: If needed, clear progress gauges.
1493 return FSVOL_DOIT;
1494
1496 {
1497 if ((FSVOL_OP)Param1 == FSVOL_FORMAT)
1498 {
1499 /* In case we just repair an existing installation,
1500 * just go to the file system check step */
1501 if (FsVolContext->pSetupData->RepairUpdateFlag)
1502 return FSVOL_SKIP;
1504 /* Set status text */
1506 }
1507 else
1508 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1509 {
1510 /* Set status text */
1512
1513 /* Filechecking step: set progress marquee style and start it up */
1517 }
1518
1519 return FSVOL_DOIT;
1520 }
1521
1523 {
1524 if ((FSVOL_OP)Param1 == FSVOL_CHECK)
1525 {
1526 /* File-checking finished: stop the progress bar and restore its style */
1529 }
1530 return 0;
1531 }
1532
1534 {
1535 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1536
1537 // FIXME: See also FSVOLNOTIFY_PARTITIONERROR
1538 if (FmtInfo->ErrorStatus == STATUS_PARTITION_FAILURE)
1539 {
1540 // ERROR_WRITE_PTABLE
1542 0, // Default to "Error"
1544 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1545 // TODO: Go back to the partitioning page?
1546 return FSVOL_ABORT;
1547 }
1548 else
1550 {
1551 /* FIXME: show an error dialog */
1552 // MUIDisplayError(ERROR_FORMATTING_PARTITION, Ir, POPUP_WAIT_ANY_KEY, PathBuffer);
1554 0, // Default to "Error"
1556 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1557 return FSVOL_ABORT;
1558 }
1559 else
1560 if (FmtInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1561 {
1562 INT nRet;
1563
1565 NULL, // Default to "Error"
1567 FmtInfo->FileSystemName);
1568 if (nRet == IDCANCEL)
1569 {
1570 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1571 return FSVOL_ABORT;
1572 }
1573 else if (nRet == IDOK)
1574 {
1575 return FSVOL_RETRY;
1576 }
1577 }
1578 else if (!NT_SUCCESS(FmtInfo->ErrorStatus))
1579 {
1580 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1581
1582 DPRINT1("FormatPartition() failed with status 0x%08lx\n", FmtInfo->ErrorStatus);
1583
1584 // ERROR_FORMATTING_PARTITION
1586 0, // Default to "Error"
1588 FmtInfo->Volume->Info.DeviceName);
1589 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1590 return FSVOL_ABORT;
1591 }
1592
1593 return FSVOL_RETRY;
1594 }
1595
1597 {
1598 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1599
1600 if (ChkInfo->ErrorStatus == STATUS_NOT_SUPPORTED)
1601 {
1602 INT nRet;
1603
1605 NULL, // Default to "Error"
1607 ChkInfo->Volume->Info.FileSystem);
1608 if (nRet == IDCANCEL)
1609 {
1610 // FsVolContext->NextPageOnAbort = QUIT_PAGE;
1611 return FSVOL_ABORT;
1612 }
1613 else if (nRet == IDOK)
1614 {
1615 return FSVOL_SKIP;
1616 }
1617 }
1618 else if (!NT_SUCCESS(ChkInfo->ErrorStatus))
1619 {
1620 DPRINT1("ChkdskPartition() failed with status 0x%08lx\n", ChkInfo->ErrorStatus);
1621
1623 0, // Default to "Error"
1625 ChkInfo->ErrorStatus);
1626 return FSVOL_SKIP;
1627 }
1628
1629 return FSVOL_SKIP;
1630 }
1631
1633 {
1634 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1635 PVOL_CREATE_INFO VolCreate;
1636
1637 ASSERT((FSVOL_OP)Param2 == FSVOL_FORMAT);
1638
1639 /* Find the volume info in the partition TreeList UI.
1640 * If none, don't format it. */
1642 FmtInfo->Volume);
1643 if (!VolCreate)
1644 return FSVOL_SKIP;
1645 ASSERT(VolCreate->Volume == FmtInfo->Volume);
1646
1647 /* If there is no formatting information, skip it */
1648 if (!*VolCreate->FileSystemName)
1649 return FSVOL_SKIP;
1650
1651 ASSERT(*FmtInfo->Volume->Info.DeviceName);
1652
1653 /* Set status text */
1654 if (FmtInfo->Volume->Info.DriveLetter)
1655 {
1658 IDS_FORMATTING_PROGRESS1, // L"Formatting volume %c: (%s) in %s..."
1659 FmtInfo->Volume->Info.DriveLetter,
1660 FmtInfo->Volume->Info.DeviceName,
1661 VolCreate->FileSystemName);
1662 }
1663 else
1664 {
1667 IDS_FORMATTING_PROGRESS2, // L"Formatting volume %s in %s..."
1668 FmtInfo->Volume->Info.DeviceName,
1669 VolCreate->FileSystemName);
1670 }
1671
1672 // StartFormat(FmtInfo, FileSystemList->Selected);
1673 FmtInfo->FileSystemName = VolCreate->FileSystemName;
1674 FmtInfo->MediaFlag = VolCreate->MediaFlag;
1675 FmtInfo->Label = VolCreate->Label;
1676 FmtInfo->QuickFormat = VolCreate->QuickFormat;
1677 FmtInfo->ClusterSize = VolCreate->ClusterSize;
1678 FmtInfo->Callback = FormatCallback;
1679
1680 /* Set up the progress bar */
1682 PBM_SETRANGE, 0, MAKELPARAM(0, 100));
1684 PBM_SETPOS, 0, 0);
1685
1686 return FSVOL_DOIT;
1687 }
1688
1690 {
1691 PFORMAT_VOLUME_INFO FmtInfo = (PFORMAT_VOLUME_INFO)Param1;
1692
1693 // EndFormat(FmtInfo->ErrorStatus);
1694 if (FmtInfo->FileSystemName)
1695 *(PWSTR)FmtInfo->FileSystemName = UNICODE_NULL; // FIXME: HACK!
1696
1697 // /* Reset the file system list */
1698 // ResetFileSystemList();
1699 return 0;
1700 }
1701
1703 {
1704 PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1705 PVOL_CREATE_INFO VolCreate;
1706
1707 ASSERT((FSVOL_OP)Param2 == FSVOL_CHECK);
1708
1709 /* Find the volume info in the partition TreeList UI.
1710 * If none, don't check it. */
1712 ChkInfo->Volume);
1713 if (!VolCreate)
1714 return FSVOL_SKIP;
1715 ASSERT(VolCreate->Volume == ChkInfo->Volume);
1716
1717 ASSERT(*ChkInfo->Volume->Info.DeviceName);
1718
1719 /* Set status text */
1720 if (ChkInfo->Volume->Info.DriveLetter)
1721 {
1724 IDS_CHECKING_PROGRESS1, // L"Checking volume %c: (%s)..."
1725 ChkInfo->Volume->Info.DriveLetter,
1726 ChkInfo->Volume->Info.DeviceName);
1727 }
1728 else
1729 {
1732 IDS_CHECKING_PROGRESS2, // L"Checking volume %s..."
1733 ChkInfo->Volume->Info.DeviceName);
1734 }
1735
1736 // StartCheck(ChkInfo);
1737 // TODO: Think about which values could be defaulted...
1738 ChkInfo->FixErrors = TRUE;
1739 ChkInfo->Verbose = FALSE;
1740 ChkInfo->CheckOnlyIfDirty = TRUE;
1741 ChkInfo->ScanDrive = FALSE;
1742 ChkInfo->Callback = ChkdskCallback;
1743
1744 return FSVOL_DOIT;
1745 }
1746
1748 {
1749 // PCHECK_VOLUME_INFO ChkInfo = (PCHECK_VOLUME_INFO)Param1;
1750 // EndCheck(ChkInfo->ErrorStatus);
1751 return 0;
1752 }
1753 }
1754
1755 return 0;
1756}
static BOOLEAN NTAPI FormatCallback(_In_ CALLBACKCOMMAND Command, _In_ ULONG Modifier, _In_ PVOID Argument)
Definition: reactos.c:1364
struct _FSVOL_CONTEXT * PFSVOL_CONTEXT
#define IDS_ERROR_SYSTEM_PARTITION
Definition: resource.h:187
#define IDS_ERROR_FORMAT_UNRECOGNIZED_VOLUME
Definition: resource.h:190
#define IDS_FORMATTING_PROGRESS1
Definition: resource.h:138
#define IDS_ERROR_COULD_NOT_CHECK
Definition: resource.h:199
#define IDS_ERROR_CHECKING_PARTITION
Definition: resource.h:202
#define IDS_ERROR_COULD_NOT_FORMAT
Definition: resource.h:193
#define IDS_CHECKING_PROGRESS2
Definition: resource.h:141
#define IDS_CHECKING_PROGRESS1
Definition: resource.h:140
#define IDC_ITEM
Definition: resource.h:71
#define IDS_FORMATTING_PROGRESS2
Definition: resource.h:139
#define IDS_ERROR_WRITE_PTABLE
Definition: resource.h:183
#define IDS_ERROR_FORMATTING_PARTITION
Definition: resource.h:196
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:876
#define STATUS_PARTITION_FAILURE
Definition: ntstatus.h:698
#define PBS_MARQUEE
Definition: commctrl.h:2203
#define PBM_SETMARQUEE
Definition: commctrl.h:2204
@ FSVOLNOTIFY_STARTCHECK
Definition: fsutil.h:153
@ FSVOLNOTIFY_ENDQUEUE
Definition: fsutil.h:145
@ FSVOLNOTIFY_STARTSUBQUEUE
Definition: fsutil.h:146
@ FSVOLNOTIFY_ENDFORMAT
Definition: fsutil.h:151
@ FSVOLNOTIFY_STARTFORMAT
Definition: fsutil.h:150
@ FSVOLNOTIFY_STARTQUEUE
Definition: fsutil.h:144
@ FSVOLNOTIFY_ENDSUBQUEUE
Definition: fsutil.h:147
@ FSVOLNOTIFY_PARTITIONERROR
Definition: fsutil.h:149
@ FSVOLNOTIFY_CHECKERROR
Definition: fsutil.h:155
@ ChangeSystemPartition
Definition: fsutil.h:156
@ FSVOLNOTIFY_FORMATERROR
Definition: fsutil.h:152
@ FSVOLNOTIFY_ENDCHECK
Definition: fsutil.h:154
enum _FSVOL_OP FSVOL_OP
struct _FORMAT_VOLUME_INFO * PFORMAT_VOLUME_INFO
@ FSVOL_FORMAT
Definition: fsutil.h:162
@ FSVOL_CHECK
Definition: fsutil.h:163
@ FSVOL_DOIT
Definition: fsutil.h:166
@ FSVOL_ABORT
Definition: fsutil.h:165
@ FSVOL_RETRY
Definition: fsutil.h:167
@ FSVOL_SKIP
Definition: fsutil.h:168
struct _CHECK_VOLUME_INFO * PCHECK_VOLUME_INFO
#define ERROR_SYSTEM_PARTITION_NOT_FOUND
Definition: setuplib.h:188
BOOLEAN Verbose
Definition: fsutil.h:195
NTSTATUS ErrorStatus
Definition: fsutil.h:191
PVOLENTRY Volume
Definition: fsutil.h:189
PFMIFSCALLBACK Callback
Definition: fsutil.h:198
BOOLEAN CheckOnlyIfDirty
Definition: fsutil.h:196
BOOLEAN FixErrors
Definition: fsutil.h:194
BOOLEAN ScanDrive
Definition: fsutil.h:197
PFMIFSCALLBACK Callback
Definition: fsutil.h:183
BOOLEAN QuickFormat
Definition: fsutil.h:181
NTSTATUS ErrorStatus
Definition: fsutil.h:175
PVOLENTRY Volume
Definition: fsutil.h:173
FMIFS_MEDIA_FLAG MediaFlag
Definition: fsutil.h:179
PCWSTR FileSystemName
Definition: fsutil.h:178
PSETUPDATA pSetupData
Definition: reactos.c:1357
HWND hPartList
Definition: reactos.h:70
LONG_PTR dwPbStyle
Definition: reactos.h:74
HWND hwndDlg
Definition: reactos.h:71
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskVolumeN".
Definition: volutil.h:18
WCHAR FileSystem[MAX_PATH+1]
Definition: volutil.h:22
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:187
ULONG ClusterSize
Definition: reactos.h:199
BOOLEAN QuickFormat
Definition: reactos.h:198
PVOLENTRY Volume
Definition: reactos.h:188
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:195
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:196
PCWSTR Label
Definition: reactos.h:197
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define IDOK
Definition: winuser.h:841
#define MB_OKCANCEL
Definition: winuser.h:815
#define GWL_STYLE
Definition: winuser.h:863

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

◆ GetLocalSetupDllPath()

static PCWSTR GetLocalSetupDllPath ( VOID  )
static

Definition at line 3381 of file reactos.c.

3382{
3383 static WCHAR SetupDllPath[MAX_PATH] = L"";
3384 static BOOL Init = FALSE;
3385 BOOL Success;
3386 DWORD PathSize;
3387
3388 /* Don't rebuild the path if we did it already */
3389 if (Init)
3390 return SetupDllPath;
3391 Init = TRUE;
3392
3393 /*
3394 * Retrieve the full path of the current running Setup instance.
3395 * From this we build the suitable path to the Setup DLL.
3396 */
3397 PathSize = GetModuleFileNameW(NULL, SetupDllPath, _countof(SetupDllPath));
3398 SetupDllPath[_countof(SetupDllPath) - 1] = UNICODE_NULL; // Ensure NUL-termination (see WinXP bug)
3399
3400 Success = ((PathSize != 0) && (PathSize < _countof(SetupDllPath)) &&
3402 if (Success)
3403 {
3404 /* Find the last path separator, remove it as well as the file name */
3405 PWCHAR pch = wcsrchr(SetupDllPath, L'\\');
3406 if (!pch)
3407 pch = SetupDllPath;
3408
3409 /* The Setup DLL is inside the System32 sub-directory */
3410 PathSize = _countof(SetupDllPath) - (pch - SetupDllPath);
3411 Success = SUCCEEDED(StringCchCopyW(pch, PathSize, L"\\system32"));
3412 }
3413 if (!Success)
3414 {
3415 /* Failure: invalidate the path; the DLL won't be found and delay-loaded */
3416 *SetupDllPath = UNICODE_NULL;
3417 }
3418
3419 return SetupDllPath;
3420}
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define pch(ap)
Definition: match.c:418

Referenced by setupDelayHook().

◆ GetSelectedComboListItem()

PVOID GetSelectedComboListItem ( IN HWND  hWndList)

Definition at line 675 of file reactos.c.

677{
678 INT Index;
679
681 if (Index == CB_ERR)
682 return NULL;
683
685}
_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:2471

Referenced by DeviceDlgProc().

◆ GetSelectedListViewItem()

PVOID GetSelectedListViewItem ( IN HWND  hWndList)

Definition at line 733 of file reactos.c.

735{
736 INT Index;
737 LVITEM item;
738
740 if (Index == LB_ERR)
741 return NULL;
742
743 item.mask = LVIF_PARAM;
744 item.iItem = Index;
746
747 return (PVOID)item.lParam;
748}
#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:2468

Referenced by UpgradeRepairDlgProc().

◆ GetSettingDescription()

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

Definition at line 753 of file reactos.c.

757{
758 StringCchCopyW(Buffer, cchBufferSize,
760}
_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 3332 of file reactos.c.

3333{
3334 ATOM hotkey;
3335 MSG msg;
3336
3337 DPRINT("HotkeyThread start\n");
3338
3339 hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
3340 if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
3341 DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
3342
3343 while (GetMessageW(&msg, NULL, 0, 0))
3344 {
3345 if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
3346 {
3347 WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
3348 STARTUPINFOW si = { sizeof(si) };
3350
3351 if (CreateProcessW(NULL,
3352 CmdLine,
3353 NULL,
3354 NULL,
3355 FALSE,
3357 NULL,
3358 NULL,
3359 &si,
3360 &pi))
3361 {
3364 }
3365 else
3366 {
3367 DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
3368 }
3369 }
3370 }
3371
3372 UnregisterHotKey(NULL, hotkey);
3373 GlobalDeleteAtom(hotkey);
3374
3375 DPRINT("HotkeyThread terminate\n");
3376 return 0;
3377}
#define msg(x)
Definition: auth_time.c:54
WORD ATOM
Definition: dimm.idl:113
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:444
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:434
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:4441
static const WCHAR CmdLine[]
Definition: install.c:48
#define MOD_SHIFT
Definition: imm.h:186
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static SYSTEM_INFO si
Definition: virtual.c:39
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define CREATE_NEW_CONSOLE
Definition: winbase.h:185
#define VK_F10
Definition: winuser.h:2300
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:1907

Referenced by _tWinMain().

◆ InitGenericComboList()

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

Definition at line 637 of file reactos.c.

641{
642 INT Index, CurrentEntryIndex = 0;
643 PGENERIC_LIST_ENTRY ListEntry;
645 WCHAR CurrentItemText[256];
646
647 for (Entry = List->ListHead.Flink;
648 Entry != &List->ListHead;
649 Entry = Entry->Flink)
650 {
652
653 if (GetEntryDescriptionProc)
654 {
655 GetEntryDescriptionProc(ListEntry,
656 CurrentItemText,
657 ARRAYSIZE(CurrentItemText));
658 Index = SendMessageW(hWndList, CB_ADDSTRING, 0, (LPARAM)CurrentItemText);
659 }
660 else
661 {
663 }
664
665 if (ListEntry == List->CurrentEntry)
666 CurrentEntryIndex = Index;
667
669 }
670
671 SendMessageW(hWndList, CB_SETCURSEL, CurrentEntryIndex, 0);
672}
Definition: genlist.h:11
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define CB_SETITEMDATA
Definition: winuser.h:1995
#define CB_SETCURSEL
Definition: winuser.h:1990
#define CB_ADDSTRING
Definition: winuser.h:1965

Referenced by DeviceDlgProc().

◆ InitGenericListView()

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

Definition at line 696 of file reactos.c.

700{
701 INT CurrentEntryIndex = 0;
702 LVITEM lvItem;
703 PGENERIC_LIST_ENTRY ListEntry;
705 WCHAR CurrentItemText[256];
706
707 for (Entry = List->ListHead.Flink;
708 Entry != &List->ListHead;
709 Entry = Entry->Flink)
710 {
712
713 if (!AddEntryItemProc)
714 continue;
715
716 AddEntryItemProc(hWndList,
717 &lvItem,
718 ListEntry,
719 CurrentItemText,
720 ARRAYSIZE(CurrentItemText));
721
722 if (ListEntry == List->CurrentEntry)
723 CurrentEntryIndex = lvItem.iItem;
724 }
725
726 ListView_EnsureVisible(hWndList, CurrentEntryIndex, FALSE);
727 ListView_SetItemState(hWndList, CurrentEntryIndex,
730}
#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 3014 of file reactos.c.

3016{
3017 InitializeListHead(&MappingList->List);
3018 MappingList->MappingsCount = 0;
3019}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

Referenced by _tWinMain().

◆ IsShellActive()

static BOOL IsShellActive ( VOID  )
static

Detects whether a Windows shell is active.

Definition at line 2618 of file reactos.c.

2619{
2620/* See reactos/undocuser.h */
2622
2623 /* Return success if a shell window is present, valid, and interactive */
2624 HWND hWndProgman = GetProgmanWindow();
2625 if (!(hWndProgman && IsWindow(hWndProgman) &&
2626 IsWindowEnabled(hWndProgman) && IsWindowVisible(hWndProgman)))
2627 {
2628 hWndProgman = GetShellWindow();
2629 }
2630 return (hWndProgman && IsWindow(hWndProgman) &&
2631 IsWindowEnabled(hWndProgman) && IsWindowVisible(hWndProgman));
2632}
HWND WINAPI GetProgmanWindow(void)
Definition: input.c:992
HWND WINAPI GetShellWindow(void)
Definition: input.c:974
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI IsWindow(_In_opt_ HWND)

Referenced by AreThereInteractiveWindows(), and FinishDlgProc().

◆ LoadAllocStringW()

size_t LoadAllocStringW ( _In_opt_ HINSTANCE hInstance hInstance  ,
_In_ UINT  uID,
_In_opt_ _Outptr_ PWSTR pString,
_In_opt_ size_t  cchBufferLen 
)

Definition at line 114 of file reactos.c.

120{
121 PCWSTR pStr;
122 size_t Length;
123
124 /* Try to load the string from the resource */
125 Length = LoadStringW(hInstance, uID, (PWSTR)&pStr, 0);
126 if (Length == 0)
127 {
128 /* No resource string was found, return NULL */
129 *pString = NULL;
130 return 0;
131 }
132
133 /* If the caller gave a pointer to a buffer on input, verify whether it
134 * is large enough to contain the string. If not, allocate a new buffer. */
135 if (!*pString || (cchBufferLen < Length + 1))
136 {
137 /* Allocate a new buffer, adding a NUL-terminator */
138 *pString = HeapAlloc(GetProcessHeap(), 0, (Length + 1) * sizeof(WCHAR));
139 if (!*pString)
140 return 0;
141 }
142
143 /* Copy the string, NUL-terminated */
144 StringCchCopyNW(*pString, Length + 1, pStr, Length);
145 return Length;
146}
_In_ UINT uID
Definition: shlwapi.h:156

Referenced by CheckForOtherInstance(), DisplayMessageV(), SetWindowResPrintfVW(), and SetWindowResTextW().

◆ LoadSetupData()

BOOL LoadSetupData ( IN OUT PSETUPDATA  pSetupData)

Definition at line 2919 of file reactos.c.

2921{
2922 pSetupData->PartitionList = CreatePartitionList();
2923 if (!pSetupData->PartitionList)
2924 {
2925 DPRINT1("Could not enumerate available disks; failing installation\n");
2926 return FALSE;
2927 }
2928
2929 pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
2930 if (!pSetupData->NtOsInstallsList)
2931 DPRINT1("Failed to get a list of NTOS installations; continue installation...\n");
2932
2933 /* Load the hardware, language and keyboard layout lists */
2934
2935 pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf);
2936 pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
2937 pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
2938
2939 pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
2940
2941 /* If not unattended, overwrite language and locale with
2942 * the current ones of the running ReactOS instance */
2943 if (!pSetupData->bUnattend)
2944 {
2945 LCID LocaleID = GetUserDefaultLCID();
2946
2947 StringCchPrintfW(pSetupData->DefaultLanguage,
2948 _countof(pSetupData->DefaultLanguage),
2949 L"%08lx", LocaleID);
2950
2951 StringCchPrintfW(pSetupData->USetupData.LocaleID,
2952 _countof(pSetupData->USetupData.LocaleID),
2953 L"%08lx", LocaleID);
2954 }
2955
2956 /* new part */
2957 pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
2958 wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
2959 pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
2960
2961 pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
2962 pSetupData->SelectedLanguageId,
2963 pSetupData->DefaultKBLayout);
2964
2965 /* If not unattended, overwrite keyboard layout with
2966 * the current one of the running ReactOS instance */
2967 if (!pSetupData->bUnattend)
2968 {
2969 C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
2970 /* If the call fails, keep the default already stored in the buffer */
2971 GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
2972 }
2973
2974 /* Change the default entries in the language and keyboard layout lists */
2975 {
2976 PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList;
2977 PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList;
2978 PGENERIC_LIST_ENTRY ListEntry;
2979
2980 /* Search for default language */
2981 for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
2982 ListEntry = GetNextListEntry(ListEntry))
2983 {
2984 PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2985 if (!_wcsicmp(pSetupData->DefaultLanguage, LocaleId))
2986 {
2987 DPRINT("found %S in LanguageList\n", LocaleId);
2988 SetCurrentListEntry(LanguageList, ListEntry);
2989 break;
2990 }
2991 }
2992
2993 /* Search for default layout */
2994 for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
2995 ListEntry = GetNextListEntry(ListEntry))
2996 {
2997 PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
2998 // FIXME: Temporary "fix" to set the best keyboard entry depending on the
2999 // selected language in unattended setup; see also usetup!SetupStartPage().
3000 if (( pSetupData->bUnattend && !_wcsicmp(pSetupData->DefaultLanguage, pszLayoutId)) ||
3001 (!pSetupData->bUnattend && !_wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId)))
3002 {
3003 DPRINT("Found %S in LayoutList\n", pszLayoutId);
3004 SetCurrentListEntry(LayoutList, ListEntry);
3005 break;
3006 }
3007 }
3008 }
3009
3010 return TRUE;
3011}
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:1216
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
#define C_ASSERT(e)
Definition: intsafe.h:73
USHORT LANGID
Definition: mui.h:9
PGENERIC_LIST_ENTRY NTAPI GetFirstListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:110
PGENERIC_LIST_ENTRY NTAPI GetNextListEntry(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:121
PGENERIC_LIST NTAPI CreateNTOSInstallationsList(_In_ PPARTLIST PartList)
Create a list of available NT OS installations on the computer, by searching for recognized ones on e...
Definition: osdetect.c:768
DWORD LCID
Definition: nls.h:13
wcscpy
PPARTLIST NTAPI CreatePartitionList(VOID)
Definition: partlist.c:2043
_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 1954 of file reactos.c.

1956{
1957 PSETUPDATA pSetupData;
1958 HWND hwndDlg = (HWND)Param;
1959 HWND hWndParent = GetParent(hwndDlg);
1960 HWND hWndProgress;
1961 LONG_PTR dwStyle;
1962 ERROR_NUMBER ErrorNumber;
1965 FSVOL_CONTEXT FsVolContext;
1968
1969 /* Retrieve pointer to the global setup data */
1970 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1971
1972 /* Get the progress handle */
1973 hWndProgress = GetDlgItem(hwndDlg, IDC_PROCESSPROGRESS);
1974
1975 /* Setup global UI context */
1976 UiContext.hwndDlg = hwndDlg;
1978 UiContext.hWndProgress = hWndProgress;
1979 UiContext.dwPbStyle = 0;
1980
1981
1982 /* Disable the Close/Cancel buttons during all partition operations */
1983 // TODO: Consider, alternatively, to just show an info-box saying
1984 // that the installation process cannot be canceled at this stage?
1986
1987
1988 /*
1989 * Find/Set the system partition, and apply all pending partition operations.
1990 */
1991
1992 /* Create context for the volume/partition operations */
1993 FsVolContext.pSetupData = pSetupData;
1994
1995 /* Set status text */
1997 pSetupData->hInstance,
1999 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2000
2001 /* Find or set the active system partition before starting formatting */
2006 &FsVolContext);
2007 // if (!Success)
2008 // return FsVolContext.NextPageOnAbort;
2009 //
2010 // FIXME?? If cannot use any system partition, install FreeLdr on floppy / removable media??
2011 //
2012 if (!Success)
2013 {
2014 /* Display an error if an unexpected failure happened */
2015 MessageBoxW(hWndParent, L"Failed to find or set the system partition!", NULL, MB_ICONERROR);
2016
2017 /* Re-enable the Close/Cancel buttons */
2019 goto Quit;
2020 }
2021
2022
2023 /* Set status text */
2025 pSetupData->hInstance,
2027 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2028
2029 /* Apply all pending operations on partitions: formatting and checking */
2034 &FsVolContext);
2035 if (!Success)
2036 {
2037 /* Display an error if an unexpected failure happened */
2038 MessageBoxW(hWndParent, L"Failed to prepare the partitions!", NULL, MB_ICONERROR);
2039
2040 /* Re-enable the Close/Cancel buttons */
2042 goto Quit;
2043 }
2044
2045
2046 /* Re-enable the Close/Cancel buttons */
2048
2049
2050 /* Re-calculate the final destination paths */
2052 Status = InitDestinationPaths(&pSetupData->USetupData,
2053 NULL, // pSetupData->USetupData.InstallationDirectory,
2056 if (!Success)
2057 {
2058 DisplayMessage(hWndParent, MB_ICONERROR, NULL, L"InitDestinationPaths() failed with status 0x%08lx\n", Status);
2059 goto Quit;
2060 }
2061
2062
2063 /*
2064 * Preparation of the list of files to be copied
2065 */
2066
2067 /* Set status text */
2069 pSetupData->hInstance,
2071 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2072
2073 /* Set progress marquee style and start it up */
2074 dwStyle = GetWindowLongPtrW(hWndProgress, GWL_STYLE);
2075 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle | PBS_MARQUEE);
2076 SendMessageW(hWndProgress, PBM_SETMARQUEE, TRUE, 0);
2077
2078 /* Prepare the list of files */
2079 /* ErrorNumber = */ Success = PrepareFileCopy(&pSetupData->USetupData, NULL);
2080
2081 /* Stop progress and restore its style */
2082 SendMessageW(hWndProgress, PBM_SETMARQUEE, FALSE, 0);
2083 SetWindowLongPtrW(hWndProgress, GWL_STYLE, dwStyle);
2084
2085 if (/*ErrorNumber != ERROR_SUCCESS*/ !Success)
2086 {
2087 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
2088 if (!pSetupData->bAbortInstall)
2089 MessageBoxW(hWndParent, L"Failed to prepare the list of files!", NULL, MB_ICONERROR);
2090 goto Quit;
2091 }
2092
2093
2094 /*
2095 * Perform the file copy
2096 */
2097
2098 /* Set status text */
2100 pSetupData->hInstance,
2102 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2103
2104 /* Create context for the copy process */
2105 CopyContext.pSetupData = pSetupData;
2106 CopyContext.TotalOperations = 0;
2107 CopyContext.CompletedOperations = 0;
2108
2109 /* Do the file copying - The callback handles whether or not we should stop file copying */
2111 if (!Success)
2112 {
2113 /* Display an error only if an unexpected failure happened, and not because the user cancelled the installation */
2114 if (!pSetupData->bAbortInstall)
2115 MessageBoxW(hWndParent, L"Failed to copy the files!", NULL, MB_ICONERROR);
2116 goto Quit;
2117 }
2118
2119 // /* Set status text */
2120 // SetWindowResTextW(GetDlgItem(hwndDlg, IDC_ACTIVITY),
2121 // pSetupData->hInstance,
2122 // IDS_INSTALL_FINALIZE);
2123 // SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2124
2125 /* Create the $winnt$.inf file */
2126 InstallSetupInfFile(&pSetupData->USetupData);
2127
2128
2129 /* Disable the Close/Cancel buttons for the remaining non-cancellable operations */
2130 // TODO: Consider, alternatively, to just show an info-box saying
2131 // that the installation process cannot be canceled at this stage?
2133
2134 /*
2135 * Create or update the registry hives
2136 */
2137
2138 /* Set status text */
2140 pSetupData->hInstance,
2143 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2144
2145 /* Set up the progress bar */
2146 SendMessageW(hWndProgress,
2147 PBM_SETRANGE, 0,
2148 MAKELPARAM(0, 8)); // FIXME: hardcoded number of steps, see StringIDs[] array in RegistryStatus()
2149 SendMessageW(hWndProgress,
2150 PBM_SETSTEP, 1, 0);
2151 SendMessageW(hWndProgress,
2152 PBM_SETPOS, 0, 0);
2153
2154 ErrorNumber = UpdateRegistry(&pSetupData->USetupData,
2155 pSetupData->RepairUpdateFlag,
2156 pSetupData->PartitionList,
2157 InstallVolume->Info.DriveLetter,
2158 pSetupData->SelectedLanguageId,
2160 NULL /* SubstSettings */);
2161 DBG_UNREFERENCED_PARAMETER(ErrorNumber);
2163
2164 /*
2165 * And finally, install the bootloader
2166 */
2167
2168 /* Set status text */
2170 pSetupData->hInstance,
2172 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2173
2175 StringCchPrintfW(PathBuffer, _countof(PathBuffer),
2176 L"%s\\", SystemPartition->DeviceName);
2177 RtlCreateUnicodeString(&pSetupData->USetupData.SystemRootPath, PathBuffer);
2178 DPRINT1("SystemRootPath: %wZ\n", &pSetupData->USetupData.SystemRootPath);
2179
2180 switch (pSetupData->USetupData.BootLoaderLocation)
2181 {
2182 /* Install on removable disk */
2183 case 1:
2184 {
2185 // TODO: So far SETUP only supports the 1st floppy.
2186 // Use a simple UI like comdlg32's DlgDirList* to show
2187 // a list of drives that the user could select.
2188 static const UNICODE_STRING FloppyDrive = RTL_CONSTANT_STRING(L"\\Device\\Floppy0\\");
2189 static const WCHAR DriveLetter = L'A';
2190
2191 INT nRet;
2192 RetryCancel:
2195 L"Bootloader installation",
2196 L"Please insert a blank floppy disk in drive %c: .\n"
2197 L"All data in the floppy disk will be erased!\n"
2198 L"\nClick on OK to continue."
2199 L"\nClick on CANCEL to skip bootloader installation.",
2200 DriveLetter);
2201 if (nRet != IDOK)
2202 break; /* Skip installation */
2203
2204 Retry:
2206 &FloppyDrive,
2207 &pSetupData->USetupData.SourceRootPath,
2208 &pSetupData->USetupData.DestinationArcPath);
2209 if (Status == STATUS_SUCCESS)
2210 break; /* Successful installation */
2211
2213 {
2214 // ERROR_NO_FLOPPY
2217 NULL, // Default to "Error"
2218 L"No disk detected in drive %c: .",
2219 DriveLetter);
2220 if (nRet == IDRETRY)
2221 goto Retry;
2222 }
2223 else if ((Status == ERROR_WRITE_BOOT) ||
2225 {
2226 /* Error when writing the boot code */
2228 0, // Default to "Error"
2230 }
2231 else if (!NT_SUCCESS(Status))
2232 {
2233 /* Any other NTSTATUS failure code */
2234 DPRINT1("InstallBootcodeToRemovable() failed: Status 0x%lx\n", Status);
2236 0, // Default to "Error"
2238 Status);
2239 }
2240 goto RetryCancel;
2241 }
2242
2243 /* Install on hard-disk */
2244 case 2: // System partition / MBR and VBR (on BIOS-based PC)
2245 case 3: // VBR only (on BIOS-based PC)
2246 {
2247 /* Copy FreeLoader to the disk and save the boot entries */
2249 pSetupData->USetupData.ArchType,
2250 &pSetupData->USetupData.SystemRootPath,
2251 &pSetupData->USetupData.SourceRootPath,
2252 &pSetupData->USetupData.DestinationArcPath,
2253 (pSetupData->USetupData.BootLoaderLocation == 2)
2254 ? 1 /* Install MBR and VBR */
2255 : 0 /* Install VBR only */);
2256 if (Status == STATUS_SUCCESS)
2257 break; /* Successful installation */
2258
2259 if (Status == ERROR_WRITE_BOOT)
2260 {
2261 /* Error when writing the VBR */
2263 0, // Default to "Error"
2265 SystemVolume->Info.FileSystem);
2266 }
2267 else if (Status == ERROR_INSTALL_BOOTCODE)
2268 {
2269 /* Error when writing the MBR */
2271 0, // Default to "Error"
2273 L"MBR");
2274 }
2275 else if (Status == STATUS_NOT_SUPPORTED)
2276 {
2278 0, // Default to "Error"
2280 }
2281 else if (!NT_SUCCESS(Status))
2282 {
2283 /* Any other NTSTATUS failure code */
2284 DPRINT1("InstallBootManagerAndBootEntries() failed: Status 0x%lx\n", Status);
2286 0, // Default to "Error"
2288 Status);
2289 }
2290 Success = FALSE;
2291 goto Quit;
2292 }
2293
2294 /* Skip installation */
2295 case 0:
2296 default:
2297 break;
2298 }
2299
2300Quit:
2301 /* Signal the wizard page that we have succeeded or failed */
2302 PostMessage(hwndDlg, PM_INSTALL_DONE, Success, 0); // Status
2303 return Success;
2304}
unsigned char BOOLEAN
Definition: actypes.h:127
BOOLEAN NTAPI PrepareFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL)
Definition: install.c:685
BOOLEAN NTAPI DoFileCopy(IN OUT PUSETUP_DATA pSetupData, IN PSP_FILE_CALLBACK_W MsgHandler, IN PVOID Context OPTIONAL)
Definition: install.c:828
static VOID __cdecl RegistryStatus(IN REGISTRY_STATUS RegStatus,...)
Definition: reactos.c:1901
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1430
#define SystemVolume
Definition: reactos.c:34
#define InstallVolume
Definition: reactos.c:29
#define PM_INSTALL_DONE
Definition: reactos.c:1950
PPARTENTRY InstallPartition
Definition: reactos.c:27
PPARTENTRY SystemPartition
Definition: reactos.c:32
static UINT CALLBACK FileCopyCallback(PVOID Context, UINT Notification, UINT_PTR Param1, UINT_PTR Param2)
Definition: reactos.c:1769
#define IDS_CONFIG_SYSTEM_PARTITION
Definition: resource.h:146
#define IDS_COPYING_FILES
Definition: resource.h:149
#define IDS_ERROR_BOOTLDR_FAILED
Definition: resource.h:212
#define IDS_PREPARE_FILES
Definition: resource.h:148
#define IDS_PREPARE_PARTITIONS
Definition: resource.h:147
#define IDS_ERROR_BOOTLDR_ARCH_UNSUPPORTED
Definition: resource.h:210
#define IDC_PROCESSPROGRESS
Definition: resource.h:72
#define IDS_ERROR_INSTALL_BOOTCODE
Definition: resource.h:207
#define IDS_ERROR_WRITE_BOOT
Definition: resource.h:205
#define IDS_ERROR_INSTALL_BOOTCODE_REMOVABLE
Definition: resource.h:208
#define IDS_UPDATE_REGISTRY
Definition: resource.h:151
#define IDC_ACTIVITY
Definition: resource.h:70
#define IDS_INSTALL_BOOTLOADER
Definition: resource.h:153
#define IDS_CREATE_REGISTRY
Definition: resource.h:150
NTSTATUS NTAPI InstallBootcodeToRemovable(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING RemovableRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath)
Definition: bootsup.c:1830
NTSTATUS NTAPI InstallBootManagerAndBootEntries(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ ULONG_PTR Options)
Installs FreeLoader on the system and configure the boot entries.
Definition: bootsup.c:1674
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RTL_CONSTANT_STRING(s)
Definition: combase.c:35
HANDLE HWND
Definition: compat.h:19
static PDISK_IMAGE FloppyDrive[2]
Definition: dskbios32.c:36
enum _ERROR_NUMBER ERROR_NUMBER
@ ERROR_WRITE_BOOT
Definition: errorcode.h:28
@ ERROR_INSTALL_BOOTCODE
Definition: errorcode.h:35
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define RTL_NUMBER_OF_FIELD(type, field)
Definition: ntbasedef.h:715
#define DBG_UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:330
BOOLEAN NTAPI FsVolCommitOpsQueue(_In_ PPARTLIST PartitionList, _In_ PVOLENTRY SystemVolume, _In_ PVOLENTRY InstallVolume, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Definition: fsutil.c:1097
VOID NTAPI InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:208
NTSTATUS NTAPI InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:866
BOOLEAN NTAPI InitSystemPartition(_In_ PPARTLIST PartitionList, _In_ PPARTENTRY InstallPartition, _Out_ PPARTENTRY *pSystemPartition, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Find or set the active system partition.
Definition: setuplib.c:681
ERROR_NUMBER NTAPI UpdateRegistry(IN OUT PUSETUP_DATA pSetupData, IN BOOLEAN RepairUpdateFlag, IN PPARTLIST PartitionList, IN WCHAR DestinationDriveLetter, IN PCWSTR SelectedLanguageId, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL)
Definition: setuplib.c:1157
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
WCHAR DeviceName[MAX_PATH]
NT device name: "\Device\HarddiskM\PartitionN".
Definition: partlist.h:77
UCHAR bAbortInstall
Definition: reactos.h:141
PCWSTR SelectedLanguageId
Definition: reactos.h:171
PPARTLIST PartitionList
Definition: reactos.h:160
UNICODE_STRING SystemRootPath
Definition: setuplib.h:119
UNICODE_STRING SourceRootPath
Definition: setuplib.h:101
LONG BootLoaderLocation
Definition: setuplib.h:132
ARCHITECTURE_TYPE ArchType
Definition: setuplib.h:145
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:122
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
#define MB_RETRYCANCEL
Definition: winuser.h:816
#define PostMessage
Definition: winuser.h:5998
#define MB_ICONINFORMATION
Definition: winuser.h:813
#define IDRETRY
Definition: winuser.h:844

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 2310 of file reactos.c.

2315{
2316 PSETUPDATA pSetupData;
2317
2318 /* Retrieve pointer to the global setup data */
2319 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
2320
2321 switch (uMsg)
2322 {
2323 case WM_INITDIALOG:
2324 {
2325 /* Save pointer to the global setup data */
2326 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
2327 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
2328
2329 /* Reset the status text and set the main label in bold */
2330 SetDlgItemTextW(hwndDlg, IDC_ACTIVITY, L"");
2331 SetDlgItemTextW(hwndDlg, IDC_ITEM, L"");
2332 SetDlgItemFont(hwndDlg, IDC_ACTIVITY, pSetupData->hBoldFont, TRUE);
2333 break;
2334 }
2335
2336 case WM_SETCURSOR:
2337 {
2338 /* Set a page-wide cursor */
2339 if (!hWaitCursor)
2340 break;
2343 return TRUE;
2344 }
2345
2346 case WM_NOTIFY:
2347 {
2348 LPNMHDR lpnm = (LPNMHDR)lParam;
2349
2350 switch (lpnm->code)
2351 {
2352 case PSN_SETACTIVE:
2353 {
2354 HWND hWndParent = GetParent(hwndDlg);
2355
2356 /*
2357 * Disable all buttons during installation, and hide "Back" and "Next".
2358 * Don't use the PropSheet_SetWizButtons() macro, because its
2359 * posted message would be handled after hiding the buttons.
2360 * The message would then interfere with the hidden buttons
2361 * (when both "Back" and "Next" are hidden, "Next" gets forcefully shown).
2362 */
2364 // PropSheet_ShowWizButtons(hWndParent, 0, PSWIZB_BACK | PSWIZB_NEXT);
2367
2368 /* Start the installation procedure once the page is fully displayed */
2369 PostMessageW(hwndDlg, PM_INSTALL_START, 0, 0);
2370 break;
2371 }
2372
2373 case PSN_KILLACTIVE:
2374 {
2375 /* Avoid reentrant calls caused by the message dispatching
2376 * done below: allow only the first page change, and ignore
2377 * all the others. */
2380 {
2382 return TRUE;
2383 }
2384
2385 /* If no installation is running, just change the page */
2386 if (!pSetupData->hInstallThread)
2387 break;
2388
2389 /* Wait for the installation thread to terminate.
2390 * Since we dispatch messages in the meantime, we must
2391 * guard the property sheet notification handlers from
2392 * being invoked multiple times. */
2394 if (dwStatus == WAIT_TIMEOUT)
2395 {
2396 /* Show the hourglass cursor */
2397 HCURSOR hOldCursor;
2399 hOldCursor = SetCursor(hWaitCursor);
2401
2402 for (;;)
2403 {
2404 MSG msg;
2406 FALSE, INFINITE,
2408 if (dwStatus != (WAIT_OBJECT_0 + 1))
2409 break; // Stop if anything else (thread terminated, timeout or failure).
2410
2411 /* We still need to process main window messages to avoid freeze */
2412 while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
2413 {
2416 }
2417 }
2418
2419 /* Restore the old cursor */
2421 SetCursor(hOldCursor);
2422 hWaitCursor = NULL;
2423 }
2424#if 0 && DBG
2425 if (dwStatus == WAIT_OBJECT_0)
2426 {
2427 DWORD dwExitCode = NO_ERROR;
2428 GetExitCodeThread(pSetupData->hInstallThread, &dwExitCode);
2429 DBG_UNREFERENCED_PARAMETER(dwExitCode);
2430 }
2431#endif
2432 /* Cleanup; we can now change the page */
2433 CloseHandle(pSetupData->hInstallThread);
2434 pSetupData->hInstallThread = NULL;
2435 CloseHandle(pSetupData->hHaltInstallEvent);
2436 pSetupData->hHaltInstallEvent = NULL;
2437 break;
2438 }
2439
2440 case PSN_QUERYCANCEL:
2441 {
2442 INT nRet;
2443
2444 if (pSetupData->bStopInstall)
2445 {
2446 /* The installation is terminating (either successfully,
2447 * or cancelled by the user or due to an error), ignore all
2448 * new requests since this is now too late to change bets. */
2449 nRet = IDYES;
2450 }
2451 else
2452 {
2453 /* Halt the on-going file copy */
2454 ResetEvent(pSetupData->hHaltInstallEvent);
2455
2456 nRet = DisplayMessage(GetParent(hwndDlg),
2460 if (nRet == IDYES)
2461 {
2462 /* Signal the file copy thread to stop */
2464 }
2465 /* else, we don't stop installation, resume file copy */
2466 SetEvent(pSetupData->hHaltInstallEvent);
2467 }
2468
2469 /* If we are not already in the process of cancelling
2470 * the installation or switching to a page, do it now. */
2471 if ((nRet == IDYES) && !pSetupData->bPageSwitching &&
2474 {
2475 /* Go to the Abort page */
2476#ifdef TERMINATE_USE_PRESSBUTTON
2479#else
2480 PostMessageW(hwndDlg, PM_INSTALL_DONE, FALSE, 0);
2481#endif
2482 }
2483
2484 /* Do not close the wizard too soon */
2486 return TRUE;
2487 }
2488
2489 case PSN_WIZBACK:
2490 /* Always disable going back */
2491 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, -1);
2492 return TRUE;
2493
2494 case PSN_WIZNEXT:
2495 {
2496#ifdef TERMINATE_USE_PRESSBUTTON
2497 LONG_PTR nNextPage = (!pSetupData->bAbortInstall ? IDD_FINISHPAGE : IDD_ABORTPAGE);
2498 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, nNextPage);
2499#else
2500 /* Always disable going next */
2501 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, -1);
2502#endif
2503 return TRUE;
2504 }
2505
2506 default:
2507 break;
2508 }
2509 break;
2510 }
2511
2512 case PM_INSTALL_START:
2513 {
2514 HWND hWndParent = GetParent(hwndDlg);
2515
2516 ASSERT(pSetupData->hInstallThread == NULL);
2517
2518 /* Force repainting first to make sure the wizard is visible */
2521
2522 /* Create the file-copy halt (manual-reset) event */
2523 pSetupData->hHaltInstallEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
2524 if (!pSetupData->hHaltInstallEvent)
2525 {
2527 L"Cannot create the install event, error %lu\n", GetLastError());
2528 goto Fail;
2529 }
2530 /* Start the installation thread */
2531 pSetupData->bStopInstall = FALSE;
2532 pSetupData->hInstallThread = CreateThread(NULL, 0,
2534 (PVOID)hwndDlg,
2535 0, NULL);
2536 if (!pSetupData->hInstallThread)
2537 {
2539 L"Cannot create the installation thread, error %lu\n", GetLastError());
2540 CloseHandle(pSetupData->hHaltInstallEvent);
2541 pSetupData->hHaltInstallEvent = NULL;
2542 Fail:
2543 /* Cancel the installation */
2545#ifdef TERMINATE_USE_PRESSBUTTON
2548#else
2549 SendMessageW(hwndDlg, PM_INSTALL_DONE, FALSE, 0);
2550#endif
2551 }
2552 break;
2553 }
2554
2555 case PM_INSTALL_DONE:
2556 {
2557 HWND hWndParent = GetParent(hwndDlg);
2558 BOOL Success = !!wParam;
2559 BOOL AutoSwitchPage = TRUE;
2560
2561 /* If an unexpected error happened, stay on the copy page to allow
2562 * the user to view the current state, and keep the Close/Cancel
2563 * buttons to allow going to the Abort page.
2564 * Otherwise, we have been manually cancelled by the user and we
2565 * will directly switch to the Abort page. */
2566 if (!Success && !pSetupData->bStopInstall)
2567 {
2569 AutoSwitchPage = FALSE;
2570 }
2571 else
2572 {
2573 /* Disable the Close/Cancel buttons, since the installation has
2574 * either successfully terminated, or was already cancelled by
2575 * the user. */
2577 }
2578
2579 if (!Success)
2580 {
2581 /* The installation was aborted */
2583 }
2584 else if (pSetupData->bAbortInstall)
2585 {
2586 /* Override success in case the thread just terminated with some status
2587 * while at the same time, the user chose to cancel the installation */
2588 Success = FALSE;
2589 }
2590
2591 /* We are done! Switch to the Finish or the Abort page */
2592 if (!AutoSwitchPage)
2593 break;
2594 // TODO: if (!Success): Unwind installation.
2595#ifdef TERMINATE_USE_PRESSBUTTON
2596 // NOTE: In this case, PSN_QUERYCANCEL **CANNOT** call PM_INSTALL_DONE
2598#else
2599 if (!Success)
2602#endif
2603 break;
2604 }
2605
2606 default:
2607 break;
2608 }
2609
2610 return FALSE;
2611}
HCURSOR hWaitCursor
Definition: reactos.c:38
#define PM_INSTALL_START
Definition: reactos.c:1949
static DWORD WINAPI PrepareAndDoCopyThread(IN LPVOID Param)
Definition: reactos.c:1954
#define SETUP_ABORT_INSTALL
Definition: reactos.h:140
#define SETUP_PAGE_SWITCHING
Definition: reactos.h:146
#define SETUP_IS_CANCELLING
Definition: reactos.h:143
#define InterlockedFlagsTestAndSet8(Target, Flags)
Definition: reactos.h:118
#define IDD_FINISHPAGE
Definition: resource.h:74
#define NO_ERROR
Definition: dderror.h:5
#define WAIT_TIMEOUT
Definition: dderror.h:14
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:541
int Fail
Definition: ehthrow.cxx:24
#define InterlockedOr8
Definition: interlocked.h:244
#define PSBTN_CANCEL
Definition: prsht.h:151
#define PSBTN_NEXT
Definition: prsht.h:147
DWORD dwStatus
Definition: mediaobj.idl:95
UCHAR bPageSwitching
Definition: reactos.h:147
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:650
char * PCHAR
Definition: typedefs.h:51
#define WAIT_OBJECT_0
Definition: winbase.h:383
HICON HCURSOR
Definition: windef.h:99
BOOL WINAPI TranslateMessage(_In_ const MSG *)
int WINAPI ShowCursor(_In_ BOOL)
Definition: cursoricon.c:3071
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:893
#define QS_ALLINPUT
Definition: winuser.h:914
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI UpdateWindow(_In_ HWND)
#define LoadCursor
Definition: winuser.h:5978
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define WM_SETCURSOR
Definition: winuser.h:1664
#define IDC_WAIT
Definition: winuser.h:697
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

◆ PropSheet_SetCloseCancel()

VOID PropSheet_SetCloseCancel ( _In_ HWND  hWndWiz,
_In_ BOOL  Enable 
)

Enable or disable the Cancel and the Close title-bar property-sheet buttons.

The buttons are however kept visible in case they are disabled (this informs the user they are disabled only temporarily).

Definition at line 1939 of file reactos.c.

1942{
1943 EnableDlgItem(hWndWiz, IDCANCEL, Enable);
1945 SC_CLOSE,
1947}
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define MF_BYCOMMAND
Definition: winuser.h:202
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_GRAYED
Definition: winuser.h:129

Referenced by FinishDlgProc(), PrepareAndDoCopyThread(), and ProcessDlgProc().

◆ PropSheetCallback()

static int CALLBACK PropSheetCallback ( _In_ HWND  hDlg,
_In_ UINT  message,
_In_ LPARAM  lParam 
)
static

Definition at line 3569 of file reactos.c.

3573{
3574 switch (message)
3575 {
3576 case PSCB_PRECREATE:
3577 {
3578 LPDLGTEMPLATE dlgTemplate = (LPDLGTEMPLATE)lParam;
3579 LPDLGTEMPLATEEX dlgTemplateEx = (LPDLGTEMPLATEEX)lParam;
3580 DWORD dwStyle = 0, dwStyleMask = 0;
3581
3582 // FIXME: HACK: See hack in PropSheetCallback()::PSCB_INITIALIZED
3583 // Hide the dialog by default; DM_REPOSITION will center it on screen then show it.
3584 dwStyleMask |= WS_VISIBLE;
3585
3586 dwStyle |= DS_CENTER; // Center the dialog -- But propsheet code repositions it afterwards...
3587 //dwStyleMask |= DS_CONTEXTHELP; // TODO: Enable if you want context help.
3588 dwStyle |= DS_SETFOREGROUND; // Ensure we are initially set to the foreground.
3589 dwStyleMask |= dwStyle;
3590
3591 /* Set the property sheet dialog styles */
3592 if (dlgTemplateEx->signature == 0xFFFF)
3593 dlgTemplateEx->style = (dlgTemplateEx->style & ~dwStyleMask) | (dwStyle & dwStyleMask);
3594 else
3595 dlgTemplate->style = (dlgTemplate->style & ~dwStyleMask) | (dwStyle & dwStyleMask);
3596 break;
3597 }
3598
3599 // NOTE: This callback is needed to set large icon correctly.
3600 case PSCB_INITIALIZED:
3601 {
3603 SendMessageW(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
3604
3605 /* Sub-class the property sheet window procedure */
3607
3608 // FIXME: HACK: Wine comctl32 propsheet.c doesn't send DM_REPOSITION
3609 // after creating, initializing and resizing the property sheet dialog,
3610 // so we simulate its call there...
3611 PostMessageW(hDlg, DM_REPOSITION, 0, 0);
3612 break;
3613 }
3614
3615 default:
3616 break;
3617 }
3618
3619 return FALSE;
3620}
struct DLGTEMPLATEEX * LPDLGTEMPLATEEX
WNDPROC wpOrgPrshtProc
Definition: reactos.c:3521
static LRESULT CALLBACK PrshtWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:3526
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define WS_VISIBLE
Definition: pedump.c:620
#define PSCB_PRECREATE
Definition: prsht.h:76
#define PSCB_INITIALIZED
Definition: prsht.h:75
WORD signature
Definition: msconfig.c:127
DWORD style
Definition: msconfig.c:130
DWORD style
Definition: winuser.h:3167
Definition: tftpd.h:60
#define ICON_BIG
Definition: tnclass.cpp:51
#define DWLP_DLGPROC
Definition: winuser.h:882
struct DLGTEMPLATE * LPDLGTEMPLATE
#define DS_CENTER
Definition: winuser.h:369
#define DS_SETFOREGROUND
Definition: winuser.h:379
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
#define DM_REPOSITION
Definition: winuser.h:2136
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444

Referenced by _tWinMain().

◆ PrshtWndProc()

static LRESULT CALLBACK PrshtWndProc ( HWND  hWnd,
UINT  uMessage,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 3526 of file reactos.c.

3527{
3528 switch (uMessage)
3529 {
3530 case DM_REPOSITION:
3531 {
3532 /* Center the wizard window */
3534 // FIXME: HACK: See hack in PropSheetCallback()::PSCB_INITIALIZED
3536 break;
3537 }
3538
3539 case WM_SETCURSOR:
3540 {
3541 /* Set a wizard-wide cursor */
3542 // NOTE: There is a problem, where when hovering over the wizard
3543 // navigation buttons, the cursor would blink with the arrow.
3544 // To mitigate this problem, only show the custom cursor when
3545 // we are on the main wizard window.
3546 if (!(hWaitCursor && (wParam == (WPARAM)hWnd)))
3547 break;
3549 return TRUE;
3550 }
3551
3552 case WM_DESTROY:
3553 {
3554 /* Restore the original dialog procedure */
3557 }
3558
3559 default:
3560 break;
3561 }
3562
3563 /* Invoke the original dialog procedure */
3564 return CallWindowProc(wpOrgPrshtProc, hWnd, uMessage, wParam, lParam);
3565}
UINT_PTR WPARAM
Definition: minwindef.h:174
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define CallWindowProc
Definition: winuser.h:5901
#define WM_DESTROY
Definition: winuser.h:1637

Referenced by PropSheetCallback().

◆ RegistryStatus()

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

Definition at line 1901 of file reactos.c.

1902{
1903 /* WARNING: Please keep this lookup table in sync with the resources! */
1904 static const UINT StringIDs[] =
1905 {
1906 IDS_REG_DONE, /* Success */
1907 IDS_REG_REGHIVEUPDATE, /* RegHiveUpdate */
1908 IDS_REG_IMPORTFILE, /* ImportRegHive */
1909 IDS_REG_DISPLAYSETTINGSUPDATE, /* DisplaySettingsUpdate */
1910 IDS_REG_LOCALESETTINGSUPDATE, /* LocaleSettingsUpdate */
1911 IDS_REG_ADDKBLAYOUTS, /* KeybLayouts */
1912 IDS_REG_KEYBOARDSETTINGSUPDATE, /* KeybSettingsUpdate */
1913 IDS_REG_CODEPAGEINFOUPDATE, /* CodePageInfoUpdate */
1914 };
1915
1916 if (RegStatus < _countof(StringIDs))
1917 {
1918 va_list args;
1919 va_start(args, RegStatus);
1921 va_end(args);
1922 }
1923 else
1924 {
1926 }
1927
1929}
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:302
#define IDS_REG_REGHIVEUPDATE
Definition: resource.h:156
#define IDS_REG_CODEPAGEINFOUPDATE
Definition: resource.h:162
#define IDS_REG_DONE
Definition: resource.h:155
#define IDS_REG_IMPORTFILE
Definition: resource.h:157
#define IDS_REG_UNKNOWN
Definition: resource.h:163
#define IDS_REG_KEYBOARDSETTINGSUPDATE
Definition: resource.h:161
#define IDS_REG_ADDKBLAYOUTS
Definition: resource.h:160
#define IDS_REG_LOCALESETTINGSUPDATE
Definition: resource.h:159
#define IDS_REG_DISPLAYSETTINGSUPDATE
Definition: resource.h:158

Referenced by PrepareAndDoCopyThread().

◆ setupDelayHook()

static FARPROC WINAPI setupDelayHook ( unsigned  dliNotify,
PDelayLoadInfo  pdli 
)
static

Controls the delay-loading of Setup DLLs from a suitable path.

See also
https://stackoverflow.com/a/75325443 https://devblogs.microsoft.com/oldnewthing/20170126-00/?p=95265

Definition at line 3440 of file reactos.c.

3441{
3442 static CHAR dllPath[MAX_PATH];
3443 static PCWSTR setupDllPath = NULL;
3444
3445 switch (dliNotify)
3446 {
3448 {
3449 // NOTE: Add any other needed setup-specific DLLs there.
3450 if (_stricmp(pdli->szDll, "setuplib.dll") == 0)
3451 {
3452 if (!setupDllPath)
3453 setupDllPath = GetLocalSetupDllPath();
3454 if (setupDllPath && *setupDllPath &&
3455 SUCCEEDED(StringCchPrintfA(dllPath, _countof(dllPath), "%S\\%s",
3456 setupDllPath, pdli->szDll)))
3457 {
3458 pdli->szDll = dllPath; /* Set szDll to the new path */
3459 }
3460 }
3461 break; /* Load the DLL using the modified path */
3462 }
3463
3464 case dliFailLoadLib:
3465 {
3466 /*
3467 * Library loading failed.
3468 * Raise a hard error instead of the default
3469 * exception, and "cleanly" kill the process.
3470 */
3471 ANSI_STRING DllPathA;
3473 ULONG_PTR Parameters[] = {(ULONG_PTR)&DllPathU};
3475
3476 RtlInitAnsiString(&DllPathA, pdli->szDll);
3477 RtlAnsiStringToUnicodeString(&DllPathU, &DllPathA, FALSE);
3480 0x1,
3481 Parameters,
3482 OptionOk,
3483 &Response);
3484 ExitProcess(-1);
3485 break;
3486 }
3487
3488 default:
3489 break;
3490 }
3491
3492 return NULL;
3493}
#define DECLARE_UNICODE_STRING_SIZE(_var, _size)
Definition: reactos.c:3423
static PCWSTR GetLocalSetupDllPath(VOID)
Definition: reactos.c:3381
#define _stricmp
Definition: cat.c:22
@ dliFailLoadLib
Definition: delayimp.h:37
@ dliNotePreLoadLibrary
Definition: delayimp.h:35
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1330
#define ULONG_PTR
Definition: config.h:101
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
Definition: harderr.c:551
#define HARDERROR_OVERRIDE_ERRORMODE
Definition: extypes.h:146
@ OptionOk
Definition: extypes.h:187
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define STATUS_DLL_NOT_FOUND
Definition: ntstatus.h:639
char CHAR
Definition: pedump.c:57
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520
LPCSTR szDll
Definition: delayimp.h:70
Definition: ncftp.h:89
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869

◆ SetWindowResPrintfVW()

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

Definition at line 302 of file reactos.c.

307{
308 WCHAR ResBuffer[256];
309 WCHAR szText[256];
310 PWSTR ResFmt = ResBuffer; // Use the static buffers by default.
311 PWSTR String = szText;
312
313 /* Try to load the string from the resource */
314 (void)LoadAllocStringW(hInstance, uID, &ResFmt, _countof(ResBuffer));
315 if (!ResFmt)
316 return;
317
318 /* Format the string and retrieve its length. If it is too long,
319 * an auxiliary buffer is allocated; otherwise the static buffer
320 * is used. The string is built to be NUL-terminated. */
321 (void)FormatAllocStringWV(&String, _countof(szText), ResFmt, args);
322 if (!String)
323 {
324 /* Allocation failed, use the original format string verbatim */
325 String = ResFmt;
326 }
327
329
330 /* Free the buffers if needed */
331 if ((String != szText) && (String != ResFmt))
333
334 if (ResFmt && (ResFmt != ResBuffer))
335 HeapFree(GetProcessHeap(), 0, ResFmt);
336}
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2439

Referenced by RegistryStatus(), and SetWindowResPrintfW().

◆ SetWindowResPrintfW()

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

Definition at line 340 of file reactos.c.

345{
347
348 va_start(args, uID);
350 va_end(args);
351}

Referenced by FileCopyCallback(), FsVolCallback(), and RegistryStatus().

◆ SetWindowResTextW()

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

Definition at line 283 of file reactos.c.

288{
289 WCHAR szText[256];
290 PWSTR String = szText; // Use the static buffer by default.
291
292 /* Try to load the string from the resource */
294 if (!String)
295 return;
297 if (String != szText)
299}

Referenced by FinishDlgProc(), PrepareAndDoCopyThread(), and SummaryDlgProc().

◆ StartDlgProc()

static INT_PTR CALLBACK StartDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static
  • Center the wizard window *‍/

Definition at line 354 of file reactos.c.

359{
360 PSETUPDATA pSetupData;
361
362 /* Retrieve pointer to the global setup data */
363 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
364
365 switch (uMsg)
366 {
367 case WM_INITDIALOG:
368 {
369 /* Save pointer to the global setup data */
370 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
371 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
372
373 /* Set title font */
374 SetDlgItemFont(hwndDlg, IDC_STARTTITLE, pSetupData->hTitleFont, TRUE);
375
376 // TEMPTEMP: Set the ReactOS-Alpha information in bold.
377 // TODO: Remove once we reach 0.5/Beta :)
378 SetDlgItemFont(hwndDlg, IDC_WARNTEXT1, pSetupData->hBoldFont, TRUE);
379 SetDlgItemFont(hwndDlg, IDC_WARNTEXT2, pSetupData->hBoldFont, TRUE);
380 SetDlgItemFont(hwndDlg, IDC_WARNTEXT3, pSetupData->hBoldFont, TRUE);
381
383 //CenterWindow(GetParent(hwndDlg));
384 return TRUE;
385 }
386
387 case WM_NOTIFY:
388 {
389 LPNMHDR lpnm = (LPNMHDR)lParam;
390
391 switch (lpnm->code)
392 {
393 case PSN_SETACTIVE:
394 {
395 /* Only "Next" and "Cancel" for the first page and hide "Back".
396 * Don't use the PropSheet_SetWizButtons() macro, because its
397 * posted message could interfere with the hidden button. */
399 // PropSheet_ShowWizButtons(GetParent(hwndDlg), 0, PSWIZB_BACK);
401 break;
402 }
403
404 case PSN_KILLACTIVE:
405 {
406 /* Show "Back" button */
407 // PropSheet_ShowWizButtons(GetParent(hwndDlg), PSWIZB_BACK, PSWIZB_BACK);
409 break;
410 }
411
412 default:
413 break;
414 }
415 break;
416 }
417
418 default:
419 break;
420 }
421
422 return FALSE;
423}
#define IDC_WARNTEXT2
Definition: resource.h:30
#define IDC_WARNTEXT1
Definition: resource.h:29
#define IDC_WARNTEXT3
Definition: resource.h:31
#define IDC_STARTTITLE
Definition: resource.h:28

◆ SummaryDlgProc()

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

Definition at line 1149 of file reactos.c.

1154{
1155 static WCHAR szOrgWizNextBtnText[260]; // TODO: Make it dynamic
1156
1157 PSETUPDATA pSetupData;
1158
1159 /* Retrieve pointer to the global setup data */
1160 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
1161
1162 switch (uMsg)
1163 {
1164 case WM_INITDIALOG:
1165 {
1166 /* Save pointer to the global setup data */
1167 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
1168 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
1169 break;
1170 }
1171
1172 case WM_COMMAND:
1173 {
1175 {
1176 // Ideally we could add the PSWIZBF_ELEVATIONREQUIRED style.
1179 else
1181 return TRUE;
1182 }
1183 break;
1184 }
1185
1186 case WM_NOTIFY:
1187 {
1188 LPNMHDR lpnm = (LPNMHDR)lParam;
1189
1190 switch (lpnm->code)
1191 {
1192 case PSN_SETACTIVE:
1193 {
1194 WCHAR CurrentItemText[256];
1195
1197
1198 /* Skip the Summary page in unattended setup */
1199 if (pSetupData->bUnattend)
1200 {
1201 SetWindowLongPtrW(hwndDlg, DWLP_MSGRESULT, -1);
1202 return TRUE;
1203 }
1204
1205 /* Show the current selected settings */
1206
1207 // FIXME! Localize
1208 if (pSetupData->RepairUpdateFlag)
1209 {
1210 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1211 L"Upgrading/Repairing \"%s\" from \"%s\"",
1213 pSetupData->CurrentInstallation->VendorName);
1214 }
1215 else
1216 {
1217 StringCchCopyW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1218 L"New ReactOS installation");
1219 }
1220 SetDlgItemTextW(hwndDlg, IDC_INSTALLTYPE, CurrentItemText);
1221
1222 SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a");
1223 SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a");
1224
1226 CurrentItemText,
1227 ARRAYSIZE(CurrentItemText));
1228 SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText);
1229
1231 CurrentItemText,
1232 ARRAYSIZE(CurrentItemText));
1233 SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText);
1234
1236 CurrentItemText,
1237 ARRAYSIZE(CurrentItemText));
1238 SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText);
1239
1240 if (InstallVolume->Info.DriveLetter)
1241 {
1242#if 0
1243 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1244 L"%c: \x2014 %wZ",
1245 InstallVolume->Info.DriveLetter,
1246 &pSetupData->USetupData.DestinationRootPath);
1247#else
1248 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1249 L"%c: \x2014 Harddisk %lu, Partition %lu",
1250 InstallVolume->Info.DriveLetter,
1251 InstallPartition->DiskEntry->DiskNumber,
1253#endif
1254 }
1255 else
1256 {
1257#if 0
1258 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1259 L"%wZ",
1260 &pSetupData->USetupData.DestinationRootPath);
1261#else
1262 StringCchPrintfW(CurrentItemText, ARRAYSIZE(CurrentItemText),
1263 L"Harddisk %lu, Partition %lu",
1264 InstallPartition->DiskEntry->DiskNumber,
1266#endif
1267 }
1268 SetDlgItemTextW(hwndDlg, IDC_DESTDRIVE, CurrentItemText);
1269
1270 SetDlgItemTextW(hwndDlg, IDC_PATH,
1272 /*pSetupData->USetupData.InstallPath.Buffer*/);
1273
1274
1275 /* Change the "Next" button text to "Install" */
1276 // PropSheet_SetNextText(GetParent(hwndDlg), ...);
1278 szOrgWizNextBtnText, ARRAYSIZE(szOrgWizNextBtnText));
1280 pSetupData->hInstance,
1282
1283 /* Keep the "Next" button disabled. It will be enabled only
1284 * when the user clicks on the installation approval checkbox. */
1287 break;
1288 }
1289
1291 {
1292 /* Focus on the confirmation check-box */
1294 return TRUE;
1295 }
1296
1297 case PSN_KILLACTIVE:
1298 {
1299 /* Restore the original "Next" button text */
1300 SetDlgItemTextW(GetParent(hwndDlg), ID_WIZNEXT, szOrgWizNextBtnText);
1301 break;
1302 }
1303
1304 case PSN_QUERYCANCEL:
1305 {
1306 if (DisplayMessage(GetParent(hwndDlg),
1310 {
1311 /* Go to the Abort page */
1313 }
1314
1315 /* Do not close the wizard too soon */
1317 return TRUE;
1318 }
1319
1320 case PSN_WIZBACK:
1321 {
1322 /* When the user performs a regular installation, go back to the previous page */
1323 if (!pSetupData->RepairUpdateFlag)
1324 break;
1325
1326 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
1327 {
1328 /* Return to the Upgrade/Repair selection page, when the user is
1329 * upgrading and there are more than one installation available */
1331 }
1332 else
1333 {
1334 /* Return to the Install type selection page, when the user is
1335 * upgrading and there is at most one installation available */
1337 }
1338 return TRUE;
1339 }
1340
1341 default:
1342 break;
1343 }
1344 break;
1345 }
1346
1347 default:
1348 break;
1349 }
1350
1351 return FALSE;
1352}
#define IDS_INSTALLBTN
Definition: resource.h:115
#define IDC_CONFIRM_INSTALL
Definition: resource.h:67
#define IDC_ARCHITECTURE
Definition: resource.h:61
#define IDC_PATH
Definition: resource.h:81
#define IDD_UPDATEREPAIRPAGE
Definition: resource.h:39
#define IDC_DESTDRIVE
Definition: resource.h:65
#define IDC_INSTALLTYPE
Definition: resource.h:59
#define IDC_INSTALLSOURCE
Definition: resource.h:60
ULONG NTAPI GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:149
PGENERIC_LIST_ENTRY NTAPI GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:102
#define PSN_QUERYINITIALFOCUS
Definition: prsht.h:126
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
ULONG OnDiskPartitionNumber
Definition: partlist.h:74
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:161
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:162
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:124
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:157
#define HIWORD(l)
Definition: typedefs.h:247
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2283
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define BST_UNCHECKED
Definition: winuser.h:199
#define WM_COMMAND
Definition: winuser.h:1768
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define BN_CLICKED
Definition: winuser.h:1954
#define BST_CHECKED
Definition: winuser.h:197

◆ TypeDlgProc()

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

Definition at line 426 of file reactos.c.

431{
432 PSETUPDATA pSetupData;
433
434 /* Retrieve pointer to the global setup data */
435 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
436
437 switch (uMsg)
438 {
439 case WM_INITDIALOG:
440 {
441 /* Save pointer to the global setup data */
442 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
443 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
444
445 /* Set the options in bold */
446 SetDlgItemFont(hwndDlg, IDC_INSTALL, pSetupData->hBoldFont, TRUE);
447 SetDlgItemFont(hwndDlg, IDC_UPDATE, pSetupData->hBoldFont, TRUE);
448
449 /*
450 * Enable double-click handling with the BS_NOTIFY style for both options.
451 * Idea adapted from: https://devblogs.microsoft.com/oldnewthing/20050804-10/?p=34713
452 */
453 {
454 HWND hRadio = GetDlgItem(hwndDlg, IDC_INSTALL);
456 hRadio = GetDlgItem(hwndDlg, IDC_UPDATE);
458 }
459
460 /*
461 * Enable the "Update" radio button and text only if we have
462 * available NT installations, otherwise disable them.
463 */
464 if (pSetupData->NtOsInstallsList &&
466 {
467 EnableDlgItem(hwndDlg, IDC_UPDATE, TRUE);
469 }
470 else
471 {
472 EnableDlgItem(hwndDlg, IDC_UPDATE, FALSE);
474 }
475
476 /* Check the "Install ReactOS" radio button and ensure it is initially focused */
479 return FALSE;
480 }
481
482 case WM_COMMAND:
483 {
484 /*
485 * Go to the next page if the user double-clicked one of the options.
486 * Idea adapted from: https://devblogs.microsoft.com/oldnewthing/20050804-10/?p=34713
487 */
488 if (HIWORD(wParam) == BN_DBLCLK) switch (LOWORD(wParam))
489 {
490 case IDC_INSTALL:
491 case IDC_UPDATE:
493 return TRUE;
494 }
495 break;
496 }
497
498 case WM_NOTIFY:
499 {
500 LPNMHDR lpnm = (LPNMHDR)lParam;
501
502 switch (lpnm->code)
503 {
504 case PSN_SETACTIVE:
505 {
506 /* Ensure the "Install ReactOS" radio button is checked if we don't have
507 * a selected installation (default case), which can also happen if the
508 * user clicked on the "Do not upgrade" button on the Upgrade/Repair
509 * selection page, then went back here. */
510 if (!pSetupData->CurrentInstallation)
512 else
514
516 break;
517 }
518
519 case PSN_QUERYCANCEL:
520 {
521 if (DisplayMessage(GetParent(hwndDlg),
525 {
526 /* Go to the Abort page */
528 }
529
530 /* Do not close the wizard too soon */
532 return TRUE;
533 }
534
535 case PSN_WIZNEXT: /* Set the selected data */
536 {
537 /*
538 * Go update only if we have available NT installations
539 * and we choose to do so.
540 */
541 if (pSetupData->NtOsInstallsList &&
542 GetNumberOfListEntries(pSetupData->NtOsInstallsList) != 0 &&
544 {
545 pSetupData->RepairUpdateFlag = TRUE;
546
547 /*
548 * Display the existing NT installations page only
549 * if we have more than one available NT installations.
550 */
551 if (GetNumberOfListEntries(pSetupData->NtOsInstallsList) > 1)
552 {
553 /* pSetupData->CurrentInstallation will be set from within IDD_UPDATEREPAIRPAGE */
554
555 /* Actually the best would be to dynamically insert the page only when needed */
557 }
558 else
559 {
560 /* Retrieve the current installation */
561 pSetupData->CurrentInstallation =
567
568 /* Jump to the Summary page during repair/upgrade */
570 }
571 }
572 else
573 {
574 pSetupData->CurrentInstallation = NULL;
575 pSetupData->RepairUpdateFlag = FALSE;
577 }
578
579 return TRUE;
580 }
581
582 default:
583 break;
584 }
585 break;
586 }
587
588 default:
589 break;
590 }
591
592 return FALSE;
593}
#define IDC_UPDATE
Definition: resource.h:36
#define IDC_UPDATETEXT
Definition: resource.h:37
#define IDD_SUMMARYPAGE
Definition: resource.h:58
#define IDD_DEVICEPAGE
Definition: resource.h:43
#define IDC_INSTALL
Definition: fontview.h:13
PPARTENTRY PartEntry
Definition: partlist.h:57
#define BN_DBLCLK
Definition: winuser.h:1955
#define BS_NOTIFY
Definition: winuser.h:268
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)

◆ UpgradeRepairDlgProc()

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

Definition at line 829 of file reactos.c.

834{
835 PSETUPDATA pSetupData;
836 HWND hList;
837 HIMAGELIST hSmall;
838
839 /* Retrieve pointer to the global setup data */
840 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
841
842 switch (uMsg)
843 {
844 case WM_INITDIALOG:
845 {
846 /* Save pointer to the global setup data */
847 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGEW)lParam)->lParam;
848 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
849
850 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
851
853
855 hList,
860
861 /* Create the ImageList */
864 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
865 1, 1);
866
867 /* Add event type icons to the ImageList */
870
871 /* Assign the ImageList to the List View */
873
875 break;
876 }
877
878 case WM_DESTROY:
879 {
880 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
883 ImageList_Destroy(hSmall);
884 return TRUE;
885 }
886
887 case WM_COMMAND:
888 {
890 {
891 /* Skip the upgrade and do the usual new-installation workflow */
892 pSetupData->CurrentInstallation = NULL;
893 pSetupData->RepairUpdateFlag = FALSE;
895 return TRUE;
896 }
897 break;
898 }
899
900 case WM_NOTIFY:
901 {
902 LPNMHDR lpnm = (LPNMHDR)lParam;
903
904 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == NM_DBLCLK)
905 {
906 /* Go to the next page if the user double-clicked on an installation */
908 if (pnmv->iItem != -1)
910 break;
911 }
912
913 if (lpnm->idFrom == IDC_NTOSLIST && lpnm->code == LVN_ITEMCHANGED)
914 {
916
917 /* Check whether the item has been (de)selected */
918 if (!(pnmv->uChanged & LVIF_STATE) ||
919 !((pnmv->uOldState ^ pnmv->uNewState) & LVIS_SELECTED))
920 {
921 break;
922 }
923
924 /* Enable or disable the "Next" button when the user
925 * selects or deselects an installation to upgrade */
926 if (pnmv->uNewState & LVIS_SELECTED)
928 else
930 break;
931 }
932
933 switch (lpnm->code)
934 {
935 case PSN_SETACTIVE:
936 {
937 /* Keep the "Next" button disabled. It will be enabled only
938 * when the user selects an installation to upgrade. */
940 break;
941 }
942
944 {
945 /* Reselect the currently selected item, so as to refresh the UI buttons */
946 INT Index;
947 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
949 if (Index != LB_ERR)
950 {
951 /* Deselect first the item before reselecting it, so as to
952 * invalidate its cached state and have the LVN_ITEMCHANGED
953 * notification sent. */
954 //ListView_EnsureVisible(hList, Index, FALSE);
959 }
960
961 /* Focus on the installations list */
963 return TRUE;
964 }
965
966 case PSN_QUERYCANCEL:
967 {
968 if (DisplayMessage(GetParent(hwndDlg),
972 {
973 /* Go to the Abort page */
975 }
976
977 /* Do not close the wizard too soon */
979 return TRUE;
980 }
981
982 case PSN_WIZNEXT: /* Set the selected data */
983 {
984 /*
985 * Go update only if we have available NT installations
986 * and we choose to do so.
987 */
988 if (!pSetupData->NtOsInstallsList ||
990 {
991 pSetupData->CurrentInstallation = NULL;
992 pSetupData->RepairUpdateFlag = FALSE;
993 break;
994 }
995
996 hList = GetDlgItem(hwndDlg, IDC_NTOSLIST);
999
1000 /* Retrieve the current installation */
1001 pSetupData->CurrentInstallation =
1006 pSetupData->CurrentInstallation->PathComponent);
1007
1008 /* We perform an upgrade */
1009 pSetupData->RepairUpdateFlag = TRUE;
1010 /* Jump to the Summary page during repair/upgrade */
1012 return TRUE;
1013 }
1014
1015 default:
1016 break;
1017 }
1018 break;
1019 }
1020
1021 default:
1022 break;
1023 }
1024
1025 return FALSE;
1026}
PVOID GetSelectedListViewItem(IN HWND hWndList)
Definition: reactos.c:733
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: reactos.c:825
#define MAX_LIST_COLUMNS
Definition: reactos.c:823
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: reactos.c:826
VOID InitGenericListView(IN HWND hWndList, IN PGENERIC_LIST List, IN PADD_ENTRY_ITEM AddEntryItemProc)
Definition: reactos.c:696
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:598
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:764
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: reactos.c:824
#define IDI_WINICON
Definition: resource.h:19
#define IDI_ROSICON
Definition: resource.h:18
#define IDC_SKIPUPGRADE
Definition: resource.h:41
#define IDC_NTOSLIST
Definition: resource.h:40
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define LVSIL_SMALL
Definition: commctrl.h:2304
#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw)
Definition: commctrl.h:2731
#define NM_DBLCLK
Definition: commctrl.h:131
#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:3266
UINT uNewState
Definition: commctrl.h:3041
UINT uOldState
Definition: commctrl.h:3042
#define SM_CYSMICON
Definition: winuser.h:1024
#define SM_CXSMICON
Definition: winuser.h:1023
int WINAPI GetSystemMetrics(_In_ int)

Variable Documentation

◆ __pfnDliFailureHook2

PfnDliHook __pfnDliFailureHook2 = setupDelayHook

Definition at line 3502 of file reactos.c.

◆ __pfnDliNotifyHook2

PfnDliHook __pfnDliNotifyHook2 = setupDelayHook

Custom delay-loading hooks for loading the Setup DLLs from a suitable path.

Definition at line 3501 of file reactos.c.

◆ column_alignment

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

Definition at line 826 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ column_ids

Definition at line 824 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ column_widths

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

Definition at line 825 of file reactos.c.

Referenced by UpgradeRepairDlgProc().

◆ dwFlags

Definition at line 3625 of file reactos.c.

◆ hWaitCursor

HCURSOR hWaitCursor

Definition at line 38 of file reactos.c.

Referenced by ProcessDlgProc(), and PrshtWndProc().

◆ IncludeForUnattended

BOOL IncludeForUnattended

Definition at line 3624 of file reactos.c.

◆ InstallPartition

◆ pfnDlgProc

DLGPROC pfnDlgProc

Definition at line 3629 of file reactos.c.

Referenced by SH_CreatePropertySheetPage(), and SH_CreatePropertySheetPageEx().

◆ ProcessHeap

HANDLE ProcessHeap
  • Internal Headers *‍/

Definition at line 23 of file reactos.c.

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

◆ pszHeaderSubTitle

PCWSTR pszHeaderSubTitle

Definition at line 3628 of file reactos.c.

Referenced by free_prop_sheet_pages(), and prop_sheet_pages_AtoW().

◆ pszHeaderTitle

PCWSTR pszHeaderTitle

Definition at line 3627 of file reactos.c.

Referenced by free_prop_sheet_pages(), and prop_sheet_pages_AtoW().

◆ pszTemplate

PCWSTR pszTemplate

Definition at line 3626 of file reactos.c.

Referenced by free_prop_sheet_pages(), and prop_sheet_pages_AtoW().

◆ SetupData

◆ SystemPartition

◆ UiContext

◆ 

const struct { ... } WizardPages[]

Referenced by _tWinMain().

◆ wpOrgPrshtProc

WNDPROC wpOrgPrshtProc = NULL

Definition at line 3521 of file reactos.c.

Referenced by PropSheetCallback(), and PrshtWndProc().