From b342194d4bd38962b54bfec59d4d0fe8769e42b3 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 7 Feb 2023 16:56:07 +0100 Subject: [PATCH] [includes] add missing c++ guards --- include/freerdp/channels/echo.h | 7 + include/freerdp/channels/log.h | 7 + include/freerdp/channels/rdp2tcp.h | 8 + include/freerdp/channels/rdpecam.h | 60 ++++--- include/freerdp/channels/rdpgfx.h | 37 ++-- include/freerdp/gdi/video.h | 27 ++- include/freerdp/utils/smartcard_call.h | 37 ++-- include/freerdp/utils/smartcard_operations.h | 110 ++++++------ include/freerdp/utils/smartcard_pack.h | 178 ++++++++++--------- include/freerdp/utils/smartcardlogon.h | 57 +++--- 10 files changed, 308 insertions(+), 220 deletions(-) diff --git a/include/freerdp/channels/echo.h b/include/freerdp/channels/echo.h index 47e78f299..aca56cc49 100644 --- a/include/freerdp/channels/echo.h +++ b/include/freerdp/channels/echo.h @@ -27,4 +27,11 @@ #define ECHO_DVC_CHANNEL_NAME "ECHO" +#ifdef __cplusplus +extern "C" +{ +#endif +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_ECHO_H */ diff --git a/include/freerdp/channels/log.h b/include/freerdp/channels/log.h index 51a653e70..36934e651 100644 --- a/include/freerdp/channels/log.h +++ b/include/freerdp/channels/log.h @@ -25,4 +25,11 @@ #define CHANNELS_TAG(tag) FREERDP_TAG("channels.") tag +#ifdef __cplusplus +extern "C" +{ +#endif +#ifdef __cplusplus +} +#endif #endif /* FREERDP_UTILS_DEBUG_H */ diff --git a/include/freerdp/channels/rdp2tcp.h b/include/freerdp/channels/rdp2tcp.h index f332795e7..24375e5ed 100644 --- a/include/freerdp/channels/rdp2tcp.h +++ b/include/freerdp/channels/rdp2tcp.h @@ -27,4 +27,12 @@ #define RDP2TCP_DVC_CHANNEL_NAME "rdp2tcp" +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_RDP2TCP_H */ diff --git a/include/freerdp/channels/rdpecam.h b/include/freerdp/channels/rdpecam.h index 2d5ae4008..856f5eb2e 100644 --- a/include/freerdp/channels/rdpecam.h +++ b/include/freerdp/channels/rdpecam.h @@ -27,33 +27,38 @@ #define RDPECAM_DVC_CHANNEL_NAME "rdpecam" #define RDPECAM_CONTROL_DVC_CHANNEL_NAME "RDCamera_Device_Enumerator" -typedef enum +#ifdef __cplusplus +extern "C" { - CAM_MSG_ID_SuccessResponse = 0x01, - CAM_MSG_ID_ErrorResponse = 0x02, - CAM_MSG_ID_SelectVersionRequest = 0x03, - CAM_MSG_ID_SelectVersionResponse = 0x04, - CAM_MSG_ID_DeviceAddedNotification = 0x05, - CAM_MSG_ID_DeviceRemovedNotification = 0x06, - CAM_MSG_ID_ActivateDeviceRequest = 0x07, - CAM_MSG_ID_DeactivateDeviceRequest = 0x08, - CAM_MSG_ID_StreamListRequest = 0x09, - CAM_MSG_ID_StreamListResponse = 0x0A, - CAM_MSG_ID_MediaTypeListRequest = 0x0B, - CAM_MSG_ID_MediaTypeListResponse = 0x0C, - CAM_MSG_ID_CurrentMediaTypeRequest = 0x0D, - CAM_MSG_ID_CurrentMediaTypeResponse = 0x0E, - CAM_MSG_ID_StartStreamsRequest = 0x0F, - CAM_MSG_ID_StopStreamsRequest = 0x10, - CAM_MSG_ID_SampleRequest = 0x11, - CAM_MSG_ID_SampleResponse = 0x12, - CAM_MSG_ID_SampleErrorResponse = 0x13, - CAM_MSG_ID_PropertyListRequest = 0x14, - CAM_MSG_ID_PropertyListResponse = 0x15, - CAM_MSG_ID_PropertyValueRequest = 0x16, - CAM_MSG_ID_PropertyValueResponse = 0x17, - CAM_MSG_ID_SetPropertyValueRequest = 0x18, -} CAM_MSG_ID; +#endif + + typedef enum + { + CAM_MSG_ID_SuccessResponse = 0x01, + CAM_MSG_ID_ErrorResponse = 0x02, + CAM_MSG_ID_SelectVersionRequest = 0x03, + CAM_MSG_ID_SelectVersionResponse = 0x04, + CAM_MSG_ID_DeviceAddedNotification = 0x05, + CAM_MSG_ID_DeviceRemovedNotification = 0x06, + CAM_MSG_ID_ActivateDeviceRequest = 0x07, + CAM_MSG_ID_DeactivateDeviceRequest = 0x08, + CAM_MSG_ID_StreamListRequest = 0x09, + CAM_MSG_ID_StreamListResponse = 0x0A, + CAM_MSG_ID_MediaTypeListRequest = 0x0B, + CAM_MSG_ID_MediaTypeListResponse = 0x0C, + CAM_MSG_ID_CurrentMediaTypeRequest = 0x0D, + CAM_MSG_ID_CurrentMediaTypeResponse = 0x0E, + CAM_MSG_ID_StartStreamsRequest = 0x0F, + CAM_MSG_ID_StopStreamsRequest = 0x10, + CAM_MSG_ID_SampleRequest = 0x11, + CAM_MSG_ID_SampleResponse = 0x12, + CAM_MSG_ID_SampleErrorResponse = 0x13, + CAM_MSG_ID_PropertyListRequest = 0x14, + CAM_MSG_ID_PropertyListResponse = 0x15, + CAM_MSG_ID_PropertyValueRequest = 0x16, + CAM_MSG_ID_PropertyValueResponse = 0x17, + CAM_MSG_ID_SetPropertyValueRequest = 0x18, + } CAM_MSG_ID; #define CAM_HEADER_SIZE 2 @@ -333,4 +338,7 @@ typedef struct CAM_PROPERTY_VALUE PropertyValue; } CAM_SET_PROPERTY_VALUE_REQUEST; +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_RDPECAM_H */ diff --git a/include/freerdp/channels/rdpgfx.h b/include/freerdp/channels/rdpgfx.h index 4d7ef885d..4e72ec1c7 100644 --- a/include/freerdp/channels/rdpgfx.h +++ b/include/freerdp/channels/rdpgfx.h @@ -26,23 +26,27 @@ #define RDPGFX_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Graphics" -/** - * Common Data Types - */ - -typedef struct +#ifdef __cplusplus +extern "C" { - UINT16 x; - UINT16 y; -} RDPGFX_POINT16; +#endif + /** + * Common Data Types + */ -typedef struct -{ - BYTE B; - BYTE G; - BYTE R; - BYTE XA; -} RDPGFX_COLOR32; + typedef struct + { + UINT16 x; + UINT16 y; + } RDPGFX_POINT16; + + typedef struct + { + BYTE B; + BYTE G; + BYTE R; + BYTE XA; + } RDPGFX_COLOR32; #define GFX_PIXEL_FORMAT_XRGB_8888 0x20 #define GFX_PIXEL_FORMAT_ARGB_8888 0x21 @@ -398,4 +402,7 @@ typedef struct UINT16 timeDiffEDR; } RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU; +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_RDPGFX_H */ diff --git a/include/freerdp/gdi/video.h b/include/freerdp/gdi/video.h index 9d740035a..58717fe24 100644 --- a/include/freerdp/gdi/video.h +++ b/include/freerdp/gdi/video.h @@ -24,18 +24,27 @@ #include #include -typedef struct s_gdiVideoContext gdiVideoContext; +#ifdef __cplusplus +extern "C" +{ +#endif -FREERDP_API void gdi_video_geometry_init(rdpGdi* gdi, GeometryClientContext* geom); -FREERDP_API void gdi_video_geometry_uninit(rdpGdi* gdi, GeometryClientContext* geom); + typedef struct s_gdiVideoContext gdiVideoContext; -FREERDP_API void gdi_video_control_init(rdpGdi* gdi, VideoClientContext* video); -FREERDP_API void gdi_video_control_uninit(rdpGdi* gdi, VideoClientContext* video); + FREERDP_API void gdi_video_geometry_init(rdpGdi* gdi, GeometryClientContext* geom); + FREERDP_API void gdi_video_geometry_uninit(rdpGdi* gdi, GeometryClientContext* geom); -FREERDP_API void gdi_video_data_init(rdpGdi* gdi, VideoClientContext* video); -FREERDP_API void gdi_video_data_uninit(rdpGdi* gdi, VideoClientContext* context); + FREERDP_API void gdi_video_control_init(rdpGdi* gdi, VideoClientContext* video); + FREERDP_API void gdi_video_control_uninit(rdpGdi* gdi, VideoClientContext* video); -FREERDP_API gdiVideoContext* gdi_video_new(rdpGdi* gdi); -FREERDP_API void gdi_video_free(gdiVideoContext* context); + FREERDP_API void gdi_video_data_init(rdpGdi* gdi, VideoClientContext* video); + FREERDP_API void gdi_video_data_uninit(rdpGdi* gdi, VideoClientContext* context); + + FREERDP_API gdiVideoContext* gdi_video_new(rdpGdi* gdi); + FREERDP_API void gdi_video_free(gdiVideoContext* context); + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_GDI_VIDEO_H_ */ diff --git a/include/freerdp/utils/smartcard_call.h b/include/freerdp/utils/smartcard_call.h index 51d126e54..052af0f47 100644 --- a/include/freerdp/utils/smartcard_call.h +++ b/include/freerdp/utils/smartcard_call.h @@ -33,22 +33,29 @@ typedef struct s_scard_call_context scard_call_context; -FREERDP_API scard_call_context* smartcard_call_context_new(const rdpSettings* settings); -FREERDP_API void smartcard_call_context_free(scard_call_context* ctx); -FREERDP_API BOOL smartcard_call_context_signal_stop(scard_call_context* ctx, BOOL reset); -FREERDP_API BOOL smartcard_call_context_add(scard_call_context* ctx, const char* name); -FREERDP_API BOOL smartcard_call_cancel_context(scard_call_context* ctx, SCARDCONTEXT context); -FREERDP_API BOOL smartcard_call_cancel_all_context(scard_call_context* ctx); -FREERDP_API BOOL smartcard_call_release_context(scard_call_context* ctx, SCARDCONTEXT context); -FREERDP_API BOOL smartcard_call_is_configured(scard_call_context* ctx); +#ifdef __cplusplus +extern "C" +{ +#endif + FREERDP_API scard_call_context* smartcard_call_context_new(const rdpSettings* settings); + FREERDP_API void smartcard_call_context_free(scard_call_context* ctx); + FREERDP_API BOOL smartcard_call_context_signal_stop(scard_call_context* ctx, BOOL reset); + FREERDP_API BOOL smartcard_call_context_add(scard_call_context* ctx, const char* name); + FREERDP_API BOOL smartcard_call_cancel_context(scard_call_context* ctx, SCARDCONTEXT context); + FREERDP_API BOOL smartcard_call_cancel_all_context(scard_call_context* ctx); + FREERDP_API BOOL smartcard_call_release_context(scard_call_context* ctx, SCARDCONTEXT context); + FREERDP_API BOOL smartcard_call_is_configured(scard_call_context* ctx); -FREERDP_API BOOL smarcard_call_set_callbacks(scard_call_context* ctx, void* userdata, - void* (*fn_new)(void*, SCARDCONTEXT), - void (*fn_free)(void*)); -FREERDP_API void* smartcard_call_get_context(scard_call_context* ctx, SCARDCONTEXT hContext); + FREERDP_API BOOL smarcard_call_set_callbacks(scard_call_context* ctx, void* userdata, + void* (*fn_new)(void*, SCARDCONTEXT), + void (*fn_free)(void*)); + FREERDP_API void* smartcard_call_get_context(scard_call_context* ctx, SCARDCONTEXT hContext); -FREERDP_API LONG smartcard_irp_device_control_call(scard_call_context* context, wStream* out, - UINT32* pIoStatus, - SMARTCARD_OPERATION* operation); + FREERDP_API LONG smartcard_irp_device_control_call(scard_call_context* context, wStream* out, + UINT32* pIoStatus, + SMARTCARD_OPERATION* operation); +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_SMARTCARD_CALL_H */ diff --git a/include/freerdp/utils/smartcard_operations.h b/include/freerdp/utils/smartcard_operations.h index fc011639b..cab7facfa 100644 --- a/include/freerdp/utils/smartcard_operations.h +++ b/include/freerdp/utils/smartcard_operations.h @@ -30,59 +30,67 @@ #include #include -typedef struct +#ifdef __cplusplus +extern "C" { - union +#endif + typedef struct { - Handles_Call handles; - Long_Call lng; - Context_Call context; - ContextAndStringA_Call contextAndStringA; - ContextAndStringW_Call contextAndStringW; - ContextAndTwoStringA_Call contextAndTwoStringA; - ContextAndTwoStringW_Call contextAndTwoStringW; - EstablishContext_Call establishContext; - ListReaderGroups_Call listReaderGroups; - ListReaders_Call listReaders; - GetStatusChangeA_Call getStatusChangeA; - LocateCardsA_Call locateCardsA; - LocateCardsW_Call locateCardsW; - LocateCards_ATRMask locateCardsATRMask; - LocateCardsByATRA_Call locateCardsByATRA; - LocateCardsByATRW_Call locateCardsByATRW; - GetStatusChangeW_Call getStatusChangeW; - GetReaderIcon_Call getReaderIcon; - GetDeviceTypeId_Call getDeviceTypeId; - Connect_Common_Call connect; - ConnectA_Call connectA; - ConnectW_Call connectW; - Reconnect_Call reconnect; - HCardAndDisposition_Call hCardAndDisposition; - State_Call state; - Status_Call status; - SCardIO_Request scardIO; - Transmit_Call transmit; - GetTransmitCount_Call getTransmitCount; - Control_Call control; - GetAttrib_Call getAttrib; - SetAttrib_Call setAttrib; - ReadCache_Common readCache; - ReadCacheA_Call readCacheA; - ReadCacheW_Call readCacheW; - WriteCache_Common writeCache; - WriteCacheA_Call writeCacheA; - WriteCacheW_Call writeCacheW; - } call; - UINT32 ioControlCode; - UINT32 completionID; - UINT32 deviceID; - SCARDCONTEXT hContext; - SCARDHANDLE hCard; - const char* ioControlCodeName; -} SMARTCARD_OPERATION; + union + { + Handles_Call handles; + Long_Call lng; + Context_Call context; + ContextAndStringA_Call contextAndStringA; + ContextAndStringW_Call contextAndStringW; + ContextAndTwoStringA_Call contextAndTwoStringA; + ContextAndTwoStringW_Call contextAndTwoStringW; + EstablishContext_Call establishContext; + ListReaderGroups_Call listReaderGroups; + ListReaders_Call listReaders; + GetStatusChangeA_Call getStatusChangeA; + LocateCardsA_Call locateCardsA; + LocateCardsW_Call locateCardsW; + LocateCards_ATRMask locateCardsATRMask; + LocateCardsByATRA_Call locateCardsByATRA; + LocateCardsByATRW_Call locateCardsByATRW; + GetStatusChangeW_Call getStatusChangeW; + GetReaderIcon_Call getReaderIcon; + GetDeviceTypeId_Call getDeviceTypeId; + Connect_Common_Call connect; + ConnectA_Call connectA; + ConnectW_Call connectW; + Reconnect_Call reconnect; + HCardAndDisposition_Call hCardAndDisposition; + State_Call state; + Status_Call status; + SCardIO_Request scardIO; + Transmit_Call transmit; + GetTransmitCount_Call getTransmitCount; + Control_Call control; + GetAttrib_Call getAttrib; + SetAttrib_Call setAttrib; + ReadCache_Common readCache; + ReadCacheA_Call readCacheA; + ReadCacheW_Call readCacheW; + WriteCache_Common writeCache; + WriteCacheA_Call writeCacheA; + WriteCacheW_Call writeCacheW; + } call; + UINT32 ioControlCode; + UINT32 completionID; + UINT32 deviceID; + SCARDCONTEXT hContext; + SCARDHANDLE hCard; + const char* ioControlCodeName; + } SMARTCARD_OPERATION; -FREERDP_API LONG smartcard_irp_device_control_decode(wStream* s, UINT32 CompletionId, UINT32 FileId, - SMARTCARD_OPERATION* operation); -FREERDP_API void smartcard_operation_free(SMARTCARD_OPERATION* op, BOOL allocated); + FREERDP_API LONG smartcard_irp_device_control_decode(wStream* s, UINT32 CompletionId, + UINT32 FileId, + SMARTCARD_OPERATION* operation); + FREERDP_API void smartcard_operation_free(SMARTCARD_OPERATION* op, BOOL allocated); +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_SMARTCARD_CLIENT_OPERATIONS_H */ diff --git a/include/freerdp/utils/smartcard_pack.h b/include/freerdp/utils/smartcard_pack.h index fa342cd90..42a4f02e6 100644 --- a/include/freerdp/utils/smartcard_pack.h +++ b/include/freerdp/utils/smartcard_pack.h @@ -34,135 +34,153 @@ #define SMARTCARD_COMMON_TYPE_HEADER_LENGTH 8 #define SMARTCARD_PRIVATE_TYPE_HEADER_LENGTH 8 -FREERDP_API LONG smartcard_pack_write_size_align(wStream* s, size_t size, UINT32 alignment); -FREERDP_API LONG smartcard_unpack_read_size_align(wStream* s, size_t size, UINT32 alignment); +#ifdef __cplusplus +extern "C" +{ +#endif -FREERDP_API SCARDCONTEXT smartcard_scard_context_native_from_redir(REDIR_SCARDCONTEXT* context); -FREERDP_API void smartcard_scard_context_native_to_redir(REDIR_SCARDCONTEXT* context, - SCARDCONTEXT hContext); + FREERDP_API LONG smartcard_pack_write_size_align(wStream* s, size_t size, UINT32 alignment); + FREERDP_API LONG smartcard_unpack_read_size_align(wStream* s, size_t size, UINT32 alignment); -FREERDP_API SCARDHANDLE smartcard_scard_handle_native_from_redir(REDIR_SCARDHANDLE* handle); -FREERDP_API void smartcard_scard_handle_native_to_redir(REDIR_SCARDHANDLE* handle, - SCARDHANDLE hCard); + FREERDP_API SCARDCONTEXT smartcard_scard_context_native_from_redir(REDIR_SCARDCONTEXT* context); + FREERDP_API void smartcard_scard_context_native_to_redir(REDIR_SCARDCONTEXT* context, + SCARDCONTEXT hContext); -FREERDP_API LONG smartcard_unpack_common_type_header(wStream* s); -FREERDP_API void smartcard_pack_common_type_header(wStream* s); + FREERDP_API SCARDHANDLE smartcard_scard_handle_native_from_redir(REDIR_SCARDHANDLE* handle); + FREERDP_API void smartcard_scard_handle_native_to_redir(REDIR_SCARDHANDLE* handle, + SCARDHANDLE hCard); -FREERDP_API LONG smartcard_unpack_private_type_header(wStream* s); -FREERDP_API void smartcard_pack_private_type_header(wStream* s, UINT32 objectBufferLength); + FREERDP_API LONG smartcard_unpack_common_type_header(wStream* s); + FREERDP_API void smartcard_pack_common_type_header(wStream* s); -FREERDP_API LONG smartcard_unpack_establish_context_call(wStream* s, EstablishContext_Call* call); + FREERDP_API LONG smartcard_unpack_private_type_header(wStream* s); + FREERDP_API void smartcard_pack_private_type_header(wStream* s, UINT32 objectBufferLength); -FREERDP_API LONG smartcard_pack_establish_context_return(wStream* s, - const EstablishContext_Return* ret); + FREERDP_API LONG smartcard_unpack_establish_context_call(wStream* s, + EstablishContext_Call* call); -FREERDP_API LONG smartcard_unpack_context_call(wStream* s, Context_Call* call, const char* name); + FREERDP_API LONG smartcard_pack_establish_context_return(wStream* s, + const EstablishContext_Return* ret); -FREERDP_API void smartcard_trace_long_return(const Long_Return* ret, const char* name); + FREERDP_API LONG smartcard_unpack_context_call(wStream* s, Context_Call* call, + const char* name); -FREERDP_API LONG smartcard_unpack_list_reader_groups_call(wStream* s, ListReaderGroups_Call* call, - BOOL unicode); + FREERDP_API void smartcard_trace_long_return(const Long_Return* ret, const char* name); -FREERDP_API LONG smartcard_pack_list_reader_groups_return(wStream* s, - const ListReaderGroups_Return* ret, - BOOL unicode); + FREERDP_API LONG smartcard_unpack_list_reader_groups_call(wStream* s, + ListReaderGroups_Call* call, + BOOL unicode); -FREERDP_API LONG smartcard_unpack_list_readers_call(wStream* s, ListReaders_Call* call, - BOOL unicode); + FREERDP_API LONG smartcard_pack_list_reader_groups_return(wStream* s, + const ListReaderGroups_Return* ret, + BOOL unicode); -FREERDP_API LONG smartcard_pack_list_readers_return(wStream* s, const ListReaders_Return* ret, - BOOL unicode); + FREERDP_API LONG smartcard_unpack_list_readers_call(wStream* s, ListReaders_Call* call, + BOOL unicode); -FREERDP_API LONG smartcard_unpack_context_and_two_strings_a_call(wStream* s, - ContextAndTwoStringA_Call* call); + FREERDP_API LONG smartcard_pack_list_readers_return(wStream* s, const ListReaders_Return* ret, + BOOL unicode); -FREERDP_API LONG smartcard_unpack_context_and_two_strings_w_call(wStream* s, - ContextAndTwoStringW_Call* call); + FREERDP_API LONG + smartcard_unpack_context_and_two_strings_a_call(wStream* s, ContextAndTwoStringA_Call* call); -FREERDP_API LONG smartcard_unpack_context_and_string_a_call(wStream* s, - ContextAndStringA_Call* call); + FREERDP_API LONG + smartcard_unpack_context_and_two_strings_w_call(wStream* s, ContextAndTwoStringW_Call* call); -FREERDP_API LONG smartcard_unpack_context_and_string_w_call(wStream* s, - ContextAndStringW_Call* call); + FREERDP_API LONG smartcard_unpack_context_and_string_a_call(wStream* s, + ContextAndStringA_Call* call); -FREERDP_API LONG smartcard_unpack_locate_cards_a_call(wStream* s, LocateCardsA_Call* call); + FREERDP_API LONG smartcard_unpack_context_and_string_w_call(wStream* s, + ContextAndStringW_Call* call); -FREERDP_API LONG smartcard_pack_locate_cards_return(wStream* s, const LocateCards_Return* ret); + FREERDP_API LONG smartcard_unpack_locate_cards_a_call(wStream* s, LocateCardsA_Call* call); -FREERDP_API LONG smartcard_unpack_locate_cards_w_call(wStream* s, LocateCardsW_Call* call); + FREERDP_API LONG smartcard_pack_locate_cards_return(wStream* s, const LocateCards_Return* ret); -FREERDP_API LONG smartcard_pack_locate_cards_w_return(wStream* s, const LocateCardsW_Call* ret); + FREERDP_API LONG smartcard_unpack_locate_cards_w_call(wStream* s, LocateCardsW_Call* call); -FREERDP_API LONG smartcard_unpack_connect_a_call(wStream* s, ConnectA_Call* call); + FREERDP_API LONG smartcard_pack_locate_cards_w_return(wStream* s, const LocateCardsW_Call* ret); -FREERDP_API LONG smartcard_unpack_connect_w_call(wStream* s, ConnectW_Call* call); + FREERDP_API LONG smartcard_unpack_connect_a_call(wStream* s, ConnectA_Call* call); -FREERDP_API LONG smartcard_pack_connect_return(wStream* s, const Connect_Return* ret); + FREERDP_API LONG smartcard_unpack_connect_w_call(wStream* s, ConnectW_Call* call); -FREERDP_API LONG smartcard_unpack_reconnect_call(wStream* s, Reconnect_Call* call); + FREERDP_API LONG smartcard_pack_connect_return(wStream* s, const Connect_Return* ret); -FREERDP_API LONG smartcard_pack_reconnect_return(wStream* s, const Reconnect_Return* ret); + FREERDP_API LONG smartcard_unpack_reconnect_call(wStream* s, Reconnect_Call* call); -FREERDP_API LONG smartcard_unpack_hcard_and_disposition_call(wStream* s, - HCardAndDisposition_Call* call, - const char* name); + FREERDP_API LONG smartcard_pack_reconnect_return(wStream* s, const Reconnect_Return* ret); -FREERDP_API LONG smartcard_unpack_get_status_change_a_call(wStream* s, GetStatusChangeA_Call* call); + FREERDP_API LONG smartcard_unpack_hcard_and_disposition_call(wStream* s, + HCardAndDisposition_Call* call, + const char* name); -FREERDP_API LONG smartcard_unpack_get_status_change_w_call(wStream* s, GetStatusChangeW_Call* call); + FREERDP_API LONG smartcard_unpack_get_status_change_a_call(wStream* s, + GetStatusChangeA_Call* call); -FREERDP_API LONG smartcard_pack_get_status_change_return(wStream* s, - const GetStatusChange_Return* ret, - BOOL unicode); + FREERDP_API LONG smartcard_unpack_get_status_change_w_call(wStream* s, + GetStatusChangeW_Call* call); -FREERDP_API LONG smartcard_unpack_state_call(wStream* s, State_Call* call); -FREERDP_API LONG smartcard_pack_state_return(wStream* s, const State_Return* ret); + FREERDP_API LONG smartcard_pack_get_status_change_return(wStream* s, + const GetStatusChange_Return* ret, + BOOL unicode); -FREERDP_API LONG smartcard_unpack_status_call(wStream* s, Status_Call* call, BOOL unicode); + FREERDP_API LONG smartcard_unpack_state_call(wStream* s, State_Call* call); + FREERDP_API LONG smartcard_pack_state_return(wStream* s, const State_Return* ret); -FREERDP_API LONG smartcard_pack_status_return(wStream* s, const Status_Return* ret, BOOL unicode); + FREERDP_API LONG smartcard_unpack_status_call(wStream* s, Status_Call* call, BOOL unicode); -FREERDP_API LONG smartcard_unpack_get_attrib_call(wStream* s, GetAttrib_Call* call); + FREERDP_API LONG smartcard_pack_status_return(wStream* s, const Status_Return* ret, + BOOL unicode); -FREERDP_API LONG smartcard_pack_get_attrib_return(wStream* s, const GetAttrib_Return* ret, - DWORD dwAttrId, DWORD cbAttrCallLen); + FREERDP_API LONG smartcard_unpack_get_attrib_call(wStream* s, GetAttrib_Call* call); -FREERDP_API LONG smartcard_unpack_set_attrib_call(wStream* s, SetAttrib_Call* call); + FREERDP_API LONG smartcard_pack_get_attrib_return(wStream* s, const GetAttrib_Return* ret, + DWORD dwAttrId, DWORD cbAttrCallLen); -FREERDP_API LONG smartcard_unpack_control_call(wStream* s, Control_Call* call); + FREERDP_API LONG smartcard_unpack_set_attrib_call(wStream* s, SetAttrib_Call* call); -FREERDP_API LONG smartcard_pack_control_return(wStream* s, const Control_Return* ret); + FREERDP_API LONG smartcard_unpack_control_call(wStream* s, Control_Call* call); -FREERDP_API LONG smartcard_unpack_transmit_call(wStream* s, Transmit_Call* call); + FREERDP_API LONG smartcard_pack_control_return(wStream* s, const Control_Return* ret); -FREERDP_API LONG smartcard_pack_transmit_return(wStream* s, const Transmit_Return* ret); + FREERDP_API LONG smartcard_unpack_transmit_call(wStream* s, Transmit_Call* call); -FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_a_call(wStream* s, - LocateCardsByATRA_Call* call); + FREERDP_API LONG smartcard_pack_transmit_return(wStream* s, const Transmit_Return* ret); -FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_w_call(wStream* s, - LocateCardsByATRW_Call* call); + FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_a_call(wStream* s, + LocateCardsByATRA_Call* call); -FREERDP_API LONG smartcard_unpack_read_cache_a_call(wStream* s, ReadCacheA_Call* call); + FREERDP_API LONG smartcard_unpack_locate_cards_by_atr_w_call(wStream* s, + LocateCardsByATRW_Call* call); -FREERDP_API LONG smartcard_unpack_read_cache_w_call(wStream* s, ReadCacheW_Call* call); + FREERDP_API LONG smartcard_unpack_read_cache_a_call(wStream* s, ReadCacheA_Call* call); -FREERDP_API LONG smartcard_pack_read_cache_return(wStream* s, const ReadCache_Return* ret); + FREERDP_API LONG smartcard_unpack_read_cache_w_call(wStream* s, ReadCacheW_Call* call); -FREERDP_API LONG smartcard_unpack_write_cache_a_call(wStream* s, WriteCacheA_Call* call); + FREERDP_API LONG smartcard_pack_read_cache_return(wStream* s, const ReadCache_Return* ret); -FREERDP_API LONG smartcard_unpack_write_cache_w_call(wStream* s, WriteCacheW_Call* call); + FREERDP_API LONG smartcard_unpack_write_cache_a_call(wStream* s, WriteCacheA_Call* call); -FREERDP_API LONG smartcard_unpack_get_transmit_count_call(wStream* s, GetTransmitCount_Call* call); -FREERDP_API LONG smartcard_pack_get_transmit_count_return(wStream* s, - const GetTransmitCount_Return* call); + FREERDP_API LONG smartcard_unpack_write_cache_w_call(wStream* s, WriteCacheW_Call* call); -FREERDP_API LONG smartcard_unpack_get_reader_icon_call(wStream* s, GetReaderIcon_Call* call); -FREERDP_API LONG smartcard_pack_get_reader_icon_return(wStream* s, const GetReaderIcon_Return* ret); + FREERDP_API LONG smartcard_unpack_get_transmit_count_call(wStream* s, + GetTransmitCount_Call* call); + FREERDP_API LONG smartcard_pack_get_transmit_count_return(wStream* s, + const GetTransmitCount_Return* call); -FREERDP_API LONG smartcard_unpack_get_device_type_id_call(wStream* s, GetDeviceTypeId_Call* call); + FREERDP_API LONG smartcard_unpack_get_reader_icon_call(wStream* s, GetReaderIcon_Call* call); + FREERDP_API LONG smartcard_pack_get_reader_icon_return(wStream* s, + const GetReaderIcon_Return* ret); -FREERDP_API LONG smartcard_pack_device_type_id_return(wStream* s, - const GetDeviceTypeId_Return* ret); + FREERDP_API LONG smartcard_unpack_get_device_type_id_call(wStream* s, + GetDeviceTypeId_Call* call); + + FREERDP_API LONG smartcard_pack_device_type_id_return(wStream* s, + const GetDeviceTypeId_Return* ret); + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_SMARTCARD_CLIENT_PACK_H */ diff --git a/include/freerdp/utils/smartcardlogon.h b/include/freerdp/utils/smartcardlogon.h index 5137201da..2f9056d01 100644 --- a/include/freerdp/utils/smartcardlogon.h +++ b/include/freerdp/utils/smartcardlogon.h @@ -23,31 +23,40 @@ #include #include -typedef struct SmartcardKeyInfo_st SmartcardKeyInfo; - -typedef struct SmartcardCertInfo_st +#ifdef __cplusplus +extern "C" { - LPWSTR csp; - LPWSTR reader; - rdpCertificate* certificate; - char* pkinitArgs; - UINT32 slotId; - char* keyName; - WCHAR* containerName; - char* upn; - char* userHint; - char* domainHint; - char* subject; - char* issuer; - BYTE sha1Hash[20]; - SmartcardKeyInfo* key_info; -} SmartcardCertInfo; +#endif -FREERDP_API BOOL smartcard_enumerateCerts(const rdpSettings* settings, SmartcardCertInfo*** scCerts, - size_t* retCount, BOOL gateway); -FREERDP_API BOOL smartcard_getCert(const rdpContext* context, SmartcardCertInfo** cert, - BOOL gateway); -FREERDP_API void smartcardCertInfo_Free(SmartcardCertInfo* pscCert); -FREERDP_API void smartcardCertList_Free(SmartcardCertInfo** pscCert, size_t count); + typedef struct SmartcardKeyInfo_st SmartcardKeyInfo; + typedef struct SmartcardCertInfo_st + { + LPWSTR csp; + LPWSTR reader; + rdpCertificate* certificate; + char* pkinitArgs; + UINT32 slotId; + char* keyName; + WCHAR* containerName; + char* upn; + char* userHint; + char* domainHint; + char* subject; + char* issuer; + BYTE sha1Hash[20]; + SmartcardKeyInfo* key_info; + } SmartcardCertInfo; + + FREERDP_API BOOL smartcard_enumerateCerts(const rdpSettings* settings, + SmartcardCertInfo*** scCerts, size_t* retCount, + BOOL gateway); + FREERDP_API BOOL smartcard_getCert(const rdpContext* context, SmartcardCertInfo** cert, + BOOL gateway); + FREERDP_API void smartcardCertInfo_Free(SmartcardCertInfo* pscCert); + FREERDP_API void smartcardCertList_Free(SmartcardCertInfo** pscCert, size_t count); + +#ifdef __cplusplus +} +#endif #endif /* LIBFREERDP_CORE_SMARTCARDLOGON_H */