sorry for opening yet another thread on user mode / kernel mode memory
management, I posted some related questions earlier, thanks to Pavel
Lebedinsky, Maxim S. Shatskih and Tim Roberts for answering most questions,
but one has remained unanswered.
In
NTKERNELAPI PVOID
MmMapLockedPagesSpecifyCache(
IN PMDL MemoryDescriptorList,
IN KPROCESSOR_MODE AccessMode,
IN MEMORY_CACHING_TYPE CacheType,
IN PVOID BaseAddress,
IN ULONG BugCheckOnFailure,
IN MM_PAGE_PRIORITY Priority
);
what is the purpose of the IN PVOID BaseAddress parameter?
The docs say:
BaseAddress
If AccessMode = UserMode, this parameter specifies the starting user
address to map the MDL to, or NULL to allow the system to choose the starting
address.
What is the intended use of this parameter? When would I supply this
parameter, how would I obtain it, and how would I pass it to the kernel?
Or is there some unwritten law that anything else but NULL is illegal?
I tried to supply a base address in different ways while using
AccessMode = UserMode, but the kernel threw an exception all the time.
Any help?
Thx a lot
--
Don Burn (MVP, Windows DDK)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Gunter" <Gun...@discussions.microsoft.com> wrote in message
news:E16DC18F-C6D4-4E03...@microsoft.com...
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4023 (20090420) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4023 (20090420) __________
The message was checked by ESET NOD32 Antivirus.
thanks very much for your answer. I have read through the article you
pointed me to.
Unfortunately, the example discussed there also uses NULL as BaseAddress,
so it actually doesn't answer my question.
(Allow me to mention that I know how to use MmMapLockedPagesSpecifyCache
with a system-provided base address, my current driver works that way, but
this not want I want to do, for different reasons).
So, allow me to ask you (or anybody else in the driver community): can
someone point me to an article/example/source code where the parameter
BaseAddress in MmMapLockedPagesSpecifyCache is *not NULL*?
Thanks very much
Does it really take an example for you to understand what this is supposed
to do? Consider, for example, a poorly designed interface DLL that needs
to have the device mapped in to the same address in multiple processes.
That's a case where you might use this.
You also might have a chunk of address space that a user-mode process
allocated (but didn't commit) by VirtualAlloc. That would be another case.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.