18 |
* along with WinPT; if not, write to the Free Software Foundation, |
* along with WinPT; if not, write to the Free Software Foundation, |
19 |
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
20 |
*/ |
*/ |
|
|
|
21 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
22 |
#include <config.h> |
#include <config.h> |
23 |
#endif |
#endif |
24 |
|
|
25 |
#include <stdio.h> |
#if 0 /* not needed right now. */ |
26 |
#include <stdio.h> |
#include <stdio.h> |
27 |
#include <windows.h> |
#include <windows.h> |
28 |
|
#ifndef __MINGW32__ |
29 |
|
#include <winscard.h> |
30 |
|
#endif |
31 |
|
|
32 |
#include "gpgme.h" |
#include "gpgme.h" |
33 |
#include "wptTypes.h" |
#include "wptTypes.h" |
38 |
mingw does not come with winscard and we dlopen the stuff |
mingw does not come with winscard and we dlopen the stuff |
39 |
anyway. */ |
anyway. */ |
40 |
typedef unsigned long pcsc_context_t; |
typedef unsigned long pcsc_context_t; |
|
|
|
41 |
struct pcsc_readerstate_s |
struct pcsc_readerstate_s |
42 |
{ |
{ |
43 |
const char *reader; |
const char *reader; |
44 |
void *user_data; |
void *user_data; |
45 |
unsigned long current_state; |
unsigned long current_state; |
46 |
unsigned long event_state; |
unsigned long event_state; |
47 |
unsigned long atrlen; |
unsigned long atrlen; |
48 |
unsigned char atr[33]; |
unsigned char atr[33]; |
49 |
}; |
}; |
50 |
|
|
51 |
typedef struct pcsc_readerstate_s *pcsc_readerstate_t; |
typedef struct pcsc_readerstate_s *pcsc_readerstate_t; |
111 |
#define PCSC_E_READER_UNAVAILABLE 0x80100017 |
#define PCSC_E_READER_UNAVAILABLE 0x80100017 |
112 |
#define PCSC_W_REMOVED_CARD 0x80100069 |
#define PCSC_W_REMOVED_CARD 0x80100069 |
113 |
|
|
114 |
|
|
115 |
/* Possible card states. */ |
/* Possible card states. */ |
116 |
enum card_state_t { |
enum card_state_t { |
117 |
CARD_STATE_NONE=0, |
CARD_STATE_NONE=0, |
296 |
if (rc == PCSC_E_TIMEOUT) |
if (rc == PCSC_E_TIMEOUT) |
297 |
continue; |
continue; |
298 |
if (rc) |
if (rc) |
299 |
; /* FIXME: What is this?? */ |
; /* FIXME: What is this?? */ |
300 |
|
|
301 |
/* next reader */ |
/* next reader */ |
302 |
curr_rd++; |
curr_rd++; |
334 |
stat |= CARD_STATE_EXCLUSI; |
stat |= CARD_STATE_EXCLUSI; |
335 |
return stat; |
return stat; |
336 |
} |
} |
337 |
|
#endif |