The SmartcardT1Request routine copies request data from the caller's buffer to the buffer that is managed by the smartcard library routines, from which it is transmitted to the card reader, and then checks the T=1 protocol status.
NTSTATUS
SmartcardT1Request(
PSMARTCARD_EXTENSION SmartcardExtension
);
SmartcardT1Request returns an NTSTATUS value.
| Value | Meaning |
|---|---|
| STATUS_SUCCESS | Buffer successfully set up. |
| STATUS_INSUFFICIENT_RESOURCES | Smartcard library buffer was not properly allocated. |
Declared in smclib.h. Include smclib.h.
The caller must allocate a SMARTCARD_EXTENSION structure and pass a pointer to this structure to the the SmartcardInitialize (WDM) routine. SmartcardInitialize allocates two internal buffers that are managed by the smartcard library routines and initializes the SmartcardRequest and SmartcardReply members of the SMARTCARD_EXTENSION structure to point to these two internal buffers. SmartcardT1Request uses one of these buffers, therefore SmartcardInitialize must be called before SmartcardT1Request.
A caller of the SmartcardT1Request routine must copy the request data to the location pointed to by the IoRequest.RequestBuffer member of the previously allocated and initialized SMARTCARD_EXTENSION structure, and then pass a pointer to this structure to SmartcardT1Request in the SmartcardExtension parameter.
This SmartcardT1Request routine copies the data in the caller's buffer at IoRequest.RequestBuffer to the smartcard library buffer at SmartcardExtension->SmartcardRequest.Buffer. SmartcardT1Request then sets SmartcardExtension->SmartcardRequest.BufferLength to the number of bytes to be transmitted to the smart card.
Do not change any members of the T1_DATA structure. They will be initialized automatically. The only member that can be safely modified is NAD. Changing any member might lead to protocol errors.
The driver must call SmartcardT1Reply (WDM) to read the data associated with the reply to this request.
If your driver must send header data to the reader before the T=1 data, you should set SmartcardExtension->SmartcardRequest.BufferLength to the number of bytes you need for your header before you call this function. The packet will look like this:

Here is an example of a T=1 transmission.
// Run this loop as long as the protocol requires to send data
do {
// Copy data to SmartcardExtension->SmartcardRequest.Buffer
// embedded in a T=1 frame
status = SmartcardT1Request(SmartcardExtension);
if (status != STATUS_SUCCESS)
return status;
// Send T=1 frame to smart card
status = DriverSendDataToSmartcard(…);
if (status != STATUS_SUCCESS)
return status;
// Now set appropiate timeout (This example calculates the time-out in ms)
// Timeout = SmartcardExtension->CardCapabilities.T1.BWT *
// (SmartcardExtension->T1.Wtx ? SmartcardExtension->T1.Wtx : 1);
// receive T=1 frame from smart card
status = DriverReceiveDataFromSmartcard(…);
if (status != STATUS_SUCCESS)
return status;
// Check T=1 protocol status and copy any data back to user buffer
status = SmartcardT1Reply(SmartcardExtension);
} while (status == STATUS_MORE_PROCESSING_REQUIRED);
return status;
SmartcardT1Request functions the same for both WDM and VxD drivers.
SmartcardT1Reply (WDM), SmartcardT1Request (VxD), SmartcardT1Reply (VxD), SMARTCARD_EXTENSION