ReactOS 0.4.16-dev-822-gbcedb53
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#define SetDlgItemFont(hDlg, nID, hFont, bRedraw) \
55 SetWindowFont(GetDlgItem((hDlg), (nID)), (hFont), (bRedraw))
56
57/* These are public names and values determined from MFC, and compatible with Windows */
58// Property Sheet control id's (determined with Spy++)
59#define IDC_TAB_CONTROL 0x3020
60#define ID_APPLY_NOW 0x3021
61#define ID_WIZBACK 0x3023
62#define ID_WIZNEXT 0x3024
63#define ID_WIZFINISH 0x3025
64
65
66#include "treelist.h"
67
68#include <setupapi.h>
69#include <devguid.h>
70
71#define NTOS_MODE_USER
72#include <ndk/cmtypes.h> // For CM_DISK stuff
73#include <ndk/iofuncs.h> // For NtCreate/OpenFile
74#include <ndk/rtlfuncs.h>
75
76
77/* Setup library headers */
78// #include <reactos/rosioctl.h>
79#include <../lib/setuplib.h>
80
81
82/* UI elements */
83typedef struct _UI_CONTEXT
84{
85 HWND hPartList; // Disks & partitions list
86 HWND hwndDlg; // Install progress page
87 HWND hWndItem; // Progress action
88 HWND hWndProgress; // Progress gauge
89 LONG_PTR dwPbStyle; // Progress gauge style
91
93
94
95/*
96 * A mapping entry that maps an NT path to a corresponding Win32 path.
97 *
98 * Example is:
99 * NT path: "\Device\Harddisk0\Partition1\some\path1"
100 * Win32 path: "C:\some\path1"
101 *
102 * Here, the NT path prefix to be cached is only
103 * "\Device\Harddisk0\Partition1\", to be mapped with "C:\".
104 *
105 * Then the same entry would be reused if one wants to convert
106 * the NT path "\Device\Harddisk0\Partition1\another\path2",
107 * which converts to the Win32 path "C:\another\path2" .
108 */
110{
112 WCHAR NtPath[MAX_PATH]; // MAX_PATH for both entries should be more than enough.
115
116/* The list of NT to Win32 path prefix mappings */
118{
122
123
124#if 0
125typedef struct _KBLAYOUT
126{
127 TCHAR LayoutId[9];
128 TCHAR LayoutName[128];
129 TCHAR DllName[128];
130} KBLAYOUT, *PKBLAYOUT;
131#endif
132
133typedef struct _SETUPDATA
134{
135 /* General */
138
141
145
147
149
150 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
151
155
156
157 /* Settings */
158 LONG DestPartSize; // if partition doesn't exist, size of partition
159
160 /* txtsetup.sif data */
161 // LONG DefaultLang; // default language (table index)
162 // LONG DefaultKBLayout; // default keyboard layout (table index)
164 WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
165 WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
166
168
169extern HANDLE ProcessHeap;
170extern SETUPDATA SetupData;
171
174
178typedef struct _VOL_CREATE_INFO
179{
181
182 /* Volume-related parameters:
183 * Cached input information that will be set to
184 * the FORMAT_VOLUME_INFO structure given to the
185 * 'FSVOLNOTIFY_STARTFORMAT' step */
186 // PCWSTR FileSystemName;
193
194/* See drivepage.c */
197 _In_ HWND hTreeList,
199
200
201/*
202 * Attempts to convert a pure NT file path into a corresponding Win32 path.
203 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
204 */
205BOOL
208 OUT PWSTR pwszPath,
209 IN DWORD cchPathMax,
210 IN PCWSTR pwszNTPath);
211
212
213/* drivepage.c */
214
218 _In_ HWND hwndDlg,
219 _In_ UINT uMsg,
222
223
224/* reactos.c */
225
226BOOL
229 IN HWND hWndListView,
230 IN const UINT* pIDs,
231 IN const INT* pColsWidth,
232 IN const INT* pColsAlign,
233 IN UINT nNumOfColumns);
234
235INT
238 _In_ UINT uType,
239 _In_opt_ PCWSTR pszTitle,
240 _In_opt_ PCWSTR pszFormatMessage,
242
243INT
247 _In_ UINT uType,
248 _In_opt_ PCWSTR pszTitle,
249 _In_opt_ PCWSTR pszFormatMessage,
250 ...);
251
252INT
256 _In_ UINT uIDTitle,
257 _In_ UINT uIDMessage,
258 ...);
259
260VOID
262 _In_ HWND hWnd,
264 _In_ UINT uID);
265
266VOID
268 _In_ HWND hWnd,
270 _In_ UINT uID,
272
273VOID
276 _In_ HWND hWnd,
278 _In_ UINT uID,
279 ...);
280
281#endif /* _REACTOS_PCH_ */
282
283/* 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:298
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:2505
HANDLE ProcessHeap
Definition: servman.c:15
UI_CONTEXT UiContext
Definition: reactos.c:55
PPARTENTRY InstallPartition
Definition: reactos.c:45
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:1612
INT __cdecl DisplayError(_In_opt_ HWND hWnd, _In_ UINT uIDTitle, _In_ UINT uIDMessage,...)
Definition: reactos.c:251
VOID SetWindowResPrintfVW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID, _In_ va_list args)
Definition: reactos.c:282
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:519
INT __cdecl DisplayMessage(_In_opt_ HWND hWnd, _In_ UINT uType, _In_opt_ PCWSTR pszTitle, _In_opt_ PCWSTR pszFormatMessage,...)
Definition: reactos.c:232
PPARTENTRY SystemPartition
Definition: reactos.c:50
struct _VOL_CREATE_INFO * PVOL_CREATE_INFO
VOID SetWindowResTextW(_In_ HWND hWnd, _In_opt_ HINSTANCE hInstance, _In_ UINT uID)
Definition: reactos.c:271
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:130
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:112
WCHAR Win32Path[MAX_PATH]
Definition: reactos.h:113
LIST_ENTRY ListEntry
Definition: reactos.h:111
USETUP_DATA USetupData
Definition: reactos.h:148
HINSTANCE hInstance
Definition: reactos.h:136
HFONT hBoldFont
Definition: reactos.h:140
PCWSTR SelectedLanguageId
Definition: reactos.h:163
HFONT hTitleFont
Definition: reactos.h:139
BOOL bStopInstall
Definition: reactos.h:144
WCHAR DefaultKBLayout[20]
Definition: reactos.h:165
HANDLE hInstallThread
Definition: reactos.h:142
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:153
PPARTLIST PartitionList
Definition: reactos.h:152
LONG DestPartSize
Definition: reactos.h:158
HANDLE hHaltInstallEvent
Definition: reactos.h:143
WCHAR DefaultLanguage[20]
Definition: reactos.h:164
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:154
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:146
BOOLEAN RepairUpdateFlag
Definition: reactos.h:150
BOOL bUnattend
Definition: reactos.h:137
HWND hWndItem
Definition: reactos.h:87
HWND hPartList
Definition: reactos.h:85
HWND hWndProgress
Definition: reactos.h:88
LONG_PTR dwPbStyle
Definition: reactos.h:89
HWND hwndDlg
Definition: reactos.h:86
Data structure stored when a partition/volume needs to be formatted.
Definition: reactos.h:179
ULONG ClusterSize
Definition: reactos.h:191
BOOLEAN QuickFormat
Definition: reactos.h:190
PVOLENTRY Volume
Definition: reactos.h:180
WCHAR FileSystemName[MAX_PATH+1]
Definition: reactos.h:187
FMIFS_MEDIA_FLAG MediaFlag
Definition: reactos.h:188
PCWSTR Label
Definition: reactos.h:189
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