Assertion failed and KernelMode expception with IoMarkPending

In CreateDispatch routine while making a call IoMarkPendingIRp I am facing BSOD.
*** Fatal System Error: 0x0000001e (0xC0000420,0x9EACD7C1,0x97B58278,0xA6364730)
Irp currentStack location is 3 but stack count is 1.Can anybody have any idea.
NT_ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1);
nt!KiFatalExceptionHandler+0x1a C/C++/ASM
nt!ExecuteHandler2+0x26 C/C++/ASM
nt!ExecuteHandler+0x24 C/C++/ASM
nt!KiDispatchException+0x378 C/C++/ASM
nt!KiDispatchTrapException+0x4e C/C++/ASM
nt!KiRaiseAssertion+0xc1 C/C++/ASM

AFSKernelMode!IoGetCurrentIrpStackLocation+0x31 [c:\program files (x86)\windows kits\8.1\include\km\wdm.h @ 26983] C/C++/ASM
AFSKernelMode!IoMarkIrpPending+0xd [c:\program files (x86)\windows kits\8.1\include\km\wdm.h @ 27344] C/C++/ASM
AFSKernelMode!CreateRoutine+0x628 [c:\users\ys_91_000\documents\visual studio 2013\projects\afskernelmode\afskernelmode\create.c @ 183] C/C++/ASM
nt!IofCallDriver+0x3f C/C++/ASM
nt!IopParseDevice+0x51b C/C++/ASM
nt!ObpLookupObjectName+0x27e C/C++/ASM
nt!ObOpenObjectByName+0xfe C/C++/ASM
nt!IopCreateFile+0x2ae C/C++/ASM
nt!NtCreateFile+0x34 C/C++/ASM
nt!KiSystemServicePostCall C/C++/ASM
ntdll!KiFastSystemCallRet C/C++/ASM
ntdll!NtCreateFile+0xa C/C++/ASM
KERNELBASE!CreateFileInternal+0x2fd C/C++/ASM

Did you go look at the assert? From wdm.h:

NT_ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1);

What this says is that the IRP is too small. From your stack trace it would appear you are the only driver on the stack, so the question is how did you manage to consume an additional stack location?

Tony
OSR

Yes…that is the surprising. I dont know where from this extra stack location are getting added it should be always 1 . And i dont have any idea…How to get rid of this.I can see in the Locals WIndows that currentStatackLocation containing the right data but it is not clear that why it is has currentstack location value as 3.