X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=base%2Fsetup%2Flib%2Fsetuplib.h;h=837633a7e7c386c4a3a411c0378f193aa6691837;hp=a53fc3cb2d8ce45f708ca823674c54fb8a3f2521;hb=f894631472a436f02f1b80c31b2a6a04a215f10f;hpb=92b99b865eca36e35662641f09680bb86ea2c5fe diff --git a/base/setup/lib/setuplib.h b/base/setup/lib/setuplib.h index a53fc3cb2d8..837633a7e7c 100644 --- a/base/setup/lib/setuplib.h +++ b/base/setup/lib/setuplib.h @@ -7,6 +7,8 @@ #pragma once +/* INCLUDES *****************************************************************/ + /* Needed PSDK headers when using this library */ #if 0 @@ -14,10 +16,7 @@ #define _INC_WINDOWS #define COM_NO_WINDOWS_H -#include // For LF_FACESIZE and TranslateCharsetInfo() -#include -#include // For code page support -#include +#include #endif @@ -26,15 +25,169 @@ extern HANDLE ProcessHeap; #include "errorcode.h" -#include "linklist.h" -#include "ntverrsrc.h" -// #include "arcname.h" -#include "filesup.h" +#include "spapisup/fileqsup.h" +#include "spapisup/infsupp.h" +#include "utils/linklist.h" +#include "utils/ntverrsrc.h" +// #include "utils/arcname.h" +#include "utils/bldrsup.h" +#include "bootsup.h" +#include "utils/filesup.h" #include "fsutil.h" -#include "genlist.h" -#include "inicache.h" -#include "partlist.h" -#include "arcname.h" -#include "osdetect.h" +#include "utils/genlist.h" +#include "utils/inicache.h" +#include "utils/partlist.h" +#include "utils/arcname.h" +#include "utils/osdetect.h" +#include "utils/regutil.h" +#include "registry.h" +#include "mui.h" +#include "settings.h" + + +/* DEFINES ******************************************************************/ + +#define KB ((ULONGLONG)1024) +#define MB (KB*KB) +#define GB (KB*KB*KB) +// #define TB (KB*KB*KB*KB) +// #define PB (KB*KB*KB*KB*KB) + + +/* TYPEDEFS *****************************************************************/ + +struct _USETUP_DATA; + +typedef VOID +(__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...); + +typedef struct _USETUP_DATA +{ +/* Error handling *****/ + ERROR_NUMBER LastErrorNumber; + PSETUP_ERROR_ROUTINE ErrorRoutine; + +/* Setup INFs *****/ + HINF SetupInf; + +/* Installation *****/ + PVOID SetupFileQueue; // HSPFILEQ + +/* SOURCE Paths *****/ + UNICODE_STRING SourceRootPath; + UNICODE_STRING SourceRootDir; + UNICODE_STRING SourcePath; + +/* DESTINATION Paths *****/ + /* + * Path to the system partition, where the boot manager resides. + * On x86 PCs, this is usually the active partition. + * On ARC, (u)EFI, ... platforms, this is a dedicated partition. + * + * For more information, see: + * https://en.wikipedia.org/wiki/System_partition_and_boot_partition + * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/boot-and-system-volumes.html + * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/arc-boot-process.html + * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/efi-boot-process.html + * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-system-volume.html + * http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-boot-volume.html + */ + UNICODE_STRING SystemRootPath; + + /* Path to the installation directory inside the ReactOS boot partition */ + UNICODE_STRING DestinationArcPath; /** Equivalent of 'NTOS_INSTALLATION::SystemArcPath' **/ + UNICODE_STRING DestinationPath; /** Equivalent of 'NTOS_INSTALLATION::SystemNtPath' **/ + UNICODE_STRING DestinationRootPath; + + // FIXME: This is only temporary!! Must be removed later! + UNICODE_STRING InstallPath; + + LONG DestinationDiskNumber; + LONG DestinationPartitionNumber; + + LONG MBRInstallType; + LONG FormatPartition; + LONG AutoPartition; + +/* Settings lists *****/ + PGENERIC_LIST ComputerList; + PGENERIC_LIST DisplayList; + PGENERIC_LIST KeyboardList; + PGENERIC_LIST LayoutList; + PGENERIC_LIST LanguageList; + +/* Other stuff *****/ + WCHAR LocaleID[9]; + LANGID LanguageId; + + ULONG RequiredPartitionDiskSpace; + WCHAR InstallationDirectory[MAX_PATH]; +} USETUP_DATA, *PUSETUP_DATA; + +// HACK!! +extern BOOLEAN IsUnattendedSetup; + + +/* FUNCTIONS ****************************************************************/ + +VOID +CheckUnattendedSetup( + IN OUT PUSETUP_DATA pSetupData); + +VOID +InstallSetupInfFile( + IN OUT PUSETUP_DATA pSetupData); + +NTSTATUS +GetSourcePaths( + OUT PUNICODE_STRING SourcePath, + OUT PUNICODE_STRING SourceRootPath, + OUT PUNICODE_STRING SourceRootDir); + +ERROR_NUMBER +LoadSetupInf( + IN OUT PUSETUP_DATA pSetupData); + +NTSTATUS +InitDestinationPaths( + IN OUT PUSETUP_DATA pSetupData, + IN PCWSTR InstallationDir, + IN PDISKENTRY DiskEntry, // FIXME: HACK! + IN PPARTENTRY PartEntry); // FIXME: HACK! + +// NTSTATUS +ERROR_NUMBER +InitializeSetup( + IN OUT PUSETUP_DATA pSetupData, + IN ULONG InitPhase); + +VOID +FinishSetup( + IN OUT PUSETUP_DATA pSetupData); + + +typedef enum _REGISTRY_STATUS +{ + Success = 0, + RegHiveUpdate, + ImportRegHive, + DisplaySettingsUpdate, + LocaleSettingsUpdate, + KeybLayouts, + KeybSettingsUpdate, + CodePageInfoUpdate, +} REGISTRY_STATUS; + +typedef VOID +(__cdecl *PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS, ...); + +ERROR_NUMBER +UpdateRegistry( + IN OUT PUSETUP_DATA pSetupData, + /**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */ + /**/IN PPARTLIST PartitionList, /* HACK HACK! */ + /**/IN WCHAR DestinationDriveLetter, /* HACK HACK! */ + /**/IN PCWSTR SelectedLanguageId, /* HACK HACK! */ + IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL); /* EOF */