Validating Range of Address.

Hi
Are there any APIs to check whether the range of addresses is valid in the current process context? The address to be validated is a user mode address. I can do the check either in usermode application or in the display driver or miniport.

Thanks.

Sorry for sending back to back mails.
Actually i want to do the check in kernel mode not in the application.

Thanks.

Which kernel-mode address would you like to check? User-mode app should
never send you a kernel-mode address (even in your private IOCTL
communication), you should pass handles instead (and remap it into
kernel-mode address in kernel-mode).

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, March 10, 2011 2:22 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Validating Range of Address.

Hi
Are there any APIs to check whether the range of addresses is valid in the
current process context? The address to be validated is a user mode address.
I can do the check either in usermode application or in the display driver
or miniport.

Thanks.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The typical way a driver validates the memory is to map it into the
kernel. While there is ProbeForRead and ProbeForWrite calls, they have
the problem that you can call them and get a result that things are ok,
but before you can do anything with the result the application can make
the memory invalid. So the only safe method is to map it into the
kernel, the application may still invalidate the memory but the driver
has access.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@gmail.com” wrote in message
news:xxxxx@ntdev:

> Hi
> Are there any APIs to check whether the range of addresses is valid in the current process context? The address to be validated is a user mode address. I can do the check either in usermode application or in the display driver or miniport.
>
> Thanks.

You have VideoPortLockBuffer available for a video miniport. How is
this user mode address getting to your video miniport driver?

Mark Roddy

On Thu, Mar 10, 2011 at 9:14 AM, wrote:
> Sorry for sending back to back mails.
> Actually i want to do the check in kernel mode not in the application.
>
> Thanks.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Hi Don
Thanks a lot. That is exactly what i want.

@ Mark. Iam using IOCTL to send the user address.