Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ProbeForRead...

0 views
Skip to first unread message

Prabhashankar

unread,
Dec 17, 1999, 3:00:00 AM12/17/99
to
Hi there,
Has anybody used this API? I am trying to use this API in NDIS5
miniport for USB. When the address is bad, I get a page fault (exception
0x0D)! The main intention of calling this API is to see if the address
is bad. The code is given below...I am sure that I am doing some thing
wrong, just don't know what. Any help will be appreciated...

UCHAR
USB_ProbeForRead(
IN PVOID Address,
IN ULONG Length,
IN ULONG Alignment
)
{
try {
ProbeForRead(
Address,
Length,
Alignment);
} except (EXCEPTION_EXECUTE_HANDLER) {
ASSERT(FALSE);
return FALSE;
}

return TRUE;
}

Thanks
Prabhu


Sent via Deja.com http://www.deja.com/
Before you buy.

Walter Oney

unread,
Dec 17, 1999, 3:00:00 AM12/17/99
to
Prabhashankar wrote:
> Has anybody used this API? I am trying to use this API in NDIS5
> miniport for USB. When the address is bad, I get a page fault (exception
> 0x0D)! The main intention of calling this API is to see if the address
> is bad. The code is given below...I am sure that I am doing some thing
> wrong, just don't know what. Any help will be appreciated...

ProbeForXxx doesn't actually touch the memory, so I'm a bit surprised at
the general protection fault. All it actually does is verify that the
address you give is in the user portion of the address space and has the
specified alignment. You're expected to reference that memory within an
exception frame that will trap an address that turns out to be invalid.

The reason ProbeForXxx doesn't do more is that someone could
theoretically use one of the VirtualXxx functions in user mode to change
the attributes of the memory block in between the time you probe and the
time you actually access the block.

--
Walter Oney
http://www.oneysoft.com

0 new messages