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