ReactOS 0.4.16-dev-297-gc569aee
setuplib.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Setup Library
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Public header
5 * COPYRIGHT: Copyright 2017-2018 Hermes Belusca-Maito
6 */
7
8#pragma once
9
10/* INCLUDES *****************************************************************/
11
12/* Needed PSDK headers when using this library */
13#if 0
14
15#define WIN32_NO_STATUS
16#define _INC_WINDOWS
17#define COM_NO_WINDOWS_H
18
19#include <winxxx.h>
20
21#endif
22
23/* NOTE: Please keep the header inclusion order! */
24
25extern HANDLE ProcessHeap;
26
27#include "errorcode.h"
28#include "spapisup/fileqsup.h"
29#include "spapisup/infsupp.h"
30#include "utils/linklist.h"
31#include "utils/ntverrsrc.h"
32// #include "utils/arcname.h"
33#include "utils/bldrsup.h"
34#include "utils/filesup.h"
35#include "utils/fsrec.h"
36#include "utils/genlist.h"
37#include "utils/inicache.h"
38#include "utils/partinfo.h"
39#include "utils/partlist.h"
40#include "utils/arcname.h"
41#include "utils/osdetect.h"
42#include "utils/regutil.h"
43
45{
46 ARCH_PcAT, //< Standard BIOS-based PC-AT
47 ARCH_NEC98x86, //< NEC PC-98
48 ARCH_Xbox, //< Original Xbox
49 ARCH_Arc, //< ARC-based (MIPS, SGI)
50 ARCH_Efi, //< EFI and UEFI
51// Place other architectures supported by the Setup below.
53
54#include "bootcode.h"
55#include "fsutil.h"
56#include "bootsup.h"
57#include "registry.h"
58#include "mui.h"
59#include "settings.h"
60
61// #include "install.h" // See at the end...
62
63
64/* DEFINES ******************************************************************/
65
66#define KB ((ULONGLONG)1024)
67#define MB (KB*KB)
68#define GB (KB*KB*KB)
69// #define TB (KB*KB*KB*KB)
70// #define PB (KB*KB*KB*KB*KB)
71
72
73/* TYPEDEFS *****************************************************************/
74
75struct _USETUP_DATA;
76
77typedef VOID
79
80typedef struct _USETUP_DATA
81{
82/* Error handling *****/
85
86/* Setup INFs *****/
88
89/* Installation *****/
90 PVOID SetupFileQueue; // HSPFILEQ
91
92/* SOURCE Paths *****/
96
97/* DESTINATION Paths *****/
98 /*
99 * Path to the system partition, where the boot manager resides.
100 * On x86 PCs, this is usually the active partition.
101 * On ARC, (u)EFI, ... platforms, this is a dedicated partition.
102 *
103 * For more information, see:
104 * https://en.wikipedia.org/wiki/System_partition_and_boot_partition
105 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/boot-and-system-volumes.html
106 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/arc-boot-process.html
107 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/efi-boot-process.html
108 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-system-volume.html
109 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-boot-volume.html
110 */
112
113 /* Path to the installation directory inside the ReactOS boot partition */
117
118 // FIXME: This is only temporary!! Must be removed later!
120
123
128
129/* Settings lists *****/
135
136/* Settings *****/
137 ARCHITECTURE_TYPE ArchType; //< Target architecture (MachineType)
140 // PCWSTR KeyboardDriver;
141 // PCWSTR MouseDriver;
142 PCWSTR LayoutId; // DefaultKBLayout
143
144/* Other stuff *****/
147
151
152
153#include "install.h"
154
155
156// HACK!!
158
159
160/* FUNCTIONS ****************************************************************/
161
162#include "substset.h"
163
164VOID
166 IN OUT PUSETUP_DATA pSetupData);
167
168VOID
170 IN OUT PUSETUP_DATA pSetupData);
171
174 _Out_ PUNICODE_STRING SourcePath,
175 _Out_ PUNICODE_STRING SourceRootPath,
176 _Out_ PUNICODE_STRING SourceRootDir);
177
180 IN OUT PUSETUP_DATA pSetupData);
181
182#define ERROR_SYSTEM_PARTITION_NOT_FOUND (ERROR_LAST_ERROR_CODE + 1)
183
186 _In_ PPARTLIST PartitionList, /* HACK HACK! */
187 _In_ PPARTENTRY InstallPartition, /* HACK HACK! */
188 _Out_ PPARTENTRY* pSystemPartition, /* HACK HACK! */
191
199#define IS_VALID_INSTALL_PATH_CHAR(c) \
200 (isalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_')
201
204 _In_ PCWSTR InstallDir);
205
208 _Inout_ PUSETUP_DATA pSetupData,
209 _In_ PCWSTR InstallationDir,
211
212// NTSTATUS
215 IN OUT PUSETUP_DATA pSetupData,
216 IN ULONG InitPhase);
217
218VOID
220 IN OUT PUSETUP_DATA pSetupData);
221
222
224{
234
235typedef VOID
237
240 IN OUT PUSETUP_DATA pSetupData,
241 IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
242 IN PPARTLIST PartitionList, /* HACK HACK! */
243 IN WCHAR DestinationDriveLetter, /* HACK HACK! */
244 IN PCWSTR SelectedLanguageId, /* HACK HACK! */
246 IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL);
247
248/* EOF */
unsigned char BOOLEAN
#define __cdecl
Definition: accygwin.h:79
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
static FSVOL_OP CALLBACK FsVolCallback(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: reactos.c:1252
PPARTENTRY InstallPartition
Definition: reactos.c:45
#define MAX_PATH
Definition: compat.h:34
enum _ERROR_NUMBER ERROR_NUMBER
USHORT LANGID
Definition: mui.h:9
UNICODE_STRING Volume
Definition: fltkernel.h:1172
static const char const char const char PIMAGEHLP_STATUS_ROUTINE StatusRoutine
Definition: image.c:35
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
long LONG
Definition: pedump.c:60
FSVOL_OP(CALLBACK * PFSVOL_CALLBACK)(_In_opt_ PVOID Context, _In_ FSVOLNOTIFY FormatStatus, _In_ ULONG_PTR Param1, _In_ ULONG_PTR Param2)
Definition: fsutil.h:196
NTSTATUS InitDestinationPaths(_Inout_ PUSETUP_DATA pSetupData, _In_ PCWSTR InstallationDir, _In_ PVOLENTRY Volume)
Definition: setuplib.c:855
BOOLEAN InitSystemPartition(_In_ PPARTLIST PartitionList, _In_ PPARTENTRY InstallPartition, _Out_ PPARTENTRY *pSystemPartition, _In_opt_ PFSVOL_CALLBACK FsVolCallback, _In_opt_ PVOID Context)
Find or set the active system partition.
Definition: setuplib.c:672
_ARCHITECTURE_TYPE
Definition: setuplib.h:45
@ ARCH_Arc
Definition: setuplib.h:49
@ ARCH_NEC98x86
Definition: setuplib.h:47
@ ARCH_PcAT
Definition: setuplib.h:46
@ ARCH_Xbox
Definition: setuplib.h:48
@ ARCH_Efi
Definition: setuplib.h:50
ERROR_NUMBER LoadSetupInf(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:557
VOID FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:1096
BOOLEAN IsValidInstallDirectory(_In_ PCWSTR InstallDir)
Verify whether the given directory is suitable for ReactOS installation. Each path component must be ...
Definition: setuplib.c:771
VOID CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:28
HANDLE ProcessHeap
Definition: servman.c:15
_REGISTRY_STATUS
Definition: setuplib.h:224
@ KeybLayouts
Definition: setuplib.h:230
@ DisplaySettingsUpdate
Definition: setuplib.h:228
@ CodePageInfoUpdate
Definition: setuplib.h:232
@ LocaleSettingsUpdate
Definition: setuplib.h:229
@ RegHiveUpdate
Definition: setuplib.h:226
@ ImportRegHive
Definition: setuplib.h:227
@ KeybSettingsUpdate
Definition: setuplib.h:231
@ Success
Definition: setuplib.h:225
enum _ARCHITECTURE_TYPE ARCHITECTURE_TYPE
VOID(__cdecl * PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS,...)
Definition: setuplib.h:236
ERROR_NUMBER UpdateRegistry(IN OUT PUSETUP_DATA pSetupData, IN BOOLEAN RepairUpdateFlag, IN PPARTLIST PartitionList, IN WCHAR DestinationDriveLetter, IN PCWSTR SelectedLanguageId, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL)
Definition: setuplib.c:1146
enum _REGISTRY_STATUS REGISTRY_STATUS
struct _USETUP_DATA * PUSETUP_DATA
VOID InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:202
NTSTATUS GetSourcePaths(_Out_ PUNICODE_STRING SourcePath, _Out_ PUNICODE_STRING SourceRootPath, _Out_ PUNICODE_STRING SourceRootDir)
Determine the installation source path and isolate its useful path components (root path and source s...
Definition: setuplib.c:402
BOOLEAN IsUnattendedSetup
Definition: reactos.c:41
struct _USETUP_DATA USETUP_DATA
VOID(__cdecl * PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA *,...)
Definition: setuplib.h:78
ERROR_NUMBER InitializeSetup(IN OUT PUSETUP_DATA pSetupData, IN ULONG InitPhase)
Definition: setuplib.c:1010
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PGENERIC_LIST DisplayList
Definition: setuplib.h:131
LONG DestinationPartitionNumber
Definition: setuplib.h:122
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:116
PGENERIC_LIST LanguageList
Definition: setuplib.h:134
UNICODE_STRING SourcePath
Definition: setuplib.h:95
PGENERIC_LIST LayoutList
Definition: setuplib.h:133
PVOID SetupFileQueue
Definition: setuplib.h:90
PGENERIC_LIST ComputerList
Definition: setuplib.h:130
UNICODE_STRING SourceRootDir
Definition: setuplib.h:94
PSETUP_ERROR_ROUTINE ErrorRoutine
Definition: setuplib.h:84
HINF SetupInf
Definition: setuplib.h:87
UNICODE_STRING SystemRootPath
Definition: setuplib.h:111
LONG FsType
Definition: setuplib.h:127
LONG AutoPartition
Definition: setuplib.h:126
UNICODE_STRING SourceRootPath
Definition: setuplib.h:93
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:149
UNICODE_STRING InstallPath
Definition: setuplib.h:119
LONG BootLoaderLocation
Definition: setuplib.h:124
UNICODE_STRING DestinationPath
Definition: setuplib.h:115
ARCHITECTURE_TYPE ArchType
Definition: setuplib.h:137
PCWSTR DisplayType
Definition: setuplib.h:139
PGENERIC_LIST KeyboardList
Definition: setuplib.h:132
LANGID LanguageId
Definition: setuplib.h:146
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:114
PCWSTR ComputerType
Definition: setuplib.h:138
WCHAR LocaleID[9]
Definition: setuplib.h:145
ULONG RequiredPartitionDiskSpace
Definition: setuplib.h:148
ERROR_NUMBER LastErrorNumber
Definition: setuplib.h:83
PCWSTR LayoutId
Definition: setuplib.h:142
LONG DestinationDiskNumber
Definition: setuplib.h:121
LONG FormatPartition
Definition: setuplib.h:125
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
static PPARTLIST PartitionList
Definition: usetup.c:75
static BOOLEAN RepairUpdateFlag
Definition: usetup.c:72
PCWSTR SelectedLanguageId
Definition: usetup.c:68
__wchar_t WCHAR
Definition: xmlstorage.h:180