[Pcsclite-cvs-commit] PCSC/src readerfactory.h,1.17,1.18

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv25243/src

Modified Files:
	readerfactory.h 
Log Message:
in the structure READER_CONTEXT remove:
  UCHAR ucAtr[MAX_ATR_SIZE]; 
  DWORD dwAtrLen;
  DWORD dwProtocol;
  DWORD dwStatus;
  DWORD dwPublicID;
and replace them by a link to the reader structure:
  struct pubReaderStatesList *readerState;

The fields (ATR, procotol, state) were duplicated in both structures
PREADER_STATE and READER_CONTEXT. It was useless and misleading.

It was uneasy to change the ATR or the card protocol after the card was
powered on. A protocol change may occur if the card supports both T=0
and T=1 and the SCardConnect() does not select the default protocol.


Index: readerfactory.h
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/readerfactory.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- readerfactory.h	17 Jun 2004 08:41:04 -0000	1.17
+++ readerfactory.h	18 Jun 2004 08:43:07 -0000	1.18
@@ -5,6 +5,8 @@
  *
  * Copyright (C) 1999
  *  David Corcoran <corcoran@linuxnet.com>
+ * Copyright (C) 2004
+ *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
  * $Id$
  */
@@ -12,7 +14,7 @@
 #ifndef __readerfactory_h__
 #define __readerfactory_h__
 
-#include <thread_generic.h>
+#include "thread_generic.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -96,21 +98,20 @@
 		RDR_CLIHANDLES psHandles[PCSCLITE_MAX_READER_CONTEXT_CHANNELS];	
                                          /* Structure of connected handles */
 		FCT_MAP psFunctions;	/* Structure of function pointers */
-		UCHAR ucAtr[MAX_ATR_SIZE];	/* Atr for inserted card */
-		DWORD dwAtrLen;			/* Size of the ATR */
 		LPVOID vHandle;			/* Dlopen handle */
 		DWORD dwVersion;		/* IFD Handler version number */
 		DWORD dwPort;			/* Port ID */
-		DWORD dwProtocol;		/* Currently used protocol */
 		DWORD dwSlot;			/* Current Reader Slot */
 		DWORD dwBlockStatus;	/* Current blocking status */
-		DWORD dwStatus;			/* Current Status Mask */
 		DWORD dwLockId;			/* Lock Id */
 		DWORD dwIdentity;		/* Shared ID High Nibble */
 		DWORD dwContexts;		/* Number of open contexts */
-		DWORD dwPublicID;		/* Public id of public state struct */
 		PDWORD pdwFeeds;		/* Number of shared client to lib */
 		PDWORD pdwMutex;		/* Number of client to mutex */
+
+		struct pubReaderStatesList *readerState; /* link to the reader state */
+		/* we can't use PREADER_STATE here since eventhandler.h can't be
+		 * included because of circular dependencies */
 
 		/* these structures are unused */
 #if 0