Solved

Mapping Phys To Linear and vice versa

Posted on 1997-02-10
1
292 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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