[Pcsclite-cvs-commit] r4861 - /trunk/PCSC/src/winscard.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Apr 8 13:51:30 UTC 2010


Author: rousseau
Date: Thu Apr  8 13:51:28 2010
New Revision: 4861

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4861
Log:
SCardConnect() & SCardReconnect(): correctly log SCARD_PROTOCOL_RAW
protocol instead of "unknown"

Modified:
    trunk/PCSC/src/winscard.c

Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=4861&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Thu Apr  8 13:51:28 2010
@@ -417,13 +417,22 @@
 
 	if (dwShareMode != SCARD_SHARE_DIRECT)
 	{
-		if ((*pdwActiveProtocol != SCARD_PROTOCOL_T0)
-			&& (*pdwActiveProtocol != SCARD_PROTOCOL_T1))
-			Log2(PCSC_LOG_ERROR, "Active Protocol: unknown %d",
-				*pdwActiveProtocol);
-		else
-			Log2(PCSC_LOG_DEBUG, "Active Protocol: T=%d",
-				(*pdwActiveProtocol == SCARD_PROTOCOL_T0) ? 0 : 1);
+		switch (*pdwActiveProtocol)
+		{
+			case SCARD_PROTOCOL_T0:
+			case SCARD_PROTOCOL_T1:
+				Log2(PCSC_LOG_DEBUG, "Active Protocol: T=%d",
+					(*pdwActiveProtocol == SCARD_PROTOCOL_T0) ? 0 : 1);
+				break;
+
+			case SCARD_PROTOCOL_RAW:
+				Log1(PCSC_LOG_DEBUG, "Active Protocol: RAW");
+				break;
+
+			default:
+				Log2(PCSC_LOG_ERROR, "Active Protocol: unknown %d",
+					*pdwActiveProtocol);
+		}
 	}
 	else
 		Log1(PCSC_LOG_DEBUG, "Direct access: no protocol selected");
@@ -742,13 +751,22 @@
 
 	if (dwShareMode != SCARD_SHARE_DIRECT)
 	{
-		if ((*pdwActiveProtocol != SCARD_PROTOCOL_T0)
-			&& (*pdwActiveProtocol != SCARD_PROTOCOL_T1))
-			Log2(PCSC_LOG_ERROR, "Active Protocol: unknown %d",
-				*pdwActiveProtocol);
-		else
-			Log2(PCSC_LOG_DEBUG, "Active Protocol: T=%d",
-				(*pdwActiveProtocol == SCARD_PROTOCOL_T0) ? 0 : 1);
+		switch (*pdwActiveProtocol)
+		{
+			case SCARD_PROTOCOL_T0:
+			case SCARD_PROTOCOL_T1:
+				Log2(PCSC_LOG_DEBUG, "Active Protocol: T=%d",
+					(*pdwActiveProtocol == SCARD_PROTOCOL_T0) ? 0 : 1);
+				break;
+
+			case SCARD_PROTOCOL_RAW:
+				Log1(PCSC_LOG_DEBUG, "Active Protocol: RAW");
+				break;
+
+			default:
+				Log2(PCSC_LOG_ERROR, "Active Protocol: unknown %d",
+					*pdwActiveProtocol);
+		}
 	}
 	else
 		Log1(PCSC_LOG_DEBUG, "Direct access: no protocol selected");




More information about the Pcsclite-cvs-commit mailing list