[SETUPLIB][REACTOS][USETUP] Turn setuplib into a DLL shared between TUI and GUI 1st-stage setups (#7523)

CORE-13525

Notes:
- Most of the exported functions have been turned from default cdecl to explicit stdcall / "NTAPI".
- The two InitializeSetup() phases have been collapsed to make the initialization simpler.

Average reductions (percentages; see PR #7523 for actual numbers):

x86 Debug builds:
reactos.exe: 35.1%
smss.exe   : 39.8%
Total (including setuplib.dll): 17.9%

x86 Release builds:
reactos.exe: 22.3%
smss.exe   : 25.0%
Total (including setuplib.dll): 10.6%

x64 Debug builds:
reactos.exe: 40.6%
smss.exe   : 41.6%
Total (including setuplib.dll): 20.0%

x64 Release builds:
reactos.exe: 22.8%
smss.exe   : 22.3%
Total (including setuplib.dll): 10.1%
This commit is contained in:
Hermès Bélusca-Maïto 2024-11-22 21:45:06 +01:00
parent e51e5de1f8
commit d7c1d220b5
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
35 changed files with 462 additions and 262 deletions

View file

@ -3,9 +3,12 @@ add_definitions(${I18N_DEFS})
if(_WINKD_) if(_WINKD_)
add_definitions(-D_WINKD_) add_definitions(-D_WINKD_)
endif() endif()
add_definitions(-D_SETUPLIB_)
include_directories(spapisup utils) include_directories(spapisup utils)
spec2def(setuplib.dll setuplib.spec ADD_IMPORTLIB)
list(APPEND SOURCE list(APPEND SOURCE
spapisup/fileqsup.c spapisup/fileqsup.c
spapisup/infsupp.c spapisup/infsupp.c
@ -32,6 +35,15 @@ list(APPEND SOURCE
setuplib.c setuplib.c
precomp.h) precomp.h)
add_library(setuplib ${SOURCE}) add_library(setuplib SHARED
${SOURCE}
setuplib.rc
${CMAKE_CURRENT_BINARY_DIR}/setuplib.def)
add_pch(setuplib precomp.h SOURCE) add_pch(setuplib precomp.h SOURCE)
add_dependencies(setuplib xdk) # psdk add_dependencies(setuplib xdk) # psdk
set_module_type(setuplib nativedll)
target_link_libraries(setuplib ext2lib vfatlib btrfslib ${PSEH_LIB})
add_importlibs(setuplib ntdll)
add_cd_file(TARGET setuplib DESTINATION reactos/system32 NO_CAB FOR bootcd regtest)

View file

@ -19,7 +19,7 @@
#include "bootcode.h" #include "bootcode.h"
#include "fsutil.h" #include "fsutil.h"
#include "setuplib.h" // HAXX for IsUnattendedSetup!! #include "setuplib.h" // HACK for IsUnattendedSetup
#include "bootsup.h" #include "bootsup.h"
@ -1658,6 +1658,7 @@ GetDeviceInfo(
* @return An NTSTATUS code indicating success or failure. * @return An NTSTATUS code indicating success or failure.
**/ **/
NTSTATUS NTSTATUS
NTAPI
InstallBootManagerAndBootEntries( InstallBootManagerAndBootEntries(
_In_ ARCHITECTURE_TYPE ArchType, _In_ ARCHITECTURE_TYPE ArchType,
_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SystemRootPath,
@ -1813,6 +1814,7 @@ Quit:
} }
NTSTATUS NTSTATUS
NTAPI
InstallBootcodeToRemovable( InstallBootcodeToRemovable(
_In_ ARCHITECTURE_TYPE ArchType, _In_ ARCHITECTURE_TYPE ArchType,
_In_ PCUNICODE_STRING RemovableRootPath, _In_ PCUNICODE_STRING RemovableRootPath,

View file

@ -8,6 +8,7 @@
#pragma once #pragma once
NTSTATUS NTSTATUS
NTAPI
InstallBootManagerAndBootEntries( InstallBootManagerAndBootEntries(
_In_ ARCHITECTURE_TYPE ArchType, _In_ ARCHITECTURE_TYPE ArchType,
_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SystemRootPath,
@ -16,6 +17,7 @@ InstallBootManagerAndBootEntries(
_In_ ULONG_PTR Options); _In_ ULONG_PTR Options);
NTSTATUS NTSTATUS
NTAPI
InstallBootcodeToRemovable( InstallBootcodeToRemovable(
_In_ ARCHITECTURE_TYPE ArchType, _In_ ARCHITECTURE_TYPE ArchType,
_In_ PCUNICODE_STRING RemovableRootPath, _In_ PCUNICODE_STRING RemovableRootPath,

View file

@ -179,6 +179,7 @@ static FILE_SYSTEM RegisteredFileSystems[] =
/** QueryAvailableFileSystemFormat() **/ /** QueryAvailableFileSystemFormat() **/
BOOLEAN BOOLEAN
NTAPI
GetRegisteredFileSystems( GetRegisteredFileSystems(
IN ULONG Index, IN ULONG Index,
OUT PCWSTR* FileSystemName) OUT PCWSTR* FileSystemName)
@ -241,6 +242,7 @@ GetFileSystemByName(
/** ChkdskEx() **/ /** ChkdskEx() **/
NTSTATUS NTSTATUS
NTAPI
ChkdskFileSystem_UStr( ChkdskFileSystem_UStr(
_In_ PUNICODE_STRING DriveRoot, _In_ PUNICODE_STRING DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -284,6 +286,7 @@ ChkdskFileSystem_UStr(
} }
NTSTATUS NTSTATUS
NTAPI
ChkdskFileSystem( ChkdskFileSystem(
_In_ PCWSTR DriveRoot, _In_ PCWSTR DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -308,6 +311,7 @@ ChkdskFileSystem(
/** FormatEx() **/ /** FormatEx() **/
NTSTATUS NTSTATUS
NTAPI
FormatFileSystem_UStr( FormatFileSystem_UStr(
_In_ PUNICODE_STRING DriveRoot, _In_ PUNICODE_STRING DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -373,6 +377,7 @@ FormatFileSystem_UStr(
} }
NTSTATUS NTSTATUS
NTAPI
FormatFileSystem( FormatFileSystem(
_In_ PCWSTR DriveRoot, _In_ PCWSTR DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -754,6 +759,7 @@ Quit:
// //
NTSTATUS NTSTATUS
NTAPI
ChkdskVolume( ChkdskVolume(
_In_ PVOLINFO Volume, _In_ PVOLINFO Volume,
_In_ BOOLEAN FixErrors, _In_ BOOLEAN FixErrors,
@ -778,6 +784,7 @@ ChkdskVolume(
} }
NTSTATUS NTSTATUS
NTAPI
ChkdskPartition( ChkdskPartition(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ BOOLEAN FixErrors, _In_ BOOLEAN FixErrors,
@ -801,6 +808,7 @@ ChkdskPartition(
} }
NTSTATUS NTSTATUS
NTAPI
FormatVolume( FormatVolume(
_In_ PVOLINFO Volume, _In_ PVOLINFO Volume,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -839,6 +847,7 @@ FormatVolume(
} }
NTSTATUS NTSTATUS
NTAPI
FormatPartition( FormatPartition(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -1084,6 +1093,7 @@ GetNextUnformattedVolume(
} }
BOOLEAN BOOLEAN
NTAPI
FsVolCommitOpsQueue( FsVolCommitOpsQueue(
_In_ PPARTLIST PartitionList, _In_ PPARTLIST PartitionList,
_In_ PVOLENTRY SystemVolume, _In_ PVOLENTRY SystemVolume,

View file

@ -12,6 +12,7 @@
/** QueryAvailableFileSystemFormat() **/ /** QueryAvailableFileSystemFormat() **/
BOOLEAN BOOLEAN
NTAPI
GetRegisteredFileSystems( GetRegisteredFileSystems(
IN ULONG Index, IN ULONG Index,
OUT PCWSTR* FileSystemName); OUT PCWSTR* FileSystemName);
@ -19,6 +20,7 @@ GetRegisteredFileSystems(
/** ChkdskEx() **/ /** ChkdskEx() **/
NTSTATUS NTSTATUS
NTAPI
ChkdskFileSystem_UStr( ChkdskFileSystem_UStr(
_In_ PUNICODE_STRING DriveRoot, _In_ PUNICODE_STRING DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -29,6 +31,7 @@ ChkdskFileSystem_UStr(
_In_opt_ PFMIFSCALLBACK Callback); _In_opt_ PFMIFSCALLBACK Callback);
NTSTATUS NTSTATUS
NTAPI
ChkdskFileSystem( ChkdskFileSystem(
_In_ PCWSTR DriveRoot, _In_ PCWSTR DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -41,6 +44,7 @@ ChkdskFileSystem(
/** FormatEx() **/ /** FormatEx() **/
NTSTATUS NTSTATUS
NTAPI
FormatFileSystem_UStr( FormatFileSystem_UStr(
_In_ PUNICODE_STRING DriveRoot, _In_ PUNICODE_STRING DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -51,6 +55,7 @@ FormatFileSystem_UStr(
_In_opt_ PFMIFSCALLBACK Callback); _In_opt_ PFMIFSCALLBACK Callback);
NTSTATUS NTSTATUS
NTAPI
FormatFileSystem( FormatFileSystem(
_In_ PCWSTR DriveRoot, _In_ PCWSTR DriveRoot,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -109,6 +114,7 @@ InstallNtfsBootCode(
// //
NTSTATUS NTSTATUS
NTAPI
ChkdskPartition( ChkdskPartition(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ BOOLEAN FixErrors, _In_ BOOLEAN FixErrors,
@ -118,6 +124,7 @@ ChkdskPartition(
_In_opt_ PFMIFSCALLBACK Callback); _In_opt_ PFMIFSCALLBACK Callback);
NTSTATUS NTSTATUS
NTAPI
FormatPartition( FormatPartition(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ PCWSTR FileSystemName, _In_ PCWSTR FileSystemName,
@ -200,6 +207,7 @@ typedef FSVOL_OP
_In_ ULONG_PTR Param2); _In_ ULONG_PTR Param2);
BOOLEAN BOOLEAN
NTAPI
FsVolCommitOpsQueue( FsVolCommitOpsQueue(
_In_ PPARTLIST PartitionList, _In_ PPARTLIST PartitionList,
_In_ PVOLENTRY SystemVolume, _In_ PVOLENTRY SystemVolume,

View file

@ -13,7 +13,7 @@
#include "filesup.h" #include "filesup.h"
#include "infsupp.h" #include "infsupp.h"
#include "setuplib.h" // HAXX for USETUP_DATA!! #include "setuplib.h" // HACK for USETUP_DATA
#include "install.h" #include "install.h"
@ -681,6 +681,7 @@ PrepareCopyInfFile(
// #define USE_CABINET_INF // #define USE_CABINET_INF
BOOLEAN // ERROR_NUMBER BOOLEAN // ERROR_NUMBER
NTAPI
PrepareFileCopy( PrepareFileCopy(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL) IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL)
@ -823,6 +824,7 @@ PrepareFileCopy(
} }
BOOLEAN BOOLEAN
NTAPI
DoFileCopy( DoFileCopy(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
IN PSP_FILE_CALLBACK_W MsgHandler, IN PSP_FILE_CALLBACK_W MsgHandler,

View file

@ -27,11 +27,13 @@ PrepareCopyInfFile(
#endif #endif
BOOLEAN // ERROR_NUMBER BOOLEAN // ERROR_NUMBER
NTAPI
PrepareFileCopy( PrepareFileCopy(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL); IN PFILE_COPY_STATUS_ROUTINE StatusRoutine OPTIONAL);
BOOLEAN BOOLEAN
NTAPI
DoFileCopy( DoFileCopy(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
IN PSP_FILE_CALLBACK_W MsgHandler, IN PSP_FILE_CALLBACK_W MsgHandler,

View file

@ -29,10 +29,14 @@
#include <ntstrsafe.h> #include <ntstrsafe.h>
/* Filesystem headers */ /* Filesystem headers */
#include <reactos/rosioctl.h> // For extra partition IDs #include <reactos/rosioctl.h> // For extra partition IDs
#ifndef SPLIBAPI
#define SPLIBAPI
#endif
// //
///* Internal Headers */ ///* Internal Headers */
//#include "interface/consup.h" //#include "interface/consup.h"
@ -51,7 +55,6 @@
//#include "filesup.h" //#include "filesup.h"
//#include "genlist.h" //#include "genlist.h"
extern HANDLE ProcessHeap; extern HANDLE ProcessHeap;
#include "errorcode.h" #include "errorcode.h"

View file

@ -22,9 +22,13 @@
/* GLOBALS ******************************************************************/ /* GLOBALS ******************************************************************/
HANDLE ProcessHeap;
BOOLEAN IsUnattendedSetup = FALSE;
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
VOID VOID
NTAPI
CheckUnattendedSetup( CheckUnattendedSetup(
IN OUT PUSETUP_DATA pSetupData) IN OUT PUSETUP_DATA pSetupData)
{ {
@ -199,6 +203,7 @@ Quit:
} }
VOID VOID
NTAPI
InstallSetupInfFile( InstallSetupInfFile(
IN OUT PUSETUP_DATA pSetupData) IN OUT PUSETUP_DATA pSetupData)
{ {
@ -669,6 +674,7 @@ LoadSetupInf(
* @brief Find or set the active system partition. * @brief Find or set the active system partition.
**/ **/
BOOLEAN BOOLEAN
NTAPI
InitSystemPartition( InitSystemPartition(
/**/_In_ PPARTLIST PartitionList, /* HACK HACK! */ /**/_In_ PPARTLIST PartitionList, /* HACK HACK! */
/**/_In_ PPARTENTRY InstallPartition, /* HACK HACK! */ /**/_In_ PPARTENTRY InstallPartition, /* HACK HACK! */
@ -768,6 +774,7 @@ InitSystemPartition(
* Each path component must be a valid 8.3 name. * Each path component must be a valid 8.3 name.
**/ **/
BOOLEAN BOOLEAN
NTAPI
IsValidInstallDirectory( IsValidInstallDirectory(
_In_ PCWSTR InstallDir) _In_ PCWSTR InstallDir)
{ {
@ -852,6 +859,7 @@ IsValidInstallDirectory(
NTSTATUS NTSTATUS
NTAPI
InitDestinationPaths( InitDestinationPaths(
_Inout_ PUSETUP_DATA pSetupData, _Inout_ PUSETUP_DATA pSetupData,
_In_ PCWSTR InstallationDir, _In_ PCWSTR InstallationDir,
@ -1007,92 +1015,91 @@ InitDestinationPaths(
// NTSTATUS // NTSTATUS
ERROR_NUMBER ERROR_NUMBER
NTAPI
InitializeSetup( InitializeSetup(
IN OUT PUSETUP_DATA pSetupData, _Inout_ PUSETUP_DATA pSetupData,
IN ULONG InitPhase) _In_opt_ PSETUP_ERROR_ROUTINE ErrorRoutine,
_In_ PSPFILE_EXPORTS pSpFileExports,
_In_ PSPINF_EXPORTS pSpInfExports)
{ {
if (InitPhase == 0) ERROR_NUMBER Error;
NTSTATUS Status;
IsUnattendedSetup = FALSE;
RtlZeroMemory(pSetupData, sizeof(*pSetupData));
/* Initialize error handling */
pSetupData->LastErrorNumber = ERROR_SUCCESS;
pSetupData->ErrorRoutine = ErrorRoutine;
/* Initialize global unicode strings */
RtlInitUnicodeString(&pSetupData->SourcePath, NULL);
RtlInitUnicodeString(&pSetupData->SourceRootPath, NULL);
RtlInitUnicodeString(&pSetupData->SourceRootDir, NULL);
RtlInitUnicodeString(&pSetupData->DestinationArcPath, NULL);
RtlInitUnicodeString(&pSetupData->DestinationPath, NULL);
RtlInitUnicodeString(&pSetupData->DestinationRootPath, NULL);
RtlInitUnicodeString(&pSetupData->SystemRootPath, NULL);
// FIXME: This is only temporary!! Must be removed later!
/***/RtlInitUnicodeString(&pSetupData->InstallPath, NULL);/***/
/* Initialize SpFile and SpInf support */
RtlCopyMemory(&SpFileExports, pSpFileExports, sizeof(SpFileExports));
RtlCopyMemory(&SpInfExports, pSpInfExports, sizeof(SpInfExports));
//
// TODO: Load and start SetupDD, and ask it for the information
//
/* Get the source path and source root path */
Status = GetSourcePaths(&pSetupData->SourcePath,
&pSetupData->SourceRootPath,
&pSetupData->SourceRootDir);
if (!NT_SUCCESS(Status))
{ {
RtlZeroMemory(pSetupData, sizeof(*pSetupData)); DPRINT1("GetSourcePaths() failed (Status 0x%08lx)\n", Status);
return ERROR_NO_SOURCE_DRIVE;
/* Initialize error handling */
pSetupData->LastErrorNumber = ERROR_SUCCESS;
pSetupData->ErrorRoutine = NULL;
/* Initialize global unicode strings */
RtlInitUnicodeString(&pSetupData->SourcePath, NULL);
RtlInitUnicodeString(&pSetupData->SourceRootPath, NULL);
RtlInitUnicodeString(&pSetupData->SourceRootDir, NULL);
RtlInitUnicodeString(&pSetupData->DestinationArcPath, NULL);
RtlInitUnicodeString(&pSetupData->DestinationPath, NULL);
RtlInitUnicodeString(&pSetupData->DestinationRootPath, NULL);
RtlInitUnicodeString(&pSetupData->SystemRootPath, NULL);
// FIXME: This is only temporary!! Must be removed later!
/***/RtlInitUnicodeString(&pSetupData->InstallPath, NULL);/***/
//
// TODO: Load and start SetupDD, and ask it for the information
//
return ERROR_SUCCESS;
} }
else DPRINT1("SourcePath (1): '%wZ'\n", &pSetupData->SourcePath);
if (InitPhase == 1) DPRINT1("SourceRootPath (1): '%wZ'\n", &pSetupData->SourceRootPath);
DPRINT1("SourceRootDir (1): '%wZ'\n", &pSetupData->SourceRootDir);
/* Set up default values */
pSetupData->DestinationDiskNumber = 0;
pSetupData->DestinationPartitionNumber = 1;
pSetupData->BootLoaderLocation = 2; // Default to "System partition"
pSetupData->FormatPartition = 0;
pSetupData->AutoPartition = 0;
pSetupData->FsType = 0;
/* Load 'txtsetup.sif' from the installation media */
Error = LoadSetupInf(pSetupData);
if (Error != ERROR_SUCCESS)
{ {
ERROR_NUMBER Error; DPRINT1("LoadSetupInf() failed (Error 0x%lx)\n", Error);
NTSTATUS Status; return Error;
}
DPRINT1("SourcePath (2): '%wZ'\n", &pSetupData->SourcePath);
DPRINT1("SourceRootPath (2): '%wZ'\n", &pSetupData->SourceRootPath);
DPRINT1("SourceRootDir (2): '%wZ'\n", &pSetupData->SourceRootDir);
/* Get the source path and source root path */ /* Retrieve the target machine architecture type */
Status = GetSourcePaths(&pSetupData->SourcePath, // FIXME: This should be determined at runtime!!
&pSetupData->SourceRootPath, // FIXME: Allow for (pre-)installing on an architecture
&pSetupData->SourceRootDir); // different from the current one?
if (!NT_SUCCESS(Status))
{
DPRINT1("GetSourcePaths() failed (Status 0x%08lx)\n", Status);
return ERROR_NO_SOURCE_DRIVE;
}
DPRINT1("SourcePath (1): '%wZ'\n", &pSetupData->SourcePath);
DPRINT1("SourceRootPath (1): '%wZ'\n", &pSetupData->SourceRootPath);
DPRINT1("SourceRootDir (1): '%wZ'\n", &pSetupData->SourceRootDir);
/* Set up default values */
pSetupData->DestinationDiskNumber = 0;
pSetupData->DestinationPartitionNumber = 1;
pSetupData->BootLoaderLocation = 2; // Default to "System partition"
pSetupData->FormatPartition = 0;
pSetupData->AutoPartition = 0;
pSetupData->FsType = 0;
/* Load 'txtsetup.sif' from the installation media */
Error = LoadSetupInf(pSetupData);
if (Error != ERROR_SUCCESS)
{
DPRINT1("LoadSetupInf() failed (Error 0x%lx)\n", Error);
return Error;
}
DPRINT1("SourcePath (2): '%wZ'\n", &pSetupData->SourcePath);
DPRINT1("SourceRootPath (2): '%wZ'\n", &pSetupData->SourceRootPath);
DPRINT1("SourceRootDir (2): '%wZ'\n", &pSetupData->SourceRootDir);
/* Retrieve the target machine architecture type */
// FIXME: This should be determined at runtime!!
// FIXME: Allow for (pre-)installing on an architecture
// different from the current one?
#if defined(SARCH_XBOX) #if defined(SARCH_XBOX)
pSetupData->ArchType = ARCH_Xbox; pSetupData->ArchType = ARCH_Xbox;
// #elif defined(SARCH_PC98) // #elif defined(SARCH_PC98)
#else // TODO: Arc, UEFI #else // TODO: Arc, UEFI
pSetupData->ArchType = (IsNEC_98 ? ARCH_NEC98x86 : ARCH_PcAT); pSetupData->ArchType = (IsNEC_98 ? ARCH_NEC98x86 : ARCH_PcAT);
#endif #endif
return ERROR_SUCCESS;
}
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
VOID VOID
NTAPI
FinishSetup( FinishSetup(
IN OUT PUSETUP_DATA pSetupData) IN OUT PUSETUP_DATA pSetupData)
{ {
@ -1143,6 +1150,7 @@ FinishSetup(
* Calls SetMountedDeviceValues * Calls SetMountedDeviceValues
*/ */
ERROR_NUMBER ERROR_NUMBER
NTAPI
UpdateRegistry( UpdateRegistry(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
/**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */ /**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
@ -1396,4 +1404,31 @@ Cleanup:
return ErrorNumber; return ErrorNumber;
} }
/* ENTRY-POINT ***************************************************************/
/* Declared in ndk/umfuncs.h */
NTSTATUS
NTAPI
LdrDisableThreadCalloutsForDll(
_In_ PVOID BaseAddress);
BOOL
NTAPI
DllMain(
_In_ HINSTANCE hDll,
_In_ ULONG dwReason,
_In_opt_ PVOID pReserved)
{
UNREFERENCED_PARAMETER(pReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
LdrDisableThreadCalloutsForDll(hDll);
ProcessHeap = RtlGetProcessHeap();
}
return TRUE;
}
/* EOF */ /* EOF */

View file

@ -7,6 +7,16 @@
#pragma once #pragma once
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _SETUPLIB_
#define SPLIBAPI DECLSPEC_IMPORT
#else
#define SPLIBAPI
#endif
/* INCLUDES *****************************************************************/ /* INCLUDES *****************************************************************/
/* Needed PSDK headers when using this library */ /* Needed PSDK headers when using this library */
@ -20,9 +30,9 @@
#endif #endif
/* NOTE: Please keep the header inclusion order! */ extern SPLIBAPI BOOLEAN IsUnattendedSetup; // HACK
extern HANDLE ProcessHeap; /* NOTE: Please keep the header inclusion order! */
#include "errorcode.h" #include "errorcode.h"
#include "spapisup/fileqsup.h" #include "spapisup/fileqsup.h"
@ -153,19 +163,17 @@ typedef struct _USETUP_DATA
#include "install.h" #include "install.h"
// HACK!!
extern BOOLEAN IsUnattendedSetup;
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
#include "substset.h" #include "substset.h"
VOID VOID
NTAPI
CheckUnattendedSetup( CheckUnattendedSetup(
IN OUT PUSETUP_DATA pSetupData); IN OUT PUSETUP_DATA pSetupData);
VOID VOID
NTAPI
InstallSetupInfFile( InstallSetupInfFile(
IN OUT PUSETUP_DATA pSetupData); IN OUT PUSETUP_DATA pSetupData);
@ -182,6 +190,7 @@ LoadSetupInf(
#define ERROR_SYSTEM_PARTITION_NOT_FOUND (ERROR_LAST_ERROR_CODE + 1) #define ERROR_SYSTEM_PARTITION_NOT_FOUND (ERROR_LAST_ERROR_CODE + 1)
BOOLEAN BOOLEAN
NTAPI
InitSystemPartition( InitSystemPartition(
/**/_In_ PPARTLIST PartitionList, /* HACK HACK! */ /**/_In_ PPARTLIST PartitionList, /* HACK HACK! */
/**/_In_ PPARTENTRY InstallPartition, /* HACK HACK! */ /**/_In_ PPARTENTRY InstallPartition, /* HACK HACK! */
@ -200,10 +209,12 @@ InitSystemPartition(
(isalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_') (isalnum(c) || (c) == L'.' || (c) == L'\\' || (c) == L'-' || (c) == L'_')
BOOLEAN BOOLEAN
NTAPI
IsValidInstallDirectory( IsValidInstallDirectory(
_In_ PCWSTR InstallDir); _In_ PCWSTR InstallDir);
NTSTATUS NTSTATUS
NTAPI
InitDestinationPaths( InitDestinationPaths(
_Inout_ PUSETUP_DATA pSetupData, _Inout_ PUSETUP_DATA pSetupData,
_In_ PCWSTR InstallationDir, _In_ PCWSTR InstallationDir,
@ -211,11 +222,15 @@ InitDestinationPaths(
// NTSTATUS // NTSTATUS
ERROR_NUMBER ERROR_NUMBER
NTAPI
InitializeSetup( InitializeSetup(
IN OUT PUSETUP_DATA pSetupData, _Inout_ PUSETUP_DATA pSetupData,
IN ULONG InitPhase); _In_opt_ PSETUP_ERROR_ROUTINE ErrorRoutine,
_In_ PSPFILE_EXPORTS pSpFileExports,
_In_ PSPINF_EXPORTS pSpInfExports);
VOID VOID
NTAPI
FinishSetup( FinishSetup(
IN OUT PUSETUP_DATA pSetupData); IN OUT PUSETUP_DATA pSetupData);
@ -236,6 +251,7 @@ typedef VOID
(__cdecl *PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS, ...); (__cdecl *PREGISTRY_STATUS_ROUTINE)(IN REGISTRY_STATUS, ...);
ERROR_NUMBER ERROR_NUMBER
NTAPI
UpdateRegistry( UpdateRegistry(
IN OUT PUSETUP_DATA pSetupData, IN OUT PUSETUP_DATA pSetupData,
/**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */ /**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */
@ -245,4 +261,8 @@ UpdateRegistry(
IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL,
IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL); IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL);
#ifdef __cplusplus
}
#endif
/* EOF */ /* EOF */

View file

@ -0,0 +1,16 @@
/*
* PROJECT: ReactOS Setup Library
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Resources
* COPYRIGHT: Copyright 2003-2024 ReactOS Team
*/
#include <windef.h>
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Setup Library DLL"
#define REACTOS_STR_INTERNAL_NAME "setuplib"
#define REACTOS_STR_ORIGINAL_FILENAME "setuplib.dll"
#include <reactos/version.rc>

View file

@ -0,0 +1,83 @@
@ extern IsUnattendedSetup
@ extern MbrPartitionTypes
@ extern GptPartitionTypes
;; fileqsup and infsupp function pointers to be initialized by the user of this library
;;@ extern SpFileExports
;;@ extern SpInfExports
;; infsupp
@ cdecl INF_GetDataField(ptr long ptr) ## -private
;; filesup
@ cdecl ConcatPathsV(ptr long long ptr)
@ cdecl CombinePathsV(ptr long long ptr)
@ varargs ConcatPaths(ptr long long)
@ varargs CombinePaths(ptr long long)
@ cdecl SetupCopyFile(wstr wstr long)
@ cdecl SetupDeleteFile(wstr long)
@ cdecl SetupMoveFile(wstr wstr long)
;; genlist
@ stdcall CreateGenericList()
@ stdcall DestroyGenericList(ptr long)
@ stdcall GetCurrentListEntry(ptr)
@ stdcall GetFirstListEntry(ptr)
@ stdcall GetNextListEntry(ptr)
@ stdcall GetListEntryData(ptr)
@ stdcall GetNumberOfListEntries(ptr)
@ stdcall SetCurrentListEntry(ptr ptr)
;; partlist
@ stdcall CreatePartitionList()
@ stdcall CreatePartition(ptr ptr int64 ptr)
@ stdcall DeletePartition(ptr ptr ptr)
@ stdcall DestroyPartitionList(ptr)
@ stdcall GetNextPartition(ptr ptr)
@ stdcall GetPrevPartition(ptr ptr)
@ stdcall GetAdjUnpartitionedEntry(ptr long)
@ stdcall PartitionCreateChecks(ptr int64 ptr)
@ cdecl -ret64 RoundingDivide(int64 int64)
;;;;
@ cdecl IsPartitionActive(ptr) ## -private
@ cdecl SelectPartition(ptr long long)
;; osdetect
@ stdcall CreateNTOSInstallationsList(ptr)
@ stdcall FindSubStrI(wstr wstr)
;; settings
@ cdecl CreateComputerTypeList(ptr)
@ cdecl CreateDisplayDriverList(ptr)
@ cdecl CreateKeyboardDriverList(ptr)
@ cdecl CreateKeyboardLayoutList(ptr wstr ptr)
@ cdecl CreateLanguageList(ptr ptr)
@ cdecl GetDefaultLanguageIndex()
;; mui
@ cdecl MUIDefaultKeyboardLayout(wstr)
@ cdecl MUIGetOEMCodePage(wstr) ## -private
;; setuplib
@ stdcall CheckUnattendedSetup(ptr)
@ stdcall FinishSetup(ptr)
@ stdcall IsValidInstallDirectory(wstr)
@ stdcall InitDestinationPaths(ptr wstr ptr)
@ stdcall InitializeSetup(ptr ptr ptr ptr)
@ stdcall InitSystemPartition(ptr ptr ptr ptr ptr)
@ stdcall InstallSetupInfFile(ptr)
@ stdcall UpdateRegistry(ptr long ptr long wstr ptr ptr)
;; fsutil
@ stdcall FsVolCommitOpsQueue(ptr ptr ptr ptr ptr)
@ stdcall GetRegisteredFileSystems(long ptr)
;; install
@ stdcall PrepareFileCopy(ptr ptr)
@ stdcall DoFileCopy(ptr ptr ptr)
;; bootsup
@ stdcall InstallBootManagerAndBootEntries(long ptr ptr ptr ptr)
@ stdcall InstallBootcodeToRemovable(long ptr ptr ptr)

View file

@ -20,15 +20,6 @@
* These externs should be defined by the user of this library. * These externs should be defined by the user of this library.
* They are kept there for reference and ease of usage. * They are kept there for reference and ease of usage.
*/ */
#if 0 SPFILE_EXPORTS SpFileExports = {NULL};
pSpFileQueueOpen SpFileQueueOpen = NULL;
pSpFileQueueClose SpFileQueueClose = NULL;
pSpFileQueueCopy SpFileQueueCopy = NULL;
pSpFileQueueDelete SpFileQueueDelete = NULL;
pSpFileQueueRename SpFileQueueRename = NULL;
pSpFileQueueCommit SpFileQueueCommit = NULL;
#endif
/* EOF */ /* EOF */

View file

@ -51,7 +51,7 @@
#define FILEOP_NEWPATH 4 #define FILEOP_NEWPATH 4
/* TYPES ********************************************************************/ /* TYPES *********************************************************************/
typedef PVOID HSPFILEQ; typedef PVOID HSPFILEQ;
@ -72,21 +72,17 @@ typedef UINT (CALLBACK* PSP_FILE_CALLBACK_W)(
#endif #endif
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS *****************************************************************/
// #define SetupOpenFileQueue // #define SetupOpenFileQueue
typedef HSPFILEQ typedef HSPFILEQ
(WINAPI* pSpFileQueueOpen)(VOID); (WINAPI* pSpFileQueueOpen)(VOID);
extern pSpFileQueueOpen SpFileQueueOpen;
// #define SetupCloseFileQueue // #define SetupCloseFileQueue
typedef BOOL typedef BOOL
(WINAPI* pSpFileQueueClose)( (WINAPI* pSpFileQueueClose)(
IN HSPFILEQ QueueHandle); IN HSPFILEQ QueueHandle);
extern pSpFileQueueClose SpFileQueueClose;
// #define SetupQueueCopyW // #define SetupQueueCopyW
typedef BOOL typedef BOOL
(WINAPI* pSpFileQueueCopy)( (WINAPI* pSpFileQueueCopy)(
@ -101,8 +97,6 @@ typedef BOOL
IN PCWSTR TargetFileName OPTIONAL, IN PCWSTR TargetFileName OPTIONAL,
IN ULONG CopyStyle); IN ULONG CopyStyle);
extern pSpFileQueueCopy SpFileQueueCopy;
// #define SetupQueueDeleteW // #define SetupQueueDeleteW
typedef BOOL typedef BOOL
(WINAPI* pSpFileQueueDelete)( (WINAPI* pSpFileQueueDelete)(
@ -110,8 +104,6 @@ typedef BOOL
IN PCWSTR PathPart1, IN PCWSTR PathPart1,
IN PCWSTR PathPart2 OPTIONAL); IN PCWSTR PathPart2 OPTIONAL);
extern pSpFileQueueDelete SpFileQueueDelete;
// #define SetupQueueRenameW // #define SetupQueueRenameW
typedef BOOL typedef BOOL
(WINAPI* pSpFileQueueRename)( (WINAPI* pSpFileQueueRename)(
@ -121,8 +113,6 @@ typedef BOOL
IN PCWSTR TargetPath OPTIONAL, IN PCWSTR TargetPath OPTIONAL,
IN PCWSTR TargetFileName); IN PCWSTR TargetFileName);
extern pSpFileQueueRename SpFileQueueRename;
// #define SetupCommitFileQueueW // #define SetupCommitFileQueueW
typedef BOOL typedef BOOL
(WINAPI* pSpFileQueueCommit)( (WINAPI* pSpFileQueueCommit)(
@ -131,6 +121,23 @@ typedef BOOL
IN PSP_FILE_CALLBACK_W MsgHandler, IN PSP_FILE_CALLBACK_W MsgHandler,
IN PVOID Context OPTIONAL); IN PVOID Context OPTIONAL);
extern pSpFileQueueCommit SpFileQueueCommit; typedef struct _SPFILE_EXPORTS
{
pSpFileQueueOpen SpFileQueueOpen;
pSpFileQueueClose SpFileQueueClose;
pSpFileQueueCopy SpFileQueueCopy;
pSpFileQueueDelete SpFileQueueDelete;
pSpFileQueueRename SpFileQueueRename;
pSpFileQueueCommit SpFileQueueCommit;
} SPFILE_EXPORTS, *PSPFILE_EXPORTS;
extern /*SPLIBAPI*/ SPFILE_EXPORTS SpFileExports;
#define SpFileQueueOpen (SpFileExports.SpFileQueueOpen)
#define SpFileQueueClose (SpFileExports.SpFileQueueClose)
#define SpFileQueueCopy (SpFileExports.SpFileQueueCopy)
#define SpFileQueueDelete (SpFileExports.SpFileQueueDelete)
#define SpFileQueueRename (SpFileExports.SpFileQueueRename)
#define SpFileQueueCommit (SpFileExports.SpFileQueueCommit)
/* EOF */ /* EOF */

View file

@ -21,20 +21,7 @@
* These externs should be defined by the user of this library. * These externs should be defined by the user of this library.
* They are kept there for reference and ease of usage. * They are kept there for reference and ease of usage.
*/ */
#if 0 SPINF_EXPORTS SpInfExports = {NULL};
pSpInfCloseInfFile SpInfCloseInfFile = NULL;
pSpInfFindFirstLine SpInfFindFirstLine = NULL;
pSpInfFindNextLine SpInfFindNextLine = NULL;
pSpInfGetFieldCount SpInfGetFieldCount = NULL;
pSpInfGetBinaryField SpInfGetBinaryField = NULL;
pSpInfGetIntField SpInfGetIntField = NULL;
pSpInfGetMultiSzField SpInfGetMultiSzField = NULL;
pSpInfGetStringField SpInfGetStringField = NULL;
pSpInfGetField SpInfGetField = NULL;
pSpInfOpenInfFile SpInfOpenInfFile = NULL;
#endif
/* HELPER FUNCTIONS **********************************************************/ /* HELPER FUNCTIONS **********************************************************/

View file

@ -29,6 +29,8 @@ typedef struct _INFCONTEXT
#endif #endif
C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
/* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */ /* Lower the MAX_INF_STRING_LENGTH value in order to avoid too much stack usage */
#undef MAX_INF_STRING_LENGTH #undef MAX_INF_STRING_LENGTH
#define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h #define MAX_INF_STRING_LENGTH 1024 // Still larger than in infcommon.h
@ -41,27 +43,14 @@ typedef struct _INFCONTEXT
#define INF_STYLE_WIN4 0x00000002 #define INF_STYLE_WIN4 0x00000002
#endif #endif
#if 0
typedef PVOID HINF;
typedef struct _INFCONTEXT
{
HINF Inf;
HINF CurrentInf;
UINT Section;
UINT Line;
} INFCONTEXT, *PINFCONTEXT;
#endif
C_ASSERT(sizeof(INFCONTEXT) == 2 * sizeof(HINF) + 2 * sizeof(UINT));
/* FUNCTIONS *****************************************************************/
// #define SetupCloseInfFile InfCloseFile // #define SetupCloseInfFile InfCloseFile
typedef VOID typedef VOID
(WINAPI* pSpInfCloseInfFile)( (WINAPI* pSpInfCloseInfFile)(
IN HINF InfHandle); IN HINF InfHandle);
extern pSpInfCloseInfFile SpInfCloseInfFile;
// #define SetupFindFirstLineW InfpFindFirstLineW // #define SetupFindFirstLineW InfpFindFirstLineW
typedef BOOL typedef BOOL
(WINAPI* pSpInfFindFirstLine)( (WINAPI* pSpInfFindFirstLine)(
@ -70,23 +59,17 @@ typedef BOOL
IN PCWSTR Key, IN PCWSTR Key,
IN OUT PINFCONTEXT Context); IN OUT PINFCONTEXT Context);
extern pSpInfFindFirstLine SpInfFindFirstLine;
// #define SetupFindNextLine InfFindNextLine // #define SetupFindNextLine InfFindNextLine
typedef BOOL typedef BOOL
(WINAPI* pSpInfFindNextLine)( (WINAPI* pSpInfFindNextLine)(
IN PINFCONTEXT ContextIn, IN PINFCONTEXT ContextIn,
OUT PINFCONTEXT ContextOut); OUT PINFCONTEXT ContextOut);
extern pSpInfFindNextLine SpInfFindNextLine;
// #define SetupGetFieldCount InfGetFieldCount // #define SetupGetFieldCount InfGetFieldCount
typedef ULONG typedef ULONG
(WINAPI* pSpInfGetFieldCount)( (WINAPI* pSpInfGetFieldCount)(
IN PINFCONTEXT Context); IN PINFCONTEXT Context);
extern pSpInfGetFieldCount SpInfGetFieldCount;
// #define SetupGetBinaryField InfGetBinaryField // #define SetupGetBinaryField InfGetBinaryField
typedef BOOL typedef BOOL
(WINAPI* pSpInfGetBinaryField)( (WINAPI* pSpInfGetBinaryField)(
@ -96,8 +79,6 @@ typedef BOOL
IN ULONG ReturnBufferSize, IN ULONG ReturnBufferSize,
OUT PULONG RequiredSize); OUT PULONG RequiredSize);
extern pSpInfGetBinaryField SpInfGetBinaryField;
// #define SetupGetIntField InfGetIntField // #define SetupGetIntField InfGetIntField
typedef BOOL typedef BOOL
(WINAPI* pSpInfGetIntField)( (WINAPI* pSpInfGetIntField)(
@ -105,8 +86,6 @@ typedef BOOL
IN ULONG FieldIndex, IN ULONG FieldIndex,
OUT INT *IntegerValue); // PINT OUT INT *IntegerValue); // PINT
extern pSpInfGetIntField SpInfGetIntField;
// #define SetupGetMultiSzFieldW InfGetMultiSzField // #define SetupGetMultiSzFieldW InfGetMultiSzField
typedef BOOL typedef BOOL
(WINAPI* pSpInfGetMultiSzField)( (WINAPI* pSpInfGetMultiSzField)(
@ -116,8 +95,6 @@ typedef BOOL
IN ULONG ReturnBufferSize, IN ULONG ReturnBufferSize,
OUT PULONG RequiredSize); OUT PULONG RequiredSize);
extern pSpInfGetMultiSzField SpInfGetMultiSzField;
// #define SetupGetStringFieldW InfGetStringField // #define SetupGetStringFieldW InfGetStringField
typedef BOOL typedef BOOL
(WINAPI* pSpInfGetStringField)( (WINAPI* pSpInfGetStringField)(
@ -127,16 +104,12 @@ typedef BOOL
IN ULONG ReturnBufferSize, IN ULONG ReturnBufferSize,
OUT PULONG RequiredSize); OUT PULONG RequiredSize);
extern pSpInfGetStringField SpInfGetStringField;
// #define pSetupGetField // #define pSetupGetField
typedef PCWSTR typedef PCWSTR
(WINAPI* pSpInfGetField)( (WINAPI* pSpInfGetField)(
IN PINFCONTEXT Context, IN PINFCONTEXT Context,
IN ULONG FieldIndex); IN ULONG FieldIndex);
extern pSpInfGetField SpInfGetField;
/* A version of SetupOpenInfFileW with support for a user-provided LCID */ /* A version of SetupOpenInfFileW with support for a user-provided LCID */
// #define SetupOpenInfFileExW InfpOpenInfFileW // #define SetupOpenInfFileExW InfpOpenInfFileW
typedef HINF typedef HINF
@ -147,8 +120,32 @@ typedef HINF
IN LCID LocaleId, IN LCID LocaleId,
OUT PUINT ErrorLine); OUT PUINT ErrorLine);
extern pSpInfOpenInfFile SpInfOpenInfFile; typedef struct _SPINF_EXPORTS
{
pSpInfCloseInfFile SpInfCloseInfFile;
pSpInfFindFirstLine SpInfFindFirstLine;
pSpInfFindNextLine SpInfFindNextLine;
pSpInfGetFieldCount SpInfGetFieldCount;
pSpInfGetBinaryField SpInfGetBinaryField;
pSpInfGetIntField SpInfGetIntField;
pSpInfGetMultiSzField SpInfGetMultiSzField;
pSpInfGetStringField SpInfGetStringField;
pSpInfGetField SpInfGetField;
pSpInfOpenInfFile SpInfOpenInfFile;
} SPINF_EXPORTS, *PSPINF_EXPORTS;
extern /*SPLIBAPI*/ SPINF_EXPORTS SpInfExports;
#define SpInfCloseInfFile (SpInfExports.SpInfCloseInfFile)
#define SpInfFindFirstLine (SpInfExports.SpInfFindFirstLine)
#define SpInfFindNextLine (SpInfExports.SpInfFindNextLine)
#define SpInfGetFieldCount (SpInfExports.SpInfGetFieldCount)
#define SpInfGetBinaryField (SpInfExports.SpInfGetBinaryField)
#define SpInfGetIntField (SpInfExports.SpInfGetIntField)
#define SpInfGetMultiSzField (SpInfExports.SpInfGetMultiSzField)
#define SpInfGetStringField (SpInfExports.SpInfGetStringField)
#define SpInfGetField (SpInfExports.SpInfGetField)
#define SpInfOpenInfFile (SpInfExports.SpInfOpenInfFile)
/* HELPER FUNCTIONS **********************************************************/ /* HELPER FUNCTIONS **********************************************************/

View file

@ -17,6 +17,7 @@
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
PGENERIC_LIST PGENERIC_LIST
NTAPI
CreateGenericList(VOID) CreateGenericList(VOID)
{ {
PGENERIC_LIST List; PGENERIC_LIST List;
@ -33,6 +34,7 @@ CreateGenericList(VOID)
} }
VOID VOID
NTAPI
DestroyGenericList( DestroyGenericList(
IN OUT PGENERIC_LIST List, IN OUT PGENERIC_LIST List,
IN BOOLEAN FreeData) IN BOOLEAN FreeData)
@ -59,6 +61,7 @@ DestroyGenericList(
} }
BOOLEAN BOOLEAN
NTAPI
AppendGenericListEntry( AppendGenericListEntry(
IN OUT PGENERIC_LIST List, IN OUT PGENERIC_LIST List,
IN PVOID Data, IN PVOID Data,
@ -84,6 +87,7 @@ AppendGenericListEntry(
} }
VOID VOID
NTAPI
SetCurrentListEntry( SetCurrentListEntry(
IN PGENERIC_LIST List, IN PGENERIC_LIST List,
IN PGENERIC_LIST_ENTRY Entry) IN PGENERIC_LIST_ENTRY Entry)
@ -94,6 +98,7 @@ SetCurrentListEntry(
} }
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetCurrentListEntry( GetCurrentListEntry(
IN PGENERIC_LIST List) IN PGENERIC_LIST List)
{ {
@ -101,6 +106,7 @@ GetCurrentListEntry(
} }
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetFirstListEntry( GetFirstListEntry(
IN PGENERIC_LIST List) IN PGENERIC_LIST List)
{ {
@ -111,6 +117,7 @@ GetFirstListEntry(
} }
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetNextListEntry( GetNextListEntry(
IN PGENERIC_LIST_ENTRY Entry) IN PGENERIC_LIST_ENTRY Entry)
{ {
@ -123,6 +130,7 @@ GetNextListEntry(
} }
PVOID PVOID
NTAPI
GetListEntryData( GetListEntryData(
IN PGENERIC_LIST_ENTRY Entry) IN PGENERIC_LIST_ENTRY Entry)
{ {
@ -137,6 +145,7 @@ GetListEntryUiData(
} }
ULONG ULONG
NTAPI
GetNumberOfListEntries( GetNumberOfListEntries(
IN PGENERIC_LIST List) IN PGENERIC_LIST List)
{ {

View file

@ -24,37 +24,45 @@ typedef struct _GENERIC_LIST
PGENERIC_LIST PGENERIC_LIST
NTAPI
CreateGenericList(VOID); CreateGenericList(VOID);
VOID VOID
NTAPI
DestroyGenericList( DestroyGenericList(
IN OUT PGENERIC_LIST List, IN OUT PGENERIC_LIST List,
IN BOOLEAN FreeData); IN BOOLEAN FreeData);
BOOLEAN BOOLEAN
NTAPI
AppendGenericListEntry( AppendGenericListEntry(
IN OUT PGENERIC_LIST List, IN OUT PGENERIC_LIST List,
IN PVOID Data, IN PVOID Data,
IN BOOLEAN Current); IN BOOLEAN Current);
VOID VOID
NTAPI
SetCurrentListEntry( SetCurrentListEntry(
IN PGENERIC_LIST List, IN PGENERIC_LIST List,
IN PGENERIC_LIST_ENTRY Entry); IN PGENERIC_LIST_ENTRY Entry);
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetCurrentListEntry( GetCurrentListEntry(
IN PGENERIC_LIST List); IN PGENERIC_LIST List);
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetFirstListEntry( GetFirstListEntry(
IN PGENERIC_LIST List); IN PGENERIC_LIST List);
PGENERIC_LIST_ENTRY PGENERIC_LIST_ENTRY
NTAPI
GetNextListEntry( GetNextListEntry(
IN PGENERIC_LIST_ENTRY Entry); IN PGENERIC_LIST_ENTRY Entry);
PVOID PVOID
NTAPI
GetListEntryData( GetListEntryData(
IN PGENERIC_LIST_ENTRY Entry); IN PGENERIC_LIST_ENTRY Entry);
@ -63,6 +71,7 @@ GetListEntryUiData(
IN PGENERIC_LIST_ENTRY Entry); IN PGENERIC_LIST_ENTRY Entry);
ULONG ULONG
NTAPI
GetNumberOfListEntries( GetNumberOfListEntries(
IN PGENERIC_LIST List); IN PGENERIC_LIST List);

View file

@ -209,12 +209,16 @@ EnumerateInstallations(
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
/* /**
* FindSubStrI(PCWSTR str, PCWSTR strSearch) : * @brief
* Searches for a sub-string 'strSearch' inside 'str', similarly to what * Finds the first occurrence of a sub-string 'strSearch' inside 'str',
* wcsstr(str, strSearch) does, but ignores the case during the comparisons. * using case-insensitive comparisons.
*/ **/
PCWSTR FindSubStrI(PCWSTR str, PCWSTR strSearch) PCWSTR
NTAPI
FindSubStrI(
_In_ PCWSTR str,
_In_ PCWSTR strSearch)
{ {
PCWSTR cp = str; PCWSTR cp = str;
PCWSTR s1, s2; PCWSTR s1, s2;
@ -760,6 +764,7 @@ FindNTOSInstallations(
**/ **/
// EnumerateNTOSInstallations // EnumerateNTOSInstallations
PGENERIC_LIST PGENERIC_LIST
NTAPI
CreateNTOSInstallationsList( CreateNTOSInstallationsList(
_In_ PPARTLIST PartList) _In_ PPARTLIST PartList)
{ {

View file

@ -30,14 +30,14 @@ typedef struct _NTOS_INSTALLATION
// EnumerateNTOSInstallations // EnumerateNTOSInstallations
PGENERIC_LIST PGENERIC_LIST
NTAPI
CreateNTOSInstallationsList( CreateNTOSInstallationsList(
_In_ PPARTLIST PartList); _In_ PPARTLIST PartList);
/* PCWSTR
* FindSubStrI(PCWSTR str, PCWSTR strSearch) : NTAPI
* Searches for a sub-string 'strSearch' inside 'str', similarly to what FindSubStrI(
* wcsstr(str, strSearch) does, but ignores the case during the comparisons. _In_ PCWSTR str,
*/ _In_ PCWSTR strSearch);
PCWSTR FindSubStrI(PCWSTR str, PCWSTR strSearch);
/* EOF */ /* EOF */

View file

@ -16,7 +16,7 @@ typedef struct _MBR_PARTITION_TYPE
} MBR_PARTITION_TYPE, *PMBR_PARTITION_TYPE; } MBR_PARTITION_TYPE, *PMBR_PARTITION_TYPE;
#define NUM_MBR_PARTITION_TYPES 153 #define NUM_MBR_PARTITION_TYPES 153
extern const MBR_PARTITION_TYPE MbrPartitionTypes[NUM_MBR_PARTITION_TYPES]; extern SPLIBAPI const MBR_PARTITION_TYPE MbrPartitionTypes[NUM_MBR_PARTITION_TYPES];
/* GPT PARTITION TYPES ******************************************************/ /* GPT PARTITION TYPES ******************************************************/
@ -27,6 +27,6 @@ typedef struct _GPT_PARTITION_TYPE
} GPT_PARTITION_TYPE, *PGPT_PARTITION_TYPE; } GPT_PARTITION_TYPE, *PGPT_PARTITION_TYPE;
#define NUM_GPT_PARTITION_TYPES 177 #define NUM_GPT_PARTITION_TYPES 177
extern const GPT_PARTITION_TYPE GptPartitionTypes[NUM_GPT_PARTITION_TYPES]; extern SPLIBAPI const GPT_PARTITION_TYPE GptPartitionTypes[NUM_GPT_PARTITION_TYPES];
/* EOF */ /* EOF */

View file

@ -1984,6 +1984,7 @@ GetActiveDiskPartition(
} }
PPARTLIST PPARTLIST
NTAPI
CreatePartitionList(VOID) CreatePartitionList(VOID)
{ {
PPARTLIST List; PPARTLIST List;
@ -2069,6 +2070,7 @@ CreatePartitionList(VOID)
} }
VOID VOID
NTAPI
DestroyPartitionList( DestroyPartitionList(
IN PPARTLIST List) IN PPARTLIST List)
{ {
@ -2288,6 +2290,7 @@ SelectPartition(
} }
PPARTENTRY PPARTENTRY
NTAPI
GetNextPartition( GetNextPartition(
IN PPARTLIST List, IN PPARTLIST List,
IN PPARTENTRY CurrentPart OPTIONAL) IN PPARTENTRY CurrentPart OPTIONAL)
@ -2380,6 +2383,7 @@ GetNextPartition(
} }
PPARTENTRY PPARTENTRY
NTAPI
GetPrevPartition( GetPrevPartition(
IN PPARTLIST List, IN PPARTLIST List,
IN PPARTENTRY CurrentPart OPTIONAL) IN PPARTENTRY CurrentPart OPTIONAL)
@ -2783,6 +2787,7 @@ UpdateDiskLayout(
* @return The adjacent unpartitioned region, if it exists, or NULL. * @return The adjacent unpartitioned region, if it exists, or NULL.
**/ **/
PPARTENTRY PPARTENTRY
NTAPI
GetAdjUnpartitionedEntry( GetAdjUnpartitionedEntry(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ BOOLEAN Direction) _In_ BOOLEAN Direction)
@ -2872,6 +2877,7 @@ MBRPartitionCreateChecks(
} }
ERROR_NUMBER ERROR_NUMBER
NTAPI
PartitionCreateChecks( PartitionCreateChecks(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_opt_ ULONGLONG SizeBytes, _In_opt_ ULONGLONG SizeBytes,
@ -2900,6 +2906,7 @@ PartitionCreateChecks(
// (see VDS::CREATE_PARTITION_PARAMETERS and PPARTITION_INFORMATION_MBR/GPT for example) // (see VDS::CREATE_PARTITION_PARAMETERS and PPARTITION_INFORMATION_MBR/GPT for example)
// So far we only use it as the optional type of the partition to create. // So far we only use it as the optional type of the partition to create.
BOOLEAN BOOLEAN
NTAPI
CreatePartition( CreatePartition(
_In_ PPARTLIST List, _In_ PPARTLIST List,
_Inout_ PPARTENTRY PartEntry, _Inout_ PPARTENTRY PartEntry,
@ -2990,6 +2997,7 @@ DismountPartition(
} }
BOOLEAN BOOLEAN
NTAPI
DeletePartition( DeletePartition(
_In_ PPARTLIST List, _In_ PPARTLIST List,
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,

View file

@ -283,9 +283,11 @@ IsPartitionActive(
IN PPARTENTRY PartEntry); IN PPARTENTRY PartEntry);
PPARTLIST PPARTLIST
NTAPI
CreatePartitionList(VOID); CreatePartitionList(VOID);
VOID VOID
NTAPI
DestroyPartitionList( DestroyPartitionList(
IN PPARTLIST List); IN PPARTLIST List);
@ -323,27 +325,32 @@ SelectPartition(
_In_ ULONG PartitionNumber); _In_ ULONG PartitionNumber);
PPARTENTRY PPARTENTRY
NTAPI
GetNextPartition( GetNextPartition(
IN PPARTLIST List, IN PPARTLIST List,
IN PPARTENTRY CurrentPart OPTIONAL); IN PPARTENTRY CurrentPart OPTIONAL);
PPARTENTRY PPARTENTRY
NTAPI
GetPrevPartition( GetPrevPartition(
IN PPARTLIST List, IN PPARTLIST List,
IN PPARTENTRY CurrentPart OPTIONAL); IN PPARTENTRY CurrentPart OPTIONAL);
PPARTENTRY PPARTENTRY
NTAPI
GetAdjUnpartitionedEntry( GetAdjUnpartitionedEntry(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_ BOOLEAN Direction); _In_ BOOLEAN Direction);
ERROR_NUMBER ERROR_NUMBER
NTAPI
PartitionCreateChecks( PartitionCreateChecks(
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,
_In_opt_ ULONGLONG SizeBytes, _In_opt_ ULONGLONG SizeBytes,
_In_opt_ ULONG_PTR PartitionInfo); _In_opt_ ULONG_PTR PartitionInfo);
BOOLEAN BOOLEAN
NTAPI
CreatePartition( CreatePartition(
_In_ PPARTLIST List, _In_ PPARTLIST List,
_Inout_ PPARTENTRY PartEntry, _Inout_ PPARTENTRY PartEntry,
@ -351,6 +358,7 @@ CreatePartition(
_In_opt_ ULONG_PTR PartitionInfo); _In_opt_ ULONG_PTR PartitionInfo);
BOOLEAN BOOLEAN
NTAPI
DeletePartition( DeletePartition(
_In_ PPARTLIST List, _In_ PPARTLIST List,
_In_ PPARTENTRY PartEntry, _In_ PPARTENTRY PartEntry,

View file

@ -17,9 +17,10 @@ list(APPEND SOURCE
file(GLOB reactos_rc_deps res/*.*) file(GLOB reactos_rc_deps res/*.*)
add_rc_deps(reactos.rc ${reactos_rc_deps}) add_rc_deps(reactos.rc ${reactos_rc_deps})
add_executable(reactos ${SOURCE} reactos.rc) add_executable(reactos ${SOURCE} reactos.rc)
add_pch(reactos reactos.h SOURCE) add_pch(reactos reactos.h SOURCE)
set_module_type(reactos win32gui UNICODE) set_module_type(reactos win32gui UNICODE)
target_link_libraries(reactos uuid setuplib ext2lib vfatlib btrfslib ${PSEH_LIB}) target_link_libraries(reactos uuid)
target_link_libraries(reactos zlib_solo) ## We use USETUP's cabinet implementation target_link_libraries(reactos zlib_solo) ## We use USETUP's cabinet implementation
add_importlibs(reactos advapi32 gdi32 user32 comctl32 shlwapi setupapi msvcrt kernel32 ntdll) add_importlibs(reactos advapi32 gdi32 user32 comctl32 shlwapi setupapi setuplib msvcrt kernel32 ntdll)
add_cd_file(TARGET reactos DESTINATION reactos NO_CAB FOR bootcd) add_cd_file(TARGET reactos DESTINATION reactos NO_CAB FOR bootcd)

View file

@ -38,7 +38,6 @@
/* GLOBALS ******************************************************************/ /* GLOBALS ******************************************************************/
HANDLE ProcessHeap; HANDLE ProcessHeap;
BOOLEAN IsUnattendedSetup = FALSE;
SETUPDATA SetupData; SETUPDATA SetupData;
/* The partition where to perform the installation */ /* The partition where to perform the installation */
@ -2826,11 +2825,9 @@ _tWinMain(HINSTANCE hInst,
/* Initialize the NT to Win32 path prefix mapping list */ /* Initialize the NT to Win32 path prefix mapping list */
InitNtToWin32PathMappingList(&SetupData.MappingList); InitNtToWin32PathMappingList(&SetupData.MappingList);
/* Initialize Setup, phase 0 */ /* Initialize Setup */
InitializeSetup(&SetupData.USetupData, 0); Error = InitializeSetup(&SetupData.USetupData, NULL,
&SpFileExports, &SpInfExports);
/* Initialize Setup, phase 1 */
Error = InitializeSetup(&SetupData.USetupData, 1);
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
// //

View file

@ -163,8 +163,6 @@ typedef struct _SETUPDATA
} SETUPDATA, *PSETUPDATA; } SETUPDATA, *PSETUPDATA;
extern HANDLE ProcessHeap; extern HANDLE ProcessHeap;
extern BOOLEAN IsUnattendedSetup;
extern SETUPDATA SetupData; extern SETUPDATA SetupData;
extern PPARTENTRY InstallPartition; extern PPARTENTRY InstallPartition;

View file

@ -173,12 +173,15 @@ SpFileQueueRename_NtToWin32(
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
pSpFileQueueOpen SpFileQueueOpen = SetupOpenFileQueue; SPFILE_EXPORTS SpFileExports =
pSpFileQueueClose SpFileQueueClose = SetupCloseFileQueue; {
pSpFileQueueCopy SpFileQueueCopy = SpFileQueueCopy_NtToWin32; SetupOpenFileQueue,
pSpFileQueueDelete SpFileQueueDelete = SpFileQueueDelete_NtToWin32; SetupCloseFileQueue,
pSpFileQueueRename SpFileQueueRename = SpFileQueueRename_NtToWin32; SpFileQueueCopy_NtToWin32,
pSpFileQueueCommit SpFileQueueCommit = SetupCommitFileQueueW; SpFileQueueDelete_NtToWin32,
SpFileQueueRename_NtToWin32,
SetupCommitFileQueueW
};
#endif #endif

View file

@ -83,16 +83,19 @@ SetupOpenInfFileExW(
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
pSpInfCloseInfFile SpInfCloseInfFile = SetupCloseInfFile; SPINF_EXPORTS SpInfExports =
pSpInfFindFirstLine SpInfFindFirstLine = SetupFindFirstLineW; {
pSpInfFindNextLine SpInfFindNextLine = SetupFindNextLine; SetupCloseInfFile,
pSpInfGetFieldCount SpInfGetFieldCount = SetupGetFieldCount; SetupFindFirstLineW,
pSpInfGetBinaryField SpInfGetBinaryField = SetupGetBinaryField; SetupFindNextLine,
pSpInfGetIntField SpInfGetIntField = SetupGetIntField; SetupGetFieldCount,
pSpInfGetMultiSzField SpInfGetMultiSzField = SetupGetMultiSzFieldW; SetupGetBinaryField,
pSpInfGetStringField SpInfGetStringField = SetupGetStringFieldW; SetupGetIntField,
pSpInfGetField SpInfGetField = pSetupGetField; SetupGetMultiSzFieldW,
pSpInfOpenInfFile SpInfOpenInfFile = SetupOpenInfFileExW; SetupGetStringFieldW,
pSetupGetField,
SetupOpenInfFileExW
};
/* HELPER FUNCTIONS **********************************************************/ /* HELPER FUNCTIONS **********************************************************/

View file

@ -35,6 +35,6 @@ endif()
add_pch(usetup usetup.h SOURCE) add_pch(usetup usetup.h SOURCE)
set_module_type(usetup nativecui) set_module_type(usetup nativecui)
target_link_libraries(usetup inflib setuplib zlib_solo ext2lib vfatlib btrfslib chkstk ${PSEH_LIB}) target_link_libraries(usetup inflib zlib_solo chkstk)
add_importlibs(usetup ntdll) add_importlibs(usetup setuplib ntdll)
add_cd_file(TARGET usetup DESTINATION reactos/system32 NO_CAB NAME_ON_CD smss.exe FOR bootcd regtest) add_cd_file(TARGET usetup DESTINATION reactos/system32 NO_CAB NAME_ON_CD smss.exe FOR bootcd regtest)

View file

@ -997,11 +997,14 @@ Quit:
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
pSpFileQueueOpen SpFileQueueOpen = SetupOpenFileQueue; SPFILE_EXPORTS SpFileExports =
pSpFileQueueClose SpFileQueueClose = SetupCloseFileQueue; {
pSpFileQueueCopy SpFileQueueCopy = SetupQueueCopyWithCab; SetupOpenFileQueue,
pSpFileQueueDelete SpFileQueueDelete = SetupQueueDeleteW; SetupCloseFileQueue,
pSpFileQueueRename SpFileQueueRename = SetupQueueRenameW; SetupQueueCopyWithCab,
pSpFileQueueCommit SpFileQueueCommit = SetupCommitFileQueueW; SetupQueueDeleteW,
SetupQueueRenameW,
SetupCommitFileQueueW
};
/* EOF */ /* EOF */

View file

@ -228,16 +228,19 @@ SetupOpenInfFileExW(
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
pSpInfCloseInfFile SpInfCloseInfFile = SetupCloseInfFile; SPINF_EXPORTS SpInfExports =
pSpInfFindFirstLine SpInfFindFirstLine = SetupFindFirstLineW; {
pSpInfFindNextLine SpInfFindNextLine = SetupFindNextLine; SetupCloseInfFile,
pSpInfGetFieldCount SpInfGetFieldCount = SetupGetFieldCount; SetupFindFirstLineW,
pSpInfGetBinaryField SpInfGetBinaryField = SetupGetBinaryField; SetupFindNextLine,
pSpInfGetIntField SpInfGetIntField = SetupGetIntField; SetupGetFieldCount,
pSpInfGetMultiSzField SpInfGetMultiSzField = SetupGetMultiSzFieldW; SetupGetBinaryField,
pSpInfGetStringField SpInfGetStringField = SetupGetStringFieldW; SetupGetIntField,
pSpInfGetField SpInfGetField = pSetupGetField; SetupGetMultiSzFieldW,
pSpInfOpenInfFile SpInfOpenInfFile = SetupOpenInfFileExW; SetupGetStringFieldW,
pSetupGetField,
SetupOpenInfFileExW
};
/* HELPER FUNCTIONS **********************************************************/ /* HELPER FUNCTIONS **********************************************************/

View file

@ -40,7 +40,6 @@
/* GLOBALS & LOCALS *********************************************************/ /* GLOBALS & LOCALS *********************************************************/
HANDLE ProcessHeap; HANDLE ProcessHeap;
BOOLEAN IsUnattendedSetup = FALSE;
static USETUP_DATA USetupData; static USETUP_DATA USetupData;
@ -534,6 +533,28 @@ GetNTOSInstallationName(
} }
// PSETUP_ERROR_ROUTINE
static VOID
__cdecl
USetupErrorRoutine(
IN PUSETUP_DATA pSetupData,
...)
{
INPUT_RECORD Ir;
va_list arg_ptr;
va_start(arg_ptr, pSetupData);
if (pSetupData->LastErrorNumber >= ERROR_SUCCESS &&
pSetupData->LastErrorNumber < ERROR_LAST_ERROR_CODE)
{
// Note: the "POPUP_WAIT_ENTER" actually depends on the LastErrorNumber...
MUIDisplayErrorV(pSetupData->LastErrorNumber, &Ir, POPUP_WAIT_ENTER, arg_ptr);
}
va_end(arg_ptr);
}
/* /*
* Start page * Start page
* *
@ -566,8 +587,9 @@ SetupStartPage(PINPUT_RECORD Ir)
MUIDisplayPage(SETUP_INIT_PAGE); MUIDisplayPage(SETUP_INIT_PAGE);
/* Initialize Setup, phase 1 */ /* Initialize Setup */
Error = InitializeSetup(&USetupData, 1); Error = InitializeSetup(&USetupData, USetupErrorRoutine,
&SpFileExports, &SpInfExports);
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
MUIDisplayError(Error, Ir, POPUP_WAIT_ENTER); MUIDisplayError(Error, Ir, POPUP_WAIT_ENTER);
@ -3037,28 +3059,6 @@ InitInstallDir:
} }
// PSETUP_ERROR_ROUTINE
static VOID
__cdecl
USetupErrorRoutine(
IN PUSETUP_DATA pSetupData,
...)
{
INPUT_RECORD Ir;
va_list arg_ptr;
va_start(arg_ptr, pSetupData);
if (pSetupData->LastErrorNumber >= ERROR_SUCCESS &&
pSetupData->LastErrorNumber < ERROR_LAST_ERROR_CODE)
{
// Note: the "POPUP_WAIT_ENTER" actually depends on the LastErrorNumber...
MUIDisplayErrorV(pSetupData->LastErrorNumber, &Ir, POPUP_WAIT_ENTER, arg_ptr);
}
va_end(arg_ptr);
}
/* /*
* Displays the PrepareCopyPage. * Displays the PrepareCopyPage.
* *
@ -4034,10 +4034,6 @@ RunUSetup(VOID)
return STATUS_APP_INIT_FAILURE; return STATUS_APP_INIT_FAILURE;
} }
/* Initialize Setup, phase 0 */
InitializeSetup(&USetupData, 0);
USetupData.ErrorRoutine = USetupErrorRoutine;
/* Hide the cursor and clear the screen and keyboard buffer */ /* Hide the cursor and clear the screen and keyboard buffer */
CONSOLE_SetCursorType(TRUE, FALSE); CONSOLE_SetCursorType(TRUE, FALSE);
CONSOLE_ClearScreen(); CONSOLE_ClearScreen();

View file

@ -70,7 +70,6 @@
extern HANDLE ProcessHeap; extern HANDLE ProcessHeap;
extern BOOLEAN IsUnattendedSetup;
extern PCWSTR SelectedLanguageId; extern PCWSTR SelectedLanguageId;
typedef enum _PAGE_NUMBER typedef enum _PAGE_NUMBER

View file

@ -11,8 +11,7 @@ list(APPEND SOURCE
precomp.h) precomp.h)
add_executable(setuplib_unittest ${SOURCE}) add_executable(setuplib_unittest ${SOURCE})
target_link_libraries(setuplib_unittest setuplib ${PSEH_LIB})
set_module_type(setuplib_unittest win32cui) set_module_type(setuplib_unittest win32cui)
add_importlibs(setuplib_unittest msvcrt kernel32 ntdll) add_importlibs(setuplib_unittest setuplib msvcrt kernel32)
#add_pch(setuplib_unittest precomp.h SOURCE) #add_pch(setuplib_unittest precomp.h SOURCE)
add_rostests_file(TARGET setuplib_unittest) add_rostests_file(TARGET setuplib_unittest)

View file

@ -7,24 +7,8 @@
#include "precomp.h" #include "precomp.h"
// // SPFILE_EXPORTS SpFileExports = {NULL};
// FIXME: Temporary symbols defined to make linking work. // SPINF_EXPORTS SpInfExports = {NULL};
// They will be defined to something once INF file testing is implemented.
//
pSpInfCloseInfFile SpInfCloseInfFile = NULL;
pSpInfFindFirstLine SpInfFindFirstLine = NULL;
pSpInfFindNextLine SpInfFindNextLine = NULL;
pSpInfGetFieldCount SpInfGetFieldCount = NULL;
pSpInfGetBinaryField SpInfGetBinaryField = NULL;
pSpInfGetIntField SpInfGetIntField = NULL;
pSpInfGetMultiSzField SpInfGetMultiSzField = NULL;
pSpInfGetStringField SpInfGetStringField = NULL;
pSpInfGetField SpInfGetField = NULL;
pSpInfOpenInfFile SpInfOpenInfFile = NULL;
BOOLEAN IsUnattendedSetup = FALSE;
HANDLE ProcessHeap;
START_TEST(IsValidInstallDirectory) START_TEST(IsValidInstallDirectory)
{ {
@ -93,8 +77,6 @@ START_TEST(IsValidInstallDirectory)
#define BOOL_TO_STR(b) ((b) ? "TRUE" : "FALSE") #define BOOL_TO_STR(b) ((b) ? "TRUE" : "FALSE")
ProcessHeap = GetProcessHeap();
UINT i; UINT i;
for (i = 0; i < _countof(tests); ++i) for (i = 0; i < _countof(tests); ++i)
{ {