// winsmcrd.h
// CTL_CODE(0x0031, 0x00c, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SMARTCARD_SET_PROTOCOL 0x00310030
View the official Windows Driver Kit DDI referenceNo description available.
The IOCTL_SMARTCARD_SET_PROTOCOL request sets the protocol that the driver will use to communicate with the smart card after the card is detected (inserted).
Irp->AssociatedIrp.SystemBuffer Contains a mask of protocols that are acceptable for the following transmissions. The mask can be a bitwise OR of the following values:
The last two values are additional bit definitions that indicate that the driver must either explicitly perform protocol type selection (PTS) with the best possible communication parameters (SCARD_PROTOCOL_OPTIMAL) or use the implicit protocol of the card with standard parameters (SCARD_PROTOCOL_DEFAULT). If the card supports only one protocol with one set of communication parameters, the bits are ignored.
Parameters.DeviceIoControl.InputBufferLength Must be set to sizeof(ULONG). The driver decides which protocol out of the mask to use with the inserted card.
Irp->IoStatus.Information must be set to sizeof(ULONG).
Irp->IoStatus.Status is set to one of the following values.
| Value | Meaning |
|---|---|
| STATUS_SUCCESS | A protocol was successfully selected. |
| STATUS_NO_MEDIA | No smart card is detected in the reader. |
| STATUS_IO_TIMEOUT | The operation timed out. |
| STATUS_NOT_SUPPORTED | The smart card does not support any of the requested protocols. |
| STATUS_INVALID_DEVICE_REQUEST | The mask contains no known protocol. |
For more information, see NTSTATUS Values.
Near field communication (NFC) design guide