Driver Verifier & ExAcquireResourceExclusiveLite

Running a driver on Windows 2000 but compiled with the DDK for NT 4.0 the
“Driver Verifier” signals an undocumented error code on the call
ExAcquireResourceExclusiveLite if the IRQL is at PASSIVE_LEVEL. No errors at
APC_LEVEL. From the DDK 2000 documentation appears that the call at
PASSIVE_LEVEL is allowed.

Specifically the Verifier do the call
KeBugCheckEx(0xC4,0x37,0,0,resource_pointer), where 0xC4 is the Verifier
specific error code, but 0x37 is an undocumented (DDK 2000) sub error code.

The code is :

ERESOURCE* res;
NTSTATUS status;
unsigned size = sizeof(ERESOURCE);

ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL );

res = ExAllocatePool(NonPagedPool,size);
ASSERT( res );

status = ExInitializeResourceLite(res);
ASSERT(NT_SUCCESS(status));

ExAcquireResourceExclusiveLite(res,TRUE); // FAIL with
KeBugCheckEx(0xC4,0x37,0,0,res)

I don’t know about your ddk but mine says:

“Normal kernel APCs must be disabled before calling
ExAcquireResourceExclusiveLite. Otherwise a bugcheck occurs. Normal kernel
APCs can be disabled by calling KeEnterCriticalRegion or by raising the
calling thread’s IRQL to APC_LEVEL.”

-the w2k ddk.

The verifier is enforcing this rule.

-----Original Message-----
From: xxxxx@eutron.it [mailto:xxxxx@eutron.it]
Sent: Friday, March 17, 2000 10:52 AM
To: NT Developers Interest List
Subject: [ntdev] Driver Verifier & ExAcquireResourceExclusiveLite

Running a driver on Windows 2000 but compiled with the DDK
for NT 4.0 the
“Driver Verifier” signals an undocumented error code on the call
ExAcquireResourceExclusiveLite if the IRQL is at
PASSIVE_LEVEL. No errors at
APC_LEVEL. From the DDK 2000 documentation appears that the call at
PASSIVE_LEVEL is allowed.

Specifically the Verifier do the call
KeBugCheckEx(0xC4,0x37,0,0,resource_pointer), where 0xC4 is
the Verifier
specific error code, but 0x37 is an undocumented (DDK 2000)
sub error code.

The code is :

ERESOURCE* res;
NTSTATUS status;
unsigned size = sizeof(ERESOURCE);

ASSERT( KeGetCurrentIrql() < DISPATCH_LEVEL );

res = ExAllocatePool(NonPagedPool,size);
ASSERT( res );

status = ExInitializeResourceLite(res);
ASSERT(NT_SUCCESS(status));

ExAcquireResourceExclusiveLite(res,TRUE); // FAIL with
KeBugCheckEx(0xC4,0x37,0,0,res)


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)