[Pcsclite-cvs-commit] PCSC/src readerfactory.c,1.33,1.34

sauveron-guest@quantz.debian.org sauveron-guest@quantz.debian.org
Wed, 14 Jan 2004 12:46:25 +0100


Update of /cvsroot/pcsclite/PCSC/src
In directory quantz:/tmp/cvs-serv6868/src

Modified Files:
	readerfactory.c 
Log Message:
Add a new parameter to RFAddReader to get the device name

Index: readerfactory.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/readerfactory.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- readerfactory.c	13 Jan 2004 17:54:03 -0000	1.33
+++ readerfactory.c	14 Jan 2004 11:46:23 -0000	1.34
@@ -67,7 +67,7 @@
 	return rv;
 }
 
-LONG RFAddReader(LPSTR lpcReader, DWORD dwPort, LPSTR lpcLibrary)
+LONG RFAddReader(LPSTR lpcReader, DWORD dwPort, LPSTR lpcLibrary, LPSTR lpcDevice)
 {
 	DWORD dwContext, dwContextB, dwGetSize;
 	UCHAR ucGetData[1], ucThread[1];
@@ -144,6 +144,7 @@
 		lpcLibrary, dwPort, 0);
 
 	strcpy((sReadersContexts[dwContext])->lpcLibrary, lpcLibrary);
+	strcpy((sReadersContexts[dwContext])->lpcDevice, lpcDevice);
 	(sReadersContexts[dwContext])->dwVersion = 0;
 	(sReadersContexts[dwContext])->dwPort = dwPort;
 	(sReadersContexts[dwContext])->mMutex = 0;
@@ -345,6 +346,7 @@
 				lpcLibrary, dwPort, j);
 
 			strcpy((sReadersContexts[dwContextB])->lpcLibrary, lpcLibrary);
+			strcpy((sReadersContexts[dwContext])->lpcDevice, lpcDevice);
 			(sReadersContexts[dwContextB])->dwVersion =
 			  (sReadersContexts[dwContext])->dwVersion;
 			(sReadersContexts[dwContextB])->dwPort =
@@ -520,6 +522,7 @@
 			sContext->dwFeeds = 0;
 		}
 
+		sContext->lpcDevice[0] = 0;
 		sContext->dwVersion = 0;
 		sContext->dwPort = 0;
 		sContext->mMutex = 0;
@@ -1425,8 +1428,8 @@
 
 	if (rv != IFD_SUCCESS)
 	{
-		DebugLogB("RFInitializeReader: Open Port %X Failed",
-			rContext->dwPort);
+		DebugLogC("RFInitializeReader: Open Port %X Failed (%s)",
+			rContext->dwPort, rContext->lpcDevice);
 		RFUnBindFunctions(rContext);
 		RFUnloadReader(rContext);
 		return SCARD_E_INVALID_TARGET;