From cdb295c734ccdedec1d03417c89d786ca7121c4d Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 7 Dec 2008 18:05:28 +0000 Subject: [PATCH] - Change more ASSERT(FALSE) to KeBugCheck(MEMORY_MANAGEMENT) so it dies on release build too svn path=/trunk/; revision=37914 --- reactos/ntoskrnl/mm/anonmem.c | 16 ++++++------- reactos/ntoskrnl/mm/balance.c | 12 +++++----- reactos/ntoskrnl/mm/freelist.c | 44 +++++++++++++++++----------------- reactos/ntoskrnl/mm/iospace.c | 2 +- reactos/ntoskrnl/mm/marea.c | 6 ++--- reactos/ntoskrnl/mm/mdlsup.c | 4 ++-- reactos/ntoskrnl/mm/mpw.c | 2 +- reactos/ntoskrnl/mm/npool.c | 32 ++++++++++++------------- reactos/ntoskrnl/mm/pagefile.c | 22 ++++++++--------- reactos/ntoskrnl/mm/pageop.c | 4 ++-- reactos/ntoskrnl/mm/procsup.c | 6 ++--- reactos/ntoskrnl/mm/rmap.c | 22 ++++++++--------- 12 files changed, 86 insertions(+), 86 deletions(-) diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index 39c05dc5036..75888e2e001 100644 --- a/reactos/ntoskrnl/mm/anonmem.c +++ b/reactos/ntoskrnl/mm/anonmem.c @@ -163,7 +163,7 @@ MmPageOutVirtualMemory(PMM_AVL_TABLE AddressSpace, if (Page == 0) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } /* @@ -301,7 +301,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } /* @@ -322,12 +322,12 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, 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 @@ -373,7 +373,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("MmRequestPageMemoryConsumer failed, status = %x\n", Status); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } /* @@ -387,7 +387,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } MmSetSavedSwapEntryPage(Page, SwapEntry); } @@ -414,7 +414,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("MmCreateVirtualMapping failed, not out of memory\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(Status); } @@ -888,7 +888,7 @@ MmFreeVirtualMemory(PEPROCESS Process, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } MmLockAddressSpace(&Process->VadRoot); MmReleasePageOp(PageOp); diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index 4a122f06e59..4259833a684 100644 --- a/reactos/ntoskrnl/mm/balance.c +++ b/reactos/ntoskrnl/mm/balance.c @@ -97,7 +97,7 @@ MmReleasePageMemoryConsumer(ULONG Consumer, PFN_TYPE Page) if (Page == 0) { DPRINT1("Tried to release page zero.\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } KeAcquireSpinLock(&AllocationListLock, &oldIrql); @@ -169,7 +169,7 @@ MmRebalanceMemoryConsumers(VOID) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Target = Target - NrFreedPages; } @@ -326,7 +326,7 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(MiMinimumPagesPerRun, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } } @@ -357,7 +357,7 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } } @@ -366,7 +366,7 @@ MiBalancerThread(PVOID Unused) else { DPRINT1("KeWaitForMultipleObjects failed, status = %x\n", Status); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } } @@ -406,7 +406,7 @@ MiInitBalancerThread(VOID) NULL); if (!NT_SUCCESS(Status)) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Priority = LOW_REALTIME_PRIORITY + 1; diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index f824cf25981..da928fc27ed 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -270,7 +270,7 @@ MmInitializePageList(VOID) if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } else @@ -416,7 +416,7 @@ MmMarkPageMapped(PFN_TYPE Pfn) if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE) { DPRINT1("Mapping non-used page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Page->MapCount++; Page->ReferenceCount++; @@ -438,12 +438,12 @@ MmMarkPageUnmapped(PFN_TYPE Pfn) 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--; @@ -511,7 +511,7 @@ MmReferencePageUnsafe(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Referencing non-used page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Page->ReferenceCount++; @@ -542,7 +542,7 @@ MmGetReferenceCountPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Getting reference count for free page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } RCount = Page->ReferenceCount; @@ -577,12 +577,12 @@ MmDereferencePage(PFN_TYPE Pfn) 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--; @@ -594,29 +594,29 @@ MmDereferencePage(PFN_TYPE Pfn) 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; @@ -647,7 +647,7 @@ MmGetLockCountPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Getting lock count for free page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } LockCount = Page->LockCount; @@ -671,7 +671,7 @@ MmLockPageUnsafe(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Locking free page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Page->LockCount++; @@ -702,7 +702,7 @@ MmUnlockPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Unlocking free page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Page->LockCount--; @@ -757,17 +757,17 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) 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; @@ -789,7 +789,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SavedSwapEntry) if (PageDescriptor->MapCount != 0) { DPRINT1("Returning mapped page.\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } return PfnOffset; } @@ -970,7 +970,7 @@ MmZeroPageThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DPRINT1("ZeroPageThread: Wait failed\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (ZeroPageThreadShouldTerminate) @@ -995,7 +995,7 @@ MmZeroPageThreadMain(PVOID Ignored) 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; diff --git a/reactos/ntoskrnl/mm/iospace.c b/reactos/ntoskrnl/mm/iospace.c index 18566d853e8..7bcf5ae235f 100644 --- a/reactos/ntoskrnl/mm/iospace.c +++ b/reactos/ntoskrnl/mm/iospace.c @@ -104,7 +104,7 @@ MmMapIoSpace (IN PHYSICAL_ADDRESS PhysicalAddress, if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } return (PVOID)((ULONG_PTR)Result + Offset); diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index c53aed137ac..4fec0117fa8 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -899,7 +899,7 @@ MmFreeMemoryAreaByPtr( BaseAddress); if (MemoryArea == NULL) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(STATUS_UNSUCCESSFUL); } @@ -1039,7 +1039,7 @@ MmMapMemoryArea(PVOID BaseAddress, 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)), @@ -1049,7 +1049,7 @@ MmMapMemoryArea(PVOID BaseAddress, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } } diff --git a/reactos/ntoskrnl/mm/mdlsup.c b/reactos/ntoskrnl/mm/mdlsup.c index 7bcb4178716..396bbd5b004 100644 --- a/reactos/ntoskrnl/mm/mdlsup.c +++ b/reactos/ntoskrnl/mm/mdlsup.c @@ -57,7 +57,7 @@ MmInitializeMdlImplementation(VOID) if (!NT_SUCCESS(Status)) { MmUnlockAddressSpace(MmGetKernelAddressSpace()); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } MmUnlockAddressSpace(MmGetKernelAddressSpace()); @@ -692,7 +692,7 @@ MmMapLockedPagesSpecifyCache(IN PMDL Mdl, { return NULL; } - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE); if (MiMdlMappingRegionHint == StartingOffset) MiMdlMappingRegionHint += PageCount; diff --git a/reactos/ntoskrnl/mm/mpw.c b/reactos/ntoskrnl/mm/mpw.c index e2d0b7a8733..8acdc5afddd 100644 --- a/reactos/ntoskrnl/mm/mpw.c +++ b/reactos/ntoskrnl/mm/mpw.c @@ -71,7 +71,7 @@ MmMpwThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DbgPrint("MpwThread: Wait failed\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(STATUS_UNSUCCESSFUL); } if (MpwThreadShouldTerminate) diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index 5aade5b0e00..1d323de5ecc 100644 --- a/reactos/ntoskrnl/mm/npool.c +++ b/reactos/ntoskrnl/mm/npool.c @@ -936,7 +936,7 @@ static void validate_free_list(void) { DbgPrint("Bad block magic (probable pool corruption) at %x\n", current); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (base_addr < MiNonPagedPoolStart || @@ -946,13 +946,13 @@ static void validate_free_list(void) 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); } @@ -979,7 +979,7 @@ static void validate_used_list(void) { 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) > @@ -989,13 +989,13 @@ static void validate_used_list(void) 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) @@ -1004,7 +1004,7 @@ static void validate_used_list(void) "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; @@ -1035,19 +1035,19 @@ static void check_duplicates(HDR* blk) { 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); } @@ -1060,13 +1060,13 @@ static void check_duplicates(HDR* blk) 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; @@ -1460,7 +1460,7 @@ ExRosQueryNonPagedPoolTag ( PVOID Addr ) { 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; } @@ -1510,7 +1510,7 @@ void check_redzone_header(HDR_USED* hdr) 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 @@ -1728,7 +1728,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to allocate a page\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Status = MmCreateVirtualMapping(NULL, @@ -1739,7 +1739,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } Address = (PVOID)((ULONG_PTR)Address + PAGE_SIZE); } diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index cca7c871abe..bc28ddb3e73 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -205,7 +205,7 @@ MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER first = mid + 1; } } - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); #if defined(__GNUC__) return (LARGE_INTEGER)0LL; @@ -237,7 +237,7 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(STATUS_UNSUCCESSFUL); } @@ -247,13 +247,13 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) 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); @@ -298,7 +298,7 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(STATUS_UNSUCCESSFUL); } @@ -308,13 +308,13 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) 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); @@ -450,13 +450,13 @@ MmFreeSwapPage(SWAPENTRY Entry) 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); @@ -504,7 +504,7 @@ MmAllocSwapPage(VOID) off = MiAllocPageFromPagingFile(PagingFileList[i]); if (off == 0xFFFFFFFF) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); KeReleaseSpinLock(&PagingFileListLock, oldIrql); return(STATUS_UNSUCCESSFUL); } @@ -518,7 +518,7 @@ MmAllocSwapPage(VOID) } KeReleaseSpinLock(&PagingFileListLock, oldIrql); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(0); } diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index a0d0eb2eb0c..02a84e36468 100644 --- a/reactos/ntoskrnl/mm/pageop.c +++ b/reactos/ntoskrnl/mm/pageop.c @@ -66,7 +66,7 @@ MmReleasePageOp(PMM_PAGEOP PageOp) PrevPageOp = PrevPageOp->Next; } KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } PMM_PAGEOP @@ -211,7 +211,7 @@ MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, if (PageOp == NULL) { KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); return(NULL); } diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index 31de2086424..a9b93b351c2 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -217,7 +217,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create thread stack\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } /* @@ -241,7 +241,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Could not create Virtual Mapping for Kernel Stack\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } /* Return the stack base */ @@ -715,7 +715,7 @@ MmDeleteProcessAddressSpace(PEPROCESS Process) break; default: - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } } diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index cf6b00fa5b1..29fd9e9bdaa 100644 --- a/reactos/ntoskrnl/mm/rmap.c +++ b/reactos/ntoskrnl/mm/rmap.c @@ -81,7 +81,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (Address < MmSystemRangeStart) { @@ -177,7 +177,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) } else { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (Address < MmSystemRangeStart) { @@ -211,7 +211,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (Address < MmSystemRangeStart) @@ -301,7 +301,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) } else { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } if (Address < MmSystemRangeStart) { @@ -321,7 +321,7 @@ MmSetCleanAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } while (current_entry != NULL) { @@ -342,7 +342,7 @@ MmSetDirtyAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } while (current_entry != NULL) { @@ -392,7 +392,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, new_entry = ExAllocateFromNPagedLookasideList(&RmapLookasideList); if (new_entry == NULL) { - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } new_entry->Address = Address; new_entry->Process = (PEPROCESS)Process; @@ -410,7 +410,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, "address 0x%.8X\n", Process->UniqueProcessId, Address, MmGetPfnForProcess(Process, Address) << PAGE_SHIFT, Page << PAGE_SHIFT); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } ExAcquireFastMutex(&RmapListLock); @@ -427,7 +427,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, DbgPrint("\n previous caller "); DbgPrint("%p", current_entry->Caller); DbgPrint("\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } current_entry = current_entry->Next; } @@ -463,7 +463,7 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, if (current_entry == NULL) { DPRINT1("MmDeleteAllRmaps: No rmaps.\n"); - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); } MmSetRmapListHeadPage(Page, NULL); ExReleaseFastMutex(&RmapListLock); @@ -527,5 +527,5 @@ MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, previous_entry = current_entry; current_entry = current_entry->Next; } - ASSERT(FALSE); + KeBugCheck(MEMORY_MANAGEMENT); }