fix channel/smartcard: return value handling

Device control calls always returned SCARD_S_SUCCESS even if an error
occurred. This caused server side software (including the card manager)
to behave incorrectly.
This commit is contained in:
Bernhard Miklautz 2017-12-04 12:31:10 +01:00
parent 99c69cde27
commit 3dc4e283db

View File

@ -2039,19 +2039,8 @@ LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OP
/* Device Control Response */
Stream_Write_UINT32(irp->output, outputBufferLength); /* OutputBufferLength (4 bytes) */
if ((result = smartcard_pack_common_type_header(smartcard,
irp->output))) /* CommonTypeHeader (8 bytes) */
{
WLog_ERR(TAG, "smartcard_pack_common_type_header failed with error %"PRId32"", result);
return result;
}
if ((result = smartcard_pack_private_type_header(smartcard, irp->output,
objectBufferLength))) /* PrivateTypeHeader (8 bytes) */
{
WLog_ERR(TAG, "smartcard_pack_private_type_header failed with error %"PRId32"", result);
return result;
}
smartcard_pack_common_type_header(smartcard, irp->output); /* CommonTypeHeader (8 bytes) */
smartcard_pack_private_type_header(smartcard, irp->output, objectBufferLength); /* PrivateTypeHeader (8 bytes) */
Stream_Write_UINT32(irp->output, result); /* Result (4 bytes) */
Stream_SetPosition(irp->output, Stream_Length(irp->output));