Quick Answer
Restart the Smart Card service (SCardSvr) and replug your reader—that clears 90% of these.
Why This Happens
Smart card operations are transactional. Your app sends a request, the reader does its thing, and if something cancels it mid-flight—like a timeout, a user clicking Cancel, or a USB hiccup—you get SCARD_E_CANCELLED. The error code 0X80100002 literally means an SCardCancel call was made, either by your app or by a lower-level driver. In the enterprise world, I've seen this most often with certificate-based logins on Dell Latitude laptops using Dell's own smart card readers. The driver and the Windows Smart Card service get out of sync, and the next read attempt gets canceled silently.
Numbered Fix Steps
- Restart the Smart Card service. Open an elevated PowerShell or Command Prompt and run:
Wait a few seconds, then try your smart card operation again. This resets the service's internal state, which is the culprit here almost always.net stop scardsvr net start scardsvr - Unplug and replug the reader. Pull the USB cable, wait 5 seconds, plug it back in. If it's a laptop with an integrated reader, skip this and go to the next step.
- Update the reader driver. Open Device Manager, expand Smart card readers, right-click your reader, and select Update driver. If that doesn't find anything, go to the manufacturer's site. Dell's integrated readers often need a specific driver—generic Windows ones work, but they're flaky.
- Check for standby issues. If your machine went to sleep with the smart card operation pending, that's a classic trigger. Disable USB selective suspend in Power Options, or just restart the service after every resume. Yeah, it's annoying, but it's the reality of USB smart card readers.
- Test with another app. Use the built-in
certutilto see if the reader responds:
If that works, the issue is in your specific app—check its timeout settings. Some apps have a default timeout of 5 seconds, which is way too short for a slow reader.certutil -scinfo
Alternative Fixes
If the above doesn't cut it, try these:
- Reinstall the reader driver. In Device Manager, right-click the reader and choose Uninstall device. Then scan for hardware changes. This clears any corrupted driver state. Doesn't happen often, but when it does, nothing else helps.
- Check the Event Viewer. Look under Windows Logs > System for events with source SCardSvr or Smart Card Reader. The event details often point to the exact reader that's failing.
- Update Windows. Yeah, it's cliché, but I've seen this error fixed in a cumulative update. Don't bother with optional updates—just the monthly rollup.
- Try a different USB port. If your reader is on a USB hub, move it to a direct port. Hubs cause power issues and dropped connections, leading to spurious cancellations.
Prevention Tip
Set your smart card service to Automatic (it usually is) and add a scheduled task to restart it daily if you're heavy on smart card use. Or just get into the habit of replugging the reader once a week. It's dumb, but it works. Also, never put your laptop to sleep mid-card-operation—wait for the PIN prompt to clear. That single habit prevents half the SCARD_E_CANCELLED errors I've dealt with.