Lock/Unlock FCB/CCB

Please help,
I am on a file system driver and it work.
Except when verifier is enabled,
I have a BSOD like saying KeEnterCriticalRegion must be run with IRQL <= APC_LEVEL,
and I need it to lock FCB and CCB resources.

How to lock / release FCB and CCB resources in this case?

In the ‘ExAcquireResourceExclusiveLite’ function I read these:
Normal kernel APC delivery must be disabled before calling this routine. Disable normal kernel APC delivery by calling KeEnterCriticalRegion. Delivery must remain disabled until the resource is released, at which point it can be reenabled by calling KeLeaveCriticalRegion. For more information, see Disabling APCs.

I want to lock the FCB otherwise I could not run my filesystem driver in multi thread.

I also have a BSOD: ExAcquireResourceExclusiveLite should be called at IRQL <= APC_LEVEL

HOW I LOCK / UNLOCK THE FCB RESOURCE CCB DIFFERENTLY !!! ???

Thank you very much.

Why are you above APC level?

How to lock / release FCB and CCB resources in this case?

Without knowing which cases it is it’s hard to say. I’d guess that you are
either trying to acquire the lock in a post call or you have missed one of
the pre-calls.

In the ‘ExAcquireResourceExclusiveLite’ function I read these:
Normal kernel APC delivery must be disabled before calling
this routine. Disable normal kernel APC delivery by calling
KeEnterCriticalRegion. Delivery must remain disabled until
the resource is released, at which point it can be reenabled
by calling KeLeaveCriticalRegion. For more information, see Disabling
APCs.

Irrellevant to the problem at hand. I’ll not however that there are cases
(MPW callback being the most obvious) when you can “know” that APCs are
disabled and that you will cause another verifier error you call use
KeEnterCriticalRegion.

I solved this problem by remove function acquirespinxxxxx.