SCardGetStatusChange

The SCardGetStatusChange function blocks execution until the current availability of the cards in a specific set of readers changes.

The caller supplies a list of readers to be monitored via an SCARD_READERSTATE array and the maximum amount of time (in seconds) that it is willing to wait for an action to occur on one of the listed readers. The function returns when there is a change in availability, having filled in the dwEventState members of the rgReaderStates parameter appropriately.

LONG SCardGetStatusChange(
  IN SCARDCONTEXT hContext,
  IN DWORD dwTimeout,
  IN OUT LPSCARD_READERSTATE rgReaderStates,
  IN DWORD cReaders
);
 

Parameters

hContext
Supplies the handle that identifies the resource manager context. The resource manager context is set by a previous call to SCardEstablishContext.
dwTimeOut
Supplies the maximum amount of time (in milliseconds) to wait for an action. A value of zero implies a value of INFINITE, dwTimeOut will never timeout.
rgReaderStates
Supplies an array of SCARD_READERSTATE structures that specify the readers to watch, and receives the result.
cReaders
Supplies the number of elements in the rgReaderStates array.

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

SCardGetStatusChange is a smart card tracking function. For a description of other tracking functions, see Smart Card Tracking 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

SCardCancel, SCardEstablishContext, SCardLocateCards, SCARD_READERSTATE