[Pcsclite-cvs-commit] r3120 - in /trunk/PCSC/src: winscard.c winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Sep 9 14:04:05 UTC 2008


Author: rousseau
Date: Tue Sep  9 14:04:04 2008
New Revision: 3120

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3120
Log:
SCardTransmit(): correctly pass the pioRecvPci parameter

Thanks to David L. Markowitz for the bug report

Modified:
    trunk/PCSC/src/winscard.c
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=3120&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Tue Sep  9 14:04:04 2008
@@ -1599,6 +1599,9 @@
 
 	sSendPci.Length = pioSendPci->cbPciLength;
 
+	sRecvPci.Protocol = pioRecvPci->dwProtocol;
+	sRecvPci.Length = pioRecvPci->cbPciLength;
+
 	/* the protocol number is decoded a few lines above */
 	Log2(PCSC_LOG_DEBUG, "Send Protocol: T=%d", sSendPci.Protocol);
 
@@ -1614,11 +1617,8 @@
 			cbSendLength, pbRecvBuffer, &dwRxLength, &sRecvPci);
 	}
 
-	if (pioRecvPci)
-	{
-		pioRecvPci->dwProtocol = sRecvPci.Protocol;
-		pioRecvPci->cbPciLength = sRecvPci.Length;
-	}
+	pioRecvPci->dwProtocol = sRecvPci.Protocol;
+	pioRecvPci->cbPciLength = sRecvPci.Length;
 
 	/*
 	 * Check for any errors that might have occurred

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=3120&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Tue Sep  9 14:04:04 2008
@@ -3019,8 +3019,16 @@
 		memset(scTransmitStruct.pbRecvBuffer, 0, sizeof(scTransmitStruct.pbRecvBuffer));
 		scTransmitStruct.rv = SCARD_S_SUCCESS;
 
-		scTransmitStruct.pioRecvPciProtocol = SCARD_PROTOCOL_ANY;
-		scTransmitStruct.pioRecvPciLength = sizeof(SCARD_IO_REQUEST);
+		if (pioRecvPci)
+		{
+			scTransmitStruct.pioRecvPciProtocol = pioRecvPci->dwProtocol;
+			scTransmitStruct.pioRecvPciLength = pioRecvPci->cbPciLength;
+		}
+		else
+		{
+			scTransmitStruct.pioRecvPciProtocol = SCARD_PROTOCOL_ANY;
+			scTransmitStruct.pioRecvPciLength = sizeof(SCARD_IO_REQUEST);
+		}
 
 		rv = WrapSHMWrite(SCARD_TRANSMIT,
 			psContextMap[dwContextIndex].dwClientID, sizeof(scTransmitStruct),




More information about the Pcsclite-cvs-commit mailing list