The SCardStatus function provides the current status of a smart card in a reader. You can call it any time after a successful call to SCardConnect and before a successful call to SCardDisconnect. It does not affect the state of the reader or reader driver.
LONG SCardStatus( IN SCARDHANDLE hCard, OUT LPTSTR
mszReaderNames,
IN OUT LPDWORD pcchReaderLen,
OUT LPDWORD pdwState,
OUT LPDWORD pdwProtocol,
OUT LPBYTE pbAtr,
OUT LPDWORD pbcAtrLen
);
On output, receives the actual length (in characters) of the reader name list, including the trailing NULL character.
Value | Meaning |
---|---|
SCARD_ABSENT | There is no card in the reader. |
SCARD_PRESENT | There is a card in the reader, but it has not been moved into position for use. |
SCARD_SWALLOWED | There is a card in the reader in position for use. The card is not powered. |
SCARD_POWERED | Power is being provided to the card, but the reader driver is unaware of the mode of the card. |
SCARD_NEGOTIABLEMODE | The card has been reset and is awaiting PTS negotiation. |
SCARD_SPECIFICMODE | The card has been reset and specific communication protocols have been established. |
Value | Meaning |
---|---|
SCARD_PROTOCOL_RAW | The Raw Transfer protocol is in use. |
SCARD_PROTOCOL_T0 | The ISO 7816/3 T=0 protocol is in use. |
SCARD_PROTOCOL_T1 | The ISO 7816/3 T=1 protocol is in use. |
If the function… | The return value is… |
---|---|
Succeeds | SCARD_S_SUCCESS. |
Fails | An error code (see Error Codes for a list of all error codes). |
SCardStatus is a smart card and reader access function. For a description of other access functions, see Smart Card and Reader Access Functions.
Windows NT: Use version 4.0 SP3 and later.
Windows: Use Windows 95 OSR2.1.
Windows CE: Unsupported.
Header: Declared in winscard.h.
Import Library: Link with winscard.lib.