Silent driver installation for bus devices

I am currently developing a KMDF bus driver (my first Windows driver) with dynamic child enumeration. The child devices are created as raw devices so that they can be controlled directly by the bus driver. I have an INF file for the parent device (which happens to be a USB device) as well as a NULL INF file for the child devices.

Unfortunately, every time that a new child device is attached to the bus, the “Found New Hardware” wizard pops up. Luckily, after the first time that the INF is installed, the wizard is able to automatically find the appropriate driver for the device when clicking through the prompts. Nonetheless, in my system, child devices will be frequently coming and going from the bus (on the order of several per hour), and it would make for a very poor user experience if the user had to click through the wizard each time that a new device is connected. Is there any way to have the driver install silently for each child device without any user interaction or dialogs?

I should note that, at present, I am very early in the development process and have not yet signed or test-signed the driver. However, as I’m currently testing on a Windows XP 32-bit environment with the Driver Signing policy set to Ignore, it is my understanding that it shouldn’t matter if my driver is unsigned. Also, the setup class for both devices is custom, which I gather is not supported by WHQL for Windows XP.

Is there any way that I can make my the driver installation for child devices completely silent?

xxxxx@cspeed.com wrote:

I am currently developing a KMDF bus driver (my first Windows driver) with dynamic child enumeration. … Nonetheless, in my system, child devices will be frequently coming and going from the bus (on the order of several per hour), and it would make for a very poor user experience if the user had to click through the wizard each time that a new device is connected. Is there any way to have the driver install silently for each child device without any user interaction or dialogs?

How are you generating your device IDs? What you specifying for
UniqueID? If the child instance ID is one the system has seen before,
it will not do an new install. Consider the parallels to USB. If you
insert a USB device with a serial number, no matter what port it is in,
it will be recognized as the same device, and no new install is required.

I should note that, at present, I am very early in the development process and have not yet signed or test-signed the driver. However, as I’m currently testing on a Windows XP 32-bit environment with the Driver Signing policy set to Ignore, it is my understanding that it shouldn’t matter if my driver is unsigned. Also, the setup class for both devices is custom, which I gather is not supported by WHQL for Windows XP.

Well, there is no WHQL for XP any more. You WHQL for Windows 7, and you
ask for an XP rider when you do so.


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

>unsigned. Also, the setup class for both devices is custom, which I gather is not supported by WHQL

for Windows XP.

For Vista+ you add your cert to Trusted Publishers of the Local Machine to suppress these “Do you trust?”/WHQL boxes.

For XP I was told it is also possible (it is told to be not possible on 2003 only), but I personally spent a couple of hours trying this and failed.

If your driver is for real hardware - then I would say go pass WHQL. But, if you’re about the software-only virtual device (or just a kernel add-on) which is a part of the larger SW product - then probably such a thing will not be WHQLable in principle.


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

Thank you for the quick responses.

As far as the unique ID goes (by which I assume you’re referring to the device instance ID), I’m afraid that I will need numerous devices connected to the bus simultaneously. Since I believe that every device that’s currently attached must have a unique device instance ID, this means that I cannot simply forge each device to appear as the same, already installed, device.

If, for example, 10 devices are connected to the bus, I think that all 10 devices need to have unique IDs, but I do not want the user to have to click through the wizard 10 times. Is there some way to have these child devices behave similarly to a USB jump drive, where plugging in a new device simply installs the driver automatically without requiring any user interaction?

xxxxx@cspeed.com wrote:

As far as the unique ID goes (by which I assume you’re referring to the device instance ID), I’m afraid that I will need numerous devices connected to the bus simultaneously. Since I believe that every device that’s currently attached must have a unique device instance ID, this means that I cannot simply forge each device to appear as the same, already installed, device.

What I’m saying is that the “1st device” would always have the same ID,
and the “2nd device” would always have the same ID, etc., like a USB hub
with 7 ports. Windows creates a new entry in the registry for every
unique ID. Every time it does that, it needs to do an installation. If
you can live with a cap on the maximum number of devices, you would only
have one dialog for each NEW device.

If, for example, 10 devices are connected to the bus, I think that all 10 devices need to have unique IDs, but I do not want the user to have to click through the wizard 10 times. Is there some way to have these child devices behave similarly to a USB jump drive, where plugging in a new device simply installs the driver automatically without requiring any user interaction?

USB drives install silently because they are signed by WHQL. If you
want to go through the WHQL process, you can achieve your goal.


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

Oh ok, I understand what you are saying with the IDs. Actually, this is the route that I was planning on taking anyway. Unfortunately, it still means that the user would be presented with lots of dialogs after the driver is first installed until the system settles at some capacity. This would still make for an undesirable user experience.

So WHQL signing the driver will allow the devices to install silently, even when a new device instance is connected? Is this true for all versions of Windows? As I mentioned, both the parent device and the child device belong to custom device setup classes, so I’m not sure if that makes a difference for WHQL. I think I read in the WDK documentation that in XP and earlier, non-standard device setup classes cannot be WHQL tested. Since, we will ultimately want to support XP, Vista, and Win7 (once we get further along in the development), does this WHQL XP “rider” that you mentioned support custom device classes for XP with completely silent installation?

xxxxx@cspeed.com wrote:

Oh ok, I understand what you are saying with the IDs. Actually, this is the route that I was planning on taking anyway. Unfortunately, it still means that the user would be presented with lots of dialogs after the driver is first installed until the system settles at some capacity. This would still make for an undesirable user experience.

So WHQL signing the driver will allow the devices to install silently, even when a new device instance is connected?

Yes.

Is this true for all versions of Windows?

Yes. Well, starting with Windows 2000, anyway.

As I mentioned, both the parent device and the child device belong to custom device setup classes, so I’m not sure if that makes a difference for WHQL.

That means you have two different driver packages (two different INF
files), and hence two separate WHQL submissions (and two separate fees…).

I think I read in the WDK documentation that in XP and earlier, non-standard device setup classes cannot be WHQL tested.

No. There has always been an “unclassified” category. The tests check
basic driver resiliency, power management handling, and for USB devices,
basic USB handling. I assume nothing earlier than XP is relevant for
you. You can’t get a signature for 2000 any more.

Since, we will ultimately want to support XP, Vista, and Win7 (once we get further along in the development), does this WHQL XP “rider” that you mentioned support custom device classes for XP with completely silent installation?

Yes.


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

Thank you for all of your help! I will definitely look into WHQL for my driver(s).

> So WHQL signing the driver will allow the devices to install silently, even when a new device instance

is connected? Is this true for all versions of Windows?

Yes.

On Vista+, you can also pre-install your certificate to Trusted Publishers from your install app with the same effect.


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