SPAPI_E_DEVINFO_LIST_LOCKED (0x800F0212) – locked device info set
This error means Windows is trying to modify a device information set that another process has locked. Usually a driver install or device manager stuck in a previous operation.
When this error hits
You're trying to update a driver through Device Manager, or maybe run a script that adds a device via SetupDiCallClassInstaller. Suddenly you get this: SPAPI_E_DEVINFO_LIST_LOCKED (0x800F0212). It happens most often after you've manually canceled a driver install halfway, or when a previous SetupDiDestroyDeviceInfoList never got called properly. I've seen it on Windows 10 22H2 and Windows 11 23H2 when using third-party driver tools that leave the device info set open.
What's actually happening here
Windows uses a handle called a device information set (or devinfo set) to track devices during install operations. That handle can be in one of two states: unlocked (normal) or locked (exclusive access). The lock prevents two things from modifying the same set at once — it's a protection against corruption. But if an application crashes or gets shut down without releasing the lock, Windows keeps thinking the set is still in use. So your new operation sees the lock and refuses to proceed.
The fix: force close the lock
The real fix is to close whatever process still holds that lock, then clean up any stale devinfo handles. Here's what works.
Step 1: Kill the process that owns the lock
Open Task Manager (Ctrl+Shift+Esc). Look for any DeviceSetupManager.exe, rundll32.exe with a driver install flag, or the tool you used earlier (like pnputil.exe or a manufacturer updater). Right-click and End task. If you're not sure, reboot — that's the nuclear option and it always works.
Step 2: Restart the Plug and Play service
Even after killing the process, the lock might linger in the kernel. Open an admin Command Prompt (Win+R → cmd → Ctrl+Shift+Enter) and run:
net stop plugplay && net start plugplay
This restarts the Plug and Play service, which releases all devinfo set locks. You'll see a warning about dependent services — that's fine, they restart automatically.
Step 3: Delete leftover driver packages (only if needed)
If the error came from a driver that partially installed, you might have a corrupted driver package. Delete it using pnputil. First list all third-party packages:
pnputil /enum-drivers
Find the one that was being installed (look at the Published Name column, often something like oemXX.inf). Then delete it:
pnputil /delete-driver oemXX.inf
Step 4: Try your install again
Now run the driver install or script again. The lock should be gone, and the operation should complete without the 0x800F0212 error.
What to check if it still fails
If the error returns, something is re-locking the set. Check these:
- Antivirus interference — Some security software (I've seen this with McAfee and Bitdefender) hooks into device install APIs and holds locks longer than normal. Temporarily disable real-time protection and retry.
- Another device install running in background — Windows Update might be installing a driver at the same time. Open
Settings → Windows Update → Update historyand look for pending driver installs. Wait for them to finish or pause updates. - Corrupted driver store — Rare, but possible. Run
DISM /Online /Cleanup-Image /RestoreHealthandsfc /scannowfrom an admin Command Prompt. This fixes the driver store if it's broken.
The most common cause is simply a stuck process from a previous failed install. A reboot handles 95% of cases. If you're writing custom code, always call SetupDiDestroyDeviceInfoList in your cleanup path — that's the polite way to release the lock.
Was this solution helpful?