Author: akhaldi
Date: Sun Oct 13 23:14:40 2013
New Revision: 60654
URL:
http://svn.reactos.org/svn/reactos?rev=60654&view=rev
Log:
[FREELDR]
* Use the FrLdr prefix with the heap functions to avoid any ambiguities.
Modified:
trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
trunk/reactos/boot/freeldr/freeldr/fs/fat.c
trunk/reactos/boot/freeldr/freeldr/include/mm.h
trunk/reactos/boot/freeldr/freeldr/mm/heap.c
trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c
Modified: trunk/reactos/boot/freeldr/freeldr/fs/ext2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/ex…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Sun Oct 13 23:14:40 2013
@@ -866,7 +866,9 @@
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 @@
memcpy(Buffer, ((PUCHAR)TempBuffer + StartingOffset), Length);
- HeapFree(FrLdrTempHeap, TempBuffer, '2TXE');
+ FrLdrHeapFree(FrLdrTempHeap, TempBuffer, '2TXE');
return TRUE;
}
@@ -1098,9 +1100,9 @@
BlockPointersPerBlock = Ext2BlockSizeInBytes / sizeof(ULONG);
- BlockBuffer = HeapAllocate(FrLdrTempHeap,
- Ext2BlockSizeInBytes,
- '2TXE');
+ BlockBuffer = FrLdrHeapAllocate(FrLdrTempHeap,
+ Ext2BlockSizeInBytes,
+ '2TXE');
if (!BlockBuffer)
{
return FALSE;
@@ -1117,7 +1119,7 @@
(*CurrentBlockInList)++;
}
- HeapFree(FrLdrTempHeap, BlockBuffer, '2TXE');
+ FrLdrHeapFree(FrLdrTempHeap, BlockBuffer, '2TXE');
return TRUE;
}
Modified: trunk/reactos/boot/freeldr/freeldr/fs/fat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fa…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] Sun Oct 13 23:14:40 2013
@@ -911,7 +911,9 @@
//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 @@
//TRACE("FAT entry is 0x%x.\n", fat);
- HeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
+ FrLdrHeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
*ClusterPointer = fat;
@@ -1181,7 +1183,7 @@
// 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 @@
status = TRUE;
}
- HeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
+ FrLdrHeapFree(FrLdrTempHeap, ReadBuffer, 'xTAF');
return status;
}
Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Sun Oct 13 23:14:40 2013
@@ -125,34 +125,33 @@
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);
-
Modified: trunk/reactos/boot/freeldr/freeldr/mm/heap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/he…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/mm/heap.c [iso-8859-1] Sun Oct 13 23:14:40 2013
@@ -66,7 +66,7 @@
} HEAP, *PHEAP;
PVOID
-HeapCreate(
+FrLdrHeapCreate(
SIZE_T MaximumSize,
TYPE_OF_MEMORY MemoryType)
{
@@ -137,7 +137,7 @@
}
VOID
-HeapDestroy(
+FrLdrHeapDestroy(
PVOID HeapHandle)
{
PHEAP Heap = HeapHandle;
@@ -151,7 +151,7 @@
#ifdef FREELDR_HEAP_VERIFIER
VOID
-HeapVerify(
+FrLdrHeapVerify(
PVOID HeapHandle)
{
PHEAP Heap = HeapHandle;
@@ -176,7 +176,7 @@
#endif /* FREELDR_HEAP_VERIFIER */
VOID
-HeapRelease(
+FrLdrHeapRelease(
PVOID HeapHandle)
{
PHEAP Heap = HeapHandle;
@@ -242,7 +242,7 @@
}
VOID
-HeapCleanupAll(VOID)
+FrLdrHeapCleanupAll(VOID)
{
PHEAP Heap;
@@ -257,7 +257,7 @@
/* Release fre pages */
- HeapRelease(FrLdrDefaultHeap);
+ FrLdrHeapRelease(FrLdrDefaultHeap);
Heap = FrLdrTempHeap;
TRACE("Heap statistics for temp heap:\n"
@@ -267,11 +267,11 @@
Heap->NumAllocs, Heap->NumFrees);
/* Destroy the heap */
- HeapDestroy(FrLdrTempHeap);
+ FrLdrHeapDestroy(FrLdrTempHeap);
}
static VOID
-HeapRemoveFreeList(
+FrLdrHeapRemoveFreeList(
PHEAP Heap,
PHEAP_BLOCK Block)
{
@@ -289,7 +289,7 @@
}
static VOID
-HeapInsertFreeList(
+FrLdrHeapInsertFreeList(
PHEAP Heap,
PHEAP_BLOCK FreeBlock)
{
@@ -311,7 +311,7 @@
}
PVOID
-HeapAllocate(
+FrLdrHeapAllocate(
PVOID HeapHandle,
SIZE_T ByteSize,
ULONG Tag)
@@ -323,7 +323,7 @@
#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 @@
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 @@
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 @@
}
VOID
-HeapFree(
+FrLdrHeapFree(
PVOID HeapHandle,
PVOID Pointer,
ULONG Tag)
@@ -439,7 +439,7 @@
#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 @@
{
/* 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 @@
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 @@
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 @@
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 @@
IN SIZE_T NumberOfBytes,
IN ULONG Tag)
{
- return HeapAllocate(FrLdrDefaultHeap, NumberOfBytes, Tag);
+ return FrLdrHeapAllocate(FrLdrDefaultHeap, NumberOfBytes, Tag);
}
PVOID
@@ -558,7 +558,7 @@
IN POOL_TYPE PoolType,
IN SIZE_T NumberOfBytes)
{
- return HeapAllocate(FrLdrDefaultHeap, NumberOfBytes, 0);
+ return FrLdrHeapAllocate(FrLdrDefaultHeap, NumberOfBytes, 0);
}
VOID
@@ -566,7 +566,7 @@
ExFreePool(
IN PVOID P)
{
- HeapFree(FrLdrDefaultHeap, P, 0);
+ FrLdrHeapFree(FrLdrDefaultHeap, P, 0);
}
VOID
@@ -575,7 +575,7 @@
IN PVOID P,
IN ULONG Tag)
{
- HeapFree(FrLdrDefaultHeap, P, Tag);
+ FrLdrHeapFree(FrLdrDefaultHeap, P, Tag);
}
PVOID
@@ -587,7 +587,7 @@
{
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 @@
IN ULONG Flags,
IN PVOID HeapBase)
{
- HeapFree(FrLdrDefaultHeap, HeapBase, ' ltR');
+ FrLdrHeapFree(FrLdrDefaultHeap, HeapBase, ' ltR');
return TRUE;
}
-
Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Sun Oct 13 23:14:40
2013
@@ -144,9 +144,9 @@
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;
Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Sun Oct 13 23:14:40
2013
@@ -188,7 +188,7 @@
//BOOLEAN Status;
/* Cleanup heap */
- HeapCleanupAll();
+ FrLdrHeapCleanupAll();
//
// Creating a suitable memory map for Windows can be tricky, so let's