From 8f7e1579fd6a1a99fdbba2c6a5242cdeda61ce9d Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 8 May 2019 12:26:04 +0200 Subject: [PATCH] Silenced unused parameter warnings in smartcard trace --- channels/smartcard/client/smartcard_operations.c | 5 ++- channels/smartcard/client/smartcard_pack.c | 53 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index fcc3262..aa3127f 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -1430,7 +1430,9 @@ static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation) { Long_Call* call; - IRP* irp = operation->irp; + IRP* irp; + WINPR_UNUSED(smartcard); + irp = operation->irp; operation->call = call = calloc(1, sizeof(Long_Call)); if (!call) @@ -1451,6 +1453,7 @@ static LONG smartcard_AccessStartedEvent_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation) { LONG status = SCARD_S_SUCCESS; + WINPR_UNUSED(operation); if (!smartcard->StartedEvent) smartcard->StartedEvent = SCardAccessStartedEvent(); diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index fa95d76..eeff7fb 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -34,6 +34,7 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s UINT32 filler; UINT8 endianness; UINT16 commonHeaderLength; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 8) { @@ -77,6 +78,7 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) { + WINPR_UNUSED(smartcard); Stream_Write_UINT8(s, 1); /* Version (1 byte) */ Stream_Write_UINT8(s, 0x10); /* Endianness (1 byte) */ Stream_Write_UINT16(s, 8); /* CommonHeaderLength (2 bytes) */ @@ -87,6 +89,7 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* { UINT32 filler; UINT32 objectBufferLength; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 8) { @@ -118,6 +121,7 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 objectBufferLength) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, objectBufferLength); /* ObjectBufferLength (4 bytes) */ Stream_Write_UINT32(s, 0x00000000); /* Filler (4 bytes), should be 0x00000000 */ } @@ -126,6 +130,7 @@ LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, U UINT32 alignment) { UINT32 pad; + WINPR_UNUSED(smartcard); pad = size; size = (size + alignment - 1) & ~(alignment - 1); pad = size - pad; @@ -140,6 +145,7 @@ LONG smartcard_pack_write_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UI UINT32 alignment) { UINT32 pad; + WINPR_UNUSED(smartcard); pad = size; size = (size + alignment - 1) & ~(alignment - 1); pad = size - pad; @@ -162,6 +168,7 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca REDIR_SCARDCONTEXT* context) { SCARDCONTEXT hContext = { 0 }; + WINPR_UNUSED(smartcard); if ((context->cbContext != sizeof(ULONG_PTR)) && (context->cbContext != 0)) { @@ -180,6 +187,7 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext) { + WINPR_UNUSED(smartcard); ZeroMemory(context, sizeof(REDIR_SCARDCONTEXT)); context->cbContext = sizeof(ULONG_PTR); CopyMemory(&(context->pbContext), &hContext, context->cbContext); @@ -189,6 +197,7 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard REDIR_SCARDHANDLE* handle) { SCARDHANDLE hCard = 0; + WINPR_UNUSED(smartcard); if (handle->cbHandle != sizeof(ULONG_PTR)) { @@ -207,6 +216,7 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDHANDLE* handle, SCARDHANDLE hCard) { + WINPR_UNUSED(smartcard); ZeroMemory(handle, sizeof(REDIR_SCARDHANDLE)); handle->cbHandle = sizeof(ULONG_PTR); CopyMemory(&(handle->pbHandle), &hCard, handle->cbHandle); @@ -216,6 +226,7 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* REDIR_SCARDCONTEXT* context) { UINT32 pbContextNdrPtr; + WINPR_UNUSED(smartcard); ZeroMemory(context, sizeof(REDIR_SCARDCONTEXT)); if (Stream_GetRemainingLength(s) < 4) @@ -264,6 +275,7 @@ LONG smartcard_pack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDCONTEXT* context) { UINT32 pbContextNdrPtr; + WINPR_UNUSED(smartcard); pbContextNdrPtr = (context->cbContext) ? 0x00020001 : 0; Stream_Write_UINT32(s, context->cbContext); /* cbContext (4 bytes) */ Stream_Write_UINT32(s, pbContextNdrPtr); /* pbContextNdrPtr (4 bytes) */ @@ -274,6 +286,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre REDIR_SCARDCONTEXT* context) { UINT32 length; + WINPR_UNUSED(smartcard); if (context->cbContext == 0) return SCARD_S_SUCCESS; @@ -318,6 +331,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDCONTEXT* context) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, context->cbContext); /* Length (4 bytes) */ if (context->cbContext) @@ -332,6 +346,7 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s REDIR_SCARDHANDLE* handle) { UINT32 pbHandleNdrPtr; + WINPR_UNUSED(smartcard); ZeroMemory(handle, sizeof(REDIR_SCARDHANDLE)); if (Stream_GetRemainingLength(s) < 4) @@ -358,6 +373,7 @@ LONG smartcard_pack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDHANDLE* handle) { UINT32 pbHandleNdrPtr; + WINPR_UNUSED(smartcard); pbHandleNdrPtr = (handle->cbHandle) ? 0x00020002 : 0; Stream_Write_UINT32(s, handle->cbHandle); /* cbHandle (4 bytes) */ Stream_Write_UINT32(s, pbHandleNdrPtr); /* pbHandleNdrPtr (4 bytes) */ @@ -368,6 +384,7 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea REDIR_SCARDHANDLE* handle) { UINT32 length; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 4) { @@ -407,6 +424,7 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDHANDLE* handle) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, handle->cbHandle); /* Length (4 bytes) */ if (handle->cbHandle) @@ -418,6 +436,8 @@ LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, EstablishContext_Call* call) { + WINPR_UNUSED(smartcard); + if (Stream_GetRemainingLength(s) < 4) { WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %"PRIuz", Expected: 4", @@ -432,6 +452,8 @@ LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStrea void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, EstablishContext_Call* call) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -462,6 +484,7 @@ void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, EstablishContext_Return* ret) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -505,6 +528,7 @@ LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* call, const char* name) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -529,6 +553,8 @@ void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* cal void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, Long_Return* ret, const char* name) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -568,6 +594,7 @@ void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, ListReaderGroups_Call* call, BOOL unicode) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -622,6 +649,7 @@ void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, int index; int length; char* mszA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -730,6 +758,7 @@ void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, ListReaders_ { BYTE* pb; char* mszGroupsA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -807,6 +836,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, ListReader size_t index; size_t length; char* mszA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -926,6 +956,7 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, ConnectA_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -999,6 +1030,7 @@ void smartcard_trace_connect_w_call(SMARTCARD_DEVICE* smartcard, ConnectW_Call* { BYTE* pb; char* szReaderA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1060,6 +1092,7 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, Connect_Return* ret) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1142,6 +1175,7 @@ LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Re void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1185,12 +1219,15 @@ void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* LONG smartcard_pack_reconnect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Reconnect_Return* ret) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, ret->dwActiveProtocol); /* dwActiveProtocol (4 bytes) */ return SCARD_S_SUCCESS; } void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, Reconnect_Return* ret) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1244,6 +1281,7 @@ void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, HCardAndDisposition_Call* call, const char* name) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1417,6 +1455,7 @@ void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; LPSCARD_READERSTATEA readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1584,6 +1623,7 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; LPSCARD_READERSTATEW readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1632,6 +1672,7 @@ LONG smartcard_pack_get_status_change_return(SMARTCARD_DEVICE* smartcard, wStrea { UINT32 index; ReaderState_Return* rgReaderState; + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, ret->cReaders); /* cReaders (4 bytes) */ Stream_Write_UINT32(s, 0x00020100); /* rgReaderStatesNdrPtr (4 bytes) */ Stream_Write_UINT32(s, ret->cReaders); /* rgReaderStatesNdrCount (4 bytes) */ @@ -1657,6 +1698,7 @@ void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; ReaderState_Return* rgReaderState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1782,6 +1824,7 @@ LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Statu void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, Status_Call* call, BOOL unicode) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1855,6 +1898,7 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, Status_Return* r size_t length; char* pbAtr = NULL; char* mszReaderNamesA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1960,6 +2004,7 @@ LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, G void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2027,6 +2072,8 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, GetAttrib_Return* ret, DWORD dwAttrId) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2129,6 +2176,7 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, Control_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2210,6 +2258,8 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_control_return(SMARTCARD_DEVICE* smartcard, Control_Return* ret) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2483,6 +2533,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c BYTE* pb; UINT32 cbExtraBytes; BYTE* pbExtraBytes; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2644,6 +2695,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Retur { UINT32 cbExtraBytes; BYTE* pbExtraBytes; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2868,6 +2920,7 @@ void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, char* szCurrentState; char* rgbAtr; LPSCARD_READERSTATEA readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; -- 2.7.4