From 19397d47fd699b1d6e824fb15ad1650e3c41491e Mon Sep 17 00:00:00 2001 From: erbth Date: Wed, 11 Jun 2014 21:45:53 +0200 Subject: [PATCH] fixed getstatuschangeA rdp-return value in case of failure --- channels/smartcard/client/smartcard_operations.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 47f77c4e9..13ded0b8d 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -388,8 +388,9 @@ static UINT32 smartcard_GetStatusChangeA_Call(SMARTCARD_DEVICE* smartcard, SMART status = ret.ReturnCode = SCardGetStatusChangeA(operation->hContext, call->dwTimeOut, call->rgReaderStates, call->cReaders); - if (status && (status != SCARD_E_TIMEOUT) && (status != SCARD_E_CANCELLED)) - return status; + if (status && (status != SCARD_E_TIMEOUT) && (status != SCARD_E_CANCELLED)){ + call->cReaders=0; + } ret.cReaders = call->cReaders; ret.rgReaderStates = (ReaderState_Return*) calloc(ret.cReaders, sizeof(ReaderState_Return));