[SETUPLIB] Move the files that implement utility functions into their own subdirector...
[reactos.git] / base / setup / lib / setuplib.h
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 "utils/linklist.h"
29 #include "utils/ntverrsrc.h"
30 // #include "utils/arcname.h"
31 #include "utils/bldrsup.h"
32 #include "bootsup.h"
33 #include "utils/filesup.h"
34 #include "fsutil.h"
35 #include "utils/genlist.h"
36 #include "utils/infsupp.h"
37 #include "utils/inicache.h"
38 #include "utils/partlist.h"
39 #include "utils/arcname.h"
40 #include "utils/osdetect.h"
41 #include "utils/regutil.h"
42 #include "registry.h"
43
44
45 /* DEFINES ******************************************************************/
46
47 #define KB ((ULONGLONG)1024)
48 #define MB (KB*KB)
49 #define GB (KB*KB*KB)
50 // #define TB (KB*KB*KB*KB)
51 // #define PB (KB*KB*KB*KB*KB)
52
53
54 /* TYPEDEFS *****************************************************************/
55
56 typedef struct _USETUP_DATA
57 {
58 /* SOURCE Paths *****/
59 UNICODE_STRING SourceRootPath;
60 UNICODE_STRING SourceRootDir;
61 UNICODE_STRING SourcePath;
62
63 /* DESTINATION Paths *****/
64 /*
65 * Path to the system partition, where the boot manager resides.
66 * On x86 PCs, this is usually the active partition.
67 * On ARC, (u)EFI, ... platforms, this is a dedicated partition.
68 *
69 * For more information, see:
70 * https://en.wikipedia.org/wiki/System_partition_and_boot_partition
71 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/boot-and-system-volumes.html
72 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/arc-boot-process.html
73 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/efi-boot-process.html
74 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-system-volume.html
75 * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-boot-volume.html
76 */
77 UNICODE_STRING SystemRootPath;
78
79 /* Path to the installation directory inside the ReactOS boot partition */
80 UNICODE_STRING DestinationPath; /** Equivalent of 'NTOS_INSTALLATION::SystemNtPath' **/
81 UNICODE_STRING DestinationArcPath; /** Equivalent of 'NTOS_INSTALLATION::SystemArcPath' **/
82 UNICODE_STRING DestinationRootPath;
83
84 LONG DestinationDiskNumber;
85 LONG DestinationPartitionNumber;
86 LONG MBRInstallType;
87
88 LONG FormatPartition;
89 LONG AutoPartition;
90
91 WCHAR LocaleID[9];
92 LANGID LanguageId;
93
94 ULONG RequiredPartitionDiskSpace;
95 WCHAR InstallationDirectory[MAX_PATH];
96 } USETUP_DATA, *PUSETUP_DATA;
97
98 // HACK!!
99 extern BOOLEAN IsUnattendedSetup;
100
101
102 /* FUNCTIONS ****************************************************************/
103
104 VOID
105 CheckUnattendedSetup(
106 IN OUT PUSETUP_DATA pSetupData);
107
108 VOID
109 InstallSetupInfFile(
110 IN OUT PUSETUP_DATA pSetupData);
111
112 NTSTATUS
113 GetSourcePaths(
114 OUT PUNICODE_STRING SourcePath,
115 OUT PUNICODE_STRING SourceRootPath,
116 OUT PUNICODE_STRING SourceRootDir);
117
118 ERROR_NUMBER
119 LoadSetupInf(
120 OUT HINF* SetupInf,
121 IN OUT PUSETUP_DATA pSetupData);
122
123
124 /* EOF */