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.
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