Author Topic: Suppressing new device dialog for devices with serial numbers.  (Read 15617 times)

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
We're having a problem at the factory. Our device has a unique serial number, so every new one which gets plugged in goes through the new device found dialog. We'd like to suppress the dialog and just install the driver once for every instance of the device. We thought we'd found a solution with the IgnoreHWSerNum registry key documented here: http://msdn.microsoft.com/en-us/library/windows/hardware/jj649944(v=vs.85).aspx but that doesn't seem to be working.

This being a Windows problem is somewhat beyond me. The device is enumerating as a CDC-ACM class device (class:2, subclass:2, protocol:1).

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #1 on: May 30, 2013, 08:44:32 pm »
I got a little more information. I thought there had been discussion of this problem before, and I think I'm remembering the solution involved signing the driver. As this is using MS's own CDC driver, I was thinking the driver would be signed, so that wouldn't be the problem. Now I'm being told:

Quote
The procedure is to connect a device and go through the manual install steps where we provide the .inf I attached and select that it's a serial COM port.  It definitely complains about being unsigned.

The .inf file referenced is:
Quote
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%ProviderName%
DriverVer=04/26/2012,1.1.0.0

[MANUFACTURER]
%ProviderName%=DeviceList, NTx86, NTamd64

[DeviceList.NTx86]
%NameCDC%=DriverInstall,USB\VID_2464&PID_0004&MI_01&Class_02&SubClass_02

[DeviceList.NTamd64]
%NameCDC%=DriverInstall,USB\VID_2464&PID_0004&MI_01&Class_02&SubClass_02

[DriverInstall]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=LowerFilterAddReg,SerialPropPageAddReg

[DriverInstall.Services]
include = mdmcpq.inf
AddService = usbser, 0x00000002, LowerFilter_Service_Inst

; This adds the serial port property tab to the device properties dialog
[SerialPropPageAddReg]
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[Strings]
ProviderName = "Company"
NameCDC = "Name Serial Port"
« Last Edit: May 30, 2013, 09:43:09 pm by Barry Twycross »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #2 on: May 30, 2013, 09:43:45 pm »
For the driver to be considered signed, the INF has to be signed as well.

The issue came up here:

http://www.lvr.com/forum/index.php?topic=1059.0

Another discussion relating to FTDI but might have useful info:

http://www.ftdichip.com/Support/Knowledgebase/index.html?ignorehardwareserialnumber.htm


Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #3 on: May 30, 2013, 10:59:28 pm »
That page from FTDI is where the engineer started thinking about the IgnoreHWSerNum key. It seems that no one has confirmed it still works on Windows 7 (which I forget to mention was the OS involved).

It seems that another key GlobalDisableSerNumGen has been used in the past, but MSDN no longer mentions that, so we don't think its supported still.


Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #4 on: May 30, 2013, 11:02:45 pm »
The linked thread looks promising:

Quote
The entry name should have VID/PID of the device. For example of devices (VID/PID = 0xABCD / 0x1234)
IgnoreHWSerNumABCD1234

We'll give that a try.

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #5 on: May 31, 2013, 03:25:54 pm »
Hi Barry and Jan,

a) IgnoreHWSerNum
The old method, referred by above Jan's post, still works on Windows 7 (x86/x64) and Windows 8 (x86/x64), too.

Your device looks like a composite device.
Composite device requires two entries, one for the composite parent, another for the interface.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\
- IgnoreHWSerNum24640004
- IgnoreHWSerNum2464000401

Both of entries are REG_BINARY, and their value are 0x01 (1 byte).

b) Driver signing

Vista (x64), Win7 (x64) and Win8 (x86/x64) require signed package for driver installation.
As of CDC of usbser.sys, the installation package means just the INF file.

Tsuneo

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Suppressing new device dialog for devices with serial numbers.
« Reply #6 on: June 05, 2013, 02:59:28 pm »
Thanks everyone, adding the VID/PID to the registry entry name solved the problem.