diff --git a/reactos/drivers/video/videoprt/ddc.c b/reactos/drivers/video/videoprt/ddc.c index 0b51f35b6f6..a29f639ddd6 100644 --- a/reactos/drivers/video/videoprt/ddc.c +++ b/reactos/drivers/video/videoprt/ddc.c @@ -183,7 +183,7 @@ VideoPortDDCMonitorHelper( TRACE_(VIDEOPRT, "VideoPortDDCMonitorHelper()\n"); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); if (ddc->Size != sizeof (ddc)) { WARN_(VIDEOPRT, "ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size); diff --git a/reactos/drivers/video/videoprt/videoprt.c b/reactos/drivers/video/videoprt/videoprt.c index e21a044cfec..636b7120f5a 100644 --- a/reactos/drivers/video/videoprt/videoprt.c +++ b/reactos/drivers/video/videoprt/videoprt.c @@ -875,7 +875,7 @@ VideoPortSetRegistryParameters( TRACE_(VIDEOPRT, "VideoPortSetRegistryParameters ParameterName %S, RegPath: %wZ\n", ValueName, &VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); Status = RtlWriteRegistryValue( RTL_REGISTRY_ABSOLUTE, VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension)->RegistryPath.Buffer, diff --git a/reactos/hal/halppc/generic/dma.c b/reactos/hal/halppc/generic/dma.c index 57b6dfe80c6..a3bf04aaaf4 100644 --- a/reactos/hal/halppc/generic/dma.c +++ b/reactos/hal/halppc/generic/dma.c @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { diff --git a/reactos/hal/halx86/generic/dma.c b/reactos/hal/halx86/generic/dma.c index d55a56b5a6f..efd53f430d6 100644 --- a/reactos/hal/halx86/generic/dma.c +++ b/reactos/hal/halx86/generic/dma.c @@ -1569,7 +1569,7 @@ IoFlushAdapterBuffers( PHYSICAL_ADDRESS PhysicalAddress; PPFN_NUMBER MdlPagesPtr; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); if (AdapterObject != NULL && !AdapterObject->MasterDevice) { diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 47d12eda3b0..10d36fa0f20 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -16,11 +16,6 @@ #ifndef __INTERNAL_DEBUG #define __INTERNAL_DEBUG -/* FIXME: should probably remove this later */ -#if !defined(CHECKED) && !defined(NDEBUG) -#define CHECKED -#endif - /* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */ #if !defined(_RTLFUNCS_H) && (!defined(_NTDDK_) || !defined(__NTDDK_H)) @@ -87,13 +82,11 @@ RtlAssert( /* These are always printed */ #define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint - #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); /* These are printed only if NDEBUG is NOT defined */ #ifndef NDEBUG #define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint - #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); #else #ifdef _MSC_VER @@ -104,7 +97,6 @@ RtlAssert( #else #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #endif - #define CHECKPOINT #endif #define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__); @@ -122,8 +114,6 @@ RtlAssert( #define DPRINT1(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) - #define CHECKPOINT1 - #define CHECKPOINT #define UNIMPLEMENTED #define ERR_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) @@ -132,17 +122,8 @@ RtlAssert( #define INFO_(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #endif -/* - * FUNCTION: Assert a maximum value for the current irql - * ARGUMENTS: - * x = Maximum irql - */ -#define ASSERT_IRQL(x) assert(KeGetCurrentIrql()<=(x)) -#define assert_irql(x) assert(KeGetCurrentIrql()<=(x)) - -#ifndef KEBUGCHECK -#define KEBUGCHECK(a) DbgPrint("KeBugCheck (0x%X) at %s:%i\n", a, __FILE__,__LINE__), KeBugCheck(a) -#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx (0x%X, 0x%X, 0x%X, 0x%X, 0x%X) at %s:%i\n", a, b, c, d, e, __FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e) -#endif +#define ASSERT_IRQL_LESS_OR_EQUAL(x) ASSERT(KeGetCurrentIrql()<=(x)) +#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql()==(x)) +#define ASSERT_IRQL_LESS(x) ASSERT(KeGetCurrentIrql()<(x)) #endif /* __INTERNAL_DEBUG */ diff --git a/reactos/include/reactos/helper.h b/reactos/include/reactos/helper.h index f3fdd7f9be4..1bb7a52cfe4 100644 --- a/reactos/include/reactos/helper.h +++ b/reactos/include/reactos/helper.h @@ -27,15 +27,6 @@ #define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) ) #endif -#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V)) - -#define RtlRosMin3(X,Y,Z) (((X) < (Y)) ? RtlRosMin(X,Z) : RtlRosMin(Y,Z)) - -#ifndef KEBUGCHECK -#define KEBUGCHECKEX(a,b,c,d,e) DbgPrint("KeBugCheckEx at %s:%i\n",__FILE__,__LINE__), KeBugCheckEx(a,b,c,d,e) -#define KEBUGCHECK(a) DbgPrint("KeBugCheck at %s:%i\n",__FILE__,__LINE__), KeBugCheck(a) -#endif - /* iterate through the list using a list entry. * elem is set to NULL if the list is run thru without breaking out or if list is empty. */ diff --git a/reactos/ntoskrnl/ex/fmutex.c b/reactos/ntoskrnl/ex/fmutex.c index 4b22f8b9e01..e84e1cc613a 100644 --- a/reactos/ntoskrnl/ex/fmutex.c +++ b/reactos/ntoskrnl/ex/fmutex.c @@ -131,7 +131,7 @@ FASTCALL ExReleaseFastMutex(IN OUT PFAST_MUTEX FastMutex) { KIRQL OldIrql; - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); /* Erase the owner */ FastMutex->Owner = NULL; diff --git a/reactos/ntoskrnl/include/internal/debug.h b/reactos/ntoskrnl/include/internal/debug.h index a45e5ca8af4..0d10b91f9a6 100644 --- a/reactos/ntoskrnl/include/internal/debug.h +++ b/reactos/ntoskrnl/include/internal/debug.h @@ -15,27 +15,11 @@ * Define NASSERT before including this header to disable assertions */ -#include #ifndef __NTOSKRNL_DEBUG #define __NTOSKRNL_DEBUG #include -#if defined(_MSC_VER) && (_MSC_VER < 1300) -/* TODO: Verify which version the MS compiler learned the __FUNCTION__ macro */ -#define __FUNCTION__ "" -#endif - -#define CPRINT DPRINT1 - -/* - * FUNCTION: Assert a maximum value for the current irql - * ARGUMENTS: - * x = Maximum irql - */ -#define ASSERT_IRQL_LESS_OR_EQUAL(x) ASSERT(KeGetCurrentIrql()<=(x)) -#define ASSERT_IRQL_EQUAL(x) ASSERT(KeGetCurrentIrql()==(x)) -#define ASSERT_IRQL_LESS(x) ASSERT(KeGetCurrentIrql()<(x)) #endif /* __NTOSKRNL_DEBUG */ diff --git a/reactos/ntoskrnl/mm/pool.c b/reactos/ntoskrnl/mm/pool.c index 6febb0adc3f..a1582ba559f 100644 --- a/reactos/ntoskrnl/mm/pool.c +++ b/reactos/ntoskrnl/mm/pool.c @@ -225,7 +225,7 @@ ExAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, VOID STDCALL ExFreePool(IN PVOID Block) { - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); if (Block >= MmPagedPoolBase && (char*)Block < ((char*)MmPagedPoolBase + MmPagedPoolSize)) { diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index b2cc217fcf7..2e7993e38a3 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -91,7 +91,7 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, else align = 0; - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); return RPoolAlloc ( MmPagedPool, NumberOfBytes, Tag, align ); } @@ -99,7 +99,7 @@ ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, VOID STDCALL ExFreePagedPool(IN PVOID Block) { - ASSERT_IRQL(APC_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(APC_LEVEL); RPoolFree ( MmPagedPool, Block ); } diff --git a/reactos/ntoskrnl/po/power.c b/reactos/ntoskrnl/po/power.c index 6dd7d636c1f..f0b6ae4e188 100644 --- a/reactos/ntoskrnl/po/power.c +++ b/reactos/ntoskrnl/po/power.c @@ -349,7 +349,7 @@ PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, { POWER_STATE ps; - ASSERT_IRQL(DISPATCH_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL); ps.SystemState = PowerSystemWorking; // Fully on ps.DeviceState = PowerDeviceD0; // Fully on diff --git a/reactos/subsystems/win32/win32k/eng/engwindow.c b/reactos/subsystems/win32/win32k/eng/engwindow.c index a3f505468f9..ffae58cc2bc 100644 --- a/reactos/subsystems/win32/win32k/eng/engwindow.c +++ b/reactos/subsystems/win32/win32k/eng/engwindow.c @@ -153,7 +153,7 @@ IntEngWindowChanged( PLIST_ENTRY CurrentEntry; WNDGDI *Current; - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); CurrentEntry = Window->WndObjListHead.Flink; while (CurrentEntry != &Window->WndObjListHead) diff --git a/reactos/subsystems/win32/win32k/eng/semaphor.c b/reactos/subsystems/win32/win32k/eng/semaphor.c index 0cb96b75792..50d20841cd1 100644 --- a/reactos/subsystems/win32/win32k/eng/semaphor.c +++ b/reactos/subsystems/win32/win32k/eng/semaphor.c @@ -134,7 +134,7 @@ EngInitializeSafeSemaphore( { /* Wait for the other thread to create the semaphore */ ASSERT(Semaphore->lCount > 1); - ASSERT_IRQL(PASSIVE_LEVEL); + ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); while (Semaphore->hsem == NULL); }