"New Hardware Found" tip displayed and reboot is requested with ->SilentInstall on

Hi,

looks like Windows (Win7 32) ignores the DEVICE_CAPABILITIES::SilentInstall flag on heavy load, and shows the “New Hardware Found” balloon tips. More so, in these cases, Windows wants to reboot the machine due to new device arrival, which is amazingly strange.

I have a software-only bus driver which creates the PDOs. The PDOs are “raw” and do not require any functional drivers. I have a NULL INF (actually a chapter in the INF of the root devnode off which these PDOs are created, the setup class for all of them is System) for these devices.

The root devnode of the driver is root-enumerated and is installed by “devcon install” (as for now, the installation app will be written later).

I fill the DEVICE_CAPABILITIES for the PDOs as following:

Caps->Size = sizeof(DEVICE_CAPABILITIES);
Caps->Version = 1;
Caps->DeviceD1 = 0;
Caps->DeviceD2 = 0;
Caps->LockSupported = 0;
Caps->EjectSupported = 0;
Caps->Removable = 0;
Caps->DockDevice = 0;
Caps->UniqueID = 1;
Caps->SilentInstall = 1; // no UI on install
Caps->RawDeviceOK = 1; // no FDOs
Caps->SurpriseRemovalOK = 1; // no UI on surprise remove
Caps->WakeFromD0 = 0;
Caps->WakeFromD1 = 0;
Caps->WakeFromD2 = 0;
Caps->WakeFromD3 = 0;
Caps->HardwareDisabled = 0;
Caps->NoDisplayInUI = 1; // hidden
Caps->Address = 0xffffffff;
Caps->UINumber = 0xffffffff;
// D0 for running system, D3 for all other states
Caps->DeviceState[PowerSystemWorking] = PowerDeviceD0;
Caps->DeviceState[PowerSystemSleeping1] = PowerDeviceD3;
Caps->DeviceState[PowerSystemSleeping2] = PowerDeviceD3;
Caps->DeviceState[PowerSystemSleeping3] = PowerDeviceD3;
Caps->DeviceState[PowerSystemHibernate] = PowerDeviceD3;
Caps->DeviceState[PowerSystemShutdown] = PowerDeviceD3;
Caps->SystemWake = PowerSystemUnspecified;
Caps->DeviceWake = PowerDeviceUnspecified;
Caps->D1Latency = 0;
Caps->D2Latency = 0;
Caps->D3Latency = 0;

The bus driver reports the devnode creation (IoInvalidateDeviceRelations and new PDO created in response to it), executing the software commands (IOCTLs) sent to the root device.

The problem is that, sometimes and rarely (I don’t know why, I don’t know what governs this, probably the heavy load, the behavior is surely non-deterministic) the OS shows the balloon tips of New Hardware Arrived, thus violating the SilentInstall flag. My unit test app calls the IOCTL, the driver requests new devnode creation - and sometimes the OS decides to ignore SilentInstall for it.

Immediately after this, the OS shows the “reboot is required” dialog. If I say “No” - nothing bad occurs, everything works. If I say “yes” - then the event is logged that rundll32.exe asked to reboot due to hardware installation.

Questions:

  • why such non-deterministic behaviour?
  • why SilentInstall is violated?
  • why reboot request due to installation of new devnodes, given the fact that NULL INFs for them were installed fine?


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

Something becomes clearer:

From setupapi.dev.log:

dvi: Install Device: Removing device sub-tree. 03:02:43.780
dvi: Install Device: Removing device sub-tree completed. 03:02:43.967
! dvi: Query-removal during install of ‘my instance id’ was vetoed by ‘my instance id’ (veto type 6: PNP_VetoDevice).
! dvi: Device required reboot: Query remove failed (install) 0x17: CR_REMOVE_VETOED.

OK, this probably will shed some light on reboot request (looks like query remove arrived to the PDO which is just-created and never started, I should support this), but why the balloon tip was displayed?


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

Just wild guess… When it pops, did you double check if the dev_cap->SlientInstall is still 1? Could it be silent memory corruption?

Calvin
p.s. somebody would ask why not use wdf.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, February 01, 2010 4:33 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] “New Hardware Found” tip displayed and reboot is requested with ->SilentInstall on

Hi,

looks like Windows (Win7 32) ignores the DEVICE_CAPABILITIES::SilentInstall flag on heavy load, and shows the “New Hardware Found” balloon tips. More so, in these cases, Windows wants to reboot the machine due to new device arrival, which is amazingly strange.

I have a software-only bus driver which creates the PDOs. The PDOs are “raw” and do not require any functional drivers. I have a NULL INF (actually a chapter in the INF of the root devnode off which these PDOs are created, the setup class for all of them is System) for these devices.

The root devnode of the driver is root-enumerated and is installed by “devcon install” (as for now, the installation app will be written later).

I fill the DEVICE_CAPABILITIES for the PDOs as following:

Caps->Size = sizeof(DEVICE_CAPABILITIES);
Caps->Version = 1;
Caps->DeviceD1 = 0;
Caps->DeviceD2 = 0;
Caps->LockSupported = 0;
Caps->EjectSupported = 0;
Caps->Removable = 0;
Caps->DockDevice = 0;
Caps->UniqueID = 1;
Caps->SilentInstall = 1; // no UI on install
Caps->RawDeviceOK = 1; // no FDOs
Caps->SurpriseRemovalOK = 1; // no UI on surprise remove
Caps->WakeFromD0 = 0;
Caps->WakeFromD1 = 0;
Caps->WakeFromD2 = 0;
Caps->WakeFromD3 = 0;
Caps->HardwareDisabled = 0;
Caps->NoDisplayInUI = 1; // hidden
Caps->Address = 0xffffffff;
Caps->UINumber = 0xffffffff;
// D0 for running system, D3 for all other states
Caps->DeviceState[PowerSystemWorking] = PowerDeviceD0;
Caps->DeviceState[PowerSystemSleeping1] = PowerDeviceD3;
Caps->DeviceState[PowerSystemSleeping2] = PowerDeviceD3;
Caps->DeviceState[PowerSystemSleeping3] = PowerDeviceD3;
Caps->DeviceState[PowerSystemHibernate] = PowerDeviceD3;
Caps->DeviceState[PowerSystemShutdown] = PowerDeviceD3;
Caps->SystemWake = PowerSystemUnspecified;
Caps->DeviceWake = PowerDeviceUnspecified;
Caps->D1Latency = 0;
Caps->D2Latency = 0;
Caps->D3Latency = 0;

The bus driver reports the devnode creation (IoInvalidateDeviceRelations and new PDO created in response to it), executing the software commands (IOCTLs) sent to the root device.

The problem is that, sometimes and rarely (I don’t know why, I don’t know what governs this, probably the heavy load, the behavior is surely non-deterministic) the OS shows the balloon tips of New Hardware Arrived, thus violating the SilentInstall flag. My unit test app calls the IOCTL, the driver requests new devnode creation - and sometimes the OS decides to ignore SilentInstall for it.

Immediately after this, the OS shows the “reboot is required” dialog. If I say “No” - nothing bad occurs, everything works. If I say “yes” - then the event is logged that rundll32.exe asked to reboot due to hardware installation.

Questions:

  • why such non-deterministic behaviour?
  • why SilentInstall is violated?
  • why reboot request due to installation of new devnodes, given the fact that NULL INFs for them were installed fine?


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


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

SilentInstall has not been respected in terms of the UI since XP, Win7 is no different than XP in this regard. Are you also setting PNP_DEVICE_DONT_DISPLAY_IN_UI (since you are setting NoDisplayInUI) in IRP_MN_QUERY_PNP_DEVICE_STATE?

d

>regard. Are you also setting PNP_DEVICE_DONT_DISPLAY_IN_UI (since you are setting

NoDisplayInUI) in IRP_MN_QUERY_PNP_DEVICE_STATE?

Yes.

What is the most interesting is that the UI appears sometimes and not always.

More so: I saw such behaviour with some MS-provided drivers too, on the machine where there was no my driver at all. Forgot the details, maybe this was about USBSTOR.


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