ReactOS 0.4.17-dev-116-ga4b6fe9
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-2024 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
118typedef struct _SETUPDATA
119{
120 /* General */
124
127
131
133
135
136 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
137
141
142
143 /* Settings */
144 LONG DestPartSize; // if partition doesn't exist, size of partition
145
146 /* txtsetup.sif data */
147 // LONG DefaultLang; // default language (table index)
148 // LONG DefaultKBLayout; // default keyboard layout (table index)
150 WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
151 WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
152
154
155extern HANDLE ProcessHeap;
156extern SETUPDATA SetupData;
157
160
164typedef struct _VOL_CREATE_INFO
165{
167
168 /* Volume-related parameters:
169 * Cached input information that will be set to
170 * the FORMAT_VOLUME_INFO structure given to the
171 * 'FSVOLNOTIFY_STARTFORMAT' step */
172 // PCWSTR FileSystemName;
179
180/* See drivepage.c */
183 _In_ HWND hTreeList,
185
186
187/*
188 * Attempts to convert a pure NT file path into a corresponding Win32 path.
189 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
190 */
191BOOL
194 OUT PWSTR pwszPath,
195 IN DWORD cchPathMax,
196 IN PCWSTR pwszNTPath);
197
198
199/* drivepage.c */
200
204 _In_ HWND hwndDlg,
205 _In_ UINT uMsg,
208
209
210/* reactos.c */
211
212BOOL
215 IN HWND hWndListView,
216 IN const UINT* pIDs,
217 IN const INT* pColsWidth,
218 IN const INT* pColsAlign,
219 IN UINT nNumOfColumns);
220
221size_t
224 _In_ UINT uID,
226 _In_opt_ size_t cchBufferLen /*,
227 _In_opt_ PCWSTR pDefaultString*/);
228
229size_t
232 _In_opt_ size_t cchBufferLen,
233 _In_ PCWSTR pszFormat,
235
236INT
239 _In_ UINT uType,
240 _In_opt_ PCWSTR pszTitle,
241 _In_opt_ PCWSTR pszFormatMessage,
243
244INT
248 _In_ UINT uType,
249 _In_opt_ PCWSTR pszTitle,
250 _In_opt_ PCWSTR pszFormatMessage,
251 ...);
252
253INT
257 _In_ UINT uIDTitle,
258 _In_ UINT uIDMessage,
259 ...);
260
261VOID
263 _In_ HWND hWnd,
265 _In_ UINT uID /*,
266 _In_opt_ PCWSTR pDefaultString*/);
267
268VOID
270 _In_ HWND hWnd,
272 _In_ UINT uID,
274
275VOID
278 _In_ HWND hWnd,
280 _In_ UINT uID,
281 ...);
282
283#endif /* _REACTOS_PCH_ */
284
285/* 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:339
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:2748
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:113
struct _SETUPDATA SETUPDATA
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:835
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1595
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:262
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:301
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:559
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:243
size_t FormatAllocStringWV(_In_opt_ _Outptr_ PWSTR *pString, _In_opt_ size_t cchBufferLen, _In_ PCWSTR pszFormat, _In_ va_list args)
Definition: reactos.c:148
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:282
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:173
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
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
unsigned int UINT
Definition: ndis.h:50
#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
USETUP_DATA USetupData
Definition: reactos.h:134
HINSTANCE hInstance
Definition: reactos.h:121
HFONT hBoldFont
Definition: reactos.h:126
PCWSTR SelectedLanguageId
Definition: reactos.h:149
HFONT hTitleFont
Definition: reactos.h:125
BOOL bStopInstall
Definition: reactos.h:130
WCHAR DefaultKBLayout[20]
Definition: reactos.h:151
HANDLE hInstallThread
Definition: reactos.h:128
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:139
BOOL bMustReboot
Definition: reactos.h:123
PPARTLIST PartitionList
Definition: reactos.h:138
LONG DestPartSize
Definition: reactos.h:144
HANDLE hHaltInstallEvent
Definition: reactos.h:129
WCHAR DefaultLanguage[20]
Definition: reactos.h:150
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:140
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:132
BOOLEAN RepairUpdateFlag
Definition: reactos.h:136
BOOL bUnattend
Definition: reactos.h:122
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:165
ULONG ClusterSize
Definition: reactos.h:177
BOOLEAN QuickFormat
Definition: reactos.h:176
PVOLENTRY Volume
Definition: reactos.h:166
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:173
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:174
PCWSTR Label
Definition: reactos.h:175
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
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