fix [channels/smartcard]: fix StatusW_Call

According to 2.2.2.18 Status_Call cbAtrLen is unused an must be ignored
upon receipt.
This commit is contained in:
Bernhard Miklautz 2019-07-10 18:36:34 +02:00 committed by akallabeth
parent 3c18555693
commit a311075202

View File

@ -1209,15 +1209,19 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT
Status_Call* call = operation->call; Status_Call* call = operation->call;
DWORD cbAtrLen; DWORD cbAtrLen;
if (call->cbAtrLen > 32) /**
call->cbAtrLen = 32; * [MS-RDPESC]
* According to 2.2.2.18 Status_Call cbAtrLen is unused an must be ignored upon receipt.
*/
cbAtrLen = call->cbAtrLen = 32;
call->cchReaderLen;
if (call->fmszReaderNamesIsNULL) if (call->fmszReaderNamesIsNULL)
cchReaderLen = 0; cchReaderLen = 0;
else else
cchReaderLen = SCARD_AUTOALLOCATE; cchReaderLen = SCARD_AUTOALLOCATE;
cbAtrLen = call->cbAtrLen;
ZeroMemory(ret.pbAtr, 32); ZeroMemory(ret.pbAtr, 32);
status = ret.ReturnCode = SCardStatusW(operation->hCard, status = ret.ReturnCode = SCardStatusW(operation->hCard,
call->fmszReaderNamesIsNULL ? NULL : (LPWSTR) &mszReaderNames, call->fmszReaderNamesIsNULL ? NULL : (LPWSTR) &mszReaderNames,
@ -1236,7 +1240,6 @@ static LONG smartcard_StatusW_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERAT
ret.cBytes = cchReaderLen; ret.cBytes = cchReaderLen;
#endif #endif
if (call->cbAtrLen)
ret.cbAtrLen = cbAtrLen; ret.cbAtrLen = cbAtrLen;
} }