The data transmission callback function performs data transmissions.
NTSTATUS
(*ReaderFunction[RDF_TRANSMIT])(
PSMARTCARD_EXTENSION SmartcardExtension
);
This function returns an NTSTATUS value. Possible values are the following.
| Value | Meaning |
|---|---|
| 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 dwProtocol, is invalid. |
Declared in smclib.h. Include smclib.h.
It is mandatory for card reader drivers to implement this callback function.
When this function is called, SmartcardExtension->IoRequest.RequestBuffer points to a SCARD_IO_REQUEST structure followed by the data to be transmitted:
typedef struct _SCARD_IO_REQUEST{
DWORD dwProtocol; // Protocol identifier
DWORD cbPciLength; // Protocol Control Information Length
} SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
The dwProtocol member must contain the protocol identifier that was returned by a call to IOCTL_SMARTCARD_SET_PROTOCOL.
The cbPciLength member contains the size, in bytes, of the SCARD_IO_REQUEST structure. The size of this structure is usually 8 bytes. This structure will be used mainly for future implementations.
The SCARD_IO_REQUEST 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 SmartcardT0Request (WDM), SmartcardT0Request (VxD), SmartcardT1Request (WDM), and SmartcardT1Request (VxD).
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.
You must 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.
SMARTCARD_EXTENSION, IOCTL_SMARTCARD_TRANSMIT, IOCTL_SMARTCARD_SET_PROTOCOL, SmartcardT0Request (WDM), SmartcardT0Request (VxD), SmartcardT1Request (WDM), SmartcardT1Request (VxD)