[Pcsclite-cvs-commit] r2975 - /trunk/PCSC/src/readerfactory.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu May 29 13:47:04 UTC 2008


Author: rousseau
Date: Thu May 29 13:47:03 2008
New Revision: 2975

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2975
Log:
RFAddReader(): try to use the reader polling thread also for the other
slots on a multi-slots reader

Modified:
    trunk/PCSC/src/readerfactory.c

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=2975&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Thu May 29 13:47:03 2008
@@ -312,6 +312,7 @@
 	{
 		char *tmpReader = NULL;
 		DWORD dwContextB = 0;
+		RESPONSECODE (*fct)(DWORD) = NULL;
 
 		/*
 		 * We must find an empty spot to put the
@@ -412,7 +413,26 @@
 			return rv;
 		}
 
-		EHSpawnEventHandler(sReadersContexts[dwContextB], NULL);
+		/* asynchronous card movement? */
+		dwGetSize = sizeof(fct);
+
+		rv = IFDGetCapabilities((sReadersContexts[dwContextB]),
+				TAG_IFD_POLLING_THREAD, &dwGetSize, (PUCHAR)&fct);
+		if ((rv != SCARD_S_SUCCESS) || (dwGetSize != sizeof(fct)))
+		{
+			fct = NULL;
+			Log1(PCSC_LOG_INFO, "Using the pcscd polling thread");
+		}
+		else
+			Log1(PCSC_LOG_INFO, "Using the reader polling thread");
+
+		rv = EHSpawnEventHandler(sReadersContexts[dwContextB], fct);
+		if (rv != SCARD_S_SUCCESS)
+		{
+			Log2(PCSC_LOG_ERROR, "%s init failed.", lpcReader);
+			RFRemoveReader(lpcReader, dwPort);
+			return rv;
+		}
 	}
 
 	return SCARD_S_SUCCESS;




More information about the Pcsclite-cvs-commit mailing list