Previous Next

IOCTL_SMARTCARD_SET_PROTOCOL

WDM driver version

Operation

The IOCTL_SMARTCARD_SET_PROTOCOL request 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 indicating that the driver must either explicitly perform PTS selection (SCARD_PROTOCOL_OPTIMAL) with the best possible communication parameters or 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 one of the following values.

Status Meaning
STATUS_SUCCESS One protocol has been successfully selected.
STATUS_NO_MEDIA No card is in the 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.

Headers

Defined in winsmcrd.h. Include winsmcrd.h.

See Also

IOCTL_SMARTCARD_SET_ATTRIBUTE

VxD driver version

Operation

The IOCTL_SMARTCARD_SET_PROTOCOL request 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 indicating to the driver that it must either explicitly perform PTS selection (SCARD_PROTOCOL_OPTIMAL) with the best possible communication parameters or 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 selects a protocol from 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).

I/O Status Block

Following are possible return values.

Value Meaning
STATUS_SUCCESS One protocol has been successfully selected.
STATUS_NO_MEDIA No card is in the 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.

Headers

Defined in winsmcrd.h. Include winsmcrd.h.

See Also

IOCTL_SMARTCARD_SET_ATTRIBUTE