Hopefully fail to break anything in the process of syncing with trunk (r47786)
[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 #pragma once
28
29 /* C Headers */
30 #include <ctype.h>
31 #include <stdio.h>
32 #include <stddef.h>
33
34 /* PSDK/NDK */
35 #define WIN32_NO_STATUS
36 #include <windows.h>
37 #define NTOS_MODE_USER
38 #include <ndk/ntndk.h>
39 #include <fmifs/fmifs.h>
40
41 /* VFAT */
42 #include <fslib/vfatlib.h>
43
44 /* DDK Disk Headers */
45 #include <ntddscsi.h>
46
47 /* ReactOS Version */
48 #include <reactos/buildno.h>
49
50 /* Internal Headers */
51 #include "interface/consup.h"
52 #include "partlist.h"
53 #include "inffile.h"
54 #include "inicache.h"
55 #include "progress.h"
56 #ifdef __REACTOS__
57 #include "filequeue.h"
58 #endif
59 #include "bootsup.h"
60 #include "registry.h"
61 #include "fslist.h"
62 #include "chkdsk.h"
63 #include "format.h"
64 #include "cabinet.h"
65 #include "filesup.h"
66 #include "drivesup.h"
67 #include "genlist.h"
68 #include "settings.h"
69 #include "host.h"
70 #include "mui.h"
71 #include "errorcode.h"
72
73 extern HANDLE ProcessHeap;
74 extern UNICODE_STRING SourceRootPath;
75 extern UNICODE_STRING SourceRootDir;
76 extern UNICODE_STRING SourcePath;
77 extern BOOLEAN IsUnattendedSetup;
78 extern PWCHAR SelectedLanguageId;
79
80 typedef enum _PAGE_NUMBER
81 {
82 START_PAGE,
83 LANGUAGE_PAGE,
84 INTRO_PAGE,
85 LICENSE_PAGE,
86 INSTALL_INTRO_PAGE,
87
88 // SCSI_CONTROLLER_PAGE,
89
90 DEVICE_SETTINGS_PAGE,
91 COMPUTER_SETTINGS_PAGE,
92 DISPLAY_SETTINGS_PAGE,
93 KEYBOARD_SETTINGS_PAGE,
94 LAYOUT_SETTINGS_PAGE,
95
96 SELECT_PARTITION_PAGE,
97 CREATE_PARTITION_PAGE,
98 DELETE_PARTITION_PAGE,
99
100 SELECT_FILE_SYSTEM_PAGE,
101 FORMAT_PARTITION_PAGE,
102 CHECK_FILE_SYSTEM_PAGE,
103
104 PREPARE_COPY_PAGE,
105 INSTALL_DIRECTORY_PAGE,
106 FILE_COPY_PAGE,
107 REGISTRY_PAGE,
108 BOOT_LOADER_PAGE,
109 BOOT_LOADER_FLOPPY_PAGE,
110 BOOT_LOADER_HARDDISK_PAGE,
111
112 REPAIR_INTRO_PAGE,
113
114 SUCCESS_PAGE,
115 QUIT_PAGE,
116 FLUSH_PAGE,
117 REBOOT_PAGE, /* virtual page */
118 } PAGE_NUMBER, *PPAGE_NUMBER;
119
120 #define POPUP_WAIT_NONE 0
121 #define POPUP_WAIT_ANY_KEY 1
122 #define POPUP_WAIT_ENTER 2
123
124 #define LIST_FOR_EACH(elem, list, type, field) \
125 for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
126 &(elem)->field != (list) || (elem == NULL); \
127 (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
128
129 #define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
130 {\
131 PLIST_ENTRY current;\
132 \
133 current = (ListHead)->Flink;\
134 while (current != (ListHead))\
135 {\
136 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
137 (NewEntry)->SortField)\
138 {\
139 break;\
140 }\
141 current = current->Flink;\
142 }\
143 \
144 InsertTailList(current, &((NewEntry)->ListEntryField));\
145 }
146
147 /* EOF */