redirect specific smartcard readers

This commit is contained in:
dodo040 2017-05-15 13:43:51 +02:00
parent 36f07fcfaf
commit 722e927c64
7 changed files with 635 additions and 427 deletions

View File

@ -45,7 +45,6 @@ void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext)
SMARTCARD_OPERATION* operation;
UINT error = CHANNEL_RC_OK;
smartcard = pContext->smartcard;
nCount = 0;
hEvents[nCount++] = MessageQueue_Event(pContext->IrpQueue);
@ -516,7 +515,6 @@ static void* smartcard_thread_func(void* arg)
wMessage message;
SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) arg;
UINT error = CHANNEL_RC_OK;
nCount = 0;
hEvents[nCount++] = MessageQueue_Event(smartcard->IrpQueue);
hEvents[nCount++] = Queue_Event(smartcard->CompletedIrpQueue);
@ -741,6 +739,15 @@ UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
smartcard->name = name;
}
LONG status;
status = SCardAddReaderName(&smartcard->thread, (LPSTR) name);
if (status != SCARD_S_SUCCESS)
{
WLog_ERR(TAG, "Failed to add reader name!");
goto error_device_data;
}
smartcard->IrpQueue = MessageQueue_New(NULL);
if (!smartcard->IrpQueue)

View File

@ -785,7 +785,7 @@ static char** freerdp_command_line_parse_comma_separated_values_offset(
p = t;
if (count)
if (*count)
MoveMemory(&p[1], p, sizeof(char*)** count);
(*count)++;
@ -859,13 +859,24 @@ static int freerdp_client_command_line_post_filter(void* context,
}
CommandLineSwitchCase(arg, "smartcard")
{
char** p;
int count;
p = freerdp_command_line_parse_comma_separated_values_offset(arg->Value,
&count);
p[0] = "smartcard";
status = freerdp_client_add_device_channel(settings, count, p);
free(p);
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{
char** p;
int count;
p = freerdp_command_line_parse_comma_separated_values_offset(arg->Value, &count);
p[0] = "smartcard";
status = freerdp_client_add_device_channel(settings, count, p);
free(p);
}
else
{
char* p[2];
int count;
count = 2;
p[0] = "smartcard";
p[1] = "";
status = freerdp_client_add_device_channel(settings, count, p);
}
}
CommandLineSwitchCase(arg, "printer")
{
@ -1815,14 +1826,21 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (arg->Flags & COMMAND_LINE_VALUE_PRESENT)
{
p = strstr(arg->Value, "://");
if (p) {
if (p)
{
*p = '\0';
if (!strcmp("http", arg->Value)) {
if (!strcmp("http", arg->Value))
{
settings->ProxyType = PROXY_TYPE_HTTP;
} else {
}
else
{
WLog_ERR(TAG, "Only HTTP proxys supported by now");
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
arg->Value = p + 3;
}
@ -1830,16 +1848,18 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (p)
{
length = (int) (p - arg->Value);
if (!isdigit(p[1])) {
length = (int)(p - arg->Value);
if (!isdigit(p[1]))
{
WLog_ERR(TAG, "Could not parse proxy port");
return COMMAND_LINE_ERROR_UNEXPECTED_VALUE;
}
settings->ProxyPort = atoi(&p[1]);
settings->ProxyHostname = (char*) malloc(length + 1);
strncpy(settings->ProxyHostname, arg->Value, length);
settings->ProxyHostname[length] = '\0';
settings->ProxyType = PROXY_TYPE_HTTP;
}
}
@ -2533,7 +2553,8 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
}
CommandLineSwitchCase(arg, "action-script")
{
free (settings->ActionScript);
free(settings->ActionScript);
if (!(settings->ActionScript = _strdup(arg->Value)))
return COMMAND_LINE_ERROR_MEMORY;
}
@ -2547,13 +2568,14 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
if (user)
{
free(settings->Username);
if (!settings->Domain && user)
{
BOOL ret;
free(settings->Domain);
ret = freerdp_parse_username(user, &settings->Username, &settings->Domain);
free(user);
if (!ret)
return COMMAND_LINE_ERROR;
}
@ -2570,7 +2592,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
BOOL ret;
free(settings->GatewayDomain);
ret = freerdp_parse_username(gwUser, &settings->GatewayUsername,
&settings->GatewayDomain);
&settings->GatewayDomain);
free(gwUser);
if (!ret)
@ -2710,7 +2732,7 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings)
if (settings->DeviceRedirection)
{
if (!freerdp_client_load_static_channel_addin(channels, settings, "rdpdr",
settings))
settings))
return FALSE;
if (!freerdp_static_channel_collection_find(settings, "rdpsnd"))
@ -2785,14 +2807,14 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings)
if (settings->EncomspVirtualChannel)
{
if (!freerdp_client_load_static_channel_addin(channels, settings, "encomsp",
settings))
settings))
return FALSE;
}
if (settings->RemdeskVirtualChannel)
{
if (!freerdp_client_load_static_channel_addin(channels, settings, "remdesk",
settings))
settings))
return FALSE;
}

View File

@ -236,7 +236,7 @@ typedef struct _SCARD_IO_REQUEST
DWORD dwProtocol;
DWORD cbPciLength;
} SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST;
typedef const SCARD_IO_REQUEST* LPCSCARD_IO_REQUEST;
typedef struct
{
@ -261,13 +261,13 @@ typedef struct
} DUMMYUNIONNAME;
} SCARD_T0_REQUEST;
typedef SCARD_T0_REQUEST *PSCARD_T0_REQUEST, *LPSCARD_T0_REQUEST;
typedef SCARD_T0_REQUEST* PSCARD_T0_REQUEST, *LPSCARD_T0_REQUEST;
typedef struct
{
SCARD_IO_REQUEST ioRequest;
} SCARD_T1_REQUEST;
typedef SCARD_T1_REQUEST *PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST;
typedef SCARD_T1_REQUEST* PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST;
#define SCARD_READER_SWALLOWS 0x00000001
#define SCARD_READER_EJECTS 0x00000002
@ -290,10 +290,10 @@ typedef SCARD_T1_REQUEST *PSCARD_T1_REQUEST, *LPSCARD_T1_REQUEST;
#endif
typedef ULONG_PTR SCARDCONTEXT;
typedef SCARDCONTEXT *PSCARDCONTEXT, *LPSCARDCONTEXT;
typedef SCARDCONTEXT* PSCARDCONTEXT, *LPSCARDCONTEXT;
typedef ULONG_PTR SCARDHANDLE;
typedef SCARDHANDLE *PSCARDHANDLE, *LPSCARDHANDLE;
typedef SCARDHANDLE* PSCARDHANDLE, *LPSCARDHANDLE;
#define SCARD_AUTOALLOCATE (DWORD)(-1)
@ -330,11 +330,15 @@ typedef SCARDHANDLE *PSCARDHANDLE, *LPSCARDHANDLE;
#define SCERR_NOCARDNAME 0x4000
#define SCERR_NOGUIDS 0x8000
typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCA)(SCARDCONTEXT hSCardContext, LPSTR szReader, LPSTR mszCards, PVOID pvUserData);
typedef SCARDHANDLE (WINAPI *LPOCNCONNPROCW)(SCARDCONTEXT hSCardContext, LPWSTR szReader, LPWSTR mszCards, PVOID pvUserData);
typedef SCARDHANDLE(WINAPI* LPOCNCONNPROCA)(SCARDCONTEXT hSCardContext, LPSTR szReader,
LPSTR mszCards, PVOID pvUserData);
typedef SCARDHANDLE(WINAPI* LPOCNCONNPROCW)(SCARDCONTEXT hSCardContext, LPWSTR szReader,
LPWSTR mszCards, PVOID pvUserData);
typedef BOOL (WINAPI *LPOCNCHKPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, PVOID pvUserData);
typedef void (WINAPI *LPOCNDSCPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard, PVOID pvUserData);
typedef BOOL (WINAPI* LPOCNCHKPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard,
PVOID pvUserData);
typedef void (WINAPI* LPOCNDSCPROC)(SCARDCONTEXT hSCardContext, SCARDHANDLE hCard,
PVOID pvUserData);
#define SCARD_READER_SEL_AUTH_PACKAGE ((DWORD)-629)
@ -463,9 +467,9 @@ typedef struct
typedef enum
{
RSR_MATCH_TYPE_READER_AND_CONTAINER = 1,
RSR_MATCH_TYPE_SERIAL_NUMBER,
RSR_MATCH_TYPE_ALL_CARDS
RSR_MATCH_TYPE_READER_AND_CONTAINER = 1,
RSR_MATCH_TYPE_SERIAL_NUMBER,
RSR_MATCH_TYPE_ALL_CARDS
} READER_SEL_REQUEST_MATCH_TYPE;
typedef struct
@ -600,42 +604,44 @@ extern const SCARD_IO_REQUEST g_rgSCardRawPci;
#define SCARD_PCI_RAW (&g_rgSCardRawPci)
WINSCARDAPI LONG WINAPI SCardEstablishContext(DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
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);
LPSTR mszGroups, LPDWORD pcchGroups);
WINSCARDAPI LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT hContext,
LPWSTR mszGroups, LPDWORD pcchGroups);
LPWSTR mszGroups, LPDWORD pcchGroups);
WINSCARDAPI LONG WINAPI SCardListReadersA(SCARDCONTEXT hContext,
LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders);
LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders);
WINSCARDAPI LONG WINAPI SCardListReadersW(SCARDCONTEXT hContext,
LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders);
LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders);
WINSCARDAPI LONG WINAPI SCardListCardsA(SCARDCONTEXT hContext,
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, LPDWORD pcchCards);
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);
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards,
LPDWORD pcchCards);
WINSCARDAPI LONG WINAPI SCardListInterfacesA(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
WINSCARDAPI LONG WINAPI SCardListInterfacesW(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
WINSCARDAPI LONG WINAPI SCardGetProviderIdA(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidProviderId);
LPCSTR szCard, LPGUID pguidProviderId);
WINSCARDAPI LONG WINAPI SCardGetProviderIdW(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidProviderId);
LPCWSTR szCard, LPGUID pguidProviderId);
WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameA(SCARDCONTEXT hContext,
LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider);
LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider);
WINSCARDAPI LONG WINAPI SCardGetCardTypeProviderNameW(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider);
LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider);
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupA(SCARDCONTEXT hContext, LPCSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardIntroduceReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName);
@ -644,34 +650,34 @@ WINSCARDAPI LONG WINAPI SCardForgetReaderGroupA(SCARDCONTEXT hContext, LPCSTR sz
WINSCARDAPI LONG WINAPI SCardForgetReaderGroupW(SCARDCONTEXT hContext, LPCWSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardIntroduceReaderA(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szDeviceName);
LPCSTR szReaderName, LPCSTR szDeviceName);
WINSCARDAPI LONG WINAPI SCardIntroduceReaderW(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szDeviceName);
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);
LPCSTR szReaderName, LPCSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardAddReaderToGroupW(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
LPCWSTR szReaderName, LPCWSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szGroupName);
LPCSTR szReaderName, LPCSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
LPCWSTR szReaderName, LPCWSTR szGroupName);
WINSCARDAPI LONG WINAPI SCardIntroduceCardTypeA(SCARDCONTEXT hContext,
LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen);
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);
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);
LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider);
WINSCARDAPI LONG WINAPI SCardSetCardTypeProviderNameW(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider);
LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider);
WINSCARDAPI LONG WINAPI SCardForgetCardTypeA(SCARDCONTEXT hContext, LPCSTR szCardName);
WINSCARDAPI LONG WINAPI SCardForgetCardTypeW(SCARDCONTEXT hContext, LPCWSTR szCardName);
@ -683,31 +689,31 @@ WINSCARDAPI HANDLE WINAPI SCardAccessStartedEvent(void);
WINSCARDAPI void WINAPI SCardReleaseStartedEvent(void);
WINSCARDAPI LONG WINAPI SCardLocateCardsA(SCARDCONTEXT hContext,
LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
WINSCARDAPI LONG WINAPI SCardLocateCardsW(SCARDCONTEXT hContext,
LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
WINSCARDAPI LONG WINAPI SCardLocateCardsByATRA(SCARDCONTEXT hContext,
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
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);
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
WINSCARDAPI LONG WINAPI SCardGetStatusChangeA(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
WINSCARDAPI LONG WINAPI SCardGetStatusChangeW(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
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);
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);
LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
WINSCARDAPI LONG WINAPI SCardReconnect(SCARDHANDLE hCard,
DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol);
DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol);
WINSCARDAPI LONG WINAPI SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition);
@ -718,28 +724,30 @@ WINSCARDAPI LONG WINAPI SCardEndTransaction(SCARDHANDLE hCard, DWORD dwDispositi
WINSCARDAPI LONG WINAPI SCardCancelTransaction(SCARDHANDLE hCard);
WINSCARDAPI LONG WINAPI SCardState(SCARDHANDLE hCard,
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
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);
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);
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);
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);
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 SCardGetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
LPDWORD pcbAttrLen);
WINSCARDAPI LONG WINAPI SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen);
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);
@ -750,35 +758,39 @@ 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);
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);
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);
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);
UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen);
WINSCARDAPI LONG WINAPI SCardGetReaderIconA(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
WINSCARDAPI LONG WINAPI SCardGetReaderIconW(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
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 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);
LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
WINSCARDAPI LONG WINAPI SCardGetReaderDeviceInstanceIdW(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdA(SCARDCONTEXT hContext,
LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders);
LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders);
WINSCARDAPI LONG WINAPI SCardListReadersWithDeviceInstanceIdW(SCARDCONTEXT hContext,
LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders);
LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders);
WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent);
WINSCARDAPI LONG WINAPI SCardAddReaderName(HANDLE* key, LPSTR readerName);
#ifdef UNICODE
#define SCardListReaderGroups SCardListReaderGroupsW
#define SCardListReaders SCardListReadersW
@ -847,185 +859,193 @@ WINSCARDAPI LONG WINAPI SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent);
* Extended API
*/
typedef LONG (WINAPI * fnSCardEstablishContext)(DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
typedef LONG(WINAPI* fnSCardEstablishContext)(DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
typedef LONG (WINAPI * fnSCardReleaseContext)(SCARDCONTEXT hContext);
typedef LONG(WINAPI* fnSCardReleaseContext)(SCARDCONTEXT hContext);
typedef LONG (WINAPI * fnSCardIsValidContext)(SCARDCONTEXT hContext);
typedef LONG(WINAPI* fnSCardIsValidContext)(SCARDCONTEXT hContext);
typedef LONG (WINAPI * fnSCardListReaderGroupsA)(SCARDCONTEXT hContext,
LPSTR mszGroups, LPDWORD pcchGroups);
typedef LONG (WINAPI * fnSCardListReaderGroupsW)(SCARDCONTEXT hContext,
LPWSTR mszGroups, LPDWORD pcchGroups);
typedef LONG(WINAPI* fnSCardListReaderGroupsA)(SCARDCONTEXT hContext,
LPSTR mszGroups, LPDWORD pcchGroups);
typedef LONG(WINAPI* fnSCardListReaderGroupsW)(SCARDCONTEXT hContext,
LPWSTR mszGroups, LPDWORD pcchGroups);
typedef LONG (WINAPI * fnSCardListReadersA)(SCARDCONTEXT hContext,
LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (WINAPI * fnSCardListReadersW)(SCARDCONTEXT hContext,
LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders);
typedef LONG(WINAPI* fnSCardListReadersA)(SCARDCONTEXT hContext,
LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG(WINAPI* fnSCardListReadersW)(SCARDCONTEXT hContext,
LPCWSTR mszGroups, LPWSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (WINAPI * fnSCardListCardsA)(SCARDCONTEXT hContext,
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards, LPDWORD pcchCards);
typedef LONG(WINAPI* fnSCardListCardsA)(SCARDCONTEXT hContext,
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, CHAR* mszCards,
LPDWORD pcchCards);
typedef LONG (WINAPI * fnSCardListCardsW)(SCARDCONTEXT hContext,
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards, LPDWORD pcchCards);
typedef LONG(WINAPI* fnSCardListCardsW)(SCARDCONTEXT hContext,
LPCBYTE pbAtr, LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, WCHAR* mszCards,
LPDWORD pcchCards);
typedef LONG (WINAPI * fnSCardListInterfacesA)(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
typedef LONG (WINAPI * fnSCardListInterfacesW)(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
typedef LONG(WINAPI* fnSCardListInterfacesA)(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
typedef LONG(WINAPI* fnSCardListInterfacesW)(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidInterfaces, LPDWORD pcguidInterfaces);
typedef LONG (WINAPI * fnSCardGetProviderIdA)(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidProviderId);
typedef LONG (WINAPI * fnSCardGetProviderIdW)(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidProviderId);
typedef LONG(WINAPI* fnSCardGetProviderIdA)(SCARDCONTEXT hContext,
LPCSTR szCard, LPGUID pguidProviderId);
typedef LONG(WINAPI* fnSCardGetProviderIdW)(SCARDCONTEXT hContext,
LPCWSTR szCard, LPGUID pguidProviderId);
typedef LONG (WINAPI * fnSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext,
LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider);
typedef LONG (WINAPI * fnSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider);
typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameA)(SCARDCONTEXT hContext,
LPCSTR szCardName, DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider);
typedef LONG(WINAPI* fnSCardGetCardTypeProviderNameW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider);
typedef LONG (WINAPI * fnSCardIntroduceReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
typedef LONG (WINAPI * fnSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
typedef LONG(WINAPI* fnSCardIntroduceReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
typedef LONG(WINAPI* fnSCardIntroduceReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
typedef LONG (WINAPI * fnSCardForgetReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
typedef LONG (WINAPI * fnSCardForgetReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
typedef LONG(WINAPI* fnSCardForgetReaderGroupA)(SCARDCONTEXT hContext, LPCSTR szGroupName);
typedef LONG(WINAPI* fnSCardForgetReaderGroupW)(SCARDCONTEXT hContext, LPCWSTR szGroupName);
typedef LONG (WINAPI * fnSCardIntroduceReaderA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szDeviceName);
typedef LONG (WINAPI * fnSCardIntroduceReaderW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szDeviceName);
typedef LONG(WINAPI* fnSCardIntroduceReaderA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szDeviceName);
typedef LONG(WINAPI* fnSCardIntroduceReaderW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szDeviceName);
typedef LONG (WINAPI * fnSCardForgetReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName);
typedef LONG (WINAPI * fnSCardForgetReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName);
typedef LONG(WINAPI* fnSCardForgetReaderA)(SCARDCONTEXT hContext, LPCSTR szReaderName);
typedef LONG(WINAPI* fnSCardForgetReaderW)(SCARDCONTEXT hContext, LPCWSTR szReaderName);
typedef LONG (WINAPI * fnSCardAddReaderToGroupA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szGroupName);
typedef LONG (WINAPI * fnSCardAddReaderToGroupW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
typedef LONG(WINAPI* fnSCardAddReaderToGroupA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szGroupName);
typedef LONG(WINAPI* fnSCardAddReaderToGroupW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
typedef LONG (WINAPI * fnSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szGroupName);
typedef LONG (WINAPI * fnSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPCSTR szGroupName);
typedef LONG(WINAPI* fnSCardRemoveReaderFromGroupW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPCWSTR szGroupName);
typedef LONG (WINAPI * fnSCardIntroduceCardTypeA)(SCARDCONTEXT hContext,
LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen);
typedef LONG (WINAPI * fnSCardIntroduceCardTypeW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen);
typedef LONG(WINAPI* fnSCardIntroduceCardTypeA)(SCARDCONTEXT hContext,
LPCSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen);
typedef LONG(WINAPI* fnSCardIntroduceCardTypeW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces,
DWORD dwInterfaceCount, LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen);
typedef LONG (WINAPI * fnSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext,
LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider);
typedef LONG (WINAPI * fnSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider);
typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameA)(SCARDCONTEXT hContext,
LPCSTR szCardName, DWORD dwProviderId, LPCSTR szProvider);
typedef LONG(WINAPI* fnSCardSetCardTypeProviderNameW)(SCARDCONTEXT hContext,
LPCWSTR szCardName, DWORD dwProviderId, LPCWSTR szProvider);
typedef LONG (WINAPI * fnSCardForgetCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName);
typedef LONG (WINAPI * fnSCardForgetCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName);
typedef LONG(WINAPI* fnSCardForgetCardTypeA)(SCARDCONTEXT hContext, LPCSTR szCardName);
typedef LONG(WINAPI* fnSCardForgetCardTypeW)(SCARDCONTEXT hContext, LPCWSTR szCardName);
typedef LONG (WINAPI * fnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem);
typedef LONG(WINAPI* fnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem);
typedef HANDLE (WINAPI * fnSCardAccessStartedEvent)(void);
typedef HANDLE(WINAPI* fnSCardAccessStartedEvent)(void);
typedef void (WINAPI * fnSCardReleaseStartedEvent)(void);
typedef void (WINAPI* fnSCardReleaseStartedEvent)(void);
typedef LONG (WINAPI * fnSCardLocateCardsA)(SCARDCONTEXT hContext,
LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardLocateCardsW)(SCARDCONTEXT hContext,
LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardLocateCardsA)(SCARDCONTEXT hContext,
LPCSTR mszCards, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardLocateCardsW)(SCARDCONTEXT hContext,
LPCWSTR mszCards, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardLocateCardsByATRA)(SCARDCONTEXT hContext,
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardLocateCardsByATRW)(SCARDCONTEXT hContext,
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardLocateCardsByATRA)(SCARDCONTEXT hContext,
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardLocateCardsByATRW)(SCARDCONTEXT hContext,
LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardGetStatusChangeA)(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardGetStatusChangeW)(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardGetStatusChangeA)(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEA rgReaderStates, DWORD cReaders);
typedef LONG(WINAPI* fnSCardGetStatusChangeW)(SCARDCONTEXT hContext,
DWORD dwTimeout, LPSCARD_READERSTATEW rgReaderStates, DWORD cReaders);
typedef LONG (WINAPI * fnSCardCancel)(SCARDCONTEXT hContext);
typedef LONG(WINAPI* fnSCardCancel)(SCARDCONTEXT hContext);
typedef LONG (WINAPI * fnSCardConnectA)(SCARDCONTEXT hContext,
LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG (WINAPI * fnSCardConnectW)(SCARDCONTEXT hContext,
LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG(WINAPI* fnSCardConnectA)(SCARDCONTEXT hContext,
LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG(WINAPI* fnSCardConnectW)(SCARDCONTEXT hContext,
LPCWSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol);
typedef LONG (WINAPI * fnSCardReconnect)(SCARDHANDLE hCard,
DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol);
typedef LONG(WINAPI* fnSCardReconnect)(SCARDHANDLE hCard,
DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol);
typedef LONG (WINAPI * fnSCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG(WINAPI* fnSCardDisconnect)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG (WINAPI * fnSCardBeginTransaction)(SCARDHANDLE hCard);
typedef LONG(WINAPI* fnSCardBeginTransaction)(SCARDHANDLE hCard);
typedef LONG (WINAPI * fnSCardEndTransaction)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG(WINAPI* fnSCardEndTransaction)(SCARDHANDLE hCard, DWORD dwDisposition);
typedef LONG (WINAPI * fnSCardCancelTransaction)(SCARDHANDLE hCard);
typedef LONG(WINAPI* fnSCardCancelTransaction)(SCARDHANDLE hCard);
typedef LONG (WINAPI * fnSCardState)(SCARDHANDLE hCard,
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG(WINAPI* fnSCardState)(SCARDHANDLE hCard,
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG (WINAPI * fnSCardStatusA)(SCARDHANDLE hCard,
LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState,
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG (WINAPI * fnSCardStatusW)(SCARDHANDLE hCard,
LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState,
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG(WINAPI* fnSCardStatusA)(SCARDHANDLE hCard,
LPSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState,
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG(WINAPI* fnSCardStatusW)(SCARDHANDLE hCard,
LPWSTR mszReaderNames, LPDWORD pcchReaderLen, LPDWORD pdwState,
LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
typedef LONG (WINAPI * fnSCardTransmit)(SCARDHANDLE hCard,
LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength,
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
typedef LONG(WINAPI* fnSCardTransmit)(SCARDHANDLE hCard,
LPCSCARD_IO_REQUEST pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength,
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength);
typedef LONG (WINAPI * fnSCardGetTransmitCount)(SCARDHANDLE hCard, LPDWORD pcTransmitCount);
typedef LONG(WINAPI* fnSCardGetTransmitCount)(SCARDHANDLE hCard, LPDWORD pcTransmitCount);
typedef LONG (WINAPI * fnSCardControl)(SCARDHANDLE hCard,
DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize,
LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned);
typedef LONG(WINAPI* fnSCardControl)(SCARDHANDLE hCard,
DWORD dwControlCode, LPCVOID lpInBuffer, DWORD cbInBufferSize,
LPVOID lpOutBuffer, DWORD cbOutBufferSize, LPDWORD lpBytesReturned);
typedef LONG (WINAPI * fnSCardGetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen);
typedef LONG(WINAPI* fnSCardGetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr,
LPDWORD pcbAttrLen);
typedef LONG (WINAPI * fnSCardSetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen);
typedef LONG(WINAPI* fnSCardSetAttrib)(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr,
DWORD cbAttrLen);
typedef LONG (WINAPI * fnSCardUIDlgSelectCardA)(LPOPENCARDNAMEA_EX pDlgStruc);
typedef LONG (WINAPI * fnSCardUIDlgSelectCardW)(LPOPENCARDNAMEW_EX pDlgStruc);
typedef LONG(WINAPI* fnSCardUIDlgSelectCardA)(LPOPENCARDNAMEA_EX pDlgStruc);
typedef LONG(WINAPI* fnSCardUIDlgSelectCardW)(LPOPENCARDNAMEW_EX pDlgStruc);
typedef LONG (WINAPI * fnGetOpenCardNameA)(LPOPENCARDNAMEA pDlgStruc);
typedef LONG (WINAPI * fnGetOpenCardNameW)(LPOPENCARDNAMEW pDlgStruc);
typedef LONG(WINAPI* fnGetOpenCardNameA)(LPOPENCARDNAMEA pDlgStruc);
typedef LONG(WINAPI* fnGetOpenCardNameW)(LPOPENCARDNAMEW pDlgStruc);
typedef LONG (WINAPI * fnSCardDlgExtendedError)(void);
typedef LONG(WINAPI* fnSCardDlgExtendedError)(void);
typedef LONG (WINAPI * fnSCardReadCacheA)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen);
typedef LONG (WINAPI * fnSCardReadCacheW)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen);
typedef LONG(WINAPI* fnSCardReadCacheA)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD* DataLen);
typedef LONG(WINAPI* fnSCardReadCacheW)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD* DataLen);
typedef LONG (WINAPI * fnSCardWriteCacheA)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen);
typedef LONG (WINAPI * fnSCardWriteCacheW)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen);
typedef LONG(WINAPI* fnSCardWriteCacheA)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPSTR LookupName, PBYTE Data, DWORD DataLen);
typedef LONG(WINAPI* fnSCardWriteCacheW)(SCARDCONTEXT hContext,
UUID* CardIdentifier, DWORD FreshnessCounter, LPWSTR LookupName, PBYTE Data, DWORD DataLen);
typedef LONG (WINAPI * fnSCardGetReaderIconA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
typedef LONG (WINAPI * fnSCardGetReaderIconW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
typedef LONG(WINAPI* fnSCardGetReaderIconA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
typedef LONG(WINAPI* fnSCardGetReaderIconW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPBYTE pbIcon, LPDWORD pcbIcon);
typedef LONG (WINAPI * fnSCardGetDeviceTypeIdA)(SCARDCONTEXT hContext, LPCSTR szReaderName, LPDWORD pdwDeviceTypeId);
typedef LONG (WINAPI * fnSCardGetDeviceTypeIdW)(SCARDCONTEXT hContext, LPCWSTR szReaderName, LPDWORD pdwDeviceTypeId);
typedef LONG(WINAPI* fnSCardGetDeviceTypeIdA)(SCARDCONTEXT hContext, LPCSTR szReaderName,
LPDWORD pdwDeviceTypeId);
typedef LONG(WINAPI* fnSCardGetDeviceTypeIdW)(SCARDCONTEXT hContext, LPCWSTR szReaderName,
LPDWORD pdwDeviceTypeId);
typedef LONG (WINAPI * fnSCardGetReaderDeviceInstanceIdA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
typedef LONG (WINAPI * fnSCardGetReaderDeviceInstanceIdW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdA)(SCARDCONTEXT hContext,
LPCSTR szReaderName, LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
typedef LONG(WINAPI* fnSCardGetReaderDeviceInstanceIdW)(SCARDCONTEXT hContext,
LPCWSTR szReaderName, LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId);
typedef LONG (WINAPI * fnSCardListReadersWithDeviceInstanceIdA)(SCARDCONTEXT hContext,
LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (WINAPI * fnSCardListReadersWithDeviceInstanceIdW)(SCARDCONTEXT hContext,
LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders);
typedef LONG(WINAPI* fnSCardListReadersWithDeviceInstanceIdA)(SCARDCONTEXT hContext,
LPCSTR szDeviceInstanceId, LPSTR mszReaders, LPDWORD pcchReaders);
typedef LONG(WINAPI* fnSCardListReadersWithDeviceInstanceIdW)(SCARDCONTEXT hContext,
LPCWSTR szDeviceInstanceId, LPWSTR mszReaders, LPDWORD pcchReaders);
typedef LONG (WINAPI * fnSCardAudit)(SCARDCONTEXT hContext, DWORD dwEvent);
typedef LONG(WINAPI* fnSCardAudit)(SCARDCONTEXT hContext, DWORD dwEvent);
typedef LONG(WINAPI* fnSCardAddReaderName)(HANDLE* key, LPSTR readerName);
struct _SCardApiFunctionTable
{
@ -1108,6 +1128,7 @@ struct _SCardApiFunctionTable
fnSCardListReadersWithDeviceInstanceIdA pfnSCardListReadersWithDeviceInstanceIdA;
fnSCardListReadersWithDeviceInstanceIdW pfnSCardListReadersWithDeviceInstanceIdW;
fnSCardAudit pfnSCardAudit;
fnSCardAddReaderName pfnSCardAddReaderName;
};
typedef struct _SCardApiFunctionTable SCardApiFunctionTable;

File diff suppressed because it is too large Load Diff

View File

@ -155,6 +155,7 @@ static wArrayList* g_Readers = NULL;
static wListDictionary* g_CardHandles = NULL;
static wListDictionary* g_CardContexts = NULL;
static wListDictionary* g_MemoryBlocks = NULL;
static wListDictionary* g_ReadersNames = NULL;
char SMARTCARD_PNP_NOTIFICATION_A[] = "\\\\?PnP?\\Notification";
@ -645,26 +646,8 @@ error_namePSC:
return FALSE;
}
static int PCSC_AtoiWithLength(const char* str, int length)
{
int index;
int value = 0;
for (index = 0; index < length; ++index)
{
if (!isdigit(str[index]))
return -1;
value = value * 10 + (str[index] - '0');
}
return value;
}
char* PCSC_ConvertReaderNameToWinSCard(const char* name)
{
int slot;
int index;
int size;
int length;
int ctoken;
@ -672,7 +655,6 @@ char* PCSC_ConvertReaderNameToWinSCard(const char* name)
char* p, *q;
char* tokens[64][2];
char* nameWinSCard;
char* checkAliasName;
/**
* pcsc-lite reader name format:
@ -746,45 +728,7 @@ char* PCSC_ConvertReaderNameToWinSCard(const char* name)
if (ntokens < 2)
return NULL;
slot = index = -1;
ctoken = ntokens - 1;
slot = PCSC_AtoiWithLength(tokens[ctoken][0], (int)(tokens[ctoken][1] - tokens[ctoken][0]));
ctoken--;
index = PCSC_AtoiWithLength(tokens[ctoken][0], (int)(tokens[ctoken][1] - tokens[ctoken][0]));
ctoken--;
if (index < 0)
{
slot = -1;
index = slot;
ctoken++;
}
if ((index < 0) || (slot < 0))
return NULL;
if (tokens[ctoken] && tokens[ctoken][1] && *(tokens[ctoken][1] - 1) == ')')
{
while ((*(tokens[ctoken][0]) != '(') && (ctoken > 0))
ctoken--;
ctoken--;
}
if (ctoken < 1)
return NULL;
if (*(tokens[ctoken][1] - 1) == ']')
{
while ((*(tokens[ctoken][0]) != '[') && (ctoken > 0))
ctoken--;
ctoken--;
}
if (ctoken < 1)
return NULL;
p = tokens[0][0];
q = tokens[ctoken][1];
length = (q - p);
@ -794,23 +738,7 @@ char* PCSC_ConvertReaderNameToWinSCard(const char* name)
if (!nameWinSCard)
return NULL;
/**
* pcsc-lite appears to use an index number based on all readers,
* while WinSCard uses an index number based on readers of the same name.
* Set index for this reader by checking if index is already used by another reader
* and incrementing until available index found.
*/
index = 0;
sprintf_s(nameWinSCard, size, "%.*s %d", length, p, index);
checkAliasName = PCSC_GetReaderNameFromAlias(nameWinSCard);
while ((checkAliasName != NULL) && (strcmp(checkAliasName, name) != 0))
{
index++;
sprintf_s(nameWinSCard, size, "%.*s %d", length, p, index);
checkAliasName = PCSC_GetReaderNameFromAlias(nameWinSCard);
}
sprintf_s(nameWinSCard, size, "%.*s", length, p);
return nameWinSCard;
}
@ -825,6 +753,34 @@ char* PCSC_GetReaderAliasFromName(char* namePCSC)
return nameWinSCard;
}
int PCSC_RedirectReader(char* readerName)
{
char* name;
ULONG_PTR* readers;
int i, nbReaders;
nbReaders = ListDictionary_GetKeys(g_ReadersNames, &readers);
for (i = 0; i < nbReaders; i++)
{
name = ListDictionary_GetItemValue(g_ReadersNames, (void*) readers[i]);
if (name)
{
if (strcmp(name, "") == 0)
{
return 0;
}
if (strncmp(readerName, name, strlen(readerName)) == 0)
{
return 0;
}
}
}
return -1;
}
char* PCSC_ConvertReaderNamesToWinSCard(const char* names, LPDWORD pcchReaders)
{
int length;
@ -832,6 +788,7 @@ char* PCSC_ConvertReaderNamesToWinSCard(const char* names, LPDWORD pcchReaders)
DWORD cchReaders;
char* nameWinSCard;
char* namesWinSCard;
BOOL endReaderName = FALSE;
p = (char*) names;
cchReaders = *pcchReaders;
namesWinSCard = (char*) malloc(cchReaders * 2);
@ -849,7 +806,13 @@ char* PCSC_ConvertReaderNamesToWinSCard(const char* names, LPDWORD pcchReaders)
if (nameWinSCard)
{
length = strlen(nameWinSCard);
CopyMemory(q, nameWinSCard, length);
if (PCSC_RedirectReader(nameWinSCard) == 0)
{
CopyMemory(q, nameWinSCard, length);
endReaderName = TRUE;
}
free(nameWinSCard);
}
else
@ -858,9 +821,14 @@ char* PCSC_ConvertReaderNamesToWinSCard(const char* names, LPDWORD pcchReaders)
CopyMemory(q, p, length);
}
q += length;
*q = '\0';
q++;
if (endReaderName)
{
q += length;
*q = '\0';
q++;
endReaderName = FALSE;
}
p += strlen(p) + 1;
}
@ -2847,6 +2815,27 @@ WINSCARDAPI LONG WINAPI PCSC_SCardAudit(SCARDCONTEXT hContext, DWORD dwEvent)
return 0;
}
WINSCARDAPI LONG WINAPI PCSC_SCardAddReaderName(HANDLE* key, LPSTR readerName)
{
LONG status = SCARD_S_SUCCESS;
int count = 0;
if (!g_ReadersNames)
{
g_ReadersNames = ListDictionary_New(TRUE);
if (!g_ReadersNames)
return SCARD_E_NO_SERVICE;
}
count = ListDictionary_Count(g_ReadersNames);
if (!ListDictionary_Add(g_ReadersNames, key, readerName))
return SCARD_E_NO_SERVICE;
return status;
}
#ifdef __MACOSX__
unsigned int determineMacOSXVersion()
{
@ -3042,7 +3031,8 @@ SCardApiFunctionTable PCSC_SCardApiFunctionTable =
PCSC_SCardGetReaderDeviceInstanceIdW, /* SCardGetReaderDeviceInstanceIdW */
PCSC_SCardListReadersWithDeviceInstanceIdA, /* SCardListReadersWithDeviceInstanceIdA */
PCSC_SCardListReadersWithDeviceInstanceIdW, /* SCardListReadersWithDeviceInstanceIdW */
PCSC_SCardAudit /* SCardAudit */
PCSC_SCardAudit, /* SCardAudit */
PCSC_SCardAddReaderName /* SCardAddReaderName */
};
PSCardApiFunctionTable PCSC_GetSCardApiFunctionTable(void)

View File

@ -41,15 +41,15 @@
#ifdef __APPLE__
typedef unsigned int PCSC_DWORD;
typedef PCSC_DWORD *PCSC_PDWORD, *PCSC_LPDWORD;
typedef PCSC_DWORD* PCSC_PDWORD, *PCSC_LPDWORD;
typedef unsigned int PCSC_ULONG;
typedef PCSC_ULONG *PCSC_PULONG;
typedef PCSC_ULONG* PCSC_PULONG;
typedef int PCSC_LONG;
#else
typedef unsigned long PCSC_DWORD;
typedef PCSC_DWORD *PCSC_PDWORD, *PCSC_LPDWORD;
typedef PCSC_DWORD* PCSC_PDWORD, *PCSC_LPDWORD;
typedef unsigned long PCSC_ULONG;
typedef PCSC_ULONG *PCSC_PULONG;
typedef PCSC_ULONG* PCSC_PULONG;
typedef long PCSC_LONG;
#endif
@ -121,37 +121,41 @@ typedef struct
struct _PCSCFunctionTable
{
PCSC_LONG (* pfnSCardEstablishContext)(PCSC_DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
PCSC_LONG (* pfnSCardReleaseContext)(SCARDCONTEXT hContext);
PCSC_LONG (* pfnSCardIsValidContext)(SCARDCONTEXT hContext);
PCSC_LONG (* pfnSCardConnect)(SCARDCONTEXT hContext,
LPCSTR szReader, PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, PCSC_LPDWORD pdwActiveProtocol);
PCSC_LONG (* pfnSCardReconnect)(SCARDHANDLE hCard,
PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols,
PCSC_DWORD dwInitialization, PCSC_LPDWORD pdwActiveProtocol);
PCSC_LONG (* pfnSCardDisconnect)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition);
PCSC_LONG (* pfnSCardBeginTransaction)(SCARDHANDLE hCard);
PCSC_LONG (* pfnSCardEndTransaction)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition);
PCSC_LONG (* pfnSCardStatus)(SCARDHANDLE hCard,
LPSTR mszReaderName, PCSC_LPDWORD pcchReaderLen, PCSC_LPDWORD pdwState,
PCSC_LPDWORD pdwProtocol, LPBYTE pbAtr, PCSC_LPDWORD pcbAtrLen);
PCSC_LONG (* pfnSCardGetStatusChange)(SCARDCONTEXT hContext,
PCSC_DWORD dwTimeout, PCSC_SCARD_READERSTATE* rgReaderStates, PCSC_DWORD cReaders);
PCSC_LONG (* pfnSCardControl)(SCARDHANDLE hCard,
PCSC_DWORD dwControlCode, LPCVOID pbSendBuffer, PCSC_DWORD cbSendLength,
LPVOID pbRecvBuffer, PCSC_DWORD cbRecvLength, PCSC_LPDWORD lpBytesReturned);
PCSC_LONG (* pfnSCardTransmit)(SCARDHANDLE hCard,
const PCSC_SCARD_IO_REQUEST* pioSendPci, LPCBYTE pbSendBuffer, PCSC_DWORD cbSendLength,
PCSC_SCARD_IO_REQUEST* pioRecvPci, LPBYTE pbRecvBuffer, PCSC_LPDWORD pcbRecvLength);
PCSC_LONG (* pfnSCardListReaderGroups)(SCARDCONTEXT hContext, LPSTR mszGroups, PCSC_LPDWORD pcchGroups);
PCSC_LONG (* pfnSCardListReaders)(SCARDCONTEXT hContext,
LPCSTR mszGroups, LPSTR mszReaders, PCSC_LPDWORD pcchReaders);
PCSC_LONG (* pfnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem);
PCSC_LONG (* pfnSCardCancel)(SCARDCONTEXT hContext);
PCSC_LONG (* pfnSCardGetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPBYTE pbAttr, PCSC_LPDWORD pcbAttrLen);
PCSC_LONG (* pfnSCardSetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPCBYTE pbAttr, PCSC_DWORD cbAttrLen);
PCSC_LONG(* pfnSCardEstablishContext)(PCSC_DWORD dwScope,
LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext);
PCSC_LONG(* pfnSCardReleaseContext)(SCARDCONTEXT hContext);
PCSC_LONG(* pfnSCardIsValidContext)(SCARDCONTEXT hContext);
PCSC_LONG(* pfnSCardConnect)(SCARDCONTEXT hContext,
LPCSTR szReader, PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols,
LPSCARDHANDLE phCard, PCSC_LPDWORD pdwActiveProtocol);
PCSC_LONG(* pfnSCardReconnect)(SCARDHANDLE hCard,
PCSC_DWORD dwShareMode, PCSC_DWORD dwPreferredProtocols,
PCSC_DWORD dwInitialization, PCSC_LPDWORD pdwActiveProtocol);
PCSC_LONG(* pfnSCardDisconnect)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition);
PCSC_LONG(* pfnSCardBeginTransaction)(SCARDHANDLE hCard);
PCSC_LONG(* pfnSCardEndTransaction)(SCARDHANDLE hCard, PCSC_DWORD dwDisposition);
PCSC_LONG(* pfnSCardStatus)(SCARDHANDLE hCard,
LPSTR mszReaderName, PCSC_LPDWORD pcchReaderLen, PCSC_LPDWORD pdwState,
PCSC_LPDWORD pdwProtocol, LPBYTE pbAtr, PCSC_LPDWORD pcbAtrLen);
PCSC_LONG(* pfnSCardGetStatusChange)(SCARDCONTEXT hContext,
PCSC_DWORD dwTimeout, PCSC_SCARD_READERSTATE* rgReaderStates, PCSC_DWORD cReaders);
PCSC_LONG(* pfnSCardControl)(SCARDHANDLE hCard,
PCSC_DWORD dwControlCode, LPCVOID pbSendBuffer, PCSC_DWORD cbSendLength,
LPVOID pbRecvBuffer, PCSC_DWORD cbRecvLength, PCSC_LPDWORD lpBytesReturned);
PCSC_LONG(* pfnSCardTransmit)(SCARDHANDLE hCard,
const PCSC_SCARD_IO_REQUEST* pioSendPci, LPCBYTE pbSendBuffer, PCSC_DWORD cbSendLength,
PCSC_SCARD_IO_REQUEST* pioRecvPci, LPBYTE pbRecvBuffer, PCSC_LPDWORD pcbRecvLength);
PCSC_LONG(* pfnSCardListReaderGroups)(SCARDCONTEXT hContext, LPSTR mszGroups,
PCSC_LPDWORD pcchGroups);
PCSC_LONG(* pfnSCardListReaders)(SCARDCONTEXT hContext,
LPCSTR mszGroups, LPSTR mszReaders, PCSC_LPDWORD pcchReaders);
PCSC_LONG(* pfnSCardFreeMemory)(SCARDCONTEXT hContext, LPCVOID pvMem);
PCSC_LONG(* pfnSCardCancel)(SCARDCONTEXT hContext);
PCSC_LONG(* pfnSCardGetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPBYTE pbAttr,
PCSC_LPDWORD pcbAttrLen);
PCSC_LONG(* pfnSCardSetAttrib)(SCARDHANDLE hCard, PCSC_DWORD dwAttrId, LPCBYTE pbAttr,
PCSC_DWORD cbAttrLen);
PCSC_LONG(* pfnSCardAddReaderName)(HANDLE* key, LPSTR readerName);
};
typedef struct _PCSCFunctionTable PCSCFunctionTable;

View File

@ -111,7 +111,8 @@ SCardApiFunctionTable WinSCard_SCardApiFunctionTable =
NULL, /* SCardGetReaderDeviceInstanceIdW */
NULL, /* SCardListReadersWithDeviceInstanceIdA */
NULL, /* SCardListReadersWithDeviceInstanceIdW */
NULL /* SCardAudit */
NULL, /* SCardAudit */
NULL /* SCardAddReaderName */
};
PSCardApiFunctionTable WinSCard_GetSCardApiFunctionTable(void)
@ -202,7 +203,6 @@ int WinSCard_InitializeSCardApi(void)
WINSCARD_LOAD_PROC(SCardListReadersWithDeviceInstanceIdA);
WINSCARD_LOAD_PROC(SCardListReadersWithDeviceInstanceIdW);
WINSCARD_LOAD_PROC(SCardAudit);
return 1;
}