ReactOS 0.4.17-dev-573-g8315b8c
reactos.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS GUI first stage setup application
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Precompiled header
5 * COPYRIGHT: Copyright 2008-2010 Matthias Kupfer <mkupfer@reactos.org>
6 * Copyright 2008-2009 Dmitry Chapyshev <dmitry@reactos.org>
7 * Copyright 2018-2026 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
8 */
9
10#ifndef _REACTOS_PCH_
11#define _REACTOS_PCH_
12
13/* C Headers */
14#include <stdlib.h>
15#include <stdarg.h>
16#include <tchar.h>
17
18/* PSDK/NDK */
19#define WIN32_NO_STATUS
20#include <windef.h>
21#include <winbase.h>
22#include <winreg.h>
23#include <wingdi.h>
24#include <winuser.h>
25
26#include <strsafe.h>
27
28#include <commctrl.h>
29#include <windowsx.h>
30
31#define EnableDlgItem(hDlg, nID, bEnable) \
32 EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
33
34#define ShowDlgItem(hDlg, nID, nCmdShow) \
35 ShowWindow(GetDlgItem((hDlg), (nID)), (nCmdShow))
36
37#define SetDlgItemFont(hDlg, nID, hFont, bRedraw) \
38 SetWindowFont(GetDlgItem((hDlg), (nID)), (hFont), (bRedraw))
39
40// Property Sheet string IDs
41#define IDS_CLOSE 4160 // 0x1040
42/* These are public names and values determined from MFC, and compatible with Windows */
43// Property Sheet control IDs (determined with Spy++)
44#define IDC_TAB_CONTROL 0x3020
45#define ID_APPLY_NOW 0x3021
46#define ID_WIZBACK 0x3023
47#define ID_WIZNEXT 0x3024
48#define ID_WIZFINISH 0x3025
49
50
51#include "treelist.h"
52
53#include <setupapi.h>
54#include <devguid.h>
55
56#define NTOS_MODE_USER
57#include <ndk/cmtypes.h> // For CM_DISK stuff
58#include <ndk/iofuncs.h> // For NtCreate/OpenFile
59#include <ndk/rtlfuncs.h>
60
61
62/* Setup library headers */
63// #include <reactos/rosioctl.h>
64#include <../lib/setuplib.h>
65
66
67/* UI elements */
68typedef struct _UI_CONTEXT
69{
70 HWND hPartList; // Disks & partitions list
71 HWND hwndDlg; // Install progress page
72 HWND hWndItem; // Progress action
73 HWND hWndProgress; // Progress gauge
74 LONG_PTR dwPbStyle; // Progress gauge style
76
78
79
80/*
81 * A mapping entry that maps an NT path to a corresponding Win32 path.
82 *
83 * Example is:
84 * NT path: "\Device\Harddisk0\Partition1\some\path1"
85 * Win32 path: "C:\some\path1"
86 *
87 * Here, the NT path prefix to be cached is only
88 * "\Device\Harddisk0\Partition1\", to be mapped with "C:\".
89 *
90 * Then the same entry would be reused if one wants to convert
91 * the NT path "\Device\Harddisk0\Partition1\another\path2",
92 * which converts to the Win32 path "C:\another\path2" .
93 */
95{
97 WCHAR NtPath[MAX_PATH]; // MAX_PATH for both entries should be more than enough.
100
101/* The list of NT to Win32 path prefix mappings */
103{
107
108
109#if 0
110typedef struct _KBLAYOUT
111{
112 TCHAR LayoutId[9];
113 TCHAR LayoutName[128];
114 TCHAR DllName[128];
115} KBLAYOUT, *PKBLAYOUT;
116#endif
117
118#define InterlockedFlagsTestAndSet8(Target, Flags) \
119 !!(InterlockedOr8((PCHAR)(Target), (Flags)) & (Flags))
120
121#define InterlockedFlagsTestAndReset8(Target, Flags) \
122 !!(InterlockedAnd8((PCHAR)(Target), ~(Flags)) & (Flags))
123
124typedef struct _SETUPDATA
125{
126 /* General */
130
133
136 union
137 {
138 struct
139 {
140#define SETUP_ABORT_INSTALL 1
143#define SETUP_IS_CANCELLING 4
146#define SETUP_PAGE_SWITCHING 16
150 };
152 };
153
155
157
158 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
159
163
164
165 /* Settings */
166 LONG DestPartSize; // if partition doesn't exist, size of partition
167
168 /* txtsetup.sif data */
169 // LONG DefaultLang; // default language (table index)
170 // LONG DefaultKBLayout; // default keyboard layout (table index)
172 WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
173 WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
174
176
177extern HANDLE ProcessHeap;
178extern SETUPDATA SetupData;
179
182
186typedef struct _VOL_CREATE_INFO
187{
189
190 /* Volume-related parameters:
191 * Cached input information that will be set to
192 * the FORMAT_VOLUME_INFO structure given to the
193 * 'FSVOLNOTIFY_STARTFORMAT' step */
194 // PCWSTR FileSystemName;
201
202/* See drivepage.c */
205 _In_ HWND hTreeList,
207
208
209/*
210 * Attempts to convert a pure NT file path into a corresponding Win32 path.
211 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
212 */
213BOOL
216 OUT PWSTR pwszPath,
217 IN DWORD cchPathMax,
218 IN PCWSTR pwszNTPath);
219
220
221/* drivepage.c */
222
226 _In_ HWND hwndDlg,
227 _In_ UINT uMsg,
230
231
232/* reactos.c */
233
234BOOL
237 IN HWND hWndListView,
238 IN const UINT* pIDs,
239 IN const INT* pColsWidth,
240 IN const INT* pColsAlign,
241 IN UINT nNumOfColumns);
242
243size_t
246 _In_ UINT uID,
248 _In_opt_ size_t cchBufferLen /*,
249 _In_opt_ PCWSTR pDefaultString*/);
250
251size_t
254 _In_opt_ size_t cchBufferLen,
255 _In_ PCWSTR pszFormat,
257
258INT
261 _In_ UINT uType,
262 _In_opt_ PCWSTR pszTitle,
263 _In_opt_ PCWSTR pszFormatMessage,
265
266INT
270 _In_ UINT uType,
271 _In_opt_ PCWSTR pszTitle,
272 _In_opt_ PCWSTR pszFormatMessage,
273 ...);
274
275INT
279 _In_ UINT uIDTitle,
280 _In_ UINT uIDMessage,
281 ...);
282
283VOID
285 _In_ HWND hWnd,
287 _In_ UINT uID /*,
288 _In_opt_ PCWSTR pDefaultString*/);
289
290VOID
292 _In_ HWND hWnd,
294 _In_ UINT uID,
296
297VOID
300 _In_ HWND hWnd,
302 _In_ UINT uID,
303 ...);
304
305#endif /* _REACTOS_PCH_ */
306
307/* EOF */
unsigned char BOOLEAN
Definition: actypes.h:127
HWND hWnd
Definition: settings.c:17
struct _NT_WIN32_PATH_MAPPING_LIST NT_WIN32_PATH_MAPPING_LIST
VOID __cdecl SetWindowResPrintfW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID,...)
Definition: reactos.c:341
struct _NT_WIN32_PATH_MAPPING NT_WIN32_PATH_MAPPING
struct _VOL_CREATE_INFO VOL_CREATE_INFO
Data structure stored when a partition/volume needs to be formatted.
struct _NT_WIN32_PATH_MAPPING_LIST * PNT_WIN32_PATH_MAPPING_LIST
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:3013
HANDLE ProcessHeap
Definition: servman.c:15
UI_CONTEXT UiContext
Definition: reactos.c:38
PPARTENTRY InstallPartition
Definition: reactos.c:28
struct _UI_CONTEXT UI_CONTEXT
size_t LoadAllocStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen)
Definition: reactos.c:115
struct _SETUPDATA SETUPDATA
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:815
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1684
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:264
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:303
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:599
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:245
size_t FormatAllocStringWV(_In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen, _In_ PCWSTR pszFormat, _In_ va_list args)
Definition: reactos.c:150
PPARTENTRY SystemPartition
Definition: reactos.c:33
struct _VOL_CREATE_INFO * PVOL_CREATE_INFO
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:284
struct _NT_WIN32_PATH_MAPPING * PNT_WIN32_PATH_MAPPING
INT DisplayMessageV(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage, _In_ va_list args)
Definition: reactos.c:175
struct _SETUPDATA * PSETUPDATA
struct _UI_CONTEXT * PUI_CONTEXT
SETUPDATA SetupData
Definition: reactos.c:24
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:31
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define __cdecl
Definition: corecrt.h:121
char * va_list
Definition: vadefs.h:50
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FMIFS_MEDIA_FLAG
Definition: fmifs.h:53
FxString * pString
unsigned int UINT
Definition: sysinfo.c:13
char TCHAR
Definition: tchar.h:1402
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
UNICODE_STRING Volume
Definition: fltkernel.h:1172
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define _Outptr_
Definition: no_sal2.h:262
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
_In_ UINT uID
Definition: shlwapi.h:156
Definition: typedefs.h:120
WCHAR NtPath[MAX_PATH]
Definition: reactos.h:97
WCHAR Win32Path[MAX_PATH]
Definition: reactos.h:98
LIST_ENTRY ListEntry
Definition: reactos.h:96
BOOLEAN bStopInstall
Definition: reactos.h:151
USETUP_DATA USetupData
Definition: reactos.h:156
HINSTANCE hInstance
Definition: reactos.h:127
UCHAR bAbortInstall
Definition: reactos.h:141
HFONT hBoldFont
Definition: reactos.h:132
PCWSTR SelectedLanguageId
Definition: reactos.h:171
UCHAR bIsCancelling
Definition: reactos.h:144
HFONT hTitleFont
Definition: reactos.h:131
WCHAR DefaultKBLayout[20]
Definition: reactos.h:173
HANDLE hInstallThread
Definition: reactos.h:134
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:161
BOOL bMustReboot
Definition: reactos.h:129
PPARTLIST PartitionList
Definition: reactos.h:160
UCHAR bPageSwitching
Definition: reactos.h:147
UCHAR bReserved
Definition: reactos.h:149
LONG DestPartSize
Definition: reactos.h:166
HANDLE hHaltInstallEvent
Definition: reactos.h:135
WCHAR DefaultLanguage[20]
Definition: reactos.h:172
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:162
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:154
BOOLEAN RepairUpdateFlag
Definition: reactos.h:158
BOOL bUnattend
Definition: reactos.h:128
HWND hWndItem
Definition: reactos.h:72
HWND hPartList
Definition: reactos.h:70
HWND hWndProgress
Definition: reactos.h:73
LONG_PTR dwPbStyle
Definition: reactos.h:74
HWND hwndDlg
Definition: reactos.h:71
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
Definition: match.c:390
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char UCHAR
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40