[SHELL-EXPERIMENTS]
[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 #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 #define NTOS_MODE_USER
43 #include <ndk/cmfuncs.h>
44 #include <ndk/exfuncs.h>
45 #include <ndk/iofuncs.h>
46 #include <ndk/kefuncs.h>
47 #include <ndk/mmfuncs.h>
48 #include <ndk/obfuncs.h>
49 #include <ndk/psfuncs.h>
50 #include <ndk/rtlfuncs.h>
51 #include <ndk/setypes.h>
52
53 /* Filesystem headers */
54 #include <fslib/ext2lib.h>
55 #include <fslib/vfatlib.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 "registry.h"
68 #include "fslist.h"
69 #include "cabinet.h"
70 #include "filesup.h"
71 #include "genlist.h"
72 #include "host.h"
73 #include "mui.h"
74 #include "errorcode.h"
75
76 extern HANDLE ProcessHeap;
77 extern UNICODE_STRING SourceRootPath;
78 extern UNICODE_STRING SourceRootDir;
79 extern UNICODE_STRING SourcePath;
80 extern BOOLEAN IsUnattendedSetup;
81 extern PWCHAR SelectedLanguageId;
82
83 #ifdef __REACTOS__
84
85 extern VOID InfSetHeap(PVOID Heap);
86 extern VOID InfCloseFile(HINF InfHandle);
87 extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn,
88 PINFCONTEXT ContextOut);
89 extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context,
90 ULONG FieldIndex,
91 PUCHAR ReturnBuffer,
92 ULONG ReturnBufferSize,
93 PULONG RequiredSize);
94 extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context,
95 ULONG FieldIndex,
96 PWSTR ReturnBuffer,
97 ULONG ReturnBufferSize,
98 PULONG RequiredSize);
99 extern BOOLEAN InfGetStringField(PINFCONTEXT Context,
100 ULONG FieldIndex,
101 PWSTR ReturnBuffer,
102 ULONG ReturnBufferSize,
103 PULONG RequiredSize);
104
105 #define SetupCloseInfFile InfCloseFile
106 #define SetupFindNextLine InfFindNextLine
107 #define SetupGetBinaryField InfGetBinaryField
108 #define SetupGetMultiSzFieldW InfGetMultiSzField
109 #define SetupGetStringFieldW InfGetStringField
110
111 #endif /* __REACTOS__ */
112
113 #ifndef _PAGE_NUMBER_DEFINED
114 #define _PAGE_NUMBER_DEFINED
115 typedef enum _PAGE_NUMBER
116 {
117 START_PAGE,
118 LANGUAGE_PAGE,
119 INTRO_PAGE,
120 LICENSE_PAGE,
121 INSTALL_INTRO_PAGE,
122
123 // SCSI_CONTROLLER_PAGE,
124
125 DEVICE_SETTINGS_PAGE,
126 COMPUTER_SETTINGS_PAGE,
127 DISPLAY_SETTINGS_PAGE,
128 KEYBOARD_SETTINGS_PAGE,
129 LAYOUT_SETTINGS_PAGE,
130
131 SELECT_PARTITION_PAGE,
132 CREATE_PRIMARY_PARTITION_PAGE,
133 CREATE_EXTENDED_PARTITION_PAGE,
134 CREATE_LOGICAL_PARTITION_PAGE,
135 DELETE_PARTITION_PAGE,
136
137 SELECT_FILE_SYSTEM_PAGE,
138 FORMAT_PARTITION_PAGE,
139 CHECK_FILE_SYSTEM_PAGE,
140
141 PREPARE_COPY_PAGE,
142 INSTALL_DIRECTORY_PAGE,
143 FILE_COPY_PAGE,
144 REGISTRY_PAGE,
145 BOOT_LOADER_PAGE,
146 BOOT_LOADER_FLOPPY_PAGE,
147 BOOT_LOADER_HARDDISK_MBR_PAGE,
148 BOOT_LOADER_HARDDISK_VBR_PAGE,
149
150 REPAIR_INTRO_PAGE,
151
152 SUCCESS_PAGE,
153 QUIT_PAGE,
154 FLUSH_PAGE,
155 REBOOT_PAGE, /* virtual page */
156 } PAGE_NUMBER, *PPAGE_NUMBER;
157 #endif
158
159 #define POPUP_WAIT_NONE 0
160 #define POPUP_WAIT_ANY_KEY 1
161 #define POPUP_WAIT_ENTER 2
162
163 #define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
164 {\
165 PLIST_ENTRY current;\
166 \
167 current = (ListHead)->Flink;\
168 while (current != (ListHead))\
169 {\
170 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
171 (NewEntry)->SortField)\
172 {\
173 break;\
174 }\
175 current = current->Flink;\
176 }\
177 \
178 InsertTailList(current, &((NewEntry)->ListEntryField));\
179 }
180
181 #endif /* _USETUP_PCH_ */