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