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