[SETUPLIB][USETUP] Add support for setup error handling.
[reactos.git] / base / setup / lib / setuplib.h
index 033a4c8..837633a 100644 (file)
@@ -25,6 +25,8 @@
 extern HANDLE ProcessHeap;
 
 #include "errorcode.h"
+#include "spapisup/fileqsup.h"
+#include "spapisup/infsupp.h"
 #include "utils/linklist.h"
 #include "utils/ntverrsrc.h"
 // #include "utils/arcname.h"
@@ -33,13 +35,13 @@ extern HANDLE ProcessHeap;
 #include "utils/filesup.h"
 #include "fsutil.h"
 #include "utils/genlist.h"
-#include "utils/infsupp.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"
 
 
@@ -54,8 +56,23 @@ extern HANDLE ProcessHeap;
 
 /* 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;
@@ -78,17 +95,28 @@ typedef struct _USETUP_DATA
     UNICODE_STRING SystemRootPath;
 
     /* Path to the installation directory inside the ReactOS boot partition */
-    UNICODE_STRING DestinationPath;     /** Equivalent of 'NTOS_INSTALLATION::SystemNtPath' **/
     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 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;
 
@@ -118,8 +146,48 @@ GetSourcePaths(
 
 ERROR_NUMBER
 LoadSetupInf(
-    OUT HINF* SetupInf,
     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 */