FreeRDP
smartcard_pcsc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/library.h>
#include <winpr/smartcard.h>
#include <winpr/collections.h>
#include <winpr/environment.h>
#include "smartcard_pcsc.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("smartcard")
 

Functions

WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory_Internal (SCARDCONTEXT hContext, LPCVOID pvMem)
 
WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext_Internal (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
 
WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext_Internal (SCARDCONTEXT hContext)
 
static LONG PCSC_MapErrorCodeToWinSCard (LONG errorCode)
 
static DWORD PCSC_ConvertCardStateToWinSCard (DWORD dwCardState, LONG status)
 
static DWORD PCSC_ConvertProtocolsToWinSCard (DWORD dwProtocols)
 
static DWORD PCSC_ConvertProtocolsFromWinSCard (DWORD dwProtocols)
 
static PCSC_SCARDCONTEXT * PCSC_GetCardContextData (SCARDCONTEXT hContext)
 
static PCSC_SCARDCONTEXT * PCSC_EstablishCardContext (SCARDCONTEXT hContext)
 
static void PCSC_ReleaseCardContext (SCARDCONTEXT hContext)
 
static BOOL PCSC_LockCardContext (SCARDCONTEXT hContext)
 
static BOOL PCSC_UnlockCardContext (SCARDCONTEXT hContext)
 
static PCSC_SCARDHANDLE * PCSC_GetCardHandleData (SCARDHANDLE hCard)
 
static SCARDCONTEXT PCSC_GetCardContextFromHandle (SCARDHANDLE hCard)
 
static BOOL PCSC_WaitForCardAccess (SCARDCONTEXT hContext, SCARDHANDLE hCard, BOOL shared)
 
static BOOL PCSC_ReleaseCardAccess (SCARDCONTEXT hContext, SCARDHANDLE hCard)
 
static PCSC_SCARDHANDLE * PCSC_ConnectCardHandle (SCARDCONTEXT hSharedContext, SCARDHANDLE hCard)
 
static void PCSC_DisconnectCardHandle (SCARDHANDLE hCard)
 
static BOOL PCSC_AddMemoryBlock (SCARDCONTEXT hContext, void *pvMem)
 
static voidPCSC_RemoveMemoryBlock (SCARDCONTEXT hContext, void *pvMem)
 
WINSCARDAPI LONG WINAPI PCSC_SCardEstablishContext (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
 
WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIsValidContext (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal (SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsA (SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsW (SCARDCONTEXT hContext, LPWSTR mszGroups, LPDWORD pcchGroups)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReaders_Internal (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReadersA (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReadersW (SCARDCONTEXT hContext, LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListCardsA (SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR *mszCards, LPDWORD pcchCards)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListCardsW (SCARDCONTEXT hContext, LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR *mszCards, LPDWORD pcchCards)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesA (SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesW (SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdA (SCARDCONTEXT hContext, LPCSTR szCard, LPGUID pguidProviderId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdW (SCARDCONTEXT hContext, LPCWSTR szCard, LPGUID pguidProviderId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameA (SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, CHAR *szProvider, LPDWORD pcchProvider)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameW (SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, WCHAR *szProvider, LPDWORD pcchProvider)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderGroupA (SCARDCONTEXT hContext, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderGroupW (SCARDCONTEXT hContext, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderGroupA (SCARDCONTEXT hContext, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderGroupW (SCARDCONTEXT hContext, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szDeviceName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szDeviceName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderA (SCARDCONTEXT hContext, LPCSTR szReaderName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderW (SCARDCONTEXT hContext, LPCWSTR szReaderName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPCSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPCWSTR szGroupName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeA (SCARDCONTEXT hContext, LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeW (SCARDCONTEXT hContext, LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameA (SCARDCONTEXT hContext, LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider)
 
WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameW (SCARDCONTEXT hContext, LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetCardTypeA (SCARDCONTEXT hContext, LPCSTR szCardName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardForgetCardTypeW (SCARDCONTEXT hContext, LPCWSTR szCardName)
 
WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory (SCARDCONTEXT hContext, LPCVOID pvMem)
 
WINSCARDAPI HANDLE WINAPI PCSC_SCardAccessStartedEvent (void)
 
WINSCARDAPI void WINAPI PCSC_SCardReleaseStartedEvent (void)
 
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsA (SCARDCONTEXT hContext, LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsW (SCARDCONTEXT hContext, LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRA (SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRW (SCARDCONTEXT hContext, LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeA (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChangeW (SCARDCONTEXT hContext, DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardCancel (SCARDCONTEXT hContext)
 
WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal (SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI PCSC_SCardConnectA (SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI PCSC_SCardConnectW (SCARDCONTEXT hContext, LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI PCSC_SCardReconnect (SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol)
 
WINSCARDAPI LONG WINAPI PCSC_SCardDisconnect (SCARDHANDLE hCard, DWORD dwDisposition)
 
WINSCARDAPI LONG WINAPI PCSC_SCardBeginTransaction (SCARDHANDLE hCard)
 
WINSCARDAPI LONG WINAPI PCSC_SCardEndTransaction (SCARDHANDLE hCard, DWORD dwDisposition)
 
WINSCARDAPI LONG WINAPI PCSC_SCardCancelTransaction (SCARDHANDLE hCard)
 
WINSCARDAPI LONG WINAPI PCSC_SCardState (SCARDHANDLE hCard, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardStatus_Internal (SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen, BOOL unicode)
 
WINSCARDAPI LONG WINAPI PCSC_SCardStatusA (SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardStatusW (SCARDHANDLE hCard, LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardTransmit (SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetTransmitCount (SCARDHANDLE hCard, LPDWORD pcTransmitCount)
 
WINSCARDAPI LONG WINAPI PCSC_SCardControl (SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize, LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_Internal (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib_FriendlyName (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardSetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardUIDlgSelectCardA (LPOPENCARDNAMEA_EX pDlgStruc)
 
WINSCARDAPI LONG WINAPI PCSC_SCardUIDlgSelectCardW (LPOPENCARDNAMEW_EX pDlgStruc)
 
WINSCARDAPI LONG WINAPI PCSC_GetOpenCardNameA (LPOPENCARDNAMEA pDlgStruc)
 
WINSCARDAPI LONG WINAPI PCSC_GetOpenCardNameW (LPOPENCARDNAMEW pDlgStruc)
 
WINSCARDAPI LONG WINAPI PCSC_SCardDlgExtendedError (void)
 
WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheA (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD *DataLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheW (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD *DataLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheA (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheW (SCARDCONTEXT hContext, UUID *CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPDWORD pdwDeviceTypeId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPDWORD pdwDeviceTypeId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdA (SCARDCONTEXT hContext, LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdW (SCARDCONTEXT hContext, LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdA (SCARDCONTEXT hContext, LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdW (SCARDCONTEXT hContext, LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders)
 
WINSCARDAPI LONG WINAPI PCSC_SCardAudit (SCARDCONTEXT hContext, DWORD dwEvent)
 
PSCardApiFunctionTable PCSC_GetSCardApiFunctionTable (void)
 
int PCSC_InitializeSCardApi (void)
 

Variables

static HMODULE g_PCSCModule = NULL
 
static PCSCFunctionTable g_PCSC = { 0 }
 
static HANDLE g_StartedEvent = NULL
 
static int g_StartedEventRefCount = 0
 
static BOOL g_SCardAutoAllocate = FALSE
 
static BOOL g_PnP_Notification = TRUE
 
static wListDictionary * g_CardHandles = NULL
 
static wListDictionary * g_CardContexts = NULL
 
static wListDictionary * g_MemoryBlocks = NULL
 
char SMARTCARD_PNP_NOTIFICATION_A [] = "\\\\?PnP?\\Notification"
 
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(PCSC_SCARD_IO_REQUEST) }
 
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(PCSC_SCARD_IO_REQUEST) }
 
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardRawPci = { PCSC_SCARD_PROTOCOL_RAW, sizeof(PCSC_SCARD_IO_REQUEST) }
 
SCardApiFunctionTable PCSC_SCardApiFunctionTable
 

Macro Definition Documentation

#define TAG   WINPR_TAG("smartcard")

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.

Function Documentation

static BOOL PCSC_AddMemoryBlock ( SCARDCONTEXT  hContext,
void pvMem 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static PCSC_SCARDHANDLE* PCSC_ConnectCardHandle ( SCARDCONTEXT  hSharedContext,
SCARDHANDLE  hCard 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD PCSC_ConvertCardStateToWinSCard ( DWORD  dwCardState,
LONG  status 
)
static

pcsc-lite's SCardStatus returns a bit-field, not an enumerated value.

    State             WinSCard           pcsc-lite

 SCARD_UNKNOWN           0                0x0001
 SCARD_ABSENT            1                0x0002
 SCARD_PRESENT           2                0x0004
 SCARD_SWALLOWED         3                0x0008
 SCARD_POWERED           4                0x0010
 SCARD_NEGOTIABLE        5                0x0020
 SCARD_SPECIFIC          6                0x0040

pcsc-lite also never sets SCARD_SPECIFIC, which is expected by some windows applications.

Here is the caller graph for this function:

static DWORD PCSC_ConvertProtocolsFromWinSCard ( DWORD  dwProtocols)
static

pcsc-lite uses a different value for SCARD_PROTOCOL_RAW, and it does not define WinSCard's SCARD_PROTOCOL_DEFAULT.

Here is the caller graph for this function:

static DWORD PCSC_ConvertProtocolsToWinSCard ( DWORD  dwProtocols)
static

pcsc-lite uses a different value for SCARD_PROTOCOL_RAW, and also has SCARD_PROTOCOL_T15 which is not in WinSCard.

Here is the caller graph for this function:

static void PCSC_DisconnectCardHandle ( SCARDHANDLE  hCard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static PCSC_SCARDCONTEXT* PCSC_EstablishCardContext ( SCARDCONTEXT  hContext)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static PCSC_SCARDCONTEXT* PCSC_GetCardContextData ( SCARDCONTEXT  hContext)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static SCARDCONTEXT PCSC_GetCardContextFromHandle ( SCARDHANDLE  hCard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static PCSC_SCARDHANDLE* PCSC_GetCardHandleData ( SCARDHANDLE  hCard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI PCSC_GetOpenCardNameA ( LPOPENCARDNAMEA  pDlgStruc)
WINSCARDAPI LONG WINAPI PCSC_GetOpenCardNameW ( LPOPENCARDNAMEW  pDlgStruc)
PSCardApiFunctionTable PCSC_GetSCardApiFunctionTable ( void  )

Here is the caller graph for this function:

int PCSC_InitializeSCardApi ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL PCSC_LockCardContext ( SCARDCONTEXT  hContext)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static LONG PCSC_MapErrorCodeToWinSCard ( LONG  errorCode)
static

pcsc-lite returns SCARD_E_UNEXPECTED when it should return SCARD_E_UNSUPPORTED_FEATURE.

Additionally, the pcsc-lite headers incorrectly define SCARD_E_UNSUPPORTED_FEATURE to 0x8010001F, when the real value should be 0x80100022.

Here is the caller graph for this function:

static BOOL PCSC_ReleaseCardAccess ( SCARDCONTEXT  hContext,
SCARDHANDLE  hCard 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void PCSC_ReleaseCardContext ( SCARDCONTEXT  hContext)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void* PCSC_RemoveMemoryBlock ( SCARDCONTEXT  hContext,
void pvMem 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI HANDLE WINAPI PCSC_SCardAccessStartedEvent ( void  )

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderToGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardAudit ( SCARDCONTEXT  hContext,
DWORD  dwEvent 
)
WINSCARDAPI LONG WINAPI PCSC_SCardBeginTransaction ( SCARDHANDLE  hCard)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardCancel ( SCARDCONTEXT  hContext)

Here is the call graph for this function:

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

As stated here : https://pcsclite.alioth.debian.org/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 SCARD_PROTOCOL_UNDEFINED is valid for dwPreferredProtocols (only) if dwShareMode == SCARD_SHARE_DIRECT and allows to send control commands to the reader (with SCardControl()) even if a card is not present in the reader

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardDlgExtendedError ( void  )
WINSCARDAPI LONG WINAPI PCSC_SCardEndTransaction ( SCARDHANDLE  hCard,
DWORD  dwDisposition 
)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_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:

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

Standard Windows Smart Card API (PCSC)

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardForgetCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardForgetCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardForgetReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory ( SCARDCONTEXT  hContext,
LPCVOID  pvMem 
)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardFreeMemory_Internal ( SCARDCONTEXT  hContext,
LPCVOID  pvMem 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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

pcsc-lite returns SCARD_E_INSUFFICIENT_BUFFER if the given buffer size is larger than PCSC_MAX_BUFFER_SIZE (264)

pcsc-lite adds a null terminator to the vendor name, while WinSCard doesn't. Strip the null terminator.

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
CHAR *  szProvider,
LPDWORD  pcchProvider 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
WCHAR *  szProvider,
LPDWORD  pcchProvider 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetDeviceTypeIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPDWORD  pdwDeviceTypeId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidProviderId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetProviderIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidProviderId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPWSTR  szDeviceInstanceId,
LPDWORD  pcchDeviceInstanceId 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetReaderIconW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPBYTE  pbIcon,
LPDWORD  pcbIcon 
)
WINSCARDAPI LONG WINAPI PCSC_SCardGetStatusChange_Internal ( SCARDCONTEXT  hContext,
DWORD  dwTimeout,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)

Apple's SmartCard Services (not vanilla pcsc-lite) appears to have trouble with the "\\\\?PnP?\\Notification" reader name. I am always getting EXC_BAD_ACCESS with it.

The SmartCard Services tarballs can be found here: http://opensource.apple.com/tarballs/SmartCardServices/

The "\\\\?PnP?\\Notification" string cannot be found anywhere in the sources, while this string is present in the vanilla pcsc-lite sources.

To work around this apparent lack of "\\\\?PnP?\\Notification" support, we have to filter rgReaderStates to exclude the special PnP reader name.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardGetTransmitCount ( SCARDHANDLE  hCard,
LPDWORD  pcTransmitCount 
)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceCardTypeW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
LPCGUID  pguidPrimaryProvider,
LPCGUID  rgguidInterfaces,
DWORD  dwInterfaceCount,
LPCBYTE  pbAtr,
LPCBYTE  pbAtrMask,
DWORD  cbAtrLen 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szDeviceName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIntroduceReaderW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szDeviceName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardIsValidContext ( SCARDCONTEXT  hContext)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardListCardsA ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
CHAR *  mszCards,
LPDWORD  pcchCards 
)
WINSCARDAPI LONG WINAPI PCSC_SCardListCardsW ( SCARDCONTEXT  hContext,
LPCBYTE  pbAtr,
LPCGUID  rgquidInterfaces,
DWORD  cguidInterfaceCount,
WCHAR *  mszCards,
LPDWORD  pcchCards 
)
WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesA ( SCARDCONTEXT  hContext,
LPCSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
WINSCARDAPI LONG WINAPI PCSC_SCardListInterfacesW ( SCARDCONTEXT  hContext,
LPCWSTR  szCard,
LPGUID  pguidInterfaces,
LPDWORD  pcguidInterfaces 
)
WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroups_Internal ( SCARDCONTEXT  hContext,
LPSTR  mszGroups,
LPDWORD  pcchGroups 
)

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardListReaderGroupsA ( SCARDCONTEXT  hContext,
LPSTR  mszGroups,
LPDWORD  pcchGroups 
)

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdA ( SCARDCONTEXT  hContext,
LPCSTR  szDeviceInstanceId,
LPSTR  mszReaders,
LPDWORD  pcchReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardListReadersWithDeviceInstanceIdW ( SCARDCONTEXT  hContext,
LPCWSTR  szDeviceInstanceId,
LPWSTR  mszReaders,
LPDWORD  pcchReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsA ( SCARDCONTEXT  hContext,
LPCSTR  mszCards,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRA ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEA  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsByATRW ( SCARDCONTEXT  hContext,
LPSCARD_ATRMASK  rgAtrMasks,
DWORD  cAtrs,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardLocateCardsW ( SCARDCONTEXT  hContext,
LPCWSTR  mszCards,
LPSCARD_READERSTATEW  rgReaderStates,
DWORD  cReaders 
)
WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
WINSCARDAPI LONG WINAPI PCSC_SCardReadCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD *  DataLen 
)
WINSCARDAPI LONG WINAPI PCSC_SCardReconnect ( SCARDHANDLE  hCard,
DWORD  dwShareMode,
DWORD  dwPreferredProtocols,
DWORD  dwInitialization,
LPDWORD  pdwActiveProtocol 
)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext ( SCARDCONTEXT  hContext)

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardReleaseContext_Internal ( SCARDCONTEXT  hContext)

Here is the call graph for this function:

Here is the caller graph for this function:

WINSCARDAPI void WINAPI PCSC_SCardReleaseStartedEvent ( void  )

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupA ( SCARDCONTEXT  hContext,
LPCSTR  szReaderName,
LPCSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardRemoveReaderFromGroupW ( SCARDCONTEXT  hContext,
LPCWSTR  szReaderName,
LPCWSTR  szGroupName 
)
WINSCARDAPI LONG WINAPI PCSC_SCardSetAttrib ( SCARDHANDLE  hCard,
DWORD  dwAttrId,
LPCBYTE  pbAttr,
DWORD  cbAttrLen 
)

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameA ( SCARDCONTEXT  hContext,
LPCSTR  szCardName,
DWORD  dwProviderId,
LPCSTR  szProvider 
)
WINSCARDAPI LONG WINAPI PCSC_SCardSetCardTypeProviderNameW ( SCARDCONTEXT  hContext,
LPCWSTR  szCardName,
DWORD  dwProviderId,
LPCWSTR  szProvider 
)
WINSCARDAPI LONG WINAPI PCSC_SCardState ( SCARDHANDLE  hCard,
LPDWORD  pdwState,
LPDWORD  pdwProtocol,
LPBYTE  pbAtr,
LPDWORD  pcbAtrLen 
)

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

pcsc-lite cannot have a null pioSendPci parameter, unlike WinSCard. Query the current protocol and use default SCARD_IO_REQUEST for it.

Here is the call graph for this function:

WINSCARDAPI LONG WINAPI PCSC_SCardUIDlgSelectCardA ( LPOPENCARDNAMEA_EX  pDlgStruc)
WINSCARDAPI LONG WINAPI PCSC_SCardUIDlgSelectCardW ( LPOPENCARDNAMEW_EX  pDlgStruc)
WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheA ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)
WINSCARDAPI LONG WINAPI PCSC_SCardWriteCacheW ( SCARDCONTEXT  hContext,
UUID *  CardIdentifier,
DWORD  FreshnessCounter,
LPWSTR  LookupName,
PBYTE  Data,
DWORD  DataLen 
)
static BOOL PCSC_UnlockCardContext ( SCARDCONTEXT  hContext)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL PCSC_WaitForCardAccess ( SCARDCONTEXT  hContext,
SCARDHANDLE  hCard,
BOOL  shared 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

wListDictionary* g_CardContexts = NULL
static
wListDictionary* g_CardHandles = NULL
static
wListDictionary* g_MemoryBlocks = NULL
static
PCSCFunctionTable g_PCSC = { 0 }
static
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardRawPci = { PCSC_SCARD_PROTOCOL_RAW, sizeof(PCSC_SCARD_IO_REQUEST) }
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(PCSC_SCARD_IO_REQUEST) }
const PCSC_SCARD_IO_REQUEST g_PCSC_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(PCSC_SCARD_IO_REQUEST) }
HMODULE g_PCSCModule = NULL
static
BOOL g_PnP_Notification = TRUE
static
BOOL g_SCardAutoAllocate = FALSE
static
HANDLE g_StartedEvent = NULL
static
int g_StartedEventRefCount = 0
static
SCardApiFunctionTable PCSC_SCardApiFunctionTable
char SMARTCARD_PNP_NOTIFICATION_A[] = "\\\\?PnP?\\Notification"