00001 /* 00002 * MUSCLE SmartCard Development ( http://www.linuxnet.com ) 00003 * 00004 * Copyright (C) 1999 00005 * David Corcoran <corcoran@linuxnet.com> 00006 * 00007 * $Id: atrhandler.h 1421 2005-04-12 12:09:21Z rousseau $ 00008 */ 00009 00016 #ifndef __atrhandler_h__ 00017 #define __atrhandler_h__ 00018 00019 #ifdef __cplusplus 00020 extern "C" 00021 { 00022 #endif 00023 00024 #define SCARD_CONVENTION_DIRECT 0x0001 00025 #define SCARD_CONVENTION_INVERSE 0x0002 00026 00027 typedef struct _SMARTCARD_EXTENSION 00028 { 00029 00030 struct _ATR 00031 { 00032 DWORD Length; 00033 UCHAR Value[MAX_ATR_SIZE]; 00034 DWORD HistoryLength; 00035 UCHAR HistoryValue[MAX_ATR_SIZE]; 00036 } 00037 ATR; 00038 00039 DWORD ReadTimeout; 00040 00041 struct _CardCapabilities 00042 { 00043 UCHAR AvailableProtocols; 00044 UCHAR CurrentProtocol; 00045 UCHAR Convention; 00046 USHORT ETU; 00047 00048 struct _PtsData 00049 { 00050 UCHAR F1; 00051 UCHAR D1; 00052 UCHAR I1; 00053 UCHAR P1; 00054 UCHAR N1; 00055 } 00056 PtsData; 00057 00058 struct _T1 00059 { 00060 USHORT BGT; 00061 USHORT BWT; 00062 USHORT CWT; 00063 USHORT CGT; 00064 USHORT WT; 00065 } 00066 T1; 00067 00068 struct _T0 00069 { 00070 USHORT BGT; 00071 USHORT BWT; 00072 USHORT CWT; 00073 USHORT CGT; 00074 USHORT WT; 00075 } 00076 T0; 00077 00078 } 00079 CardCapabilities; 00080 00081 /* 00082 * PREADER_CONNECTION psReaderConnection; 00083 */ 00084 00085 } 00086 SMARTCARD_EXTENSION, *PSMARTCARD_EXTENSION; 00087 00088 /* 00089 * Decodes the ATR and fills the structure 00090 */ 00091 00092 short ATRDecodeAtr(PSMARTCARD_EXTENSION psExtension, 00093 PUCHAR pucAtr, DWORD dwLength); 00094 00095 #ifdef __cplusplus 00096 } 00097 #endif 00098 00099 #endif /* __atrhandler_h__ */