Merge pull request #2799 from kaliway/scardlistreaders-fix

Smartcard Reader Connection Handling
This commit is contained in:
Marc-André Moreau 2015-07-28 08:51:03 -04:00
commit dfa29804ad

View File

@ -320,18 +320,15 @@ static UINT32 smartcard_ListReadersA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD
call->mszGroups = NULL; call->mszGroups = NULL;
} }
if (status != SCARD_S_SUCCESS)
return status;
smartcard_trace_list_readers_return(smartcard, &ret, FALSE); smartcard_trace_list_readers_return(smartcard, &ret, FALSE);
status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret); status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret);
if (status != SCARD_S_SUCCESS)
return status;
if (mszReaders) if (mszReaders)
SCardFreeMemory(operation->hContext, mszReaders); SCardFreeMemory(operation->hContext, mszReaders);
if (status != SCARD_S_SUCCESS)
return status;
return ret.ReturnCode; return ret.ReturnCode;
} }
@ -373,19 +370,15 @@ static UINT32 smartcard_ListReadersW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD
call->mszGroups = NULL; call->mszGroups = NULL;
} }
if (status != SCARD_S_SUCCESS)
return status;
smartcard_trace_list_readers_return(smartcard, &ret, TRUE); smartcard_trace_list_readers_return(smartcard, &ret, TRUE);
status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret); status = smartcard_pack_list_readers_return(smartcard, irp->output, &ret);
if (status != SCARD_S_SUCCESS)
return status;
if (mszReaders) if (mszReaders)
SCardFreeMemory(operation->hContext, mszReaders); SCardFreeMemory(operation->hContext, mszReaders);
if (status != SCARD_S_SUCCESS)
return status;
return ret.ReturnCode; return ret.ReturnCode;
} }