Share via


Send Feedback

This code sets the protocol to be used with the currently inserted card.


  • dwOpenData
    [in] Handle returned from a call to the smart card reader driver's XXX_Open (Device Manager) function.

  • dwCode
    [in] Specifies this code.

  • pBufIn
    [in] Contains a mask of protocols that are acceptable for the following transmissions. This mask can contain any of the following protocol codes, which can be combined by using the bitwise-OR operator:


    SCARD_PROTOCOL_DEFAULT and SCODE_PROTOCOL_OPTIMAL are not protocols themselves, but instead instruct the driver either to explicitly perform protocol selection with the best possible communication parameters or to use the implicit protocol of the card with standard parameters. If the card supports only one protocol with one set of communication parameters, pBufIn is ignored.

  • dwLenIn
    [in] Set to sizeof(ULONG).

  • pBufOut
    [out] The driver stores the code for whatever protocol it selects in pBufOut.

  • dwLenOut
    [out] Set to sizeof(ULONG).

  • pdwActualOut
    [out] Set to sizeof(ULONG).

Return Values

One of the following status values.

Status Description
STATUS_SUCCESS One protocol has been successfully selected.
STATUS_NO_MEDIA There is no smart card in the card reader.
STATUS_IO_TIMEOUT The operation has 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.


Smart card reader drivers return Windows NT status values, rather than Win32 error values, as the return values from the driver's callback function.


OS Versions: Windows CE 3.0 and later.
Header: Winsmcrd.h.

See Also

XXX_Open (Device Manager)

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.