Two instances of the drivers for two identical devices ?

Hello Experts
If I have two identical USB Devices connected on two different USB
Ports on a Windows PC, will there will be two different instances of
my driver running on it ? Is there are anyway to distinguish which
instance of the driver is for running for which device ? Not that I
want to do that now but just thinking aloud
I could check it myself but don’t access to my system now.

There will be one driver object pointer and two device object pointers in this case. You driver will be loaded once, your adddevice routine will be called twice.

d

debt from my phone

-----Original Message-----
From: driver developer
Sent: Wednesday, August 03, 2011 10:26 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Two instances of the drivers for two identical devices ?

Hello Experts
If I have two identical USB Devices connected on two different USB
Ports on a Windows PC, will there will be two different instances of
my driver running on it ? Is there are anyway to distinguish which
instance of the driver is for running for which device ? Not that I
want to do that now but just thinking aloud
I could check it myself but don’t access to my system now.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron
Also will I need to take any additional care for this kind of
situation in my driver ?

On Thu, Aug 4, 2011 at 11:27 AM, Doron Holan wrote:
> There will be one driver object pointer and two device object pointers in this case. You driver will be loaded once, your adddevice routine will be called twice.
>
> d
>
> debt from my phone
>
> -----Original Message-----
> From: driver developer
> Sent: Wednesday, August 03, 2011 10:26 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Two instances of the drivers for two identical devices ?
>
>
> Hello Experts
> If I have two identical USB Devices connected on two different USB
> Ports on a Windows PC, will there will be two different instances of
> my driver running on it ? Is there are anyway to distinguish which
> instance of the driver is for running for which device ? Not that I
> want to do that now but just thinking aloud
> I could check it myself but don’t access to my system now.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

1 instance of the driver and 2 device objects on it.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“driver developer” wrote in message news:xxxxx@ntdev…
> Hello Experts
> If I have two identical USB Devices connected on two different USB
> Ports on a Windows PC, will there will be two different instances of
> my driver running on it ? Is there are anyway to distinguish which
> instance of the driver is for running for which device ? Not that I
> want to do that now but just thinking aloud
> I could check it myself but don’t access to my system now.
>

Just be careful with globals.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“driver developer” wrote in message news:xxxxx@ntdev…
> Thanks Doron
> Also will I need to take any additional care for this kind of
> situation in my driver ?
>
> On Thu, Aug 4, 2011 at 11:27 AM, Doron Holan wrote:
>> There will be one driver object pointer and two device object pointers in this case. You driver will be loaded once, your adddevice routine will be called twice.
>>
>> d
>>
>> debt from my phone
>>
>> -----Original Message-----
>> From: driver developer
>> Sent: Wednesday, August 03, 2011 10:26 PM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Two instances of the drivers for two identical devices ?
>>
>>
>> Hello Experts
>> If I have two identical USB Devices connected on two different USB
>> Ports on a Windows PC, will there will be two different instances of
>> my driver running on it ? Is there are anyway to distinguish which
>> instance of the driver is for running for which device ? Not that I
>> want to do that now but just thinking aloud
>> I could check it myself but don’t access to my system now.
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>>
>

driver developer wrote:

Also will I need to take any additional care for this kind of
situation in my driver ?

What is it that you are worried about? That was perfectly ordinary code
for a filter driver, although if the driver isn’t doing anything in the
completion, there’s no reason to use one. You could just use
IoSkipCurrentStackLocation and send it along with no further action.


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

driver developer wrote:

Hello Experts
If I have two identical USB Devices connected on two different USB
Ports on a Windows PC, will there will be two different instances of
my driver running on it ?

Note that this is only valid if the devices have different serial
numbers, or do not have serial numbers at all.

Is there are anyway to distinguish which
instance of the driver is for running for which device ? Not that I
want to do that now but just thinking aloud

Yes, but how would YOU tell them apart? USB ports aren’t numbered. If
the devices have serial numbers, then it’s easy. The driver can read
the serial number string, and a human being can match them together.


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