FreeRDP
smartcard.c File Reference
#include <winpr/crt.h>
#include <winpr/library.h>
#include <winpr/smartcard.h>
#include <winpr/synch.h>
#include "smartcard.h"
#include "smartcard_inspect.h"

Macros

#define SCARDAPI_STUB_CALL_LONG(_name, ...)
 
#define SCARDAPI_STUB_CALL_HANDLE(_name, ...)
 
#define SCARDAPI_STUB_CALL_VOID(_name, ...)
 

Functions

static BOOL CALLBACK InitializeSCardApiStubs (PINIT_ONCE once, PVOID param, PVOID *context)
 
WINSCARDAPI LONG WINAPI SCardEstablishContext (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
 
WINSCARDAPI LONG WINAPI SCardReleaseContext (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI SCardIsValidContext (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI SCardListReaderGroupsA (SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups)
 
WINSCARDAPI LONG WINAPI SCardListReaderGroupsW (SCARDCONTEXT hContext, LPWSTR mszGroups, LPDWORD pcchGroups)
 
WINSCARDAPI LONG WINAPI SCardListReadersA (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI SCardListReadersW (SCARDCONTEXT hContext, LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI SCardListCardsA (SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR *mszCards, LPDWORD pcchCards)
 
WINSCARDAPI LONG WINAPI SCardListCardsW (SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR *mszCards, LPDWORD pcchCards)
 
WINSCARDAPI LONG WINAPI SCardListInterfacesA (SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
 
WINSCARDAPI LONG WINAPI SCardListInterfacesW (SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
 
WINSCARDAPI LONG WINAPI SCardGetProviderIdA (SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidProviderId)
 
WINSCARDAPI LONG WINAPI SCardGetProviderIdW (SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidProviderId)
 
WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA (SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, CHAR *szProvider, LPDWORD pcchProvider)
 
WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW (SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, WCHAR *szProvider, LPDWORD pcchProvider)
 
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA (SCARDCONTEXT hContext, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW (SCARDCONTEXT hContext, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA (SCARDCONTEXT hContext, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW (SCARDCONTEXT hContext, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardIntroduceReaderA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szDeviceName)
 
WINSCARDAPI LONG WINAPI SCardIntroduceReaderW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szDeviceName)
 
WINSCARDAPI LONG WINAPI SCardForgetReaderA (SCARDCONTEXT hContext, LPCSTR szReaderName)
 
WINSCARDAPI LONG WINAPI SCardForgetReaderW (SCARDCONTEXT hContext, LPCWSTR szReaderName)
 
WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA (SCARDCONTEXT hContext, LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
 
WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW (SCARDCONTEXT hContext, LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
 
WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA (SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider)
 
WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW (SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider)
 
WINSCARDAPI LONG WINAPI SCardForgetCardTypeA (SCARDCONTEXT hContext, LPCSTR szCardName)
 
WINSCARDAPI LONG WINAPI SCardForgetCardTypeW (SCARDCONTEXT hContext, LPCWSTR szCardName)
 
WINSCARDAPI LONG WINAPI SCardFreeMemory (SCARDCONTEXT hContext, LPCVOID pvMem)
 
WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent (void)
 
WINSCARDAPI void WINAPI SCardReleaseStartedEvent (void)
 
WINSCARDAPI LONG WINAPI SCardLocateCardsA (SCARDCONTEXT hContext, LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardLocateCardsW (SCARDCONTEXT hContext, LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA (SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW (SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardGetStatusChangeA (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardGetStatusChangeW (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI SCardCancel (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI SCardConnectA (SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI SCardConnectW (SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI SCardReconnect (SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI SCardDisconnect (SCARDHANDLE hCard, DWORD dwDisposition)
 
WINSCARDAPI LONG WINAPI SCardBeginTransaction (SCARDHANDLE hCard)
 
WINSCARDAPI LONG WINAPI SCardEndTransaction (SCARDHANDLE hCard, DWORD dwDisposition)
 
WINSCARDAPI LONG WINAPI SCardCancelTransaction (SCARDHANDLE hCard)
 
WINSCARDAPI LONG WINAPI SCardState (SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI SCardStatusA (SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI SCardStatusW (SCARDHANDLE hCard, LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI SCardTransmit (SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)
 
WINSCARDAPI LONG WINAPI SCardGetTransmitCount (SCARDHANDLE hCard, LPDWORD pcTransmitCount)
 
WINSCARDAPI LONG WINAPI SCardControl (SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned)
 
WINSCARDAPI LONG WINAPI SCardGetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
 
WINSCARDAPI LONG WINAPI SCardSetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen)
 
WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA (LPOPENCARDNAMEA_EX pDlgStruc)
 
WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW (LPOPENCARDNAMEW_EX pDlgStruc)
 
WINSCARDAPI LONG WINAPI GetOpenCardNameA (LPOPENCARDNAMEA pDlgStruc)
 
WINSCARDAPI LONG WINAPI GetOpenCardNameW (LPOPENCARDNAMEW pDlgStruc)
 
WINSCARDAPI LONG WINAPI SCardDlgExtendedError (void)
 
WINSCARDAPI LONG WINAPI SCardReadCacheA (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD *DataLen)
 
WINSCARDAPI LONG WINAPI SCardReadCacheW (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD *DataLen)
 
WINSCARDAPI LONG WINAPI SCardWriteCacheA (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen)
 
WINSCARDAPI LONG WINAPI SCardWriteCacheW (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen)
 
WINSCARDAPI LONG WINAPI SCardGetReaderIconA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon)
 
WINSCARDAPI LONG WINAPI SCardGetReaderIconW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon)
 
WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPDWORD pdwDeviceTypeId)
 
WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPDWORD pdwDeviceTypeId)
 
WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId)
 
WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId)
 
WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA (SCARDCONTEXT hContext, LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW (SCARDCONTEXT hContext, LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI SCardAudit (SCARDCONTEXT hContext, DWORD dwEvent)
 
WINSCARDAPI const char *WINAPI SCardGetErrorString (LONG errorCode)
 
WINSCARDAPI const char *WINAPI SCardGetAttributeString (DWORD dwAttrId)
 
WINSCARDAPI const char *WINAPI SCardGetProtocolString (DWORD dwProtocols)
 
WINSCARDAPI const char *WINAPI SCardGetShareModeString (DWORD dwShareMode)
 
WINSCARDAPI const char *WINAPI SCardGetDispositionString (DWORD dwDisposition)
 
WINSCARDAPI const char *WINAPI SCardGetScopeString (DWORD dwScope)
 
WINSCARDAPI const char *WINAPI SCardGetCardStateString (DWORD dwCardState)
 
WINSCARDAPI char *WINAPI SCardGetReaderStateString (DWORD dwReaderState)
 

Variables

static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
 
static PSCardApiFunctionTable g_SCardApi = NULL
 
const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }
 
const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }
 
const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }
 

Macro Definition Documentation

#define SCARDAPI_STUB_CALL_HANDLE (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn ## _name) \
return g_SCardApi->pfn ## _name ( __VA_ARGS__ )
static INIT_ONCE g_Initialized
Definition: smartcard.c:33
return(void *)((char *) buffer-> buffer+buffer->tail)
static PSCardApiFunctionTable g_SCardApi
Definition: smartcard.c:34
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
static BOOL CALLBACK InitializeSCardApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: smartcard.c:62
#define SCARDAPI_STUB_CALL_LONG (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn ## _name) \
return g_SCardApi->pfn ## _name ( __VA_ARGS__ )
static INIT_ONCE g_Initialized
Definition: smartcard.c:33
#define SCARD_E_NO_SERVICE
Definition: include/winpr/smartcard.h:65
return(void *)((char *) buffer-> buffer+buffer->tail)
static PSCardApiFunctionTable g_SCardApi
Definition: smartcard.c:34
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
static BOOL CALLBACK InitializeSCardApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: smartcard.c:62
#define SCARDAPI_STUB_CALL_VOID (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn ## _name) \
g_SCardApi->pfn ## _name ( __VA_ARGS__ )
static INIT_ONCE g_Initialized
Definition: smartcard.c:33
return(void *)((char *) buffer-> buffer+buffer->tail)
static PSCardApiFunctionTable g_SCardApi
Definition: smartcard.c:34
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:322
if availableBytes return NULL
Definition: TPCircularBuffer.h:104
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
static BOOL CALLBACK InitializeSCardApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: smartcard.c:62

Function Documentation

WINSCARDAPI LONG WINAPI GetOpenCardNameA ( LPOPENCARDNAMEA  pDlgStruc)
WINSCARDAPI LONG WINAPI GetOpenCardNameW ( LPOPENCARDNAMEW  pDlgStruc)
static BOOL CALLBACK InitializeSCardApiStubs ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static

Here is the call graph for this function:

WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent ( void  )

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardAudit ( SCARDCONTEXT  hContext,
DWORD  dwEvent 
)
WINSCARDAPI LONG WINAPI SCardBeginTransaction ( SCARDHANDLE  hCard)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardCancel ( SCARDCONTEXT  hContext)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardCancelTransaction ( SCARDHANDLE  hCard)
WINSCARDAPI LONG WINAPI SCardConnectA ( SCARDCONTEXT  hContext,
LPCSTR  szReader,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
LPSCARDHANDLE  phCard,
LPDWORD  pdwActiveProtocol 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardConnectW ( SCARDCONTEXT  hContext,
LPCWSTR  szReader,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
LPSCARDHANDLE  phCard,
LPDWORD  pdwActiveProtocol 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardControl ( SCARDHANDLE  hCard,
DWORD  dwControlCode,
LPCVOID  lpInBuffer,
DWORD  cbInBufferSize,
LPVOID  lpOutBuffer,
DWORD  cbOutBufferSize,
LPDWORD  lpBytesReturned 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardDisconnect ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardDlgExtendedError ( void  )
WINSCARDAPI LONG WINAPI SCardEndTransaction ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardEstablishContext ( DWORD  dwScope,
LPCVOID  pvReserved1,
LPCVOID  pvReserved2,
LPSCARDCONTEXT  phContext 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardForgetCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName 
)
WINSCARDAPI LONG WINAPI SCardForgetCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName 
)
WINSCARDAPI LONG WINAPI SCardForgetReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName 
)
WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardForgetReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName 
)
WINSCARDAPI LONG WINAPI SCardFreeMemory ( SCARDCONTEXT  hContext,
LPCVOID  pvMem 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPBYTE  pbAttr,
LPDWORD  pcbAttrLen 
)

Here is the caller graph for this function:

WINSCARDAPI const char* WINAPI SCardGetAttributeString ( DWORD  dwAttrId)

Here is the caller graph for this function:

WINSCARDAPI const char* WINAPI SCardGetCardStateString ( DWORD  dwCardState)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
CHAR *  szProvider,
LPDWORD  pcchProvider 
)
WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
WCHAR *  szProvider,
LPDWORD  pcchProvider 
)
WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
WINSCARDAPI const char* WINAPI SCardGetDispositionString ( DWORD  dwDisposition)

Here is the caller graph for this function:

WINSCARDAPI const char* WINAPI SCardGetErrorString ( LONG  errorCode)

Extended API

WINSCARDAPI const char* WINAPI SCardGetProtocolString ( DWORD  dwProtocols)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetProviderIdA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidProviderId 
)
WINSCARDAPI LONG WINAPI SCardGetProviderIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidProviderId 
)
WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPWSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
WINSCARDAPI LONG WINAPI SCardGetReaderIconA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
WINSCARDAPI LONG WINAPI SCardGetReaderIconW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
WINSCARDAPI char* WINAPI SCardGetReaderStateString ( DWORD  dwReaderState)

Here is the caller graph for this function:

WINSCARDAPI const char* WINAPI SCardGetScopeString ( DWORD  dwScope)

Here is the caller graph for this function:

WINSCARDAPI const char* WINAPI SCardGetShareModeString ( DWORD  dwShareMode)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetStatusChangeA ( SCARDCONTEXT  hContext,
DWORD  dwTimeout,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetStatusChangeW ( SCARDCONTEXT  hContext,
DWORD  dwTimeout,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardGetTransmitCount ( SCARDHANDLE  hCard,
LPDWORD  pcTransmitCount 
)
WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
WINSCARDAPI LONG WINAPI SCardIntroduceReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szDeviceName 
)
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardIntroduceReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szDeviceName 
)
WINSCARDAPI LONG WINAPI SCardIsValidContext ( SCARDCONTEXT  hContext)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardListCardsA ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
CHAR *  mszCards,
LPDWORD  pcchCards 
)
WINSCARDAPI LONG WINAPI SCardListCardsW ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
WCHAR *  mszCards,
LPDWORD  pcchCards 
)
WINSCARDAPI LONG WINAPI SCardListInterfacesA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
WINSCARDAPI LONG WINAPI SCardListInterfacesW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
WINSCARDAPI LONG WINAPI SCardListReaderGroupsA ( SCARDCONTEXT  hContext,
LPSTR  mszGroups,
LPDWORD  pcchGroups 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardListReaderGroupsW ( SCARDCONTEXT  hContext,
LPWSTR  mszGroups,
LPDWORD  pcchGroups 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardListReadersA ( SCARDCONTEXT  hContext,
LPCSTR  mszGroups,
LPSTR  mszReaders,
LPDWORD  pcchReaders 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardListReadersW ( SCARDCONTEXT  hContext,
LPCWSTR  mszGroups,
LPWSTR  mszReaders,
LPDWORD  pcchReaders 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szDeviceInstanceId,
LPSTR  mszReaders,
LPDWORD  pcchReaders 
)
WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szDeviceInstanceId,
LPWSTR  mszReaders,
LPDWORD  pcchReaders 
)
WINSCARDAPI LONG WINAPI SCardLocateCardsA ( SCARDCONTEXT  hContext,
LPCSTR  mszCards,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI SCardLocateCardsW ( SCARDCONTEXT  hContext,
LPCWSTR  mszCards,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI SCardReadCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
WINSCARDAPI LONG WINAPI SCardReadCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
WINSCARDAPI LONG WINAPI SCardReconnect ( SCARDHANDLE  hCard,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
DWORD  dwInitialization,
LPDWORD  pdwActiveProtocol 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardReleaseContext ( SCARDCONTEXT  hContext)

Here is the caller graph for this function:

WINSCARDAPI void WINAPI SCardReleaseStartedEvent ( void  )

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI SCardSetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPCBYTE  pbAttr,
DWORD  cbAttrLen 
)
WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
LPCSTR  szProvider 
)
WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
LPCWSTR  szProvider 
)
WINSCARDAPI LONG WINAPI SCardState ( SCARDHANDLE  hCard,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardStatusA ( SCARDHANDLE  hCard,
LPSTR  mszReaderNames,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardStatusW ( SCARDHANDLE  hCard,
LPWSTR  mszReaderNames,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)

Here is the caller graph for this function:

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

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA ( LPOPENCARDNAMEA_EX  pDlgStruc)
WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW ( LPOPENCARDNAMEW_EX  pDlgStruc)
WINSCARDAPI LONG WINAPI SCardWriteCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)
WINSCARDAPI LONG WINAPI SCardWriteCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)

Variable Documentation

INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
static

WinPR: Windows Portable Runtime Smart Card API

Copyright 2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }
const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }

Standard Windows Smart Card API

const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }
PSCardApiFunctionTable g_SCardApi = NULL
static