Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Input/Output Buffer Validation
Device Manager calls the MapCallerPtr function to validate all input and output buffers passed to DeviceIoControl. Because Device Manager validates these buffers, individual drivers that use DeviceIoControl do not need to validate their input and output buffers. The following Device Manager code excerpt shows when and how Device Manager validates the input and output buffers.
BOOL DM_DevDeviceIoControl(
fsopendev_t *fsodev,
DWORD dwIoControlCode,
LPVOID lpInBuf,
DWORD nInBufSize,
LPVOID lpOutBuf,
DWORD nOutBufSize,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped)
{
BOOL retval = FALSE;
DWORD dodec = 0;
LPEXCEPTION_POINTERS pep;
lpInBuf = MapCallerPtr(lpInBuf,nInBufSize);
lpOutBuf = MapCallerPtr(lpOutBuf,nOutBufSize);
// End of code excerpt.
}
See Also
Send Feedback on this topic to the authors