[KMTESTS]

- Fix some typos in previous commit
- Make the driver object accessible to tests

svn path=/trunk/; revision=54355
This commit is contained in:
Thomas Faber 2011-11-12 00:21:57 +00:00
parent d0133a99d0
commit 2bc2e85140
4 changed files with 6 additions and 3 deletions

View file

@ -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);

View file

@ -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),

View file

@ -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);

View file

@ -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);