if (Page == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
if (PageOp == NULL)
{
DPRINT1("MmGetPageOp failed");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
if (Status != STATUS_SUCCESS)
{
DPRINT1("Failed to wait for page op\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PageOp->Status == STATUS_PENDING)
{
DPRINT1("Woke for page op before completion\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
* If this wasn't a pagein then we need to restart the handling
if (!NT_SUCCESS(Status))
{
DPRINT1("MmRequestPageMemoryConsumer failed, status = %x\n", Status);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
Status = MmReadFromSwapPage(SwapEntry, Page);
if (!NT_SUCCESS(Status))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmSetSavedSwapEntryPage(Page, SwapEntry);
}
if (!NT_SUCCESS(Status))
{
DPRINT1("MmCreateVirtualMapping failed, not out of memory\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(Status);
}
if (Status != STATUS_SUCCESS)
{
DPRINT1("Failed to wait for page op\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmLockAddressSpace(&Process->VadRoot);
MmReleasePageOp(PageOp);
if (Page == 0)
{
DPRINT1("Tried to release page zero.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
KeAcquireSpinLock(&AllocationListLock, &oldIrql);
Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages);
if (!NT_SUCCESS(Status))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Target = Target - NrFreedPages;
}
Status = MiMemoryConsumers[i].Trim(MiMinimumPagesPerRun, 0, &NrFreedPages);
if (!NT_SUCCESS(Status))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
}
Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages);
if (!NT_SUCCESS(Status))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
}
else
{
DPRINT1("KeWaitForMultipleObjects failed, status = %x\n", Status);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
}
NULL);
if (!NT_SUCCESS(Status))
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Priority = LOW_REALTIME_PRIORITY + 1;
if (!NT_SUCCESS(Status))
{
DPRINT1("Unable to create virtual mapping\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
else
if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE)
{
DPRINT1("Mapping non-used page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->MapCount++;
Page->ReferenceCount++;
if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE)
{
DPRINT1("Unmapping non-used page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->MapCount == 0)
{
DPRINT1("Unmapping not mapped page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->MapCount--;
Page->ReferenceCount--;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Referencing non-used page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->ReferenceCount++;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Getting reference count for free page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
RCount = Page->ReferenceCount;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Dereferencing free page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->ReferenceCount == 0)
{
DPRINT1("Derefrencing page with reference count 0\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->ReferenceCount--;
if (Page->RmapListHead != NULL)
{
DPRINT1("Freeing page with rmap entries.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->MapCount != 0)
{
DPRINT1("Freeing mapped page (0x%x count %d)\n",
Pfn << PAGE_SHIFT, Page->MapCount);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->LockCount > 0)
{
DPRINT1("Freeing locked page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->SavedSwapEntry != 0)
{
DPRINT1("Freeing page with swap entry.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Freeing page with flags %x\n",
Page->Flags.Type);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->Flags.Type = MM_PHYSICAL_PAGE_FREE;
Page->Flags.Consumer = MC_MAXIMUM;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Getting lock count for free page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
LockCount = Page->LockCount;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Locking free page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->LockCount++;
if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED)
{
DPRINT1("Unlocking free page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Page->LockCount--;
if (PageDescriptor->Flags.Type != MM_PHYSICAL_PAGE_FREE)
{
DPRINT1("Got non-free page from freelist\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PageDescriptor->MapCount != 0)
{
DPRINT1("Got mapped page from freelist\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PageDescriptor->ReferenceCount != 0)
{
DPRINT1("%d\n", PageDescriptor->ReferenceCount);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_USED;
PageDescriptor->Flags.Consumer = Consumer;
if (PageDescriptor->MapCount != 0)
{
DPRINT1("Returning mapped page.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
return PfnOffset;
}
if (!NT_SUCCESS(Status))
{
DPRINT1("ZeroPageThread: Wait failed\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (ZeroPageThreadShouldTerminate)
if (PageDescriptor->MapCount != 0)
{
DPRINT1("Mapped page on freelist.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
PageDescriptor->Flags.Zero = 1;
PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_FREE;
if (!NT_SUCCESS(Status))
{
DbgPrint("Unable to create virtual mapping\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
return (PVOID)((ULONG_PTR)Result + Offset);
BaseAddress);
if (MemoryArea == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(STATUS_UNSUCCESSFUL);
}
if (!NT_SUCCESS(Status))
{
DPRINT1("Unable to allocate page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Status = MmCreateVirtualMapping (NULL,
(PVOID)((ULONG_PTR)BaseAddress + (i * PAGE_SIZE)),
if (!NT_SUCCESS(Status))
{
DPRINT1("Unable to create virtual mapping\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
}
if (!NT_SUCCESS(Status))
{
MmUnlockAddressSpace(MmGetKernelAddressSpace());
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmUnlockAddressSpace(MmGetKernelAddressSpace());
{
return NULL;
}
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE);
if (MiMdlMappingRegionHint == StartingOffset) MiMdlMappingRegionHint += PageCount;
if (!NT_SUCCESS(Status))
{
DbgPrint("MpwThread: Wait failed\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(STATUS_UNSUCCESSFUL);
}
if (MpwThreadShouldTerminate)
{
DbgPrint("Bad block magic (probable pool corruption) at %x\n",
current);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (base_addr < MiNonPagedPoolStart ||
DbgPrint("Size %d\n",current->hdr.Size);
DbgPrint("Limits are %x %x\n",MiNonPagedPoolStart,
(ULONG_PTR)MiNonPagedPoolStart+MiNonPagedPoolLength);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
blocks_seen++;
if (blocks_seen > EiNrFreeBlocks)
{
DbgPrint("Too many blocks on free list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
p = avl_get_next(FreeBlockListRoot, p);
}
{
DbgPrint("Bad block magic (probable pool corruption) at %x\n",
current);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (base_addr < MiNonPagedPoolStart ||
((ULONG_PTR)base_addr+current->hdr.Size) >
DbgPrint("Size %d\n",current->hdr.Size);
DbgPrint("Limits are %x %x\n",MiNonPagedPoolStart,
(ULONG_PTR)MiNonPagedPoolStart+MiNonPagedPoolLength);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
blocks_seen++;
if (blocks_seen > EiNrUsedBlocks)
{
DbgPrint("Too many blocks on used list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (current->ListEntry.Flink != &UsedBlockListHead &&
current->ListEntry.Flink->Blink != ¤t->ListEntry)
"current->next->previous %x)\n",
__FILE__,__LINE__,current, current->ListEntry.Flink,
current->ListEntry.Flink->Blink);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
current_entry = current_entry->Flink;
{
DbgPrint("Bad block magic (probable pool corruption) at %x\n",
free);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if ( (ULONG_PTR)free > base && (ULONG_PTR)free < last )
{
DbgPrint("intersecting blocks on list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if ( (ULONG_PTR)free < base &&
((ULONG_PTR)free + free->hdr.Size) > base )
{
DbgPrint("intersecting blocks on list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
p = avl_get_next(FreeBlockListRoot, p);
}
if ( (ULONG_PTR)used > base && (ULONG_PTR)used < last )
{
DbgPrint("intersecting blocks on list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if ( (ULONG_PTR)used < base &&
((ULONG_PTR)used + used->hdr.Size) > base )
{
DbgPrint("intersecting blocks on list\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
current_entry = current_entry->Flink;
{
HDR_USED* blk=(HDR_USED*)((ULONG_PTR)Addr - HDR_USED_SIZE);
if (blk->hdr.Magic != BLOCK_HDR_USED_MAGIC)
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return blk->Tag;
}
DbgPrint("NPPOL: High-side redzone overwritten, Block %x, Size %d, Tag %x(%s), Caller %x\n",
(ULONG_PTR)hdr + HDR_USED_SIZE, hdr->UserSize, hdr->Tag, c, hdr->Caller);
}
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
#endif
if (!NT_SUCCESS(Status))
{
DbgPrint("Unable to allocate a page\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Status = MmCreateVirtualMapping(NULL,
if (!NT_SUCCESS(Status))
{
DbgPrint("Unable to create virtual mapping\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
Address = (PVOID)((ULONG_PTR)Address + PAGE_SIZE);
}
first = mid + 1;
}
}
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
#if defined(__GNUC__)
return (LARGE_INTEGER)0LL;
if (SwapEntry == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(STATUS_UNSUCCESSFUL);
}
if (i >= MAX_PAGING_FILES)
{
DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PagingFileList[i]->FileObject == NULL ||
PagingFileList[i]->FileObject->DeviceObject == NULL)
{
DPRINT1("Bad paging file 0x%.8X\n", SwapEntry);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmInitializeMdl(Mdl, NULL, PAGE_SIZE);
if (SwapEntry == 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(STATUS_UNSUCCESSFUL);
}
if (i >= MAX_PAGING_FILES)
{
DPRINT1("Bad swap entry 0x%.8X\n", SwapEntry);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (PagingFileList[i]->FileObject == NULL ||
PagingFileList[i]->FileObject->DeviceObject == NULL)
{
DPRINT1("Bad paging file 0x%.8X\n", SwapEntry);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmInitializeMdl(Mdl, NULL, PAGE_SIZE);
if (i >= MAX_PAGING_FILES)
{
DPRINT1("Bad swap entry 0x%.8X\n", Entry);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
KeAcquireSpinLock(&PagingFileListLock, &oldIrql);
if (PagingFileList[i] == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
KeAcquireSpinLockAtDpcLevel(&PagingFileList[i]->AllocMapLock);
off = MiAllocPageFromPagingFile(PagingFileList[i]);
if (off == 0xFFFFFFFF)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
KeReleaseSpinLock(&PagingFileListLock, oldIrql);
return(STATUS_UNSUCCESSFUL);
}
}
KeReleaseSpinLock(&PagingFileListLock, oldIrql);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(0);
}
PrevPageOp = PrevPageOp->Next;
}
KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
PMM_PAGEOP
if (PageOp == NULL)
{
KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
return(NULL);
}
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to create thread stack\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/*
if (!NT_SUCCESS(Status))
{
DPRINT1("Could not create Virtual Mapping for Kernel Stack\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
/* Return the stack base */
break;
default:
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
}
Address = entry->Address;
if ((((ULONG_PTR)Address) & 0xFFF) != 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Address < MmSystemRangeStart)
{
}
else
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Address < MmSystemRangeStart)
{
Address = entry->Address;
if ((((ULONG_PTR)Address) & 0xFFF) != 0)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Address < MmSystemRangeStart)
}
else
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
if (Address < MmSystemRangeStart)
{
if (current_entry == NULL)
{
DPRINT1("MmIsDirtyRmap: No rmaps.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
while (current_entry != NULL)
{
if (current_entry == NULL)
{
DPRINT1("MmIsDirtyRmap: No rmaps.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
while (current_entry != NULL)
{
new_entry = ExAllocateFromNPagedLookasideList(&RmapLookasideList);
if (new_entry == NULL)
{
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
new_entry->Address = Address;
new_entry->Process = (PEPROCESS)Process;
"address 0x%.8X\n", Process->UniqueProcessId, Address,
MmGetPfnForProcess(Process, Address) << PAGE_SHIFT,
Page << PAGE_SHIFT);
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
ExAcquireFastMutex(&RmapListLock);
DbgPrint("\n previous caller ");
DbgPrint("%p", current_entry->Caller);
DbgPrint("\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
current_entry = current_entry->Next;
}
if (current_entry == NULL)
{
DPRINT1("MmDeleteAllRmaps: No rmaps.\n");
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}
MmSetRmapListHeadPage(Page, NULL);
ExReleaseFastMutex(&RmapListLock);
previous_entry = current_entry;
current_entry = current_entry->Next;
}
- ASSERT(FALSE);
+ KeBugCheck(MEMORY_MANAGEMENT);
}