Re: [ntdev]Re: [ntdev] Re: [ntdev] [NTDEV]How to pending a IO Request in WDF driver on Windows 7

Thank for you help, now I think I can realy understand the definition of “synchronous” and “asynchronous” :slight_smile:

Now I have a new question, how can I recognise which request should be finished?

In my application , I need run multiple I/O requests on a single file handle. In overlapped I/O, all the things will be done in asynchronous.
so it’s likely to happen that the latter request is finished before the former.
At the begining, I intend to use WdfRequestForwardToIoQueue to save the request I want to pending, and then use WdfIoQueueRetrieveNextRequest to get the requset and complete it.
However, when I have done these actually, I find there hasn’t enough information to recognise the very request I wanted.
For example, when I receive a device interrupt for DMA complete, I should release the corresponding transaction and request.

Should I establish a user-defined data structure to save all the information I need? Or there’s a better way to slove it via WDF framework supplied routines?

xxxxx@sina.com

发件人: Tim Roberts
发送时间: 2016-10-15 00:34
收件人: Windows System Software Devs Interest List
主题: [ntdev]Re: [ntdev] 回复:Re: [ntdev] [NTDEV]How to pending a IO Request in WDF driver on Windows 7

lizzoe wrote:

You mean that’s impossible in synchronous I/O? A uncompleted Read
request is bound to block other Write request? Is there a document
can explain it ?

Of course it is. That’s the very definition if “synchronous I/O”. This
is just a fundamental principle of Windows user mode I/O, and has very
little to do with kernel drivers. Unless you use overlapped I/O, you
can only have one I/O request at a time on any given file handle. A
ReadFile (or WriteFile or DeviceIoControl) call will not return until
the IRP is completed, and no other thread can submit another request.

If you want to have multiple I/O requests on a single file handle, you
must use overlapped I/O.

With overlapped I/O, as soon as your dispatch handler returns, the
application can continue on to do other things, whether or not you
completed the IRP.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>