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