Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

winscard_clnt.c File Reference

This handles smartcard reader communications and forwarding requests over message queues. More...

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/un.h>
#include <errno.h>
#include "misc.h"
#include "pcsclite.h"
#include "winscard.h"
#include "debug.h"
#include "thread_generic.h"
#include "readerfactory.h"
#include "eventhandler.h"
#include "sys_generic.h"
#include "winscard_msg.h"

Go to the source code of this file.

Data Structures

struct  _psChannelMap
 Represents an Application Context Channel. More...

struct  _psContextMap
 Represents the an Application Context on the Client side. More...


Defines

#define SCARD_PROTOCOL_ANY_OLD   0x1000
 used for backward compatibility.

#define min(a, b)   (((a) < (b)) ? (a) : (b))
#define TRUE   1
#define FALSE   0
#define PROFILE_START
#define PROFILE_END

Typedefs

typedef _psChannelMap CHANNEL_MAP * PCHANNEL_MAP

Functions

LONG SCardAddContext (SCARDCONTEXT, DWORD)
 Adds an Application Context to the vector psContextMap. More...

LONG SCardGetContextIndice (SCARDCONTEXT)
 Get the index from the Application Context vector psContextMap for the passed context. More...

LONG SCardGetContextIndiceTH (SCARDCONTEXT)
 Get the index from the Application Context vector psContextMap for the passed context. More...

LONG SCardRemoveContext (SCARDCONTEXT)
 Removes an Application Context from a control vector. More...

LONG SCardAddHandle (SCARDHANDLE, DWORD, LPSTR)
LONG SCardGetIndicesFromHandle (SCARDHANDLE, PDWORD, PDWORD)
LONG SCardGetIndicesFromHandleTH (SCARDHANDLE, PDWORD, PDWORD)
LONG SCardRemoveHandle (SCARDHANDLE)
LONG SCardGetSetAttrib (SCARDHANDLE hCard, int command, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
LONG SCardCheckDaemonAvailability (void)
 Checks if the Server is running. More...

LONG SCardLockThread (void)
 This function locks a mutex so another thread must wait to use this function. More...

LONG SCardUnlockThread (void)
 This function unlocks a mutex so another thread may use the client. More...

LONG SCardEstablishContextTH (DWORD, LPCVOID, LPCVOID, LPSCARDCONTEXT)
 Creates a communication context to the PC/SC Resource Manager. More...

LONG SCardEstablishContext (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
 Creates an Application Context to the PC/SC Resource Manager. More...

LONG SCardReleaseContext (SCARDCONTEXT hContext)
 This function destroys a communication context to the PC/SC Resource Manager. This must be the last function called in a PC/SC application. More...

LONG SCardSetTimeout (SCARDCONTEXT hContext, DWORD dwTimeout)
LONG SCardConnect (SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 This function establishes a connection to the friendly name of the reader specified in szReader. More...

LONG SCardReconnect (SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol)
 This function reestablishes a connection to a reader that was previously connected to using SCardConnect(). More...

LONG SCardDisconnect (SCARDHANDLE hCard, DWORD dwDisposition)
 This function terminates a connection to the connection made through SCardConnect(). More...

LONG SCardBeginTransaction (SCARDHANDLE hCard)
 This function establishes a temporary exclusive access mode for doing a series of commands or transaction. More...

LONG SCardEndTransaction (SCARDHANDLE hCard, DWORD dwDisposition)
 This function ends a previously begun transaction. More...

LONG SCardCancelTransaction (SCARDHANDLE hCard)
LONG SCardStatus (SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 This function returns the current status of the reader connected to by hCard. More...

LONG SCardGetStatusChange (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders)
 This function receives a structure or list of structures containing reader names. It then blocks for a change in state to occur on any of the OR'd values contained in dwCurrentState for a maximum blocking time of dwTimeout or forever if INFINITE is used. More...

LONG SCardControl (SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned)
 This function sends a command directly to the IFD Handler to be processed by the reader. More...

LONG SCardGetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
 This function get an attribute from the IFD Handler. More...

LONG SCardSetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen)
 This function set an attribute of the IFD Handler. More...

LONG SCardTransmit (SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)
 This function sends an APDU to the smart card contained in the reader connected to by SCardConnect(). More...

LONG SCardListReaders (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders)
 This function returns a list of currently available readers on the system. More...

LONG SCardListReaderGroups (SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups)
 This function returns a list of currently available reader groups on the system. mszGroups is a pointer to a character string that is allocated by the application. If the application sends mszGroups as NULL then this function will return the size of the buffer needed to allocate in pcchGroups. More...

LONG SCardCancel (SCARDCONTEXT hContext)
 This function cancels all pending blocking requests on the SCardGetStatusChange() function. More...

LONG SCardIsValidContext (SCARDCONTEXT hContext)
 check if a SCARDCONTEXT is valid. More...

void DESTRUCTOR SCardUnload (void)
 free resources allocated by the library You _shall_ call this function if you use dlopen/dlclose to load/unload the library. More...


Variables

_psContextMap psContextMap [PCSCLITE_MAX_APPLICATION_CONTEXTS]
 Represents the an Application Context on the Client side. More...

short isExecuted = 0
 Make sure the initialization code is executed only once.

int mapAddr = 0
 Memory mapped address used to read status information about the readers. More...

PCSCLITE_MUTEX clientMutex = PTHREAD_MUTEX_INITIALIZER
 Ensure that some functions be accessed in thread-safe mode. More...

PREADER_STATE readerStates [PCSCLITE_MAX_READERS_CONTEXTS]
 Pointers to a memory mapped area used to read status information about the readers. More...

PCSC_API SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }
PCSC_API SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }
PCSC_API SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }


Detailed Description

This handles smartcard reader communications and forwarding requests over message queues.

Here is exposed the API for client applications.

Definition in file winscard_clnt.c.


Function Documentation

LONG SCardAddContext SCARDCONTEXT    hContext,
DWORD    dwClientID
[static]
 

Adds an Application Context to the vector psContextMap.

am[in] hContext Application Context ID.
am[in] dwClientID Client connection ID.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Success (SCARD_S_SUCCESS)
SCARD_E_NO_MEMORY  There is no free slot to store hContext (SCARD_E_NO_MEMORY)

Definition at line 3119 of file winscard_clnt.c.

References _psContextMap::contextBlockStatus, _psContextMap::dwClientID, _psContextMap::hContext, _psContextMap::mMutex, PCSCLITE_MAX_APPLICATION_CONTEXTS, psContextMap, SCardAddContext, and SYS_MutexInit.

Referenced by SCardAddContext, and SCardEstablishContextTH.

LONG SCardBeginTransaction SCARDHANDLE    hCard
 

This function establishes a temporary exclusive access mode for doing a series of commands or transaction.

You might want to use this when you are selecting a few files and then writing a large file so you can make sure that another application will not change the current file. If another application has a lock on this reader or this application is in SCARD_SHARE_EXCLUSIVE there will be no action taken.

am[in] hCard Connection made from SCardConnect.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_SHARING_VIOLATION  Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION)
SCARD_E_READER_UNAVAILABLE  The reader has been removed (SCARD_E_READER_UNAVAILABLE)
Test:
SCARDCONTEXT hContext;  SCARDHANDLE hCard;  DWORD dwActiveProtocol;  LONG rv;  ...  rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);  rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0, &hCard, &dwActiveProtocol);  rv = SCardBeginTransaction(hCard);  ...  / * Do some transmit commands * /

Definition at line 1017 of file winscard_clnt.c.

References rxSharedSegment::data, begin_struct::hCard, _psContextMap::psChannelMap, psContextMap, begin_struct::rv, SCardBeginTransaction, SCardCheckDaemonAvailability, SYS_MutexLock, SYS_MutexUnLock, and SYS_USleep.

Referenced by SCardBeginTransaction.

LONG SCardCancel SCARDCONTEXT    hContext
 

This function cancels all pending blocking requests on the SCardGetStatusChange() function.

am[in] hContext Connection context to the PC/SC Resource Manager.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hContext handle (SCARD_E_INVALID_HANDLE)
Test:

Definition at line 3037 of file winscard_clnt.c.

References _psContextMap::contextBlockStatus, psContextMap, SCardCancel, and SCardGetContextIndice.

Referenced by SCardCancel.

LONG SCardCancelTransaction SCARDHANDLE    hCard
 

Deprecated:
This function is not in Microsoft(R) WinSCard API and is deprecated in pcsc-lite API.

Definition at line 1258 of file winscard_clnt.c.

References rxSharedSegment::data, cancel_struct::hCard, _psContextMap::psChannelMap, psContextMap, cancel_struct::rv, SCardCancelTransaction, SCardCheckDaemonAvailability, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardCancelTransaction.

LONG SCardCheckDaemonAvailability void    [static]
 

Checks if the Server is running.

Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Server is running (SCARD_S_SUCCESS)
SCARD_E_NO_SERVICE  Server is not running (SCARD_E_NO_SERVICE)

Definition at line 3340 of file winscard_clnt.c.

Referenced by SCardBeginTransaction, SCardCancelTransaction, SCardConnect, SCardControl, SCardDisconnect, SCardEndTransaction, SCardEstablishContextTH, SCardGetStatusChange, SCardListReaderGroups, SCardListReaders, SCardReconnect, SCardReleaseContext, SCardStatus, and SCardTransmit.

LONG SCardConnect SCARDCONTEXT    hContext,
LPCSTR    szReader,
DWORD    dwShareMode,
DWORD    dwPreferredProtocols,
LPSCARDHANDLE    phCard,
LPDWORD    pdwActiveProtocol
 

This function establishes a connection to the friendly name of the reader specified in szReader.

The first connection will power up and perform a reset on the card.

am[in] hContext Connection context to the PC/SC Resource Manager.
am[in] szReader Reader name to connect to.
am[in] dwShareMode Mode of connection type: exclusive or shared.
  • SCARD_SHARE_SHARED - This application will allow others to share the reader.
  • SCARD_SHARE_EXCLUSIVE - This application will NOT allow others to share the reader.
  • SCARD_SHARE_DIRECT - Direct control of the reader, even without a card. SCARD_SHARE_DIRECT can be used before using SCardControl() to send control commands to the reader even if a card is not present in the reader.
am[in] dwPreferredProtocols Desired protocol use.
  • SCARD_PROTOCOL_T0 - Use the T=0 protocol.
  • SCARD_PROTOCOL_T1 - Use the T=1 protocol.
  • SCARD_PROTOCOL_RAW - Use with memory type cards.
dwPreferredProtocols is a bit mask of acceptable protocols for the connection. You can use (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if you do not have a preferred protocol.
am[out] phCard Handle to this connection.
am[out] pdwActiveProtocol Established protocol to this connection.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hContext handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INVALID_VALUE  Invalid sharing mode, requested protocol, or reader name (SCARD_E_INVALID_VALUE)
SCARD_E_NOT_READY  Could not allocate the desired port (SCARD_E_NOT_READY)
SCARD_E_READER_UNAVAILABLE  Could not power up the reader or card (SCARD_E_READER_UNAVAILABLE)
SCARD_E_SHARING_VIOLATION  Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION)
SCARD_E_UNSUPPORTED_FEATURE  Protocol not supported (SCARD_E_UNSUPPORTED_FEATURE)
Test:

Definition at line 622 of file winscard_clnt.c.

References rxSharedSegment::data, connect_struct::dwPreferredProtocols, connect_struct::dwShareMode, connect_struct::hContext, connect_struct::pdwActiveProtocol, connect_struct::phCard, psContextMap, connect_struct::rv, SCARD_PROTOCOL_ANY_OLD, SCardCheckDaemonAvailability, SCardConnect, SCardGetContextIndice, SYS_MutexLock, SYS_MutexUnLock, and connect_struct::szReader.

Referenced by SCardConnect.

LONG SCardControl SCARDHANDLE    hCard,
DWORD    dwControlCode,
LPCVOID    pbSendBuffer,
DWORD    cbSendLength,
LPVOID    pbRecvBuffer,
DWORD    cbRecvLength,
LPDWORD    lpBytesReturned
 

This function sends a command directly to the IFD Handler to be processed by the reader.

This is useful for creating client side reader drivers for functions like PIN pads, biometrics, or other extensions to the normal smart card reader that are not normally handled by PC/SC.

Note:
the API of this function changed. In pcsc-lite 1.2.0 and before the API was not Windows(R) PC/SC compatible. This has been corrected.
am[in] hCard Connection made from SCardConnect.
am[in] dwControlCode Control code for the operation.\n
Click here for a list of supported commands by some drivers.
am[in] pbSendBuffer Command to send to the reader.
am[in] cbSendLength Length of the command.
am[out] pbRecvBuffer Response from the reader.
am[in] cbRecvLength Length of the response buffer.
am[out] lpBytesReturned Length of the response.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_NOT_TRANSACTED  Data exchange not successful (SCARD_E_NOT_TRANSACTED)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INVALID_VALUE  Invalid value was presented (SCARD_E_INVALID_VALUE)
SCARD_E_READER_UNAVAILABLE  The reader has been removed(SCARD_E_READER_UNAVAILABLE)
SCARD_W_RESET_CARD  The card has been reset by another application (SCARD_W_RESET_CARD)
SCARD_W_REMOVED_CARD  The card has been removed from the reader(SCARD_W_REMOVED_CARD)
Test:

Definition at line 2152 of file winscard_clnt.c.

References control_struct::cbRecvLength, control_struct_extended::cbRecvLength, control_struct::cbSendLength, control_struct_extended::cbSendLength, rxSharedSegment::data, control_struct_extended::data, control_struct::dwBytesReturned, _psContextMap::dwClientID, control_struct::dwControlCode, control_struct_extended::dwControlCode, control_struct::hCard, control_struct_extended::hCard, control_struct::pbRecvBuffer, control_struct::pbSendBuffer, _psContextMap::psChannelMap, psContextMap, control_struct::rv, SCardCheckDaemonAvailability, SCardControl, control_struct_extended::size, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardControl.

LONG SCardDisconnect SCARDHANDLE    hCard,
DWORD    dwDisposition
 

This function terminates a connection to the connection made through SCardConnect().

dwDisposition can have the following values:

am[in] hCard Connection made from SCardConnect.
am[in] dwDisposition Reader function to execute.
  • SCARD_LEAVE_CARD - Do nothing.
  • SCARD_RESET_CARD - Reset the card (warm reset).
  • SCARD_UNPOWER_CARD - Unpower the card (cold reset).
  • SCARD_EJECT_CARD - Eject the card.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful(SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INVALID_VALUE  - Invalid dwDisposition (SCARD_E_INVALID_VALUE)
Test:

Definition at line 919 of file winscard_clnt.c.

References rxSharedSegment::data, disconnect_struct::dwDisposition, disconnect_struct::hCard, psContextMap, disconnect_struct::rv, SCardCheckDaemonAvailability, SCardDisconnect, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardDisconnect.

LONG SCardEndTransaction SCARDHANDLE    hCard,
DWORD    dwDisposition
 

This function ends a previously begun transaction.

The calling application must be the owner of the previously begun transaction or an error will occur.

am[in] hCard Connection made from SCardConnect.
am[in] dwDisposition Action to be taken on the reader.
The disposition action is not currently used in this release.
  • SCARD_LEAVE_CARD - Do nothing.
  • SCARD_RESET_CARD - Reset the card.
  • SCARD_UNPOWER_CARD - Unpower the card.
  • SCARD_EJECT_CARD - Eject the card.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_SHARING_VIOLATION  Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION)
SCARD_E_READER_UNAVAILABLE  The reader has been removed (SCARD_E_READER_UNAVAILABLE)
Test:

Definition at line 1163 of file winscard_clnt.c.

References rxSharedSegment::data, end_struct::dwDisposition, end_struct::hCard, _psContextMap::psChannelMap, psContextMap, end_struct::rv, SCardCheckDaemonAvailability, SCardEndTransaction, SYS_MutexLock, SYS_MutexUnLock, and SYS_USleep.

Referenced by SCardEndTransaction.

LONG SCardEstablishContext DWORD    dwScope,
LPCVOID    pvReserved1,
LPCVOID    pvReserved2,
LPSCARDCONTEXT    phContext
 

Creates an Application Context to the PC/SC Resource Manager.

This must be the first function called in a PC/SC application. This is a thread-safe wrapper to the function SCardEstablishContextTH().

am[in] dwScope Scope of the establishment.
This can either be a local or remote connection.
  • SCARD_SCOPE_USER - Not used.
  • SCARD_SCOPE_TERMINAL - Not used.
  • SCARD_SCOPE_GLOBAL - Not used.
  • SCARD_SCOPE_SYSTEM - Services on the local machine.
am[in] pvReserved1 Reserved for future use. Can be used for remote connection.
am[in] pvReserved2 Reserved for future use.
am[out] phContext Returned Application Context.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_NO_SERVICE  The server is not runing (SCARD_E_NO_SERVICE)
SCARD_E_INVALID_VALUE  Invalid scope type passed (SCARD_E_INVALID_VALUE )
SCARD_E_INVALID_PARAMETER  phContext is null (SCARD_E_INVALID_PARAMETER)
Test:

Definition at line 237 of file winscard_clnt.c.

References SCardEstablishContext, SCardEstablishContextTH, SCardLockThread, and SCardUnlockThread.

Referenced by SCardEstablishContext.

LONG SCardEstablishContextTH DWORD    dwScope,
LPCVOID    pvReserved1,
LPCVOID    pvReserved2,
LPSCARDCONTEXT    phContext
[static]
 

Creates a communication context to the PC/SC Resource Manager.

This function shuld not be called directly. Instead, the thread-safe function SCardEstablishContext() should be called.

am[in] dwScope Scope of the establishment.
This can either be a local or remote connection.
  • SCARD_SCOPE_USER - Not used.
  • SCARD_SCOPE_TERMINAL - Not used.
  • SCARD_SCOPE_GLOBAL - Not used.
  • SCARD_SCOPE_SYSTEM - Services on the local machine.
am[in] pvReserved1 Reserved for future use. Can be used for remote connection.
am[in] pvReserved2 Reserved for future use.
am[out] phContext Returned reference to this connection.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_NO_SERVICE  The server is not runing (SCARD_E_NO_SERVICE)
SCARD_E_INVALID_PARAMETER  phContext is null. (SCARD_E_INVALID_PARAMETER)
SCARD_E_INVALID_VALUE  Invalid scope type passed (SCARD_E_INVALID_VALUE)

Definition at line 279 of file winscard_clnt.c.

References rxSharedSegment::command, _psContextMap::contextBlockStatus, rxSharedSegment::data, rxSharedSegment::date, _psContextMap::dwClientID, establish_struct::dwScope, rxSharedSegment::group_id, _psContextMap::hContext, isExecuted, version_struct::major, mapAddr, version_struct::minor, _psContextMap::mMutex, rxSharedSegment::mtype, PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS, PCSCLITE_MAX_APPLICATION_CONTEXTS, establish_struct::phContext, PROTOCOL_VERSION_MAJOR, PROTOCOL_VERSION_MINOR, _psContextMap::psChannelMap, psContextMap, establish_struct::rv, version_struct::rv, SCardAddContext, SCardCheckDaemonAvailability, SCardEstablishContextTH, SYS_CloseFile, SYS_GetPageSize, SYS_Initialize, SYS_OpenFile, SYS_PublicMemoryMap, and rxSharedSegment::user_id.

Referenced by SCardEstablishContext, and SCardEstablishContextTH.

LONG SCardGetAttrib SCARDHANDLE    hCard,
DWORD    dwAttrId,
LPBYTE    pbAttr,
LPDWORD    pcbAttrLen
 

This function get an attribute from the IFD Handler.

The list of possible attributes is available in the file pcsclite.h.

am[in] hCard Connection made from SCardConnect().
am[in] dwAttrId Identifier for the attribute to get.
  • SCARD_ATTR_ASYNC_PROTOCOL_TYPES
  • SCARD_ATTR_ATR_STRING
  • SCARD_ATTR_CHANNEL_ID
  • SCARD_ATTR_CHARACTERISTICS
  • SCARD_ATTR_CURRENT_BWT
  • SCARD_ATTR_CURRENT_CLK
  • SCARD_ATTR_CURRENT_CWT
  • SCARD_ATTR_CURRENT_D
  • SCARD_ATTR_CURRENT_EBC_ENCODING
  • SCARD_ATTR_CURRENT_F
  • SCARD_ATTR_CURRENT_IFSC
  • SCARD_ATTR_CURRENT_IFSD
  • SCARD_ATTR_CURRENT_IO_STATE
  • SCARD_ATTR_CURRENT_N
  • SCARD_ATTR_CURRENT_PROTOCOL_TYPE
  • SCARD_ATTR_CURRENT_W
  • SCARD_ATTR_DEFAULT_CLK
  • SCARD_ATTR_DEFAULT_DATA_RATE
  • SCARD_ATTR_DEVICE_FRIENDLY_NAME_A
  • SCARD_ATTR_DEVICE_FRIENDLY_NAME_W
  • SCARD_ATTR_DEVICE_IN_USE
  • SCARD_ATTR_DEVICE_SYSTEM_NAME_A
  • SCARD_ATTR_DEVICE_SYSTEM_NAME_W
  • SCARD_ATTR_DEVICE_UNIT
  • SCARD_ATTR_ESC_AUTHREQUEST
  • SCARD_ATTR_ESC_CANCEL
  • SCARD_ATTR_ESC_RESET
  • SCARD_ATTR_EXTENDED_BWT
  • SCARD_ATTR_ICC_INTERFACE_STATUS
  • SCARD_ATTR_ICC_PRESENCE
  • SCARD_ATTR_ICC_TYPE_PER_ATR
  • SCARD_ATTR_MAX_CLK
  • SCARD_ATTR_MAX_DATA_RATE
  • SCARD_ATTR_MAX_IFSD
  • SCARD_ATTR_MAXINPUT
  • SCARD_ATTR_POWER_MGMT_SUPPORT
  • SCARD_ATTR_SUPRESS_T1_IFS_REQUEST
  • SCARD_ATTR_SYNC_PROTOCOL_TYPES
  • SCARD_ATTR_USER_AUTH_INPUT_DEVICE
  • SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE
  • SCARD_ATTR_VENDOR_IFD_SERIAL_NO
  • SCARD_ATTR_VENDOR_IFD_TYPE
  • SCARD_ATTR_VENDOR_IFD_VERSION
  • SCARD_ATTR_VENDOR_NAME
Not all the dwAttrId values listed above may be implemented in the IFD Handler you are using. And some dwAttrId values not listed here may be implemented.
am[out] pbAttr Pointer to a buffer that receives the attribute.
Parameters:
pcbAttrLen  [inout] Length of the pbAttr buffer in bytes.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_NOT_TRANSACTED  Data exchange not successful (SCARD_E_NOT_TRANSACTED)
SCARD_E_INSUFFICIENT_BUFFER  Reader buffer not large enough (SCARD_E_INSUFFICIENT_BUFFER)
Test:

Definition at line 2406 of file winscard_clnt.c.

References SCardGetAttrib.

Referenced by SCardGetAttrib.

LONG SCardGetContextIndice SCARDCONTEXT    hContext [static]
 

Get the index from the Application Context vector psContextMap for the passed context.

This function is a thread-safe wrapper to the function SCardGetContextIndiceTH().

am[in] hContext Application Context whose index will be find.
Returns:
Index corresponding to the Application Context or -1 if it is not found.

Definition at line 3151 of file winscard_clnt.c.

References SCardGetContextIndice, SCardGetContextIndiceTH, SCardLockThread, and SCardUnlockThread.

Referenced by SCardCancel, SCardConnect, SCardGetContextIndice, SCardGetStatusChange, SCardIsValidContext, SCardListReaderGroups, SCardListReaders, and SCardReleaseContext.

LONG SCardGetContextIndiceTH SCARDCONTEXT    hContext [static]
 

Get the index from the Application Context vector psContextMap for the passed context.

This functions is not thread-safe and should not be called. Instead, call the function SCardGetContextIndice().

am[in] hContext Application Context whose index will be find.
Returns:
Index corresponding to the Application Context or -1 if it is not found.

Definition at line 3174 of file winscard_clnt.c.

References _psContextMap::hContext, PCSCLITE_MAX_APPLICATION_CONTEXTS, and psContextMap.

Referenced by SCardGetContextIndice, and SCardRemoveContext.

LONG SCardGetStatusChange SCARDCONTEXT    hContext,
DWORD    dwTimeout,
LPSCARD_READERSTATE_A    rgReaderStates,
DWORD    cReaders
 

This function receives a structure or list of structures containing reader names. It then blocks for a change in state to occur on any of the OR'd values contained in dwCurrentState for a maximum blocking time of dwTimeout or forever if INFINITE is used.

The new event state will be contained in dwEventState. A status change might be a card insertion or removal event, a change in ATR, etc.

This function will block for reader availability if cReaders is equal to zero and rgReaderStates is NULL.

 typedef struct {
   LPCSTR szReader;          // Reader name
   LPVOID pvUserData;         // User defined data
   DWORD dwCurrentState;      // Current state of reader
   DWORD dwEventState;        // Reader state after a state change
   DWORD cbAtr;               // ATR Length, usually MAX_ATR_SIZE
   BYTE rgbAtr[MAX_ATR_SIZE]; // ATR Value
 } SCARD_READERSTATE;
 ...
 typedef SCARD_READERSTATE *PSCARD_READERSTATE, **LPSCARD_READERSTATE;
 ...

Value of dwCurrentState and dwEventState:

  • SCARD_STATE_UNAWARE The application is unaware of the current state, and would like to know. The use of this value results in an immediate return from state transition monitoring services. This is represented by all bits set to zero.
  • SCARD_STATE_IGNORE This reader should be ignored
  • SCARD_STATE_CHANGED There is a difference between the state believed by the application, and the state known by the resource manager. When this bit is set, the application may assume a significant state change has occurred on this reader.
  • SCARD_STATE_UNKNOWN The given reader name is not recognized by the resource manager. If this bit is set, then SCARD_STATE_CHANGED and SCARD_STATE_IGNORE will also be set
  • SCARD_STATE_UNAVAILABLE The actual state of this reader is not available. If this bit is set, then all the following bits are clear.
  • SCARD_STATE_EMPTY There is no card in the reader. If this bit is set, all the following bits will be clear
  • SCARD_STATE_PRESENT There is a card in the reader
  • SCARD_STATE_ATRMATCH There is a card in the reader with an ATR matching one of the target cards. If this bit is set, SCARD_STATE_PRESENT will also be set. This bit is only returned on the SCardLocateCards() function.
  • SCARD_STATE_EXCLUSIVE The card in the reader is allocated for exclusive use by another application. If this bit is set, SCARD_STATE_PRESENT will also be set.
  • SCARD_STATE_INUSE The card in the reader is in use by one or more other applications, but may be connected to in shared mode. If this bit is set, SCARD_STATE_PRESENT will also be set.
  • SCARD_STATE_MUTE There is an unresponsive card in the reader.
am[in] hContext Connection context to the PC/SC Resource Manager.
am[in] dwTimeout Maximum waiting time (in miliseconds) for status
change, zero (or INFINITE) for infinite.
Parameters:
rgReaderStates  [inout] Structures of readers with current states.
am[in] cReaders Number of structures.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_VALUE  Invalid States, reader name, etc (SCARD_E_INVALID_VALUE)
SCARD_E_INVALID_HANDLE  Invalid hContext handle (SCARD_E_INVALID_HANDLE)
SCARD_E_READER_UNAVAILABLE  The reader is unavailable (SCARD_E_READER_UNAVAILABLE)
Test:

Definition at line 1613 of file winscard_clnt.c.

References pubReaderStatesList::cardAtr, pubReaderStatesList::cardAtrLength, _psContextMap::contextBlockStatus, psContextMap, pubReaderStatesList::readerSharing, pubReaderStatesList::readerState, SCardCheckDaemonAvailability, SCardGetContextIndice, SCardGetStatusChange, SYS_MutexLock, SYS_MutexUnLock, and SYS_USleep.

Referenced by SCardGetStatusChange.

LONG SCardIsValidContext SCARDCONTEXT    hContext
 

check if a SCARDCONTEXT is valid.

Call this function to determine whether a smart card context handle is still valid. After a smart card context handle has been set by SCardEstablishContext, it may become not valid if the resource manager service has been shut down.

am[in] hContext Connection context to the PC/SC Resource Manager.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid Handle (SCARD_E_INVALID_HANDLE)
Test:

Definition at line 3082 of file winscard_clnt.c.

References SCardGetContextIndice.

LONG SCardListReaderGroups SCARDCONTEXT    hContext,
LPSTR    mszGroups,
LPDWORD    pcchGroups
 

This function returns a list of currently available reader groups on the system. mszGroups is a pointer to a character string that is allocated by the application. If the application sends mszGroups as NULL then this function will return the size of the buffer needed to allocate in pcchGroups.

The group names is a multi-string and separated by a nul character ('\0') and ended by a double nul character. "SCard$DefaultReaders\0Group 2\0\0".

am[in] hContext Connection context to the PC/SC Resource Manager.
am[out] mszGroups List of groups to list readers.
Parameters:
pcchGroups  [inout] Size of multi-string buffer including NULL's.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid Scope Handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INSUFFICIENT_BUFFER  Reader buffer not large enough (SCARD_E_INSUFFICIENT_BUFFER)
Test:

Definition at line 2966 of file winscard_clnt.c.

References psContextMap, SCardCheckDaemonAvailability, SCardGetContextIndice, SCardListReaderGroups, SYS_MutexLock, and SYS_MutexUnLock.

LONG SCardListReaders SCARDCONTEXT    hContext,
LPCSTR    mszGroups,
LPSTR    mszReaders,
LPDWORD    pcchReaders
 

This function returns a list of currently available readers on the system.

mszReaders is a pointer to a character string that is allocated by the application. If the application sends mszGroups and mszReaders as NULL then this function will return the size of the buffer needed to allocate in pcchReaders.

am[in] hContext Connection context to the PC/SC Resource Manager.
am[in] mszGroups List of groups to list readers (not used).
am[out] mszReaders Multi-string with list of readers.
Parameters:
pcchReaders  [inout] Size of multi-string buffer including NULL's.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid Scope Handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INSUFFICIENT_BUFFER  Reader buffer not large enough (SCARD_E_INSUFFICIENT_BUFFER)
Test:

Definition at line 2862 of file winscard_clnt.c.

References psContextMap, SCardCheckDaemonAvailability, SCardGetContextIndice, SCardListReaders, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardListReaders.

LONG SCardLockThread void    [inline, static]
 

This function locks a mutex so another thread must wait to use this function.

Wrapper to the function SYS_MutexLock().

Definition at line 3318 of file winscard_clnt.c.

References clientMutex, and SYS_MutexLock.

Referenced by SCardEstablishContext, SCardGetContextIndice, and SCardReleaseContext.

LONG SCardReconnect SCARDHANDLE    hCard,
DWORD    dwShareMode,
DWORD    dwPreferredProtocols,
DWORD    dwInitialization,
LPDWORD    pdwActiveProtocol
 

This function reestablishes a connection to a reader that was previously connected to using SCardConnect().

In a multi application environment it is possible for an application to reset the card in shared mode. When this occurs any other application trying to access certain commands will be returned the value SCARD_W_RESET_CARD. When this occurs SCardReconnect() must be called in order to acknowledge that the card was reset and allow it to change it's state accordingly.

am[in] hCard Handle to a previous call to connect.
am[in] dwShareMode Mode of connection type: exclusive/shared.
  • SCARD_SHARE_SHARED - This application will allow others to share the reader.
  • SCARD_SHARE_EXCLUSIVE - This application will NOT allow others to share the reader.
am[in] dwPreferredProtocols Desired protocol use.
  • SCARD_PROTOCOL_T0 - Use the T=0 protocol.
  • SCARD_PROTOCOL_T1 - Use the T=1 protocol.
  • SCARD_PROTOCOL_RAW - Use with memory type cards.
dwPreferredProtocols is a bit mask of acceptable protocols for the connection. You can use (SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if you do not have a preferred protocol.
am[in] dwInitialization Desired action taken on the card/reader.
  • SCARD_LEAVE_CARD - Do nothing.
  • SCARD_RESET_CARD - Reset the card (warm reset).
  • SCARD_UNPOWER_CARD - Unpower the card (cold reset).
  • SCARD_EJECT_CARD - Eject the card.
am[out] pdwActiveProtocol Established protocol to this connection.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_NOT_READY  Could not allocate the desired port (SCARD_E_NOT_READY)
SCARD_E_INVALID_VALUE  Invalid sharing mode, requested protocol, or reader name (SCARD_E_INVALID_VALUE)
SCARD_E_READER_UNAVAILABLE  The reader has been removed (SCARD_E_READER_UNAVAILABLE)
SCARD_E_UNSUPPORTED_FEATURE  Protocol not supported (SCARD_E_UNSUPPORTED_FEATURE)
SCARD_E_SHARING_VIOLATION  Someone else has exclusive rights (SCARD_E_SHARING_VIOLATION)
Test:

Definition at line 791 of file winscard_clnt.c.

References rxSharedSegment::data, reconnect_struct::dwInitialization, reconnect_struct::dwPreferredProtocols, reconnect_struct::dwShareMode, reconnect_struct::hCard, reconnect_struct::pdwActiveProtocol, _psContextMap::psChannelMap, psContextMap, reconnect_struct::rv, SCARD_PROTOCOL_ANY_OLD, SCardCheckDaemonAvailability, SCardReconnect, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardReconnect.

LONG SCardReleaseContext SCARDCONTEXT    hContext
 

This function destroys a communication context to the PC/SC Resource Manager. This must be the last function called in a PC/SC application.

am[in] hContext Connection context to be closed.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
Test:

Definition at line 491 of file winscard_clnt.c.

References rxSharedSegment::data, release_struct::hContext, psContextMap, release_struct::rv, SCardCheckDaemonAvailability, SCardGetContextIndice, SCardLockThread, SCardReleaseContext, SCardRemoveContext, SCardUnlockThread, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardReleaseContext.

LONG SCardRemoveContext SCARDCONTEXT    hContext [static]
 

Removes an Application Context from a control vector.

am[in] hContext Application Context to be removed.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Success (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  The context hContext was not found (SCARD_E_INVALID_HANDLE)

Definition at line 3199 of file winscard_clnt.c.

References _psContextMap::contextBlockStatus, _psContextMap::dwClientID, _psContextMap::hContext, _psContextMap::mMutex, PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS, _psContextMap::psChannelMap, psContextMap, SCardGetContextIndiceTH, and SCardRemoveContext.

Referenced by SCardReleaseContext, and SCardRemoveContext.

LONG SCardSetAttrib SCARDHANDLE    hCard,
DWORD    dwAttrId,
LPCBYTE    pbAttr,
DWORD    cbAttrLen
 

This function set an attribute of the IFD Handler.

The list of attributes you can set is dependent on the IFD Handler you are using.

am[in] hCard Connection made from SCardConnect().
am[in] dwAttrId Identifier for the attribute to set.
am[in] pbAttr Pointer to a buffer that receives the attribute.
am[in] cbAttrLen Length of the \p pbAttr buffer in bytes.
Returns:
Error code
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_NOT_TRANSACTED  Data exchange not successful (SCARD_E_NOT_TRANSACTED)
Test:

Definition at line 2455 of file winscard_clnt.c.

References SCardSetAttrib.

Referenced by SCardSetAttrib.

LONG SCardSetTimeout SCARDCONTEXT    hContext,
DWORD    dwTimeout
 

Deprecated:
This function is not in Microsoft(R) WinSCard API and is deprecated in pcsc-lite API. The function does not do anything except returning SCARD_S_SUCCESS.
am[in] hContext Connection context to the PC/SC Resource Manager.
am[in] dwTimeout New timeout value.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)

Definition at line 563 of file winscard_clnt.c.

LONG SCardStatus SCARDHANDLE    hCard,
LPSTR    mszReaderNames,
LPDWORD    pcchReaderLen,
LPDWORD    pdwState,
LPDWORD    pdwProtocol,
LPBYTE    pbAtr,
LPDWORD    pcbAtrLen
 

This function returns the current status of the reader connected to by hCard.

It's friendly name will be stored in szReaderName. pcchReaderLen will be the size of the allocated buffer for szReaderName, while pcbAtrLen will be the size of the allocated buffer for pbAtr. If either of these is too small, the function will return with SCARD_E_INSUFFICIENT_BUFFER and the necessary size in pcchReaderLen and pcbAtrLen. The current state, and protocol will be stored in pdwState and pdwProtocol respectively.

am[in] hCard Connection made from SCardConnect.
Parameters:
mszReaderNames  [inout] Friendly name of this reader.
pcchReaderLen  [inout] Size of the szReaderName multistring.
am[out] pdwState Current state of this reader. pdwState
is a DWORD possibly OR'd with the following values:
  • SCARD_ABSENT - There is no card in the reader.
  • SCARD_PRESENT - There is a card in the reader, but it has not been moved into position for use.
  • SCARD_SWALLOWED - There is a card in the reader in position for use. The card is not powered.
  • SCARD_POWERED - Power is being provided to the card, but the reader driver is unaware of the mode of the card.
  • SCARD_NEGOTIABLE - The card has been reset and is awaiting PTS negotiation.
  • SCARD_SPECIFIC - The card has been reset and specific communication protocols have been established.
am[out] pdwProtocol Current protocol of this reader.
  • SCARD_PROTOCOL_T0 Use the T=0 protocol.
  • SCARD_PROTOCOL_T1 Use the T=1 protocol.
am[out] pbAtr Current ATR of a card in this reader.
am[out] pcbAtrLen Length of ATR.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_INSUFFICIENT_BUFFER  Not enough allocated memory for szReaderName or for pbAtr (SCARD_E_INSUFFICIENT_BUFFER)
SCARD_E_READER_UNAVAILABLE  The reader has been removed (SCARD_E_READER_UNAVAILABLE)
Test:

Definition at line 1385 of file winscard_clnt.c.

References rxSharedSegment::data, status_struct::hCard, status_struct::mszReaderNames, status_struct::pbAtr, status_struct::pcbAtrLen, status_struct::pcchReaderLen, _psContextMap::psChannelMap, psContextMap, status_struct::rv, SCardCheckDaemonAvailability, SCardStatus, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardStatus.

LONG SCardTransmit SCARDHANDLE    hCard,
LPCSCARD_IO_REQUEST    pioSendPci,
LPCBYTE    pbSendBuffer,
DWORD    cbSendLength,
LPSCARD_IO_REQUEST    pioRecvPci,
LPBYTE    pbRecvBuffer,
LPDWORD    pcbRecvLength
 

This function sends an APDU to the smart card contained in the reader connected to by SCardConnect().

The card responds from the APDU and stores this response in pbRecvBuffer and it's length in SpcbRecvLength. SSendPci and SRecvPci are structures containing the following:

 typedef struct {
    DWORD dwProtocol;    // SCARD_PROTOCOL_T0 or SCARD_PROTOCOL_T1
    DWORD cbPciLength;   // Length of this structure - not used
 } SCARD_IO_REQUEST;
am[in] hCard Connection made from SCardConnect().
Parameters:
pioSendPci  [inout] Structure of protocol information.
  • SCARD_PCI_T0 - Pre-defined T=0 PCI structure.
  • SCARD_PCI_T1 - Pre-defined T=1 PCI structure.
am[in] pbSendBuffer APDU to send to the card.
am[in] cbSendLength Length of the APDU.
Parameters:
pioRecvPci  [inout] Structure of protocol information.
am[out] pbRecvBuffer Response from the card.
Parameters:
pcbRecvLength  [inout] Length of the response.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS  Successful (SCARD_S_SUCCESS)
SCARD_E_INVALID_HANDLE  Invalid hCard handle (SCARD_E_INVALID_HANDLE)
SCARD_E_NOT_TRANSACTED  APDU exchange not successful (SCARD_E_NOT_TRANSACTED)
SCARD_E_PROTO_MISMATCH  Connect protocol is different than desired (SCARD_E_PROTO_MISMATCH)
SCARD_E_INVALID_VALUE  Invalid Protocol, reader name, etc (SCARD_E_INVALID_VALUE)
SCARD_E_READER_UNAVAILABLE  The reader has been removed (SCARD_E_READER_UNAVAILABLE)
SCARD_W_RESET_CARD  The card has been reset by another application (SCARD_W_RESET_CARD)
SCARD_W_REMOVED_CARD  The card has been removed from the reader (SCARD_W_REMOVED_CARD)
Test:

Definition at line 2623 of file winscard_clnt.c.

References transmit_struct::cbSendLength, transmit_struct_extended::cbSendLength, rxSharedSegment::data, transmit_struct_extended::data, _psContextMap::dwClientID, transmit_struct::hCard, transmit_struct_extended::hCard, transmit_struct::pbRecvBuffer, transmit_struct::pbSendBuffer, transmit_struct::pcbRecvLength, transmit_struct_extended::pcbRecvLength, transmit_struct::pioRecvPci, transmit_struct_extended::pioRecvPci, transmit_struct::pioSendPci, transmit_struct_extended::pioSendPci, _psContextMap::psChannelMap, psContextMap, transmit_struct::rv, SCardCheckDaemonAvailability, SCardTransmit, transmit_struct_extended::size, SYS_MutexLock, and SYS_MutexUnLock.

Referenced by SCardTransmit.

void DESTRUCTOR SCardUnload void   
 

free resources allocated by the library You _shall_ call this function if you use dlopen/dlclose to load/unload the library.

Otherwise you will exhaust the ressources available.

Definition at line 3365 of file winscard_clnt.c.

References isExecuted, mapAddr, PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS, SYS_CloseFile, and SYS_PublicMemoryUnmap.

LONG SCardUnlockThread void    [inline, static]
 

This function unlocks a mutex so another thread may use the client.

Wrapper to the function SYS_MutexUnLock().

Definition at line 3328 of file winscard_clnt.c.

References clientMutex, and SYS_MutexUnLock.

Referenced by SCardEstablishContext, SCardGetContextIndice, and SCardReleaseContext.


Variable Documentation

PCSCLITE_MUTEX clientMutex = PTHREAD_MUTEX_INITIALIZER [static]
 

Ensure that some functions be accessed in thread-safe mode.

These function's names finishes with "TH".

Definition at line 167 of file winscard_clnt.c.

Referenced by SCardLockThread, and SCardUnlockThread.

int mapAddr = 0 [static]
 

Memory mapped address used to read status information about the readers.

Each element in the vector readerStates makes references to a part of the memory mapped.

Definition at line 161 of file winscard_clnt.c.

Referenced by SCardEstablishContextTH, and SCardUnload.

struct _psContextMap psContextMap[PCSCLITE_MAX_APPLICATION_CONTEXTS] [static]
 

Represents the an Application Context on the Client side.

An Application Context contains Channels (_psChannelMap).

Referenced by SCardAddContext, SCardBeginTransaction, SCardCancel, SCardCancelTransaction, SCardConnect, SCardControl, SCardDisconnect, SCardEndTransaction, SCardEstablishContextTH, SCardGetContextIndiceTH, SCardGetStatusChange, SCardListReaderGroups, SCardListReaders, SCardReconnect, SCardReleaseContext, SCardRemoveContext, SCardStatus, and SCardTransmit.

PREADER_STATE readerStates[PCSCLITE_MAX_READERS_CONTEXTS] [static]
 

Pointers to a memory mapped area used to read status information about the readers.

Each element in the vector readerStates makes references to a part of the memory mapped mapAddr.

Definition at line 175 of file winscard_clnt.c.


Generated on Wed Apr 2 10:14:28 2008 for pcsc-lite by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002