RDF_CARD_POWER callback function

The RDF_CARD_POWER callback function resets or turns off an inserted smart card.

Syntax

NTSTATUS (*ReaderFunction[RDF_CARD_POWER])(
   PSMARTCARD_EXTENSION SmartcardExtension
);

Parameters

  • SmartcardExtension
    A pointer to the smart card extension, SMARTCARD_EXTENSION, of the device. For more information about the members of this structure, see Remarks.

Return value

This function returns one of the following NTSTATUS values:

Return code Description
STATUS_SUCCESS

The function was successfully executed.

STATUS_NO_MEDIA

No smart card is inserted in the reader.

STATUS_IO_TIMEOUT

The request timed out.

STATUS_BUFFER_TOO_SMALL

The user buffer is not large enough to hold the answer-to-reset (ATR).

 

Remarks

It is mandatory for smart card reader drivers to implement this callback function.

On input, the structure pointed to by SmartcardExtension should have the following member values:

  • MajorIoControlCode
    Should have a value of IOCTL_SMARTCARD_POWER.

  • IoRequest.ReplyBufferLength
    Should contain the length of the buffer.

  • MinorIoControlCode
    Should have one of the following minor codes:

    • SCARD_COLD_RESET
      Performs a cold reset of the smart card.

    • SCARD_WARM_RESET
      Performs a warm reset of the smart card.

    • SCARD_POWER_DOWN
      Turns off smart card power.

On output, the structure pointed to by SmartcardExtension should have the following values:

  • IoRequest.ReplyBuffer
    Receives the ATR that is returned by the smart card. In addition, you must transfer the ATR to SmartcardExtension->CardCapabilities.ATR.Buffer so that the library can parse the ATR.

  • IoRequest.Information
    Receives the length of the ATR.

  • CardCapabilities.ATR.Length
    Contains the length of the ATR.

Requirements

Target platform

Desktop

Header

Smclib.h (include Smclib.h)

See also

SMARTCARD_EXTENSION

 

 

Send comments about this topic to Microsoft