[SETUP:REACTOS] Adapt the 1st-stage GUI setup to compile with the setuplib.
[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
74 // generic entries with simple 1:1 mapping
75 typedef struct _GENENTRY
76 {
77 TCHAR Id[24];
78 TCHAR Value[128];
79 } GENENTRY, *PGENENTRY;
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 BOOLEAN RepairUpdateFlag; // flag for update/repair an installed reactos
106
107
108 // txtsetup.sif data
109 LONG DefaultLang; // default language (table index)
110 PLANG pLanguages;
111 LONG LangCount;
112 LONG DefaultKBLayout; // default keyboard layout (table index)
113 PKBLAYOUT pKbLayouts;
114 LONG KbLayoutCount;
115 PGENENTRY pComputers;
116 LONG CompCount;
117 PGENENTRY pDisplays;
118 LONG DispCount;
119 PGENENTRY pKeyboards;
120 LONG KeybCount;
121 } SETUPDATA, *PSETUPDATA;
122
123 extern HANDLE ProcessHeap;
124 extern BOOLEAN IsUnattendedSetup;
125
126 typedef struct _IMGINFO
127 {
128 HBITMAP hBitmap;
129 INT cxSource;
130 INT cySource;
131 } IMGINFO, *PIMGINFO;
132
133
134
135 /*
136 * Attempts to convert a pure NT file path into a corresponding Win32 path.
137 * Adapted from GetInstallSourceWin32() in dll/win32/syssetup/wizard.c
138 */
139 BOOL
140 ConvertNtPathToWin32Path(
141 OUT PWSTR pwszPath,
142 IN DWORD cchPathMax,
143 IN PCWSTR pwszNTPath);
144
145
146 /* drivepage.c */
147 INT_PTR
148 CALLBACK
149 DriveDlgProc(
150 HWND hwndDlg,
151 UINT uMsg,
152 WPARAM wParam,
153 LPARAM lParam);
154
155 #endif /* _REACTOS_PCH_ */
156
157 /* EOP */