Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / base / setup / usetup / usetup.h
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 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 text-mode setup
22 * FILE: subsys/system/usetup/usetup.h
23 * PURPOSE: Text-mode setup
24 * PROGRAMMER: Eric Kohl
25 */
26
27 /* C Headers */
28 #include <stdio.h>
29 #include <stdlib.h>
30
31 /* PSDK/NDK */
32 #define WIN32_NO_STATUS
33 #include <windef.h>
34 #include <winbase.h>
35 #include <winreg.h>
36 #include <winuser.h>
37 #include <wincon.h>
38
39 #define NTOS_MODE_USER
40 #include <ndk/cmfuncs.h>
41 #include <ndk/exfuncs.h>
42 #include <ndk/iofuncs.h>
43 #include <ndk/kefuncs.h>
44 #include <ndk/mmtypes.h>
45 #include <ndk/mmfuncs.h>
46 #include <ndk/obfuncs.h>
47 #include <ndk/psfuncs.h>
48 #include <ndk/rtlfuncs.h>
49
50 /* Filesystem headers */
51 #include <fslib/ext2lib.h>
52 #include <fslib/vfatlib.h>
53
54 /* DDK Disk Headers */
55 #include <ntddscsi.h>
56
57 /* Internal Headers */
58 #include "interface/consup.h"
59 #include "partlist.h"
60 #include "inffile.h"
61 #include "inicache.h"
62 #include "progress.h"
63 #ifdef __REACTOS__
64 #include "infros.h"
65 #include "filequeue.h"
66 #endif
67 #include "bootsup.h"
68 #include "registry.h"
69 #include "fslist.h"
70 #include "chkdsk.h"
71 #include "format.h"
72 #include "cabinet.h"
73 #include "filesup.h"
74 #include "drivesup.h"
75 #include "genlist.h"
76 #include "settings.h"
77 #include "host.h"
78 #include "mui.h"
79 #include "errorcode.h"
80
81 #define INITGUID
82 #include <guiddef.h>
83 #include <libs/umpnpmgr/sysguid.h>
84
85 #include <zlib.h>
86
87 extern HANDLE ProcessHeap;
88 extern UNICODE_STRING SourceRootPath;
89 extern UNICODE_STRING SourceRootDir;
90 extern UNICODE_STRING SourcePath;
91 extern BOOLEAN IsUnattendedSetup;
92 extern PWCHAR SelectedLanguageId;
93
94 #ifdef __REACTOS__
95
96 extern VOID InfSetHeap(PVOID Heap);
97 extern VOID InfCloseFile(HINF InfHandle);
98 extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn,
99 PINFCONTEXT ContextOut);
100 extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context,
101 ULONG FieldIndex,
102 PUCHAR ReturnBuffer,
103 ULONG ReturnBufferSize,
104 PULONG RequiredSize);
105 extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context,
106 ULONG FieldIndex,
107 PWSTR ReturnBuffer,
108 ULONG ReturnBufferSize,
109 PULONG RequiredSize);
110 extern BOOLEAN InfGetStringField(PINFCONTEXT Context,
111 ULONG FieldIndex,
112 PWSTR ReturnBuffer,
113 ULONG ReturnBufferSize,
114 PULONG RequiredSize);
115
116 #define SetupCloseInfFile InfCloseFile
117 #define SetupFindNextLine InfFindNextLine
118 #define SetupGetBinaryField InfGetBinaryField
119 #define SetupGetMultiSzFieldW InfGetMultiSzField
120 #define SetupGetStringFieldW InfGetStringField
121
122 #endif /* __REACTOS__ */
123
124 #ifndef _PAGE_NUMBER_DEFINED
125 #define _PAGE_NUMBER_DEFINED
126 typedef enum _PAGE_NUMBER
127 {
128 START_PAGE,
129 LANGUAGE_PAGE,
130 INTRO_PAGE,
131 LICENSE_PAGE,
132 INSTALL_INTRO_PAGE,
133
134 // SCSI_CONTROLLER_PAGE,
135
136 DEVICE_SETTINGS_PAGE,
137 COMPUTER_SETTINGS_PAGE,
138 DISPLAY_SETTINGS_PAGE,
139 KEYBOARD_SETTINGS_PAGE,
140 LAYOUT_SETTINGS_PAGE,
141
142 SELECT_PARTITION_PAGE,
143 CREATE_PARTITION_PAGE,
144 DELETE_PARTITION_PAGE,
145
146 SELECT_FILE_SYSTEM_PAGE,
147 FORMAT_PARTITION_PAGE,
148 CHECK_FILE_SYSTEM_PAGE,
149
150 PREPARE_COPY_PAGE,
151 INSTALL_DIRECTORY_PAGE,
152 FILE_COPY_PAGE,
153 REGISTRY_PAGE,
154 BOOT_LOADER_PAGE,
155 BOOT_LOADER_FLOPPY_PAGE,
156 BOOT_LOADER_HARDDISK_MBR_PAGE,
157 BOOT_LOADER_HARDDISK_VBR_PAGE,
158
159 REPAIR_INTRO_PAGE,
160
161 SUCCESS_PAGE,
162 QUIT_PAGE,
163 FLUSH_PAGE,
164 REBOOT_PAGE, /* virtual page */
165 } PAGE_NUMBER, *PPAGE_NUMBER;
166 #endif
167
168 #define POPUP_WAIT_NONE 0
169 #define POPUP_WAIT_ANY_KEY 1
170 #define POPUP_WAIT_ENTER 2
171
172 #define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
173 {\
174 PLIST_ENTRY current;\
175 \
176 current = (ListHead)->Flink;\
177 while (current != (ListHead))\
178 {\
179 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
180 (NewEntry)->SortField)\
181 {\
182 break;\
183 }\
184 current = current->Flink;\
185 }\
186 \
187 InsertTailList(current, &((NewEntry)->ListEntryField));\
188 }
189
190 /* EOF */