Previous Next

RDF_IOCTL_VENDOR

The vendor I/O request callback function performs vendor-specific IOCTL operations.

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

Parameters

SmartcardExtension
Caller must pass the following values to the function on input:
SmartcardExtension->MajorIoControlCode
Contains a vendor-specific IOCTL code. Refer to the macro SCARD_CTL_CODE in winsmcrd.h for information on how to define a vendor-specific IOCTL code. Note that the code must be between 2048 and 4095.
SmartcardExtension->IoRequest.RequestBuffer
Pointer to the user’s input buffer.
SmartcardExtension->IoRequest.RequestBufferLength
The size, in bytes, of the user’s input buffer.
SmartcardExtension->IoRequest.ReplyBuffer
Pointer to the user’s output buffer.
SmartcardExtension->IoRequest.ReplyBufferLength
The size, in bytes, of the user’s output buffer.

The request supplies the following value:

SmartcardExtension->IoRequest.Information
Must be set to the number of bytes returned.

Return Value

This function returns an NTSTATUS value. The value returned depends upon the function performed, since this function executes a vendor-defined IOCTL call. Possible values are the following.

Value Meaning
STATUS_SUCCESS Function successfully executed.
STATUS_NO_MEDIA No card is in the reader.
STATUS_IO_TIMEOUT The request has timed out.
STATUS_BUFFER_TOO_SMALL The user’s reply buffer is too small.
STATUS_INVALID_DEVICE_REQUEST The request is not valid for this IOCTL.
STATUS_PENDING The operation is pending.

Headers

Declared in smclib.h. Include smclib.h.

Comments

It is optional for card reader drivers to implement this callback function.

In Windows 98, vendor IOCTLs are always asynchronous. As with all other IOCTLs, a user-mode application dispatches a vendor-defined IOCTL to a smart card reader device by calling the DeviceIoControl function. (See the Platform SDK documentation for information on how to use DeviceIoControl.) But when the IOCTL is vendor-defined, the application must first open the reader device for "overlapped" (that is asynchronous) access. The application must also define an OVERLAPPED structure and pass it to the system in the last argument of DeviceIoControl (The OVERLAPPED structure is also described in the Platform SDK documentation). When the operating system calls the driver's I/O control dispatch routine, it passes a DIOCPARAMETERS structure to the driver. The lpoOverlapped member of the DIOCPARAMETERS structure contains pointer to the OVERLAPPED structure.

See Also

SMARTCARD_EXTENSION, DIOCPARAMETERS