[Pcsclite-cvs-commit] r4453 - in /trunk/PCSC/src: pcscd.h.in readerfactory.c winscard_clnt.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Oct 8 12:16:32 UTC 2009


Author: rousseau
Date: Thu Oct  8 12:16:30 2009
New Revision: 4453

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4453
Log:
do not use contextBlockStatus tpo block/unblock a context. We now use
SCardCancel() on the server side to unblock SCardGetStatusChange()

Modified:
    trunk/PCSC/src/pcscd.h.in
    trunk/PCSC/src/readerfactory.c
    trunk/PCSC/src/winscard_clnt.c

Modified: trunk/PCSC/src/pcscd.h.in
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcscd.h.in?rev=4453&op=diff
==============================================================================
--- trunk/PCSC/src/pcscd.h.in (original)
+++ trunk/PCSC/src/pcscd.h.in Thu Oct  8 12:16:30 2009
@@ -20,9 +20,6 @@
 #define SCARD_RESET			0x0001	/**< Card was reset */
 #define SCARD_INSERTED			0x0002	/**< Card was inserted */
 #define SCARD_REMOVED			0x0004	/**< Card was removed */
-
-#define BLOCK_STATUS_RESUME		0x00FF	/**< Normal resume */
-#define BLOCK_STATUS_BLOCKING		0x00FA	/**< Function is blocking */
 
 #define PCSCLITE_CONFIG_DIR		"@confdir_exp@"
 

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=4453&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Thu Oct  8 12:16:30 2009
@@ -1011,7 +1011,6 @@
 
 LONG RFUnblockReader(PREADER_CONTEXT rContext)
 {
-	rContext->dwBlockStatus = BLOCK_STATUS_RESUME;
 	return SCARD_S_SUCCESS;
 }
 

Modified: trunk/PCSC/src/winscard_clnt.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard_clnt.c?rev=4453&op=diff
==============================================================================
--- trunk/PCSC/src/winscard_clnt.c (original)
+++ trunk/PCSC/src/winscard_clnt.c Thu Oct  8 12:16:30 2009
@@ -193,7 +193,6 @@
 {
 	DWORD dwClientID;				/**< Client Connection ID */
 	SCARDCONTEXT hContext;			/**< Application Context ID */
-	DWORD contextBlockStatus;
 	PCSCLITE_MUTEX_T mMutex;		/**< Mutex for this context */
 	CHANNEL_MAP psChannelMap[PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS];
 } psContextMap[PCSCLITE_MAX_APPLICATION_CONTEXTS];
@@ -404,7 +403,6 @@
 			 */
 			psContextMap[i].dwClientID = 0;
 			psContextMap[i].hContext = 0;
-			psContextMap[i].contextBlockStatus = BLOCK_STATUS_RESUME;
 			psContextMap[i].mMutex = NULL;
 
 			for (j = 0; j < PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS; j++)
@@ -1860,8 +1858,6 @@
 
 	/* Now is where we start our event checking loop */
 	Log1(PCSC_LOG_DEBUG, "Event Loop Start");
-
-	psContextMap[dwContextIndex].contextBlockStatus = BLOCK_STATUS_BLOCKING;
 
 	/* Get the initial reader count on the system */
 	for (j=0; j < PCSCLITE_MAX_READERS_CONTEXTS; j++)
@@ -2157,10 +2153,6 @@
 			if (dwBreakFlag == 1)
 				break;
 
-			if (BLOCK_STATUS_RESUME
-				== psContextMap[dwContextIndex].contextBlockStatus)
-				break;
-
 			/* Only sleep once for each cycle of reader checks. */
 			{
 				struct wait_reader_state_change waitStatusStruct;
@@ -2251,9 +2243,6 @@
 		}
 	}
 	while (1);
-
-	if (psContextMap[dwContextIndex].contextBlockStatus == BLOCK_STATUS_RESUME)
-		rv = SCARD_E_CANCELLED;
 
 end:
 	Log1(PCSC_LOG_DEBUG, "Event Loop End");
@@ -3325,12 +3314,6 @@
 	if (dwContextIndex == -1)
 		return SCARD_E_INVALID_HANDLE;
 
-	/*
-	 * Set the block status for this Context so blocking calls will
-	 * complete
-	 */
-	psContextMap[dwContextIndex].contextBlockStatus = BLOCK_STATUS_RESUME;
-
 	/* create a new connection to the server */
 	if (SHMClientSetupSession(&dwClientID) != 0)
 	{
@@ -3449,7 +3432,6 @@
 		{
 			psContextMap[i].hContext = hContext;
 			psContextMap[i].dwClientID = dwClientID;
-			psContextMap[i].contextBlockStatus = BLOCK_STATUS_RESUME;
 			psContextMap[i].mMutex = malloc(sizeof(PCSCLITE_MUTEX));
 			(void)SYS_MutexInit(psContextMap[i].mMutex);
 			return SCARD_S_SUCCESS;
@@ -3540,7 +3522,6 @@
 	psContextMap[indice].dwClientID = 0;
 	free(psContextMap[indice].mMutex);
 	psContextMap[indice].mMutex = NULL;
-	psContextMap[indice].contextBlockStatus = BLOCK_STATUS_RESUME;
 
 	for (i = 0; i < PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS; i++)
 	{




More information about the Pcsclite-cvs-commit mailing list