atrhandler.h

Go to the documentation of this file.
00001 /*
00002  * MUSCLE SmartCard Development ( http://www.linuxnet.com )
00003  *
00004  * Copyright (C) 1999-2002
00005  *  David Corcoran <corcoran@linuxnet.com>
00006  * Copyright (C) 2002-2009
00007  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
00008  *
00009  * $Id: atrhandler.h 4544 2009-11-12 14:33:44Z rousseau $
00010  */
00011 
00018 #ifndef __atrhandler_h__
00019 #define __atrhandler_h__
00020 
00021 #ifdef __cplusplus
00022 extern "C"
00023 {
00024 #endif
00025 
00026 #define SCARD_CONVENTION_DIRECT  0x0001
00027 #define SCARD_CONVENTION_INVERSE 0x0002
00028 
00029     typedef struct _SMARTCARD_EXTENSION
00030     {
00031 
00032         struct _ATR
00033         {
00034             int Length;
00035             int HistoryLength;
00036             UCHAR Value[MAX_ATR_SIZE];
00037             UCHAR HistoryValue[MAX_ATR_SIZE];
00038         }
00039         ATR;
00040 
00041         struct _CardCapabilities
00042         {
00043             UCHAR AvailableProtocols;
00044             UCHAR CurrentProtocol;
00045             UCHAR Convention;
00046         }
00047         CardCapabilities;
00048     }
00049     SMARTCARD_EXTENSION, *PSMARTCARD_EXTENSION;
00050 
00051     /*
00052      * Decodes the ATR and fills the structure
00053      */
00054 
00055     short ATRDecodeAtr(/*@out@*/ PSMARTCARD_EXTENSION psExtension,
00056         PUCHAR pucAtr, DWORD dwLength);
00057 
00058 #ifdef __cplusplus
00059 }
00060 #endif
00061 
00062 #endif                          /* __atrhandler_h__ */