?
Solved

Mapping Phys To Linear and vice versa

Posted on 1997-02-10
1
Medium Priority
?
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
donc earned 200 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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

770 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