Author: fireball
Date: Sun Jan 13 18:17:54 2008
New Revision: 31762
URL:
http://svn.reactos.org/svn/reactos?rev=31762&view=rev
Log:
- Use new APIs MmHeapAlloc / MmHeapFree for small and discardable memory allocations (not
everywhere yet). There is currently no difference, since they all point to the same old
memory allocator.
- Include bget.h to freeldr.h.
Modified:
trunk/reactos/boot/freeldr/freeldr/fs/fat.c
trunk/reactos/boot/freeldr/freeldr/fs/iso.c
trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c
trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c
trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c
trunk/reactos/boot/freeldr/freeldr/inifile/parse.c
trunk/reactos/boot/freeldr/freeldr/mm/mm.c
trunk/reactos/boot/freeldr/freeldr/oslist.c
trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
trunk/reactos/boot/freeldr/freeldr/reactos/registry.c
trunk/reactos/boot/freeldr/freeldr/rtl/libsupp.c
trunk/reactos/boot/freeldr/freeldr/ui/tui.c
trunk/reactos/boot/freeldr/freeldr/ui/ui.c
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 (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/fat.c Sun Jan 13 18:17:54 2008
@@ -131,7 +131,7 @@
//
// Allocate the memory to hold the boot sector
//
- FatVolumeBootSector = (PFAT_BOOTSECTOR) MmAllocateMemory(512);
+ FatVolumeBootSector = (PFAT_BOOTSECTOR) MmHeapAlloc(512);
Fat32VolumeBootSector = (PFAT32_BOOTSECTOR) FatVolumeBootSector;
FatXVolumeBootSector = (PFATX_BOOTSECTOR) FatVolumeBootSector;
@@ -148,7 +148,7 @@
// If this fails then abort
if (!MachDiskReadLogicalSectors(DriveNumber, VolumeStartSector, 1,
(PVOID)DISKREADBUFFER))
{
- MmFreeMemory(FatVolumeBootSector);
+ MmHeapFree(FatVolumeBootSector);
return FALSE;
}
RtlCopyMemory(FatVolumeBootSector, (PVOID)DISKREADBUFFER, 512);
@@ -247,7 +247,7 @@
sprintf(ErrMsg, "Invalid boot sector magic on drive 0x%x (expected 0xaa55 found
0x%x)",
DriveNumber, FatVolumeBootSector->BootSectorMagic);
FileSystemError(ErrMsg);
- MmFreeMemory(FatVolumeBootSector);
+ MmHeapFree(FatVolumeBootSector);
return FALSE;
}
@@ -259,7 +259,7 @@
(! ISFATX(FatType) && 64 * 1024 <
FatVolumeBootSector->SectorsPerCluster * FatVolumeBootSector->BytesPerSector))
{
FileSystemError("This file system has cluster sizes bigger than 64k.\nFreeLoader
does not support this.");
- MmFreeMemory(FatVolumeBootSector);
+ MmHeapFree(FatVolumeBootSector);
return FALSE;
}
@@ -332,7 +332,7 @@
return FALSE;
}
}
- MmFreeMemory(FatVolumeBootSector);
+ MmHeapFree(FatVolumeBootSector);
//
// Initialize the disk cache for this drive
@@ -445,7 +445,7 @@
// Attempt to allocate memory for directory buffer
//
DbgPrint((DPRINT_FILESYSTEM, "Trying to allocate (DirectorySize) %d bytes.\n",
*DirectorySize));
- DirectoryBuffer = MmAllocateMemory(*DirectorySize);
+ DirectoryBuffer = MmHeapAlloc(*DirectorySize);
if (DirectoryBuffer == NULL)
{
@@ -459,7 +459,7 @@
{
if (!FatReadVolumeSectors(FatDriveNumber, RootDirSectorStart, RootDirSectors,
DirectoryBuffer))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return NULL;
}
}
@@ -467,7 +467,7 @@
{
if (!FatReadClusterChain(DirectoryStartCluster, 0xFFFFFFFF, DirectoryBuffer))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return NULL;
}
}
@@ -817,7 +817,7 @@
{
if (!FatXSearchDirectoryBufferForFile(DirectoryBuffer, DirectorySize, PathPart,
&FatFileInfo))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return FALSE;
}
}
@@ -825,12 +825,12 @@
{
if (!FatSearchDirectoryBufferForFile(DirectoryBuffer, DirectorySize, PathPart,
&FatFileInfo))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return FALSE;
}
}
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
//
// If we have another sub-directory to go then
@@ -839,7 +839,7 @@
if ((i+1) < NumberOfPathParts)
{
DirectoryStartCluster = FatFileInfo.FileFatChain[0];
- MmFreeMemory(FatFileInfo.FileFatChain);
+ MmHeapFree(FatFileInfo.FileFatChain);
}
}
@@ -1007,7 +1007,7 @@
return NULL;
}
- FileHandle = MmAllocateMemory(sizeof(FAT_FILE_INFO));
+ FileHandle = MmHeapAlloc(sizeof(FAT_FILE_INFO));
if (FileHandle == NULL)
{
@@ -1071,7 +1071,7 @@
//
// Allocate array memory
//
- ArrayPointer = MmAllocateMemory(ArraySize);
+ ArrayPointer = MmHeapAlloc(ArraySize);
if (ArrayPointer == NULL)
{
@@ -1104,7 +1104,7 @@
//
if (!FatGetFatEntry(StartCluster, &StartCluster))
{
- MmFreeMemory(ArrayPointer);
+ MmHeapFree(ArrayPointer);
return NULL;
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/fs/iso.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/is…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/fs/iso.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/fs/iso.c Sun Jan 13 18:17:54 2008
@@ -139,7 +139,7 @@
// Attempt to allocate memory for directory buffer
//
DbgPrint((DPRINT_FILESYSTEM, "Trying to allocate (DirectoryLength) %d
bytes.\n", DirectoryLength));
- DirectoryBuffer = MmAllocateMemory(DirectoryLength);
+ DirectoryBuffer = MmHeapAlloc(DirectoryLength);
if (DirectoryBuffer == NULL)
{
@@ -153,7 +153,7 @@
{
if (!MachDiskReadLogicalSectors(IsoDriveNumber, DirectoryStartSector + i, 1,
(PVOID)DISKREADBUFFER))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return NULL;
}
RtlCopyMemory(Ptr, (PVOID)DISKREADBUFFER, SECTORSIZE);
@@ -224,11 +224,11 @@
//
if (!IsoSearchDirectoryBufferForFile(DirectoryBuffer, DirectoryLength, PathPart,
&IsoFileInfo))
{
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
return FALSE;
}
- MmFreeMemory(DirectoryBuffer);
+ MmHeapFree(DirectoryBuffer);
//
// If we have another sub-directory to go then
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h Sun Jan 13 18:17:54 2008
@@ -78,6 +78,7 @@
#include <keycodes.h>
#include <ver.h>
#include <cmdline.h>
+#include <bget.h>
/* Needed by boot manager */
#include <bootmgr.h>
#include <oslist.h>
Modified: trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inffi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c Sun Jan 13 18:17:54 2008
@@ -159,7 +159,7 @@
Next = Line->Next;
if (Line->Key != NULL)
{
- MmFreeMemory (Line->Key);
+ MmHeapFree (Line->Key);
Line->Key = NULL;
}
@@ -167,12 +167,12 @@
while (Line->FirstField != NULL)
{
Field = Line->FirstField->Next;
- MmFreeMemory (Line->FirstField);
+ MmHeapFree (Line->FirstField);
Line->FirstField = Field;
}
Line->LastField = NULL;
- MmFreeMemory (Line);
+ MmHeapFree (Line);
return Next;
}
@@ -196,7 +196,7 @@
}
Section->LastLine = NULL;
- MmFreeMemory (Section);
+ MmHeapFree (Section);
return Next;
}
@@ -245,7 +245,7 @@
/* Allocate and initialize the new section */
Size = sizeof(INFCACHESECTION) + strlen (Name);
- Section = (PINFCACHESECTION)MmAllocateMemory (Size);
+ Section = (PINFCACHESECTION)MmHeapAlloc (Size);
if (Section == NULL)
{
// DPRINT("RtlAllocateHeap() failed\n");
@@ -284,7 +284,7 @@
return NULL;
}
- Line = (PINFCACHELINE)MmAllocateMemory (sizeof(INFCACHELINE));
+ Line = (PINFCACHELINE)MmHeapAlloc (sizeof(INFCACHELINE));
if (Line == NULL)
{
// DPRINT("RtlAllocateHeap() failed\n");
@@ -320,7 +320,7 @@
if (Line->Key != NULL)
return NULL;
- Line->Key = (PCHAR)MmAllocateMemory (strlen (Key) + 1);
+ Line->Key = (PCHAR)MmHeapAlloc (strlen (Key) + 1);
if (Line->Key == NULL)
return NULL;
@@ -338,7 +338,7 @@
ULONG Size;
Size = sizeof(INFCACHEFIELD) + strlen(Data);
- Field = (PINFCACHEFIELD)MmAllocateMemory (Size);
+ Field = (PINFCACHEFIELD)MmHeapAlloc (Size);
if (Field == NULL)
{
return NULL;
@@ -906,7 +906,7 @@
// DPRINT("File size: %lu\n", FileLength);
/* Allocate file buffer */
- FileBuffer = MmAllocateMemory (FileSize + 1);
+ FileBuffer = MmHeapAlloc (FileSize + 1);
if (FileBuffer == NULL)
{
// DPRINT1("RtlAllocateHeap() failed\n");
@@ -921,7 +921,7 @@
if (!Success)
{
// DPRINT("FsReadFile() failed\n");
- MmFreeMemory (FileBuffer);
+ MmHeapFree (FileBuffer);
return FALSE;
}
@@ -929,11 +929,11 @@
FileBuffer[FileSize] = 0;
/* Allocate infcache header */
- Cache = (PINFCACHE)MmAllocateMemory (sizeof(INFCACHE));
+ Cache = (PINFCACHE)MmHeapAlloc (sizeof(INFCACHE));
if (Cache == NULL)
{
// DPRINT("RtlAllocateHeap() failed\n");
- MmFreeMemory (FileBuffer);
+ MmHeapFree (FileBuffer);
return FALSE;
}
@@ -948,12 +948,12 @@
ErrorLine);
if (!Success)
{
- MmFreeMemory (Cache);
+ MmHeapFree (Cache);
Cache = NULL;
}
/* Free file buffer */
- MmFreeMemory (FileBuffer);
+ MmHeapFree (FileBuffer);
*InfHandle = (HINF)Cache;
@@ -979,7 +979,7 @@
}
Cache->LastSection = NULL;
- MmFreeMemory(Cache);
+ MmHeapFree(Cache);
}
Modified: trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/inifile/ini_init.c Sun Jan 13 18:17:54 2008
@@ -37,7 +37,7 @@
// Get the file size & allocate enough memory for it
FreeLoaderIniFileSize = FsGetFileSize(Freeldr_Ini);
- FreeLoaderIniFileData = MmAllocateMemory(FreeLoaderIniFileSize);
+ FreeLoaderIniFileData = MmHeapAlloc(FreeLoaderIniFileSize);
// If we are out of memory then return FALSE
if (FreeLoaderIniFileData == NULL)
@@ -51,7 +51,7 @@
if (!FsReadFile(Freeldr_Ini, FreeLoaderIniFileSize, NULL, FreeLoaderIniFileData))
{
FsCloseFile(Freeldr_Ini);
- MmFreeMemory(FreeLoaderIniFileData);
+ MmHeapFree(FreeLoaderIniFileData);
return FALSE;
}
@@ -60,7 +60,7 @@
// Parse the .ini file data
Success = IniParseFile(FreeLoaderIniFileData, FreeLoaderIniFileSize);
- MmFreeMemory(FreeLoaderIniFileData);
+ MmHeapFree(FreeLoaderIniFileData);
return Success;
}
Modified: trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c Sun Jan 13 18:17:54 2008
@@ -178,7 +178,7 @@
PINI_SECTION Section;
// Allocate a new section structure
- Section = MmAllocateMemory(sizeof(INI_SECTION));
+ Section = MmHeapAlloc(sizeof(INI_SECTION));
if (!Section)
{
return FALSE;
@@ -187,10 +187,10 @@
RtlZeroMemory(Section, sizeof(INI_SECTION));
// Allocate the section name buffer
- Section->SectionName = MmAllocateMemory(strlen(SectionName));
+ Section->SectionName = MmHeapAlloc(strlen(SectionName));
if (!Section->SectionName)
{
- MmFreeMemory(Section);
+ MmHeapFree(Section);
return FALSE;
}
@@ -212,7 +212,7 @@
PINI_SECTION_ITEM SectionItem;
// Allocate a new item structure
- SectionItem = MmAllocateMemory(sizeof(INI_SECTION_ITEM));
+ SectionItem = MmHeapAlloc(sizeof(INI_SECTION_ITEM));
if (!SectionItem)
{
return FALSE;
@@ -221,19 +221,19 @@
RtlZeroMemory(SectionItem, sizeof(INI_SECTION_ITEM));
// Allocate the setting name buffer
- SectionItem->ItemName = MmAllocateMemory(strlen(SettingName) + 1);
+ SectionItem->ItemName = MmHeapAlloc(strlen(SettingName) + 1);
if (!SectionItem->ItemName)
{
- MmFreeMemory(SectionItem);
+ MmHeapFree(SectionItem);
return FALSE;
}
// Allocate the setting value buffer
- SectionItem->ItemValue = MmAllocateMemory(strlen(SettingValue) + 1);
+ SectionItem->ItemValue = MmHeapAlloc(strlen(SettingValue) + 1);
if (!SectionItem->ItemValue)
{
- MmFreeMemory(SectionItem->ItemName);
- MmFreeMemory(SectionItem);
+ MmHeapFree(SectionItem->ItemName);
+ MmHeapFree(SectionItem);
return FALSE;
}
Modified: trunk/reactos/boot/freeldr/freeldr/inifile/parse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/inifile/parse.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/inifile/parse.c Sun Jan 13 18:17:54 2008
@@ -46,7 +46,7 @@
// Start with an 80-byte buffer
IniFileLineSize = 80;
- IniFileLine = MmAllocateMemory(IniFileLineSize);
+ IniFileLine = MmHeapAlloc(IniFileLineSize);
if (!IniFileLine)
{
return FALSE;
@@ -61,8 +61,8 @@
if (IniFileLineSize < IniGetNextLineSize(IniFileData, IniFileSize, CurrentOffset))
{
IniFileLineSize = IniGetNextLineSize(IniFileData, IniFileSize, CurrentOffset);
- MmFreeMemory(IniFileLine);
- IniFileLine = MmAllocateMemory(IniFileLineSize);
+ MmHeapFree(IniFileLine);
+ IniFileLine = MmHeapAlloc(IniFileLineSize);
if (!IniFileLine)
{
return FALSE;
@@ -84,21 +84,21 @@
if (IniIsSectionName(IniFileLine, LineLength))
{
// Allocate a new section structure
- CurrentSection = MmAllocateMemory(sizeof(INI_SECTION));
+ CurrentSection = MmHeapAlloc(sizeof(INI_SECTION));
if (!CurrentSection)
{
- MmFreeMemory(IniFileLine);
+ MmHeapFree(IniFileLine);
return FALSE;
}
RtlZeroMemory(CurrentSection, sizeof(INI_SECTION));
// Allocate the section name buffer
- CurrentSection->SectionName = MmAllocateMemory(IniGetSectionNameSize(IniFileLine,
LineLength));
+ CurrentSection->SectionName = MmHeapAlloc(IniGetSectionNameSize(IniFileLine,
LineLength));
if (!CurrentSection->SectionName)
{
- MmFreeMemory(CurrentSection);
- MmFreeMemory(IniFileLine);
+ MmHeapFree(CurrentSection);
+ MmHeapFree(IniFileLine);
return FALSE;
}
@@ -128,31 +128,31 @@
}
// Allocate a new item structure
- CurrentItem = MmAllocateMemory(sizeof(INI_SECTION_ITEM));
+ CurrentItem = MmHeapAlloc(sizeof(INI_SECTION_ITEM));
if (!CurrentItem)
{
- MmFreeMemory(IniFileLine);
+ MmHeapFree(IniFileLine);
return FALSE;
}
RtlZeroMemory(CurrentItem, sizeof(INI_SECTION_ITEM));
// Allocate the setting name buffer
- CurrentItem->ItemName = MmAllocateMemory(IniGetSettingNameSize(IniFileLine,
LineLength));
+ CurrentItem->ItemName = MmHeapAlloc(IniGetSettingNameSize(IniFileLine,
LineLength));
if (!CurrentItem->ItemName)
{
- MmFreeMemory(CurrentItem);
- MmFreeMemory(IniFileLine);
+ MmHeapFree(CurrentItem);
+ MmHeapFree(IniFileLine);
return FALSE;
}
// Allocate the setting value buffer
- CurrentItem->ItemValue = MmAllocateMemory(IniGetSettingValueSize(IniFileLine,
LineLength));
+ CurrentItem->ItemValue = MmHeapAlloc(IniGetSettingValueSize(IniFileLine,
LineLength));
if (!CurrentItem->ItemValue)
{
- MmFreeMemory(CurrentItem->ItemName);
- MmFreeMemory(CurrentItem);
- MmFreeMemory(IniFileLine);
+ MmHeapFree(CurrentItem->ItemName);
+ MmHeapFree(CurrentItem);
+ MmHeapFree(IniFileLine);
return FALSE;
}
Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/mm/mm.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c Sun Jan 13 18:17:54 2008
@@ -310,8 +310,8 @@
PVOID MmHeapAlloc(ULONG MemorySize)
{
- // Stub for WinLdr
- return NULL;
+ // Temporary forwarder...
+ return MmAllocateMemoryWithType(MemorySize, LoaderOsloaderHeap);
}
VOID MmHeapFree(PVOID MemoryPointer)
Modified: trunk/reactos/boot/freeldr/freeldr/oslist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/oslis…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/oslist.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/oslist.c Sun Jan 13 18:17:54 2008
@@ -119,8 +119,8 @@
//
// Allocate memory to hold operating system list arrays
//
- OperatingSystemSectionNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
- OperatingSystemDisplayNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
+ OperatingSystemSectionNames = MmHeapAlloc( sizeof(PCHAR) * OperatingSystemCount);
+ OperatingSystemDisplayNames = MmHeapAlloc( sizeof(PCHAR) * OperatingSystemCount);
//
// If either allocation failed then return FALSE
@@ -129,12 +129,12 @@
{
if (OperatingSystemSectionNames != NULL)
{
- MmFreeMemory(OperatingSystemSectionNames);
+ MmHeapFree(OperatingSystemSectionNames);
}
if (OperatingSystemDisplayNames != NULL)
{
- MmFreeMemory(OperatingSystemDisplayNames);
+ MmHeapFree(OperatingSystemDisplayNames);
}
return FALSE;
@@ -151,8 +151,8 @@
//
for (Idx=0; Idx<OperatingSystemCount; Idx++)
{
- OperatingSystemSectionNames[Idx] = MmAllocateMemory(80);
- OperatingSystemDisplayNames[Idx] = MmAllocateMemory(80);
+ OperatingSystemSectionNames[Idx] = MmHeapAlloc(80);
+ OperatingSystemDisplayNames[Idx] = MmHeapAlloc(80);
//
// If it failed then jump to the cleanup code
@@ -177,20 +177,20 @@
{
if (OperatingSystemSectionNames[Idx] != NULL)
{
- MmFreeMemory(OperatingSystemSectionNames[Idx]);
+ MmHeapFree(OperatingSystemSectionNames[Idx]);
}
if (OperatingSystemDisplayNames[Idx] != NULL)
{
- MmFreeMemory(OperatingSystemDisplayNames[Idx]);
+ MmHeapFree(OperatingSystemDisplayNames[Idx]);
}
}
//
// Free operating system list arrays
//
- MmFreeMemory(OperatingSystemSectionNames);
- MmFreeMemory(OperatingSystemDisplayNames);
+ MmHeapFree(OperatingSystemSectionNames);
+ MmHeapFree(OperatingSystemDisplayNames);
return FALSE;
}
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c Sun Jan 13 18:17:54 2008
@@ -32,7 +32,7 @@
NTAPI
CmpAllocate (SIZE_T Size, BOOLEAN Paged, ULONG Tag)
{
- return MmAllocateMemory(Size);
+ return MmHeapAlloc(Size);
}
@@ -40,7 +40,7 @@
NTAPI
CmpFree (PVOID Ptr, IN ULONG Quota)
{
- return MmFreeMemory(Ptr);
+ return MmHeapFree(Ptr);
}
static BOOLEAN
@@ -62,7 +62,7 @@
if (ValueCell->Flags & VALUE_COMP_NAME)
{
- wName = MmAllocateMemory ((ValueCell->NameLength + 1)*sizeof(WCHAR));
+ wName = MmHeapAlloc ((ValueCell->NameLength + 1)*sizeof(WCHAR));
for (i = 0; i < ValueCell->NameLength; i++)
{
wName[i] = ((PCHAR)ValueCell->Name)[i];
@@ -71,7 +71,7 @@
}
else
{
- wName = MmAllocateMemory (ValueCell->NameLength + sizeof(WCHAR));
+ wName = MmHeapAlloc (ValueCell->NameLength + sizeof(WCHAR));
memcpy (wName,
ValueCell->Name,
ValueCell->NameLength);
@@ -93,7 +93,7 @@
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_REGISTRY, "RegSetValue() failed!\n"));
- MmFreeMemory (wName);
+ MmHeapFree (wName);
return FALSE;
}
}
@@ -111,12 +111,12 @@
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_REGISTRY, "RegSetValue() failed!\n"));
- MmFreeMemory (wName);
+ MmHeapFree (wName);
return FALSE;
}
}
- MmFreeMemory (wName);
+ MmHeapFree (wName);
return TRUE;
}
@@ -147,7 +147,7 @@
if (KeyCell->Flags & KEY_COMP_NAME)
{
- wName = MmAllocateMemory ((KeyCell->NameLength + 1) * sizeof(WCHAR));
+ wName = MmHeapAlloc ((KeyCell->NameLength + 1) * sizeof(WCHAR));
for (i = 0; i < KeyCell->NameLength; i++)
{
wName[i] = ((PCHAR)KeyCell->Name)[i];
@@ -156,7 +156,7 @@
}
else
{
- wName = MmAllocateMemory (KeyCell->NameLength + sizeof(WCHAR));
+ wName = MmHeapAlloc (KeyCell->NameLength + sizeof(WCHAR));
memcpy (wName,
KeyCell->Name,
KeyCell->NameLength);
@@ -169,7 +169,7 @@
Error = RegCreateKey (ParentKey,
wName,
&SubKey);
- MmFreeMemory (wName);
+ MmHeapFree (wName);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_REGISTRY, "RegCreateKey() failed!\n"));
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/registry.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/registry.c Sun Jan 13 18:17:54 2008
@@ -28,7 +28,7 @@
RegInitializeRegistry (VOID)
{
/* Create root key */
- RootKey = (FRLDRHKEY) MmAllocateMemory (sizeof(KEY));
+ RootKey = (FRLDRHKEY) MmHeapAlloc (sizeof(KEY));
InitializeListHead (&RootKey->SubKeyList);
InitializeListHead (&RootKey->ValueList);
@@ -38,7 +38,7 @@
RootKey->ValueCount = 0;
RootKey->NameSize = 4;
- RootKey->Name = MmAllocateMemory (4);
+ RootKey->Name = MmHeapAlloc (4);
wcscpy (RootKey->Name, L"\\");
RootKey->DataType = 0;
@@ -244,7 +244,7 @@
if (CmpResult != 0)
{
/* no key found -> create new subkey */
- NewKey = (FRLDRHKEY)MmAllocateMemory(sizeof(KEY));
+ NewKey = (FRLDRHKEY)MmHeapAlloc(sizeof(KEY));
if (NewKey == NULL)
return(ERROR_OUTOFMEMORY);
@@ -262,7 +262,7 @@
CurrentKey->SubKeyCount++;
NewKey->NameSize = NameSize;
- NewKey->Name = (PWCHAR)MmAllocateMemory(NewKey->NameSize);
+ NewKey->Name = (PWCHAR)MmHeapAlloc(NewKey->NameSize);
if (NewKey->Name == NULL)
return(ERROR_OUTOFMEMORY);
memcpy(NewKey->Name, name, NewKey->NameSize - sizeof(WCHAR));
@@ -468,7 +468,7 @@
/* set default value */
if ((Key->Data != NULL) && (Key->DataSize > sizeof(PUCHAR)))
{
- MmFreeMemory(Key->Data);
+ MmHeapFree(Key->Data);
}
if (DataSize <= sizeof(PUCHAR))
@@ -479,7 +479,7 @@
}
else
{
- Key->Data = MmAllocateMemory(DataSize);
+ Key->Data = MmHeapAlloc(DataSize);
Key->DataSize = DataSize;
Key->DataType = Type;
memcpy(Key->Data, Data, DataSize);
@@ -508,7 +508,7 @@
/* add new value */
DbgPrint((DPRINT_REGISTRY, "No value found - adding new value\n"));
- Value = (PVALUE)MmAllocateMemory(sizeof(VALUE));
+ Value = (PVALUE)MmHeapAlloc(sizeof(VALUE));
if (Value == NULL)
return(ERROR_OUTOFMEMORY);
@@ -516,7 +516,7 @@
Key->ValueCount++;
Value->NameSize = (wcslen(ValueName)+1)*sizeof(WCHAR);
- Value->Name = (PWCHAR)MmAllocateMemory(Value->NameSize);
+ Value->Name = (PWCHAR)MmHeapAlloc(Value->NameSize);
if (Value->Name == NULL)
return(ERROR_OUTOFMEMORY);
wcscpy(Value->Name, ValueName);
@@ -528,7 +528,7 @@
/* set new value */
if ((Value->Data != NULL) && (Value->DataSize > sizeof(PUCHAR)))
{
- MmFreeMemory(Value->Data);
+ MmHeapFree(Value->Data);
}
if (DataSize <= sizeof(PUCHAR))
@@ -539,7 +539,7 @@
}
else
{
- Value->Data = MmAllocateMemory(DataSize);
+ Value->Data = MmHeapAlloc(DataSize);
if (Value->Data == NULL)
return(ERROR_OUTOFMEMORY);
Value->DataType = Type;
Modified: trunk/reactos/boot/freeldr/freeldr/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/rtl/l…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/rtl/libsupp.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/rtl/libsupp.c Sun Jan 13 18:17:54 2008
@@ -33,7 +33,7 @@
RtlpAllocateMemory(ULONG Bytes,
ULONG Tag)
{
- return MmAllocateMemory(Bytes);
+ return MmHeapAlloc(Bytes);
}
@@ -42,5 +42,5 @@
RtlpFreeMemory(PVOID Mem,
ULONG Tag)
{
- return MmFreeMemory(Mem);
+ return MmHeapFree(Mem);
}
Modified: trunk/reactos/boot/freeldr/freeldr/ui/tui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/tu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/tui.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/tui.c Sun Jan 13 18:17:54 2008
@@ -559,7 +559,7 @@
PVOID ScreenBuffer;
// Save the screen contents
- ScreenBuffer = MmAllocateMemory(UiScreenWidth * UiScreenHeight * 2);
+ ScreenBuffer = MmHeapAlloc(UiScreenWidth * UiScreenHeight * 2);
TuiSaveScreen(ScreenBuffer);
// Display the message box
@@ -567,7 +567,7 @@
// Restore the screen contents
TuiRestoreScreen(ScreenBuffer);
- MmFreeMemory(ScreenBuffer);
+ MmHeapFree(ScreenBuffer);
}
VOID TuiMessageBoxCritical(PCSTR MessageText)
@@ -774,7 +774,7 @@
if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed())
{
- TuiFadePalette = (PPALETTE_ENTRY)MmAllocateMemory(sizeof(PALETTE_ENTRY) * 64);
+ TuiFadePalette = (PPALETTE_ENTRY)MmHeapAlloc(sizeof(PALETTE_ENTRY) * 64);
if (TuiFadePalette != NULL)
{
@@ -789,7 +789,7 @@
if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette
!= NULL)
{
VideoFadeIn(TuiFadePalette, 64);
- MmFreeMemory(TuiFadePalette);
+ MmHeapFree(TuiFadePalette);
}
}
@@ -799,7 +799,7 @@
if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed())
{
- TuiFadePalette = (PPALETTE_ENTRY)MmAllocateMemory(sizeof(PALETTE_ENTRY) * 64);
+ TuiFadePalette = (PPALETTE_ENTRY)MmHeapAlloc(sizeof(PALETTE_ENTRY) * 64);
if (TuiFadePalette != NULL)
{
@@ -817,7 +817,7 @@
if (UiUseSpecialEffects && ! MachVideoIsPaletteFixed() && TuiFadePalette
!= NULL)
{
VideoRestorePaletteState(TuiFadePalette, 64);
- MmFreeMemory(TuiFadePalette);
+ MmHeapFree(TuiFadePalette);
}
}
@@ -841,7 +841,7 @@
PVOID ScreenBuffer;
// Save the screen contents
- ScreenBuffer = MmAllocateMemory(UiScreenWidth * UiScreenHeight * 2);
+ ScreenBuffer = MmHeapAlloc(UiScreenWidth * UiScreenHeight * 2);
TuiSaveScreen(ScreenBuffer);
// Find the height
@@ -982,7 +982,7 @@
// Restore the screen contents
TuiRestoreScreen(ScreenBuffer);
- MmFreeMemory(ScreenBuffer);
+ MmHeapFree(ScreenBuffer);
return ReturnCode;
}
Modified: trunk/reactos/boot/freeldr/freeldr/ui/ui.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/ui…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/ui/ui.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/ui/ui.c Sun Jan 13 18:17:54 2008
@@ -465,7 +465,7 @@
//if (MessageBoxTextSize > 0)
{
// Allocate enough memory to hold the text
- MessageBoxText = MmAllocateMemory(MessageBoxTextSize);
+ MessageBoxText = MmHeapAlloc(MessageBoxTextSize);
if (MessageBoxText)
{
@@ -479,7 +479,7 @@
UiMessageBox(MessageBoxText);
// Free the memory
- MmFreeMemory(MessageBoxText);
+ MmHeapFree(MessageBoxText);
}
}
}