From 13362ee99beb5b8bb72b133e57e547dd72d6841e Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 24 Aug 2008 15:48:05 +0000 Subject: [PATCH] - Remove KEBUGCHECK and KEBUGCHECKEX macros - Replace "KeBugCheck(0)" by ASSERT(FALSE) - Replace deprecated "CPRINT" by DRINT1 svn path=/trunk/; revision=35600 --- reactos/drivers/filesystems/fastfat/fcb.c | 2 +- reactos/drivers/filesystems/fastfat/rw.c | 6 +- reactos/drivers/filesystems/npfs/rw.c | 10 +- reactos/hal/hal/hal.c | 6 +- reactos/hal/halx86/generic/bus.c | 2 +- reactos/hal/halx86/generic/dma.c | 2 +- reactos/hal/halx86/generic/profil.c | 6 +- reactos/hal/halx86/mp/apic.c | 6 +- reactos/hal/halx86/mp/halinit_mp.c | 4 +- reactos/hal/halx86/mp/ioapic.c | 4 +- reactos/hal/halx86/mp/mpconfig.c | 20 ++-- reactos/hal/halx86/mp/mpsirql.c | 16 +-- reactos/hal/halx86/mp/processor_mp.c | 6 +- reactos/ntoskrnl/cc/copy.c | 4 +- reactos/ntoskrnl/cc/fs.c | 4 +- reactos/ntoskrnl/cc/view.c | 14 +-- reactos/ntoskrnl/config/cmse.c | 16 +-- reactos/ntoskrnl/config/cmsysini.c | 28 ++--- reactos/ntoskrnl/config/cmvalue.c | 2 +- reactos/ntoskrnl/dbgk/dbgkobj.c | 4 +- reactos/ntoskrnl/ex/callback.c | 2 +- reactos/ntoskrnl/ex/handle.c | 4 +- reactos/ntoskrnl/ex/init.c | 14 +-- reactos/ntoskrnl/ex/locale.c | 4 +- reactos/ntoskrnl/ex/shutdown.c | 6 +- reactos/ntoskrnl/ex/work.c | 6 +- reactos/ntoskrnl/include/internal/cc.h | 9 -- reactos/ntoskrnl/include/internal/ob_x.h | 2 +- reactos/ntoskrnl/io/iomgr/device.c | 2 +- reactos/ntoskrnl/io/iomgr/driver.c | 2 +- reactos/ntoskrnl/io/iomgr/file.c | 4 +- reactos/ntoskrnl/io/iomgr/remlock.c | 6 +- reactos/ntoskrnl/io/iomgr/volume.c | 2 +- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 34 +++--- reactos/ntoskrnl/io/pnpmgr/pnproot.c | 6 +- reactos/ntoskrnl/kd/kdmain.c | 2 +- reactos/ntoskrnl/kdbg/kdb.c | 2 +- reactos/ntoskrnl/kdbg/kdb_cli.c | 2 +- reactos/ntoskrnl/ke/apc.c | 2 +- reactos/ntoskrnl/ke/clock.c | 2 +- reactos/ntoskrnl/ke/freeldr.c | 2 +- reactos/ntoskrnl/ke/i386/kiinit.c | 2 +- reactos/ntoskrnl/ke/i386/usercall.c | 2 +- reactos/ntoskrnl/ke/powerpc/exp.c | 2 +- reactos/ntoskrnl/ke/procobj.c | 6 +- reactos/ntoskrnl/ke/thrdschd.c | 6 +- reactos/ntoskrnl/ke/wait.c | 4 +- reactos/ntoskrnl/lpc/close.c | 2 +- reactos/ntoskrnl/mm/anonmem.c | 16 +-- reactos/ntoskrnl/mm/balance.c | 18 +-- reactos/ntoskrnl/mm/freelist.c | 44 ++++---- reactos/ntoskrnl/mm/i386/page.c | 74 ++++++------ reactos/ntoskrnl/mm/i386/pagepae.c | 130 +++++++++++----------- reactos/ntoskrnl/mm/iospace.c | 2 +- reactos/ntoskrnl/mm/marea.c | 6 +- reactos/ntoskrnl/mm/mdlsup.c | 4 +- reactos/ntoskrnl/mm/mm.c | 6 +- reactos/ntoskrnl/mm/mpw.c | 2 +- reactos/ntoskrnl/mm/npool.c | 34 +++--- reactos/ntoskrnl/mm/pagefile.c | 22 ++-- reactos/ntoskrnl/mm/pageop.c | 4 +- reactos/ntoskrnl/mm/pool.c | 2 +- reactos/ntoskrnl/mm/powerpc/page.c | 28 ++--- reactos/ntoskrnl/mm/procsup.c | 8 +- reactos/ntoskrnl/mm/rmap.c | 22 ++-- reactos/ntoskrnl/mm/section.c | 116 +++++++++---------- reactos/ntoskrnl/ob/obdir.c | 4 +- reactos/ntoskrnl/ob/obhandle.c | 14 +-- reactos/ntoskrnl/ob/oblink.c | 2 +- reactos/ntoskrnl/po/power.c | 2 +- reactos/ntoskrnl/ps/kill.c | 16 +-- reactos/ntoskrnl/ps/process.c | 2 +- reactos/ntoskrnl/ps/security.c | 2 +- reactos/ntoskrnl/rtl/libsupp.c | 10 +- reactos/ntoskrnl/se/audit.c | 2 +- reactos/ntoskrnl/se/token.c | 2 +- 76 files changed, 443 insertions(+), 452 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/fcb.c b/reactos/drivers/filesystems/fastfat/fcb.c index 8ae22b8411d..f4323048f2b 100644 --- a/reactos/drivers/filesystems/fastfat/fcb.c +++ b/reactos/drivers/filesystems/fastfat/fcb.c @@ -81,7 +81,7 @@ vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU) { /* FIXME: what to do if no more memory? */ DPRINT1("Unable to initialize FCB for filename '%wZ'\n", NameU); - KEBUGCHECKEX(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); + KeBugCheckEx(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); } Fcb->PathNameU.Length = 0; diff --git a/reactos/drivers/filesystems/fastfat/rw.c b/reactos/drivers/filesystems/fastfat/rw.c index 11ed87212ae..fb7083dd1c5 100644 --- a/reactos/drivers/filesystems/fastfat/rw.c +++ b/reactos/drivers/filesystems/fastfat/rw.c @@ -69,7 +69,7 @@ OffsetToCluster(PDEVICE_EXTENSION DeviceExt, if (FirstCluster == 0) { DbgPrint("OffsetToCluster is called with FirstCluster = 0!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (FirstCluster == 1) @@ -233,7 +233,7 @@ VfatReadFileData (PVFAT_IRP_CONTEXT IrpContext, ROUND_DOWN(ReadOffset.u.LowPart, BytesPerCluster), &CorrectCluster, FALSE); if (CorrectCluster != CurrentCluster) - KEBUGCHECK(FAT_FILE_SYSTEM); + KeBugCheck(FAT_FILE_SYSTEM); } #endif } @@ -442,7 +442,7 @@ VfatWriteFileData(PVFAT_IRP_CONTEXT IrpContext, ROUND_DOWN(WriteOffset.u.LowPart, BytesPerCluster), &CorrectCluster, FALSE); if (CorrectCluster != CurrentCluster) - KEBUGCHECK(FAT_FILE_SYSTEM); + KeBugCheck(FAT_FILE_SYSTEM); } #endif } diff --git a/reactos/drivers/filesystems/npfs/rw.c b/reactos/drivers/filesystems/npfs/rw.c index e5793b5bab2..f0e65f0f8bc 100644 --- a/reactos/drivers/filesystems/npfs/rw.c +++ b/reactos/drivers/filesystems/npfs/rw.c @@ -80,7 +80,7 @@ NpfsReadWriteCancelRoutine(IN PDEVICE_OBJECT DeviceObject, } break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } ExReleaseFastMutex(&Ccb->DataListLock); KeUnlockMutex(&DeviceExt->PipeListLock); @@ -130,7 +130,7 @@ NpfsWaiterThread(PVOID InitContext) NpfsRead(IoStack->DeviceObject, Irp); break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -148,7 +148,7 @@ NpfsWaiterThread(PVOID InitContext) ThreadContext->WaitBlockArray); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeLockMutex(&ThreadContext->DeviceExt->PipeListLock); Count = Status - STATUS_SUCCESS; @@ -185,7 +185,7 @@ NpfsWaiterThread(PVOID InitContext) } break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } ExReleaseFastMutex(&Ccb->DataListLock); } @@ -357,7 +357,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject, NULL); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } ExAcquireFastMutex(&Ccb->DataListLock); } diff --git a/reactos/hal/hal/hal.c b/reactos/hal/hal/hal.c index 6448f3b2051..93190959ddf 100644 --- a/reactos/hal/hal/hal.c +++ b/reactos/hal/hal/hal.c @@ -49,7 +49,7 @@ VOID NTAPI HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -60,7 +60,7 @@ VOID NTAPI HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -71,7 +71,7 @@ ULONG_PTR NTAPI HalSetProfileInterval(IN ULONG_PTR Interval) { - KEBUGCHECK(0); + ASSERT(FALSE); return Interval; } diff --git a/reactos/hal/halx86/generic/bus.c b/reactos/hal/halx86/generic/bus.c index a35adbe315a..9b708a296a5 100644 --- a/reactos/hal/halx86/generic/bus.c +++ b/reactos/hal/halx86/generic/bus.c @@ -222,7 +222,7 @@ HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType, else if (BusDataType == EisaConfiguration) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } else if ((BusDataType == PCIConfiguration) && (HalpPCIConfigInitialized) && diff --git a/reactos/hal/halx86/generic/dma.c b/reactos/hal/halx86/generic/dma.c index 804bf782f6b..d55a56b5a6f 100644 --- a/reactos/hal/halx86/generic/dma.c +++ b/reactos/hal/halx86/generic/dma.c @@ -1487,7 +1487,7 @@ HalpCopyBufferMap( */ /* FIXME: The correct bug check code isn't defined. */ /* KEBUGCHECKEX(HAL_MEMORY_ALLOCATION, PAGE_SIZE, 0, (ULONG_PTR)__FILE__, 0); */ - KEBUGCHECK(0); + ASSERT(FALSE);; } CurrentAddress = (ULONG_PTR)VirtualAddress + diff --git a/reactos/hal/halx86/generic/profil.c b/reactos/hal/halx86/generic/profil.c index e98e982a906..4db4839d0eb 100644 --- a/reactos/hal/halx86/generic/profil.c +++ b/reactos/hal/halx86/generic/profil.c @@ -21,7 +21,7 @@ VOID NTAPI HalStopProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -32,7 +32,7 @@ VOID NTAPI HalStartProfileInterrupt(IN KPROFILE_SOURCE ProfileSource) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -43,6 +43,6 @@ ULONG_PTR NTAPI HalSetProfileInterval(IN ULONG_PTR Interval) { - KEBUGCHECK(0); + ASSERT(FALSE); return Interval; } diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index aec51e4fc2a..80c1184f420 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -939,7 +939,7 @@ VOID HaliInitBSP(VOID) /* Only initialize the BSP once */ if (BSPInitialized) { - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -961,7 +961,7 @@ VOID HaliInitBSP(VOID) else { DPRINT("No APIC found\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (APICMode == amPIC) @@ -1013,7 +1013,7 @@ HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack) Cpu >= CPUCount || OnlineCPUs & (1 << Cpu)) { - KEBUGCHECK(0); + ASSERT(FALSE); } DPRINT1("Attempting to boot CPU %d\n", Cpu); diff --git a/reactos/hal/halx86/mp/halinit_mp.c b/reactos/hal/halx86/mp/halinit_mp.c index f22d932225b..89f023f2122 100644 --- a/reactos/hal/halx86/mp/halinit_mp.c +++ b/reactos/hal/halx86/mp/halinit_mp.c @@ -43,14 +43,14 @@ HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock) if (MPSInitialized) { - KEBUGCHECK(0); + ASSERT(FALSE); } MPSInitialized = TRUE; if (!HaliFindSmpConfig()) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* store the kernel base for later use */ diff --git a/reactos/hal/halx86/mp/ioapic.c b/reactos/hal/halx86/mp/ioapic.c index 34dbb6cdf51..a9366e64e71 100644 --- a/reactos/hal/halx86/mp/ioapic.c +++ b/reactos/hal/halx86/mp/ioapic.c @@ -256,7 +256,7 @@ AssignIrqVector(ULONG irq) else if (current_vector == FIRST_SYSTEM_VECTOR) { DPRINT1("Ran out of interrupt sources!"); - KEBUGCHECK(0); + ASSERT(FALSE); } vector = current_vector; @@ -489,7 +489,7 @@ IOAPICSetupIds(VOID) if (GET_IOAPIC_ID(tmp) != IOAPICMap[apic].ApicId) { DPRINT1("Could not set I/O APIC ID!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } diff --git a/reactos/hal/halx86/mp/mpconfig.c b/reactos/hal/halx86/mp/mpconfig.c index f14e50865aa..88e6e009bf8 100644 --- a/reactos/hal/halx86/mp/mpconfig.c +++ b/reactos/hal/halx86/mp/mpconfig.c @@ -45,7 +45,7 @@ HaliMPIntSrcInfo(PMP_CONFIGURATION_INTSRC m) if (IRQCount > MAX_IRQ_SOURCE) { DPRINT1("Max # of irq sources exceeded!!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } IRQMap[IRQCount] = *m; @@ -217,7 +217,7 @@ HaliMPIOApicInfo(PMP_CONFIGURATION_IOAPIC m) DPRINT("Max # of I/O APICs (%d) exceeded (found %d).\n", MAX_IOAPIC, IOAPICCount); DPRINT1("Recompile with bigger MAX_IOAPIC!.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } IOAPICMap[IOAPICCount].ApicId = m->ApicId; @@ -245,12 +245,12 @@ HaliMPIntLocalInfo(PMP_CONFIGURATION_INTLOCAL m) if ((m->IrqType == INT_EXTINT) && (m->DstApicLInt != 0)) { DPRINT1("Invalid MP table!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if ((m->IrqType == INT_NMI) && (m->DstApicLInt != 1)) { DPRINT1("Invalid MP table!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -271,14 +271,14 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) DPRINT1("Bad MP configuration block signature: %c%c%c%c\n", pc[0], pc[1], pc[2], pc[3]); - KEBUGCHECKEX(0, pc[0], pc[1], pc[2], pc[3]); + KeBugCheckEx(0, pc[0], pc[1], pc[2], pc[3]); return FALSE; } if (MPChecksum((PUCHAR)Table, Table->Length)) { DPRINT1("Bad MP configuration block checksum\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -286,7 +286,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) { DPRINT1("Bad MP configuration table version (%d)\n", Table->Specification); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -294,7 +294,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) { DPRINT1("APIC base address is at 0x%X. I cannot handle non-standard adresses\n", Table->LocalAPICAddress); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -346,7 +346,7 @@ HaliReadMPConfigTable(PMP_CONFIGURATION_TABLE Table) } default: DPRINT1("Unknown entry in MPC table\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } } @@ -597,7 +597,7 @@ HaliGetSmpConfig(VOID) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } return TRUE; } diff --git a/reactos/hal/halx86/mp/mpsirql.c b/reactos/hal/halx86/mp/mpsirql.c index 3919b1e94ab..673ac5af844 100644 --- a/reactos/hal/halx86/mp/mpsirql.c +++ b/reactos/hal/halx86/mp/mpsirql.c @@ -37,7 +37,7 @@ KIRQL STDCALL KeGetCurrentIrql (VOID) if (irql > HIGH_LEVEL) { DPRINT1 ("CurrentIrql %x\n", irql); - KEBUGCHECK (0); + ASSERT(FALSE); } if (Flags & EFLAGS_INTERRUPT_MASK) { @@ -57,7 +57,7 @@ VOID KeSetCurrentIrql (KIRQL NewIrql) if (NewIrql > HIGH_LEVEL) { DPRINT1 ("NewIrql %x\n", NewIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } Ke386SaveFlags(Flags); _disable(); @@ -138,7 +138,7 @@ KfLowerIrql (KIRQL NewIrql) if (NewIrql > oldIrql) { DPRINT1 ("NewIrql %x CurrentIrql %x\n", NewIrql, oldIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } HalpLowerIrql (NewIrql, FALSE); } @@ -198,7 +198,7 @@ KfRaiseIrql (KIRQL NewIrql) if (NewIrql < OldIrql) { DPRINT1 ("CurrentIrql %x NewIrql %x\n", KeGetCurrentIrql (), NewIrql); - KEBUGCHECK (0); + ASSERT(FALSE); } @@ -301,14 +301,14 @@ HalBeginSystemInterrupt (KIRQL Irql, if (KeGetCurrentIrql () >= Irql) { DPRINT1("current irql %d, new irql %d\n", KeGetCurrentIrql(), Irql); - KEBUGCHECK(0); + ASSERT(FALSE); } Ke386SaveFlags(Flags); if (Flags & EFLAGS_INTERRUPT_MASK) { DPRINT1("HalBeginSystemInterrupt was called with interrupt's enabled\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } APICWrite (APIC_TPR, IRQL2TPR (Irql) & APIC_TPR_PRI); *OldIrql = KeGetCurrentIrql (); @@ -330,7 +330,7 @@ HalEndSystemInterrupt (KIRQL Irql, if (Flags & EFLAGS_INTERRUPT_MASK) { DPRINT1("HalEndSystemInterrupt was called with interrupt's enabled\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } APICSendEOI(); HalpLowerIrql (Irql, TRUE); @@ -394,7 +394,7 @@ HalRequestSoftwareInterrupt(IN KIRQL Request) break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/hal/halx86/mp/processor_mp.c b/reactos/hal/halx86/mp/processor_mp.c index 442d403d948..2deb0f5eb68 100644 --- a/reactos/hal/halx86/mp/processor_mp.c +++ b/reactos/hal/halx86/mp/processor_mp.c @@ -31,7 +31,7 @@ HalInitializeProcessor(ULONG ProcessorNumber, CPU = ThisCPU(); if (OnlineCPUs & (1 << CPU)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (ProcessorNumber == 0) @@ -70,7 +70,7 @@ HalAllProcessorsStarted (VOID) } if (CPUs > CPUCount) { - KEBUGCHECK(0); + ASSERT(FALSE); } else if (CPUs == CPUCount) { @@ -108,7 +108,7 @@ HalStartNextProcessor( if (CPU >= CPUCount) { - KEBUGCHECK(0); + ASSERT(FALSE); } DPRINT1("Attempting to boot CPU %d\n", CPU); diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index c7c5ea532f9..8397d912951 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -47,13 +47,13 @@ CcInitCacheZeroPage(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Can't allocate CcZeroPage.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } Status = MiZeroPage(CcZeroPage); if (!NT_SUCCESS(Status)) { DbgPrint("Can't zero out CcZeroPage.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } } diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 9f7324c9c22..e6fa791a7f5 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -183,7 +183,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, else { DPRINT1("Anyone has referenced a cache segment behind the new size.\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } } } @@ -202,7 +202,7 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, if (!NT_SUCCESS(Status)) { DPRINT1("CcRosInternalFreeCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + KeBugCheck(CACHE_MANAGER); } } } diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 5155b2296c1..982c85add3d 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -485,7 +485,7 @@ CcRosMarkDirtyCacheSegment(PBCB Bcb, ULONG FileOffset) CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); if (CacheSeg == NULL) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } if (!CacheSeg->Dirty) { @@ -674,7 +674,7 @@ CcRosCreateCacheSegment(PBCB Bcb, if (StartingOffset == 0xffffffff) { DPRINT1("Out of CacheSeg mapping space\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } current->BaseAddress = CiCacheSegMappingRegionBase + StartingOffset * PAGE_SIZE; @@ -700,7 +700,7 @@ CcRosCreateCacheSegment(PBCB Bcb, MmUnlockAddressSpace(MmGetKernelAddressSpace()); if (!NT_SUCCESS(Status)) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } #endif @@ -834,9 +834,9 @@ CcRosRequestCacheSegment(PBCB Bcb, if ((FileOffset % Bcb->CacheSegmentSize) != 0) { - CPRINT("Bad fileoffset %x should be multiple of %x", + DPRINT1("Bad fileoffset %x should be multiple of %x", FileOffset, Bcb->CacheSegmentSize); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } return(CcRosGetCacheSegment(Bcb, @@ -1339,7 +1339,7 @@ CmLazyCloseThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DbgPrint("LazyCloseThread: Wait failed\n"); - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); break; } if (LazyCloseThreadShouldTerminate) @@ -1401,7 +1401,7 @@ CcInitView(VOID) MmUnlockAddressSpace(MmGetKernelAddressSpace()); if (!NT_SUCCESS(Status)) { - KEBUGCHECKCC; + KeBugCheck(CACHE_MANAGER); } Buffer = ExAllocatePool(NonPagedPool, CI_CACHESEG_MAPPING_REGION_SIZE / (PAGE_SIZE * 8)); diff --git a/reactos/ntoskrnl/config/cmse.c b/reactos/ntoskrnl/config/cmse.c index 80d56dde569..16e91241688 100644 --- a/reactos/ntoskrnl/config/cmse.c +++ b/reactos/ntoskrnl/config/cmse.c @@ -43,7 +43,7 @@ CmpHiveRootSecurityDescriptor(VOID) if (!(Sid[0]) || !(Sid[1]) || !(Sid[2]) || !(Sid[3])) { /* Bugcheck */ - KEBUGCHECKEX(REGISTRY_ERROR, 11, 1, 0, 0); + KeBugCheckEx(REGISTRY_ERROR, 11, 1, 0, 0); } /* Phase 2: Initialize all SIDs */ @@ -51,7 +51,7 @@ CmpHiveRootSecurityDescriptor(VOID) Status |= RtlInitializeSid(Sid[1], &NtAuthority, 1); Status |= RtlInitializeSid(Sid[2], &NtAuthority, 1); Status |= RtlInitializeSid(Sid[3], &NtAuthority, 2); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 2, 0, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 2, 0, 0); /* Phase 2: Setup SID Sub Authorities */ *RtlSubAuthoritySid(Sid[0], 0) = SECURITY_WORLD_RID; @@ -78,18 +78,18 @@ CmpHiveRootSecurityDescriptor(VOID) /* Phase 3: Allocate the ACL */ Acl = ExAllocatePoolWithTag(PagedPool, AclLength, TAG_CM); - if (!Acl) KEBUGCHECKEX(REGISTRY_ERROR, 11, 3, 0, 0); + if (!Acl) KeBugCheckEx(REGISTRY_ERROR, 11, 3, 0, 0); /* Phase 4: Create the ACL */ Status = RtlCreateAcl(Acl, AclLength, ACL_REVISION); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 4, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 4, Status, 0); /* Phase 5: Build the ACL */ Status = RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_ALL_ACCESS, Sid[0]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_ALL_ACCESS, Sid[1]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_READ, Sid[2]); Status |= RtlAddAccessAllowedAce(Acl, ACL_REVISION, KEY_READ, Sid[3]); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 5, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 5, Status, 0); /* Phase 5: Make the ACEs inheritable */ Status = RtlGetAce(Acl, 0,( PVOID*)&AceHeader); @@ -110,7 +110,7 @@ CmpHiveRootSecurityDescriptor(VOID) sizeof(SECURITY_DESCRIPTOR) + AclLength, TAG_CM); - if (!SecurityDescriptor) KEBUGCHECKEX(REGISTRY_ERROR, 11, 6, 0, 0); + if (!SecurityDescriptor) KeBugCheckEx(REGISTRY_ERROR, 11, 6, 0, 0); /* Phase 6: Make a copy of the ACL */ AclCopy = (PACL)((PISECURITY_DESCRIPTOR)SecurityDescriptor + 1); @@ -119,14 +119,14 @@ CmpHiveRootSecurityDescriptor(VOID) /* Phase 7: Create the security descriptor */ Status = RtlCreateSecurityDescriptor(SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 7, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 7, Status, 0); /* Phase 8: Set the ACL as a DACL */ Status = RtlSetDaclSecurityDescriptor(SecurityDescriptor, TRUE, AclCopy, FALSE); - if (!NT_SUCCESS(Status)) KEBUGCHECKEX(REGISTRY_ERROR, 11, 8, Status, 0); + if (!NT_SUCCESS(Status)) KeBugCheckEx(REGISTRY_ERROR, 11, 8, Status, 0); /* Free the SIDs and original ACL */ for (i = 0; i < 4; i++) ExFreePool(Sid[i]); diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index d96919bfa45..50c40eb5460 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -643,7 +643,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) if (!Buffer) { /* Fail */ - KEBUGCHECKEX(BAD_SYSTEM_CONFIG_INFO, 3, 1, (ULONG_PTR)LoaderBlock, 0); + KeBugCheckEx(BAD_SYSTEM_CONFIG_INFO, 3, 1, (ULONG_PTR)LoaderBlock, 0); } /* Setup the unicode string */ @@ -716,7 +716,7 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) if (CmpBootType & 4) { /* We're disabled, so bugcheck */ - KEBUGCHECKEX(BAD_SYSTEM_CONFIG_INFO, + KeBugCheckEx(BAD_SYSTEM_CONFIG_INFO, 3, 3, (ULONG_PTR)SystemHive, @@ -1346,7 +1346,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 1, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 1, Status, 0); } /* Build the master hive */ @@ -1363,14 +1363,14 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 2, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 2, Status, 0); } /* Create the \REGISTRY key node */ if (!CmpCreateRegistryRoot()) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 3, 0, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 3, 0, 0); } /* Create the default security descriptor */ @@ -1393,7 +1393,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 5, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 5, Status, 0); } /* Close the handle */ @@ -1416,7 +1416,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 6, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 6, Status, 0); } /* Close the handle */ @@ -1426,7 +1426,7 @@ CmInitSystem1(VOID) if (!CmpInitializeSystemHive(KeLoaderBlock)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 7, 0, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 7, 0, 0); } /* Create the 'CurrentControlSet' link. */ @@ -1434,7 +1434,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 8, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 8, Status, 0); } /* Create the hardware hive */ @@ -1451,7 +1451,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 11, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 11, Status, 0); } /* Add the hive to the hive list */ @@ -1467,7 +1467,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0); } /* FIXME: Add to HiveList key */ @@ -1480,7 +1480,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 13, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 13, Status, 0); } /* Initialize machine-dependent information into the registry */ @@ -1488,7 +1488,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0); } /* Initialize volatile registry settings */ @@ -1496,7 +1496,7 @@ CmInitSystem1(VOID) if (!NT_SUCCESS(Status)) { /* Bugcheck */ - KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 15, Status, 0); + KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 15, Status, 0); } /* Free the load options */ diff --git a/reactos/ntoskrnl/config/cmvalue.c b/reactos/ntoskrnl/config/cmvalue.c index 5eb5976e568..5ccd8372bfc 100644 --- a/reactos/ntoskrnl/config/cmvalue.c +++ b/reactos/ntoskrnl/config/cmvalue.c @@ -189,7 +189,7 @@ CmpValueToData(IN PHHIVE Hive, { /* Free the buffer and bugcheck */ ExFreePool(Buffer); - KEBUGCHECKEX(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value); + KeBugCheckEx(REGISTRY_ERROR, 8, 0, (ULONG_PTR)Hive, (ULONG_PTR)Value); } /* Otherwise, return the cell data */ diff --git a/reactos/ntoskrnl/dbgk/dbgkobj.c b/reactos/ntoskrnl/dbgk/dbgkobj.c index 2495dc51551..bc8c0c4c96b 100644 --- a/reactos/ntoskrnl/dbgk/dbgkobj.c +++ b/reactos/ntoskrnl/dbgk/dbgkobj.c @@ -712,7 +712,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, { /* We failed. FIXME: Handle this */ DPRINT1("Unhandled Dbgk codepath!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Check if this was the first message */ @@ -736,7 +736,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process, { /* We failed. FIXME: Handle this */ DPRINT1("Unhandled Dbgk codepath!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Make sure we have a first thread */ diff --git a/reactos/ntoskrnl/ex/callback.c b/reactos/ntoskrnl/ex/callback.c index e5c21205b1e..429b0953719 100644 --- a/reactos/ntoskrnl/ex/callback.c +++ b/reactos/ntoskrnl/ex/callback.c @@ -177,7 +177,7 @@ ExReferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack) /* FIXME: Race */ CallbackRoutineBlock = NULL; DPRINT1("Unhandled callback race condition\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } else { diff --git a/reactos/ntoskrnl/ex/handle.c b/reactos/ntoskrnl/ex/handle.c index 0cea474313e..efd27aea42c 100644 --- a/reactos/ntoskrnl/ex/handle.c +++ b/reactos/ntoskrnl/ex/handle.c @@ -661,7 +661,7 @@ ExpMoveFreeHandles(IN PHANDLE_TABLE HandleTable) } /* We are strict FIFO, we need to reverse the entries */ - KEBUGCHECK(0); + ASSERT(FALSE); return LastFree; } @@ -958,7 +958,7 @@ ExDestroyHandleTable(IN PHANDLE_TABLE HandleTable, if (DestroyHandleProcedure) { /* FIXME: */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Free the handle table */ diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 2ecfb63d53a..4ce02eb6a69 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -981,7 +981,7 @@ ExpInitializeExecutive(IN ULONG Cpu, /* Now fill it in */ Status = RtlAnsiStringToUnicodeString(&NtSystemRoot, &AnsiPath, FALSE); - if (!NT_SUCCESS(Status)) KEBUGCHECK(SESSION3_INITIALIZATION_FAILED); + if (!NT_SUCCESS(Status)) KeBugCheck(SESSION3_INITIALIZATION_FAILED); /* Setup bugcheck messages */ KiInitializeBugCheck(); @@ -1002,7 +1002,7 @@ ExpInitializeExecutive(IN ULONG Cpu, } /* Initialize the executive at phase 0 */ - if (!ExInitSystem()) KEBUGCHECK(PHASE0_INITIALIZATION_FAILED); + if (!ExInitSystem()) KeBugCheck(PHASE0_INITIALIZATION_FAILED); /* Initialize the memory manager at phase 0 */ if (!MmInitSystem(0, LoaderBlock)) KeBugCheck(PHASE0_INITIALIZATION_FAILED); @@ -1203,16 +1203,16 @@ ExpInitializeExecutive(IN ULONG Cpu, #endif /* Create the Basic Object Manager Types to allow new Object Types */ - if (!ObInitSystem()) KEBUGCHECK(OBJECT_INITIALIZATION_FAILED); + if (!ObInitSystem()) KeBugCheck(OBJECT_INITIALIZATION_FAILED); /* Load basic Security for other Managers */ - if (!SeInitSystem()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED); + if (!SeInitSystem()) KeBugCheck(SECURITY_INITIALIZATION_FAILED); /* Initialize the Process Manager */ - if (!PsInitSystem(LoaderBlock)) KEBUGCHECK(PROCESS_INITIALIZATION_FAILED); + if (!PsInitSystem(LoaderBlock)) KeBugCheck(PROCESS_INITIALIZATION_FAILED); /* Initialize the PnP Manager */ - if (!PpInitSystem()) KEBUGCHECK(PP0_INITIALIZATION_FAILED); + if (!PpInitSystem()) KeBugCheck(PP0_INITIALIZATION_FAILED); /* Initialize the User-Mode Debugging Subsystem */ DbgkInitialize(); @@ -1532,7 +1532,7 @@ Phase1InitializationDiscard(IN PVOID Context) } /* Initialize the SRM in Phase 1 */ - if (!SeInitSystem()) KEBUGCHECK(SECURITY1_INITIALIZATION_FAILED); + if (!SeInitSystem()) KeBugCheck(SECURITY1_INITIALIZATION_FAILED); /* Update the progress bar */ InbvUpdateProgressBar(10); diff --git a/reactos/ntoskrnl/ex/locale.c b/reactos/ntoskrnl/ex/locale.c index b50eef2a396..bf1bf5047de 100644 --- a/reactos/ntoskrnl/ex/locale.c +++ b/reactos/ntoskrnl/ex/locale.c @@ -245,7 +245,7 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile, { DPRINT1("TODO\n"); Status = STATUS_SUCCESS; - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -395,7 +395,7 @@ NtSetDefaultUILanguage(IN LANGID LanguageId) { /* FIXME */ DPRINT1("TODO\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Otherwise, call the internal routine */ diff --git a/reactos/ntoskrnl/ex/shutdown.c b/reactos/ntoskrnl/ex/shutdown.c index cee5482b087..bb3a0e74fc8 100644 --- a/reactos/ntoskrnl/ex/shutdown.c +++ b/reactos/ntoskrnl/ex/shutdown.c @@ -185,7 +185,7 @@ ShutdownThreadMain(PVOID Context) PKDPC Dpc = ExAllocatePool(NonPagedPool, sizeof(KDPC)); if (Dpc == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeInitializeDpc(Dpc, KiHaltProcessorDpcRoutine, (PVOID)Dpc); KeSetTargetProcessorDpc(Dpc, i); @@ -245,7 +245,7 @@ NtShutdownSystem(IN SHUTDOWN_ACTION Action) (PVOID)Action); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = ObReferenceObjectByHandle(ThreadHandle, THREAD_ALL_ACCESS, @@ -256,7 +256,7 @@ NtShutdownSystem(IN SHUTDOWN_ACTION Action) NtClose(ThreadHandle); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeSetPriorityThread(&ShutdownThread->Tcb, LOW_REALTIME_PRIORITY + 1); diff --git a/reactos/ntoskrnl/ex/work.c b/reactos/ntoskrnl/ex/work.c index c17f498e4ed..f735b1749f3 100644 --- a/reactos/ntoskrnl/ex/work.c +++ b/reactos/ntoskrnl/ex/work.c @@ -177,7 +177,7 @@ ProcessLoop: if (KeGetCurrentIrql() != PASSIVE_LEVEL) { /* It didn't, bugcheck! */ - KEBUGCHECKEX(WORKER_THREAD_RETURNED_AT_BAD_IRQL, + KeBugCheckEx(WORKER_THREAD_RETURNED_AT_BAD_IRQL, (ULONG_PTR)WorkItem->WorkerRoutine, KeGetCurrentIrql(), (ULONG_PTR)WorkItem->Parameter, @@ -188,7 +188,7 @@ ProcessLoop: if (Thread->ActiveImpersonationInfo) { /* It didn't, bugcheck! */ - KEBUGCHECKEX(IMPERSONATING_WORKER_THREAD, + KeBugCheckEx(IMPERSONATING_WORKER_THREAD, (ULONG_PTR)WorkItem->WorkerRoutine, (ULONG_PTR)WorkItem->Parameter, (ULONG_PTR)WorkItem, @@ -628,7 +628,7 @@ ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, if ((ULONG_PTR)WorkItem->WorkerRoutine < MmUserProbeAddress) { /* Bugcheck the system */ - KEBUGCHECKEX(WORKER_INVALID, + KeBugCheckEx(WORKER_INVALID, 1, (ULONG_PTR)WorkItem, (ULONG_PTR)WorkItem->WorkerRoutine, diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index c1ab3cffbd9..9993fc81f11 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -301,13 +301,4 @@ NTSTATUS NTAPI CcTryToInitializeFileCache(PFILE_OBJECT FileObject); -/* - * Macro for generic cache manage bugchecking. Note that this macro assumes - * that the file name including extension is always longer than 4 characters. - */ -#define KEBUGCHECKCC \ - KEBUGCHECKEX(CACHE_MANAGER, \ - (*(ULONG*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \ - (__LINE__ & 0xFFFF), 0, 0, 0) - #endif diff --git a/reactos/ntoskrnl/include/internal/ob_x.h b/reactos/ntoskrnl/include/internal/ob_x.h index 91877a4c661..f1bc04ce57d 100644 --- a/reactos/ntoskrnl/include/internal/ob_x.h +++ b/reactos/ntoskrnl/include/internal/ob_x.h @@ -113,7 +113,7 @@ ObpReferenceNameInfo(IN POBJECT_HEADER ObjectHeader) { /* FIXME: Unhandled*/ DbgPrint("OB: Unhandled path\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Return the name information */ diff --git a/reactos/ntoskrnl/io/iomgr/device.c b/reactos/ntoskrnl/io/iomgr/device.c index 1fa5d0d6721..3c79e0250fc 100644 --- a/reactos/ntoskrnl/io/iomgr/device.c +++ b/reactos/ntoskrnl/io/iomgr/device.c @@ -1195,7 +1195,7 @@ IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject) { /* FIXME: Unhandled yet */ DPRINT1("FOEs not supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index c5a8bee7034..6db9421a465 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -819,7 +819,7 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); if (!NT_SUCCESS(Status)) { - CPRINT("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); + DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); return(Status); } DeviceNode->ServiceName = ServiceName; diff --git a/reactos/ntoskrnl/io/iomgr/file.c b/reactos/ntoskrnl/io/iomgr/file.c index da7dfce3345..fd92560aee0 100644 --- a/reactos/ntoskrnl/io/iomgr/file.c +++ b/reactos/ntoskrnl/io/iomgr/file.c @@ -786,7 +786,7 @@ IopParseDevice(IN PVOID ParseObject, else if (Status == STATUS_REPARSE) { /* FIXME: We don't handle this at all! */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Get the owner of the File Object */ @@ -1405,7 +1405,7 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL, if ((FileObject->LockOperation) && (SystemHandleCount != 1)) { DPRINT1("We need to unlock this file!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Make sure this is the last handle */ diff --git a/reactos/ntoskrnl/io/iomgr/remlock.c b/reactos/ntoskrnl/io/iomgr/remlock.c index 60b037b750a..2bd05720344 100644 --- a/reactos/ntoskrnl/io/iomgr/remlock.c +++ b/reactos/ntoskrnl/io/iomgr/remlock.c @@ -74,7 +74,7 @@ IoAcquireRemoveLockEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -110,7 +110,7 @@ IoReleaseRemoveLockEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Decrement the lock count */ @@ -150,7 +150,7 @@ IoReleaseRemoveLockAndWaitEx(IN PIO_REMOVE_LOCK RemoveLock, { /* FIXME: Not yet supported */ DPRINT1("UNIMPLEMENTED\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/io/iomgr/volume.c b/reactos/ntoskrnl/io/iomgr/volume.c index 14adb252c10..102ae54e860 100644 --- a/reactos/ntoskrnl/io/iomgr/volume.c +++ b/reactos/ntoskrnl/io/iomgr/volume.c @@ -140,7 +140,7 @@ IopDereferenceVpb(IN PVPB Vpb) if (!Vpb->ReferenceCount) { /* FIXME: IMPLEMENT CLEANUP! */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Release VPB lock */ diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index dfefe0e9f80..b06f3d4893b 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -937,7 +937,7 @@ IopAssignDeviceResources( 0x3c /* PCI_INTERRUPT_LINE */, sizeof(UCHAR)); if (ret == 0 || ret == 2) - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2057,7 +2057,7 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED); /* FIXME: Log the error (possibly in IopInitializeDeviceNodeService) */ - CPRINT("Initialization of service %S failed (Status %x)\n", + DPRINT1("Initialization of service %S failed (Status %x)\n", DeviceNode->ServiceName.Buffer, Status); } } @@ -2846,8 +2846,8 @@ PnpInit(VOID) Status = IopInitPlugPlayEvents(); if (!NT_SUCCESS(Status)) { - CPRINT("IopInitPlugPlayEvents() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IopInitPlugPlayEvents() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } /* @@ -2857,30 +2857,30 @@ PnpInit(VOID) Status = IopCreateDriver(NULL, PnpDriverInitializeEmpty, NULL, 0, 0, &IopRootDriverObject); if (!NT_SUCCESS(Status)) { - CPRINT("IoCreateDriverObject() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IoCreateDriverObject() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IoCreateDevice(IopRootDriverObject, 0, NULL, FILE_DEVICE_CONTROLLER, 0, FALSE, &Pdo); if (!NT_SUCCESS(Status)) { - CPRINT("IoCreateDevice() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IoCreateDevice() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IopCreateDeviceNode(NULL, Pdo, NULL, &IopRootDeviceNode); if (!NT_SUCCESS(Status)) { - CPRINT("Insufficient resources\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("Insufficient resources\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } if (!RtlCreateUnicodeString(&IopRootDeviceNode->InstancePath, L"HTREE\\ROOT\\0")) { - CPRINT("Failed to create the instance path!\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0); + DPRINT1("Failed to create the instance path!\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, STATUS_NO_MEMORY, 0, 0, 0); } /* Report the device to the user-mode pnp manager */ @@ -2898,8 +2898,8 @@ PnpInit(VOID) Status = IopUpdateRootKey(); if (!NT_SUCCESS(Status)) { - CPRINT("IopUpdateRootKey() failed\n"); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + DPRINT1("IopUpdateRootKey() failed\n"); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } } @@ -2910,7 +2910,7 @@ PiCompareInstancePath(IN PRTL_AVL_TABLE Table, IN PVOID SecondStruct) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); return 0; } @@ -2925,7 +2925,7 @@ PiAllocateGenericTableEntry(IN PRTL_AVL_TABLE Table, IN CLONG ByteSize) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); return NULL; } @@ -2935,7 +2935,7 @@ PiFreeGenericTableEntry(IN PRTL_AVL_TABLE Table, IN PVOID Buffer) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } VOID diff --git a/reactos/ntoskrnl/io/pnpmgr/pnproot.c b/reactos/ntoskrnl/io/pnpmgr/pnproot.c index 3742ad85d92..3643446926c 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnproot.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnproot.c @@ -1076,7 +1076,7 @@ PnpRootAddDevice( { DPRINT("PhysicalDeviceObject 0x%p\n", PhysicalDeviceObject); Status = STATUS_INSUFFICIENT_RESOURCES; - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } Status = IoCreateDevice( @@ -1090,7 +1090,7 @@ PnpRootAddDevice( if (!NT_SUCCESS(Status)) { DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } DPRINT("Created FDO %p\n", PnpRootDeviceObject); @@ -1110,7 +1110,7 @@ PnpRootAddDevice( if (!NT_SUCCESS(Status)) { DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status); - KEBUGCHECKEX(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); + KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, Status, 0, 0, 0); } PnpRootDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; diff --git a/reactos/ntoskrnl/kd/kdmain.c b/reactos/ntoskrnl/kd/kdmain.c index eacf3ef8e7d..0858982cce5 100644 --- a/reactos/ntoskrnl/kd/kdmain.c +++ b/reactos/ntoskrnl/kd/kdmain.c @@ -59,7 +59,7 @@ KdpServiceDispatcher(ULONG Service, break; case ManualBugCheck: - KEBUGCHECK(MANUALLY_INITIATED_CRASH); + KeBugCheck(MANUALLY_INITIATED_CRASH); break; case DumpNonPagedPoolStats: diff --git a/reactos/ntoskrnl/kdbg/kdb.c b/reactos/ntoskrnl/kdbg/kdb.c index cbe4b9a72eb..9e6c843659a 100644 --- a/reactos/ntoskrnl/kdbg/kdb.c +++ b/reactos/ntoskrnl/kdbg/kdb.c @@ -1331,7 +1331,7 @@ KdbEnterDebuggerException( BreakPoint->Data.SavedInstruction, NULL))) { KdbpPrint("Couldn't restore original instruction after INT3! Cannot continue execution.\n"); - KEBUGCHECK(0); + KeBugCheck(0); // FIXME: Proper bugcode! } } diff --git a/reactos/ntoskrnl/kdbg/kdb_cli.c b/reactos/ntoskrnl/kdbg/kdb_cli.c index 6c157563583..9d907818f72 100644 --- a/reactos/ntoskrnl/kdbg/kdb_cli.c +++ b/reactos/ntoskrnl/kdbg/kdb_cli.c @@ -1689,7 +1689,7 @@ KdbpCmdTss(ULONG Argc, PCHAR Argv[]) STATIC BOOLEAN KdbpCmdBugCheck(ULONG Argc, PCHAR Argv[]) { - KEBUGCHECK(0xDEADDEAD); + KeBugCheck(0xDEADDEAD); return TRUE; } diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index 688585526e8..0f658e988f9 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -478,7 +478,7 @@ Quickie: if (Process != Thread->ApcState.Process) { /* Erm, we got attached or something! BAD! */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, diff --git a/reactos/ntoskrnl/ke/clock.c b/reactos/ntoskrnl/ke/clock.c index 71b46c60c0d..938399bb62b 100644 --- a/reactos/ntoskrnl/ke/clock.c +++ b/reactos/ntoskrnl/ke/clock.c @@ -76,7 +76,7 @@ KeSetSystemTime(IN PLARGE_INTEGER NewTime, KeLowerIrql(OldIrql2); /* Check if we need to adjust interrupt time */ - if (FixInterruptTime) KEBUGCHECK(0); + if (FixInterruptTime) ASSERT(FALSE); /* Setup a temporary list of absolute timers */ InitializeListHead(&TempList); diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index 8c406bbbd78..c69a2c2f9aa 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -73,7 +73,7 @@ NTAPI KiRosGetMdFromArray(VOID) { /* Return the next MD from the list, but make sure we don't overflow */ - if (BldrCurrentMd > 60) KEBUGCHECK(0); + if (BldrCurrentMd > 60) ASSERT(FALSE); return &BldrMemoryDescriptors[BldrCurrentMd++]; } diff --git a/reactos/ntoskrnl/ke/i386/kiinit.c b/reactos/ntoskrnl/ke/i386/kiinit.c index a87d09638f7..416b3433f20 100644 --- a/reactos/ntoskrnl/ke/i386/kiinit.c +++ b/reactos/ntoskrnl/ke/i386/kiinit.c @@ -294,7 +294,7 @@ KiInitMachineDependent(VOID) if (KiMXCsrMask != MXCsrMask) { /* No, something is definitely wrong */ - KEBUGCHECKEX(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, + KeBugCheckEx(MULTIPROCESSOR_CONFIGURATION_NOT_SUPPORTED, KF_FXSR, KiMXCsrMask, MXCsrMask, diff --git a/reactos/ntoskrnl/ke/i386/usercall.c b/reactos/ntoskrnl/ke/i386/usercall.c index 71221e49447..cc2f418a22f 100644 --- a/reactos/ntoskrnl/ke/i386/usercall.c +++ b/reactos/ntoskrnl/ke/i386/usercall.c @@ -116,7 +116,7 @@ KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame, TrapFrame->EFlags = Ke386SanitizeFlags(Context.EFlags, UserMode); /* Check if thread has IOPL and force it enabled if so */ - if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= 0x3000; + if (KeGetCurrentThread()->Iopl) TrapFrame->EFlags |= EFLAGS_IOPL; /* Setup the stack */ *(PULONG_PTR)(Stack + 0 * sizeof(ULONG_PTR)) = (ULONG_PTR)NormalRoutine; diff --git a/reactos/ntoskrnl/ke/powerpc/exp.c b/reactos/ntoskrnl/ke/powerpc/exp.c index 3d9a04459e2..8534a57ee1f 100644 --- a/reactos/ntoskrnl/ke/powerpc/exp.c +++ b/reactos/ntoskrnl/ke/powerpc/exp.c @@ -104,7 +104,7 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, DbgPrint("EXCEPTION! Record %08x Frame %08x\n", ExceptionRecord, ExceptionFrame); MmuDumpMap(); - KEBUGCHECK(0); + KeBugCheck(0); } /* diff --git a/reactos/ntoskrnl/ke/procobj.c b/reactos/ntoskrnl/ke/procobj.c index 242dc28a298..a2bd61401cb 100644 --- a/reactos/ntoskrnl/ke/procobj.c +++ b/reactos/ntoskrnl/ke/procobj.c @@ -458,7 +458,7 @@ KeAttachProcess(IN PKPROCESS Process) (KeIsExecutingDpc())) { /* Invalid attempt */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, @@ -580,7 +580,7 @@ KeStackAttachProcess(IN PKPROCESS Process, if (KeIsExecutingDpc()) { /* Executing a DPC, crash! */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)Process, (ULONG_PTR)Thread->ApcState.Process, Thread->ApcStateIndex, @@ -662,7 +662,7 @@ KeUnstackDetachProcess(IN PRKAPC_STATE ApcState) (!IsListEmpty(&Thread->ApcState.ApcListHead[UserMode]))) { /* Bugcheck the system */ - KEBUGCHECK(INVALID_PROCESS_DETACH_ATTEMPT); + KeBugCheck(INVALID_PROCESS_DETACH_ATTEMPT); } /* Get the process */ diff --git a/reactos/ntoskrnl/ke/thrdschd.c b/reactos/ntoskrnl/ke/thrdschd.c index 04db88dd24b..8f1f52570ee 100644 --- a/reactos/ntoskrnl/ke/thrdschd.c +++ b/reactos/ntoskrnl/ke/thrdschd.c @@ -378,7 +378,7 @@ KiReadyThread(IN PKTHREAD Thread) if (Process->State != ProcessInMemory) { /* We don't page out processes in ROS */ - KEBUGCHECK(0); + ASSERT(FALSE); } else if (!Thread->KernelStackResident) { @@ -391,7 +391,7 @@ KiReadyThread(IN PKTHREAD Thread) Thread->State = Transition; /* The stack is always resident in ROS */ - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -610,7 +610,7 @@ KiSetPriorityThread(IN PKTHREAD Thread, { /* FIXME: TODO */ DPRINT1("Deferred state not yet supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } else { diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index a37b4a092ae..2ec2cec5159 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -520,7 +520,7 @@ KeWaitForMultipleObjects(IN ULONG Count, if (Count > THREAD_WAIT_OBJECTS) { /* Bugcheck */ - KEBUGCHECK(MAXIMUM_WAIT_OBJECTS_EXCEEDED); + KeBugCheck(MAXIMUM_WAIT_OBJECTS_EXCEEDED); } /* Use the Thread's Wait Block */ @@ -532,7 +532,7 @@ KeWaitForMultipleObjects(IN ULONG Count, if (Count > MAXIMUM_WAIT_OBJECTS) { /* Bugcheck */ - KEBUGCHECK(MAXIMUM_WAIT_OBJECTS_EXCEEDED); + KeBugCheck(MAXIMUM_WAIT_OBJECTS_EXCEEDED); } } diff --git a/reactos/ntoskrnl/lpc/close.c b/reactos/ntoskrnl/lpc/close.c index d142d0f50a9..173fcdf8794 100644 --- a/reactos/ntoskrnl/lpc/close.c +++ b/reactos/ntoskrnl/lpc/close.c @@ -40,7 +40,7 @@ LpcExitThread(IN PETHREAD Thread) if (Message) { /* FIXME: TODO */ - KEBUGCHECK(0); + ASSERT(FALSE); } /* Release the lock */ diff --git a/reactos/ntoskrnl/mm/anonmem.c b/reactos/ntoskrnl/mm/anonmem.c index b10a4e0af97..2bd93fc658d 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) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -301,7 +301,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -322,12 +322,12 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * 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); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -387,7 +387,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } MmSetSavedSwapEntryPage(Page, SwapEntry); } @@ -414,7 +414,7 @@ MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } @@ -870,7 +870,7 @@ MmFreeVirtualMemory(PEPROCESS Process, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(&Process->VadRoot); MmReleasePageOp(PageOp); diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index 03608ea3086..5c23dc588b0 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLock(&AllocationListLock, &oldIrql); @@ -169,7 +169,7 @@ MmRebalanceMemoryConsumers(VOID) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Target = Target - NrFreedPages; } @@ -215,7 +215,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = MmAllocPage(Consumer, 0); if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } *AllocatedPage = Page; if (MmStats.NrFreePages <= MiMinimumAvailablePages && @@ -263,7 +263,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = Request.Page; if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } /* Update the Consumer */ MiGetPfnEntry(Page)->Flags.Consumer = Consumer; @@ -279,7 +279,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait, Page = MmAllocPage(Consumer, 0); if (Page == 0) { - KEBUGCHECK(NO_PAGES_AVAILABLE); + KeBugCheck(NO_PAGES_AVAILABLE); } if(Consumer == MC_USER) MmInsertLRULastUserPage(Page); *AllocatedPage = Page; @@ -327,7 +327,7 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(MiMinimumPagesPerRun, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -359,7 +359,7 @@ MiBalancerThread(PVOID Unused) Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -368,7 +368,7 @@ MiBalancerThread(PVOID Unused) else { DPRINT1("KeWaitForMultipleObjects failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -409,7 +409,7 @@ MiInitBalancerThread(VOID) NULL); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Priority = LOW_REALTIME_PRIORITY + 1; diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 0327faf8f99..0f5bda54bb3 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -416,7 +416,7 @@ MmMarkPageMapped(PFN_TYPE Pfn) if (Page->Flags.Type == MM_PHYSICAL_PAGE_FREE) { DPRINT1("Mapping non-used page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->MapCount == 0) { DPRINT1("Unmapping not mapped page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } RCount = Page->ReferenceCount; @@ -577,12 +577,12 @@ MmDereferencePage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Dereferencing free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->ReferenceCount == 0) { DPRINT1("Derefrencing page with reference count 0\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->ReferenceCount--; @@ -594,29 +594,29 @@ MmDereferencePage(PFN_TYPE Pfn) if (Page->RmapListHead != NULL) { DPRINT1("Freeing page with rmap entries.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->MapCount != 0) { DPRINT1("Freeing mapped page (0x%x count %d)\n", Pfn << PAGE_SHIFT, Page->MapCount); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->LockCount > 0) { DPRINT1("Freeing locked page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->SavedSwapEntry != 0) { DPRINT1("Freeing page with swap entry.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Freeing page with flags %x\n", Page->Flags.Type); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } LockCount = Page->LockCount; @@ -671,7 +671,7 @@ MmLockPageUnsafe(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Locking free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Page->LockCount++; @@ -702,7 +702,7 @@ MmUnlockPage(PFN_TYPE Pfn) if (Page->Flags.Type != MM_PHYSICAL_PAGE_USED) { DPRINT1("Unlocking free page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageDescriptor->MapCount != 0) { DPRINT1("Got mapped page from freelist\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageDescriptor->ReferenceCount != 0) { DPRINT1("%d\n", PageDescriptor->ReferenceCount); - KEBUGCHECK(0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } return PfnOffset; } @@ -970,7 +970,7 @@ MmZeroPageThreadMain(PVOID Ignored) if (!NT_SUCCESS(Status)) { DPRINT1("ZeroPageThread: Wait failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (ZeroPageThreadShouldTerminate) @@ -995,7 +995,7 @@ MmZeroPageThreadMain(PVOID Ignored) if (PageDescriptor->MapCount != 0) { DPRINT1("Mapped page on freelist.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } PageDescriptor->Flags.Zero = 1; PageDescriptor->Flags.Type = MM_PHYSICAL_PAGE_FREE; diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index ba1c9916994..7adff6a6493 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -97,7 +97,7 @@ ProtectToPTE(ULONG flProtect) else { DPRINT1("Unknown main protection type.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (flProtect & PAGE_SYSTEM) @@ -241,7 +241,7 @@ MmDeletePageTable(PEPROCESS Process, PVOID Address) if (Address >= MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; } if (Process != NULL && Process != CurrentProcess) @@ -264,7 +264,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0])); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (0 == InterlockedCompareExchangePte(&PageDir[PdeOffset], 0, 0)) { @@ -276,7 +276,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangePte(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -293,7 +293,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + ADDR_TO_PTE_OFFSET(Address); } @@ -311,7 +311,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) @@ -334,7 +334,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangePte(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -403,7 +403,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -417,7 +417,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF WasValid = (PAGE_MASK(Pte) != 0); if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -582,14 +582,14 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetCleanPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -617,13 +617,13 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -650,7 +650,7 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -704,7 +704,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Attributes = ProtectToPTE(flProtect); @@ -724,7 +724,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt--; @@ -735,7 +735,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); @@ -744,7 +744,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -756,7 +756,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = *Pt; if (Pte != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchangePte(Pt, PFN_TO_PTE(Pages[i]) | Attributes); } @@ -776,22 +776,22 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt = MmGetPageTableForProcess(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pte = *Pt; if (PAGE_MASK((Pte)) != 0) @@ -836,13 +836,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -850,14 +850,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -889,7 +889,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -898,7 +898,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -911,7 +911,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, MmMarkPageMapped(Pages[i]); if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAGE_MASK((Pte)) != 0) { @@ -950,7 +950,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsPageInUse(Pages[i])) { DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1035,7 +1035,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchangePte(Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); @@ -1099,7 +1099,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1124,7 +1124,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1158,7 +1158,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Address < MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); } StartOffset = ADDR_TO_PDE_OFFSET(Address); @@ -1237,7 +1237,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } BaseAddress = (PVOID)HYPERSPACE; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -1251,7 +1251,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/i386/pagepae.c b/reactos/ntoskrnl/mm/i386/pagepae.c index 45ca9f32fd0..64ef87c3390 100644 --- a/reactos/ntoskrnl/mm/i386/pagepae.c +++ b/reactos/ntoskrnl/mm/i386/pagepae.c @@ -145,7 +145,7 @@ ProtectToPTE(ULONG flProtect) else { DPRINT1("Unknown main protection type.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386NoExecute && !(flProtect & PAGE_IS_EXECUTABLE)) @@ -444,7 +444,7 @@ MmDeletePageTable(PEPROCESS Process, PVOID Address) } if (Address >= MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; } if (Process != NULL && Process != CurrentProcess) @@ -477,7 +477,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) { DbgPrint("Page table entry not clear at %x/%x (is %I64x)\n", ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); - KEBUGCHECK(0); + ASSERT(FALSE); } } Pfn = PAE_PTE_TO_PFN(*(PAE_ADDR_TO_PDE(Address))); @@ -494,7 +494,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) { DbgPrint("Page table entry not clear at %x/%x (is %x)\n", ((ULONG)Address / (4*1024*1024)), i, PageTable[i]); - KEBUGCHECK(0); + ASSERT(FALSE); } } Pfn = PTE_TO_PFN(*(ADDR_TO_PDE(Address))); @@ -505,7 +505,7 @@ MmFreePageTable(PEPROCESS Process, PVOID Address) if (Address >= MmSystemRangeStart) { // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - KEBUGCHECK(0); + ASSERT(FALSE); } else { @@ -532,20 +532,20 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Process, Address, Create); if (Address >= (PVOID)PAGETABLE_MAP && Address < (PVOID)((ULONG_PTR)PAGETABLE_MAP + 0x800000)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart && Process && Process != PsGetCurrentProcess()) { PageDirTable = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); if (PageDirTable == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } PageDir = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(PageDirTable[PAE_ADDR_TO_PDTE_OFFSET(Address)])); MmDeleteHyperspaceMapping(PageDirTable); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } PageDir += PAE_ADDR_TO_PDE_PAGE_OFFSET(Address); Entry = ExfInterlockedCompareExchange64UL(PageDir, &ZeroEntry, &ZeroEntry); @@ -559,7 +559,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER; Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry); @@ -577,7 +577,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + PAE_ADDR_TO_PTE_OFFSET(Address); } @@ -595,7 +595,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PAE_PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) @@ -618,7 +618,7 @@ MmGetPageTableForProcessForPAE(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER; Entry = ExfInterlockedCompareExchange64UL(PageDir, &Entry, &ZeroEntry); @@ -645,7 +645,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.LowPart)); if (PageDir == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) { @@ -657,7 +657,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangeUL(&PageDir[PdeOffset], PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -674,7 +674,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Pt = MmCreateHyperspaceMapping(Pfn); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } return Pt + ADDR_TO_PTE_OFFSET(Address); } @@ -692,7 +692,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE; if (Ke386GlobalPagesEnabled) @@ -715,7 +715,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create) Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn); if (!NT_SUCCESS(Status) || Pfn == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = InterlockedCompareExchangeUL(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0); if (Entry != 0) @@ -825,7 +825,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -840,7 +840,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF WasValid = PAE_PAGE_MASK(Pte) != 0LL ? TRUE : FALSE; if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -863,7 +863,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Atomically disable the present bit and get the old value. @@ -877,7 +877,7 @@ MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPF WasValid = (PAGE_MASK(Pte) != 0); if (!WasValid) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1232,7 +1232,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1243,7 +1243,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1271,7 +1271,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1299,7 +1299,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetCleanPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1311,7 +1311,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1338,7 +1338,7 @@ MmSetCleanPage(PEPROCESS Process, PVOID Address) if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1364,7 +1364,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmSetDirtyPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -1375,7 +1375,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1400,7 +1400,7 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1431,7 +1431,7 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1456,7 +1456,7 @@ MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } do @@ -1525,7 +1525,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Attributes = ProtectToPTE(flProtect); @@ -1554,7 +1554,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr); @@ -1563,7 +1563,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcessForPAE(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1580,7 +1580,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = ExfpInterlockedExchange64UL(Pt, &Pte); if (Pte != 0LL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -1593,7 +1593,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pt--; @@ -1604,7 +1604,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); @@ -1613,7 +1613,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1625,7 +1625,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, Pte = *Pt; if (Pte != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); } @@ -1643,16 +1643,16 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) @@ -1664,7 +1664,7 @@ MmCreatePageFileMapping(PEPROCESS Process, Pt = MmGetPageTableForProcessForPAE(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } tmpPte = SwapEntry << 1; Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte); @@ -1690,7 +1690,7 @@ MmCreatePageFileMapping(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Address, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } Pte = *Pt; if (PAGE_MASK((Pte)) != 0) @@ -1744,13 +1744,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1758,14 +1758,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1803,7 +1803,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -1812,7 +1812,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcessForPAE(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1830,7 +1830,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pte = ExfpInterlockedExchange64UL(Pt, &tmpPte); if (PAE_PAGE_MASK((Pte)) != 0LL && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAE_PAGE_MASK((Pte)) != 0LL) { @@ -1872,7 +1872,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } PdeOffset = ADDR_TO_PDE_OFFSET(Addr); if (oldPdeOffset != PdeOffset) @@ -1881,7 +1881,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, Pt = MmGetPageTableForProcess(Process, Addr, TRUE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1894,7 +1894,7 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, MmMarkPageMapped(Pages[i]); if (PAGE_MASK((Pte)) != 0 && !((Pte) & PA_PRESENT)) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (PAGE_MASK((Pte)) != 0) { @@ -1943,7 +1943,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsPageInUse(Pages[i])) { DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -2037,7 +2037,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) if (Pt == NULL) { DPRINT1("Address %x\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } do { @@ -2062,7 +2062,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); @@ -2149,7 +2149,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2174,7 +2174,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2206,7 +2206,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i >= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2231,7 +2231,7 @@ MmCreateHyperspaceMapping(PFN_TYPE Page) } if (i <= Page % 1024) { - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -2293,7 +2293,7 @@ MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) if (Address < MmSystemRangeStart) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Ke386Pae) { @@ -2450,7 +2450,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } BaseAddress = (PVOID)HYPERSPACE; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -2464,7 +2464,7 @@ MiInitPageDirectoryMap(VOID) BoundaryAddressMultiple); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/iospace.c b/reactos/ntoskrnl/mm/iospace.c index e19d5ce2d9d..944ba9022b7 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"); - KEBUGCHECK(0); + ASSERT(FALSE); } } return (PVOID)((ULONG_PTR)Result + Offset); diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 0dee681e585..04e77c2f223 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -899,7 +899,7 @@ MmFreeMemoryAreaByPtr( BaseAddress); if (MemoryArea == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } @@ -1041,7 +1041,7 @@ MmMapMemoryArea(PVOID BaseAddress, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to allocate page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping (NULL, (PVOID)((ULONG_PTR)BaseAddress + (i * PAGE_SIZE)), @@ -1051,7 +1051,7 @@ MmMapMemoryArea(PVOID BaseAddress, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } diff --git a/reactos/ntoskrnl/mm/mdlsup.c b/reactos/ntoskrnl/mm/mdlsup.c index df52db6787c..70038cf0070 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()); - KEBUGCHECK(0); + ASSERT(FALSE); } MmUnlockAddressSpace(MmGetKernelAddressSpace()); @@ -692,7 +692,7 @@ MmMapLockedPagesSpecifyCache(IN PMDL Mdl, { return NULL; } - KEBUGCHECK(0); + ASSERT(FALSE); } Base = (PVOID)((ULONG_PTR)MiMdlMappingRegionBase + StartingOffset * PAGE_SIZE); if (MiMdlMappingRegionHint == StartingOffset) MiMdlMappingRegionHint += PageCount; diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index dc880dc5313..4bced911cc0 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -103,7 +103,7 @@ MmpAccessFault(KPROCESSOR_MODE Mode, if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { - CPRINT("Page fault at high IRQL was %d\n", KeGetCurrentIrql()); + DPRINT1("Page fault at high IRQL was %d\n", KeGetCurrentIrql()); return(STATUS_UNSUCCESSFUL); } if (PsGetCurrentProcess() == NULL) @@ -205,7 +205,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode, if (KeGetCurrentIrql() >= DISPATCH_LEVEL) { - CPRINT("Page fault at high IRQL was %d, address %x\n", KeGetCurrentIrql(), Address); + DPRINT1("Page fault at high IRQL was %d, address %x\n", KeGetCurrentIrql(), Address); return(STATUS_UNSUCCESSFUL); } @@ -219,7 +219,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode, */ if (Mode != KernelMode) { - CPRINT("Address: %x\n", Address); + DPRINT1("Address: %x\n", Address); return(STATUS_ACCESS_VIOLATION); } AddressSpace = MmGetKernelAddressSpace(); diff --git a/reactos/ntoskrnl/mm/mpw.c b/reactos/ntoskrnl/mm/mpw.c index b17199858f2..3c631691907 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"); - KEBUGCHECK(0); + ASSERT(FALSE); return(STATUS_UNSUCCESSFUL); } if (MpwThreadShouldTerminate) diff --git a/reactos/ntoskrnl/mm/npool.c b/reactos/ntoskrnl/mm/npool.c index f0c8cc4551b..ed9ee5bed00 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } blocks_seen++; if (blocks_seen > EiNrFreeBlocks) { DbgPrint("Too many blocks on free list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } blocks_seen++; if (blocks_seen > EiNrUsedBlocks) { DbgPrint("Too many blocks on used list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)free > base && (ULONG_PTR)free < last ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)free < base && ((ULONG_PTR)free + free->hdr.Size) > base ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } if ( (ULONG_PTR)used < base && ((ULONG_PTR)used + used->hdr.Size) > base ) { DbgPrint("intersecting blocks on list\n"); - KEBUGCHECK(/*KBUG_POOL_FREE_LIST_CORRUPT*/0); + ASSERT(FALSE); } 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) - KEBUGCHECK(0); + ASSERT(FALSE); 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); } - KEBUGCHECK(0); + ASSERT(FALSE); } } #endif @@ -1563,7 +1563,7 @@ VOID STDCALL ExFreeNonPagedPool (PVOID block) DbgPrint("ExFreePool of non-allocated address %x (magic %x)\n", block, blk->hdr.Magic); } - KEBUGCHECK(0); + ASSERT(FALSE); return; } @@ -1724,7 +1724,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to allocate a page\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping(NULL, @@ -1735,7 +1735,7 @@ MiInitializeNonPagedPool(VOID) if (!NT_SUCCESS(Status)) { DbgPrint("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Address = (PVOID)((ULONG_PTR)Address + PAGE_SIZE); } diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 4188bb13e7e..356d6e33684 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; } } - KEBUGCHECK(0); + ASSERT(FALSE); #if defined(__GNUC__) return (LARGE_INTEGER)0LL; @@ -237,7 +237,7 @@ MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); 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); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PagingFileList[i]->FileObject == NULL || PagingFileList[i]->FileObject->DeviceObject == NULL) { DPRINT1("Bad paging file 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInitializeMdl(Mdl, NULL, PAGE_SIZE); @@ -298,7 +298,7 @@ MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_TYPE Page) if (SwapEntry == 0) { - KEBUGCHECK(0); + ASSERT(FALSE); 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); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PagingFileList[i]->FileObject == NULL || PagingFileList[i]->FileObject->DeviceObject == NULL) { DPRINT1("Bad paging file 0x%.8X\n", SwapEntry); - KEBUGCHECK(0); + ASSERT(FALSE); } 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); - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLock(&PagingFileListLock, &oldIrql); if (PagingFileList[i] == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } KeAcquireSpinLockAtDpcLevel(&PagingFileList[i]->AllocMapLock); @@ -504,7 +504,7 @@ MmAllocSwapPage(VOID) off = MiAllocPageFromPagingFile(PagingFileList[i]); if (off == 0xFFFFFFFF) { - KEBUGCHECK(0); + ASSERT(FALSE); KeReleaseSpinLock(&PagingFileListLock, oldIrql); return(STATUS_UNSUCCESSFUL); } @@ -518,7 +518,7 @@ MmAllocSwapPage(VOID) } KeReleaseSpinLock(&PagingFileListLock, oldIrql); - KEBUGCHECK(0); + ASSERT(FALSE); return(0); } diff --git a/reactos/ntoskrnl/mm/pageop.c b/reactos/ntoskrnl/mm/pageop.c index deb4d128bd3..099b915921f 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); - KEBUGCHECK(0); + ASSERT(FALSE); } PMM_PAGEOP @@ -211,7 +211,7 @@ MmGetPageOp(PMEMORY_AREA MArea, HANDLE Pid, PVOID Address, if (PageOp == NULL) { KeReleaseSpinLock(&MmPageOpHashTableLock, oldIrql); - KEBUGCHECK(0); + ASSERT(FALSE); return(NULL); } diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index 743bca6c121..6febb0adc3f 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -41,7 +41,7 @@ EiAllocatePool(POOL_TYPE PoolType, if ((PoolType & MUST_SUCCEED_POOL_MASK) && Block==NULL) { - KEBUGCHECK(MUST_SUCCEED_POOL_EMPTY); + KeBugCheck(MUST_SUCCEED_POOL_EMPTY); } return(Block); } diff --git a/reactos/ntoskrnl/mm/powerpc/page.c b/reactos/ntoskrnl/mm/powerpc/page.c index 73b46616680..2dd9e2b76b1 100644 --- a/reactos/ntoskrnl/mm/powerpc/page.c +++ b/reactos/ntoskrnl/mm/powerpc/page.c @@ -98,7 +98,7 @@ MmCopyMmInfo(PEPROCESS Src, { DPRINT("MmCopyMmInfo(Src %x, Dest %x)\n", Src, Dest); - KeBugCheck(0); + ASSERT(FALSE); return(STATUS_SUCCESS); } @@ -125,7 +125,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Process, IN PLARGE_INTEGER DirectoryTableBase) { - KeBugCheck(0); + ASSERT(FALSE); return TRUE; } @@ -302,7 +302,7 @@ MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) if (Address < MmSystemRangeStart && Process == NULL) { DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } info.proc = Process ? (int)Process->UniqueProcessId : 0; @@ -370,7 +370,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, if (Address < MmSystemRangeStart) { DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Addr = Address; @@ -383,7 +383,7 @@ MmCreateVirtualMappingForKernel(PVOID Address, DPRINT1("Setting physical address but not allowing access at address " "0x%.8X with attributes %x/%x.\n", Addr, Attributes, flProtect); - KEBUGCHECK(0); + ASSERT(FALSE); } (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); #endif @@ -401,16 +401,16 @@ MmCreatePageFileMapping(PEPROCESS Process, if (Process == NULL && Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Process != NULL && Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SwapEntry & (1 << 31)) { - KEBUGCHECK(0); + ASSERT(FALSE); } // XXX arty @@ -440,13 +440,13 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address < MmSystemRangeStart) { DPRINT1("No process\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > 0x10000 || (ULONG_PTR) Address / PAGE_SIZE + PageCount > 0x100000) { DPRINT1("Page count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -454,14 +454,14 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, if (Address >= MmSystemRangeStart) { DPRINT1("Setting kernel address with process context\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE || (ULONG_PTR) Address / PAGE_SIZE + PageCount > (ULONG_PTR)MmSystemRangeStart / PAGE_SIZE) { DPRINT1("Page Count to large\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -508,7 +508,7 @@ MmCreateVirtualMapping(PEPROCESS Process, if (!MmIsUsablePage(Pages[i])) { DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i])); - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -564,7 +564,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) Pt = MmGetPageTableForProcess(Process, Address, FALSE); if (Pt == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } InterlockedExchange((PLONG)Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); diff --git a/reactos/ntoskrnl/mm/procsup.c b/reactos/ntoskrnl/mm/procsup.c index b679a892856..fdfd902b4aa 100644 --- a/reactos/ntoskrnl/mm/procsup.c +++ b/reactos/ntoskrnl/mm/procsup.c @@ -215,7 +215,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create thread stack\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -239,7 +239,7 @@ MmCreateKernelStack(BOOLEAN GuiStack, if (!NT_SUCCESS(Status)) { DPRINT1("Could not create Virtual Mapping for Kernel Stack\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Return the stack base */ @@ -709,11 +709,11 @@ MmDeleteProcessAddressSpace(PEPROCESS Process) break; case MEMORY_AREA_MDL_MAPPING: - KEBUGCHECK(PROCESS_HAS_LOCKED_PAGES); + KeBugCheck(PROCESS_HAS_LOCKED_PAGES); break; default: - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/mm/rmap.c b/reactos/ntoskrnl/mm/rmap.c index e2120a072b1..3607d9136ae 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) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -177,7 +177,7 @@ MmWritePagePhysicalAddress(PFN_TYPE Page) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -211,7 +211,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) Address = entry->Address; if ((((ULONG_PTR)Address) & 0xFFF) != 0) { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) @@ -301,7 +301,7 @@ MmPageOutPhysicalAddress(PFN_TYPE Page) } else { - KEBUGCHECK(0); + ASSERT(FALSE); } if (Address < MmSystemRangeStart) { @@ -321,7 +321,7 @@ MmSetCleanAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } while (current_entry != NULL) { @@ -342,7 +342,7 @@ MmSetDirtyAllRmaps(PFN_TYPE Page) if (current_entry == NULL) { DPRINT1("MmIsDirtyRmap: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } while (current_entry != NULL) { @@ -392,7 +392,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, new_entry = ExAllocateFromNPagedLookasideList(&RmapLookasideList); if (new_entry == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } 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); - KEBUGCHECK(0); + ASSERT(FALSE); } ExAcquireFastMutex(&RmapListLock); @@ -427,7 +427,7 @@ MmInsertRmap(PFN_TYPE Page, PEPROCESS Process, DbgPrint("\n previous caller "); DbgPrint("%p", current_entry->Caller); DbgPrint("\n"); - KeBugCheck(0); + ASSERT(FALSE); } current_entry = current_entry->Next; } @@ -463,7 +463,7 @@ MmDeleteAllRmaps(PFN_TYPE Page, PVOID Context, if (current_entry == NULL) { DPRINT1("MmDeleteAllRmaps: No rmaps.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmSetRmapListHeadPage(Page, NULL); ExReleaseFastMutex(&RmapListLock); @@ -527,5 +527,5 @@ MmDeleteRmap(PFN_TYPE Page, PEPROCESS Process, previous_entry = current_entry; current_entry = current_entry->Next; } - KEBUGCHECK(0); + ASSERT(FALSE); } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 53e9c9d80ec..3e93f00bf4a 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -250,7 +250,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) { DPRINT1("Image segment %d still referenced (was %d)\n", i, SectionSegments[i].ReferenceCount); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreePageTablesSectionSegment(&SectionSegments[i]); } @@ -268,7 +268,7 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject) if (Segment->ReferenceCount != 0) { DPRINT1("Data segment still referenced\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreePageTablesSectionSegment(Segment); ExFreePool(Segment); @@ -316,7 +316,7 @@ MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, TAG_SECTION_PAGE_TABLE); if (Table == NULL) { - KEBUGCHECK(0); + ASSERT(FALSE); } memset(Table, 0, sizeof(SECTION_PAGE_TABLE)); DPRINT("Table %x\n", Table); @@ -369,16 +369,16 @@ MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, if (Entry == 0) { DPRINT1("Entry == 0 for MmSharePageEntrySectionSegment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SHARE_COUNT_FROM_SSE(Entry) == MAX_SHARE_COUNT) { DPRINT1("Maximum share count reached\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (IS_SWAP_FROM_SSE(Entry)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = MAKE_SSE(PAGE_FROM_SSE(Entry), SHARE_COUNT_FROM_SSE(Entry) + 1); MmSetPageEntrySectionSegment(Segment, Offset, Entry); @@ -399,16 +399,16 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (Entry == 0) { DPRINT1("Entry == 0 for MmUnsharePageEntrySectionSegment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (SHARE_COUNT_FROM_SSE(Entry) == 0) { DPRINT1("Zero share count for unshare\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (IS_SWAP_FROM_SSE(Entry)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Entry = MAKE_SSE(PAGE_FROM_SSE(Entry), SHARE_COUNT_FROM_SSE(Entry) - 1); /* @@ -444,7 +444,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (!NT_SUCCESS(Status)) { DPRINT1("CcRosUnmapCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -493,7 +493,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, if (!NT_SUCCESS(Status)) { DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } } MmSetPageEntrySectionSegment(Segment, Offset, MAKE_SWAP_SSE(SavedSwapEntry)); @@ -504,7 +504,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, else { DPRINT1("Found a swapentry for a non private page in an image or data file sgment\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } } @@ -775,7 +775,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -793,12 +793,12 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); /* @@ -856,7 +856,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); } @@ -885,7 +885,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a swaped out private page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmUnlockSectionSegment(Segment); @@ -895,14 +895,14 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { DPRINT1("MmReadFromSwapPage failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); Status = MmCreateVirtualMapping(Process, @@ -913,7 +913,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } @@ -958,7 +958,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMappingUnsafe failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } /* @@ -994,7 +994,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, } if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmCreateVirtualMapping(Process, Address, @@ -1004,7 +1004,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } MmInsertRmap(Page, Process, (PVOID)PAddress); @@ -1085,7 +1085,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Entry != Entry1) { DPRINT1("Someone changed ppte entry while we slept\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1104,7 +1104,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); @@ -1133,13 +1133,13 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } Status = MmReadFromSwapPage(SwapEntry, Page); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1156,7 +1156,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Entry != Entry1) { DPRINT1("Someone changed ppte entry while we slept\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1179,7 +1179,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); if (Locked) @@ -1211,7 +1211,7 @@ MmNotPresentFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmInsertRmap(Page, Process, (PVOID)PAddress); if (Locked) @@ -1305,7 +1305,7 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (PageOp == NULL) { DPRINT1("MmGetPageOp failed\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1321,12 +1321,12 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (Status == STATUS_TIMEOUT) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } if (PageOp->Status == STATUS_PENDING) { DPRINT1("Woke for page op before completion\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Restart the operation @@ -1348,7 +1348,7 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &NewPage); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1373,13 +1373,13 @@ MmAccessFaultSectionView(PMM_AVL_TABLE AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT("MmCreateVirtualMapping failed, not out of memory\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return(Status); } if (!NT_SUCCESS(Status)) { DPRINT1("Unable to create virtual mapping\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } if (Locked) { @@ -1509,7 +1509,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, DPRINT1("Trying to page out from physical memory section address 0x%X " "process %d\n", Address, Process ? Process->UniqueProcessId : 0); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1520,7 +1520,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Trying to page out not-present page at (%d,0x%.8X).\n", Process ? Process->UniqueProcessId : 0, Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Page = MmGetPfnForProcess(Process, Address); SwapEntry = MmGetSavedSwapEntryPage(Page); @@ -1548,7 +1548,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, if(!MiIsPageFromCache(MemoryArea, Context.Offset)) { DPRINT1("Direct mapped non private page is not associated with the cache.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1567,7 +1567,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, if (!(Context.Segment->Flags & MM_PAGEFILE_SEGMENT) && !(Context.Segment->Characteristics & IMAGE_SCN_MEM_SHARED)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } @@ -1585,7 +1585,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a %s private page (address %x) in a pagefile segment.\n", Context.WasDirty ? "dirty" : "clean", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } if (!Context.WasDirty && SwapEntry != 0) { @@ -1603,7 +1603,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a %s private page (address %x) in a shared section segment.\n", Context.WasDirty ? "dirty" : "clean", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } if (!Context.WasDirty || SwapEntry != 0) { @@ -1624,13 +1624,13 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a swapentry for a non private and direct mapped page (address %x)\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = CcRosUnmapCacheSegment(Bcb, FileOffset, FALSE); if (!NT_SUCCESS(Status)) { DPRINT1("CCRosUnmapCacheSegment failed, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); @@ -1642,7 +1642,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Found a swap entry for a non dirty, non private and not direct mapped page (address %x)\n", Address); - KEBUGCHECK(0); + ASSERT(FALSE); } MmReleasePageMemoryConsumer(MC_USER, Page); PageOp->Status = STATUS_SUCCESS; @@ -1659,7 +1659,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, MmUnlockAddressSpace(AddressSpace); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } MmReleasePageMemoryConsumer(MC_USER, Page); PageOp->Status = STATUS_SUCCESS; @@ -1787,7 +1787,7 @@ MmPageOutSectionView(PMM_AVL_TABLE AddressSpace, MmUnlockAddressSpace(AddressSpace); if (!NT_SUCCESS(Status)) { - KEBUGCHECK(0); + ASSERT(FALSE); } } else @@ -1862,7 +1862,7 @@ MmWritePageSectionView(PMM_AVL_TABLE AddressSpace, DPRINT1("Trying to write back page from physical memory mapped at %X " "process %d\n", Address, Process ? Process->UniqueProcessId : 0); - KEBUGCHECK(0); + ASSERT(FALSE); } /* @@ -1873,7 +1873,7 @@ MmWritePageSectionView(PMM_AVL_TABLE AddressSpace, { DPRINT1("Trying to page out not-present page at (%d,0x%.8X).\n", Process ? Process->UniqueProcessId : 0, Address); - KEBUGCHECK(0); + ASSERT(FALSE); } Page = MmGetPfnForProcess(Process, Address); SwapEntry = MmGetSavedSwapEntryPage(Page); @@ -2242,7 +2242,7 @@ MmCreatePhysicalMemorySection(VOID) if (!NT_SUCCESS(Status)) { DPRINT1("Failed to create PhysicalMemory section\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } Status = ObInsertObject(PhysSection, NULL, @@ -2683,7 +2683,7 @@ ExeFmtpReadFile(IN PVOID File, if(Length == 0) { - KEBUGCHECK(STATUS_INVALID_PARAMETER_4); + ASSERT(FALSE); } FileOffset = *Offset; @@ -2691,7 +2691,7 @@ ExeFmtpReadFile(IN PVOID File, /* Negative/special offset: it cannot be used in this context */ if(FileOffset.u.HighPart < 0) { - KEBUGCHECK(STATUS_INVALID_PARAMETER_5); + ASSERT(FALSE); } AdjustOffset = PAGE_ROUND_DOWN(FileOffset.u.LowPart); @@ -3865,7 +3865,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); @@ -3899,7 +3899,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a swap entry for a page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } MmFreeSwapPage(SwapEntry); } @@ -3914,7 +3914,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Segment->Flags & MM_PAGEFILE_SEGMENT) { DPRINT1("Found a private page in a pagefile section.\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* * Just dereference private pages @@ -4040,7 +4040,7 @@ MmUnmapViewOfSection(PEPROCESS Process, if (Status != STATUS_SUCCESS) { DPRINT1("Failed to wait for page op, status = %x\n", Status); - KEBUGCHECK(0); + ASSERT(FALSE); } MmLockAddressSpace(AddressSpace); MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, @@ -4086,7 +4086,7 @@ MmUnmapViewOfSection(PEPROCESS Process, } if (i >= NrSegments) { - KEBUGCHECK(0); + ASSERT(FALSE); } for (i = 0; i < NrSegments; i++) @@ -4627,7 +4627,7 @@ MmMapViewOfSection(IN PVOID SectionObject, { /* Following this pointer would lead to us to the dark side */ /* What to do? Bugcheck? Return status? Do the mambo? */ - KEBUGCHECK(MEMORY_MANAGEMENT); + KeBugCheck(MEMORY_MANAGEMENT); } if (SectionOffset == NULL) diff --git a/reactos/ntoskrnl/ob/obdir.c b/reactos/ntoskrnl/ob/obdir.c index b7da8e05b00..7fc6c1acb51 100644 --- a/reactos/ntoskrnl/ob/obdir.c +++ b/reactos/ntoskrnl/ob/obdir.c @@ -62,7 +62,7 @@ ObpInsertEntryDirectory(IN POBJECT_DIRECTORY Parent, /* Invalid context */ DPRINT1("OB: ObpInsertEntryDirectory - invalid context %p %ld\n", Context, Context->DirectoryLocked); - KEBUGCHECK(0); + ASSERT(FALSE); return FALSE; } @@ -252,7 +252,7 @@ ObpLookupEntryDirectory(IN POBJECT_DIRECTORY Directory, if ((SearchShadow) && (Directory->DeviceMap)) { /* FIXME: We don't support this yet */ - KEBUGCHECK(0); + ASSERT(FALSE); } } diff --git a/reactos/ntoskrnl/ob/obhandle.c b/reactos/ntoskrnl/ob/obhandle.c index 1096c01f073..9ec6266471e 100644 --- a/reactos/ntoskrnl/ob/obhandle.c +++ b/reactos/ntoskrnl/ob/obhandle.c @@ -916,7 +916,7 @@ ObpIncrementHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); goto Quickie; } } @@ -945,7 +945,7 @@ ObpIncrementHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } @@ -1143,7 +1143,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); goto Quickie; } } @@ -1169,7 +1169,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object, { /* FIXME: This should never happen for now */ DPRINT1("Unhandled case\n"); - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } @@ -1753,7 +1753,7 @@ ObpCloseHandle(IN HANDLE Handle, if (KdDebuggerEnabled) { /* Bugcheck */ - KeBugCheckEx(0, (ULONG_PTR)Handle, 1, 0, 0); + KeBugCheckEx(INVALID_KERNEL_HANDLE, (ULONG_PTR)Handle, 1, 0, 0); } } } @@ -3034,7 +3034,7 @@ ObInsertObject(IN PVOID Object, { /* Weird case where we need to do a manual delete */ DPRINT1("Unhandled path\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Cleanup the lookup */ @@ -3052,7 +3052,7 @@ ObInsertObject(IN PVOID Object, } /* Return failure code */ - KEBUGCHECK(0); + ASSERT(FALSE); return Status; } } diff --git a/reactos/ntoskrnl/ob/oblink.c b/reactos/ntoskrnl/ob/oblink.c index bc742e339d8..fa083fc16d6 100644 --- a/reactos/ntoskrnl/ob/oblink.c +++ b/reactos/ntoskrnl/ob/oblink.c @@ -49,7 +49,7 @@ ObpCreateSymbolicLinkName(IN POBJECT_SYMBOLIC_LINK SymbolicLink) /* FIXME: We don't support device maps yet */ DPRINT1("Unhandled path!\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /*++ diff --git a/reactos/ntoskrnl/po/power.c b/reactos/ntoskrnl/po/power.c index e656446afed..6dd7d636c1f 100644 --- a/reactos/ntoskrnl/po/power.c +++ b/reactos/ntoskrnl/po/power.c @@ -78,7 +78,7 @@ PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState) Status = IopGetSystemPowerDeviceObject(&DeviceObject); if (!NT_SUCCESS(Status)) { - CPRINT("No system power driver available\n"); + DPRINT1("No system power driver available\n"); return STATUS_UNSUCCESSFUL; } diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index a6ec97faea4..afb9623a7b9 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -310,7 +310,7 @@ PspDeleteProcess(IN PVOID ObjectBody) if (!(ExDestroyHandle(PspCidTable, Process->UniqueProcessId, NULL))) { /* Something wrong happened, bugcheck */ - KEBUGCHECK(CID_HANDLE_DELETION); + KeBugCheck(CID_HANDLE_DELETION); } } @@ -360,7 +360,7 @@ PspDeleteThread(IN PVOID ObjectBody) if (!(ExDestroyHandle(PspCidTable, Thread->Cid.UniqueThread, NULL))) { /* Something wrong happened, bugcheck */ - KEBUGCHECK(CID_HANDLE_DELETION); + KeBugCheck(CID_HANDLE_DELETION); } } @@ -421,7 +421,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (KeIsAttachedProcess()) { /* Bugcheck */ - KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, + KeBugCheckEx(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG_PTR)CurrentProcess, (ULONG_PTR)Thread->Tcb.ApcState.Process, (ULONG_PTR)Thread->Tcb.ApcStateIndex, @@ -435,7 +435,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (Thread->ActiveExWorker) { /* Bugcheck */ - KEBUGCHECKEX(ACTIVE_EX_WORKER_THREAD_TERMINATION, + KeBugCheckEx(ACTIVE_EX_WORKER_THREAD_TERMINATION, (ULONG_PTR)Thread, 0, 0, @@ -446,7 +446,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (Thread->Tcb.CombinedApcDisable != 0) { /* Bugcheck */ - KEBUGCHECKEX(KERNEL_APC_PENDING_DURING_EXIT, + KeBugCheckEx(KERNEL_APC_PENDING_DURING_EXIT, 0, Thread->Tcb.CombinedApcDisable, 0, @@ -578,7 +578,7 @@ PspExitThread(IN NTSTATUS ExitStatus) else { /* Bugcheck, we can't allow this */ - KEBUGCHECKEX(CRITICAL_PROCESS_DIED, + KeBugCheckEx(CRITICAL_PROCESS_DIED, (ULONG_PTR)CurrentProcess, 0, 0, @@ -701,7 +701,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if (!Thread->Tcb.EnableStackSwap) { /* Stack swap really shouldn't be disabled during exit! */ - KEBUGCHECKEX(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0); + KeBugCheckEx(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0); } /* Cancel I/O for the thread. */ @@ -849,7 +849,7 @@ PspExitThread(IN NTSTATUS ExitStatus) if ((FirstEntry) || (Thread->Tcb.CombinedApcDisable != 0)) { /* Bugcheck time */ - KEBUGCHECKEX(KERNEL_APC_PENDING_DURING_EXIT, + KeBugCheckEx(KERNEL_APC_PENDING_DURING_EXIT, (ULONG_PTR)FirstEntry, Thread->Tcb.CombinedApcDisable, KeGetCurrentIrql(), diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index 3e549ff9bd8..6b92a99e8c0 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -698,7 +698,7 @@ PspCreateProcess(OUT PHANDLE ProcessHandle, { /* FIXME: We need to insert this process */ DPRINT1("Jobs not yet supported\n"); - KEBUGCHECK(0); + ASSERT(FALSE); } /* Create PEB only for User-Mode Processes */ diff --git a/reactos/ntoskrnl/ps/security.c b/reactos/ntoskrnl/ps/security.c index 525b130c076..27ea3162350 100644 --- a/reactos/ntoskrnl/ps/security.c +++ b/reactos/ntoskrnl/ps/security.c @@ -647,7 +647,7 @@ PsImpersonateClient(IN PETHREAD Thread, } /* Check if this is a job, which we don't support yet */ - if (Thread->ThreadsProcess->Job) KEBUGCHECK(0); + if (Thread->ThreadsProcess->Job) ASSERT(FALSE); /* Lock thread security */ PspLockThreadSecurityExclusive(Thread); diff --git a/reactos/ntoskrnl/rtl/libsupp.c b/reactos/ntoskrnl/rtl/libsupp.c index b67235086fc..5221937b58d 100644 --- a/reactos/ntoskrnl/rtl/libsupp.c +++ b/reactos/ntoskrnl/rtl/libsupp.c @@ -121,7 +121,7 @@ STDCALL RtlDeleteHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -130,7 +130,7 @@ STDCALL RtlEnterHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -139,7 +139,7 @@ STDCALL RtlInitializeHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -148,7 +148,7 @@ STDCALL RtlLeaveHeapLock( PRTL_CRITICAL_SECTION CriticalSection) { - KEBUGCHECK(0); + ASSERT(FALSE); return STATUS_SUCCESS; } @@ -159,7 +159,7 @@ CHECK_PAGED_CODE_RTL(char *file, int line) if(KeGetCurrentIrql() > APC_LEVEL) { DbgPrint("%s:%i: Pagable code called at IRQL > APC_LEVEL (%d)\n", file, line, KeGetCurrentIrql()); - KEBUGCHECK(0); + ASSERT(FALSE); } } #endif diff --git a/reactos/ntoskrnl/se/audit.c b/reactos/ntoskrnl/se/audit.c index de535b3f161..cafd282d2f2 100644 --- a/reactos/ntoskrnl/se/audit.c +++ b/reactos/ntoskrnl/se/audit.c @@ -84,7 +84,7 @@ SeInitializeProcessAuditName(IN PFILE_OBJECT FileObject, (!(NT_SUCCESS(Status)) || (ReturnLength == sizeof(LocalNameInfo)))) { /* First, free any buffer we might've allocated */ - KEBUGCHECK(0); + ASSERT(FALSE); if (ObjectNameInfo) ExFreePool(ObjectNameInfo); /* Now allocate a temporary one */ diff --git a/reactos/ntoskrnl/se/token.c b/reactos/ntoskrnl/se/token.c index c80a5da97f4..47832556b18 100644 --- a/reactos/ntoskrnl/se/token.c +++ b/reactos/ntoskrnl/se/token.c @@ -2277,7 +2277,7 @@ NtOpenThreadTokenEx(IN HANDLE ThreadHandle, PrimaryToken = PsReferencePrimaryToken(Thread->ThreadsProcess); Status = SepCreateImpersonationTokenDacl(Token, PrimaryToken, &Dacl); - KEBUGCHECK(0); + ASSERT(FALSE); ObfDereferenceObject(PrimaryToken); ObfDereferenceObject(Thread); if (!NT_SUCCESS(Status))