[Pcsclite-cvs-commit] r4725 - in /trunk/PCSC/src: eventhandler.c readerfactory.c readerfactory.h winscard.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Feb 9 10:48:10 UTC 2010


Author: rousseau
Date: Tue Feb  9 10:48:10 2010
New Revision: 4725

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4725
Log:
In struct ReaderContext rename "dwContexts" to "contexts" since it is no
more a DWORD but a int32_t

Modified:
    trunk/PCSC/src/eventhandler.c
    trunk/PCSC/src/readerfactory.c
    trunk/PCSC/src/readerfactory.h
    trunk/PCSC/src/winscard.c

Modified: trunk/PCSC/src/eventhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/eventhandler.c?rev=4725&op=diff
==============================================================================
--- trunk/PCSC/src/eventhandler.c (original)
+++ trunk/PCSC/src/eventhandler.c Tue Feb  9 10:48:10 2010
@@ -246,7 +246,7 @@
 	memcpy(rContext->readerState->cardAtr, ucAtr, dwAtrLen);
 	rContext->readerState->readerID = i + 100;
 	rContext->readerState->readerState = dwStatus;
-	rContext->readerState->readerSharing = rContext->dwContexts;
+	rContext->readerState->readerSharing = rContext->contexts;
 	rContext->readerState->cardAtrLength = dwAtrLen;
 	rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
 
@@ -358,7 +358,7 @@
 	 */
 	rContext->readerState->readerState = dwStatus;
 	rContext->readerState->readerSharing = dwReaderSharing =
-		rContext->dwContexts;
+		rContext->contexts;
 
 	(void)EHSignalEventToClients();
 
@@ -491,9 +491,9 @@
 		/*
 		 * Sharing may change w/o an event pass it on
 		 */
-		if (dwReaderSharing != rContext->dwContexts)
-		{
-			dwReaderSharing = rContext->dwContexts;
+		if (dwReaderSharing != rContext->contexts)
+		{
+			dwReaderSharing = rContext->contexts;
 			rContext->readerState->readerSharing = dwReaderSharing;
 			(void)EHSignalEventToClients();
 		}

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=4725&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Tue Feb  9 10:48:10 2010
@@ -174,7 +174,7 @@
 	(sReadersContexts[dwContext])->dwPort = dwPort;
 	(sReadersContexts[dwContext])->mMutex = NULL;
 	(sReadersContexts[dwContext])->dwBlockStatus = 0;
-	(sReadersContexts[dwContext])->dwContexts = 0;
+	(sReadersContexts[dwContext])->contexts = 0;
 	(sReadersContexts[dwContext])->pthThread = 0;
 	(sReadersContexts[dwContext])->dwLockId = 0;
 	(sReadersContexts[dwContext])->LockCount = 0;
@@ -366,7 +366,7 @@
 		*(sReadersContexts[dwContextB])->pdwFeeds += 1;
 
 		(sReadersContexts[dwContextB])->dwBlockStatus = 0;
-		(sReadersContexts[dwContextB])->dwContexts = 0;
+		(sReadersContexts[dwContextB])->contexts = 0;
 		(sReadersContexts[dwContextB])->dwLockId = 0;
 		(sReadersContexts[dwContextB])->LockCount = 0;
 		(sReadersContexts[dwContextB])->readerState = NULL;
@@ -499,7 +499,7 @@
 		sContext->dwPort = 0;
 		sContext->mMutex = NULL;
 		sContext->dwBlockStatus = 0;
-		sContext->dwContexts = 0;
+		sContext->contexts = 0;
 		sContext->dwSlot = 0;
 		sContext->dwLockId = 0;
 		sContext->LockCount = 0;

Modified: trunk/PCSC/src/readerfactory.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.h?rev=4725&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.h (original)
+++ trunk/PCSC/src/readerfactory.h Tue Feb  9 10:48:10 2010
@@ -128,7 +128,7 @@
 		DWORD dwLockId;			/**< Lock Id */
 		DWORD dwIdentity;		/**< Shared ID High Nibble */
 		int LockCount;			/**< number of recursive locks */
-		int32_t dwContexts;		/**< Number of open contexts */
+		int32_t contexts;		/**< Number of open contexts */
 		PDWORD pdwFeeds;		/**< Number of shared client to lib */
 		PDWORD pdwMutex;		/**< Number of client to mutex */
 

Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=4725&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Tue Feb  9 10:48:10 2010
@@ -301,7 +301,7 @@
 	/*
 	 * Connect if not exclusive mode
 	 */
-	if (rContext->dwContexts == SCARD_EXCLUSIVE_CONTEXT)
+	if (rContext->contexts == SCARD_EXCLUSIVE_CONTEXT)
 	{
 		Log1(PCSC_LOG_ERROR, "Error Reader Exclusive");
 		return SCARD_E_SHARING_VIOLATION;
@@ -444,9 +444,9 @@
 
 	if (dwShareMode == SCARD_SHARE_EXCLUSIVE)
 	{
-		if (rContext->dwContexts == SCARD_NO_CONTEXT)
-		{
-			rContext->dwContexts = SCARD_EXCLUSIVE_CONTEXT;
+		if (rContext->contexts == SCARD_NO_CONTEXT)
+		{
+			rContext->contexts = SCARD_EXCLUSIVE_CONTEXT;
 			(void)RFLockSharing(*phCard);
 		}
 		else
@@ -461,7 +461,7 @@
 		/*
 		 * Add a connection to the context stack
 		 */
-		rContext->dwContexts += 1;
+		rContext->contexts += 1;
 	}
 
 	/*
@@ -475,11 +475,11 @@
 		 * Clean up - there is no more room
 		 */
 		(void)RFDestroyReaderHandle(*phCard);
-		if (rContext->dwContexts == SCARD_EXCLUSIVE_CONTEXT)
-			rContext->dwContexts = SCARD_NO_CONTEXT;
-		else
-			if (rContext->dwContexts > SCARD_NO_CONTEXT)
-				rContext->dwContexts -= 1;
+		if (rContext->contexts == SCARD_EXCLUSIVE_CONTEXT)
+			rContext->contexts = SCARD_NO_CONTEXT;
+		else
+			if (rContext->contexts > SCARD_NO_CONTEXT)
+				rContext->contexts -= 1;
 
 		*phCard = 0;
 
@@ -491,7 +491,7 @@
 	/*
 	 * Propagate new state to reader state
 	 */
-	rContext->readerState->readerSharing = rContext->dwContexts;
+	rContext->readerState->readerSharing = rContext->contexts;
 
 	PROFILE_END
 
@@ -755,16 +755,16 @@
 
 	if (dwShareMode == SCARD_SHARE_EXCLUSIVE)
 	{
-		if (rContext->dwContexts == SCARD_EXCLUSIVE_CONTEXT)
+		if (rContext->contexts == SCARD_EXCLUSIVE_CONTEXT)
 		{
 			/*
 			 * Do nothing - we are already exclusive
 			 */
 		} else
 		{
-			if (rContext->dwContexts == SCARD_LAST_CONTEXT)
+			if (rContext->contexts == SCARD_LAST_CONTEXT)
 			{
-				rContext->dwContexts = SCARD_EXCLUSIVE_CONTEXT;
+				rContext->contexts = SCARD_EXCLUSIVE_CONTEXT;
 				(void)RFLockSharing(hCard);
 			} else
 			{
@@ -773,7 +773,7 @@
 		}
 	} else if (dwShareMode == SCARD_SHARE_SHARED)
 	{
-		if (rContext->dwContexts != SCARD_EXCLUSIVE_CONTEXT)
+		if (rContext->contexts != SCARD_EXCLUSIVE_CONTEXT)
 		{
 			/*
 			 * Do nothing - in sharing mode already
@@ -784,11 +784,11 @@
 			 * We are in exclusive mode but want to share now
 			 */
 			(void)RFUnlockSharing(hCard);
-			rContext->dwContexts = SCARD_LAST_CONTEXT;
+			rContext->contexts = SCARD_LAST_CONTEXT;
 		}
 	} else if (dwShareMode == SCARD_SHARE_DIRECT)
 	{
-		if (rContext->dwContexts != SCARD_EXCLUSIVE_CONTEXT)
+		if (rContext->contexts != SCARD_EXCLUSIVE_CONTEXT)
 		{
 			/*
 			 * Do nothing - in sharing mode already
@@ -799,7 +799,7 @@
 			 * We are in exclusive mode but want to share now
 			 */
 			(void)RFUnlockSharing(hCard);
-			rContext->dwContexts = SCARD_LAST_CONTEXT;
+			rContext->contexts = SCARD_LAST_CONTEXT;
 		}
 	} else
 		return SCARD_E_INVALID_VALUE;
@@ -812,7 +812,7 @@
 	/*
 	 * Propagate new state to reader state
 	 */
-	rContext->readerState->readerSharing = rContext->dwContexts;
+	rContext->readerState->readerSharing = rContext->contexts;
 
 	return SCARD_S_SUCCESS;
 }
@@ -863,7 +863,7 @@
 	if (rv != SCARD_S_SUCCESS)
 		return rv;
 
-	Log2(PCSC_LOG_DEBUG, "Active Contexts: %d", rContext->dwContexts);
+	Log2(PCSC_LOG_DEBUG, "Active Contexts: %d", rContext->contexts);
 
 	if (dwDisposition == SCARD_RESET_CARD ||
 		dwDisposition == SCARD_UNPOWER_CARD)
@@ -978,23 +978,23 @@
 	/*
 	 * For exclusive connection reset it to no connections
 	 */
-	if (rContext->dwContexts == SCARD_EXCLUSIVE_CONTEXT)
-		rContext->dwContexts = SCARD_NO_CONTEXT;
+	if (rContext->contexts == SCARD_EXCLUSIVE_CONTEXT)
+		rContext->contexts = SCARD_NO_CONTEXT;
 	else
 	{
 		/*
 		 * Remove a connection from the context stack
 		 */
-		rContext->dwContexts -= 1;
-
-		if (rContext->dwContexts < 0)
-			rContext->dwContexts = 0;
+		rContext->contexts -= 1;
+
+		if (rContext->contexts < 0)
+			rContext->contexts = 0;
 	}
 
 	/*
 	 * Propagate new state to reader state
 	 */
-	rContext->readerState->readerSharing = rContext->dwContexts;
+	rContext->readerState->readerSharing = rContext->contexts;
 
 	return SCARD_S_SUCCESS;
 }




More information about the Pcsclite-cvs-commit mailing list