pcsc-lite 2.3.0
|
Redirect PC/SC calls to the delegate library. More...
#include <dlfcn.h>
#include <stdio.h>
#include <stdarg.h>
#include <fcntl.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#include "misc.h"
#include <winscard.h>
#include "sys_generic.h"
Go to the source code of this file.
Macros | |
#define | DEBUG |
#define | DLSYM_DECLARE(symbol) typeof(symbol)* symbol |
#define | DLSYM_SET_VALUE(symbol) .symbol = (typeof(symbol)(*))internal_error |
#define | LIBPCSC "libpcsclite_real.so.1" |
#define | get_symbol(s) do { redirect.s = dlsym(Lib_handle, #s); if (NULL == redirect.s) { log_line("%s", dlerror()); return SCARD_F_INTERNAL_ERROR; } } while (0) |
Functions | |
static LONG | internal_error (void) |
static void | log_line (const char *fmt,...) |
static LONG | load_lib (void) |
PCSC_API LONG | SCardEstablishContext (DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext) |
PCSC_API LONG | SCardReleaseContext (SCARDCONTEXT hContext) |
PCSC_API LONG | SCardIsValidContext (SCARDCONTEXT hContext) |
PCSC_API LONG | SCardConnect (SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, DWORD dwPreferredProtocols, LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol) |
PCSC_API LONG | SCardReconnect (SCARDHANDLE hCard, DWORD dwShareMode, DWORD dwPreferredProtocols, DWORD dwInitialization, LPDWORD pdwActiveProtocol) |
PCSC_API LONG | SCardDisconnect (SCARDHANDLE hCard, DWORD dwDisposition) |
PCSC_API LONG | SCardBeginTransaction (SCARDHANDLE hCard) |
PCSC_API LONG | SCardEndTransaction (SCARDHANDLE hCard, DWORD dwDisposition) |
PCSC_API LONG | SCardStatus (SCARDHANDLE hCard, LPSTR mszReaderName, LPDWORD pcchReaderLen, LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen) |
PCSC_API LONG | SCardGetStatusChange (SCARDCONTEXT hContext, DWORD dwTimeout, SCARD_READERSTATE *rgReaderStates, DWORD cReaders) |
PCSC_API LONG | SCardControl (SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID pbSendBuffer, DWORD cbSendLength, LPVOID pbRecvBuffer, DWORD cbRecvLength, LPDWORD lpBytesReturned) |
PCSC_API LONG | SCardTransmit (SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, LPCBYTE pbSendBuffer, DWORD cbSendLength, SCARD_IO_REQUEST *pioRecvPci, LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength) |
PCSC_API LONG | SCardListReaderGroups (SCARDCONTEXT hContext, LPSTR mszGroups, LPDWORD pcchGroups) |
PCSC_API LONG | SCardListReaders (SCARDCONTEXT hContext, LPCSTR mszGroups, LPSTR mszReaders, LPDWORD pcchReaders) |
PCSC_API LONG | SCardFreeMemory (SCARDCONTEXT hContext, LPCVOID pvMem) |
PCSC_API LONG | SCardCancel (SCARDCONTEXT hContext) |
PCSC_API LONG | SCardGetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, LPDWORD pcbAttrLen) |
PCSC_API LONG | SCardSetAttrib (SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLen) |
Variables | ||
struct { | ||
} | redirect | |
static void * | Lib_handle = NULL | |
PCSC_API const SCARD_IO_REQUEST | g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(SCARD_IO_REQUEST) } | |
Protocol Control Information for T=0. | ||
PCSC_API const SCARD_IO_REQUEST | g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) } | |
Protocol Control Information for T=1. | ||
PCSC_API const SCARD_IO_REQUEST | g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, sizeof(SCARD_IO_REQUEST) } | |
Protocol Control Information for raw access. | ||
Redirect PC/SC calls to the delegate library.
Definition in file libredirect.c.
#define DEBUG |
Definition at line 51 of file libredirect.c.
#define DLSYM_DECLARE | ( | symbol | ) | typeof(symbol)* symbol |
Definition at line 53 of file libredirect.c.
#define DLSYM_SET_VALUE | ( | symbol | ) | .symbol = (typeof(symbol)(*))internal_error |
Definition at line 55 of file libredirect.c.
|
static |
Definition at line 59 of file libredirect.c.
|
static |
Definition at line 128 of file libredirect.c.
|
static |
Definition at line 113 of file libredirect.c.
PCSC_API LONG SCardBeginTransaction | ( | SCARDHANDLE | hCard | ) |
Definition at line 237 of file libredirect.c.
PCSC_API LONG SCardCancel | ( | SCARDCONTEXT | hContext | ) |
Definition at line 314 of file libredirect.c.
PCSC_API LONG SCardConnect | ( | SCARDCONTEXT | hContext, |
LPCSTR | szReader, | ||
DWORD | dwShareMode, | ||
DWORD | dwPreferredProtocols, | ||
LPSCARDHANDLE | phCard, | ||
LPDWORD | pdwActiveProtocol ) |
Definition at line 210 of file libredirect.c.
PCSC_API LONG SCardControl | ( | SCARDHANDLE | hCard, |
DWORD | dwControlCode, | ||
LPCVOID | pbSendBuffer, | ||
DWORD | cbSendLength, | ||
LPVOID | pbRecvBuffer, | ||
DWORD | cbRecvLength, | ||
LPDWORD | lpBytesReturned ) |
Definition at line 269 of file libredirect.c.
PCSC_API LONG SCardDisconnect | ( | SCARDHANDLE | hCard, |
DWORD | dwDisposition ) |
Definition at line 231 of file libredirect.c.
PCSC_API LONG SCardEndTransaction | ( | SCARDHANDLE | hCard, |
DWORD | dwDisposition ) |
Definition at line 242 of file libredirect.c.
PCSC_API LONG SCardEstablishContext | ( | DWORD | dwScope, |
LPCVOID | pvReserved1, | ||
LPCVOID | pvReserved2, | ||
LPSCARDCONTEXT | phContext ) |
Definition at line 178 of file libredirect.c.
PCSC_API LONG SCardFreeMemory | ( | SCARDCONTEXT | hContext, |
LPCVOID | pvMem ) |
Definition at line 308 of file libredirect.c.
PCSC_API LONG SCardGetAttrib | ( | SCARDHANDLE | hCard, |
DWORD | dwAttrId, | ||
LPBYTE | pbAttr, | ||
LPDWORD | pcbAttrLen ) |
Definition at line 319 of file libredirect.c.
PCSC_API LONG SCardGetStatusChange | ( | SCARDCONTEXT | hContext, |
DWORD | dwTimeout, | ||
SCARD_READERSTATE * | rgReaderStates, | ||
DWORD | cReaders ) |
Definition at line 260 of file libredirect.c.
PCSC_API LONG SCardIsValidContext | ( | SCARDCONTEXT | hContext | ) |
Definition at line 205 of file libredirect.c.
PCSC_API LONG SCardListReaderGroups | ( | SCARDCONTEXT | hContext, |
LPSTR | mszGroups, | ||
LPDWORD | pcchGroups ) |
Definition at line 293 of file libredirect.c.
PCSC_API LONG SCardListReaders | ( | SCARDCONTEXT | hContext, |
LPCSTR | mszGroups, | ||
LPSTR | mszReaders, | ||
LPDWORD | pcchReaders ) |
Definition at line 300 of file libredirect.c.
PCSC_API LONG SCardReconnect | ( | SCARDHANDLE | hCard, |
DWORD | dwShareMode, | ||
DWORD | dwPreferredProtocols, | ||
DWORD | dwInitialization, | ||
LPDWORD | pdwActiveProtocol ) |
Definition at line 221 of file libredirect.c.
PCSC_API LONG SCardReleaseContext | ( | SCARDCONTEXT | hContext | ) |
Definition at line 200 of file libredirect.c.
PCSC_API LONG SCardSetAttrib | ( | SCARDHANDLE | hCard, |
DWORD | dwAttrId, | ||
LPCBYTE | pbAttr, | ||
DWORD | cbAttrLen ) |
Definition at line 327 of file libredirect.c.
PCSC_API LONG SCardStatus | ( | SCARDHANDLE | hCard, |
LPSTR | mszReaderName, | ||
LPDWORD | pcchReaderLen, | ||
LPDWORD | pdwState, | ||
LPDWORD | pdwProtocol, | ||
LPBYTE | pbAtr, | ||
LPDWORD | pcbAtrLen ) |
Definition at line 248 of file libredirect.c.
PCSC_API LONG SCardTransmit | ( | SCARDHANDLE | hCard, |
const SCARD_IO_REQUEST * | pioSendPci, | ||
LPCBYTE | pbSendBuffer, | ||
DWORD | cbSendLength, | ||
SCARD_IO_REQUEST * | pioRecvPci, | ||
LPBYTE | pbRecvBuffer, | ||
LPDWORD | pcbRecvLength ) |
Definition at line 281 of file libredirect.c.
PCSC_API const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, sizeof(SCARD_IO_REQUEST) } |
Protocol Control Information for raw access.
Definition at line 340 of file libredirect.c.
PCSC_API const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(SCARD_IO_REQUEST) } |
Protocol Control Information for T=0.
Definition at line 336 of file libredirect.c.
PCSC_API const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) } |
Protocol Control Information for T=1.
Definition at line 338 of file libredirect.c.
|
static |
Definition at line 110 of file libredirect.c.
struct { ... } redirect |