Solved

Mapping Phys To Linear and vice versa

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

17 Experts available now in Live!

Get 1:1 Help Now