From 36c6478627a6032fb8f00216dec38e47fab44bbf Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Thu, 14 Dec 2017 16:21:19 +0100 Subject: [PATCH] fix client/smartcard: indentation and return value Integrate feedback from pull request review. --- channels/smartcard/client/smartcard_operations.c | 2 +- channels/smartcard/client/smartcard_pack.c | 6 ++---- channels/smartcard/client/smartcard_pack.h | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index 8183194..91f14a7 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -773,7 +773,7 @@ static LONG smartcard_ConnectA_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERA if ((status = smartcard_pack_connect_return(smartcard, irp->output, &ret))) { WLog_ERR(TAG, "smartcard_pack_connect_return failed with error %"PRId32"", status); - goto out_fail; + goto out_fail; } status = ret.ReturnCode; diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index fed0d2a..c5d66c1 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -75,13 +75,12 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s return SCARD_S_SUCCESS; } -LONG smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) +void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) { Stream_Write_UINT8(s, 1); /* Version (1 byte) */ Stream_Write_UINT8(s, 0x10); /* Endianness (1 byte) */ Stream_Write_UINT16(s, 8); /* CommonHeaderLength (2 bytes) */ Stream_Write_UINT32(s, 0xCCCCCCCC); /* Filler (4 bytes), should be 0xCCCCCCCC */ - return SCARD_S_SUCCESS; } LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) @@ -116,12 +115,11 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* return SCARD_S_SUCCESS; } -LONG smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, +void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 objectBufferLength) { Stream_Write_UINT32(s, objectBufferLength); /* ObjectBufferLength (4 bytes) */ Stream_Write_UINT32(s, 0x00000000); /* Filler (4 bytes), should be 0x00000000 */ - return SCARD_S_SUCCESS; } LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 size, diff --git a/channels/smartcard/client/smartcard_pack.h b/channels/smartcard/client/smartcard_pack.h index 19c0954..f7bc083 100644 --- a/channels/smartcard/client/smartcard_pack.h +++ b/channels/smartcard/client/smartcard_pack.h @@ -452,10 +452,10 @@ void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_S SCARDHANDLE hCard); LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); -LONG smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); +void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s); -LONG smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, +void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 objectBufferLength); LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, -- 2.7.4