USB driver install issue

Hi guys,

I have a USB driver (not signed) for some device. Every time I plug in a *new* device, driver installation wizard pops up. Next time I plug the same device in, it gets connected quietly. All devices are the same, as far as VID/PID/Interface map goes. The only difference is in serial number (obviously). Where should I look for the solution? Sign the driver? Make changes in .inf file? I’d appreciate any help on that matter.

Vladimir Chtchetkine wrote:

The only difference is in serial number (obviously). Where should I
look for the solution? Sign the driver?

Even if you sign the driver, every unique serial number will trigger a device installation. If you don’t want this behavior, remove the serial number from your device, or use the IgnoreHWSerNum registry key to ignore serial numbers.

I do not completely understand why the windows driver system does handle
USB devices (with the same Vendor/Product ID) plugged into different
ports, or devices that differ only in serial number as new devices.

Ok, for debugging and performance comparison it is cool to connect the
very same USB device to two different USB ports - and have a WUDF driver
serve one USB port and a WDM driver the other (different class GUIDs
necessary). But apart from this very special use-case I don’t see the
benefit of driver-installing every time you change USB ports (it may
even happen if you add a hub between port and USB device) or have a
different device serial number.
OTOH if you manually update a driver file, it may even be dangerous if
an auto-install picks the wrong inf/pnf pair from the INF cache and
overwrites a newer version with an older version (seen on W2K).
(Vista driver uninstallation is much better in this respect - it offers
you to actually delete the INF/PNF files.)

Could anyone shed some light on this, please? Or point me to an
explanation of the rationale e.g. on the MSDN? - Thanks !!

Vladimir Chtchetkine wrote:
> The only difference is in serial number (obviously). Where should I
> look for the solution? Sign the driver?

xxxxx@gmail.com wrote:

Even if you sign the driver, every unique serial number
> will trigger a device installation. If you don’t want this behavior,
> remove the serial number from your device,
> or use the IgnoreHWSerNum registry key to ignore serial numbers.

  • And even if you don’t have the USB “serial number” string set, for
    each “new” USB port you plug in the device you will get a new driver
    installation dialogue. (I observed this behaviour with our devices.)

  • If you have the USB “serial number” string set, then at least
    the_same device plugged into another USB port will be recognized and
    the driver silently copy-installed. (Observed with other devices.)

  • AFAIK, only if you have a WHQL signed driver, then installation can be
    (relatively) silent (see the USBSTOR behaviour when you connect another
    USB mass storage device).

One “hack” I have seen done with a device (from China):

  • Set a USB “serial number” string that is the same for all of your USB
    devices (of the same type).
    This should make sure you need to do the “full” driver installation once
    and only once.
    (Observation: The USB “serial number” string of the mentioned device is
    “00000001” - the S/N printed on the device is different! :slight_smile: )

Exercise left to the reader:

  • Explain why using the same serial number for all of your devices is
    not recommended. :slight_smile:
    (Hint: keep your fingers crossed that nobody will ever connect two
    devices of the same type at the same time to your computer.)

Comments?
-H

Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset=“us-ascii”
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Return-Path: xxxxx@microsoft.com

If there is no serial number, windows cannot uniquely ID the device. This =
means its identity is a combination of the device’s bus instance ID (the fi=
rst hardware ID reported) as well as the device tree topology back up to th=
e root to get to the device. This means that when you change ports or add =
a hub, the topology changes (since it includes the port #) and thus the dev=
ice’s identity changes and is considered a new device.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.o=
sr.com] On Behalf Of Hagen Patzke
Sent: Wednesday, November 21, 2007 1:13 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB driver install issue

I do not completely understand why the windows driver system does handle
USB devices (with the same Vendor/Product ID) plugged into different
ports, or devices that differ only in serial number as new devices.

Ok, for debugging and performance comparison it is cool to connect the
very same USB device to two different USB ports - and have a WUDF driver
serve one USB port and a WDM driver the other (different class GUIDs
necessary). But apart from this very special use-case I don’t see the
benefit of driver-installing every time you change USB ports (it may
even happen if you add a hub between port and USB device) or have a
different device serial number.
OTOH if you manually update a driver file, it may even be dangerous if
an auto-install picks the wrong inf/pnf pair from the INF cache and
overwrites a newer version with an older version (seen on W2K).
(Vista driver uninstallation is much better in this respect - it offers
you to actually delete the INF/PNF files.)

Could anyone shed some light on this, please? Or point me to an
explanation of the rationale e.g. on the MSDN? - Thanks !!

Vladimir Chtchetkine wrote:
> The only difference is in serial number (obviously). Where should I
> look for the solution? Sign the driver?

xxxxx@gmail.com wrote:

Even if you sign the driver, every unique serial number
> will trigger a device installation. If you don’t want this behavior,
> remove the serial number from your device,
> or use the IgnoreHWSerNum registry key to ignore serial numbers.

  • And even if you don’t have the USB “serial number” string set, for
    each “new” USB port you plug in the device you will get a new driver
    installation dialogue. (I observed this behaviour with our devices.)

  • If you have the USB “serial number” string set, then at least
    the_same device plugged into another USB port will be recognized and
    the driver silently copy-installed. (Observed with other devices.)

  • AFAIK, only if you have a WHQL signed driver, then installation can be
    (relatively) silent (see the USBSTOR behaviour when you connect another
    USB mass storage device).

One “hack” I have seen done with a device (from China):

  • Set a USB “serial number” string that is the same for all of your USB
    devices (of the same type).
    This should make sure you need to do the “full” driver installation once
    and only once.
    (Observation: The USB “serial number” string of the mentioned device is
    “00000001” - the S/N printed on the device is different! :slight_smile: )

Exercise left to the reader:

  • Explain why using the same serial number for all of your devices is
    not recommended. :slight_smile:
    (Hint: keep your fingers crossed that nobody will ever connect two
    devices of the same type at the same time to your computer.)

Comments?
-H


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.o=
sronline.com/page.cfm?name=3DListServer

Doron Holan wrote:

If there is no serial number, windows cannot uniquely ID the device. This =
means its identity is a combination of the device’s bus instance ID (the fi=
rst hardware ID reported) as well as the device tree topology back up to th=
e root to get to the device. This means that when you change ports or add =
a hub, the topology changes (since it includes the port #) and thus the dev=
ice’s identity changes and is considered a new device.

d

One of the USB main advantages is that the end user does not need to
worry about the device tree topology.

Do I need to install a new device driver if I use a different parallel
cable for my printer? No, of course not!
But I do need to install a new device driver for a device without USB
“serial number” string whenever I use a different USB port, or have a
hub in between.

Also I have to install a device driver if my new device has a serial
number - but if its S/N is different from another existing device of the
exact same type (idVendor/idProduct/bcdDevice).

In my opinion this is not at all very “user friendly”.
If you think otherwise, consider a “non-administrator-user” who just got
a replacement device via mail and can’t use it on his XP installation.

Well, I guess there has to be left some “room for improvements” for
Windows7… :wink:

So far my 2c… :slight_smile:
-H