Problem using WdfRequestGetParameters (WDF newbie)
- From: "lorenzoff" <Doppel@xxxxxxxxxx>
- Date: 18 Jan 2006 08:34:24 -0800
Hello to all and sorry for my english ;-)
I'm trying to write a kmdf driver for an usb device; in my EvtDeviceAdd
callback I use this code:
WDFQUEUE _ioctl_queue;
WDF_IO_QUEUE_CONFIG _ioctl_queue_config;
_queue_config.EvtIoRead = MyEvtIoReadWrite;
_queue_config.EvtIoWrite = MyEvtIoReadWrite;
_queue_config.EvtIoDeviceControl=MyEvtIoDeviceControl;
_status=WdfIoQueueCreate(_device, &_queue_config,
WDF_NO_OBJECT_ATTRIBUTES, &_queue);
In a test application, once retreived device handle, I write a request
(7 bytes) and read the response (512 bytes) using WriteFile and
ReadFile calls.
Both I/O request are managed by the callback that I've registered
(MyEvtIoReadWrite).
In this function I attempt to determine the request type to perform
different operations:
WDF_REQUEST_PARAMETERS _request_parameters;
WDFMEMORY _memory;
WdfRequestGetParameters(Request, &_request_parameters);
if (_request_parameters.Type==WdfRequestTypeWrite){
_status=WdfRequestRetrieveInputMemory(Request, &_memory);
....
}
else{
_status=WdfRequestRetrieveOutputMemory(Request, &_memory);
....
}
While the first call (corresponding to user-mode WriteFile) works fine
(7 bytes written), at the second call (corresponding to user-mode
ReadFile), _request_parameters.Type member is always set to
WdfRequestTypeWrite (but Length parameter is now 512) and the
subsequential call to WdfRequestRetrieveInputMemory fails due to
STATUS_INVALID_DEVICE_REQUEST (obviously).
What is wrong?
Thanks and greetings from Rome
.
- Follow-Ups:
- Re: Problem using WdfRequestGetParameters (WDF newbie)
- From: Doron Holan [MS]
- Re: Problem using WdfRequestGetParameters (WDF newbie)
- From: lorenzoff
- Re: Problem using WdfRequestGetParameters (WDF newbie)
- Prev by Date: Re: WHQL Approved Test Systems for NDIS IM Driver Certification
- Next by Date: Re: Disabling interrupts in Windows
- Previous by thread: Re: NDIS power management wake up
- Next by thread: Re: Problem using WdfRequestGetParameters (WDF newbie)
- Index(es):
Relevant Pages
|