|
pcsc-lite 2.3.3
|
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; } } while (0) |
Functions | |
| static LONG | internal_error (void) |
| static void | log_line (const char *fmt,...) |
| static void | 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 | |
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 225 of file libredirect.c.
| PCSC_API LONG SCardCancel | ( | SCARDCONTEXT | hContext | ) |
Definition at line 302 of file libredirect.c.
| PCSC_API LONG SCardConnect | ( | SCARDCONTEXT | hContext, |
| LPCSTR | szReader, | ||
| DWORD | dwShareMode, | ||
| DWORD | dwPreferredProtocols, | ||
| LPSCARDHANDLE | phCard, | ||
| LPDWORD | pdwActiveProtocol | ||
| ) |
Definition at line 198 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 257 of file libredirect.c.
| PCSC_API LONG SCardDisconnect | ( | SCARDHANDLE | hCard, |
| DWORD | dwDisposition | ||
| ) |
Definition at line 219 of file libredirect.c.
| PCSC_API LONG SCardEndTransaction | ( | SCARDHANDLE | hCard, |
| DWORD | dwDisposition | ||
| ) |
Definition at line 230 of file libredirect.c.
| PCSC_API LONG SCardEstablishContext | ( | DWORD | dwScope, |
| LPCVOID | pvReserved1, | ||
| LPCVOID | pvReserved2, | ||
| LPSCARDCONTEXT | phContext | ||
| ) |
Definition at line 175 of file libredirect.c.
| PCSC_API LONG SCardFreeMemory | ( | SCARDCONTEXT | hContext, |
| LPCVOID | pvMem | ||
| ) |
Definition at line 296 of file libredirect.c.
| PCSC_API LONG SCardGetAttrib | ( | SCARDHANDLE | hCard, |
| DWORD | dwAttrId, | ||
| LPBYTE | pbAttr, | ||
| LPDWORD | pcbAttrLen | ||
| ) |
Definition at line 307 of file libredirect.c.
| PCSC_API LONG SCardGetStatusChange | ( | SCARDCONTEXT | hContext, |
| DWORD | dwTimeout, | ||
| SCARD_READERSTATE * | rgReaderStates, | ||
| DWORD | cReaders | ||
| ) |
Definition at line 248 of file libredirect.c.
| PCSC_API LONG SCardIsValidContext | ( | SCARDCONTEXT | hContext | ) |
Definition at line 193 of file libredirect.c.
| PCSC_API LONG SCardListReaderGroups | ( | SCARDCONTEXT | hContext, |
| LPSTR | mszGroups, | ||
| LPDWORD | pcchGroups | ||
| ) |
Definition at line 281 of file libredirect.c.
| PCSC_API LONG SCardListReaders | ( | SCARDCONTEXT | hContext, |
| LPCSTR | mszGroups, | ||
| LPSTR | mszReaders, | ||
| LPDWORD | pcchReaders | ||
| ) |
Definition at line 288 of file libredirect.c.
| PCSC_API LONG SCardReconnect | ( | SCARDHANDLE | hCard, |
| DWORD | dwShareMode, | ||
| DWORD | dwPreferredProtocols, | ||
| DWORD | dwInitialization, | ||
| LPDWORD | pdwActiveProtocol | ||
| ) |
Definition at line 209 of file libredirect.c.
| PCSC_API LONG SCardReleaseContext | ( | SCARDCONTEXT | hContext | ) |
Definition at line 188 of file libredirect.c.
| PCSC_API LONG SCardSetAttrib | ( | SCARDHANDLE | hCard, |
| DWORD | dwAttrId, | ||
| LPCBYTE | pbAttr, | ||
| DWORD | cbAttrLen | ||
| ) |
Definition at line 315 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 236 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 269 of file libredirect.c.
|
static |
Definition at line 110 of file libredirect.c.
| struct { ... } redirect |