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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Feb 2 10:34:00 UTC 2010


Author: rousseau
Date: Tue Feb  2 10:33:58 2010
New Revision: 4702

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4702
Log:
SCardGetAttrib(): add support of SCARD_ATTR_DEVICE_FRIENDLY_NAME as it
is better implemented in pcscd (it knows the friendly name)

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=4702&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Tue Feb  2 10:33:58 2010
@@ -95,6 +95,8 @@
 #include "sys_generic.h"
 #include "eventhandler.h"
 #include "utils.h"
+#include "reader.h"
+#include "strlcpycat.h"
 
 #undef DO_PROFILE
 #ifdef DO_PROFILE
@@ -1461,7 +1463,18 @@
 			rv = SCARD_S_SUCCESS;
 			break;
 		case IFD_ERROR_TAG:
-			rv = SCARD_E_UNSUPPORTED_FEATURE;
+			/* Special case SCARD_ATTR_DEVICE_FRIENDLY_NAME as it is better
+			 * implemented in pcscd (it knows the friendly name)
+			 */
+			if (dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME)
+			{
+				*pcbAttrLen = strlen(rContext->lpcReader)+1;
+
+				(void)strlcpy((char *)pbAttr, rContext->lpcReader, *pcbAttrLen);
+				rv = SCARD_S_SUCCESS;
+			}
+			else 
+				rv = SCARD_E_UNSUPPORTED_FEATURE;
 			break;
 		case IFD_ERROR_INSUFFICIENT_BUFFER:
 			rv = SCARD_E_INSUFFICIENT_BUFFER;




More information about the Pcsclite-cvs-commit mailing list