Partager via


Device Manager Security (Windows CE 5.0)

Send Feedback

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

ActivateDeviceEx

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.