Workaround for bug in pcsc lite where timeout value 0

for SCardGetStatusChange() behaves just like INFINIT.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1835 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Henrik Andersson 2014-09-11 11:15:46 +00:00
parent 03c53c48bd
commit fffb479e0c

View File

@ -3,7 +3,7 @@
Smart Card support
Copyright (C) Alexi Volkov <alexi@myrealbox.com> 2006
Copyright 2010-2013 Pierre Ossman <ossman@cendio.se> for Cendio AB
Copyright 2011-2013 Henrik Andersson <hean01@cendio.se> for Cendio AB
Copyright 2011-2014 Henrik Andersson <hean01@cendio.se> for Cendio AB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -1175,6 +1175,11 @@ TS_SCardGetStatusChange(STREAM in, STREAM out, RD_BOOL wide)
memset(myRsArray, 0, dwCount * sizeof(SERVER_SCARD_READERSTATE_A));
copyReaderState_ServerToMyPCSC(rsArray, myRsArray, (SERVER_DWORD) dwCount);
/* Workaround for a bug in pcsclite, timeout value of 0 is handled as INFINIT
but is by Windows PCSC spec. used for polling current state.
*/
if (dwTimeout == 0)
dwTimeout = 1;
rv = SCardGetStatusChange(myHContext, (MYPCSC_DWORD) dwTimeout,
myRsArray, (MYPCSC_DWORD) dwCount);
copyReaderState_MyPCSCToServer(myRsArray, rsArray, (MYPCSC_DWORD) dwCount);