FreeRDP
smartcard.c File Reference
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/library.h>
#include <winpr/smartcard.h>
#include <winpr/synch.h>
#include <winpr/wlog.h>
#include <winpr/assert.h>
#include "../log.h"
#include "smartcard.h"

Macros

#define TAG   WINPR_TAG("smartcard")
 
#define xstr(s)   str(s)
 
#define str(s)   #s
 
#define SCARDAPI_STUB_CALL_LONG(_name, ...)
 
#define SCARDAPI_STUB_CALL_HANDLE(_name, ...)
 
#define SCARDAPI_STUB_CALL_VOID(_name, ...)
 
#define WINSCARD_LOAD_PROC(_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, LPVOID 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)
 
BOOL WinSCard_LoadApiTableFunctions (PSCardApiFunctionTable pWinSCardApiTable, HMODULE hWinSCardLibrary)
 
const SCardApiFunctionTableWinPR_GetSCardApiFunctionTable (void)
 

Variables

static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
 
static const SCardApiFunctionTableg_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 }
 
static const SCardApiFunctionTable WinPR_SCardApiFunctionTable
 

Macro Definition Documentation

◆ SCARDAPI_STUB_CALL_HANDLE

#define SCARDAPI_STUB_CALL_HANDLE (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
{ \
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
return NULL; \
} \
return g_SCardApi->pfn##_name(__VA_ARGS__)
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
#define InitOnceExecuteOnce
Definition: include/winpr/synch.h:388
static const SCardApiFunctionTable * g_SCardApi
Definition: smartcard.c:40
#define xstr(s)
Definition: smartcard.c:44
static BOOL CALLBACK InitializeSCardApiStubs(PINIT_ONCE once, PVOID param, PVOID *context)
Definition: smartcard.c:85
#define TAG
Definition: smartcard.c:42
static INIT_ONCE g_Initialized
Definition: smartcard.c:39

◆ SCARDAPI_STUB_CALL_LONG

#define SCARDAPI_STUB_CALL_LONG (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
{ \
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
} \
return g_SCardApi->pfn##_name(__VA_ARGS__)
#define SCARD_E_NO_SERVICE
Definition: include/winpr/smartcard.h:73

◆ SCARDAPI_STUB_CALL_VOID

#define SCARDAPI_STUB_CALL_VOID (   _name,
  ... 
)
Value:
if (!g_SCardApi || !g_SCardApi->pfn##_name) \
{ \
WLog_DBG(TAG, "Missing function pointer g_SCardApi=%p->" xstr(pfn##_name) "=%p", \
g_SCardApi, g_SCardApi ? g_SCardApi->pfn##_name : NULL); \
return; \
} \
g_SCardApi->pfn##_name(__VA_ARGS__)

◆ str

#define str (   s)    #s

◆ TAG

#define TAG   WINPR_TAG("smartcard")

◆ WINSCARD_LOAD_PROC

#define WINSCARD_LOAD_PROC (   _name,
  ... 
)
Value:
do \
{ \
WINPR_PRAGMA_DIAG_PUSH \
WINPR_PRAGMA_DIAG_IGNORED_PEDANTIC \
pWinSCardApiTable->pfn##_name = GetProcAddressAs(hWinSCardLibrary, #_name, fn##_name); \
WINPR_PRAGMA_DIAG_POP \
} while (0)
#define GetProcAddressAs(module, name, type)
Definition: library.h:88

◆ xstr

#define xstr (   s)    str(s)

Function Documentation

◆ GetOpenCardNameA()

WINSCARDAPI LONG WINAPI GetOpenCardNameA ( LPOPENCARDNAMEA  pDlgStruc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOpenCardNameW()

WINSCARDAPI LONG WINAPI GetOpenCardNameW ( LPOPENCARDNAMEW  pDlgStruc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeSCardApiStubs()

static BOOL CALLBACK InitializeSCardApiStubs ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static
Here is the call graph for this function:

◆ SCardAccessStartedEvent()

WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardAddReaderToGroupA()

WINSCARDAPI LONG WINAPI SCardAddReaderToGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardAddReaderToGroupW()

WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardAudit()

WINSCARDAPI LONG WINAPI SCardAudit ( SCARDCONTEXT  hContext,
DWORD  dwEvent 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardBeginTransaction()

WINSCARDAPI LONG WINAPI SCardBeginTransaction ( SCARDHANDLE  hCard)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardCancel()

WINSCARDAPI LONG WINAPI SCardCancel ( SCARDCONTEXT  hContext)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardCancelTransaction()

WINSCARDAPI LONG WINAPI SCardCancelTransaction ( SCARDHANDLE  hCard)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardConnectA()

WINSCARDAPI LONG WINAPI SCardConnectA ( SCARDCONTEXT  hContext,
LPCSTR  szReader,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
LPSCARDHANDLE  phCard,
LPDWORD  pdwActiveProtocol 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardConnectW()

WINSCARDAPI LONG WINAPI SCardConnectW ( SCARDCONTEXT  hContext,
LPCWSTR  szReader,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
LPSCARDHANDLE  phCard,
LPDWORD  pdwActiveProtocol 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardControl()

WINSCARDAPI LONG WINAPI SCardControl ( SCARDHANDLE  hCard,
DWORD  dwControlCode,
LPCVOID  lpInBuffer,
DWORD  cbInBufferSize,
LPVOID  lpOutBuffer,
DWORD  cbOutBufferSize,
LPDWORD  lpBytesReturned 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardDisconnect()

WINSCARDAPI LONG WINAPI SCardDisconnect ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardDlgExtendedError()

WINSCARDAPI LONG WINAPI SCardDlgExtendedError ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardEndTransaction()

WINSCARDAPI LONG WINAPI SCardEndTransaction ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardEstablishContext()

WINSCARDAPI LONG WINAPI SCardEstablishContext ( DWORD  dwScope,
LPCVOID  pvReserved1,
LPCVOID  pvReserved2,
LPSCARDCONTEXT  phContext 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetCardTypeA()

WINSCARDAPI LONG WINAPI SCardForgetCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetCardTypeW()

WINSCARDAPI LONG WINAPI SCardForgetCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetReaderA()

WINSCARDAPI LONG WINAPI SCardForgetReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetReaderGroupA()

WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetReaderGroupW()

WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardForgetReaderW()

WINSCARDAPI LONG WINAPI SCardForgetReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardFreeMemory()

WINSCARDAPI LONG WINAPI SCardFreeMemory ( SCARDCONTEXT  hContext,
LPVOID  pvMem 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetAttrib()

WINSCARDAPI LONG WINAPI SCardGetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPBYTE  pbAttr,
LPDWORD  pcbAttrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetAttributeString()

WINSCARDAPI const char* WINAPI SCardGetAttributeString ( DWORD  dwAttrId)
Here is the caller graph for this function:

◆ SCardGetCardStateString()

WINSCARDAPI const char* WINAPI SCardGetCardStateString ( DWORD  dwCardState)
Here is the caller graph for this function:

◆ SCardGetCardTypeProviderNameA()

WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
CHAR *  szProvider,
LPDWORD  pcchProvider 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetCardTypeProviderNameW()

WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
WCHAR *  szProvider,
LPDWORD  pcchProvider 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetDeviceTypeIdA()

WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetDeviceTypeIdW()

WINSCARDAPI LONG WINAPI SCardGetDeviceTypeIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetDispositionString()

WINSCARDAPI const char* WINAPI SCardGetDispositionString ( DWORD  dwDisposition)
Here is the caller graph for this function:

◆ SCardGetErrorString()

WINSCARDAPI const char* WINAPI SCardGetErrorString ( LONG  errorCode)

Extended API

◆ SCardGetProtocolString()

WINSCARDAPI const char* WINAPI SCardGetProtocolString ( DWORD  dwProtocols)
Here is the caller graph for this function:

◆ SCardGetProviderIdA()

WINSCARDAPI LONG WINAPI SCardGetProviderIdA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidProviderId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetProviderIdW()

WINSCARDAPI LONG WINAPI SCardGetProviderIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidProviderId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetReaderDeviceInstanceIdA()

WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetReaderDeviceInstanceIdW()

WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPWSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetReaderIconA()

WINSCARDAPI LONG WINAPI SCardGetReaderIconA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetReaderIconW()

WINSCARDAPI LONG WINAPI SCardGetReaderIconW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetReaderStateString()

WINSCARDAPI char* WINAPI SCardGetReaderStateString ( DWORD  dwReaderState)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetScopeString()

WINSCARDAPI const char* WINAPI SCardGetScopeString ( DWORD  dwScope)
Here is the caller graph for this function:

◆ SCardGetShareModeString()

WINSCARDAPI const char* WINAPI SCardGetShareModeString ( DWORD  dwShareMode)
Here is the caller graph for this function:

◆ SCardGetStatusChangeA()

WINSCARDAPI LONG WINAPI SCardGetStatusChangeA ( SCARDCONTEXT  hContext,
DWORD  dwTimeout,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetStatusChangeW()

WINSCARDAPI LONG WINAPI SCardGetStatusChangeW ( SCARDCONTEXT  hContext,
DWORD  dwTimeout,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardGetTransmitCount()

WINSCARDAPI LONG WINAPI SCardGetTransmitCount ( SCARDHANDLE  hCard,
LPDWORD  pcTransmitCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceCardTypeA()

WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceCardTypeW()

WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceReaderA()

WINSCARDAPI LONG WINAPI SCardIntroduceReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szDeviceName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceReaderGroupA()

WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceReaderGroupW()

WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIntroduceReaderW()

WINSCARDAPI LONG WINAPI SCardIntroduceReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szDeviceName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardIsValidContext()

WINSCARDAPI LONG WINAPI SCardIsValidContext ( SCARDCONTEXT  hContext)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListCardsA()

WINSCARDAPI LONG WINAPI SCardListCardsA ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
CHAR *  mszCards,
LPDWORD  pcchCards 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListCardsW()

WINSCARDAPI LONG WINAPI SCardListCardsW ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
WCHAR *  mszCards,
LPDWORD  pcchCards 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListInterfacesA()

WINSCARDAPI LONG WINAPI SCardListInterfacesA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListInterfacesW()

WINSCARDAPI LONG WINAPI SCardListInterfacesW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReaderGroupsA()

WINSCARDAPI LONG WINAPI SCardListReaderGroupsA ( SCARDCONTEXT  hContext,
LPSTR  mszGroups,
LPDWORD  pcchGroups 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReaderGroupsW()

WINSCARDAPI LONG WINAPI SCardListReaderGroupsW ( SCARDCONTEXT  hContext,
LPWSTR  mszGroups,
LPDWORD  pcchGroups 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReadersA()

WINSCARDAPI LONG WINAPI SCardListReadersA ( SCARDCONTEXT  hContext,
LPCSTR  mszGroups,
LPSTR  mszReaders,
LPDWORD  pcchReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReadersW()

WINSCARDAPI LONG WINAPI SCardListReadersW ( SCARDCONTEXT  hContext,
LPCWSTR  mszGroups,
LPWSTR  mszReaders,
LPDWORD  pcchReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReadersWithDeviceInstanceIdA()

WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szDeviceInstanceId,
LPSTR  mszReaders,
LPDWORD  pcchReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardListReadersWithDeviceInstanceIdW()

WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szDeviceInstanceId,
LPWSTR  mszReaders,
LPDWORD  pcchReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardLocateCardsA()

WINSCARDAPI LONG WINAPI SCardLocateCardsA ( SCARDCONTEXT  hContext,
LPCSTR  mszCards,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardLocateCardsByATRA()

WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardLocateCardsByATRW()

WINSCARDAPI LONG WINAPI SCardLocateCardsByATRW ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardLocateCardsW()

WINSCARDAPI LONG WINAPI SCardLocateCardsW ( SCARDCONTEXT  hContext,
LPCWSTR  mszCards,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardReadCacheA()

WINSCARDAPI LONG WINAPI SCardReadCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardReadCacheW()

WINSCARDAPI LONG WINAPI SCardReadCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardReconnect()

WINSCARDAPI LONG WINAPI SCardReconnect ( SCARDHANDLE  hCard,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
DWORD  dwInitialization,
LPDWORD  pdwActiveProtocol 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardReleaseContext()

WINSCARDAPI LONG WINAPI SCardReleaseContext ( SCARDCONTEXT  hContext)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardReleaseStartedEvent()

WINSCARDAPI void WINAPI SCardReleaseStartedEvent ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardRemoveReaderFromGroupA()

WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardRemoveReaderFromGroupW()

WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardSetAttrib()

WINSCARDAPI LONG WINAPI SCardSetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPCBYTE  pbAttr,
DWORD  cbAttrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardSetCardTypeProviderNameA()

WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
LPCSTR  szProvider 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardSetCardTypeProviderNameW()

WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
LPCWSTR  szProvider 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardState()

WINSCARDAPI LONG WINAPI SCardState ( SCARDHANDLE  hCard,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardStatusA()

WINSCARDAPI LONG WINAPI SCardStatusA ( SCARDHANDLE  hCard,
LPSTR  mszReaderNames,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardStatusW()

WINSCARDAPI LONG WINAPI SCardStatusW ( SCARDHANDLE  hCard,
LPWSTR  mszReaderNames,
LPDWORD  pcchReaderLen,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardTransmit()

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 call graph for this function:
Here is the caller graph for this function:

◆ SCardUIDlgSelectCardA()

WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardA ( LPOPENCARDNAMEA_EX  pDlgStruc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardUIDlgSelectCardW()

WINSCARDAPI LONG WINAPI SCardUIDlgSelectCardW ( LPOPENCARDNAMEW_EX  pDlgStruc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardWriteCacheA()

WINSCARDAPI LONG WINAPI SCardWriteCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCardWriteCacheW()

WINSCARDAPI LONG WINAPI SCardWriteCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WinPR_GetSCardApiFunctionTable()

const SCardApiFunctionTable* WinPR_GetSCardApiFunctionTable ( void  )
Here is the caller graph for this function:

◆ WinSCard_LoadApiTableFunctions()

BOOL WinSCard_LoadApiTableFunctions ( PSCardApiFunctionTable  pWinSCardApiTable,
HMODULE  hWinSCardLibrary 
)
Here is the caller graph for this function:

Variable Documentation

◆ g_Initialized

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 Copyright 2020 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2020 Thincast Technologies GmbH

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.

◆ g_rgSCardRawPci

const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, 8 }

◆ g_rgSCardT0Pci

const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }

Standard Windows Smart Card API

◆ g_rgSCardT1Pci

const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }

◆ g_SCardApi

const SCardApiFunctionTable* g_SCardApi = NULL
static

◆ WinPR_SCardApiFunctionTable

const SCardApiFunctionTable WinPR_SCardApiFunctionTable
static