Skip to content

DEVICE MANAGER ERROR · CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD

Code 38: A Previous Instance of the Driver Is Still in Memory

An earlier copy of the driver is still loaded, so Windows cannot load it again for this device. A restart clears memory and lets Windows start over.

WHAT WINDOWS SHOWS

Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)

Wording from Microsoft's documentation for CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD. Device Manager shows it on the General tab of the device's Properties.

TECHNICAL SUMMARY

Code38
Windows nameCM_PROB_DRIVER_FAILED_PRIOR_UNLOAD
Where you see itDevice Manager > the device's Properties > General > Device status
In Tweaky DriverNeeds attention

What causes Code 38

  • An earlier instance of the driver is still loaded, because of a wrong reference count or a race between loading and unloading.
  • The driver is named by more than one AddService directive in one or more of its INF files.

How to fix Code 38, safest step first

The steps follow Microsoft's recommended resolution for this code, in its order, with a reversible step first. Each one says how to put back what it changed.

  1. Restart the PC (Microsoft's recommended fix)

    Use Start > Power > Restart rather than Shut down, so Windows starts the device from scratch.

    To undo: Nothing to undo: a restart changes no setting.

  2. Before you change anything: note the driver and make a restore point

    Open the device's Properties > Driver tab and write down the driver provider, date and version. Then select Start, type Create a restore point, open it, and on the System Protection tab choose Create. Microsoft notes that System Protection is not turned on by default; if Create is greyed out, choose Configure and turn it on for the system drive first.

    To undo: A restore point changes nothing by itself. To go back later, run System Restore and pick it: Microsoft says it reverts system files, the registry and installed programs, and leaves your personal files alone.

  3. If it returns after every restart, reinstall the driver

    A Code 38 that keeps coming back points at the driver package itself, for example one whose INF files register the same service more than once. Uninstall the device, scan for hardware changes, and install the manufacturer's current driver if Windows does not bring back a working one.

    To undo: If Windows puts back a driver you did not want, use Roll Back Driver when it is offered, or install the driver you kept. The restore point from the first step brings back the whole driver configuration.

Check it yourself

  1. List every device with this code (Command Prompt or PowerShell)

    Available from Windows 10, version 1903. Each device is listed with its instance ID and the problem code with its name, CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD. No administrator rights needed; nothing is changed.

    pnputil /enum-devices /problem 38
    cmd
  2. Or with PowerShell

    Device Manager shows the same code on the General tab of the device's Properties, in the Device status box.

    Get-PnpDevice | Where-Object { [int]$_.ConfigManagerErrorCode -eq 38 } |
      Format-Table Status, Class, FriendlyName, Problem
    PowerShell

What Tweaky Driver does with Code 38

Needs attention

Tweaky Driver lists a Code 38 device under Diagnostics > Devices as Needs attention, with its code. It offers no driver for a device in this state and does not restart the PC for you.

Tweaky Driver, the driver checker that shows its sources — free for Windows 10 and 11.

Common questions

Why does a restart fix Code 38?

The problem is a copy of the driver that never left memory. A restart clears memory, so the next time Windows loads the driver there is nothing in the way.

What if Code 38 comes back?

Then the driver package is the likely cause: Microsoft names reference-count bugs, load and unload races, and a driver listed by several AddService directives. A different driver version from the manufacturer is the next step.

Will Fast Startup keep Code 38 around?

Microsoft's fix is Restart, not Shut down. With Fast Startup on, Shut down saves the running kernel and its drivers and reloads them, while Restart starts them fresh.