UpdateDriverForPlugAndPlayDevices times out after a REALLY LONG time

I can’t seem to get any of the driver samples to install on my test machine. The README.md file in the SysVAD sample says:

First, the base INF, ComponentizedAudioSample.inf, has to be installed.
To install it, open a Command Prompt window as administrator on the target computer,
then navigate to your driver package folder and enter the following command:

devcon install ComponentizedAudioSample.inf Root\Sysvad_ComponentizedAudioSample

The output:

Device node created. Install is complete when drivers are installed...
Updating drivers for Root\Sysvad_ComponentizedAudioSample from Y:\ComponentizedAudioSample.inf.
(there's an approx eight minute timeout here)
devcon.exe failed.

I built the devcon sample so I could step through, figure out where it’s failing, and look at GetLastError(). Here’s where the failure is:

if (!UpdateDriverForPlugAndPlayDevices(nullptr, hardwareId, infFullPath, INSTALLFLAG_FORCE, &reboot))
{
    // The error code from GetLastError() is 0x000005b4 (ERROR_TIMEOUT)

For context, cmdInstall(...) is called, and succeeds until the very last step, which calls cmdUpdate(...). The code shown above is from the cmdUpdate function.

Here’s what gets written to SetupAPI.log:

>>>  [Device Install (UpdateDriverForPlugAndPlayDevices) - Root\Sysvad_ComponentizedAudioSample]
>>>  Section start 2020/04/29 20:19:56.252
      cmd: x:\devcon.exe  install ComponentizedAudioSample.inf Root\Sysvad_ComponentizedAudioSample
     ndv: INF path: Y:\ComponentizedAudioSample.inf
     ndv: Install flags: 0x00000001
     ndv: {Update Device Driver - ROOT\MEDIA\0000}
     ndv:      Search options: 0x00000080
     ndv:      Searching single INF 'Y:\ComponentizedAudioSample.inf'
     dvi:      {Build Driver List} 20:19:56.354
     dvi:           Searching for hardware ID(s):
     dvi:                root\sysvad_componentizedaudiosample
     dvi:           Created Driver Node:
     dvi:                HardwareID   - Root\sysvad_ComponentizedAudioSample
     dvi:                InfName      - y:\componentizedaudiosample.inf
     dvi:                DevDesc      - Virtual Audio Device (WDM) - Tablet Sample
     dvi:                Section      - SYSVAD_SA.NT
     dvi:                Rank         - 0x80ff0000
     dvi:                Signer Score - Not digitally signed
     dvi:                DrvDate      - 04/29/2020
     dvi:                Version      - 7.51.56.686
     dvi:           Created Extension Driver Node:
     dvi:                ExtensionID  - {1d641578-54d2-404d-85de-79bb01461ac2}
     dvi:                HardwareID   - Root\sysvad_ComponentizedAudioSample
     dvi:                InfName      - C:\WINDOWS\System32\DriverStore\FileRepository\componentizedaudiosampleextension.inf_amd64_4048a6bc532de608\componentizedaudiosampleextension.inf
     dvi:                DevDesc      - Sample Device Extension
     dvi:                Section      - DeviceExtension_Install
     dvi:                Rank         - 0x80ff0000
     dvi:                Signer Score - Not digitally signed
     dvi:                DrvDate      - 04/29/2020
     dvi:                Version      - 7.51.56.810
     dvi:      {Build Driver List - exit(0x00000000)} 20:19:56.744
     dvi:      {DIF_SELECTBESTCOMPATDRV} 20:19:56.754
     dvi:           Default installer: Enter 20:19:56.766
     dvi:                {Select Best Driver}
     dvi:                     Class GUID of device changed to: {4d36e96c-e325-11ce-bfc1-08002be10318}.
     dvi:                     Selected Driver:
     dvi:                          Description - Virtual Audio Device (WDM) - Tablet Sample
     dvi:                          InfFile     - y:\componentizedaudiosample.inf
     dvi:                          Section     - SYSVAD_SA
     dvi:                     Selected Extension Driver:
     dvi:                          Description - Sample Device Extension
     dvi:                          InfFile     - c:\windows\system32\driverstore\filerepository\componentizedaudiosampleextension.inf_amd64_4048a6bc532de608\componentizedaudiosampleextension.inf
     dvi:                          Section     - DeviceExtension_Install
     dvi:                {Select Best Driver - exit(0x00000000)}
     dvi:           Default installer: Exit
     dvi:      {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 20:19:56.881
     ndv:      Force Installing Driver:
     ndv:           Inf Name       - componentizedaudiosample.inf
     ndv:           Driver Date    - 04/29/2020
     ndv:           Driver Version - 7.51.56.686
     ndv:      Force Installing Extension Driver:
     ndv:           Inf Name       - oem10.inf
     ndv:           Extension Id   - {1d641578-54d2-404d-85de-79bb01461ac2}
     ndv:           Driver Date    - 04/29/2020
     ndv:           Driver Version - 7.51.56.810
     ndv:      Driver package 'C:\WINDOWS\System32\DriverStore\FileRepository\componentizedaudiosample.inf_amd64_ea4292a0fdb5c52c\componentizedaudiosample.inf' is already imported.
     sto:      {Setup Import Driver Package: y:\componentizedaudiosample.inf} 20:19:56.987
     sto:           Driver package already imported as 'oem8.inf'.
     sto:      {Setup Import Driver Package - exit (0x00000000)} 20:19:57.035
     ndv:      Driver package 'C:\WINDOWS\System32\DriverStore\FileRepository\componentizedaudiosampleextension.inf_amd64_4048a6bc532de608\componentizedaudiosampleextension.inf' is already imported.
     sto:      {Setup Import Driver Package: C:\WINDOWS\INF\oem10.inf} 20:19:57.084
     sto:           Driver package already imported as 'oem10.inf'.
     sto:      {Setup Import Driver Package - exit (0x00000000)} 20:19:57.109
     dvi:      Searching for hardware ID(s):
     dvi:           root\sysvad_componentizedaudiosample
     dvi:      Class GUID of device changed to: {4d36e96c-e325-11ce-bfc1-08002be10318}.
     dvi:      {Plug and Play Service: Device Install for ROOT\MEDIA\0000}
*** APPROX EIGHT MINUTE WAIT OCCURS HERE ***
     ump:      {Plug and Play Service: Device Install exit(000005b4)}
!!!  ndv:      Device install failed for device.
!!!  ndv:      Error 1460: This operation returned because the timeout period expired.
     ndv:      Installing NULL driver.
     dvi:      {Plug and Play Service: Device Install for ROOT\MEDIA\0000}
     ump:      {Plug and Play Service: Device Install exit(000005b4)}
     ndv: {Update Device Driver - exit(000005b4)}
!!!  ndv: Failed to install device instance 'ROOT\MEDIA\0000'. Error = 0x000005b4
<<<  Section end 2020/04/29 20:27:57.655
<<<  [Exit status: FAILURE(0x000005b4)]

Can anyone shed some light on this?

If a previous driver install hung due to a driver bug that never completes a pnp state changing request, your install will timeout waiting for the state lock (held by the buggy driver). In this case you need to reboot. You should also look at the previous entries in the setupapi log, there could be clues in previous failures that have left the system in a bad state.

1 Like

@Doron_Holan said:
If a previous driver install hung due to a driver bug that never completes a pnp state changing request, your install will timeout waiting for the state lock (held by the buggy driver). In this case you need to reboot. You should also look at the previous entries in the setupapi log, there could be clues in previous failures that have left the system in a bad state.

Thank you Doron!

This was a critical piece of information, and led to my being able to install and test for the first time in three weeks.

–Scott