Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00224 #ifndef _ifd_handler_h_
00225 #define _ifd_handler_h_
00226
00227 #include <pcsclite.h>
00228
00229 #ifdef __cplusplus
00230 extern "C"
00231 {
00232 #endif
00233
00234
00235
00236
00237 typedef struct _DEVICE_CAPABILITIES
00238 {
00239 LPSTR Vendor_Name;
00240 LPSTR IFD_Type;
00241 DWORD IFD_Version;
00242 LPSTR IFD_Serial;
00243 DWORD IFD_Channel_ID;
00245 DWORD Asynch_Supported;
00246 DWORD Default_Clock;
00247 DWORD Max_Clock;
00248 DWORD Default_Data_Rate;
00249 DWORD Max_Data_Rate;
00250 DWORD Max_IFSD;
00251 DWORD Synch_Supported;
00252 DWORD Power_Mgmt;
00253 DWORD Card_Auth_Devices;
00254 DWORD User_Auth_Device;
00255 DWORD Mechanics_Supported;
00256 DWORD Vendor_Features;
00257 }
00258 DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
00259
00260 typedef struct _ICC_STATE
00261 {
00262 UCHAR ICC_Presence;
00263 UCHAR ICC_Interface_Status;
00264 UCHAR ATR[MAX_ATR_SIZE];
00265 UCHAR ICC_Type;
00266 }
00267 ICC_STATE, *PICC_STATE;
00268
00269 typedef struct _PROTOCOL_OPTIONS
00270 {
00271 DWORD Protocol_Type;
00272 DWORD Current_Clock;
00273 DWORD Current_F;
00274 DWORD Current_D;
00275 DWORD Current_N;
00276 DWORD Current_W;
00277 DWORD Current_IFSC;
00278 DWORD Current_IFSD;
00279 DWORD Current_BWT;
00280 DWORD Current_CWT;
00281 DWORD Current_EBC;
00282 }
00283 PROTOCOL_OPTIONS, *PPROTOCOL_OPTIONS;
00284
00288 typedef struct _SCARD_IO_HEADER
00289 {
00290 DWORD Protocol;
00291 DWORD Length;
00292 }
00293 SCARD_IO_HEADER, *PSCARD_IO_HEADER;
00294
00295
00296
00297
00298
00299 #define TAG_IFD_ATR 0x0303
00300 #define TAG_IFD_SLOTNUM 0x0180
00301 #define TAG_IFD_SLOT_THREAD_SAFE 0x0FAC
00302 #define TAG_IFD_THREAD_SAFE 0x0FAD
00303 #define TAG_IFD_SLOTS_NUMBER 0x0FAE
00304 #define TAG_IFD_SIMULTANEOUS_ACCESS 0x0FAF
00305 #define TAG_IFD_POLLING_THREAD 0x0FB0
00306 #define TAG_IFD_POLLING_THREAD_KILLABLE 0x0FB1
00308
00309
00310
00311 #define IFD_HVERSION_1_0 0x00010000
00312 #define IFD_HVERSION_2_0 0x00020000
00313 #define IFD_HVERSION_3_0 0x00030000
00314
00315
00316
00317
00318 #define IFD_POWER_UP 500
00319 #define IFD_POWER_DOWN 501
00320 #define IFD_RESET 502
00322 #define IFD_NEGOTIATE_PTS1 1
00323 #define IFD_NEGOTIATE_PTS2 2
00324 #define IFD_NEGOTIATE_PTS3 4
00326 #define IFD_SUCCESS 0
00327 #define IFD_ERROR_TAG 600
00328 #define IFD_ERROR_SET_FAILURE 601
00329 #define IFD_ERROR_VALUE_READ_ONLY 602
00330 #define IFD_ERROR_PTS_FAILURE 605
00331 #define IFD_ERROR_NOT_SUPPORTED 606
00332 #define IFD_PROTOCOL_NOT_SUPPORTED 607
00333 #define IFD_ERROR_POWER_ACTION 608
00334 #define IFD_ERROR_SWALLOW 609
00335 #define IFD_ERROR_EJECT 610
00336 #define IFD_ERROR_CONFISCATE 611
00337 #define IFD_COMMUNICATION_ERROR 612
00338 #define IFD_RESPONSE_TIMEOUT 613
00339 #define IFD_NOT_SUPPORTED 614
00340 #define IFD_ICC_PRESENT 615
00341 #define IFD_ICC_NOT_PRESENT 616
00347 #define IFD_NO_SUCH_DEVICE 617
00348 #define IFD_ERROR_INSUFFICIENT_BUFFER 618
00350 #ifndef RESPONSECODE_DEFINED_IN_WINTYPES_H
00351 typedef long RESPONSECODE;
00352 #endif
00353
00354
00355
00356
00357
00358
00359
00360
00361 #ifndef IFDHANDLERv2
00362
00363
00364
00365
00366
00367
00368
00369
00370
00458 RESPONSECODE IFDHCreateChannelByName(DWORD Lun, LPSTR DeviceName);
00459
00491 RESPONSECODE IFDHControl(DWORD Lun, DWORD dwControlCode, PUCHAR
00492 TxBuffer, DWORD TxLength, PUCHAR RxBuffer, DWORD RxLength,
00493 LPDWORD pdwBytesReturned);
00494
00495 #else
00496
00503 RESPONSECODE IFDHControl(DWORD Lun, PUCHAR TxBuffer, DWORD TxLength,
00504 PUCHAR RxBuffer, PDWORD RxLength);
00505
00506 #endif
00507
00508
00509
00510
00552 RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel);
00553
00568 RESPONSECODE IFDHCloseChannel(DWORD Lun);
00569
00612 RESPONSECODE IFDHGetCapabilities(DWORD Lun, DWORD Tag, PDWORD Length,
00613 PUCHAR Value);
00614
00640 RESPONSECODE IFDHSetCapabilities(DWORD Lun, DWORD Tag, DWORD Length, PUCHAR Value);
00641
00671 RESPONSECODE IFDHSetProtocolParameters(DWORD Lun, DWORD Protocol, UCHAR Flags,
00672 UCHAR PTS1, UCHAR PTS2, UCHAR PTS3);
00705 RESPONSECODE IFDHPowerICC(DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD
00706 AtrLength);
00707
00759 RESPONSECODE IFDHTransmitToICC(DWORD Lun, SCARD_IO_HEADER SendPci,
00760 PUCHAR TxBuffer, DWORD TxLength, PUCHAR RxBuffer, PDWORD
00761 RxLength, PSCARD_IO_HEADER RecvPci);
00762
00779 RESPONSECODE IFDHICCPresence(DWORD Lun);
00780
00781 #ifdef __cplusplus
00782 }
00783 #endif
00784
00785 #endif