Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

LONG SCardDisconnect ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)

This function terminates a connection to the connection made through SCardConnect(). dwDisposition can have the following values:

Parameters:
[in] hCard Connection made from SCardConnect.
[in] dwDisposition Reader function to execute.
  • SCARD_LEAVE_CARD - Do nothing.
  • SCARD_RESET_CARD - Reset the card (warm reset).
  • SCARD_UNPOWER_CARD - Unpower the card (cold reset).
  • SCARD_EJECT_CARD - Eject the card.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS Successful.
SCARD_E_INVALID_HANDLE Invalid hCard handle.
SCARD_E_INVALID_VALUE - Invalid dwDisposition.
Test:
 SCARDCONTEXT hContext;
 SCARDHANDLE hCard;
 DWORD dwActiveProtocol;
 LONG rv;
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
 rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);
 rv = SCardDisconnect(hCard, SCARD_UNPOWER_CARD);

Definition at line 467 of file winscard_scf.c.

References SCARD_EXCLUSIVE_CONTEXT, SCARD_NO_CONTEXT, SCardLockThread(), SCardUnlockThread(), and SYS_USleep().

Referenced by MSGFunctionDemarshall().

{
      long rv;

      SCardLockThread();
      rv = SCardDisconnectTH(hCard, dwDisposition);
      SCardUnlockThread();
      return rv;
}


Generated by  Doxygen 1.6.0   Back to index