WDF: how to set error for DeviceIOControl?

When I call OSRUSBFX2 sample driver with incorrect IOCTL code, OsrFxEvtIoDeviceControl function sets status = STATUS_INVALID_DEVICE_REQUEST and calls WdfRequestCompleteWithInformation. However, client’s DeviceIOControl still returns TRUE. How can I change this to FALSE, should I call WdfRequestCancelSentRequest for this?

Thanks.


Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.

WdfRequestCancelSentRequest should only be called on a WDFREQUEST that is sent to a WDFIOTARGET. For a request that is processed in a queue callback without being sent, you should not call this API. What you describe sounds correct, can you send a code snippet to see what you are doing?

d

– I can spell, I just can’t type.


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Alex Farber
Sent: Monday, February 20, 2006 2:38 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WDF: how to set error for DeviceIOControl?

When I call OSRUSBFX2 sample driver with incorrect IOCTL code, OsrFxEvtIoDeviceControl function sets status = STATUS_INVALID_DEVICE_REQUEST and calls WdfRequestCompleteWithInformation. However, client’s DeviceIOControl still returns TRUE. How can I change this to FALSE, should I call WdfRequestCancelSentRequest for this?
?
??? Thanks.


Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@microsoft.com To unsubscribe send a blank email to xxxxx@lists.osr.com

Thank you, it was my mistake in user mode program. After setting error status in WdfRequestCompleteWithInformation DeviceIOControl really returns FALSE. In my case I used overlapped I/O, and error must be handled in GetOverlappedResult. The problem is solved.

Doron Holan wrote:
> What you describe sounds correct, can
you send a code snippet to see what you are doing?

Original question:
> When I call OSRUSBFX2 sample driver with incorrect IOCTL code,
OsrFxEvtIoDeviceControl function sets status = STATUS_INVALID_DEVICE_REQUEST and
calls WdfRequestCompleteWithInformation. However, client’s DeviceIOControl still
returns TRUE. How can I change this to FALSE, should I call
WdfRequestCancelSentRequest for this?


Yahoo! Mail
Use Photomail to share photos without annoying attachments.