From 19397d47fd699b1d6e824fb15ad1650e3c41491e Mon Sep 17 00:00:00 2001 From: erbth Date: Wed, 11 Jun 2014 21:45:53 +0200 Subject: [PATCH 1/3] 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)); From 1a01949b6887ebaf3b52120745ea739353ff6ad0 Mon Sep 17 00:00:00 2001 From: erbth Date: Wed, 11 Jun 2014 21:47:14 +0200 Subject: [PATCH 2/3] drive hotpluging: register mounted drives already before first hotplug --- channels/rdpdr/client/rdpdr_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 5759b5154..c1b4975c2 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -460,6 +460,8 @@ static void* drive_hotplug_thread_func(void* arg) tv.tv_sec = 1; tv.tv_usec = 0; + handle_hotplug(rdpdr); + while ((rv = select(mfd+1, NULL, NULL, &rfds, &tv)) >= 0) { if (WaitForSingleObject(rdpdr->stopEvent, 0) == WAIT_OBJECT_0) From 08424758766a5336a548ce1e7e791398933c6522 Mon Sep 17 00:00:00 2001 From: erbth Date: Thu, 12 Jun 2014 17:19:08 +0200 Subject: [PATCH 3/3] fixed getstatuschangeW 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 13ded0b8d..0e9fad24e 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -454,8 +454,9 @@ static UINT32 smartcard_GetStatusChangeW_Call(SMARTCARD_DEVICE* smartcard, SMART status = ret.ReturnCode = SCardGetStatusChangeW(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));