From: Jamie Hanrahan [jeh@cmkrnl.com]
Sent: Thursday, August 26, 1999 8:20 AM
To: ntdev
Subject: Re: [ntdev] DeviceIOControl by pending IRP

mike:
> > situation:
> > 1. the user application issues an DIOC to the driver.
> > 2. driver marks IRP as pending
> > 3. the application thread hangs
> > 4. another thread of the same application tries to issue
> > another DIOC to the
> > same driver
> > ...and fails to send! even if the handle to device is newly opened
> > (CreateFile(...))

jeh:

> I'm not sure what you mean by "even if the handle is newly opened".
>
> The problem here is with the file object.  If the file object isn't
> created with FILE_FLAG_OVERLAPPED, it will only let one IO at a time
> (regardless of type of request, read, write, DIoC, etc.) through to
> the driver.
>
> Solution:  Either open the file object with FILE_FLAG_OVERLAPPED, or
> create another file object (do TWO CreateFile's, resulting
> in two file
> objects and two file handles, and use a different file
> handle in each
> thread).

mike:

> i did:
> 1. CreateFile and get hDevice
> 2. issue DIOC and get it pending
> 3. start a new thread
> 4. CreateFile and get another one hDeviceThread
> 5. issue DIOC and get the thread also hanging until
> previous DIOC completes
> 6. start new process
> 7. CreateFile and get hDeviceInNewProcess
> 8. issue successfull DIOC and inform the driver to complete
> the pending IRP
> 9. the pending IRP(s) get completed and the first process
> with hanging
> thread
> gets running

Ok.  Well, to answer your original question, it is DEFINITELY possible
to send multiple ioctl's (and/or reads and writes) to a driver at the
same time, from the same process.  I don't know why you're not seeing
the second ioctl from the first app in your driver dispatch routine,
but I certainly do in mine.  Something else is going on.

	--- Jamie Hanrahan, Kernel Mode Systems  ( http://www.cmkrnl.com/ )

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[ To unsubscribe, send email to ntdev-request@atria.com with body
UNSUBSCRIBE (the subject is ignored). ]
