Hi,
The following is my situation:
- The Driver verifier is up & running against my FSD
- “Q” is the drive mounted by my FSD (no filters here)
- first, copy c:\winnt\notepad.exe to q:\bin
- then IMMEDIATELY try to execute q:\bin\notepad.exe
The following is the assert I always get in the Windbg:
*** Assertion failed: Pfn1->u3.e1.LockCharged == 1
*** Source File: D:\nt\private\ntos\mm\iosup.c, line 772
Break, Ignore, Terminate Process or Terminate Thread (bipt)?
The stack is as follows:
Args to Child
819c9390 804826e5 0000a5aa nt!DbgBreakPoint
8044f318 8044f2f8 00000304 nt!RtlAssert+0x9a
ff895408 00000000 00000001 nt!MmProbeAndLockPages+0x5da
ff895408 00000000 00000001 nt!VerifierProbeAndLockPages+0x47
… My FSD’s read dispatch…
00000000 825e30d8 825e30c8 nt!IovSpecialIrpCallDriver+0xe4
ff890c48 825e30d8 f57c4b30 nt!IoPageRead+0xb1
ff890c48 f57c4c88 00000000 nt!MiCreateImageFileMap+0xfa
f57c4d14 000f001f 00000000 nt!MmCreateSection+0x92f
05ffd4c8 000f001f 00000000 nt!NtCreateSection+0x145
05ffd4c8 000f001f 00000000 nt!KiSystemService+0x10a
05ffd4c8 000f001f 00000000 NTDLL!NtCreateSection+0xb
000c7330 000e3330 00000000 KERNEL32!CreateProcessW+0x61d
The following is the line of code that causes this assert:
MmProbeAndLockPages( mdl, KernelMode,
( MajorFunction == IRP_MJ_READ ?
IoWriteAccess : IoReadAccess ) );
So, I am in the Paging-Read path of my FSD, and am
preparing the MDL to pass to the lower-level disk driver
(for physical read).
If I do hit “i” (ignore), notepad.exe does run fine…
Any suggestions on what I could be doing wrong in preparing
the MDL? The following is what I am basically doing:
MDL* mdl = IoAllocateMdl( myBuffer, mySize, FALSE, FALSE, irp );
// verified mdl pointer
__try
{
MmProbeAndLockPages( mdl, KernelMode,
( majorFunction == IRP_MJ_READ ?
IoWriteAccess : IoReadAccess ) );
Status = IoCallDriver( DeviceObject, irp );
}
__except(…)
… somewhere down the line:
MmUnlockPages( mdl );
IoFreeMdl( mdl );
Thanks.
-Vipul.