aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-10-29 00:07:05 +0000
committerNIIBE Yutaka <[email protected]>2013-10-29 00:07:05 +0000
commit32989ad2b152d18198d718bc2c7232ce3e79c72f (patch)
tree9b34727ca48bc0d928fb271bccb66db89baba5e9
parentdoc: Change yat2m to allow arbitrary condition names. (diff)
downloadgnupg-32989ad2b152d18198d718bc2c7232ce3e79c72f.tar.gz
gnupg-32989ad2b152d18198d718bc2c7232ce3e79c72f.zip
scd: pinpad fix for PC/SC on Windows.
* scd/apdu.c (SCARD_CTL_CODE): Fix for Windows.
-rw-r--r--scd/apdu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/scd/apdu.c b/scd/apdu.c
index 0351e0023..e0127d804 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -246,7 +246,13 @@ static char (* DLSTDCALL CT_close) (unsigned short ctn);
/* Fix pcsc-lite ABI incompatibilty. */
#ifndef SCARD_CTL_CODE
-# define SCARD_CTL_CODE(code) (0x42000000 + (code))
+#ifdef _WIN32
+#include <winioctl.h>
+#define SCARD_CTL_CODE(code) CTL_CODE(FILE_DEVICE_SMARTCARD, (code), \
+ METHOD_BUFFERED, FILE_ANY_ACCESS)
+#else
+#define SCARD_CTL_CODE(code) (0x42000000 + (code))
+#endif
#endif
#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
@@ -349,6 +355,7 @@ long (* DLSTDCALL pcsc_control) (long card,
/* Prototypes. */
+static int pcsc_vendor_specific_init (int slot);
static int pcsc_get_status (int slot, unsigned int *status);
static int reset_pcsc_reader (int slot);
static int apdu_get_status_internal (int slot, int hang, int no_atr_reset,