Before the library calls a member function, it sets up the following members in the SMARTCARD_EXTENSION structure for every control request, except IOCTL_SMARTCARD_IS_ABSENT and IOCTL_SMARTCARD_IS_PRESENT.
Members | Description |
---|---|
IoRequest.RequestBuffer | Points to the user buffer that contains the user data to be sent to the card. |
IoRequest.RequestBufferLength | The length of the user buffer. |
IoRequest.ReplyBuffer | Points to the buffer that receives the data returned by the smart card. |
IoRequest.ReplyBufferLength | The size of the reply buffer. |
IoRequest.Information | Points to a ULONG that receives the number of bytes actually received from the card. |
MajorIoControlCode | Contains the major I/O control code of this call. |
MinorIoControlCode | Contains the minor I/O control code of this call (if any). |
WDM Note In addition, the structure SmartcardExtension->OsData will be set up as follows:
Member | Description |
---|---|
CurrentIrp | Receives a pointer to the requesting IRP for every control request, except IOCTL_SMARTCARD_IS_ABSENT and IOCTL_SMARTCARD_IS_PRESENT. |
NotificationIrp | Receives a pointer to the requesting IRP for the control request IOCTL_SMARTCARD_IS_ABSENT or IOCTL_SMARTCARD_IS_PRESENT. |
The following table lists the callback function available from both libraries. Some functions are mandatory and others are optional. The driver needs to set up only mandatory functions. Every function that has not been set up will return STATUS_NOT_SUPPORTED to the smart card resource manager.
Callback Function | Description |
---|---|
RDF_CARD_POWER | Resets or powers down an inserted smart card. |
RDF_CARD_EJECT | Ejects an inserted smart card. |
RDF_CARD_TRACKING | Installs an event handler to track card insertions and removals. |
RDF_IOCTL_VENDOR | Performs vendor-specific IOCTL operations. |
RDF_READER_SWALLOW | Does a mechanical swallow. |
RDF_SET_PROTOCOL | Selects a transmission protocol for the currently inserted card. |
RDF_TRANSMIT | Performs data transmissions. |
When calling these functions, the driver should retrieve calling parameters from the members described under Input Values. It should store data to the members described under Output Values in each reference page.
VxD Note If your driver returns STATUS_PENDING to any of the callbacks except RDF_CARD_TRACKING, the smart card library will refuse any further call to the driver and will return STATUS_DEVICE_BUSY. Call SmartcardCompleteRequest to finish a call that returned STATUS_PENDING. This function informs the caller of the completion and unlocks memory that had been locked by the smart card driver library. It also enables further requests to your driver.
If you do not call SmartcardCompleteRequest, the library will block any further call to your driver.