OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Thu, 14 Mar 2019     118020 members

   Login
   Join


 
 
Contents
  Online Dump Analyzer
OSR Dev Blog
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

MmMapLockedPages(SpecifyCache) with AccessMode == UserMode

It's seem that there's been some info missing from the DDK documentation for quite a while.

When you call either MmMapLockedPagesSpecifyCache or the (now deprecated) MmMapLockedPages, and you specify UserMode (to map the pages into the user address space), you must wrap this call with an exception handler.

So, for example:

    __try {
        mappedVa = MmMapLockedPagesSpecifyCache(myMdl,
            UserMode,
            MmNonCached,
            NULL,
            FALSE,
            NormalPagePriority);

    }
    __except(EXCEPTION_EXECUTE_HANDLER) {
        NTSTATUS code;
        code = GetExceptionCode();
        DbgPrint("Call to MmMapLocked failed due to exception 0x%0x\n",
            code);

Related Articles
Change to Allow Page Mapping in XP

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

Post Your Comments.
Print this article.
Email this article.
bottom nav links