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