SmcCxUpdateCardCapabilities function

Translates information from an answer-to-reset (ATR) string.

Syntax

FORCEINLINE NTSTATUS SmcCxUpdateCardCapabilities(
  _In_ WDFDEVICE Device
);

Parameters

  • Device [in]
    Handle to the framework device object.

Return value

SmcCxUpdateCardCapabilities returns an appropriate NTSTATUS values. Possible values include:

Return code Description
STATUS_SUCCESS

The ATR string was translated successfully.

STATUS_UNRECOGNIZED_MEDIA

One of three conditions is true: the ATR string does not start with 0x3B or 0x3F, the ATR string contains a value for Fl or Dl that does not conform with the ISO standard, or the ATR checksum for T=1 is wrong.

 

Remarks

The client driver calls this method to get capabilities of the smart card that has just been reset and is currently in use. The driver must call the method after the driver has read the ATR string into the ATR member of the SCARD_CARD_CAPABILITIES structure. The driver must store the ATR bytes in the Buffer member, and it must adjust the Length member to the actual length of the ATR string. To see the format of an ATR string, see ISO 7816-3, section 6.1.4.

This routine can handle only T=0 and T=1 smart cards.

The client driver calls this method to fill the remaining members of SCARD_CARD_CAPABILITIES with information that SmcCxUpdateCardCapabilities derives from the ATR string.

To retrieve a pointer to the structure, call SmcCxGetCardCapabilities.

Examples

PSCARD_CARD_CAPABILITIES CardCapabilities = NULL;
PUCHAR OutputBuffer;
size_t OutputBufferSizeInBytes;

// Get ATR from the card and fills OutputBuffer and OutputBufferSizeInBytes. Not shown.

RtlCopyMemory(CardCapabilities->ATR.Buffer, OutputBuffer, OutputBufferSizeInBytes);
                
CardCapabilities->ATR.Length = OutputBufferSizeInBytes;
                
status = SmcCxUpdateCardCapabilities(FxDevice);

Requirements

Target platform

Desktop

Header

SmcCx.h on Windows 10

See also

SmcCxGetCardCapabilities

 

 

Send comments about this topic to Microsoft