diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c index 3553db8e8..5ba47a958 100644 --- a/winpr/libwinpr/smartcard/smartcard_pcsc.c +++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c @@ -386,22 +386,9 @@ SCARDCONTEXT PCSC_GetCardContextFromHandle(SCARDHANDLE hCard) return pCard->hContext; } -BOOL PCSC_IsCardHandleConnected(SCARDCONTEXT hContext) -{ - PCSC_SCARDCONTEXT* pContext; - - pContext = PCSC_GetCardContextData(hContext); - - if (!pContext) - return FALSE; - - return pContext->hCard ? TRUE : FALSE; -} - PCSC_SCARDHANDLE* PCSC_ConnectCardHandle(SCARDCONTEXT hContext, SCARDHANDLE hCard) { PCSC_SCARDHANDLE* pCard; - PCSC_SCARDCONTEXT* pContext; pCard = (PCSC_SCARDHANDLE*) calloc(1, sizeof(PCSC_SCARDHANDLE)); @@ -412,10 +399,6 @@ PCSC_SCARDHANDLE* PCSC_ConnectCardHandle(SCARDCONTEXT hContext, SCARDHANDLE hCar InitializeCriticalSectionAndSpinCount(&(pCard->lock), 4000); - pContext = PCSC_GetCardContextData(hContext); - - pContext->hCard = hCard; - if (!g_CardHandles) g_CardHandles = ListDictionary_New(TRUE); @@ -427,7 +410,6 @@ PCSC_SCARDHANDLE* PCSC_ConnectCardHandle(SCARDCONTEXT hContext, SCARDHANDLE hCar void PCSC_DisconnectCardHandle(SCARDHANDLE hCard) { PCSC_SCARDHANDLE* pCard; - PCSC_SCARDCONTEXT* pContext; pCard = PCSC_GetCardHandleData(hCard); @@ -436,10 +418,6 @@ void PCSC_DisconnectCardHandle(SCARDHANDLE hCard) DeleteCriticalSection(&(pCard->lock)); - pContext = PCSC_GetCardContextData(pCard->hContext); - - pContext->hCard = 0; - free(pCard); if (!g_CardHandles) @@ -1619,9 +1597,6 @@ WINSCARDAPI LONG WINAPI PCSC_SCardConnect_Internal(SCARDCONTEXT hContext, if (!g_PCSC.pfnSCardConnect) return SCARD_E_NO_SERVICE; - if (PCSC_IsCardHandleConnected(hContext)) - return SCARD_E_SHARING_VIOLATION; - szReaderPCSC = PCSC_GetReaderNameFromAlias((char*) szReader); if (!szReaderPCSC)