libwinpr-smartcard: update PCSC-WinPR instructions (WIP)

This commit is contained in:
Marc-André Moreau 2014-04-27 17:38:45 -04:00
parent 103b7d4151
commit 5db851a154
3 changed files with 41 additions and 5 deletions

View File

@ -341,7 +341,9 @@ else()
set(X11_FEATURE_TYPE "DISABLED")
endif()
find_package(PCSCWinPR)
if(WITH_PCSC_WINPR)
find_package(PCSCWinPR)
endif()
set(X11_FEATURE_PURPOSE "X11")
set(X11_FEATURE_DESCRIPTION "X11 client and server")

View File

@ -27,14 +27,40 @@
#include <stdlib.h>
#include <string.h>
#define DISABLE_PCSC_WINPR
/**
* PCSC-WinPR (only required for Mac OS X):
* PCSC-WinPR (optional for Mac OS X):
*
* PCSC-WinPR is a static build of libpcsclite with
* minor modifications meant to avoid an ABI conflict.
*
* At this point, it is only a work in progress, as I was not
* yet able to make it work properly. However, if we could make it
* work, we might be able to build against a version of pcsc-lite
* that doesn't have issues present in Apple's SmartCard Services.
*
* Patch pcsc-lite/src/PCSC/wintypes.h:
* Change "unsigned long" to "unsigned int" for
*
* typedef unsigned int ULONG;
* typedef unsigned int DWORD;
*
* This is important as ULONG and DWORD are supposed to be 32-bit,
* but unsigned long on 64-bit OS X is 64-bit, not 32-bit.
* More importantly, Apple's SmartCard Services uses unsigned int,
* while vanilla pcsc-lite still uses unsigned long.
*
* Patch pcsc-lite/src/PCSC/pcsclite.h.in:
*
* Add the WinPR_PCSC_* definitions that follow "#define WinPR_PCSC"
* in this file to pcsc-lite/src/PCSC/winscard.h
* in this source file at the beginning of the pcsclite.h.in.
*
* Change "unsigned long" to "unsigned int" in the definition
* of the SCARD_IO_REQUEST structure:
*
* unsigned int dwProtocol;
* unsigned int cbPciLength;
*
* Configure pcsc-lite with the following options (Mac OS X):
*
@ -67,6 +93,7 @@
#if 0
#define WinPR_PCSC
#define SCardEstablishContext WinPR_PCSC_SCardEstablishContext
#define SCardReleaseContext WinPR_PCSC_SCardReleaseContext
#define SCardIsValidContext WinPR_PCSC_SCardIsValidContext
@ -85,7 +112,10 @@
#define SCardCancel WinPR_PCSC_SCardCancel
#define SCardGetAttrib WinPR_PCSC_SCardGetAttrib
#define SCardSetAttrib WinPR_PCSC_SCardSetAttrib
#define list_size WinPR_PCSC_list_size /* put this line in src/simclist.h */
#define g_rgSCardT0Pci WinPR_PCSC_g_rgSCardT0Pci
#define g_rgSCardT1Pci WinPR_PCSC_g_rgSCardT1Pci
#define g_rgSCardRawPci WinPR_PCSC_g_rgSCardRawPci
#endif
#ifdef WITH_WINPR_PCSC
@ -138,6 +168,10 @@ int PCSC_InitializeSCardApi_Link(void)
{
int status = -1;
#ifdef DISABLE_PCSC_WINPR
return -1;
#endif
#ifdef WITH_WINPR_PCSC
g_PCSC_Link.pfnSCardEstablishContext = (void*) WinPR_PCSC_SCardEstablishContext;
g_PCSC_Link.pfnSCardReleaseContext = (void*) WinPR_PCSC_SCardReleaseContext;

View File

@ -2157,7 +2157,7 @@ extern int PCSC_InitializeSCardApi_Link(void);
int PCSC_InitializeSCardApi(void)
{
#if 0
#ifndef DISABLE_PCSC_LINK
if (PCSC_InitializeSCardApi_Link() >= 0)
{
g_PCSC.pfnSCardEstablishContext = g_PCSC_Link.pfnSCardEstablishContext;