SmartcardInitialize (WDM) routine
The SmartcardInitialize routine allocates internal buffers for the library.
NTSTATUS SmartcardInitialize( _In_ PSMARTCARD_EXTENSION SmartcardExtension );
A pointer to a SMARTCARD_EXTENSION structure that contains the device extension of the smart card device.
The value of this member must be set to the number of bytes to allocate for the request buffer. If the value is less than MIN_BUFFER_SIZE, the library allocates MIN_BUFFER_SIZE bytes automatically.
The value of this member must be set to the number of bytes to allocate for the receive buffer. If the value is less than MIN_BUFFER_SIZE, the library allocates MIN_BUFFER_SIZE bytes automatically.
SmartcardInitialize returns one of the following NTSTATUS values:
The operation succeeded.
The amount of memory that is required to allocate the buffers is not available.
The library allocates and uses two internal buffers: SmartcardExtension->SmartcardRequest.Buffer for receiving data, and SmartcardExtension->SmartcardReply.Buffer for sending data. Your driver should call SmartcardInitialize to allocate these buffers, and it should use these buffers to transfer data to and from the smart card. To free these buffers, call SmartcardExit (WDM) from your DriverUnload routine.
The smart card driver library checks the version of the SMARTCARD_EXTENSION structure. Before your driver calls SmartcardInitialize, it must set the Version member of SMARTCARD_EXTENSION to the value SMCLIB_VERSION. This is usually done in the DriverEntry routine.
Available in Windows XP and later versions of Windows.
|Smclib.h (include Smclib.h)|