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 by an SCARD_READERSTATE array and the maximum amount of time (in milliseconds) that it is willing to wait for an action to occur on one of the listed readers. Note that SCardGetStatusChange uses the user-supplied value in the dwCurrentState members of the rgReaderStatesSCARD_READERSTATE array as the definition of the current state of the readers. The function returns when there is a change in availability, having filled in the dwEventState members of rgReaderStates appropriately.
LONG SCardGetStatusChangeA( SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders );
The maximum amount of time, in milliseconds, to wait for an action. A value of zero causes the function to return immediately. A value of INFINITE causes this function never to time out.
An array of SCARD_READERSTATE structures that specify the readers to watch, and that receives the result.
To be notified of the arrival of a new smart card reader, set the szReader member of a SCARD_READERSTATE structure to "\\?PnP?\Notification", and set all of the other members of that structure to zero.
The number of elements in the rgReaderStates array.
This function returns different values depending on whether it succeeds or fails.
||An error code. For more information, see Smart Card Return Values.|
For information about how to call this function, see the example in SCardLocateCards.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|