Solved

Mapping Phys To Linear and vice versa

Posted on 1997-02-10
1
280 Views
Last Modified: 2013-12-04
This is my situation (and problem):
0. I first allocate some pages using PageAllocate()
1. I then lock those pages in memory using LinPageLock()
2. I get the physical addresses of the pages I've locked using CopyPageTable()
3. I then try to get the linear address from the physical address using MapPhysToLinear()

My problem is that the linear address I get from step 0 is different from the one I get from step 3. In my VxD, at some point, I have a physical address and the VxD wants the linear address corresponding to it, so it can write something there. This linear address should be the same one that the application also has (the application records the linear address it gets from the PageAllocate() call), so that the application can later see what the VxD wrote.

Why are those linear addresses different? Do the two addresses still point to the same region so that if the VxD writes something, it can be seen in the application?
0
Comment
Question by:tripunit
1 Comment
 
LVL 1

Accepted Solution

by:
donc earned 100 total points
ID: 1299061
MapPhysToLinear is designed to give you a linear address to use so you can touch the given physical page, but it isn't designed to search all page tables in the system, and try to guess which page table, using which linear address, was used to find this physical address.

Likewise, it is possible that the linear address visible to your Win32 app is not available in the address space of the VxD, so the VxD needs a copy mapped into a high spot that is valid no matter which app context is active.

To answer your second question, yes, those two linear addresses point to the same physical location, so you can write using one and read with another, and everything works OK.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now