Hello.
When starting my filter driver on Windows 2003 Server SP1, then after I
start the DriverVerifier tester, the function MmMapLockedPagesSpecifyCache
runs smoothly.
Doing the same, but without DriverVerifier, this function raises Exception
0xC0000141[STATUS_INVALID_ADDRESS].
I have tested this also on WindowsXP Professional SP2. Here this function
runs smoothly in both cases, independently on DriverVerifier.
Any idea where might be the problem ?
…
pMdlBuffer = IoAllocateMdl (pBuffer,
nBufferLen,
FALSE,
FALSE,
NULL);
if (pMdlBuffer == NULL) {
return STATUS_INSUFFICIENT_RESOURCES;
}
_try {
MmProbeAndLockPages (pMdlBuffer,
KernelMode,
IoModifyAccess);
}
_except (EXCEPTION_EXECUTE_HANDLER) {
IoFreeMdl (pMdlBuffer);
return GetExceptionCode ();
}
KeStackAttachProcess (g_G.sharedProcess, &ApcState);
_try {
pUserBuffer = MmMapLockedPagesSpecifyCache (pMdlBuffer, UserMode,
MmNonCached, NULL, FALSE, NormalPagePriority);
// ^^^ this function fails
}
_except(EXCEPTION_EXECUTE_HANDLER) {
status = GetExceptionCode ();
}
KeUnstackDetachProcess (&ApcState);
…
Thanks for your suggestions,
VPR