| Previous | Next |
| SCARD_E_SYSTEM_CANCELLED | SCARD_F_UNKNOWN_ERROR |
SCARD_F_COMM_ERROR
Where the communication can fail
SCARD_F_COMM_ERROR means that the PC/SC stack detected an internal communication failure. It should not be treated as a PIN error, certificate error, or an application-level response from the card. The failing path can include the Smart Card Resource Manager, the reader driver, the transport to the reader, card power and reset handling, or the card exchange itself.
Capture the reader name, the active protocol, the ATR reported by the reader, and the last API call before retrying. SCardStatus can report whether a card is present, powered, negotiable, or ready for a protocol; SCardGetStatusChange is useful when the reader or card state may be changing underneath the application.
Recovery without losing evidence
- Reconnect only after checking whether the card was removed, reset, or became unresponsive.
- Try another reader and cable before replacing a card; a repeatable failure that follows the reader points to a different layer than one that follows the card.
- Do not resend a state-changing APDU blindly. Determine whether the command reached the card before retrying it.
References
- Microsoft: Smart Card return values
- PCSC-lite: error codes
- Microsoft: SCardStatus
- PC/SC Workgroup: architecture and specifications
Looking for a different code? Search another status or error code.