| Previous | Next |
| SCARD_E_CANCELLED | SCARD_E_INVALID_PARAMETER |
SCARD_E_INVALID_HANDLE
SCARD_E_INVALID_HANDLE The PC/SC context or card handle supplied to the operation is no longer valid. Handles become invalid after their release and can become unusable when the Smart Card Resource Manager shuts down.
How to recover
- Track ownership and lifetime of every
SCARDCONTEXTandSCARDHANDLE; never share a released handle across asynchronous work. - Use
SCardIsValidContextbefore starting new work after service disruption or long idle periods. - Create a new context and reconnect to the card instead of retrying an API call with the stale handle.
Microsoft: SCardEstablishContext
Microsoft: SCardIsValidContext
Microsoft: Smart Cards for Windows service
Looking for a different code? Search another status or error code.