Share via


SmartcardInitialize (Windows Embedded CE 6.0)

1/6/2010

The SmartcardInitialize function allocates internal buffers for the library.

Syntax

NTSTATUS SmartcardInitialize(
  PSMARTCARD_EXTENSION SmartcardExtension
);

Parameters

  • SmartcardExtension
    [in] Points to the smart card extension of the device. In this SMARTCARD_EXTENSION structure, the BufferSize member of this structure's SmartcardRequest member must be set to the number of bytes to be allocated for the request buffer. The minimum size for this buffer is MIN_BUFFER_SIZE. If this value is smaller, MIN_BUFFER_SIZE will be allocated automatically.

    The BufferSize member of this structure's SmartcardReply member must be set to the number of bytes to be allocated for the receive buffer. The minimum size for this buffer is MIN_BUFFER_SIZE. If this value is smaller, MIN_BUFFER_SIZE will be allocated automatically.

Return Value

SmartcardInitialize returns an NTSTATUS value. The value STATUS_INSUFFICIENT_RESOURCES means that there is not enough memory available to initialize the smart card.

Remarks

For the structure pointed to by SmartcardExtension, the library uses internal buffers for sending the value in the Buffer member of this structure's SmartcardRequest member and for receiving the data in the Buffer member of this structure's SmartcardReply member. SmartcardInitialize allocates these buffers. Call SmartcardExit in your DriverUnload routine to free these internal buffers. Your driver should use those buffers for transferring data to and from the card.

The Smart Card Driver Library checks the version of the SMARTCARD_EXTENSION structure. Before calling SmartcardInitialize, the driver must assign to the Version member of SMARTCARD_EXTENSION the value SMCLIB_VERSION. This is usually done in the driver's Init routine.

Requirements

Header smclib.h
Windows Embedded CE Windows CE 3.0 and later

See Also

Reference

Smart Card Driver Functions
SmartcardExit
SMARTCARD_EXTENSION