SCARD_READERSTATE

This structure is used by functions for tracking smart cards within readers.

typedef struct {
  LPCTSTR szReader;
  LPVOID pvUserData;
  DWORD dwCurrentState;
  DWORD dwEventState;
  DWORD cbAtr;
  BYTE rgbAtr[36];
} SCARD_READERSTATE, *PSCARD_READERSTATE, *LPSCARD_READERSTATE;

Members

  • szReader
    Points to the name of the reader being monitored.
  • pvUserData
    Not used by the smart card subsystem but is used by the application.
  • dwCurrentState
    Supplies the current state of the reader, as seen by the application. This field can take on any of the following values, in combination, as a bit mask.
    Value Description
    SCARD_STATE_UNAWARE The application is unaware of the current state and would like to know it. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero.
    SCARD_STATE_IGNORE The application is not interested in this reader, and it should not be considered during monitoring operations. If this bit value is set, all other bits are ignored.
    SCARD_STATE_UNAVAILABLE The application believes that this reader is not available for use. If this bit is set, then all the following bits are ignored.
    SCARD_STATE_EMPTY The application believes that there is not a card in the reader. If this bit is set, all the following bits are ignored.
    SCARD_STATE_PRESENT The application believes that there is a card in the reader.
    SCARD_STATE_ATRMATCH The application believes that there is a card in the reader with an ATR matching one of the target cards. If this bit is set, SCARD_STATE_PRESENT is assumed. This bit has no meaning to SCardGetStatusChange beyond SCARD_STATE_PRESENT.
    SCARD_STATE_EXCLUSIVE The application believes that the card in the reader is allocated for exclusive use by another application. If this bit is set, SCARD_STATE_PRESENT is assumed.
    SCARD_STATE_INUSE The application believes that the card in the reader is in use by one or more other applications, but it may be connected to in shared mode. If this bit is set, SCARD_STATE_PRESENT is assumed.
    SCARD_STATE_MUTE The application believes that there is an unresponsive card in the reader.
  • dwEventState
    Receives the current state of the reader, as known by the smart card resource manager. This field can take on any of the following values, in combination, as a bit mask.
    Value Description
    SCARD_STATE_IGNORE This reader should be ignored.
    SCARD_STATE_CHANGED There is a difference between the state believed by the application and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader.
    SCARD_STATE_UNKNOWN The given reader name is not recognized by the resource manager. If this bit is set, SCARD_STATE_CHANGED and SCARD_STATE_IGNORE will also be set.
    SCARD_STATE_UNAVAILABLE The actual state of this reader is not available. If this bit is set, all the following bits are clear.
    SCARD_STATE_EMPTY There is no card in the reader. If this bit is set, all the following bits are be clear.
    SCARD_STATE_PRESENT There is a card in the reader.
    SCARD_STATE_ATRMATCH There is a card in the reader with an ATR matching one of the target cards. If this bit is set, SCARD_STATE_PRESENT will also be set. This bit is only returned on the SCardLocateCards function.
    SCARD_STATE_EXCLUSIVE The card in the reader is allocated for exclusive use by another application. If this bit is set, SCARD_STATE_PRESENT will also be set.
    SCARD_STATE_INUSE The card in the reader is in use by one or more other applications, but it may be connected to in shared mode. If this bit is set, SCARD_STATE_PRESENT will also be set.
    SCARD_STATE_MUTE There is an unresponsive card in the reader.
  • cbAtr
    Number of bytes in the returned ATR.
  • rgbAtr [36]
    ATR of the inserted card, with extra alignment bytes.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Winscard.h.

See Also

SCardGetStatusChange | SCardLocateCards

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.