mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
[FREELDR] Fix Release build
This commit is contained in:
parent
f694d12f0c
commit
12542f271d
|
@ -184,7 +184,8 @@ FrLdrHeapRelease(
|
||||||
PHEAP Heap = HeapHandle;
|
PHEAP Heap = HeapHandle;
|
||||||
PHEAP_BLOCK Block;
|
PHEAP_BLOCK Block;
|
||||||
PUCHAR StartAddress, EndAddress;
|
PUCHAR StartAddress, EndAddress;
|
||||||
PFN_COUNT FreePages, AllPages, AllFreePages = 0;
|
PFN_COUNT FreePages, AllFreePages = 0;
|
||||||
|
|
||||||
TRACE("HeapRelease(%p)\n", HeapHandle);
|
TRACE("HeapRelease(%p)\n", HeapHandle);
|
||||||
|
|
||||||
/* Loop all heap chunks */
|
/* Loop all heap chunks */
|
||||||
|
@ -240,13 +241,13 @@ FrLdrHeapRelease(
|
||||||
if (Block->Size == 0) break;
|
if (Block->Size == 0) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
AllPages = Heap->MaximumSize / MM_PAGE_SIZE;
|
TRACE("HeapRelease() done, freed %lu of %lu pages\n", AllFreePages, Heap->MaximumSize / MM_PAGE_SIZE);
|
||||||
TRACE("HeapRelease() done, freed %lu of %lu pages\n", AllFreePages, AllPages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
FrLdrHeapCleanupAll(VOID)
|
FrLdrHeapCleanupAll(VOID)
|
||||||
{
|
{
|
||||||
|
#if DBG
|
||||||
PHEAP Heap;
|
PHEAP Heap;
|
||||||
|
|
||||||
Heap = FrLdrDefaultHeap;
|
Heap = FrLdrDefaultHeap;
|
||||||
|
@ -257,17 +258,19 @@ FrLdrHeapCleanupAll(VOID)
|
||||||
Heap->NumAllocs, Heap->NumFrees);
|
Heap->NumAllocs, Heap->NumFrees);
|
||||||
TRACE("AllocTime = %I64d, FreeTime = %I64d, sum = %I64d\n",
|
TRACE("AllocTime = %I64d, FreeTime = %I64d, sum = %I64d\n",
|
||||||
Heap->AllocationTime, Heap->FreeTime, Heap->AllocationTime + Heap->FreeTime);
|
Heap->AllocationTime, Heap->FreeTime, Heap->AllocationTime + Heap->FreeTime);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Release free pages from the default heap */
|
/* Release free pages from the default heap */
|
||||||
FrLdrHeapRelease(FrLdrDefaultHeap);
|
FrLdrHeapRelease(FrLdrDefaultHeap);
|
||||||
|
|
||||||
|
#if DBG
|
||||||
Heap = FrLdrTempHeap;
|
Heap = FrLdrTempHeap;
|
||||||
TRACE("Heap statistics for temp heap:\n"
|
TRACE("Heap statistics for temp heap:\n"
|
||||||
"CurrentAlloc=0x%lx, MaxAlloc=0x%lx, LargestAllocation=0x%lx\n"
|
"CurrentAlloc=0x%lx, MaxAlloc=0x%lx, LargestAllocation=0x%lx\n"
|
||||||
"NumAllocs=%ld, NumFrees=%ld\n",
|
"NumAllocs=%ld, NumFrees=%ld\n",
|
||||||
Heap->CurrentAllocBytes, Heap->MaxAllocBytes, Heap->LargestAllocation,
|
Heap->CurrentAllocBytes, Heap->MaxAllocBytes, Heap->LargestAllocation,
|
||||||
Heap->NumAllocs, Heap->NumFrees);
|
Heap->NumAllocs, Heap->NumFrees);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Destroy the temp heap */
|
/* Destroy the temp heap */
|
||||||
FrLdrHeapDestroy(FrLdrTempHeap);
|
FrLdrHeapDestroy(FrLdrTempHeap);
|
||||||
|
|
|
@ -112,6 +112,7 @@ WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
ImportTable = (PIMAGE_IMPORT_DESCRIPTOR)RtlImageDirectoryEntryToData(VaToPa(ScanDTE->DllBase),
|
ImportTable = (PIMAGE_IMPORT_DESCRIPTOR)RtlImageDirectoryEntryToData(VaToPa(ScanDTE->DllBase),
|
||||||
TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &ImportTableSize);
|
TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &ImportTableSize);
|
||||||
|
|
||||||
|
#if DBG
|
||||||
{
|
{
|
||||||
UNICODE_STRING BaseName;
|
UNICODE_STRING BaseName;
|
||||||
BaseName.Buffer = VaToPa(ScanDTE->BaseDllName.Buffer);
|
BaseName.Buffer = VaToPa(ScanDTE->BaseDllName.Buffer);
|
||||||
|
@ -120,6 +121,7 @@ WinLdrScanImportDescriptorTable(IN OUT PLIST_ENTRY ModuleListHead,
|
||||||
TRACE("WinLdrScanImportDescriptorTable(): %wZ ImportTable = 0x%X\n",
|
TRACE("WinLdrScanImportDescriptorTable(): %wZ ImportTable = 0x%X\n",
|
||||||
&BaseName, ImportTable);
|
&BaseName, ImportTable);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If image doesn't have any import directory - just return success */
|
/* If image doesn't have any import directory - just return success */
|
||||||
if (ImportTable == NULL)
|
if (ImportTable == NULL)
|
||||||
|
@ -456,17 +458,21 @@ WinLdrpCompareDllName(IN PCH DllName,
|
||||||
IN PUNICODE_STRING UnicodeName)
|
IN PUNICODE_STRING UnicodeName)
|
||||||
{
|
{
|
||||||
PWSTR Buffer;
|
PWSTR Buffer;
|
||||||
UNICODE_STRING UnicodeNamePA;
|
|
||||||
SIZE_T i, Length;
|
SIZE_T i, Length;
|
||||||
|
|
||||||
/* First obvious check: for length of two names */
|
/* First obvious check: for length of two names */
|
||||||
Length = strlen(DllName);
|
Length = strlen(DllName);
|
||||||
|
|
||||||
UnicodeNamePA.Length = UnicodeName->Length;
|
#if DBG
|
||||||
UnicodeNamePA.MaximumLength = UnicodeName->MaximumLength;
|
{
|
||||||
UnicodeNamePA.Buffer = VaToPa(UnicodeName->Buffer);
|
UNICODE_STRING UnicodeNamePA;
|
||||||
TRACE("WinLdrpCompareDllName: %s and %wZ, Length = %d "
|
UnicodeNamePA.Length = UnicodeName->Length;
|
||||||
"UN->Length %d\n", DllName, &UnicodeNamePA, Length, UnicodeName->Length);
|
UnicodeNamePA.MaximumLength = UnicodeName->MaximumLength;
|
||||||
|
UnicodeNamePA.Buffer = VaToPa(UnicodeName->Buffer);
|
||||||
|
TRACE("WinLdrpCompareDllName: %s and %wZ, Length = %d "
|
||||||
|
"UN->Length %d\n", DllName, &UnicodeNamePA, Length, UnicodeName->Length);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((Length * sizeof(WCHAR)) > UnicodeName->Length)
|
if ((Length * sizeof(WCHAR)) > UnicodeName->Length)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -36,7 +36,6 @@ static VOID
|
||||||
SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath)
|
SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath)
|
||||||
{
|
{
|
||||||
INFCONTEXT InfContext;
|
INFCONTEXT InfContext;
|
||||||
BOOLEAN Success;
|
|
||||||
LPCSTR AnsiName, OemName, LangName;
|
LPCSTR AnsiName, OemName, LangName;
|
||||||
|
|
||||||
/* Get ANSI codepage file */
|
/* Get ANSI codepage file */
|
||||||
|
@ -76,8 +75,14 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
|
||||||
|
|
||||||
TRACE("NLS data %s %s %s\n", AnsiName, OemName, LangName);
|
TRACE("NLS data %s %s %s\n", AnsiName, OemName, LangName);
|
||||||
|
|
||||||
Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
#if DBG
|
||||||
TRACE("NLS data loading %s\n", Success ? "successful" : "failed");
|
{
|
||||||
|
BOOLEAN Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
||||||
|
TRACE("NLS data loading %s\n", Success ? "successful" : "failed");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TODO: Load OEM HAL font */
|
/* TODO: Load OEM HAL font */
|
||||||
// Value "OemHalFont"
|
// Value "OemHalFont"
|
||||||
|
|
Loading…
Reference in a new issue