Problem using WdfRequestGetParameters (WDF newbie)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • [3/4] Distributed storage. Algorithms.
    ... * GNU General Public License for more details. ... * This callback is invoked when node is removed from storage. ... * request processing. ... * This function reads or writes node's private data from underlying media. ...
    (Linux-Kernel)
  • Async callbacks with Global.asax
    ... ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request ... And here is the page that handles the callback request. ... the callback handler in _Default page. ... includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Asynchronous socket operations and threadpool
    ... | 0 - You get the Socket.BeginRead callback, ... | an IOCP thread. ... You kick off the DB Request async, do as much more of the user request as ... An additional complication is that your socket is back in BeginRead mode so ...
    (microsoft.public.dotnet.framework)
  • RE: ObjectDataSource update using callback instead of postback
    ... As for ASP.NET script callback, its request is ... some normal postback data processing and events other than the script call ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: LWP::Parallel callback question
    ... or different for every single request. ... > individual callbacks that get called when the request finishes. ... > it seems the only kind of callback that gets called when a request ... I don't see any way to register an individual callback for a given ...
    (comp.lang.perl.modules)