IOCTL_SMARTCARD_SET_PROTOCOL

WDM driver version:

The IOCTL_SMARTCARD_SET_PROTOCOL DeviceIoControl operation sets the protocol to be used with the currently inserted card.

Input

Irp->AssociatedIrp.SystemBuffer
Contains a mask of protocols that are acceptable for the following transmissions. This mask can be any of the following, which can be combined by using the bitwise OR operator:

The last two values are additional bit definitions telling the driver either to explicitly perform PTS selection (SCARD_PROTOCOL_OPTIMAL) with the best possible communication parameters or to use the implicit protocol of the card (SCARD_PROTOCOL_DEFAULT) with standard parameters. If the card supports only one protocol with one set of communication parameters, these 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 currently inserted card.
Parameters.DeviceIoControl.OutputBufferLength
Must be sizeof(ULONG).

Output

Irp->AssociatedIrp.SystemBuffer
The driver stores the selected protocol here. Only one bit out of the mask can be set.

I/O Status

Information must be set to sizeof(ULONG). Status can be:

Status Meaning
STATUS_SUCCESS One protocol has been successfully selected.
STATUS_NO_MEDIA No card in reader.
STATUS_IO_TIMEOUT The operation has timed out.
STATUS_NOT_SUPPORTED The card does not support any of the requested protocols.
STATUS_INVALID_DEVICE_REQUEST The mask contains no known protocol.

VxD driver version:

The IOCTL_SMARTCARD_SET_PROTOCOL DeviceIoControl operation sets the protocol to be used with the currently inserted card.

Input

DiocParams->lpvInBuffer
Contains a mask of protocols that are acceptable for the following transmissions. This mask can be any of the following, which can be combined by using the bitwise OR operator:

The last two values are additional bit definitions telling the driver either to explicitly perform PTS selection (SCARD_PROTOCOL_OPTIMAL) with the best possible communication parameters or to use the implicit protocol of the card (SCARD_PROTOCOL_DEFAULT) with standard parameters. If the card supports only one protocol with one set of communication parameters, these bits are ignored.

DiocParams->cbInBuffer
Must be set to sizeof(ULONG). The driver decides which protocol out of the mask to use with the currently inserted card.
DiocParams->cbOutBuffer
Must be sizeof(ULONG).

Output

DiocParams->lpvInBuffer
The driver stores the selected protocol here. Only one bit out of the mask can be set.
DiocParams->lpcbBytesReturned
Must be set to sizeof(ULONG).

Return Values

Following are possible return values.

Value Meaning
STATUS_SUCCESS One protocol has been successfully selected.
STATUS_NO_MEDIA No card in reader.
STATUS_IO_TIMEOUT The operation has timed out.
STATUS_NOT_SUPPORTED The card does not support any of the requested protocols.
STATUS_INVALID_DEVICE_REQUEST The mask contains no known protocol.