Subsections

SCardDisconnect

Synopsis:

#include <winscard.h>

LONG SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition);

Parameters:

hCard IN Connection made from SCardConnect
dwDisposition IN Reader function to execute

Description:

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

Value of dwDisposition Meaning
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

Example:

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

Returns:

SCARD_S_SUCCESS Successful
SCARD_E_INVALID_HANDLE Invalid hCard handle
SCARD_E_INVALID_VALUE Invalid dwDisposition



2007-06-17