ReactOS  0.4.11-dev-721-g95bc44e
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 /* These are public names and values determined from MFC, and compatible with Windows */
49 // Property Sheet control id's (determined with Spy++)
50 #define IDC_TAB_CONTROL 0x3020
51 #define ID_APPLY_NOW 0x3021
52 #define ID_WIZBACK 0x3023
53 #define ID_WIZNEXT 0x3024
54 #define ID_WIZFINISH 0x3025
55 
56 
57 #include "treelist.h"
58 
59 #include <setupapi.h>
60 #include <devguid.h>
61 
62 #define NTOS_MODE_USER
63 #include <ndk/cmtypes.h> // For CM_DISK stuff
64 #include <ndk/iofuncs.h> // For NtCreate/OpenFile
65 #include <ndk/rtlfuncs.h>
66 
67 
68 /* Setup library headers */
69 // #include <reactos/rosioctl.h>
70 #include <../lib/setuplib.h>
71 
72 #if 0
73 typedef struct _KBLAYOUT
74 {
75  TCHAR LayoutId[9];
76  TCHAR LayoutName[128];
77  TCHAR DllName[128];
78 } KBLAYOUT, *PKBLAYOUT;
79 #endif
80 
81 
82 /*
83  * A mapping entry that maps an NT path to a corresponding Win32 path.
84  *
85  * Example is:
86  * NT path: "\Device\Harddisk0\Partition1\some\path1"
87  * Win32 path: "C:\some\path1"
88  *
89  * Here, the NT path prefix to be cached is only
90  * "\Device\Harddisk0\Partition1\", to be mapped with "C:\".
91  *
92  * Then the same entry would be reused if one wants to convert
93  * the NT path "\Device\Harddisk0\Partition1\another\path2",
94  * which converts to the Win32 path "C:\another\path2" .
95  */
96 typedef struct _NT_WIN32_PATH_MAPPING
97 {
99  WCHAR NtPath[MAX_PATH]; // MAX_PATH for both entries should be more than enough.
102 
103 /* The list of NT to Win32 path prefix mappings */
105 {
109 
110 
111 typedef struct _SETUPDATA
112 {
113  /* General */
116 
118 
122 
125 
127 
129 
130  BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
131 
135 
136 
137  /* Settings */
138  LONG DestPartSize; // if partition doesn't exist, size of partition
139  LONG FSType; // file system type on partition
140  LONG FormatPart; // type of format the partition
141 
142  LONG SelectedLangId; // selected language (table index)
143 
144  /* txtsetup.sif data */
145  // LONG DefaultLang; // default language (table index)
146  // LONG DefaultKBLayout; // default keyboard layout (table index)
148  WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
149  WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
150 
152 
153 extern HANDLE ProcessHeap;
155 
156 extern SETUPDATA SetupData;
157 
158 
159 /*
160  * Attempts to convert a pure NT file path into a corresponding Win32 path.
161  * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
162  */
163 BOOL
165  IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList,
166  OUT PWSTR pwszPath,
167  IN DWORD cchPathMax,
168  IN PCWSTR pwszNTPath);
169 
170 
171 /* drivepage.c */
172 
173 BOOL
176  IN HWND hWndListView,
177  IN const UINT* pIDs,
178  IN const INT* pColsWidth,
179  IN const INT* pColsAlign,
180  IN UINT nNumOfColumns);
181 
182 INT_PTR
183 CALLBACK
185  HWND hwndDlg,
186  UINT uMsg,
187  WPARAM wParam,
188  LPARAM lParam);
189 
190 #endif /* _REACTOS_PCH_ */
191 
192 /* EOP */
HANDLE hInstallThread
Definition: reactos.h:119
#define IN
Definition: typedefs.h:38
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:296
struct _NT_WIN32_PATH_MAPPING * PNT_WIN32_PATH_MAPPING
__wchar_t WCHAR
Definition: xmlstorage.h:180
HANDLE ProcessHeap
Definition: servman.c:15
INT_PTR CALLBACK DriveDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drivepage.c:590
struct _NT_WIN32_PATH_MAPPING_LIST NT_WIN32_PATH_MAPPING_LIST
#define CALLBACK
Definition: compat.h:27
TCHAR szAbortMessage[512]
Definition: reactos.h:123
UINT uMsg
Definition: precomp.h:45
PVOID *typedef PWSTR
Definition: winlogon.h:66
HANDLE HWND
Definition: compat.h:13
LONG SelectedLangId
Definition: reactos.h:142
struct _NT_WIN32_PATH_MAPPING_LIST * PNT_WIN32_PATH_MAPPING_LIST
int32_t INT_PTR
Definition: typedefs.h:62
HANDLE hHaltInstallEvent
Definition: reactos.h:120
int32_t INT
Definition: typedefs.h:56
DWORD DWORD
Definition: winlogon.h:84
BOOLEAN RepairUpdateFlag
Definition: reactos.h:130
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1498
UINT_PTR WPARAM
Definition: windef.h:207
WCHAR DefaultKBLayout[20]
Definition: reactos.h:149
HINSTANCE hInstance
Definition: charmap.c:20
BOOL bUnattend
Definition: reactos.h:115
long LONG
Definition: pedump.c:60
WCHAR NtPath[MAX_PATH]
Definition: reactos.h:99
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR Win32Path[MAX_PATH]
Definition: reactos.h:100
BOOL bStopInstall
Definition: reactos.h:121
LONG FSType
Definition: reactos.h:139
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
char TCHAR
Definition: xmlstorage.h:189
unsigned char BOOLEAN
unsigned int BOOL
Definition: ntddk_ex.h:94
PGENERIC_LIST NtOsInstallsList
Definition: reactos.h:134
UINT WPARAM wParam
Definition: precomp.h:45
HINSTANCE hInstance
Definition: reactos.h:114
BOOLEAN IsUnattendedSetup
Definition: reactos.c:40
#define MAX_PATH
Definition: compat.h:26
PPARTLIST PartitionList
Definition: reactos.h:132
HANDLE HINSTANCE
Definition: typedefs.h:75
struct _NT_WIN32_PATH_MAPPING NT_WIN32_PATH_MAPPING
LIST_ENTRY ListEntry
Definition: reactos.h:98
TCHAR szAbortTitle[64]
Definition: reactos.h:124
Definition: typedefs.h:117
LONG FormatPart
Definition: reactos.h:140
SETUPDATA SetupData
Definition: reactos.c:41
DWORD *typedef HANDLE
Definition: winlogon.h:61
LONG DestPartSize
Definition: reactos.h:138
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
unsigned int UINT
Definition: ndis.h:50
USETUP_DATA USetupData
Definition: reactos.h:128
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define OUT
Definition: typedefs.h:39
PNTOS_INSTALLATION CurrentInstallation
Definition: reactos.h:133
unsigned int ULONG
Definition: retypes.h:1
WCHAR DefaultLanguage[20]
Definition: reactos.h:148
const uint16_t * PCWSTR
Definition: typedefs.h:55
HFONT hTitleFont
Definition: reactos.h:117
PCWSTR SelectedLanguageId
Definition: reactos.h:147
struct _SETUPDATA SETUPDATA
typedef struct _USETUP_DATA USETUP_DATA
struct _SETUPDATA * PSETUPDATA