ReactOS 0.4.16-dev-319-g6cf4263
reactos.h
Go to the documentation of this file.
1/*
2 * ReactOS applications
3 * Copyright (C) 2004-2008 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19/*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS GUI first stage setup application
22 * FILE: base/setup/reactos/reactos.c
23 * PROGRAMMERS: Matthias Kupfer
24 * Dmitry Chapyshev (dmitry@reactos.org)
25 */
26
27#ifndef _REACTOS_PCH_
28#define _REACTOS_PCH_
29
30/* C Headers */
31#include <stdlib.h>
32#include <stdarg.h>
33#include <tchar.h>
34
35/* PSDK/NDK */
36#define WIN32_NO_STATUS
37#include <windef.h>
38#include <winbase.h>
39#include <winreg.h>
40#include <wingdi.h>
41#include <winuser.h>
42
43#include <strsafe.h>
44
45#include <commctrl.h>
46#include <windowsx.h>
47
48#define EnableDlgItem(hDlg, nID, bEnable) \
49 EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
50
51#define ShowDlgItem(hDlg, nID, nCmdShow) \
52 ShowWindow(GetDlgItem((hDlg), (nID)), (nCmdShow))
53
54/* These are public names and values determined from MFC, and compatible with Windows */
55// Property Sheet control id's (determined with Spy++)
56#define IDC_TAB_CONTROL 0x3020
57#define ID_APPLY_NOW 0x3021
58#define ID_WIZBACK 0x3023
59#define ID_WIZNEXT 0x3024
60#define ID_WIZFINISH 0x3025
61
62
63#include "treelist.h"
64
65#include <setupapi.h>
66#include <devguid.h>
67
68#define NTOS_MODE_USER
69#include <ndk/cmtypes.h> // For CM_DISK stuff
70#include <ndk/iofuncs.h> // For NtCreate/OpenFile
71#include <ndk/rtlfuncs.h>
72
73
74/* Setup library headers */
75// #include <reactos/rosioctl.h>
76#include <../lib/setuplib.h>
77
78
79/* UI elements */
80typedef struct _UI_CONTEXT
81{
82 HWND hPartList; // Disks & partitions list
83 HWND hwndDlg; // Install progress page
84 HWND hWndItem; // Progress action
85 HWND hWndProgress; // Progress gauge
86 LONG_PTR dwPbStyle; // Progress gauge style
88
90
91
92/*
93 * A mapping entry that maps an NT path to a corresponding Win32 path.
94 *
95 * Example is:
96 * NT path: "\Device\Harddisk0\Partition1\some\path1"
97 * Win32 path: "C:\some\path1"
98 *
99 * Here, the NT path prefix to be cached is only
100 * "\Device\Harddisk0\Partition1\", to be mapped with "C:\".
101 *
102 * Then the same entry would be reused if one wants to convert
103 * the NT path "\Device\Harddisk0\Partition1\another\path2",
104 * which converts to the Win32 path "C:\another\path2" .
105 */
107{
109 WCHAR NtPath[MAX_PATH]; // MAX_PATH for both entries should be more than enough.
112
113/* The list of NT to Win32 path prefix mappings */
115{
119
120
121#if 0
122typedef struct _KBLAYOUT
123{
124 TCHAR LayoutId[9];
125 TCHAR LayoutName[128];
126 TCHAR DllName[128];
127} KBLAYOUT, *PKBLAYOUT;
128#endif
129
130typedef struct _SETUPDATA
131{
132 /* General */
135
137
141
143
145
146 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
147
151
152
153 /* Settings */
154 LONG DestPartSize; // if partition doesn't exist, size of partition
155
156 /* txtsetup.sif data */
157 // LONG DefaultLang; // default language (table index)
158 // LONG DefaultKBLayout; // default keyboard layout (table index)
160 WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
161 WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
162
164
165extern HANDLE ProcessHeap;
166extern SETUPDATA SetupData;
167
170
174typedef struct _VOL_CREATE_INFO
175{
177
178 /* Volume-related parameters:
179 * Cached input information that will be set to
180 * the FORMAT_VOLUME_INFO structure given to the
181 * 'FSVOLNOTIFY_STARTFORMAT' step */
182 // PCWSTR FileSystemName;
189
190/* See drivepage.c */
193 _In_ HWND hTreeList,
195
196
197/*
198 * Attempts to convert a pure NT file path into a corresponding Win32 path.
199 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
200 */
201BOOL
204 OUT PWSTR pwszPath,
205 IN DWORD cchPathMax,
206 IN PCWSTR pwszNTPath);
207
208
209/* drivepage.c */
210
214 _In_ HWND hwndDlg,
215 _In_ UINT uMsg,
218
219
220/* reactos.c */
221
222BOOL
225 IN HWND hWndListView,
226 IN const UINT* pIDs,
227 IN const INT* pColsWidth,
228 IN const INT* pColsAlign,
229 IN UINT nNumOfColumns);
230
231INT
234 _In_ UINT uType,
235 _In_opt_ PCWSTR pszTitle,
236 _In_opt_ PCWSTR pszFormatMessage,
238
239INT
243 _In_ UINT uType,
244 _In_opt_ PCWSTR pszTitle,
245 _In_opt_ PCWSTR pszFormatMessage,
246 ...);
247
248INT
252 _In_ UINT uIDTitle,
253 _In_ UINT uIDMessage,
254 ...);
255
256VOID
258 _In_ HWND hWnd,
260 _In_ UINT uID);
261
262VOID
264 _In_ HWND hWnd,
266 _In_ UINT uID,
268
269VOID
272 _In_ HWND hWnd,
274 _In_ UINT uID,
275 ...);
276
277#endif /* _REACTOS_PCH_ */
278
279/* EOF */
unsigned char BOOLEAN
#define __cdecl
Definition: accygwin.h:79
char * va_list
Definition: acmsvcex.h:78
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:276
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:2468
HANDLE ProcessHeap
Definition: servman.c:15
UI_CONTEXT UiContext
Definition: reactos.c:54
PPARTENTRY InstallPartition
Definition: reactos.c:44
struct _UI_CONTEXT UI_CONTEXT
struct _SETUPDATA SETUPDATA
PVOL_CREATE_INFO FindVolCreateInTreeByVolume(_In_ HWND hTreeList, _In_ PVOLENTRY Volume)
Definition: drivepage.c:852
INT_PTR CALLBACK DriveDlgProc(_In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: drivepage.c:1634
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:229
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:260
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:478
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:210
PPARTENTRY SystemPartition
Definition: reactos.c:49
struct _VOL_CREATE_INFO * PVOL_CREATE_INFO
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:249
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:108
struct _SETUPDATA * PSETUPDATA
struct _UI_CONTEXT * PUI_CONTEXT
SETUPDATA SetupData
Definition: reactos.c:41
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
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FMIFS_MEDIA_FLAG
Definition: fmifs.h:52
UNICODE_STRING Volume
Definition: fltkernel.h:1172
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
long LONG
Definition: pedump.c:60
Definition: typedefs.h:120
WCHAR NtPath[MAX_PATH]
Definition: reactos.h:109
WCHAR Win32Path[MAX_PATH]
Definition: reactos.h:110
LIST_ENTRY ListEntry
Definition: reactos.h:108
USETUP_DATA USetupData
Definition: reactos.h:144
HINSTANCE hInstance
Definition: reactos.h:133
PCWSTR SelectedLanguageId
Definition: reactos.h:159
HFONT hTitleFont
Definition: reactos.h:136
BOOL bStopInstall
Definition: reactos.h:140
WCHAR DefaultKBLayout[20]
Definition: reactos.h:161
HANDLE hInstallThread
Definition: reactos.h:138
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:149
PPARTLIST PartitionList
Definition: reactos.h:148
LONG DestPartSize
Definition: reactos.h:154
HANDLE hHaltInstallEvent
Definition: reactos.h:139
WCHAR DefaultLanguage[20]
Definition: reactos.h:160
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:150
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:142
BOOLEAN RepairUpdateFlag
Definition: reactos.h:146
BOOL bUnattend
Definition: reactos.h:134
HWND hWndItem
Definition: reactos.h:84
HWND hPartList
Definition: reactos.h:82
HWND hWndProgress
Definition: reactos.h:85
LONG_PTR dwPbStyle
Definition: reactos.h:86
HWND hwndDlg
Definition: reactos.h:83
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:175
ULONG ClusterSize
Definition: reactos.h:187
BOOLEAN QuickFormat
Definition: reactos.h:186
PVOLENTRY Volume
Definition: reactos.h:176
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:183
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:184
PCWSTR Label
Definition: reactos.h:185
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
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
char TCHAR
Definition: xmlstorage.h:189
__wchar_t WCHAR
Definition: xmlstorage.h:180