IOCTL_SMARTCARD_IS_PRESENT control code

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

The operation either returns immediately with STATUS_SUCCESS, which indicates that a smart card is already in the smart card reader, or it returns with STATUS_PENDING, which indicates that no smart card is currently in the reader. In this case, the driver then informs the caller through an I/O completion that the smart card was inserted. To wait for I/O completion, use the following code example:

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

Input Parameters

None

Output Parameters

None

I/O Status Block

TheInformation member must be set tozero .

The Status member is set to one of the values in the following table.

Value Meaning

STATUS_SUCCESS

A smart card is currently inserted.

STATUS_PENDING

The driver is waiting for a smart card to be removed.

STATUS_DEVICE_BUSY

Event tracking is already active.

STATUS_INVALID_DEVICE_STATE

The device cannot accept the request.

Requirements

Header

Winsmcrd.h (include Winsmcrd.h)

See also

IOCTL_SMARTCARD_IS_ABSENT

Send comments about this topic to Microsoft