From: Peter on
I met following error. It occurres only sometimes in calling
DeviceIoControl() to my IM ndis driver with different control codes, not
reproducable
How can I to solve this problem ?

APC_INDEX_MISMATCH (1)
This is a kernel internal error which can occur only on a checked build.
The most common reason to see such a bugcheck would occur when a
filesystem had a mismatched number of KeEnterCriticalRegion calls compared
to KeLeaveCriticalRegion calls. This check is made on exit from a system
call.
Arguments:
Arg1: 812f984a, address of system function (system call)
Arg2: 00000000, Thread->ApcStateIndex << 8 | Previous ApcStateIndex
Arg3: 0000ffff, Thread->KernelApcDicable
Arg4: 00000000, Previous KernelApcDisable

From: Eliyas Yakub [MSFT] on
You have to debug to find out information about the thread and owning
process and see if that's yours. Then you have to narrow it down to a
specific request. Somebody disabled KernelApc and forgot to reenable. Turn
on driver verifier on NDIS and your driver.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/driver/kernel/KB-drv.mspx