Threads and IoControl

Is there any difference between sending
IoControl IRP’s from two threads of the same
process or different processes ?

Does the IO control manager behave
in a different way when two threads
use the same device handle or two
threads from different processes
use different handles ?

Thanks, Tom.

The “IO control manager” sends the IOCTL IRP in the thread context which
called DeviceIoControl. It does not impose any synchronization, it is the
driver who must impose it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Tomer Goldberg”
To: “Windows System Software Developers Interest List”
Sent: Tuesday, August 12, 2003 6:22 PM
Subject: [ntdev] Threads and IoControl

>
> Is there any difference between sending
> IoControl IRP’s from two threads of the same
> process or different processes ?
>
> Does the IO control manager behave
> in a different way when two threads
> use the same device handle or two
> threads from different processes
> use different handles ?
>
> Thanks, Tom.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Is there a difference if
both of the threads belong to the same process or not ?

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, August 12, 2003 3:33 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Threads and IoControl

The “IO control manager” sends the IOCTL IRP in the
thread context which
called DeviceIoControl. It does not impose any
synchronization, it is the
driver who must impose it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Tomer Goldberg”
> To: “Windows System Software Developers Interest List”
>
> Sent: Tuesday, August 12, 2003 6:22 PM
> Subject: [ntdev] Threads and IoControl
>
>
> >
> > Is there any difference between sending
> > IoControl IRP’s from two threads of the same
> > process or different processes ?
> >
> > Does the IO control manager behave
> > in a different way when two threads
> > use the same device handle or two
> > threads from different processes
> > use different handles ?
> >
> > Thanks, Tom.
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@royatech.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Nope no difference as far as the driver is concerned, unless it chooses to
create a difference. The IO manager of course has some rules it imposes,
such as two threads using the same handle are not going to be able to
concurrently send requests to a device if the handle was opened
synchronously. But once again, this is not a driver issue it is an
application programming issue.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Tomer Goldberg [mailto:xxxxx@royatech.com]
Sent: Wednesday, August 13, 2003 11:48 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Threads and IoControl

Is there a difference if
both of the threads belong to the same process or not ?

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, August 12, 2003 3:33 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Threads and IoControl

The “IO control manager” sends the IOCTL IRP in the
thread context which
called DeviceIoControl. It does not impose any
synchronization, it is the
driver who must impose it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Tomer Goldberg”
> To: “Windows System Software Developers Interest List”
>
> Sent: Tuesday, August 12, 2003 6:22 PM
> Subject: [ntdev] Threads and IoControl
>
>
> >
> > Is there any difference between sending
> > IoControl IRP’s from two threads of the same
> > process or different processes ?
> >
> > Does the IO control manager behave
> > in a different way when two threads
> > use the same device handle or two
> > threads from different processes
> > use different handles ?
> >
> > Thanks, Tom.
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com To
> > unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@royatech.com To
> unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Are you asking how to find out which process originated the DeviceIoControl?
If so you can use IoGetRequesterProcess.

Alexei.

“Tomer Goldberg” wrote in message news:xxxxx@ntdev…
>
>
> Is there a difference if
> both of the threads belong to the same process or not ?
>
> > -----Original Message-----
> > From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> > Sent: Tuesday, August 12, 2003 3:33 PM
> > To: Windows System Software Developers Interest List
> > Subject: [ntdev] Re: Threads and IoControl
> >
> >
> > The “IO control manager” sends the IOCTL IRP in the
> > thread context which
> > called DeviceIoControl. It does not impose any
> > synchronization, it is the
> > driver who must impose it.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.com
> >
> >
> > ----- Original Message -----
> > From: “Tomer Goldberg”
> > To: “Windows System Software Developers Interest List”
> >
> > Sent: Tuesday, August 12, 2003 6:22 PM
> > Subject: [ntdev] Threads and IoControl
> >
> >
> > >
> > > Is there any difference between sending
> > > IoControl IRP’s from two threads of the same
> > > process or different processes ?
> > >
> > > Does the IO control manager behave
> > > in a different way when two threads
> > > use the same device handle or two
> > > threads from different processes
> > > use different handles ?
> > >
> > > Thanks, Tom.
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@royatech.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
>
>
>

> Is there a difference if

both of the threads belong to the same process or not ?

No. Once again - the IO manager does no synchronization. At all.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com