#include <winscard.h> LONG SCardCancel(SCARDCONTEXT hContext);
| hContext | IN | Connection context to the PC/SC Resource Manager |
This function cancels all pending blocking requests on the GetStatusChange() function.
SCARDCONTEXT hContext;
DWORD cReaders;
SCARD_READERSTATE rgReaderStates;
LONG rv;
rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
rgReaderStates.szReader = strdup("Reader X");
rgReaderStates.dwCurrentState = SCARD_STATE_EMPTY;
/* Spawn off thread for following function */
rv = SCardGetStatusChange(hContext, 0, rgReaderStates, cReaders);
rv = SCardCancel(hContext);
| SCARD_S_SUCCESS | Successful |
| SCARD_E_INVALID_HANDLE | Invalid hContext handle |