From 2bc2e85140acfe7c5b95cd0fdaa56803177fcaf8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Nov 2011 00:21:57 +0000 Subject: [PATCH] [KMTESTS] - Fix some typos in previous commit - Make the driver object accessible to tests svn path=/trunk/; revision=54355 --- rostests/kmtests/include/kmt_test.h | 1 + rostests/kmtests/kmtest_drv/kmtest_drv.c | 2 ++ rostests/kmtests/ntos_ex/ExFastMutex.c | 2 +- rostests/kmtests/ntos_ke/KeIrql.c | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rostests/kmtests/include/kmt_test.h b/rostests/kmtests/include/kmt_test.h index e187e05efe8..b1ac21e72a6 100644 --- a/rostests/kmtests/include/kmt_test.h +++ b/rostests/kmtests/include/kmt_test.h @@ -83,6 +83,7 @@ typedef struct extern BOOLEAN KmtIsCheckedBuild; extern BOOLEAN KmtIsMultiProcessorBuild; extern PCSTR KmtMajorFunctionNames[]; +extern PDRIVER_OBJECT KmtDriverObject; VOID KmtSetIrql(IN KIRQL NewIrql); BOOLEAN KmtAreInterruptsEnabled(VOID); diff --git a/rostests/kmtests/kmtest_drv/kmtest_drv.c b/rostests/kmtests/kmtest_drv/kmtest_drv.c index 05b5709da3a..d15fd2a1761 100644 --- a/rostests/kmtests/kmtest_drv/kmtest_drv.c +++ b/rostests/kmtests/kmtest_drv/kmtest_drv.c @@ -28,6 +28,7 @@ static DRIVER_DISPATCH DriverIoControl; /* Globals */ static PDEVICE_OBJECT MainDeviceObject; +PDRIVER_OBJECT KmtDriverObject = NULL; /* Entry */ /** @@ -62,6 +63,7 @@ DriverEntry( Prcb = KeGetCurrentPrcb(); KmtIsCheckedBuild = (Prcb->BuildType & PRCB_BUILD_DEBUG) != 0; KmtIsMultiProcessorBuild = (Prcb->BuildType & PRCB_BUILD_UNIPROCESSOR) == 0; + KmtDriverObject = DriverObject; RtlInitUnicodeString(&DeviceName, KMTEST_DEVICE_DRIVER_PATH); Status = IoCreateDevice(DriverObject, sizeof(KMT_DEVICE_EXTENSION), diff --git a/rostests/kmtests/ntos_ex/ExFastMutex.c b/rostests/kmtests/ntos_ex/ExFastMutex.c index 4ed5afe371f..4535ddfc66b 100644 --- a/rostests/kmtests/ntos_ex/ExFastMutex.c +++ b/rostests/kmtests/ntos_ex/ExFastMutex.c @@ -44,7 +44,7 @@ TestFastMutex( ExReleaseFastMutex(Mutex); CheckMutex(Mutex, 1L, NULL, 0LU, OriginalIrql, OriginalIrql); -#ifdef _M_X86 +#ifdef _M_IX86 /* ntoskrnl's fastcall version */ ExiAcquireFastMutex(Mutex); CheckMutex(Mutex, 0L, Thread, 0LU, OriginalIrql, APC_LEVEL); diff --git a/rostests/kmtests/ntos_ke/KeIrql.c b/rostests/kmtests/ntos_ke/KeIrql.c index 40f21634e3f..fab941d000d 100644 --- a/rostests/kmtests/ntos_ke/KeIrql.c +++ b/rostests/kmtests/ntos_ke/KeIrql.c @@ -96,7 +96,7 @@ START_TEST(KeIrql) /* on x86, you can raise to _any_ possible KIRQL value */ /* on x64, anything with more than the least significant 4 bits set bugchecked, last time I tried */ /* TODO: other platforms? */ -#if defined _M_X86 +#if defined _M_IX86 for (Irql = PASSIVE_LEVEL; Irql <= (KIRQL)-1; ++Irql) { DPRINT("Raising to %u\n", Irql); @@ -105,7 +105,7 @@ START_TEST(KeIrql) KeLowerIrql(Irql2); ok_irql(PrevIrql); } -#endif /* defined _M_X86 */ +#endif /* defined _M_IX86 */ /* test KeRaiseIrqlToDpcLevel */ ok_irql(PASSIVE_LEVEL);