[Pcsclite-cvs-commit] Drivers/ccid/src ccid.c,1.2,1.3 commands.c,1.4,1.5 commands.h,1.2,1.3 ifdhandler.c,1.8,1.9

rousseau@quantz.debian.org rousseau@quantz.debian.org
Thu, 15 Jan 2004 14:41:03 +0100


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory quantz:/tmp/cvs-serv17798

Modified Files:
	ccid.c commands.c commands.h ifdhandler.c 
Log Message:
use an (int *) instead of a PDWORD for rx_length argument


Index: ccid.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ccid.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ccid.c	16 Sep 2003 14:19:11 -0000	1.2
+++ ccid.c	15 Jan 2004 13:41:01 -0000	1.3
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "debug.h"
 #include "pcscdefines.h"
+#include "defs.h"
 #include "ifdhandler.h"
 #include "ccid.h"
 #include "commands.h"

Index: commands.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/commands.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- commands.c	4 Nov 2003 21:57:19 -0000	1.4
+++ commands.c	15 Jan 2004 13:41:01 -0000	1.5
@@ -24,10 +24,10 @@
 #include <string.h>
 
 #include "pcscdefines.h"
-#include "ifdhandler.h"
 #include "commands.h"
 #include "ccid.h"
 #include "defs.h"
+#include "ifdhandler.h"
 #include "config.h"
 #include "debug.h"
 
@@ -249,7 +249,7 @@
  *
  ****************************************************************************/
 RESPONSECODE CmdXfrBlock(int lun, int tx_length, unsigned char tx_buffer[],
-	PDWORD rx_length, unsigned char rx_buffer[])
+	int *rx_length, unsigned char rx_buffer[])
 {
 	RESPONSECODE return_value = IFD_SUCCESS;
 	_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(lun);
@@ -303,7 +303,7 @@
  *
  ****************************************************************************/
 RESPONSECODE CmdXfrBlockShortAPDU(int lun, int tx_length,
-	unsigned char tx_buffer[], PDWORD rx_length, unsigned char rx_buffer[])
+	unsigned char tx_buffer[], int *rx_length, unsigned char rx_buffer[])
 {
 	unsigned char cmd[10+CMD_BUF_SIZE];	/* CCID + APDU buffer */
 	status_t res;
@@ -360,7 +360,7 @@
  *
  ****************************************************************************/
 RESPONSECODE CmdXfrBlockTPDU(int lun, int tx_length, unsigned char tx_buffer[],
-	PDWORD rx_length, unsigned char rx_buffer[])
+	int  *rx_length, unsigned char rx_buffer[])
 {
 	RESPONSECODE return_value = IFD_SUCCESS;
 	int Le;

Index: commands.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/commands.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- commands.h	10 Sep 2003 09:06:41 -0000	1.2
+++ commands.h	15 Jan 2004 13:41:01 -0000	1.3
@@ -30,11 +30,11 @@
 RESPONSECODE CmdPowerOff(int lun);
 RESPONSECODE CmdGetSlotStatus(int lun, unsigned char buffer[]);
 RESPONSECODE CmdXfrBlock(int lun, int tx_length, unsigned char tx_buffer[],
-	PDWORD rx_length, unsigned char rx_buffer[]);
+	int *rx_length, unsigned char rx_buffer[]);
 RESPONSECODE CmdXfrBlockShortAPDU(int lun, int tx_length,
-	unsigned char tx_buffer[], PDWORD rx_length, unsigned char rx_buffer[]);
+	unsigned char tx_buffer[], int *rx_length, unsigned char rx_buffer[]);
 RESPONSECODE CmdXfrBlockTPDU(int lun, int tx_length, unsigned char tx_buffer[],
-	PDWORD rx_length, unsigned char rx_buffer[]);
+	int *rx_length, unsigned char rx_buffer[]);
 
 void i2dw(int value, unsigned char *buffer);
 

Index: ifdhandler.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ifdhandler.c	15 Jan 2004 08:34:20 -0000	1.8
+++ ifdhandler.c	15 Jan 2004 13:41:01 -0000	1.9
@@ -21,10 +21,10 @@
 #include <string.h>
 
 #include "pcscdefines.h"
+#include "defs.h"
 #include "ifdhandler.h"
 #include "config.h"
 #include "debug.h"
-#include "defs.h"
 #include "utils.h"
 #include "commands.h"
 
@@ -414,27 +414,27 @@
 	 * IFD_ICC_NOT_PRESENT IFD_PROTOCOL_NOT_SUPPORTED
 	 */
 
-	RESPONSECODE return_value = IFD_SUCCESS;	/* Assume it will work */
+	RESPONSECODE return_value;
+	int rx_length;
 
 	DEBUG_INFO2("lun: %X", Lun);
 
 	if (CheckLun(Lun))
 		return IFD_COMMUNICATION_ERROR;
 
+	rx_length = *RxLength;
 	switch (SendPci.Protocol)
 	{
 		case T_0:
 		case T_1:
-			return_value = CmdXfrBlock(Lun, TxLength, TxBuffer, RxLength,
+			return_value = CmdXfrBlock(Lun, TxLength, TxBuffer, &rx_length,
 				RxBuffer);
 			break;
 
 		default:
 			return_value = IFD_PROTOCOL_NOT_SUPPORTED;
 	}
-
-	if (return_value != IFD_SUCCESS)
-		*RxLength = 0;
+	*RxLength = rx_length;
 
 	return return_value;
 } /* IFDHTransmitToICC */