mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[FREELDR]
* Use the FrLdr prefix with the heap functions to avoid any ambiguities. svn path=/trunk/; revision=60654
This commit is contained in:
parent
cdb62c6244
commit
48f8139061
|
@ -866,7 +866,9 @@ BOOLEAN Ext2ReadPartialBlock(ULONG BlockNumber, ULONG StartingOffset, ULONG Leng
|
|||
|
||||
TRACE("Ext2ReadPartialBlock() BlockNumber = %d StartingOffset = %d Length = %d Buffer = 0x%x\n", BlockNumber, StartingOffset, Length, Buffer);
|
||||
|
||||
TempBuffer = HeapAllocate(FrLdrTempHeap, Ext2BlockSizeInBytes, '2TXE');
|
||||
TempBuffer = FrLdrHeapAllocate(FrLdrTempHeap,
|
||||
Ext2BlockSizeInBytes,
|
||||
'2TXE');
|
||||
|
||||
if (!Ext2ReadBlock(BlockNumber, TempBuffer))
|
||||
{
|
||||
|
@ -875,7 +877,7 @@ BOOLEAN Ext2ReadPartialBlock(ULONG BlockNumber, ULONG StartingOffset, ULONG Leng
|
|||
|
||||
memcpy(Buffer, ((PUCHAR)TempBuffer + StartingOffset), Length);
|
||||
|
||||
HeapFree(FrLdrTempHeap, TempBuffer, '2TXE');
|
||||
FrLdrHeapFree(FrLdrTempHeap, TempBuffer, '2TXE');
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1098,9 +1100,9 @@ BOOLEAN Ext2CopyIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBlockInLis
|
|||
|
||||
BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG);
|
||||
|
||||
BlockBuffer = HeapAllocate(FrLdrTempHeap,
|
||||
Ext2BlockSizeInBytes,
|
||||
'2TXE');
|
||||
BlockBuffer = FrLdrHeapAllocate(FrLdrTempHeap,
|
||||
Ext2BlockSizeInBytes,
|
||||
'2TXE');
|
||||
if (!BlockBuffer)
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -1117,7 +1119,7 @@ BOOLEAN Ext2CopyIndirectBlockPointers(ULONG* BlockList, ULONG* CurrentBlockInLis
|
|||
(*CurrentBlockInList)++;
|
||||
}
|
||||
|
||||
HeapFree(FrLdrTempHeap, BlockBuffer, '2TXE');
|
||||
FrLdrHeapFree(FrLdrTempHeap, BlockBuffer, '2TXE');
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -911,7 +911,9 @@ BOOLEAN FatGetFatEntry(PFAT_VOLUME_INFO Volume, ULONG Cluster, ULONG* ClusterPoi
|
|||
//TRACE("FatGetFatEntry() Retrieving FAT entry for cluster %d.\n", Cluster);
|
||||
|
||||
// We need a buffer for 2 secors
|
||||
ReadBuffer = HeapAllocate(FrLdrTempHeap, 2 * Volume->BytesPerSector, 'xTAF');
|
||||
ReadBuffer = FrLdrHeapAllocate(FrLdrTempHeap,
|
||||
2 * Volume->BytesPerSector,
|
||||
'xTAF');
|
||||
if (!ReadBuffer)
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -997,7 +999,7 @@ BOOLEAN FatGetFatEntry(PFAT_VOLUME_INFO Volume, ULONG Cluster, ULONG* ClusterPoi
|
|||
|
||||
//TRACE("FAT entry is 0x%x.\n", fat);
|
||||
|
||||
HeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
|
||||
FrLdrHeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
|
||||
|
||||
*ClusterPointer = fat;
|
||||
|
||||
|
@ -1181,7 +1183,7 @@ BOOLEAN FatReadPartialCluster(PFAT_VOLUME_INFO Volume, ULONG ClusterNumber, ULON
|
|||
// Calculate rounded up read size
|
||||
ReadSize = SectorCount * Volume->BytesPerSector;
|
||||
|
||||
ReadBuffer = HeapAllocate(FrLdrTempHeap, ReadSize, 'xTAF');
|
||||
ReadBuffer = FrLdrHeapAllocate(FrLdrTempHeap, ReadSize, 'xTAF');
|
||||
if (!ReadBuffer)
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -1193,7 +1195,7 @@ BOOLEAN FatReadPartialCluster(PFAT_VOLUME_INFO Volume, ULONG ClusterNumber, ULON
|
|||
status = TRUE;
|
||||
}
|
||||
|
||||
HeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
|
||||
FrLdrHeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -125,34 +125,33 @@ extern PVOID FrLdrDefaultHeap;
|
|||
extern PVOID FrLdrTempHeap;
|
||||
|
||||
PVOID
|
||||
HeapCreate(
|
||||
FrLdrHeapCreate(
|
||||
SIZE_T MaximumSize,
|
||||
TYPE_OF_MEMORY MemoryType);
|
||||
|
||||
VOID
|
||||
HeapDestroy(
|
||||
FrLdrHeapDestroy(
|
||||
PVOID HeapHandle);
|
||||
|
||||
VOID
|
||||
HeapRelease(
|
||||
FrLdrHeapRelease(
|
||||
PVOID HeapHandle);
|
||||
|
||||
VOID
|
||||
HeapVerify(
|
||||
FrLdrHeapVerify(
|
||||
PVOID HeapHandle);
|
||||
|
||||
VOID
|
||||
HeapCleanupAll(VOID);
|
||||
FrLdrHeapCleanupAll(VOID);
|
||||
|
||||
PVOID
|
||||
HeapAllocate(
|
||||
FrLdrHeapAllocate(
|
||||
PVOID HeapHandle,
|
||||
SIZE_T ByteSize,
|
||||
ULONG Tag);
|
||||
|
||||
VOID
|
||||
HeapFree(
|
||||
FrLdrHeapFree(
|
||||
PVOID HeapHandle,
|
||||
PVOID Pointer,
|
||||
ULONG Tag);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ typedef struct _HEAP
|
|||
} HEAP, *PHEAP;
|
||||
|
||||
PVOID
|
||||
HeapCreate(
|
||||
FrLdrHeapCreate(
|
||||
SIZE_T MaximumSize,
|
||||
TYPE_OF_MEMORY MemoryType)
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ HeapCreate(
|
|||
}
|
||||
|
||||
VOID
|
||||
HeapDestroy(
|
||||
FrLdrHeapDestroy(
|
||||
PVOID HeapHandle)
|
||||
{
|
||||
PHEAP Heap = HeapHandle;
|
||||
|
@ -151,7 +151,7 @@ HeapDestroy(
|
|||
|
||||
#ifdef FREELDR_HEAP_VERIFIER
|
||||
VOID
|
||||
HeapVerify(
|
||||
FrLdrHeapVerify(
|
||||
PVOID HeapHandle)
|
||||
{
|
||||
PHEAP Heap = HeapHandle;
|
||||
|
@ -176,7 +176,7 @@ HeapVerify(
|
|||
#endif /* FREELDR_HEAP_VERIFIER */
|
||||
|
||||
VOID
|
||||
HeapRelease(
|
||||
FrLdrHeapRelease(
|
||||
PVOID HeapHandle)
|
||||
{
|
||||
PHEAP Heap = HeapHandle;
|
||||
|
@ -242,7 +242,7 @@ HeapRelease(
|
|||
}
|
||||
|
||||
VOID
|
||||
HeapCleanupAll(VOID)
|
||||
FrLdrHeapCleanupAll(VOID)
|
||||
{
|
||||
PHEAP Heap;
|
||||
|
||||
|
@ -257,7 +257,7 @@ HeapCleanupAll(VOID)
|
|||
|
||||
|
||||
/* Release fre pages */
|
||||
HeapRelease(FrLdrDefaultHeap);
|
||||
FrLdrHeapRelease(FrLdrDefaultHeap);
|
||||
|
||||
Heap = FrLdrTempHeap;
|
||||
TRACE("Heap statistics for temp heap:\n"
|
||||
|
@ -267,11 +267,11 @@ HeapCleanupAll(VOID)
|
|||
Heap->NumAllocs, Heap->NumFrees);
|
||||
|
||||
/* Destroy the heap */
|
||||
HeapDestroy(FrLdrTempHeap);
|
||||
FrLdrHeapDestroy(FrLdrTempHeap);
|
||||
}
|
||||
|
||||
static VOID
|
||||
HeapRemoveFreeList(
|
||||
FrLdrHeapRemoveFreeList(
|
||||
PHEAP Heap,
|
||||
PHEAP_BLOCK Block)
|
||||
{
|
||||
|
@ -289,7 +289,7 @@ HeapRemoveFreeList(
|
|||
}
|
||||
|
||||
static VOID
|
||||
HeapInsertFreeList(
|
||||
FrLdrHeapInsertFreeList(
|
||||
PHEAP Heap,
|
||||
PHEAP_BLOCK FreeBlock)
|
||||
{
|
||||
|
@ -311,7 +311,7 @@ HeapInsertFreeList(
|
|||
}
|
||||
|
||||
PVOID
|
||||
HeapAllocate(
|
||||
FrLdrHeapAllocate(
|
||||
PVOID HeapHandle,
|
||||
SIZE_T ByteSize,
|
||||
ULONG Tag)
|
||||
|
@ -323,7 +323,7 @@ HeapAllocate(
|
|||
|
||||
#ifdef FREELDR_HEAP_VERIFIER
|
||||
/* Verify the heap */
|
||||
HeapVerify(HeapHandle);
|
||||
FrLdrHeapVerify(HeapHandle);
|
||||
|
||||
/* Add space for a size field and 2 redzones */
|
||||
ByteSize += REDZONE_ALLOCATION;
|
||||
|
@ -357,7 +357,7 @@ HeapAllocate(
|
|||
Block->Tag = Tag;
|
||||
|
||||
/* Remove this entry from the free list */
|
||||
HeapRemoveFreeList(Heap, Block);
|
||||
FrLdrHeapRemoveFreeList(Heap, Block);
|
||||
|
||||
/* Calculate the remaining size */
|
||||
Remaining = Block->Size - BlockSize;
|
||||
|
@ -376,7 +376,7 @@ HeapAllocate(
|
|||
NextBlock->Size = Remaining - 1;
|
||||
NextBlock->PreviousSize = BlockSize;
|
||||
BlockSize = NextBlock->Size;
|
||||
HeapInsertFreeList(Heap, NextBlock);
|
||||
FrLdrHeapInsertFreeList(Heap, NextBlock);
|
||||
|
||||
/* Advance to the next block */
|
||||
NextBlock = NextBlock + 1 + BlockSize;
|
||||
|
@ -426,7 +426,7 @@ HeapAllocate(
|
|||
}
|
||||
|
||||
VOID
|
||||
HeapFree(
|
||||
FrLdrHeapFree(
|
||||
PVOID HeapHandle,
|
||||
PVOID Pointer,
|
||||
ULONG Tag)
|
||||
|
@ -439,7 +439,7 @@ HeapFree(
|
|||
|
||||
#ifdef FREELDR_HEAP_VERIFIER
|
||||
/* Verify the heap */
|
||||
HeapVerify(HeapHandle);
|
||||
FrLdrHeapVerify(HeapHandle);
|
||||
#endif
|
||||
|
||||
/* Check if the block is really inside this heap */
|
||||
|
@ -485,7 +485,7 @@ HeapFree(
|
|||
{
|
||||
/* Merge next block into current */
|
||||
Block->Size += NextBlock->Size + 1;
|
||||
HeapRemoveFreeList(Heap, NextBlock);
|
||||
FrLdrHeapRemoveFreeList(Heap, NextBlock);
|
||||
|
||||
NextBlock = Block + Block->Size + 1;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ HeapFree(
|
|||
else
|
||||
{
|
||||
/* Insert the entry into the free list */
|
||||
HeapInsertFreeList(Heap, Block);
|
||||
FrLdrHeapInsertFreeList(Heap, Block);
|
||||
}
|
||||
|
||||
/* Update the next block's back link */
|
||||
|
@ -519,11 +519,11 @@ MmInitializeHeap(PVOID PageLookupTable)
|
|||
TRACE("MmInitializeHeap()\n");
|
||||
|
||||
/* Create the default heap */
|
||||
FrLdrDefaultHeap = HeapCreate(DEFAULT_HEAP_SIZE, LoaderOsloaderHeap);
|
||||
FrLdrDefaultHeap = FrLdrHeapCreate(DEFAULT_HEAP_SIZE, LoaderOsloaderHeap);
|
||||
ASSERT(FrLdrDefaultHeap);
|
||||
|
||||
/* Create a temporary heap */
|
||||
FrLdrTempHeap = HeapCreate(TEMP_HEAP_SIZE, LoaderFirmwareTemporary);
|
||||
FrLdrTempHeap = FrLdrHeapCreate(TEMP_HEAP_SIZE, LoaderFirmwareTemporary);
|
||||
ASSERT(FrLdrTempHeap);
|
||||
|
||||
TRACE("MmInitializeHeap() done, default heap %p, temp heap %p\n",
|
||||
|
@ -533,13 +533,13 @@ MmInitializeHeap(PVOID PageLookupTable)
|
|||
PVOID
|
||||
MmHeapAlloc(SIZE_T MemorySize)
|
||||
{
|
||||
return HeapAllocate(FrLdrDefaultHeap, MemorySize, 'pHmM');
|
||||
return FrLdrHeapAllocate(FrLdrDefaultHeap, MemorySize, 'pHmM');
|
||||
}
|
||||
|
||||
VOID
|
||||
MmHeapFree(PVOID MemoryPointer)
|
||||
{
|
||||
HeapFree(FrLdrDefaultHeap, MemoryPointer, 'pHmM');
|
||||
FrLdrHeapFree(FrLdrDefaultHeap, MemoryPointer, 'pHmM');
|
||||
}
|
||||
|
||||
PVOID
|
||||
|
@ -549,7 +549,7 @@ ExAllocatePoolWithTag(
|
|||
IN SIZE_T NumberOfBytes,
|
||||
IN ULONG Tag)
|
||||
{
|
||||
return HeapAllocate(FrLdrDefaultHeap, NumberOfBytes, Tag);
|
||||
return FrLdrHeapAllocate(FrLdrDefaultHeap, NumberOfBytes, Tag);
|
||||
}
|
||||
|
||||
PVOID
|
||||
|
@ -558,7 +558,7 @@ ExAllocatePool(
|
|||
IN POOL_TYPE PoolType,
|
||||
IN SIZE_T NumberOfBytes)
|
||||
{
|
||||
return HeapAllocate(FrLdrDefaultHeap, NumberOfBytes, 0);
|
||||
return FrLdrHeapAllocate(FrLdrDefaultHeap, NumberOfBytes, 0);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -566,7 +566,7 @@ NTAPI
|
|||
ExFreePool(
|
||||
IN PVOID P)
|
||||
{
|
||||
HeapFree(FrLdrDefaultHeap, P, 0);
|
||||
FrLdrHeapFree(FrLdrDefaultHeap, P, 0);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -575,7 +575,7 @@ ExFreePoolWithTag(
|
|||
IN PVOID P,
|
||||
IN ULONG Tag)
|
||||
{
|
||||
HeapFree(FrLdrDefaultHeap, P, Tag);
|
||||
FrLdrHeapFree(FrLdrDefaultHeap, P, Tag);
|
||||
}
|
||||
|
||||
PVOID
|
||||
|
@ -587,7 +587,7 @@ RtlAllocateHeap(
|
|||
{
|
||||
PVOID ptr;
|
||||
|
||||
ptr = HeapAllocate(FrLdrDefaultHeap, Size, ' ltR');
|
||||
ptr = FrLdrHeapAllocate(FrLdrDefaultHeap, Size, ' ltR');
|
||||
if (ptr && (Flags & HEAP_ZERO_MEMORY))
|
||||
{
|
||||
RtlZeroMemory(ptr, Size);
|
||||
|
@ -603,7 +603,6 @@ RtlFreeHeap(
|
|||
IN ULONG Flags,
|
||||
IN PVOID HeapBase)
|
||||
{
|
||||
HeapFree(FrLdrDefaultHeap, HeapBase, ' ltR');
|
||||
FrLdrHeapFree(FrLdrDefaultHeap, HeapBase, ' ltR');
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,9 +144,9 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
PARC_DISK_SIGNATURE_EX ArcDiskSig;
|
||||
|
||||
/* Allocate the ARC structure */
|
||||
ArcDiskSig = HeapAllocate(FrLdrDefaultHeap,
|
||||
sizeof(ARC_DISK_SIGNATURE_EX),
|
||||
'giSD');
|
||||
ArcDiskSig = FrLdrHeapAllocate(FrLdrDefaultHeap,
|
||||
sizeof(ARC_DISK_SIGNATURE_EX),
|
||||
'giSD');
|
||||
|
||||
/* Copy the data over */
|
||||
ArcDiskSig->DiskSignature.Signature = reactos_arc_disk_info[i].Signature;
|
||||
|
|
|
@ -188,7 +188,7 @@ WinLdrSetupMemoryLayout(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
//BOOLEAN Status;
|
||||
|
||||
/* Cleanup heap */
|
||||
HeapCleanupAll();
|
||||
FrLdrHeapCleanupAll();
|
||||
|
||||
//
|
||||
// Creating a suitable memory map for Windows can be tricky, so let's
|
||||
|
|
Loading…
Reference in a new issue