diff --git a/reactos/boot/freeldr/freeldr/arch/archwsup.c b/reactos/boot/freeldr/freeldr/arch/archwsup.c index c1ea8986f5e..14c08c293b1 100644 --- a/reactos/boot/freeldr/freeldr/arch/archwsup.c +++ b/reactos/boot/freeldr/freeldr/arch/archwsup.c @@ -22,24 +22,16 @@ ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]; /* FUNCTIONS ******************************************************************/ -#define TAG_HW_COMPONENT_DATA 'DCwH' -#define TAG_HW_NAME 'mNwH' +#define TAG_HW_COMPONENT_DATA 'DCwH' +#define TAG_HW_NAME 'mNwH' -PVOID -NTAPI -FldrpHwHeapAlloc(IN SIZE_T Size) -{ - /* Allocate memory from generic bootloader heap */ - return FrLdrHeapAlloc(Size, 'pHwH'); -} - -static VOID +VOID NTAPI FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString) { - SIZE_T IdentifierLength; PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; + SIZE_T IdentifierLength; PCHAR Identifier; /* Allocate memory for the identifier */ @@ -55,6 +47,17 @@ FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, Component->Identifier = Identifier; } +VOID +NTAPI +FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size) +{ + /* Set component information */ + ComponentData->ConfigurationData = ResourceList; + ComponentData->ComponentEntry.ConfigurationDataLength = Size; +} + VOID NTAPI FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode) @@ -155,10 +158,7 @@ FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, /* Set configuration data */ if (ResourceList) - { - ComponentData->ConfigurationData = ResourceList; - ComponentData->ComponentEntry.ConfigurationDataLength = Size; - } + FldrSetConfigurationData(ComponentData, ResourceList, Size); /* Return the child */ *ComponentKey = ComponentData; diff --git a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c index ff5f6e48814..8bf927d1b91 100644 --- a/reactos/boot/freeldr/freeldr/arch/arm/macharm.c +++ b/reactos/boot/freeldr/freeldr/arch/arm/macharm.c @@ -97,8 +97,7 @@ ArmPrepareForReactOS(IN BOOLEAN Setup) } BOOLEAN -ArmDiskGetBootPath(OUT PCHAR BootPath, - IN unsigned Size) +ArmDiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size) { PCCH Path = "ramdisk(0)"; diff --git a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c index d73f9e7d857..f6055cca3a9 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/pcdisk.c @@ -386,7 +386,7 @@ PcDiskGetCacheableBlockCount(UCHAR DriveNumber) } BOOLEAN -PcDiskGetBootPath(char *BootPath, unsigned Size) +PcDiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size) { // FIXME: Keep it there, or put it in DiskGetBootPath? // Or, abstract the notion of network booting to make diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c index be8cf7e840a..552b75fd056 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -247,7 +247,7 @@ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, return slots; } -BOOLEAN PpcDiskGetBootPath( char *OutBootPath, unsigned Size ) { +BOOLEAN PpcDiskGetBootPath(PCHAR OutBootPath, ULONG Size) { strncpy( OutBootPath, BootPath, Size ); return TRUE; } diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index 79c014d5f0f..4cdf12f7f5a 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -102,7 +102,7 @@ BOOLEAN DiskIsDriveRemovable(UCHAR DriveNumber) } BOOLEAN -DiskGetBootPath(char *BootPath, unsigned Size) +DiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size) { static char Path[] = "multi(0)disk(0)"; char Device[4]; diff --git a/reactos/boot/freeldr/freeldr/include/arch/archwsup.h b/reactos/boot/freeldr/freeldr/include/arch/archwsup.h index 226d573fe48..2fe5edc1a80 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/archwsup.h +++ b/reactos/boot/freeldr/freeldr/include/arch/archwsup.h @@ -25,6 +25,21 @@ // // ARC Component Configuration Routines // +VOID +NTAPI +FldrSetIdentifier( + IN PCONFIGURATION_COMPONENT_DATA ComponentData, + IN PCHAR IdentifierString +); + +VOID +NTAPI +FldrSetConfigurationData( + IN PCONFIGURATION_COMPONENT_DATA ComponentData, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, + IN ULONG Size +); + VOID NTAPI FldrCreateSystemKey( diff --git a/reactos/boot/freeldr/freeldr/include/disk.h b/reactos/boot/freeldr/freeldr/include/disk.h index 1e0e0b02f83..330fc21e1fe 100644 --- a/reactos/boot/freeldr/freeldr/include/disk.h +++ b/reactos/boot/freeldr/freeldr/include/disk.h @@ -135,7 +135,7 @@ extern ULONG FrldrBootPartition; extern PVOID DiskReadBuffer; extern SIZE_T DiskReadBufferSize; -BOOLEAN DiskGetBootPath(char *BootPath, unsigned Size); +BOOLEAN DiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size); /////////////////////////////////////////////////////////////////////////////////////// diff --git a/reactos/boot/freeldr/freeldr/include/machine.h b/reactos/boot/freeldr/freeldr/include/machine.h index 9a8a52a20d8..c104036a489 100644 --- a/reactos/boot/freeldr/freeldr/include/machine.h +++ b/reactos/boot/freeldr/freeldr/include/machine.h @@ -61,7 +61,7 @@ typedef struct tagMACHVTBL FREELDR_MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(FREELDR_MEMORY_DESCRIPTOR* Current); PFREELDR_MEMORY_DESCRIPTOR (*GetMemoryMap)(PULONG MaxMemoryMapSize); - BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size); + BOOLEAN (*DiskGetBootPath)(PCHAR BootPath, ULONG Size); BOOLEAN (*DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOLEAN (*DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry); ULONG (*DiskGetCacheableBlockCount)(UCHAR DriveNumber);