ReactOS  0.4.14-dev-77-gd9e7c48
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 
25 extern 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 "bootsup.h"
35 #include "utils/filesup.h"
36 #include "fsutil.h"
37 #include "utils/genlist.h"
38 #include "utils/inicache.h"
39 #include "utils/partlist.h"
40 #include "utils/arcname.h"
41 #include "utils/osdetect.h"
42 #include "utils/regutil.h"
43 #include "registry.h"
44 #include "mui.h"
45 #include "settings.h"
46 
47 // #include "install.h" // See at the end...
48 
49 
50 /* DEFINES ******************************************************************/
51 
52 #define KB ((ULONGLONG)1024)
53 #define MB (KB*KB)
54 #define GB (KB*KB*KB)
55 // #define TB (KB*KB*KB*KB)
56 // #define PB (KB*KB*KB*KB*KB)
57 
58 
59 /* TYPEDEFS *****************************************************************/
60 
61 struct _USETUP_DATA;
62 
63 typedef VOID
64 (__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...);
65 
66 typedef struct _USETUP_DATA
67 {
68 /* Error handling *****/
70  PSETUP_ERROR_ROUTINE ErrorRoutine;
71 
72 /* Setup INFs *****/
74 
75 /* Installation *****/
76  PVOID SetupFileQueue; // HSPFILEQ
77 
78 /* SOURCE Paths *****/
82 
83 /* DESTINATION Paths *****/
84  /*
85  * Path to the system partition, where the boot manager resides.
86  * On x86 PCs, this is usually the active partition.
87  * On ARC, (u)EFI, ... platforms, this is a dedicated partition.
88  *
89  * For more information, see:
90  * https://en.wikipedia.org/wiki/System_partition_and_boot_partition
91  * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/boot-and-system-volumes.html
92  * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/arc-boot-process.html
93  * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/efi-boot-process.html
94  * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-system-volume.html
95  * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-boot-volume.html
96  */
98 
99  /* Path to the installation directory inside the ReactOS boot partition */
103 
104  // FIXME: This is only temporary!! Must be removed later!
106 
109 
114 
115 /* Settings lists *****/
121 
122 /* Other stuff *****/
125 
129 
130 
131 #include "install.h"
132 
133 
134 // HACK!!
136 
137 
138 /* FUNCTIONS ****************************************************************/
139 
140 VOID
142  IN OUT PUSETUP_DATA pSetupData);
143 
144 VOID
146  IN OUT PUSETUP_DATA pSetupData);
147 
148 NTSTATUS
150  OUT PUNICODE_STRING SourcePath,
151  OUT PUNICODE_STRING SourceRootPath,
152  OUT PUNICODE_STRING SourceRootDir);
153 
156  IN OUT PUSETUP_DATA pSetupData);
157 
158 NTSTATUS
160  IN OUT PUSETUP_DATA pSetupData,
161  IN PCWSTR InstallationDir,
162  IN PPARTENTRY PartEntry); // FIXME: HACK!
163 
164 // NTSTATUS
167  IN OUT PUSETUP_DATA pSetupData,
168  IN ULONG InitPhase);
169 
170 VOID
172  IN OUT PUSETUP_DATA pSetupData);
173 
174 
175 typedef enum _REGISTRY_STATUS
176 {
177  Success = 0,
186 
187 typedef VOID
189 
192  IN OUT PUSETUP_DATA pSetupData,
193  IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
194  IN PPARTLIST PartitionList, /* HACK HACK! */
195  IN WCHAR DestinationDriveLetter, /* HACK HACK! */
196  IN PCWSTR SelectedLanguageId, /* HACK HACK! */
198 
199 /* EOF */
UNICODE_STRING SourceRootDir
Definition: setuplib.h:80
const uint16_t * PCWSTR
Definition: typedefs.h:55
static const char const char const char PIMAGEHLP_STATUS_ROUTINE StatusRoutine
Definition: image.c:34
#define IN
Definition: typedefs.h:38
PGENERIC_LIST LanguageList
Definition: setuplib.h:120
UNICODE_STRING SourcePath
Definition: setuplib.h:81
WCHAR InstallationDirectory[MAX_PATH]
Definition: setuplib.h:127
enum _REGISTRY_STATUS REGISTRY_STATUS
#define __cdecl
Definition: accygwin.h:79
LONG MBRInstallType
Definition: setuplib.h:110
LONG NTSTATUS
Definition: precomp.h:26
LONG FormatPartition
Definition: setuplib.h:111
PGENERIC_LIST DisplayList
Definition: setuplib.h:117
PGENERIC_LIST KeyboardList
Definition: setuplib.h:118
WORD LANGID
Definition: typedefs.h:79
NTSTATUS GetSourcePaths(OUT PUNICODE_STRING SourcePath, OUT PUNICODE_STRING SourceRootPath, OUT PUNICODE_STRING SourceRootDir)
Definition: setuplib.c:398
LONG DestinationDiskNumber
Definition: setuplib.h:107
LONG AutoPartition
Definition: setuplib.h:112
ERROR_NUMBER LastErrorNumber
Definition: setuplib.h:69
VOID FinishSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:864
UNICODE_STRING DestinationPath
Definition: setuplib.h:101
long LONG
Definition: pedump.c:60
BOOLEAN IsUnattendedSetup
Definition: reactos.c:40
LANGID LanguageId
Definition: setuplib.h:124
PGENERIC_LIST ComputerList
Definition: setuplib.h:116
HINF SetupInf
Definition: setuplib.h:73
unsigned char BOOLEAN
LONG FsType
Definition: setuplib.h:113
PSETUP_ERROR_ROUTINE ErrorRoutine
Definition: setuplib.h:70
PGENERIC_LIST LayoutList
Definition: setuplib.h:119
VOID InstallSetupInfFile(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:214
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
PCWSTR SelectedLanguageId
Definition: usetup.c:66
static PPARTLIST PartitionList
Definition: usetup.c:73
VOID CheckUnattendedSetup(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:28
enum _ERROR_NUMBER ERROR_NUMBER
VOID(__cdecl * PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS,...)
Definition: setuplib.h:188
UNICODE_STRING SourceRootPath
Definition: setuplib.h:79
ERROR_NUMBER LoadSetupInf(IN OUT PUSETUP_DATA pSetupData)
Definition: setuplib.c:512
UNICODE_STRING InstallPath
Definition: setuplib.h:105
WCHAR LocaleID[9]
Definition: setuplib.h:123
PVOID SetupFileQueue
Definition: setuplib.h:76
HANDLE ProcessHeap
Definition: servman.c:15
UNICODE_STRING DestinationArcPath
Definition: setuplib.h:100
ERROR_NUMBER InitializeSetup(IN OUT PUSETUP_DATA pSetupData, IN ULONG InitPhase)
Definition: setuplib.c:781
UNICODE_STRING SystemRootPath
Definition: setuplib.h:97
static BOOLEAN RepairUpdateFlag
Definition: usetup.c:70
#define OUT
Definition: typedefs.h:39
_REGISTRY_STATUS
Definition: setuplib.h:175
unsigned int ULONG
Definition: retypes.h:1
typedef struct _USETUP_DATA * PUSETUP_DATA
NTSTATUS InitDestinationPaths(IN OUT PUSETUP_DATA pSetupData, IN PCWSTR InstallationDir, IN PPARTENTRY PartEntry)
Definition: setuplib.c:624
typedef VOID(__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA *
LONG DestinationPartitionNumber
Definition: setuplib.h:108
typedef struct _USETUP_DATA USETUP_DATA
UNICODE_STRING DestinationRootPath
Definition: setuplib.h:102
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)
Definition: setuplib.c:914
ULONG RequiredPartitionDiskSpace
Definition: setuplib.h:126
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68