[Pcsclite-cvs-commit] PCSC/src README_INTERNALS.txt,1.3,1.4

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


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

Modified Files:
	README_INTERNALS.txt 
Log Message:
document the SCardControl migration


Index: README_INTERNALS.txt
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/README_INTERNALS.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- README_INTERNALS.txt	20 Oct 2003 15:49:19 -0000	1.3
+++ README_INTERNALS.txt	15 Apr 2004 09:01:52 -0000	1.4
@@ -4,8 +4,8 @@
 This file is not complete and may even not be exact. I (Ludovic
 Rousseau) am not the author of pcsc-lite so I may have missed points.
 
-The documentation correspond to pcsc-lite-1.0.2 compiled for GNU/Linux.
-Information may be wrong for other pcsc-lite versions.
+The documentation correspond to post pcsc-lite-1.2.0 compiled for
+GNU/Linux.  Information may be wrong for other pcsc-lite versions.
 
 
 History:
@@ -44,10 +44,11 @@
  winscard_msg.c
 
 
-PC/SC Lite Concepts
--------------------
+PC/SC Lite Concepts:
+--------------------
 These concepts will be available after the next release of pcsc-lite-1.2.0.
 I (Damien Sauveron) will try to explain the following concepts:
+
 #define PCSCLITE_MAX_APPLICATIONS         4	/* Maximum applications */
 #define PCSCLITE_MAX_APPLICATION_CONTEXTS 16	/* Maximum contexts by application */
 #define PCSCLITE_MAX_APPLICATIONS_CONTEXTS PCSCLITE_MAX_APPLICATIONS * PCSCLITE_MAX_APPLICATION_CONTEXTS
@@ -59,18 +60,32 @@
 #define PCSCLITE_MAX_READERS_CONTEXTS            256	/* Maximum readers context (a slot is count as a reader) */
 
 First imagine:
-- 3 PC/SC daemons started on 3 different hosts (it is possible to connect to PC/SC daemons over the network with SCardEstablishContext even if it is not yet implemented in PC/SC Lite): PC/SC D1, PC/SC D2, PC/SC D3
+- 3 PC/SC daemons started on 3 different hosts (it is possible to
+  connect to PC/SC daemons over the network with SCardEstablishContext
+  even if it is not yet implemented in PC/SC Lite): PC/SC D1, PC/SC D2,
+  PC/SC D3
 - 4 applications: App A, App B, App C, App D
-- 2 readers R1 and R2 but where R2 has 2 slots that we call R2S1 and R2S2
+- 2 readers R1 and R2 but where R2 has 2 slots that we call R2S1 and
+  R2S2
 
 On the following figure the (1), (2), ... (7) are some APPLICATION_CONTEXTS.
-Also App A has 3 APPLICATION_CONTEXTS. Each of them is created by SCardEstablishContext.
+Also App A has 3 APPLICATION_CONTEXTS. Each of them is created by
+SCardEstablishContext.
+
 PC/SC D1 handles 5 APPLICATIONS_CONTEXTS.
-PC/SC D1 also handles 3 READERS_CONTEXTS. These contexts are created for example by the plug of the readers.
-The maximum of applications contexts that PC/SC Ressources Manager can accept is thus PCSCLITE_MAX_APPLICATIONS * PCSCLITE_MAX_APPLICATION_CONTEXTS.
 
-On each of these contexts on the application side there are some APPLICATION_CONTEXT_CHANNELS. They are created by SCardConnect.
-And on each of these contexts on the reader side there are some READER_CONTEXT_CHANNELS.
+PC/SC D1 also handles 3 READERS_CONTEXTS. These contexts are created for
+example by the plug of the readers.
+
+The maximum of applications contexts that PC/SC Ressources Manager can
+accept is thus PCSCLITE_MAX_APPLICATIONS *
+PCSCLITE_MAX_APPLICATION_CONTEXTS.
+
+On each of these contexts on the application side there are some
+APPLICATION_CONTEXT_CHANNELS. They are created by SCardConnect.
+
+And on each of these contexts on the reader side there are some
+READER_CONTEXT_CHANNELS.
 
 
 PC/SC D2
@@ -89,12 +104,15 @@
                          (7)         |
                 App D ---------------/
 
-For simplify, there are 3 differents roles: Application, PC/SC Daemon and IFDhandler/reader.
-Between these role there are some contexts and on the top of them there are the channels.
+For simplify, there are 3 differents roles: Application, PC/SC Daemon
+and IFDhandler/reader.
+
+Between these role there are some contexts and on the top of them there
+are the channels.
 
 
-Daemon global variables
------------------------
+Daemon global variables:
+------------------------
 readerfactory.c
  static PREADER_CONTEXT sReadersContexts[PCSCLITE_MAX_READERS_CONTEXTS];
  static DWORD *dwNumReadersContexts = 0;
@@ -110,8 +128,50 @@
 
 
 
-Inter-thread communication
---------------------------
+IPC communication between pcscd and libpcsclite?:
+-------------------------------------------------
+
+pcscd and lipcsclite communicates through a named socket.
+With post 1.2.0 pcsc-lite versions the client (libpcsclite) and the
+server (pcscd) exchange a protocol version. With 1.2.0 and before the
+protocol is 0:0 (major:minor).
+
+The SCardControl() API changed from
+  LONG SCardControl(SCARDHANDLE hCard,
+      LPCBYTE pbSendBuffer,
+	  DWORD cbSendLength,
+	  LPBYTE pbRecvBuffer,
+	  LPDWORD pcbRecvLength);
+to
+  LONG SCardControl(SCARDHANDLE hCard,
+      DWORD dwControlCode,      <-- new
+	  LPCVOID lpInBuffer,
+	  DWORD nInBufferSize,
+	  LPVOID lpOutBuffer,
+	  DWORD nOutBufferSize,
+	  LPDWORD lpBytesReturned); <-- new
+
+This change was made to map Windows API.
+
+This change also has an impact on the ifd handler (smart card driver).
+The IFDHandler v3.0 use for post 1.2.0 version uses the new
+IFDHControl() API.
+
+We can have:
+- libpcsclite0, pcscd (<= 1.2.0) and ifdhandler 1.0 or 2.0
+ => old SCardControl
+- libpcsclite0, pcscd (> 1.2.0) and ifdhandler 1.0 or 2.0
+ => old SCardControl
+- libpcsclite1, pcscd (> 1.2.0) and ifdhandler 1.0 or 2.0
+ => old SCardControl
+- libpcsclite1, pcscd (> 1.2.0) and ifdhandler 3.0
+ => new SCardControl
+- libpcsclite1, pcscd (<= 1.2.0)
+ => does not work
+
+
+Inter-thread communication:
+---------------------------
 
 - to kill a context
 
@@ -119,7 +179,7 @@
 	rContext->dwLockId = 0xFFFF;
 
 
-
+$Id$
 -- 
 Ludovic Rousseau <ludovic.rouseau@free.fr>