Share via


RDF_TRANSMIT (Windows Embedded CE 6.0)

1/6/2010

The RDF_TRANSMIT callback function performs data transmissions. This callback function is mandatory.

Syntax

NTSTATUS (*ReaderFunction[RDF_TRANSMIT])(
  PSMARTCARD_EXTENSION SmartcardExtension
);

Parameters

  • SmartcardExtension
    [in] Points to the smart card extension of the device. In this SMARTCARD_EXTENSION structure, the MajorIoControlCode member contains IOCTL_SMARTCARD_TRANSMIT. The RequestBuffer member of this structure's IoRequest member points to an SCARD_IO_REQUEST structure followed by data to be transmitted to the card. The RequestBufferLength member of this structure's IoRequest member contains the number of bytes to be transmitted to the card. The ReplyBufferLength member of this structure's IoRequest member contains the size of the reply buffer. On output, the ReplyBuffer member of this structure's IoRequest member points to the buffer that receives the SCARD_IO_REQUEST structure, plus the result of the card, and the Information member of this structure's IoRequest member receives the actual number of bytes returned by the card, plus the size of SCARD_IO_REQUEST structure.

Return Value

This function returns an NTSTATUS value. Possible values are the following.

Value Description

STATUS_SUCCESS

Transmission successful.

STATUS_NO_MEDIA

No card is in the reader.

STATUS_IO_TIMEOUT

The request has timed out.

STATUS_INVALID_DEVICE_REQUEST

The protocol defined by the dwProtocol member in SCARD_IO_REQUEST is invalid.

Remarks

When this function is called, the RequestBuffer member of the IoRequest member of the structure pointed to in SmartcardExtension points to a SCARD_IO_REQUEST structure followed by data to be transmitted.

The dwProtocol member of SCARD_IO_REQUEST must contain the protocol identifier that was returned by a call to IOCTL_SMARTCARD_SET_PROTOCOL.

The cbPciLength member contains the size of this structure, which is usually eight. This structure will be used mainly for future implementations.

The structure is followed by protocol data to be transmitted to the card. Depending on the protocol to be used for this transmission, the library offers several support functions. See SmartcardT1Request.

RequestBuffer and ReplyBuffer point to the same system buffer. If you use the library function SmartcardxxRequest and SmartcardxxReply, you do not have to worry that you might overwrite the input buffer. If you do not use these functions, make a copy of the RequestBuffer before you start transmissions.

The implementation requires you to copy the SCARD_IO_REQUEST structure to the ReplyBuffer, followed by the data received from the card. Again, if you use the SmartcardxxRequest and SmartcardxxReply functions, you do not need to copy the structure because the library does this.

Requirements

Header smclib.h
Windows Embedded CE Windows CE 3.0 and later

See Also

Reference

Smart Card Driver Functions
IOCTL_SMARTCARD_SET_PROTOCOL
SmartcardT1Request

Other Resources

SCARD_IO_REQUEST