Identify physical pages mapped with MapUserPhysicalPages()

I’m using AWE to allocate and map physical memory as follows:
AllocateUserPhysicalPages()
VirtualAlloc()
MapUserPhysicalPages()

and to deallocate:
MapUserPhysicalPages()
FreeUserPhysicalPages()
VirtualFree()

However, I’m slightly incredulous that the API appears to offer no way to
query mapped memory to retrieve a list of physical pages. This means that
in order to call FreeUserPhysicalPages() I must remember this information
myself. This isn’t difficult, but it seems akward and wasteful when I’m
certain that the kernel knows full well which pages are mapped. So, my
question is,

Is there any way to retrieve a list of physical pages mapped to a given
region?

Try VirtualQuery, can it help?

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “David P”
To: “Windows System Software Devs Interest List”
Sent: Thursday, December 04, 2003 5:41 PM
Subject: [ntdev] Identify physical pages mapped with MapUserPhysicalPages()

> I’m using AWE to allocate and map physical memory as follows:
> AllocateUserPhysicalPages()
> VirtualAlloc()
> MapUserPhysicalPages()
>
> and to deallocate:
> MapUserPhysicalPages()
> FreeUserPhysicalPages()
> VirtualFree()
>
> However, I’m slightly incredulous that the API appears to offer no way to
> query mapped memory to retrieve a list of physical pages. This means that
> in order to call FreeUserPhysicalPages() I must remember this information
> myself. This isn’t difficult, but it seems akward and wasteful when I’m
> certain that the kernel knows full well which pages are mapped. So, my
> question is,
>
> Is there any way to retrieve a list of physical pages mapped to a given
> region?
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com