Previous Next

IOCTL_SMARTCARD_IS_PRESENT

WDM driver version

Operation

The IOCTL_SMARTCARD_IS_PRESENT request either returns immediately if no card is currently inserted, or it installs an event handler to track card insertions.

The operation either returns immediately with STATUS_SUCCESS, which indicates that a card is already in the reader, or it returns with STATUS_PENDING, which indicates that no card is currently in the reader. In this case, the driver then informs the caller of card insertion through an I/O completion. Waiting for I/O completion can be accomplished with the following code fragment:

success = GetOverlappedResult(
    hDevice,
    &lpOverlapped,
    &lpBytesReturned,
    TRUE);
 

Input

None

Output

None

I/O Status

Information must be set to zero. Status can be one of the following values.

Status Meaning
STATUS_SUCCESS A smart card is currently inserted.
STATUS_PENDING The driver is waiting for a card to be removed.
STATUS_DEVICE_BUSY Event tracking is already active.
STATUS_INVALID_DEVICE_STATE The device cannot accept the request.

Headers

Defined in winsmcrd.h. Include winsmcrd.h.

See Also

IOCTL_SMARTCARD_IS_ABSENT

VxD driver version

Operation

The IOCTL_SMARTCARD_IS_PRESENT request either returns immediately if no card is currently inserted, or it installs an event handler to track card insertions.

The operation either returns immediately with STATUS_SUCCESS, which indicates that a card is already in the reader, or it returns with STATUS_PENDING, which indicates that no card is currently in the reader. In this case, the driver informs the caller of card insertion through an I/O completion. Waiting for I/O completion can be accomplished with the following code fragment:

success = GetOverlappedResult(
    hDevice,
    &lpOverlapped,
    &lpBytesReturned,
    TRUE);
 

Completing the call in the driver can be accomplished with the following code fragment:

SmartcardCompleteCardTracking(
  SmartcardExtension
);
 

Input

None

Output

None

I/O Status Block

Following are possible status values.

Value Meaning
STATUS_SUCCESS A smart card is currently inserted.
STATUS_PENDING The driver is waiting for a card to be removed.
STATUS_DEVICE_BUSY Event tracking is already active.
STATUS_INVALID_DEVICE_STATE The device cannot accept the request.

Headers

Defined in winsmcrd.h. Include winsmcrd.h.

See Also

IOCTL_SMARTCARD_IS_ABSENT