a27eea12a4661e4ca2d596106e4d0cb4694a8759
[reactos.git] / base / setup / reactos / reactos.h
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 <commctrl.h>
44 /**/#include <setupapi.h>/**/
45 #include <devguid.h>
46 // #include <wine/unicode.h>
47
48 #define NTOS_MODE_USER
49 #include <ndk/cmtypes.h> // For CM_DISK stuff
50 #include <ndk/iofuncs.h> // For NtCreate/OpenFile
51 #include <ndk/rtlfuncs.h>
52
53
54 /* Setup library headers */
55 // #include <reactos/rosioctl.h>
56 #include <../lib/setuplib.h>
57 // #include "errorcode.h"
58
59
60 typedef struct _LANG
61 {
62 TCHAR LangId[9];
63 TCHAR LangName[128];
64 } LANG, *PLANG;
65
66 typedef struct _KBLAYOUT
67 {
68 TCHAR LayoutId[9];
69 TCHAR LayoutName[128];
70 TCHAR DllName[128];
71 } KBLAYOUT, *PKBLAYOUT;
72
73 // generic entries with simple 1:1 mapping
74 typedef struct _GENENTRY
75 {
76 TCHAR Id[24];
77 TCHAR Value[128];
78 } GENENTRY, *PGENENTRY;
79
80
81 typedef struct _SETUPDATA
82 {
83 /* General */
84 HINSTANCE hInstance;
85 BOOL bUnattend;
86
87 HFONT hTitleFont;
88
89 TCHAR szAbortMessage[512];
90 TCHAR szAbortTitle[64];
91
92 USETUP_DATA USetupData;
93 HINF SetupInf;
94
95 // Settings
96 LONG DestPartSize; // if partition doesn't exist, size of partition
97 LONG FSType; // file system type on partition
98 LONG FormatPart; // type of format the partition
99
100 LONG SelectedLangId; // selected language (table index)
101 LONG SelectedKBLayout; // selected keyboard layout (table index)
102 LONG SelectedComputer; // selected computer type (table index)
103 LONG SelectedDisplay; // selected display type (table index)
104 LONG SelectedKeyboard; // selected keyboard type (table index)
105
106 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
107
108
109 // txtsetup.sif data
110 #if 1
111 LONG DefaultLang; // default language (table index)
112 PLANG pLanguages;
113 LONG LangCount;
114 LONG DefaultKBLayout; // default keyboard layout (table index)
115 PKBLAYOUT pKbLayouts;
116 LONG KbLayoutCount;
117 PGENENTRY pComputers;
118 LONG CompCount;
119 PGENENTRY pDisplays;
120 LONG DispCount;
121 PGENENTRY pKeyboards;
122 LONG KeybCount;
123
124 #else
125
126 // LONG DefaultLang; // default language (table index)
127 // LONG DefaultKBLayout; // default keyboard layout (table index)
128 PWCHAR SelectedLanguageId;
129 WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
130 WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
131
132 PGENERIC_LIST ComputerList;
133 PGENERIC_LIST DisplayList;
134 PGENERIC_LIST KeyboardList;
135 PGENERIC_LIST LayoutList;
136 PGENERIC_LIST LanguageList;
137
138 PPARTLIST PartitionList;
139 PNTOS_INSTALLATION CurrentInstallation;
140 PGENERIC_LIST NtOsInstallsList;
141 #endif
142
143 } SETUPDATA, *PSETUPDATA;
144
145 extern HANDLE ProcessHeap;
146 extern BOOLEAN IsUnattendedSetup;
147
148
149 typedef struct _IMGINFO
150 {
151 HBITMAP hBitmap;
152 INT cxSource;
153 INT cySource;
154 } IMGINFO, *PIMGINFO;
155
156
157 /*
158 * Attempts to convert a pure NT file path into a corresponding Win32 path.
159 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
160 */
161 BOOL
162 ConvertNtPathToWin32Path(
163 OUT PWSTR pwszPath,
164 IN DWORD cchPathMax,
165 IN PCWSTR pwszNTPath);
166
167
168 /* drivepage.c */
169
170 BOOL
171 CreateListViewColumns(
172 IN HINSTANCE hInstance,
173 IN HWND hWndListView,
174 IN const UINT* pIDs,
175 IN const INT* pColsWidth,
176 IN const INT* pColsAlign,
177 IN UINT nNumOfColumns);
178
179 INT_PTR
180 CALLBACK
181 DriveDlgProc(
182 HWND hwndDlg,
183 UINT uMsg,
184 WPARAM wParam,
185 LPARAM lParam);
186
187 #endif /* _REACTOS_PCH_ */
188
189 /* EOP */