SCardReconnect

The SCardReconnect function reestablishes an existing connection between the calling application and a smart card. This function moves a card handle from direct access to general access, or acknowledges and clears an error condition that is preventing further access to the card.

LONG SCardReconnect(
  IN SCARDHANDLE hCard,
  IN DWORD dwShareMode,
  IN DWORD dwPreferredProtocols,
  IN DWORD dwInitialization,
  OUT LPDWORD pdwActiveProtocol
);
 

Parameters

hCard
Supplies the reference value obtained from a previous call to SCardConnect.
dwShareMode
Supplies a flag that indicates whether other applications may form connections to this card. Possible values are:
Value Meaning
SCARDSHARE_SHARED This application will share this card with other applications.
SCARDSHARE_EXCLUSIVE This application will not share this card with other applications.

dwPreferredProtocols
Supplies a bit mask of acceptable protocols for this connection. Possible values, which may be combined with the OR operation, are:
Value Meaning
SCARD_PROTOCOL_T0 T=0 is an acceptable protocol.
SCARD_PROTOCOL_T1 T=1 is an acceptable protocol.

dwInitialization
Indicates what kind of initialization should be performed on the card. Possible values are:
Value Meaning
SCARD_LEAVE_CARD Don't do anything special on reconnect.
SCARD_RESET_CARD Reset the card (Warm Reset).
SCARD_UNPOWER_CARD Power down the card and reset it (Cold Reset).

pdwActiveProtocol
Receives a flag that indicates the established active protocol. Possible values are:
Value Meaning
SCARD_PROTOCOL_T0 T=0 is the active protocol.
SCARD_PROTOCOL_T1 T=1 is the active protocol.

Return Values

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).

Remarks

SCardReconnect is a smart card and reader access function. For a description of other access functions, see Smart Card and Reader Access Functions.

QuickInfo

  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.

See Also

SCardConnect, SCardDisconnect