From 61779694ee0cfdad6ae288ec78f96cead1ae0521 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 14 Mar 2023 09:27:55 +0100 Subject: [PATCH] [includes] improved c++ guards --- include/freerdp/addin.h | 25 +- include/freerdp/altsec.h | 297 ++++---- include/freerdp/assistance.h | 4 +- include/freerdp/cache/persistent.h | 12 +- include/freerdp/channels/ainput.h | 49 +- include/freerdp/channels/disp.h | 55 +- include/freerdp/channels/drdynvc.h | 57 +- include/freerdp/channels/encomsp.h | 9 + include/freerdp/channels/geometry.h | 59 +- include/freerdp/channels/gfxredir.h | 9 + include/freerdp/channels/rdpdr.h | 9 + include/freerdp/channels/rdpei.h | 9 + include/freerdp/channels/remdesk.h | 9 + include/freerdp/channels/scard.h | 9 + include/freerdp/channels/telemetry.h | 23 +- include/freerdp/channels/video.h | 155 +++-- include/freerdp/client/ainput.h | 25 +- include/freerdp/client/audin.h | 40 +- include/freerdp/client/channels.h | 72 +- include/freerdp/client/cliprdr.h | 299 +++++---- include/freerdp/client/disp.h | 35 +- include/freerdp/client/drdynvc.h | 59 +- include/freerdp/client/encomsp.h | 104 +-- include/freerdp/client/file.h | 7 +- include/freerdp/client/geometry.h | 73 +- include/freerdp/client/printer.h | 95 +-- include/freerdp/client/rdpei.h | 110 +-- include/freerdp/client/rdpgfx.h | 276 ++++---- include/freerdp/client/remdesk.h | 25 +- include/freerdp/client/sshagent.h | 117 ++-- include/freerdp/client/tsmf.h | 57 +- include/freerdp/codec/audio.h | 10 +- include/freerdp/codec/clear.h | 4 +- include/freerdp/codec/color.h | 10 +- include/freerdp/codec/dsp.h | 4 +- include/freerdp/codec/h264.h | 88 +-- include/freerdp/codec/interleaved.h | 4 +- include/freerdp/codec/planar.h | 122 ++-- include/freerdp/codec/progressive.h | 4 +- include/freerdp/codec/yuv.h | 4 +- include/freerdp/codec/zgfx.h | 4 +- include/freerdp/codecs.h | 26 +- include/freerdp/crypto/certificate_data.h | 5 +- include/freerdp/crypto/certificate_store.h | 4 +- include/freerdp/dvc.h | 190 +++--- .../freerdp/emulate/scard/smartcard_emulate.h | 635 +++++++++--------- include/freerdp/extension.h | 55 +- include/freerdp/freerdp.h | 42 +- include/freerdp/gdi/gdi.h | 322 ++++----- include/freerdp/gdi/gfx.h | 70 +- include/freerdp/graphics.h | 8 +- include/freerdp/heartbeat.h | 18 +- include/freerdp/input.h | 64 +- include/freerdp/listener.h | 4 +- include/freerdp/locale/keyboard.h | 10 +- include/freerdp/message.h | 6 +- include/freerdp/metrics.h | 18 +- include/freerdp/peer.h | 16 +- include/freerdp/pointer.h | 135 ++-- include/freerdp/primary.h | 47 +- include/freerdp/primitives.h | 12 +- include/freerdp/rail.h | 10 +- include/freerdp/secondary.h | 9 + include/freerdp/server/ainput.h | 166 ++--- include/freerdp/server/audin.h | 164 ++--- include/freerdp/server/cliprdr.h | 200 +++--- include/freerdp/server/disp.h | 72 +- include/freerdp/server/drdynvc.h | 40 +- include/freerdp/server/echo.h | 122 ++-- include/freerdp/server/encomsp.h | 118 ++-- include/freerdp/server/gfxredir.h | 123 ++-- include/freerdp/server/proxy/proxy_config.h | 156 ++--- include/freerdp/server/proxy/proxy_server.h | 4 +- include/freerdp/server/proxy/proxy_types.h | 51 +- include/freerdp/server/rail.h | 213 +++--- include/freerdp/server/rdpdr.h | 32 +- include/freerdp/server/rdpecam-enumerator.h | 193 +++--- include/freerdp/server/rdpecam.h | 484 ++++++------- include/freerdp/server/rdpei.h | 54 +- include/freerdp/server/rdpgfx.h | 199 +++--- include/freerdp/server/rdpsnd.h | 297 ++++---- include/freerdp/server/remdesk.h | 44 +- include/freerdp/server/server-common.h | 2 + include/freerdp/server/shadow.h | 151 +++-- include/freerdp/server/telemetry.h | 141 ++-- include/freerdp/session.h | 41 +- include/freerdp/settings.h | 10 +- include/freerdp/streamdump.h | 4 +- include/freerdp/svc.h | 67 +- include/freerdp/transport_io.h | 4 +- include/freerdp/types.h | 29 +- include/freerdp/update.h | 385 +++++------ include/freerdp/utils/pcap.h | 70 +- include/freerdp/utils/pod_arrays.h | 10 +- include/freerdp/utils/profiler.h | 12 +- include/freerdp/utils/ringbuffer.h | 36 +- include/freerdp/utils/signal.h | 5 - include/freerdp/utils/smartcard_call.h | 5 +- include/freerdp/utils/smartcardlogon.h | 6 +- include/freerdp/utils/stopwatch.h | 16 +- include/freerdp/window.h | 255 +++---- 101 files changed, 4233 insertions(+), 3892 deletions(-) diff --git a/include/freerdp/addin.h b/include/freerdp/addin.h index b69ab108c..cec491aa6 100644 --- a/include/freerdp/addin.h +++ b/include/freerdp/addin.h @@ -38,23 +38,24 @@ #define FREERDP_ADDIN_CHANNEL_DEVICE 0x00004000 #define FREERDP_ADDIN_CHANNEL_ENTRYEX 0x00008000 -typedef struct -{ - DWORD dwFlags; - CHAR cName[16]; - CHAR cType[16]; - CHAR cSubsystem[16]; -} FREERDP_ADDIN; - -typedef PVIRTUALCHANNELENTRY (*FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN)(LPCSTR pszName, - LPCSTR pszSubsystem, - LPCSTR pszType, DWORD dwFlags); - #ifdef __cplusplus extern "C" { #endif + typedef struct + { + DWORD dwFlags; + CHAR cName[16]; + CHAR cType[16]; + CHAR cSubsystem[16]; + } FREERDP_ADDIN; + + typedef PVIRTUALCHANNELENTRY (*FREERDP_LOAD_CHANNEL_ADDIN_ENTRY_FN)(LPCSTR pszName, + LPCSTR pszSubsystem, + LPCSTR pszType, + DWORD dwFlags); + FREERDP_API LPSTR freerdp_get_library_install_path(void); FREERDP_API LPSTR freerdp_get_dynamic_addin_install_path(void); diff --git a/include/freerdp/altsec.h b/include/freerdp/altsec.h index 2445e88e5..348662cc1 100644 --- a/include/freerdp/altsec.h +++ b/include/freerdp/altsec.h @@ -36,166 +36,175 @@ #define STREAM_BITMAP_COMPRESSED 0x02 #define STREAM_BITMAP_V2 0x04 -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 sIndices; - UINT32 cIndices; - UINT16* indices; -} OFFSCREEN_DELETE_LIST; +#endif -typedef struct -{ - UINT32 id; - UINT32 cx; - UINT32 cy; - OFFSCREEN_DELETE_LIST deleteList; -} CREATE_OFFSCREEN_BITMAP_ORDER; + typedef struct + { + UINT32 sIndices; + UINT32 cIndices; + UINT16* indices; + } OFFSCREEN_DELETE_LIST; -typedef struct -{ - UINT32 bitmapId; -} SWITCH_SURFACE_ORDER; + typedef struct + { + UINT32 id; + UINT32 cx; + UINT32 cy; + OFFSCREEN_DELETE_LIST deleteList; + } CREATE_OFFSCREEN_BITMAP_ORDER; -typedef struct -{ - UINT32 flFlags; - UINT32 ulLeftWidth; - UINT32 ulRightWidth; - UINT32 ulTopHeight; - UINT32 ulBottomHeight; - UINT32 crTransparent; -} NINE_GRID_BITMAP_INFO; + typedef struct + { + UINT32 bitmapId; + } SWITCH_SURFACE_ORDER; -typedef struct -{ - UINT32 bitmapBpp; - UINT32 bitmapId; - UINT32 cx; - UINT32 cy; - NINE_GRID_BITMAP_INFO nineGridInfo; -} CREATE_NINE_GRID_BITMAP_ORDER; + typedef struct + { + UINT32 flFlags; + UINT32 ulLeftWidth; + UINT32 ulRightWidth; + UINT32 ulTopHeight; + UINT32 ulBottomHeight; + UINT32 crTransparent; + } NINE_GRID_BITMAP_INFO; -typedef struct -{ - UINT32 action; -} FRAME_MARKER_ORDER; + typedef struct + { + UINT32 bitmapBpp; + UINT32 bitmapId; + UINT32 cx; + UINT32 cy; + NINE_GRID_BITMAP_INFO nineGridInfo; + } CREATE_NINE_GRID_BITMAP_ORDER; -typedef struct -{ - UINT32 bitmapFlags; - UINT32 bitmapBpp; - UINT32 bitmapType; - UINT32 bitmapWidth; - UINT32 bitmapHeight; - UINT32 bitmapSize; - UINT32 bitmapBlockSize; - BYTE* bitmapBlock; -} STREAM_BITMAP_FIRST_ORDER; + typedef struct + { + UINT32 action; + } FRAME_MARKER_ORDER; -typedef struct -{ - UINT32 bitmapFlags; - UINT32 bitmapType; - UINT32 bitmapBlockSize; - BYTE* bitmapBlock; -} STREAM_BITMAP_NEXT_ORDER; + typedef struct + { + UINT32 bitmapFlags; + UINT32 bitmapBpp; + UINT32 bitmapType; + UINT32 bitmapWidth; + UINT32 bitmapHeight; + UINT32 bitmapSize; + UINT32 bitmapBlockSize; + BYTE* bitmapBlock; + } STREAM_BITMAP_FIRST_ORDER; -typedef struct -{ - UINT32 cbSize; - UINT32 cbTotalSize; - UINT32 cbTotalEmfSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_FIRST_ORDER; + typedef struct + { + UINT32 bitmapFlags; + UINT32 bitmapType; + UINT32 bitmapBlockSize; + BYTE* bitmapBlock; + } STREAM_BITMAP_NEXT_ORDER; -typedef struct -{ - UINT32 cbSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_NEXT_ORDER; + typedef struct + { + UINT32 cbSize; + UINT32 cbTotalSize; + UINT32 cbTotalEmfSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_FIRST_ORDER; -typedef struct -{ - UINT32 cbSize; - UINT32 cbTotalSize; - UINT32 cbTotalEmfSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_END_ORDER; + typedef struct + { + UINT32 cbSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_NEXT_ORDER; -typedef struct -{ - UINT32 flags; - UINT32 cacheType; - UINT32 cacheIndex; - UINT32 cbSize; - UINT32 cbTotalSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_CACHE_FIRST_ORDER; + typedef struct + { + UINT32 cbSize; + UINT32 cbTotalSize; + UINT32 cbTotalEmfSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_END_ORDER; -typedef struct -{ - UINT32 flags; - UINT32 cacheType; - UINT32 cacheIndex; - UINT32 cbSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_CACHE_NEXT_ORDER; + typedef struct + { + UINT32 flags; + UINT32 cacheType; + UINT32 cacheIndex; + UINT32 cbSize; + UINT32 cbTotalSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_CACHE_FIRST_ORDER; -typedef struct -{ - UINT32 flags; - UINT32 cacheType; - UINT32 cacheIndex; - UINT32 cbSize; - UINT32 cbTotalSize; - BYTE* emfRecords; -} DRAW_GDIPLUS_CACHE_END_ORDER; + typedef struct + { + UINT32 flags; + UINT32 cacheType; + UINT32 cacheIndex; + UINT32 cbSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_CACHE_NEXT_ORDER; -typedef BOOL (*pCreateOffscreenBitmap)( - rdpContext* context, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); -typedef BOOL (*pSwitchSurface)(rdpContext* context, const SWITCH_SURFACE_ORDER* switch_surface); -typedef BOOL (*pCreateNineGridBitmap)(rdpContext* context, - const CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); -typedef BOOL (*pFrameMarker)(rdpContext* context, const FRAME_MARKER_ORDER* frame_marker); -typedef BOOL (*pStreamBitmapFirst)(rdpContext* context, - const STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); -typedef BOOL (*pStreamBitmapNext)(rdpContext* context, - const STREAM_BITMAP_NEXT_ORDER* stream_bitmap_next); -typedef BOOL (*pDrawGdiPlusFirst)(rdpContext* context, - const DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first); -typedef BOOL (*pDrawGdiPlusNext)(rdpContext* context, - const DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); -typedef BOOL (*pDrawGdiPlusEnd)(rdpContext* context, - const DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); -typedef BOOL (*pDrawGdiPlusCacheFirst)( - rdpContext* context, const DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); -typedef BOOL (*pDrawGdiPlusCacheNext)(rdpContext* context, - const DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); -typedef BOOL (*pDrawGdiPlusCacheEnd)(rdpContext* context, - const DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end); -typedef BOOL (*pDrawOrderInfo)(rdpContext* context, UINT8 orderType, const char* orderName); + typedef struct + { + UINT32 flags; + UINT32 cacheType; + UINT32 cacheIndex; + UINT32 cbSize; + UINT32 cbTotalSize; + BYTE* emfRecords; + } DRAW_GDIPLUS_CACHE_END_ORDER; -struct rdp_altsec_update -{ - rdpContext* context; /* 0 */ - UINT32 paddingA[16 - 1]; /* 1 */ + typedef BOOL (*pCreateOffscreenBitmap)( + rdpContext* context, const CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap); + typedef BOOL (*pSwitchSurface)(rdpContext* context, const SWITCH_SURFACE_ORDER* switch_surface); + typedef BOOL (*pCreateNineGridBitmap)( + rdpContext* context, const CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap); + typedef BOOL (*pFrameMarker)(rdpContext* context, const FRAME_MARKER_ORDER* frame_marker); + typedef BOOL (*pStreamBitmapFirst)(rdpContext* context, + const STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first); + typedef BOOL (*pStreamBitmapNext)(rdpContext* context, + const STREAM_BITMAP_NEXT_ORDER* stream_bitmap_next); + typedef BOOL (*pDrawGdiPlusFirst)(rdpContext* context, + const DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first); + typedef BOOL (*pDrawGdiPlusNext)(rdpContext* context, + const DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next); + typedef BOOL (*pDrawGdiPlusEnd)(rdpContext* context, + const DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end); + typedef BOOL (*pDrawGdiPlusCacheFirst)( + rdpContext* context, const DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first); + typedef BOOL (*pDrawGdiPlusCacheNext)( + rdpContext* context, const DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next); + typedef BOOL (*pDrawGdiPlusCacheEnd)( + rdpContext* context, const DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end); + typedef BOOL (*pDrawOrderInfo)(rdpContext* context, UINT8 orderType, const char* orderName); - pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */ - pSwitchSurface SwitchSurface; /* 17 */ - pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */ - pFrameMarker FrameMarker; /* 19 */ - pStreamBitmapFirst StreamBitmapFirst; /* 20 */ - pStreamBitmapNext StreamBitmapNext; /* 21 */ - pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */ - pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */ - pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */ - pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */ - pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */ - pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */ - /* Statistics callback */ - pDrawOrderInfo DrawOrderInfo; /* 28 */ - UINT32 paddingB[32 - 29]; /* 29 */ -}; -typedef struct rdp_altsec_update rdpAltSecUpdate; + struct rdp_altsec_update + { + rdpContext* context; /* 0 */ + UINT32 paddingA[16 - 1]; /* 1 */ + + pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */ + pSwitchSurface SwitchSurface; /* 17 */ + pCreateNineGridBitmap CreateNineGridBitmap; /* 18 */ + pFrameMarker FrameMarker; /* 19 */ + pStreamBitmapFirst StreamBitmapFirst; /* 20 */ + pStreamBitmapNext StreamBitmapNext; /* 21 */ + pDrawGdiPlusFirst DrawGdiPlusFirst; /* 22 */ + pDrawGdiPlusNext DrawGdiPlusNext; /* 23 */ + pDrawGdiPlusEnd DrawGdiPlusEnd; /* 24 */ + pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */ + pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */ + pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */ + /* Statistics callback */ + pDrawOrderInfo DrawOrderInfo; /* 28 */ + UINT32 paddingB[32 - 29]; /* 29 */ + }; + typedef struct rdp_altsec_update rdpAltSecUpdate; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_UPDATE_ALTSEC_H */ diff --git a/include/freerdp/assistance.h b/include/freerdp/assistance.h index e94656cb9..41116e35b 100644 --- a/include/freerdp/assistance.h +++ b/include/freerdp/assistance.h @@ -23,13 +23,13 @@ #include #include -typedef struct rdp_assistance_file rdpAssistanceFile; - #ifdef __cplusplus extern "C" { #endif + typedef struct rdp_assistance_file rdpAssistanceFile; + FREERDP_API BYTE* freerdp_assistance_hex_string_to_bin(const void* str, size_t* size); FREERDP_API char* freerdp_assistance_bin_to_hex_string(const void* data, size_t size); diff --git a/include/freerdp/cache/persistent.h b/include/freerdp/cache/persistent.h index e1cdbde4e..bc032fece 100644 --- a/include/freerdp/cache/persistent.h +++ b/include/freerdp/cache/persistent.h @@ -28,7 +28,12 @@ #include #include -typedef struct rdp_persistent_cache rdpPersistentCache; +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct rdp_persistent_cache rdpPersistentCache; #pragma pack(push, 1) @@ -76,11 +81,6 @@ struct _PERSISTENT_CACHE_ENTRY }; typedef struct _PERSISTENT_CACHE_ENTRY PERSISTENT_CACHE_ENTRY; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API int persistent_cache_get_version(rdpPersistentCache* persistent); FREERDP_API int persistent_cache_get_count(rdpPersistentCache* persistent); diff --git a/include/freerdp/channels/ainput.h b/include/freerdp/channels/ainput.h index fe9faef3f..aea73bcb9 100644 --- a/include/freerdp/channels/ainput.h +++ b/include/freerdp/channels/ainput.h @@ -28,34 +28,43 @@ #define AINPUT_CHANNEL_NAME "ainput" #define AINPUT_DVC_CHANNEL_NAME "FreeRDP::Advanced::Input" -typedef enum +#ifdef __cplusplus +extern "C" { - MSG_AINPUT_VERSION = 0x01, - MSG_AINPUT_MOUSE = 0x02 -} eAInputMsgType; +#endif -typedef enum -{ - AINPUT_FLAGS_WHEEL = 0x0001, - AINPUT_FLAGS_MOVE = 0x0004, - AINPUT_FLAGS_DOWN = 0x0008, + typedef enum + { + MSG_AINPUT_VERSION = 0x01, + MSG_AINPUT_MOUSE = 0x02 + } eAInputMsgType; - AINPUT_FLAGS_REL = 0x0010, - AINPUT_FLAGS_HAVE_REL = 0x0020, + typedef enum + { + AINPUT_FLAGS_WHEEL = 0x0001, + AINPUT_FLAGS_MOVE = 0x0004, + AINPUT_FLAGS_DOWN = 0x0008, - /* Pointer Flags */ - AINPUT_FLAGS_BUTTON1 = 0x1000, /* left */ - AINPUT_FLAGS_BUTTON2 = 0x2000, /* right */ - AINPUT_FLAGS_BUTTON3 = 0x4000, /* middle */ + AINPUT_FLAGS_REL = 0x0010, + AINPUT_FLAGS_HAVE_REL = 0x0020, - /* Extended Pointer Flags */ - AINPUT_XFLAGS_BUTTON1 = 0x0100, - AINPUT_XFLAGS_BUTTON2 = 0x0200 -} AInputEventFlags; + /* Pointer Flags */ + AINPUT_FLAGS_BUTTON1 = 0x1000, /* left */ + AINPUT_FLAGS_BUTTON2 = 0x2000, /* right */ + AINPUT_FLAGS_BUTTON3 = 0x4000, /* middle */ -typedef struct ainput_client_context AInputClientContext; + /* Extended Pointer Flags */ + AINPUT_XFLAGS_BUTTON1 = 0x0100, + AINPUT_XFLAGS_BUTTON2 = 0x0200 + } AInputEventFlags; + + typedef struct ainput_client_context AInputClientContext; #define AINPUT_VERSION_MAJOR 1 #define AINPUT_VERSION_MINOR 0 +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_AINPUT_H */ diff --git a/include/freerdp/channels/disp.h b/include/freerdp/channels/disp.h index f95c4fceb..8e08bf263 100644 --- a/include/freerdp/channels/disp.h +++ b/include/freerdp/channels/disp.h @@ -50,31 +50,40 @@ #define DISPLAY_CONTROL_MIN_PHYSICAL_MONITOR_HEIGHT 10 #define DISPLAY_CONTROL_MAX_PHYSICAL_MONITOR_HEIGHT 10000 -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 type; - UINT32 length; -} DISPLAY_CONTROL_HEADER; +#endif -typedef struct -{ - UINT32 Flags; - INT32 Left; - INT32 Top; - UINT32 Width; - UINT32 Height; - UINT32 PhysicalWidth; - UINT32 PhysicalHeight; - UINT32 Orientation; - UINT32 DesktopScaleFactor; - UINT32 DeviceScaleFactor; -} DISPLAY_CONTROL_MONITOR_LAYOUT; + typedef struct + { + UINT32 type; + UINT32 length; + } DISPLAY_CONTROL_HEADER; -typedef struct -{ - UINT32 MonitorLayoutSize; - UINT32 NumMonitors; - DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors; -} DISPLAY_CONTROL_MONITOR_LAYOUT_PDU; + typedef struct + { + UINT32 Flags; + INT32 Left; + INT32 Top; + UINT32 Width; + UINT32 Height; + UINT32 PhysicalWidth; + UINT32 PhysicalHeight; + UINT32 Orientation; + UINT32 DesktopScaleFactor; + UINT32 DeviceScaleFactor; + } DISPLAY_CONTROL_MONITOR_LAYOUT; + + typedef struct + { + UINT32 MonitorLayoutSize; + UINT32 NumMonitors; + DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors; + } DISPLAY_CONTROL_MONITOR_LAYOUT_PDU; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_DISP_H */ diff --git a/include/freerdp/channels/drdynvc.h b/include/freerdp/channels/drdynvc.h index 870ecc953..885fa01aa 100644 --- a/include/freerdp/channels/drdynvc.h +++ b/include/freerdp/channels/drdynvc.h @@ -27,32 +27,41 @@ #define DRDYNVC_SVC_CHANNEL_NAME "drdynvc" -/* defined in MS-RDPEDYC 2.2.5.1 Soft-Sync Request PDU (DYNVC_SOFT_SYNC_REQUEST) */ -enum +#ifdef __cplusplus +extern "C" { - SOFT_SYNC_TCP_FLUSHED = 0x01, - SOFT_SYNC_CHANNEL_LIST_PRESENT = 0x02 -}; +#endif -/* define in MS-RDPEDYC 2.2.5.1.1 Soft-Sync Channel List (DYNVC_SOFT_SYNC_CHANNEL_LIST) */ -enum -{ - TUNNELTYPE_UDPFECR = 0x00000001, - TUNNELTYPE_UDPFECL = 0x00000003 -}; + /* defined in MS-RDPEDYC 2.2.5.1 Soft-Sync Request PDU (DYNVC_SOFT_SYNC_REQUEST) */ + enum + { + SOFT_SYNC_TCP_FLUSHED = 0x01, + SOFT_SYNC_CHANNEL_LIST_PRESENT = 0x02 + }; -/* @brief dynamic channel commands */ -typedef enum -{ - CREATE_REQUEST_PDU = 0x01, - DATA_FIRST_PDU = 0x02, - DATA_PDU = 0x03, - CLOSE_REQUEST_PDU = 0x04, - CAPABILITY_REQUEST_PDU = 0x05, - DATA_FIRST_COMPRESSED_PDU = 0x06, - DATA_COMPRESSED_PDU = 0x07, - SOFT_SYNC_REQUEST_PDU = 0x08, - SOFT_SYNC_RESPONSE_PDU = 0x09 -} DynamicChannelPDU; + /* define in MS-RDPEDYC 2.2.5.1.1 Soft-Sync Channel List (DYNVC_SOFT_SYNC_CHANNEL_LIST) */ + enum + { + TUNNELTYPE_UDPFECR = 0x00000001, + TUNNELTYPE_UDPFECL = 0x00000003 + }; + + /* @brief dynamic channel commands */ + typedef enum + { + CREATE_REQUEST_PDU = 0x01, + DATA_FIRST_PDU = 0x02, + DATA_PDU = 0x03, + CLOSE_REQUEST_PDU = 0x04, + CAPABILITY_REQUEST_PDU = 0x05, + DATA_FIRST_COMPRESSED_PDU = 0x06, + DATA_COMPRESSED_PDU = 0x07, + SOFT_SYNC_REQUEST_PDU = 0x08, + SOFT_SYNC_RESPONSE_PDU = 0x09 + } DynamicChannelPDU; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_DRDYNVC_H */ diff --git a/include/freerdp/channels/encomsp.h b/include/freerdp/channels/encomsp.h index 97bf7179d..d8d2cdd27 100644 --- a/include/freerdp/channels/encomsp.h +++ b/include/freerdp/channels/encomsp.h @@ -23,6 +23,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define ENCOMSP_SVC_CHANNEL_NAME "encomsp" typedef struct @@ -169,4 +174,8 @@ typedef struct DEFINE_ENCOMSP_HEADER_COMMON(); } ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_ENCOMSP_H */ diff --git a/include/freerdp/channels/geometry.h b/include/freerdp/channels/geometry.h index 51a45f4b4..f7b95875d 100644 --- a/include/freerdp/channels/geometry.h +++ b/include/freerdp/channels/geometry.h @@ -25,35 +25,44 @@ #define GEOMETRY_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Geometry::v08.01" -enum +#ifdef __cplusplus +extern "C" { - GEOMETRY_UPDATE = 1, - GEOMETRY_CLEAR = 2 -}; +#endif -enum -{ - RDH_RECTANGLE = 1 -}; + enum + { + GEOMETRY_UPDATE = 1, + GEOMETRY_CLEAR = 2 + }; -typedef struct -{ - RDP_RECT boundingRect; - UINT32 nRectCount; - RDP_RECT* rects; -} FREERDP_RGNDATA; + enum + { + RDH_RECTANGLE = 1 + }; -typedef struct -{ - UINT32 version; - UINT64 mappingId; - UINT32 updateType; - UINT64 topLevelId; - INT32 left, top, right, bottom; - INT32 topLevelLeft, topLevelTop, topLevelRight, topLevelBottom; - UINT32 geometryType; + typedef struct + { + RDP_RECT boundingRect; + UINT32 nRectCount; + RDP_RECT* rects; + } FREERDP_RGNDATA; - FREERDP_RGNDATA geometry; -} MAPPED_GEOMETRY_PACKET; + typedef struct + { + UINT32 version; + UINT64 mappingId; + UINT32 updateType; + UINT64 topLevelId; + INT32 left, top, right, bottom; + INT32 topLevelLeft, topLevelTop, topLevelRight, topLevelBottom; + UINT32 geometryType; + + FREERDP_RGNDATA geometry; + } MAPPED_GEOMETRY_PACKET; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_GEOMETRY_H */ diff --git a/include/freerdp/channels/gfxredir.h b/include/freerdp/channels/gfxredir.h index a6164a58a..b21bcc8e3 100644 --- a/include/freerdp/channels/gfxredir.h +++ b/include/freerdp/channels/gfxredir.h @@ -23,6 +23,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define GFXREDIR_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::RemoteAppGraphicsRedirection" /* GFXREDIR_LEGACY_CAPS_PDU.version */ @@ -153,4 +158,8 @@ typedef struct UINT64 presentId; } GFXREDIR_PRESENT_BUFFER_ACK_PDU; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_GFXREDIR_H */ diff --git a/include/freerdp/channels/rdpdr.h b/include/freerdp/channels/rdpdr.h index c180e8346..2a3ba5fbc 100644 --- a/include/freerdp/channels/rdpdr.h +++ b/include/freerdp/channels/rdpdr.h @@ -35,6 +35,11 @@ #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define RDPDR_SVC_CHANNEL_NAME "rdpdr" #define RDPDR_DEVICE_IO_REQUEST_LENGTH 24 @@ -377,4 +382,8 @@ typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS; typedef UINT (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_RDPDR_H */ diff --git a/include/freerdp/channels/rdpei.h b/include/freerdp/channels/rdpei.h index acd53691d..14c2b69ee 100644 --- a/include/freerdp/channels/rdpei.h +++ b/include/freerdp/channels/rdpei.h @@ -24,6 +24,11 @@ #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define RDPINPUT_HEADER_LENGTH 6 #define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input" @@ -153,4 +158,8 @@ typedef struct RDPINPUT_PEN_FRAME* frames; } RDPINPUT_PEN_EVENT; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_RDPEI_H */ diff --git a/include/freerdp/channels/remdesk.h b/include/freerdp/channels/remdesk.h index e283f9a01..45a8a4525 100644 --- a/include/freerdp/channels/remdesk.h +++ b/include/freerdp/channels/remdesk.h @@ -23,6 +23,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define REMDESK_SVC_CHANNEL_NAME "remdesk" #define REMDESK_ERROR_NOERROR 0 @@ -148,4 +153,8 @@ typedef struct UINT32 EncryptedPasswordLength; } REMDESK_CTL_EXPERT_ON_VISTA_PDU; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_REMDESK_H */ diff --git a/include/freerdp/channels/scard.h b/include/freerdp/channels/scard.h index 6bcda5640..d83e2c8a2 100644 --- a/include/freerdp/channels/scard.h +++ b/include/freerdp/channels/scard.h @@ -24,6 +24,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define RDP_SCARD_CTL_CODE(code) \ CTL_CODE(FILE_DEVICE_FILE_SYSTEM, (code), METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -488,4 +493,8 @@ typedef struct /* [string] */ WCHAR* szLookupName; } WriteCacheW_Call; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_SCARD_H */ diff --git a/include/freerdp/channels/telemetry.h b/include/freerdp/channels/telemetry.h index 85ad1ff29..e92c3e0ec 100644 --- a/include/freerdp/channels/telemetry.h +++ b/include/freerdp/channels/telemetry.h @@ -26,13 +26,22 @@ #define TELEMETRY_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Telemetry" -struct _TELEMETRY_RDP_TELEMETRY_PDU +#ifdef __cplusplus +extern "C" { - UINT32 PromptForCredentialsMillis; - UINT32 PromptForCredentialsDoneMillis; - UINT32 GraphicsChannelOpenedMillis; - UINT32 FirstGraphicsReceivedMillis; -}; -typedef struct _TELEMETRY_RDP_TELEMETRY_PDU TELEMETRY_RDP_TELEMETRY_PDU; +#endif + + struct _TELEMETRY_RDP_TELEMETRY_PDU + { + UINT32 PromptForCredentialsMillis; + UINT32 PromptForCredentialsDoneMillis; + UINT32 GraphicsChannelOpenedMillis; + UINT32 FirstGraphicsReceivedMillis; + }; + typedef struct _TELEMETRY_RDP_TELEMETRY_PDU TELEMETRY_RDP_TELEMETRY_PDU; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_TELEMETRY_H */ diff --git a/include/freerdp/channels/video.h b/include/freerdp/channels/video.h index cbfdcc4c3..ec46733c3 100644 --- a/include/freerdp/channels/video.h +++ b/include/freerdp/channels/video.h @@ -26,87 +26,96 @@ #define VIDEO_CONTROL_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Video::Control::v08.01" #define VIDEO_DATA_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Video::Data::v08.01" -/** @brief TSNM packet type */ -enum +#ifdef __cplusplus +extern "C" { - TSMM_PACKET_TYPE_PRESENTATION_REQUEST = 1, - TSMM_PACKET_TYPE_PRESENTATION_RESPONSE = 2, - TSMM_PACKET_TYPE_CLIENT_NOTIFICATION = 3, - TSMM_PACKET_TYPE_VIDEO_DATA = 4 -}; +#endif -/** @brief TSMM_PRESENTATION_REQUEST commands */ -enum -{ - TSMM_START_PRESENTATION = 1, - TSMM_STOP_PRESENTATION = 2 -}; + /** @brief TSNM packet type */ + enum + { + TSMM_PACKET_TYPE_PRESENTATION_REQUEST = 1, + TSMM_PACKET_TYPE_PRESENTATION_RESPONSE = 2, + TSMM_PACKET_TYPE_CLIENT_NOTIFICATION = 3, + TSMM_PACKET_TYPE_VIDEO_DATA = 4 + }; -/** @brief presentation request struct */ -typedef struct -{ - BYTE PresentationId; - BYTE Version; - BYTE Command; - BYTE FrameRate; - UINT32 SourceWidth, SourceHeight; - UINT32 ScaledWidth, ScaledHeight; - UINT64 hnsTimestampOffset; - UINT64 GeometryMappingId; - BYTE VideoSubtypeId[16]; - UINT32 cbExtra; - BYTE* pExtraData; -} TSMM_PRESENTATION_REQUEST; + /** @brief TSMM_PRESENTATION_REQUEST commands */ + enum + { + TSMM_START_PRESENTATION = 1, + TSMM_STOP_PRESENTATION = 2 + }; -/** @brief response to a TSMM_PRESENTATION_REQUEST */ -typedef struct -{ - BYTE PresentationId; -} TSMM_PRESENTATION_RESPONSE; + /** @brief presentation request struct */ + typedef struct + { + BYTE PresentationId; + BYTE Version; + BYTE Command; + BYTE FrameRate; + UINT32 SourceWidth, SourceHeight; + UINT32 ScaledWidth, ScaledHeight; + UINT64 hnsTimestampOffset; + UINT64 GeometryMappingId; + BYTE VideoSubtypeId[16]; + UINT32 cbExtra; + BYTE* pExtraData; + } TSMM_PRESENTATION_REQUEST; -/** @brief TSMM_VIDEO_DATA flags */ -enum -{ - TSMM_VIDEO_DATA_FLAG_HAS_TIMESTAMPS = 0x01, - TSMM_VIDEO_DATA_FLAG_KEYFRAME = 0x02, - TSMM_VIDEO_DATA_FLAG_NEW_FRAMERATE = 0x04 -}; + /** @brief response to a TSMM_PRESENTATION_REQUEST */ + typedef struct + { + BYTE PresentationId; + } TSMM_PRESENTATION_RESPONSE; -/** @brief a video data packet */ -typedef struct -{ - BYTE PresentationId; - BYTE Version; - BYTE Flags; - UINT64 hnsTimestamp; - UINT64 hnsDuration; - UINT16 CurrentPacketIndex; - UINT16 PacketsInSample; - UINT32 SampleNumber; - UINT32 cbSample; - BYTE* pSample; -} TSMM_VIDEO_DATA; + /** @brief TSMM_VIDEO_DATA flags */ + enum + { + TSMM_VIDEO_DATA_FLAG_HAS_TIMESTAMPS = 0x01, + TSMM_VIDEO_DATA_FLAG_KEYFRAME = 0x02, + TSMM_VIDEO_DATA_FLAG_NEW_FRAMERATE = 0x04 + }; -/** @brief values for NotificationType in TSMM_CLIENT_NOTIFICATION */ -enum -{ - TSMM_CLIENT_NOTIFICATION_TYPE_NETWORK_ERROR = 1, - TSMM_CLIENT_NOTIFICATION_TYPE_FRAMERATE_OVERRIDE = 2 -}; + /** @brief a video data packet */ + typedef struct + { + BYTE PresentationId; + BYTE Version; + BYTE Flags; + UINT64 hnsTimestamp; + UINT64 hnsDuration; + UINT16 CurrentPacketIndex; + UINT16 PacketsInSample; + UINT32 SampleNumber; + UINT32 cbSample; + BYTE* pSample; + } TSMM_VIDEO_DATA; -/** @brief struct used when NotificationType is FRAMERATE_OVERRIDE */ -typedef struct -{ - UINT32 Flags; - UINT32 DesiredFrameRate; -} TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE; + /** @brief values for NotificationType in TSMM_CLIENT_NOTIFICATION */ + enum + { + TSMM_CLIENT_NOTIFICATION_TYPE_NETWORK_ERROR = 1, + TSMM_CLIENT_NOTIFICATION_TYPE_FRAMERATE_OVERRIDE = 2 + }; -/** @brief a client to server notification struct */ -typedef struct -{ - BYTE PresentationId; - BYTE NotificationType; - TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE FramerateOverride; -} TSMM_CLIENT_NOTIFICATION; + /** @brief struct used when NotificationType is FRAMERATE_OVERRIDE */ + typedef struct + { + UINT32 Flags; + UINT32 DesiredFrameRate; + } TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE; + + /** @brief a client to server notification struct */ + typedef struct + { + BYTE PresentationId; + BYTE NotificationType; + TSMM_CLIENT_NOTIFICATION_FRAMERATE_OVERRIDE FramerateOverride; + } TSMM_CLIENT_NOTIFICATION; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_VIDEO_H */ diff --git a/include/freerdp/client/ainput.h b/include/freerdp/client/ainput.h index d41397b09..c43267747 100644 --- a/include/freerdp/client/ainput.h +++ b/include/freerdp/client/ainput.h @@ -25,15 +25,24 @@ #include #include -typedef UINT (*pcAInputSendInputEvent)(AInputClientContext* context, UINT64 flags, INT32 x, - INT32 y); - -struct ainput_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcAInputSendInputEvent AInputSendInputEvent; -}; + typedef UINT (*pcAInputSendInputEvent)(AInputClientContext* context, UINT64 flags, INT32 x, + INT32 y); + + struct ainput_client_context + { + void* handle; + void* custom; + + pcAInputSendInputEvent AInputSendInputEvent; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_AINPUT_CLIENT_AINPUT_H */ diff --git a/include/freerdp/client/audin.h b/include/freerdp/client/audin.h index e9333bee7..1e3f6ff4a 100644 --- a/include/freerdp/client/audin.h +++ b/include/freerdp/client/audin.h @@ -26,22 +26,28 @@ #include #include -/** - * Subsystem Interface - */ - -typedef UINT (*AudinReceive)(const AUDIO_FORMAT* format, const BYTE* data, size_t size, - void* userData); - -typedef struct s_IAudinDevice IAudinDevice; -struct s_IAudinDevice +#ifdef __cplusplus +extern "C" { - UINT (*Open)(IAudinDevice* devplugin, AudinReceive receive, void* userData); - BOOL (*FormatSupported)(IAudinDevice* devplugin, const AUDIO_FORMAT* format); - UINT (*SetFormat)(IAudinDevice* devplugin, const AUDIO_FORMAT* format, UINT32 FramesPerPacket); - UINT (*Close)(IAudinDevice* devplugin); - UINT (*Free)(IAudinDevice* devplugin); -}; +#endif + + /** + * Subsystem Interface + */ + + typedef UINT (*AudinReceive)(const AUDIO_FORMAT* format, const BYTE* data, size_t size, + void* userData); + + typedef struct s_IAudinDevice IAudinDevice; + struct s_IAudinDevice + { + UINT (*Open)(IAudinDevice* devplugin, AudinReceive receive, void* userData); + BOOL (*FormatSupported)(IAudinDevice* devplugin, const AUDIO_FORMAT* format); + UINT(*SetFormat) + (IAudinDevice* devplugin, const AUDIO_FORMAT* format, UINT32 FramesPerPacket); + UINT (*Close)(IAudinDevice* devplugin); + UINT (*Free)(IAudinDevice* devplugin); + }; #define AUDIN_DEVICE_EXPORT_FUNC_NAME "freerdp_audin_client_subsystem_entry" @@ -58,4 +64,8 @@ typedef FREERDP_AUDIN_DEVICE_ENTRY_POINTS* PFREERDP_AUDIN_DEVICE_ENTRY_POINTS; typedef UINT (*PFREERDP_AUDIN_DEVICE_ENTRY)(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints); +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_CHANNEL_AUDIN_CLIENT_AUDIN_H */ diff --git a/include/freerdp/client/channels.h b/include/freerdp/client/channels.h index c48cb514c..a046e7320 100644 --- a/include/freerdp/client/channels.h +++ b/include/freerdp/client/channels.h @@ -25,47 +25,47 @@ #include #include -typedef struct -{ - IWTSVirtualChannelCallback iface; - IWTSPlugin* plugin; - IWTSVirtualChannelManager* channel_mgr; - IWTSVirtualChannel* channel; -} GENERIC_CHANNEL_CALLBACK; - -typedef struct -{ - IWTSListenerCallback iface; - IWTSPlugin* plugin; - IWTSVirtualChannelManager* channel_mgr; - IWTSVirtualChannel* channel; - GENERIC_CHANNEL_CALLBACK* channel_callback; -} GENERIC_LISTENER_CALLBACK; - -typedef struct GENERIC_DYNVC_PLUGIN GENERIC_DYNVC_PLUGIN; -typedef UINT (*DYNVC_PLUGIN_INIT_FN)(GENERIC_DYNVC_PLUGIN* plugin, rdpContext* context, - rdpSettings* settings); -typedef void (*DYNVC_PLUGIN_TERMINATE_FN)(GENERIC_DYNVC_PLUGIN* plugin); - -struct GENERIC_DYNVC_PLUGIN -{ - IWTSPlugin iface; - GENERIC_LISTENER_CALLBACK* listener_callback; - IWTSListener* listener; - BOOL attached; - BOOL initialized; - wLog* log; - char* dynvc_name; - size_t channelCallbackSize; - const IWTSVirtualChannelCallback* channel_callbacks; - DYNVC_PLUGIN_TERMINATE_FN terminatePluginFn; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct + { + IWTSVirtualChannelCallback iface; + IWTSPlugin* plugin; + IWTSVirtualChannelManager* channel_mgr; + IWTSVirtualChannel* channel; + } GENERIC_CHANNEL_CALLBACK; + + typedef struct + { + IWTSListenerCallback iface; + IWTSPlugin* plugin; + IWTSVirtualChannelManager* channel_mgr; + IWTSVirtualChannel* channel; + GENERIC_CHANNEL_CALLBACK* channel_callback; + } GENERIC_LISTENER_CALLBACK; + + typedef struct GENERIC_DYNVC_PLUGIN GENERIC_DYNVC_PLUGIN; + typedef UINT (*DYNVC_PLUGIN_INIT_FN)(GENERIC_DYNVC_PLUGIN* plugin, rdpContext* context, + rdpSettings* settings); + typedef void (*DYNVC_PLUGIN_TERMINATE_FN)(GENERIC_DYNVC_PLUGIN* plugin); + + struct GENERIC_DYNVC_PLUGIN + { + IWTSPlugin iface; + GENERIC_LISTENER_CALLBACK* listener_callback; + IWTSListener* listener; + BOOL attached; + BOOL initialized; + wLog* log; + char* dynvc_name; + size_t channelCallbackSize; + const IWTSVirtualChannelCallback* channel_callbacks; + DYNVC_PLUGIN_TERMINATE_FN terminatePluginFn; + }; + #if defined(WITH_CHANNELS) FREERDP_API void* freerdp_channels_client_find_static_entry(const char* name, const char* identifier); diff --git a/include/freerdp/client/cliprdr.h b/include/freerdp/client/cliprdr.h index 0d9337ee4..143e1db9b 100644 --- a/include/freerdp/client/cliprdr.h +++ b/include/freerdp/client/cliprdr.h @@ -28,165 +28,174 @@ #include #include -/** - * Client Interface - */ - -typedef struct s_cliprdr_client_context CliprdrClientContext; - -typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, - const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, - const CLIPRDR_MONITOR_READY* monitorReady); -typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, - const CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, - const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*pcCliprdrClientFormatListResponse)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*pcCliprdrServerFormatListResponse)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*pcCliprdrClientLockClipboardData)( - CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*pcCliprdrServerLockClipboardData)( - CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*pcCliprdrClientUnlockClipboardData)( - CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*pcCliprdrServerUnlockClipboardData)( - CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*pcCliprdrClientFormatDataRequest)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*pcCliprdrServerFormatDataRequest)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*pcCliprdrClientFormatDataResponse)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*pcCliprdrServerFormatDataResponse)( - CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*pcCliprdrClientFileContentsRequest)( - CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*pcCliprdrServerFileContentsRequest)( - CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*pcCliprdrClientFileContentsResponse)( - CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef UINT (*pcCliprdrServerFileContentsResponse)( - CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); - -struct s_cliprdr_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcCliprdrServerCapabilities ServerCapabilities; - pcCliprdrClientCapabilities ClientCapabilities; - pcCliprdrMonitorReady MonitorReady; - pcCliprdrTempDirectory TempDirectory; - pcCliprdrClientFormatList ClientFormatList; - pcCliprdrServerFormatList ServerFormatList; - pcCliprdrClientFormatListResponse ClientFormatListResponse; - pcCliprdrServerFormatListResponse ServerFormatListResponse; - pcCliprdrClientLockClipboardData ClientLockClipboardData; - pcCliprdrServerLockClipboardData ServerLockClipboardData; - pcCliprdrClientUnlockClipboardData ClientUnlockClipboardData; - pcCliprdrServerUnlockClipboardData ServerUnlockClipboardData; - pcCliprdrClientFormatDataRequest ClientFormatDataRequest; - pcCliprdrServerFormatDataRequest ServerFormatDataRequest; - pcCliprdrClientFormatDataResponse ClientFormatDataResponse; - pcCliprdrServerFormatDataResponse ServerFormatDataResponse; - pcCliprdrClientFileContentsRequest ClientFileContentsRequest; - pcCliprdrServerFileContentsRequest ServerFileContentsRequest; - pcCliprdrClientFileContentsResponse ClientFileContentsResponse; - pcCliprdrServerFileContentsResponse ServerFileContentsResponse; + /** + * Client Interface + */ - UINT32 lastRequestedFormatId; - rdpContext* rdpcontext; -}; + typedef struct s_cliprdr_client_context CliprdrClientContext; -typedef struct -{ - UINT32 id; - char* name; - int length; -} CLIPRDR_FORMAT_NAME; + typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, + const CLIPRDR_CAPABILITIES* capabilities); + typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, + const CLIPRDR_CAPABILITIES* capabilities); + typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, + const CLIPRDR_MONITOR_READY* monitorReady); + typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, + const CLIPRDR_TEMP_DIRECTORY* tempDirectory); + typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST* formatList); + typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, + const CLIPRDR_FORMAT_LIST* formatList); + typedef UINT (*pcCliprdrClientFormatListResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); + typedef UINT (*pcCliprdrServerFormatListResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); + typedef UINT (*pcCliprdrClientLockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); + typedef UINT (*pcCliprdrServerLockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); + typedef UINT (*pcCliprdrClientUnlockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); + typedef UINT (*pcCliprdrServerUnlockClipboardData)( + CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); + typedef UINT (*pcCliprdrClientFormatDataRequest)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); + typedef UINT (*pcCliprdrServerFormatDataRequest)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); + typedef UINT (*pcCliprdrClientFormatDataResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); + typedef UINT (*pcCliprdrServerFormatDataResponse)( + CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); + typedef UINT (*pcCliprdrClientFileContentsRequest)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); + typedef UINT (*pcCliprdrServerFileContentsRequest)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); + typedef UINT (*pcCliprdrClientFileContentsResponse)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); + typedef UINT (*pcCliprdrServerFileContentsResponse)( + CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -/** - * Clipboard Events - */ + struct s_cliprdr_client_context + { + void* handle; + void* custom; -typedef struct -{ - wMessage event; - UINT32 capabilities; -} RDP_CB_CLIP_CAPS; + pcCliprdrServerCapabilities ServerCapabilities; + pcCliprdrClientCapabilities ClientCapabilities; + pcCliprdrMonitorReady MonitorReady; + pcCliprdrTempDirectory TempDirectory; + pcCliprdrClientFormatList ClientFormatList; + pcCliprdrServerFormatList ServerFormatList; + pcCliprdrClientFormatListResponse ClientFormatListResponse; + pcCliprdrServerFormatListResponse ServerFormatListResponse; + pcCliprdrClientLockClipboardData ClientLockClipboardData; + pcCliprdrServerLockClipboardData ServerLockClipboardData; + pcCliprdrClientUnlockClipboardData ClientUnlockClipboardData; + pcCliprdrServerUnlockClipboardData ServerUnlockClipboardData; + pcCliprdrClientFormatDataRequest ClientFormatDataRequest; + pcCliprdrServerFormatDataRequest ServerFormatDataRequest; + pcCliprdrClientFormatDataResponse ClientFormatDataResponse; + pcCliprdrServerFormatDataResponse ServerFormatDataResponse; + pcCliprdrClientFileContentsRequest ClientFileContentsRequest; + pcCliprdrServerFileContentsRequest ServerFileContentsRequest; + pcCliprdrClientFileContentsResponse ClientFileContentsResponse; + pcCliprdrServerFileContentsResponse ServerFileContentsResponse; -typedef struct -{ - wMessage event; - UINT32 capabilities; -} RDP_CB_MONITOR_READY_EVENT; + UINT32 lastRequestedFormatId; + rdpContext* rdpcontext; + }; -typedef struct -{ - wMessage event; - UINT32* formats; - UINT16 num_formats; - BYTE* raw_format_data; - UINT32 raw_format_data_size; - BOOL raw_format_unicode; -} RDP_CB_FORMAT_LIST_EVENT; + typedef struct + { + UINT32 id; + char* name; + int length; + } CLIPRDR_FORMAT_NAME; -typedef struct -{ - wMessage event; - UINT32 format; -} RDP_CB_DATA_REQUEST_EVENT; + /** + * Clipboard Events + */ -typedef struct -{ - wMessage event; - BYTE* data; - UINT32 size; -} RDP_CB_DATA_RESPONSE_EVENT; + typedef struct + { + wMessage event; + UINT32 capabilities; + } RDP_CB_CLIP_CAPS; -typedef struct -{ - wMessage event; - UINT32 streamId; - UINT32 lindex; - UINT32 dwFlags; - UINT32 nPositionLow; - UINT32 nPositionHigh; - UINT32 cbRequested; - UINT32 clipDataId; -} RDP_CB_FILECONTENTS_REQUEST_EVENT; + typedef struct + { + wMessage event; + UINT32 capabilities; + } RDP_CB_MONITOR_READY_EVENT; -typedef struct -{ - wMessage event; - BYTE* data; - UINT32 size; - UINT32 streamId; -} RDP_CB_FILECONTENTS_RESPONSE_EVENT; + typedef struct + { + wMessage event; + UINT32* formats; + UINT16 num_formats; + BYTE* raw_format_data; + UINT32 raw_format_data_size; + BOOL raw_format_unicode; + } RDP_CB_FORMAT_LIST_EVENT; -typedef struct -{ - wMessage event; - UINT32 clipDataId; -} RDP_CB_LOCK_CLIPDATA_EVENT; + typedef struct + { + wMessage event; + UINT32 format; + } RDP_CB_DATA_REQUEST_EVENT; -typedef struct -{ - wMessage event; - UINT32 clipDataId; -} RDP_CB_UNLOCK_CLIPDATA_EVENT; + typedef struct + { + wMessage event; + BYTE* data; + UINT32 size; + } RDP_CB_DATA_RESPONSE_EVENT; -typedef struct -{ - wMessage event; - char dirname[520]; -} RDP_CB_TEMPDIR_EVENT; + typedef struct + { + wMessage event; + UINT32 streamId; + UINT32 lindex; + UINT32 dwFlags; + UINT32 nPositionLow; + UINT32 nPositionHigh; + UINT32 cbRequested; + UINT32 clipDataId; + } RDP_CB_FILECONTENTS_REQUEST_EVENT; + + typedef struct + { + wMessage event; + BYTE* data; + UINT32 size; + UINT32 streamId; + } RDP_CB_FILECONTENTS_RESPONSE_EVENT; + + typedef struct + { + wMessage event; + UINT32 clipDataId; + } RDP_CB_LOCK_CLIPDATA_EVENT; + + typedef struct + { + wMessage event; + UINT32 clipDataId; + } RDP_CB_UNLOCK_CLIPDATA_EVENT; + + typedef struct + { + wMessage event; + char dirname[520]; + } RDP_CB_TEMPDIR_EVENT; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_CLIPRDR_CLIENT_CLIPRDR_H */ diff --git a/include/freerdp/client/disp.h b/include/freerdp/client/disp.h index ca018e1d5..26eff2713 100644 --- a/include/freerdp/client/disp.h +++ b/include/freerdp/client/disp.h @@ -24,20 +24,29 @@ #include -typedef struct s_disp_client_context DispClientContext; - -typedef UINT (*pcDispCaps)(DispClientContext* context, UINT32 MaxNumMonitors, - UINT32 MaxMonitorAreaFactorA, UINT32 MaxMonitorAreaFactorB); -typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, - DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); - -struct s_disp_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcDispCaps DisplayControlCaps; - pcDispSendMonitorLayout SendMonitorLayout; -}; + typedef struct s_disp_client_context DispClientContext; + + typedef UINT (*pcDispCaps)(DispClientContext* context, UINT32 MaxNumMonitors, + UINT32 MaxMonitorAreaFactorA, UINT32 MaxMonitorAreaFactorB); + typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, + DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); + + struct s_disp_client_context + { + void* handle; + void* custom; + + pcDispCaps DisplayControlCaps; + pcDispSendMonitorLayout SendMonitorLayout; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_DISP_CLIENT_DISP_H */ diff --git a/include/freerdp/client/drdynvc.h b/include/freerdp/client/drdynvc.h index abe6921ef..897f9dd7a 100644 --- a/include/freerdp/client/drdynvc.h +++ b/include/freerdp/client/drdynvc.h @@ -22,32 +22,41 @@ #ifndef FREERDP_CHANNEL_DRDYNVC_CLIENT_DRDYNVC_H #define FREERDP_CHANNEL_DRDYNVC_CLIENT_DRDYNVC_H -/** - * Client Interface - */ - -typedef struct s_drdynvc_client_context DrdynvcClientContext; - -typedef int (*pcDrdynvcGetVersion)(DrdynvcClientContext* context); -typedef UINT (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT (*pcDrdynvcOnChannelAttached)(DrdynvcClientContext* context, const char* name, - void* pInterface); -typedef UINT (*pcDrdynvcOnChannelDetached)(DrdynvcClientContext* context, const char* name, - void* pInterface); - -struct s_drdynvc_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcDrdynvcGetVersion GetVersion; - pcDrdynvcOnChannelConnected OnChannelConnected; - pcDrdynvcOnChannelDisconnected OnChannelDisconnected; - pcDrdynvcOnChannelAttached OnChannelAttached; - pcDrdynvcOnChannelDetached OnChannelDetached; -}; + /** + * Client Interface + */ + + typedef struct s_drdynvc_client_context DrdynvcClientContext; + + typedef int (*pcDrdynvcGetVersion)(DrdynvcClientContext* context); + typedef UINT (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, + void* pInterface); + typedef UINT (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, + void* pInterface); + typedef UINT (*pcDrdynvcOnChannelAttached)(DrdynvcClientContext* context, const char* name, + void* pInterface); + typedef UINT (*pcDrdynvcOnChannelDetached)(DrdynvcClientContext* context, const char* name, + void* pInterface); + + struct s_drdynvc_client_context + { + void* handle; + void* custom; + + pcDrdynvcGetVersion GetVersion; + pcDrdynvcOnChannelConnected OnChannelConnected; + pcDrdynvcOnChannelDisconnected OnChannelDisconnected; + pcDrdynvcOnChannelAttached OnChannelAttached; + pcDrdynvcOnChannelDetached OnChannelDetached; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_DRDYNVC_CLIENT_DRDYNVC_H */ diff --git a/include/freerdp/client/encomsp.h b/include/freerdp/client/encomsp.h index 4958e619a..005c8b33a 100644 --- a/include/freerdp/client/encomsp.h +++ b/include/freerdp/client/encomsp.h @@ -24,55 +24,65 @@ #include -/** - * Client Interface - */ - -typedef struct s_encomsp_client_context EncomspClientContext; - -typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, - const ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef UINT (*pcEncomspApplicationCreated)( - EncomspClientContext* context, const ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef UINT (*pcEncomspApplicationRemoved)( - EncomspClientContext* context, const ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, - const ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, - const ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, - const ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef UINT (*pcEncomspParticipantCreated)( - EncomspClientContext* context, const ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef UINT (*pcEncomspParticipantRemoved)( - EncomspClientContext* context, const ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef UINT (*pcEncomspChangeParticipantControlLevel)( - EncomspClientContext* context, - const ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef UINT (*pcEncomspGraphicsStreamPaused)( - EncomspClientContext* context, const ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef UINT (*pcEncomspGraphicsStreamResumed)( - EncomspClientContext* context, - const ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); - -struct s_encomsp_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcEncomspFilterUpdated FilterUpdated; - pcEncomspApplicationCreated ApplicationCreated; - pcEncomspApplicationRemoved ApplicationRemoved; - pcEncomspWindowCreated WindowCreated; - pcEncomspWindowRemoved WindowRemoved; - pcEncomspShowWindow ShowWindow; - pcEncomspParticipantCreated ParticipantCreated; - pcEncomspParticipantRemoved ParticipantRemoved; - pcEncomspChangeParticipantControlLevel ChangeParticipantControlLevel; - pcEncomspGraphicsStreamPaused GraphicsStreamPaused; - pcEncomspGraphicsStreamResumed GraphicsStreamResumed; + /** + * Client Interface + */ - UINT32 participantId; -}; + typedef struct s_encomsp_client_context EncomspClientContext; + + typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, + const ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); + typedef UINT (*pcEncomspApplicationCreated)( + EncomspClientContext* context, const ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); + typedef UINT (*pcEncomspApplicationRemoved)( + EncomspClientContext* context, const ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); + typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, + const ENCOMSP_WINDOW_CREATED_PDU* windowCreated); + typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, + const ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); + typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, + const ENCOMSP_SHOW_WINDOW_PDU* showWindow); + typedef UINT (*pcEncomspParticipantCreated)( + EncomspClientContext* context, const ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); + typedef UINT (*pcEncomspParticipantRemoved)( + EncomspClientContext* context, const ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); + typedef UINT (*pcEncomspChangeParticipantControlLevel)( + EncomspClientContext* context, + const ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); + typedef UINT (*pcEncomspGraphicsStreamPaused)( + EncomspClientContext* context, + const ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); + typedef UINT (*pcEncomspGraphicsStreamResumed)( + EncomspClientContext* context, + const ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); + + struct s_encomsp_client_context + { + void* handle; + void* custom; + + pcEncomspFilterUpdated FilterUpdated; + pcEncomspApplicationCreated ApplicationCreated; + pcEncomspApplicationRemoved ApplicationRemoved; + pcEncomspWindowCreated WindowCreated; + pcEncomspWindowRemoved WindowRemoved; + pcEncomspShowWindow ShowWindow; + pcEncomspParticipantCreated ParticipantCreated; + pcEncomspParticipantRemoved ParticipantRemoved; + pcEncomspChangeParticipantControlLevel ChangeParticipantControlLevel; + pcEncomspGraphicsStreamPaused GraphicsStreamPaused; + pcEncomspGraphicsStreamResumed GraphicsStreamResumed; + + UINT32 participantId; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_ENCOMSP_CLIENT_ENCOMSP_H */ diff --git a/include/freerdp/client/file.h b/include/freerdp/client/file.h index 9716c47ad..4a835e3c8 100644 --- a/include/freerdp/client/file.h +++ b/include/freerdp/client/file.h @@ -26,14 +26,15 @@ /* Ignore invalid integer values */ #define RDP_FILE_FLAG_PARSE_INT_RELAXED 1 -typedef struct rdp_file rdpFile; -typedef BOOL (*rdp_file_fkt_parse)(void* context, const char* key, char type, const char* value); - #ifdef __cplusplus extern "C" { #endif + typedef struct rdp_file rdpFile; + typedef BOOL (*rdp_file_fkt_parse)(void* context, const char* key, char type, + const char* value); + /* When using freerdp_client_parse_rdp_file_ex or freerdp_client_parse_rdp_file_buffer_ex * set the context for the callback with this function. */ FREERDP_API void freerdp_client_rdp_file_set_callback_context(rdpFile* file, void* context); diff --git a/include/freerdp/client/geometry.h b/include/freerdp/client/geometry.h index 202ad2c71..f1c4e7bed 100644 --- a/include/freerdp/client/geometry.h +++ b/include/freerdp/client/geometry.h @@ -24,47 +24,48 @@ #include #include -/** - * Client Interface - */ -typedef struct s_geometry_client_context GeometryClientContext; - -typedef struct S_MAPPED_GEOMETRY MAPPED_GEOMETRY; -typedef BOOL (*pcMappedGeometryAdded)(GeometryClientContext* context, MAPPED_GEOMETRY* geometry); -typedef BOOL (*pcMappedGeometryUpdate)(MAPPED_GEOMETRY* geometry); -typedef BOOL (*pcMappedGeometryClear)(MAPPED_GEOMETRY* geometry); - -/** @brief a geometry record tracked by the geometry channel */ -struct S_MAPPED_GEOMETRY -{ - volatile LONG refCounter; - UINT64 mappingId; - UINT64 topLevelId; - INT32 left, top, right, bottom; - INT32 topLevelLeft, topLevelTop, topLevelRight, topLevelBottom; - FREERDP_RGNDATA geometry; - - void* custom; - pcMappedGeometryUpdate MappedGeometryUpdate; - pcMappedGeometryClear MappedGeometryClear; -}; - -/** @brief the geometry context for client channel */ -struct s_geometry_client_context -{ - wHashTable* geometries; - void* handle; - void* custom; - - pcMappedGeometryAdded MappedGeometryAdded; - UINT32 remoteVersion; -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Client Interface + */ + typedef struct s_geometry_client_context GeometryClientContext; + + typedef struct S_MAPPED_GEOMETRY MAPPED_GEOMETRY; + typedef BOOL (*pcMappedGeometryAdded)(GeometryClientContext* context, + MAPPED_GEOMETRY* geometry); + typedef BOOL (*pcMappedGeometryUpdate)(MAPPED_GEOMETRY* geometry); + typedef BOOL (*pcMappedGeometryClear)(MAPPED_GEOMETRY* geometry); + + /** @brief a geometry record tracked by the geometry channel */ + struct S_MAPPED_GEOMETRY + { + volatile LONG refCounter; + UINT64 mappingId; + UINT64 topLevelId; + INT32 left, top, right, bottom; + INT32 topLevelLeft, topLevelTop, topLevelRight, topLevelBottom; + FREERDP_RGNDATA geometry; + + void* custom; + pcMappedGeometryUpdate MappedGeometryUpdate; + pcMappedGeometryClear MappedGeometryClear; + }; + + /** @brief the geometry context for client channel */ + struct s_geometry_client_context + { + wHashTable* geometries; + void* handle; + void* custom; + + pcMappedGeometryAdded MappedGeometryAdded; + UINT32 remoteVersion; + }; + FREERDP_API void mappedGeometryRef(MAPPED_GEOMETRY* g); FREERDP_API void mappedGeometryUnref(MAPPED_GEOMETRY* g); diff --git a/include/freerdp/client/printer.h b/include/freerdp/client/printer.h index 69854264c..fd4434594 100644 --- a/include/freerdp/client/printer.h +++ b/include/freerdp/client/printer.h @@ -25,56 +25,65 @@ #include -typedef struct rdp_printer_driver rdpPrinterDriver; -typedef struct rdp_printer rdpPrinter; -typedef struct rdp_print_job rdpPrintJob; - -typedef void (*pcReferencePrinterDriver)(rdpPrinterDriver* driver); -typedef rdpPrinter** (*pcEnumPrinters)(rdpPrinterDriver* driver); -typedef void (*pcReleaseEnumPrinters)(rdpPrinter** printers); - -typedef rdpPrinter* (*pcGetPrinter)(rdpPrinterDriver* driver, const char* name, - const char* driverName, BOOL isDefault); -typedef void (*pcReferencePrinter)(rdpPrinter* printer); - -struct rdp_printer_driver +#ifdef __cplusplus +extern "C" { - pcEnumPrinters EnumPrinters; - pcReleaseEnumPrinters ReleaseEnumPrinters; - pcGetPrinter GetPrinter; +#endif - pcReferencePrinterDriver AddRef; - pcReferencePrinterDriver ReleaseRef; -}; + typedef struct rdp_printer_driver rdpPrinterDriver; + typedef struct rdp_printer rdpPrinter; + typedef struct rdp_print_job rdpPrintJob; -typedef rdpPrintJob* (*pcCreatePrintJob)(rdpPrinter* printer, UINT32 id); -typedef rdpPrintJob* (*pcFindPrintJob)(rdpPrinter* printer, UINT32 id); + typedef void (*pcReferencePrinterDriver)(rdpPrinterDriver* driver); + typedef rdpPrinter** (*pcEnumPrinters)(rdpPrinterDriver* driver); + typedef void (*pcReleaseEnumPrinters)(rdpPrinter** printers); -struct rdp_printer -{ - size_t id; - char* name; - char* driver; - BOOL is_default; + typedef rdpPrinter* (*pcGetPrinter)(rdpPrinterDriver* driver, const char* name, + const char* driverName, BOOL isDefault); + typedef void (*pcReferencePrinter)(rdpPrinter* printer); - size_t references; - rdpPrinterDriver* backend; - pcCreatePrintJob CreatePrintJob; - pcFindPrintJob FindPrintJob; - pcReferencePrinter AddRef; - pcReferencePrinter ReleaseRef; -}; + struct rdp_printer_driver + { + pcEnumPrinters EnumPrinters; + pcReleaseEnumPrinters ReleaseEnumPrinters; + pcGetPrinter GetPrinter; -typedef UINT (*pcWritePrintJob)(rdpPrintJob* printjob, const BYTE* data, size_t size); -typedef void (*pcClosePrintJob)(rdpPrintJob* printjob); + pcReferencePrinterDriver AddRef; + pcReferencePrinterDriver ReleaseRef; + }; -struct rdp_print_job -{ - UINT32 id; - rdpPrinter* printer; + typedef rdpPrintJob* (*pcCreatePrintJob)(rdpPrinter* printer, UINT32 id); + typedef rdpPrintJob* (*pcFindPrintJob)(rdpPrinter* printer, UINT32 id); - pcWritePrintJob Write; - pcClosePrintJob Close; -}; + struct rdp_printer + { + size_t id; + char* name; + char* driver; + BOOL is_default; + + size_t references; + rdpPrinterDriver* backend; + pcCreatePrintJob CreatePrintJob; + pcFindPrintJob FindPrintJob; + pcReferencePrinter AddRef; + pcReferencePrinter ReleaseRef; + }; + + typedef UINT (*pcWritePrintJob)(rdpPrintJob* printjob, const BYTE* data, size_t size); + typedef void (*pcClosePrintJob)(rdpPrintJob* printjob); + + struct rdp_print_job + { + UINT32 id; + rdpPrinter* printer; + + pcWritePrintJob Write; + pcClosePrintJob Close; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_PRINTER_CLIENT_PRINTER_H */ diff --git a/include/freerdp/client/rdpei.h b/include/freerdp/client/rdpei.h index dbf5b02a3..6457c3b77 100644 --- a/include/freerdp/client/rdpei.h +++ b/include/freerdp/client/rdpei.h @@ -24,65 +24,75 @@ #include -/** - * Client Interface - */ - -typedef struct s_rdpei_client_context RdpeiClientContext; - -typedef UINT32 (*pcRdpeiGetVersion)(RdpeiClientContext* context); -typedef UINT32 (*pcRdpeiGetFeatures)(RdpeiClientContext* context); - -typedef UINT (*pcRdpeiAddContact)(RdpeiClientContext* context, - const RDPINPUT_CONTACT_DATA* contact); - -typedef UINT (*pcRdpeiTouchEvent)(RdpeiClientContext* context, INT32 externalId, INT32 x, INT32 y, - INT32* contactId); -typedef UINT (*pcRdpeiTouchRawEvent)(RdpeiClientContext* context, INT32 externalId, INT32 x, - INT32 y, INT32* contactId, UINT32 contactFlags, - UINT32 fieldFlags, ...); - -typedef UINT (*pcRdpeiAddPen)(RdpeiClientContext* context, INT32 externalId, - const RDPINPUT_PEN_CONTACT* contact); - -typedef UINT (*pcRdpeiPen)(RdpeiClientContext* context, INT32 externalId, UINT32 fieldFlags, - INT32 x, INT32 y, ...); -typedef UINT (*pcRdpeiPenRawEvent)(RdpeiClientContext* context, INT32 externalId, - UINT32 contactFlags, UINT32 fieldFlags, INT32 x, INT32 y, ...); - -typedef UINT (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); -typedef UINT (*pcRdpeiResumeTouch)(RdpeiClientContext* context); - -struct s_rdpei_client_context +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; +#endif - pcRdpeiGetVersion GetVersion; - pcRdpeiGetFeatures GetFeatures; + /** + * Client Interface + */ - pcRdpeiAddContact AddContact; + typedef struct s_rdpei_client_context RdpeiClientContext; - pcRdpeiTouchEvent TouchBegin; - pcRdpeiTouchEvent TouchUpdate; - pcRdpeiTouchEvent TouchEnd; + typedef UINT32 (*pcRdpeiGetVersion)(RdpeiClientContext* context); + typedef UINT32 (*pcRdpeiGetFeatures)(RdpeiClientContext* context); - pcRdpeiAddPen AddPen; + typedef UINT (*pcRdpeiAddContact)(RdpeiClientContext* context, + const RDPINPUT_CONTACT_DATA* contact); - pcRdpeiPen PenBegin; - pcRdpeiPen PenUpdate; - pcRdpeiPen PenEnd; + typedef UINT (*pcRdpeiTouchEvent)(RdpeiClientContext* context, INT32 externalId, INT32 x, + INT32 y, INT32* contactId); + typedef UINT (*pcRdpeiTouchRawEvent)(RdpeiClientContext* context, INT32 externalId, INT32 x, + INT32 y, INT32* contactId, UINT32 contactFlags, + UINT32 fieldFlags, ...); - pcRdpeiSuspendTouch SuspendTouch; - pcRdpeiResumeTouch ResumeTouch; + typedef UINT (*pcRdpeiAddPen)(RdpeiClientContext* context, INT32 externalId, + const RDPINPUT_PEN_CONTACT* contact); - pcRdpeiTouchEvent TouchCancel; - pcRdpeiTouchRawEvent TouchRawEvent; + typedef UINT (*pcRdpeiPen)(RdpeiClientContext* context, INT32 externalId, UINT32 fieldFlags, + INT32 x, INT32 y, ...); + typedef UINT (*pcRdpeiPenRawEvent)(RdpeiClientContext* context, INT32 externalId, + UINT32 contactFlags, UINT32 fieldFlags, INT32 x, INT32 y, + ...); - pcRdpeiPen PenCancel; - pcRdpeiPenRawEvent PenRawEvent; + typedef UINT (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); + typedef UINT (*pcRdpeiResumeTouch)(RdpeiClientContext* context); - UINT32 clientFeaturesMask; -}; + struct s_rdpei_client_context + { + void* handle; + void* custom; + + pcRdpeiGetVersion GetVersion; + pcRdpeiGetFeatures GetFeatures; + + pcRdpeiAddContact AddContact; + + pcRdpeiTouchEvent TouchBegin; + pcRdpeiTouchEvent TouchUpdate; + pcRdpeiTouchEvent TouchEnd; + + pcRdpeiAddPen AddPen; + + pcRdpeiPen PenBegin; + pcRdpeiPen PenUpdate; + pcRdpeiPen PenEnd; + + pcRdpeiSuspendTouch SuspendTouch; + pcRdpeiResumeTouch ResumeTouch; + + pcRdpeiTouchEvent TouchCancel; + pcRdpeiTouchRawEvent TouchRawEvent; + + pcRdpeiPen PenCancel; + pcRdpeiPenRawEvent PenRawEvent; + + UINT32 clientFeaturesMask; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_RDPEI_CLIENT_RDPEI_H */ diff --git a/include/freerdp/client/rdpgfx.h b/include/freerdp/client/rdpgfx.h index 41c02de5b..aa1885d12 100644 --- a/include/freerdp/client/rdpgfx.h +++ b/include/freerdp/client/rdpgfx.h @@ -28,147 +28,151 @@ #include -/** - * Client Interface - */ -typedef struct gdi_gfx_surface gdiGfxSurface; -typedef struct s_rdpgfx_client_context RdpgfxClientContext; - -typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, - const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); -typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context, - const RDPGFX_START_FRAME_PDU* startFrame); -typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context, - const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_COMMAND* cmd); -typedef UINT (*pcRdpgfxDeleteEncodingContext)( - RdpgfxClientContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); -typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, - const RDPGFX_CREATE_SURFACE_PDU* createSurface); -typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, - const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); -typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context, - const RDPGFX_SOLID_FILL_PDU* solidFill); -typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); -typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, - const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); -typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, - const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); -typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); -typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); -typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, - const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); -typedef UINT (*pcRdpgfxImportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot, - PERSISTENT_CACHE_ENTRY* importCacheEntry); -typedef UINT (*pcRdpgfxExportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot, - PERSISTENT_CACHE_ENTRY* importCacheEntry); -typedef UINT (*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); -typedef UINT (*pcRdpgfxMapSurfaceToScaledOutput)( - RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); -typedef UINT (*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); -typedef UINT (*pcRdpgfxMapSurfaceToScaledWindow)( - RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); -typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, void* pData); -typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId); -typedef UINT (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds, - UINT16* count); -typedef UINT (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot, - void* pData); -typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot); - -typedef UINT (*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context); - -typedef UINT (*pcRdpgfxUpdateWindowFromSurface)(RdpgfxClientContext* context, - gdiGfxSurface* surface); - -typedef UINT (*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId, - UINT32 nrRects, const RECTANGLE_16* rects); - -typedef UINT (*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise, - BOOL* do_frame_acks); -typedef UINT (*pcRdpgfxOnClose)(RdpgfxClientContext* context); -typedef UINT (*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); -typedef UINT (*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context, - const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); -typedef UINT (*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); -typedef UINT (*pcRdpgfxQoeFrameAcknowledge)( - RdpgfxClientContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); - -typedef UINT (*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID, - UINT64 windowID); -typedef UINT (*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID); - -struct s_rdpgfx_client_context -{ - void* handle; - void* custom; - - /* Implementations require locking */ - pcRdpgfxResetGraphics ResetGraphics; - pcRdpgfxStartFrame StartFrame; - pcRdpgfxEndFrame EndFrame; - pcRdpgfxSurfaceCommand SurfaceCommand; - pcRdpgfxDeleteEncodingContext DeleteEncodingContext; - pcRdpgfxCreateSurface CreateSurface; - pcRdpgfxDeleteSurface DeleteSurface; - pcRdpgfxSolidFill SolidFill; - pcRdpgfxSurfaceToSurface SurfaceToSurface; - pcRdpgfxSurfaceToCache SurfaceToCache; - pcRdpgfxCacheToSurface CacheToSurface; - pcRdpgfxCacheImportOffer CacheImportOffer; - pcRdpgfxCacheImportReply CacheImportReply; - pcRdpgfxImportCacheEntry ImportCacheEntry; - pcRdpgfxExportCacheEntry ExportCacheEntry; - pcRdpgfxEvictCacheEntry EvictCacheEntry; - pcRdpgfxMapSurfaceToOutput MapSurfaceToOutput; - pcRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput; - pcRdpgfxMapSurfaceToWindow MapSurfaceToWindow; - pcRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow; - - pcRdpgfxGetSurfaceIds GetSurfaceIds; - pcRdpgfxSetSurfaceData SetSurfaceData; - pcRdpgfxGetSurfaceData GetSurfaceData; - pcRdpgfxSetCacheSlotData SetCacheSlotData; - pcRdpgfxGetCacheSlotData GetCacheSlotData; - - /* Proxy callbacks */ - pcRdpgfxOnOpen OnOpen; - pcRdpgfxOnClose OnClose; - pcRdpgfxCapsAdvertise CapsAdvertise; - pcRdpgfxCapsConfirm CapsConfirm; - pcRdpgfxFrameAcknowledge FrameAcknowledge; - pcRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge; - - /* No locking required */ - pcRdpgfxUpdateSurfaces UpdateSurfaces; - pcRdpgfxUpdateSurfaceArea UpdateSurfaceArea; - pcRdpgfxUpdateWindowFromSurface UpdateWindowFromSurface; - - /* These callbacks allow creating/destroying a window directly - * mapped to a surface. - * NOTE: The surface is already locked. - */ - pcRdpgfxMapWindowForSurface MapWindowForSurface; - pcRdpgfxUnmapWindowForSurface UnmapWindowForSurface; - - CRITICAL_SECTION mux; - rdpCodecs* codecs; - PROFILER_DEFINE(SurfaceProfiler) -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Client Interface + */ + typedef struct gdi_gfx_surface gdiGfxSurface; + typedef struct s_rdpgfx_client_context RdpgfxClientContext; + + typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, + const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); + typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context, + const RDPGFX_START_FRAME_PDU* startFrame); + typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context, + const RDPGFX_END_FRAME_PDU* endFrame); + typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_COMMAND* cmd); + typedef UINT (*pcRdpgfxDeleteEncodingContext)( + RdpgfxClientContext* context, + const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); + typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, + const RDPGFX_CREATE_SURFACE_PDU* createSurface); + typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, + const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); + typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context, + const RDPGFX_SOLID_FILL_PDU* solidFill); + typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); + typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, + const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); + typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, + const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); + typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, + const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); + typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, + const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); + typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, + const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); + typedef UINT (*pcRdpgfxImportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot, + PERSISTENT_CACHE_ENTRY* importCacheEntry); + typedef UINT (*pcRdpgfxExportCacheEntry)(RdpgfxClientContext* context, UINT16 cacheSlot, + PERSISTENT_CACHE_ENTRY* importCacheEntry); + typedef UINT (*pcRdpgfxMapSurfaceToOutput)( + RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); + typedef UINT (*pcRdpgfxMapSurfaceToScaledOutput)( + RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); + typedef UINT (*pcRdpgfxMapSurfaceToWindow)( + RdpgfxClientContext* context, const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); + typedef UINT (*pcRdpgfxMapSurfaceToScaledWindow)( + RdpgfxClientContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); + typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, + void* pData); + typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId); + typedef UINT (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds, + UINT16* count); + typedef UINT (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot, + void* pData); + typedef void* (*pcRdpgfxGetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot); + + typedef UINT (*pcRdpgfxUpdateSurfaces)(RdpgfxClientContext* context); + + typedef UINT (*pcRdpgfxUpdateWindowFromSurface)(RdpgfxClientContext* context, + gdiGfxSurface* surface); + + typedef UINT (*pcRdpgfxUpdateSurfaceArea)(RdpgfxClientContext* context, UINT16 surfaceId, + UINT32 nrRects, const RECTANGLE_16* rects); + + typedef UINT (*pcRdpgfxOnOpen)(RdpgfxClientContext* context, BOOL* do_caps_advertise, + BOOL* do_frame_acks); + typedef UINT (*pcRdpgfxOnClose)(RdpgfxClientContext* context); + typedef UINT (*pcRdpgfxCapsAdvertise)(RdpgfxClientContext* context, + const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); + typedef UINT (*pcRdpgfxCapsConfirm)(RdpgfxClientContext* context, + const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); + typedef UINT (*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context, + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); + typedef UINT (*pcRdpgfxQoeFrameAcknowledge)( + RdpgfxClientContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); + + typedef UINT (*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID, + UINT64 windowID); + typedef UINT (*pcRdpgfxUnmapWindowForSurface)(RdpgfxClientContext* context, UINT64 windowID); + + struct s_rdpgfx_client_context + { + void* handle; + void* custom; + + /* Implementations require locking */ + pcRdpgfxResetGraphics ResetGraphics; + pcRdpgfxStartFrame StartFrame; + pcRdpgfxEndFrame EndFrame; + pcRdpgfxSurfaceCommand SurfaceCommand; + pcRdpgfxDeleteEncodingContext DeleteEncodingContext; + pcRdpgfxCreateSurface CreateSurface; + pcRdpgfxDeleteSurface DeleteSurface; + pcRdpgfxSolidFill SolidFill; + pcRdpgfxSurfaceToSurface SurfaceToSurface; + pcRdpgfxSurfaceToCache SurfaceToCache; + pcRdpgfxCacheToSurface CacheToSurface; + pcRdpgfxCacheImportOffer CacheImportOffer; + pcRdpgfxCacheImportReply CacheImportReply; + pcRdpgfxImportCacheEntry ImportCacheEntry; + pcRdpgfxExportCacheEntry ExportCacheEntry; + pcRdpgfxEvictCacheEntry EvictCacheEntry; + pcRdpgfxMapSurfaceToOutput MapSurfaceToOutput; + pcRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput; + pcRdpgfxMapSurfaceToWindow MapSurfaceToWindow; + pcRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow; + + pcRdpgfxGetSurfaceIds GetSurfaceIds; + pcRdpgfxSetSurfaceData SetSurfaceData; + pcRdpgfxGetSurfaceData GetSurfaceData; + pcRdpgfxSetCacheSlotData SetCacheSlotData; + pcRdpgfxGetCacheSlotData GetCacheSlotData; + + /* Proxy callbacks */ + pcRdpgfxOnOpen OnOpen; + pcRdpgfxOnClose OnClose; + pcRdpgfxCapsAdvertise CapsAdvertise; + pcRdpgfxCapsConfirm CapsConfirm; + pcRdpgfxFrameAcknowledge FrameAcknowledge; + pcRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge; + + /* No locking required */ + pcRdpgfxUpdateSurfaces UpdateSurfaces; + pcRdpgfxUpdateSurfaceArea UpdateSurfaceArea; + pcRdpgfxUpdateWindowFromSurface UpdateWindowFromSurface; + + /* These callbacks allow creating/destroying a window directly + * mapped to a surface. + * NOTE: The surface is already locked. + */ + pcRdpgfxMapWindowForSurface MapWindowForSurface; + pcRdpgfxUnmapWindowForSurface UnmapWindowForSurface; + + CRITICAL_SECTION mux; + rdpCodecs* codecs; + PROFILER_DEFINE(SurfaceProfiler) + }; + FREERDP_API RdpgfxClientContext* rdpgfx_client_context_new(rdpContext* context); FREERDP_API void rdpgfx_client_context_free(RdpgfxClientContext* context); diff --git a/include/freerdp/client/remdesk.h b/include/freerdp/client/remdesk.h index 89751f4dc..cc9799d25 100644 --- a/include/freerdp/client/remdesk.h +++ b/include/freerdp/client/remdesk.h @@ -22,14 +22,23 @@ #include -/** - * Client Interface - */ - -typedef struct +#ifdef __cplusplus +extern "C" { - void* handle; - void* custom; -} RemdeskClientContext; +#endif + + /** + * Client Interface + */ + + typedef struct + { + void* handle; + void* custom; + } RemdeskClientContext; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_REMDESK_CLIENT_REMDESK_H */ diff --git a/include/freerdp/client/sshagent.h b/include/freerdp/client/sshagent.h index f549abbfa..9df5373f3 100644 --- a/include/freerdp/client/sshagent.h +++ b/include/freerdp/client/sshagent.h @@ -26,61 +26,70 @@ #include #include -typedef struct +#ifdef __cplusplus +extern "C" { - int ProtocolVersion; - int MaxConnections; -} SSHAgentClientContext; +#endif -/* - * The channel is defined by the sshagent channel in xrdp as follows. - * - * Server to client commands - * ------------------------- - * - * Capabilities (at start of channel stream): - * - * INT32 SA_TAG_CAPABILITY - * INT32 SSHAGENT_CHAN_PROT_VERSION := 1 - * INT32 SSHAGENT_MAX_CONNECTIONS - * - * Open connection: - * - * INT32 SA_TAG_OPEN - * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - * - * Send data: - * - * INT32 SA_TAG_WRITE - * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - * INT32 Data length - * DATA ... - * - * Close connection: - * - * INT32 SA_TAG_CLOSE - * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - * - * Client to server commands - * ------------------------- - * - * Capabilities (in reply to server capabilities): - * - * INT32 SA_TAG_CAPABILITY - * INT32 SSHAGENT_CHAN_PROT_VERSION := 1 - * INT32 SSHAGENT_MAX_CONNECTIONS - * - * Send data: - * - * INT32 SA_TAG_WRITE - * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - * INT32 Data length - * DATA ... - * - * Close connection (abnormal): - * - * INT32 SA_TAG_CLOSE - * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) - */ + typedef struct + { + int ProtocolVersion; + int MaxConnections; + } SSHAgentClientContext; + + /* + * The channel is defined by the sshagent channel in xrdp as follows. + * + * Server to client commands + * ------------------------- + * + * Capabilities (at start of channel stream): + * + * INT32 SA_TAG_CAPABILITY + * INT32 SSHAGENT_CHAN_PROT_VERSION := 1 + * INT32 SSHAGENT_MAX_CONNECTIONS + * + * Open connection: + * + * INT32 SA_TAG_OPEN + * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) + * + * Send data: + * + * INT32 SA_TAG_WRITE + * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) + * INT32 Data length + * DATA ... + * + * Close connection: + * + * INT32 SA_TAG_CLOSE + * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) + * + * Client to server commands + * ------------------------- + * + * Capabilities (in reply to server capabilities): + * + * INT32 SA_TAG_CAPABILITY + * INT32 SSHAGENT_CHAN_PROT_VERSION := 1 + * INT32 SSHAGENT_MAX_CONNECTIONS + * + * Send data: + * + * INT32 SA_TAG_WRITE + * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) + * INT32 Data length + * DATA ... + * + * Close connection (abnormal): + * + * INT32 SA_TAG_CLOSE + * INT32 Connection id (0, ..., SSHAGENT_MAX_CONNECTIONS - 1) + */ + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_CLIENT_SSHAGENT_H */ diff --git a/include/freerdp/client/tsmf.h b/include/freerdp/client/tsmf.h index a3d1be62d..e9cff3cd5 100644 --- a/include/freerdp/client/tsmf.h +++ b/include/freerdp/client/tsmf.h @@ -36,35 +36,44 @@ #define RDP_PIXFMT_I420 0x30323449 #define RDP_PIXFMT_YV12 0x32315659 -typedef struct +#ifdef __cplusplus +extern "C" { - BYTE* frameData; - UINT32 frameSize; - UINT32 framePixFmt; - INT16 frameWidth; - INT16 frameHeight; - INT16 x; - INT16 y; - INT16 width; - INT16 height; - UINT16 numVisibleRects; - RECTANGLE_16* visibleRects; -} TSMF_VIDEO_FRAME_EVENT; +#endif -/** - * Client Interface - */ + typedef struct + { + BYTE* frameData; + UINT32 frameSize; + UINT32 framePixFmt; + INT16 frameWidth; + INT16 frameHeight; + INT16 x; + INT16 y; + INT16 width; + INT16 height; + UINT16 numVisibleRects; + RECTANGLE_16* visibleRects; + } TSMF_VIDEO_FRAME_EVENT; -typedef struct s_tsmf_client_context TsmfClientContext; + /** + * Client Interface + */ -typedef int (*pcTsmfFrameEvent)(TsmfClientContext* context, TSMF_VIDEO_FRAME_EVENT* event); + typedef struct s_tsmf_client_context TsmfClientContext; -struct s_tsmf_client_context -{ - void* handle; - void* custom; + typedef int (*pcTsmfFrameEvent)(TsmfClientContext* context, TSMF_VIDEO_FRAME_EVENT* event); - pcTsmfFrameEvent FrameEvent; -}; + struct s_tsmf_client_context + { + void* handle; + void* custom; + + pcTsmfFrameEvent FrameEvent; + }; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_CHANNEL_TSMF_CLIENT_TSMF_H */ diff --git a/include/freerdp/codec/audio.h b/include/freerdp/codec/audio.h index 820758268..04cb9ef42 100644 --- a/include/freerdp/codec/audio.h +++ b/include/freerdp/codec/audio.h @@ -25,8 +25,9 @@ #include #include -#ifdef _WIN32 -#include +#ifdef __cplusplus +extern "C" +{ #endif struct AUDIO_FORMAT @@ -191,11 +192,6 @@ typedef struct AUDIO_FORMAT AUDIO_FORMAT; * Audio Format Functions */ -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API UINT32 audio_format_compute_time_length(const AUDIO_FORMAT* format, size_t size); FREERDP_API char* audio_format_get_tag_string(UINT16 wFormatTag); diff --git a/include/freerdp/codec/clear.h b/include/freerdp/codec/clear.h index 859c24cfb..3c6456b87 100644 --- a/include/freerdp/codec/clear.h +++ b/include/freerdp/codec/clear.h @@ -26,13 +26,13 @@ #include #include -typedef struct S_CLEAR_CONTEXT CLEAR_CONTEXT; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_CLEAR_CONTEXT CLEAR_CONTEXT; + FREERDP_API int clear_compress(CLEAR_CONTEXT* clear, const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize); diff --git a/include/freerdp/codec/color.h b/include/freerdp/codec/color.h index c45499823..f769df4ab 100644 --- a/include/freerdp/codec/color.h +++ b/include/freerdp/codec/color.h @@ -24,6 +24,11 @@ #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define FREERDP_PIXEL_FORMAT_TYPE_A 0 #define FREERDP_PIXEL_FORMAT_TYPE_ARGB 1 #define FREERDP_PIXEL_FORMAT_TYPE_ABGR 2 @@ -102,11 +107,6 @@ struct gdi_palette }; typedef struct gdi_palette gdiPalette; -#ifdef __cplusplus -extern "C" -{ -#endif - /* Compare two color formats but ignore differences in alpha channel. */ FREERDP_API DWORD FreeRDPAreColorFormatsEqualNoAlpha(DWORD first, DWORD second); diff --git a/include/freerdp/codec/dsp.h b/include/freerdp/codec/dsp.h index 8ce28dc56..69e728db8 100644 --- a/include/freerdp/codec/dsp.h +++ b/include/freerdp/codec/dsp.h @@ -25,13 +25,13 @@ #include #include -typedef struct S_FREERDP_DSP_CONTEXT FREERDP_DSP_CONTEXT; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_FREERDP_DSP_CONTEXT FREERDP_DSP_CONTEXT; + FREERDP_API FREERDP_DSP_CONTEXT* freerdp_dsp_context_new(BOOL encoder); FREERDP_API BOOL freerdp_dsp_supports_format(const AUDIO_FORMAT* format, BOOL encode); FREERDP_API BOOL freerdp_dsp_encode(FREERDP_DSP_CONTEXT* context, const AUDIO_FORMAT* srcFormat, diff --git a/include/freerdp/codec/h264.h b/include/freerdp/codec/h264.h index 6dece7a9e..425c31cf6 100644 --- a/include/freerdp/codec/h264.h +++ b/include/freerdp/codec/h264.h @@ -26,55 +26,55 @@ #include #include -typedef struct S_H264_CONTEXT_SUBSYSTEM H264_CONTEXT_SUBSYSTEM; -typedef struct S_YUV_CONTEXT YUV_CONTEXT; - -typedef enum -{ - H264_RATECONTROL_VBR = 0, - H264_RATECONTROL_CQP -} H264_RATECONTROL_MODE; - -typedef struct -{ - BOOL Compressor; - - UINT32 width; - UINT32 height; - - H264_RATECONTROL_MODE RateControlMode; - UINT32 BitRate; - UINT32 FrameRate; - UINT32 QP; - UINT32 NumberOfThreads; - - UINT32 iStride[3]; - BYTE* pOldYUVData[3]; - BYTE* pYUVData[3]; - - UINT32 iYUV444Size[3]; - UINT32 iYUV444Stride[3]; - BYTE* pOldYUV444Data[3]; - BYTE* pYUV444Data[3]; - - UINT32 numSystemData; - void* pSystemData; - const H264_CONTEXT_SUBSYSTEM* subsystem; - YUV_CONTEXT* yuv; - - BOOL encodingBuffer; - BOOL firstLumaFrameDone; - BOOL firstChromaFrameDone; - - void* lumaData; - wLog* log; -} H264_CONTEXT; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_H264_CONTEXT_SUBSYSTEM H264_CONTEXT_SUBSYSTEM; + typedef struct S_YUV_CONTEXT YUV_CONTEXT; + + typedef enum + { + H264_RATECONTROL_VBR = 0, + H264_RATECONTROL_CQP + } H264_RATECONTROL_MODE; + + typedef struct + { + BOOL Compressor; + + UINT32 width; + UINT32 height; + + H264_RATECONTROL_MODE RateControlMode; + UINT32 BitRate; + UINT32 FrameRate; + UINT32 QP; + UINT32 NumberOfThreads; + + UINT32 iStride[3]; + BYTE* pOldYUVData[3]; + BYTE* pYUVData[3]; + + UINT32 iYUV444Size[3]; + UINT32 iYUV444Stride[3]; + BYTE* pOldYUV444Data[3]; + BYTE* pYUV444Data[3]; + + UINT32 numSystemData; + void* pSystemData; + const H264_CONTEXT_SUBSYSTEM* subsystem; + YUV_CONTEXT* yuv; + + BOOL encodingBuffer; + BOOL firstLumaFrameDone; + BOOL firstChromaFrameDone; + + void* lumaData; + wLog* log; + } H264_CONTEXT; + static INLINE void free_h264_metablock(RDPGFX_H264_METABLOCK* meta) { RDPGFX_H264_METABLOCK m = { 0 }; diff --git a/include/freerdp/codec/interleaved.h b/include/freerdp/codec/interleaved.h index d2ef02e5a..14d9f9a44 100644 --- a/include/freerdp/codec/interleaved.h +++ b/include/freerdp/codec/interleaved.h @@ -26,13 +26,13 @@ #include #include -typedef struct S_BITMAP_INTERLEAVED_CONTEXT BITMAP_INTERLEAVED_CONTEXT; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_BITMAP_INTERLEAVED_CONTEXT BITMAP_INTERLEAVED_CONTEXT; + FREERDP_API BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, const BYTE* pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, UINT32 bpp, BYTE* pDstData, diff --git a/include/freerdp/codec/planar.h b/include/freerdp/codec/planar.h index 34a5e6e0a..a83d25c94 100644 --- a/include/freerdp/codec/planar.h +++ b/include/freerdp/codec/planar.h @@ -24,8 +24,6 @@ #include -typedef struct S_BITMAP_PLANAR_CONTEXT BITMAP_PLANAR_CONTEXT; - #include #include @@ -40,70 +38,72 @@ typedef struct S_BITMAP_PLANAR_CONTEXT BITMAP_PLANAR_CONTEXT; #define PLANAR_CONTROL_BYTE_RUN_LENGTH(_controlByte) (_controlByte & 0x0F) #define PLANAR_CONTROL_BYTE_RAW_BYTES(_controlByte) ((_controlByte >> 4) & 0x0F) -typedef struct -{ - /** - * controlByte: - * [0-3]: nRunLength - * [4-7]: cRawBytes - */ - BYTE controlByte; - BYTE* rawValues; -} RDP6_RLE_SEGMENT; - -typedef struct -{ - UINT32 cSegments; - RDP6_RLE_SEGMENT* segments; -} RDP6_RLE_SEGMENTS; - -typedef struct -{ - /** - * formatHeader: - * [0-2]: Color Loss Level (CLL) - * [3] : Chroma Subsampling (CS) - * [4] : Run Length Encoding (RLE) - * [5] : No Alpha (NA) - * [6-7]: Reserved - */ - BYTE formatHeader; -} RDP6_BITMAP_STREAM; - -struct S_BITMAP_PLANAR_CONTEXT -{ - UINT32 maxWidth; - UINT32 maxHeight; - UINT32 maxPlaneSize; - - BOOL AllowSkipAlpha; - BOOL AllowRunLengthEncoding; - BOOL AllowColorSubsampling; - BOOL AllowDynamicColorFidelity; - - UINT32 ColorLossLevel; - - BYTE* planes[4]; - BYTE* planesBuffer; - - BYTE* deltaPlanes[4]; - BYTE* deltaPlanesBuffer; - - BYTE* rlePlanes[4]; - BYTE* rlePlanesBuffer; - - BYTE* pTempData; - UINT32 nTempStep; - - BOOL bgr; - BOOL topdown; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_BITMAP_PLANAR_CONTEXT BITMAP_PLANAR_CONTEXT; + + typedef struct + { + /** + * controlByte: + * [0-3]: nRunLength + * [4-7]: cRawBytes + */ + BYTE controlByte; + BYTE* rawValues; + } RDP6_RLE_SEGMENT; + + typedef struct + { + UINT32 cSegments; + RDP6_RLE_SEGMENT* segments; + } RDP6_RLE_SEGMENTS; + + typedef struct + { + /** + * formatHeader: + * [0-2]: Color Loss Level (CLL) + * [3] : Chroma Subsampling (CS) + * [4] : Run Length Encoding (RLE) + * [5] : No Alpha (NA) + * [6-7]: Reserved + */ + BYTE formatHeader; + } RDP6_BITMAP_STREAM; + + struct S_BITMAP_PLANAR_CONTEXT + { + UINT32 maxWidth; + UINT32 maxHeight; + UINT32 maxPlaneSize; + + BOOL AllowSkipAlpha; + BOOL AllowRunLengthEncoding; + BOOL AllowColorSubsampling; + BOOL AllowDynamicColorFidelity; + + UINT32 ColorLossLevel; + + BYTE* planes[4]; + BYTE* planesBuffer; + + BYTE* deltaPlanes[4]; + BYTE* deltaPlanesBuffer; + + BYTE* rlePlanes[4]; + BYTE* rlePlanesBuffer; + + BYTE* pTempData; + UINT32 nTempStep; + + BOOL bgr; + BOOL topdown; + }; + FREERDP_API BYTE* freerdp_bitmap_compress_planar(BITMAP_PLANAR_CONTEXT* context, const BYTE* data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE* dstData, diff --git a/include/freerdp/codec/progressive.h b/include/freerdp/codec/progressive.h index e23ca2dff..e1a37e56e 100644 --- a/include/freerdp/codec/progressive.h +++ b/include/freerdp/codec/progressive.h @@ -20,8 +20,6 @@ #ifndef FREERDP_CODEC_PROGRESSIVE_H #define FREERDP_CODEC_PROGRESSIVE_H -typedef struct S_PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT; - #include #include @@ -37,6 +35,8 @@ extern "C" { #endif + typedef struct S_PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT; + FREERDP_API int progressive_compress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcData, UINT32 SrcSize, UINT32 SrcFormat, UINT32 Width, UINT32 Height, UINT32 ScanLine, diff --git a/include/freerdp/codec/yuv.h b/include/freerdp/codec/yuv.h index adf056f6f..34acc28ef 100644 --- a/include/freerdp/codec/yuv.h +++ b/include/freerdp/codec/yuv.h @@ -20,8 +20,6 @@ #ifndef FREERDP_CODEC_YUV_H #define FREERDP_CODEC_YUV_H -typedef struct S_YUV_CONTEXT YUV_CONTEXT; - #include #include #include @@ -32,6 +30,8 @@ extern "C" { #endif + typedef struct S_YUV_CONTEXT YUV_CONTEXT; + FREERDP_API BOOL yuv420_context_decode(YUV_CONTEXT* context, const BYTE* pYUVData[3], const UINT32 iStride[3], UINT32 yuvHeight, DWORD DstFormat, BYTE* dest, UINT32 nDstStep, diff --git a/include/freerdp/codec/zgfx.h b/include/freerdp/codec/zgfx.h index 074bbd68a..ff476b051 100644 --- a/include/freerdp/codec/zgfx.h +++ b/include/freerdp/codec/zgfx.h @@ -32,13 +32,13 @@ #define ZGFX_SEGMENTED_MAXSIZE 65535 -typedef struct S_ZGFX_CONTEXT ZGFX_CONTEXT; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_ZGFX_CONTEXT ZGFX_CONTEXT; + FREERDP_API int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData, UINT32* pDstSize, UINT32 flags); FREERDP_API int zgfx_compress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, diff --git a/include/freerdp/codecs.h b/include/freerdp/codecs.h index d0d0714db..54a621f14 100644 --- a/include/freerdp/codecs.h +++ b/include/freerdp/codecs.h @@ -45,24 +45,24 @@ #define FREERDP_CODEC_AVC444 0x00000100 #define FREERDP_CODEC_ALL 0xFFFFFFFF -struct rdp_codecs -{ - rdpContext* context; - - RFX_CONTEXT* rfx; - NSC_CONTEXT* nsc; - H264_CONTEXT* h264; - CLEAR_CONTEXT* clear; - PROGRESSIVE_CONTEXT* progressive; - BITMAP_PLANAR_CONTEXT* planar; - BITMAP_INTERLEAVED_CONTEXT* interleaved; -}; - #ifdef __cplusplus extern "C" { #endif + struct rdp_codecs + { + rdpContext* context; + + RFX_CONTEXT* rfx; + NSC_CONTEXT* nsc; + H264_CONTEXT* h264; + CLEAR_CONTEXT* clear; + PROGRESSIVE_CONTEXT* progressive; + BITMAP_PLANAR_CONTEXT* planar; + BITMAP_INTERLEAVED_CONTEXT* interleaved; + }; + FREERDP_API BOOL freerdp_client_codecs_prepare(rdpCodecs* codecs, UINT32 flags, UINT32 width, UINT32 height); FREERDP_API BOOL freerdp_client_codecs_reset(rdpCodecs* codecs, UINT32 flags, UINT32 width, diff --git a/include/freerdp/crypto/certificate_data.h b/include/freerdp/crypto/certificate_data.h index 9ff7fddd5..3fb3250de 100644 --- a/include/freerdp/crypto/certificate_data.h +++ b/include/freerdp/crypto/certificate_data.h @@ -22,8 +22,6 @@ #ifndef FREERDP_CRYPTO_CERTIFICATE_DATA_H #define FREERDP_CRYPTO_CERTIFICATE_DATA_H -typedef struct rdp_certificate_data rdpCertificateData; - #include #include #include @@ -32,6 +30,9 @@ typedef struct rdp_certificate_data rdpCertificateData; extern "C" { #endif + + typedef struct rdp_certificate_data rdpCertificateData; + FREERDP_API char* freerdp_certificate_data_hash(const char* hostname, UINT16 port); FREERDP_API rdpCertificateData* freerdp_certificate_data_new(const char* hostname, UINT16 port, diff --git a/include/freerdp/crypto/certificate_store.h b/include/freerdp/crypto/certificate_store.h index 3ffd5d2fb..e496519d9 100644 --- a/include/freerdp/crypto/certificate_store.h +++ b/include/freerdp/crypto/certificate_store.h @@ -22,8 +22,6 @@ #ifndef FREERDP_CRYPTO_CERTIFICATE_STORE_H #define FREERDP_CRYPTO_CERTIFICATE_STORE_H -typedef struct rdp_certificate_store rdpCertificateStore; - #include #include #include @@ -33,6 +31,8 @@ extern "C" { #endif + typedef struct rdp_certificate_store rdpCertificateStore; + typedef enum { CERT_STORE_NOT_FOUND = 1, diff --git a/include/freerdp/dvc.h b/include/freerdp/dvc.h index 7f85a73f2..89155470c 100644 --- a/include/freerdp/dvc.h +++ b/include/freerdp/dvc.h @@ -56,110 +56,120 @@ #include #include -typedef struct s_IWTSVirtualChannelManager IWTSVirtualChannelManager; -typedef struct s_IWTSListener IWTSListener; -typedef struct s_IWTSVirtualChannel IWTSVirtualChannel; - -typedef struct s_IWTSPlugin IWTSPlugin; -typedef struct s_IWTSListenerCallback IWTSListenerCallback; -typedef struct s_IWTSVirtualChannelCallback IWTSVirtualChannelCallback; - -struct s_IWTSListener +#ifdef __cplusplus +extern "C" { - /* Retrieves the listener-specific configuration. */ - UINT (*GetConfiguration)(IWTSListener* pListener, void** ppPropertyBag); +#endif - void* pInterface; -}; + typedef struct s_IWTSVirtualChannelManager IWTSVirtualChannelManager; + typedef struct s_IWTSListener IWTSListener; + typedef struct s_IWTSVirtualChannel IWTSVirtualChannel; -struct s_IWTSVirtualChannel -{ - /* Starts a write request on the channel. */ - UINT (*Write)(IWTSVirtualChannel* pChannel, ULONG cbSize, const BYTE* pBuffer, void* pReserved); - /* Closes the channel. */ - UINT (*Close)(IWTSVirtualChannel* pChannel); -}; + typedef struct s_IWTSPlugin IWTSPlugin; + typedef struct s_IWTSListenerCallback IWTSListenerCallback; + typedef struct s_IWTSVirtualChannelCallback IWTSVirtualChannelCallback; -struct s_IWTSVirtualChannelManager -{ - /* Returns an instance of a listener object that listens on a specific - endpoint, or creates a static channel. */ - UINT(*CreateListener) - (IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, ULONG ulFlags, - IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener); - /* Find the channel or ID to send data to a specific endpoint. */ - UINT32 (*GetChannelId)(IWTSVirtualChannel* channel); - IWTSVirtualChannel* (*FindChannelById)(IWTSVirtualChannelManager* pChannelMgr, - UINT32 ChannelId); - const char* (*GetChannelName)(IWTSVirtualChannel* channel); - UINT (*DestroyListener)(IWTSVirtualChannelManager* pChannelMgr, IWTSListener* ppListener); -}; + struct s_IWTSListener + { + /* Retrieves the listener-specific configuration. */ + UINT (*GetConfiguration)(IWTSListener* pListener, void** ppPropertyBag); -struct s_IWTSPlugin -{ - /* Used for the first call that is made from the client to the plug-in. */ - UINT (*Initialize)(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr); - /* Notifies the plug-in that the Remote Desktop Connection (RDC) client - has successfully connected to the Remote Desktop Session Host (RD - Session Host) server. */ - UINT (*Connected)(IWTSPlugin* pPlugin); - /* Notifies the plug-in that the Remote Desktop Connection (RDC) client - has disconnected from the RD Session Host server. */ - UINT (*Disconnected)(IWTSPlugin* pPlugin, DWORD dwDisconnectCode); - /* Notifies the plug-in that the Remote Desktop Connection (RDC) client - has terminated. */ - UINT (*Terminated)(IWTSPlugin* pPlugin); + void* pInterface; + }; - UINT (*Attached)(IWTSPlugin* pPlugin); + struct s_IWTSVirtualChannel + { + /* Starts a write request on the channel. */ + UINT(*Write) + (IWTSVirtualChannel* pChannel, ULONG cbSize, const BYTE* pBuffer, void* pReserved); + /* Closes the channel. */ + UINT (*Close)(IWTSVirtualChannel* pChannel); + }; - UINT (*Detached)(IWTSPlugin* pPlugin); + struct s_IWTSVirtualChannelManager + { + /* Returns an instance of a listener object that listens on a specific + endpoint, or creates a static channel. */ + UINT(*CreateListener) + (IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, ULONG ulFlags, + IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener); + /* Find the channel or ID to send data to a specific endpoint. */ + UINT32 (*GetChannelId)(IWTSVirtualChannel* channel); + IWTSVirtualChannel* (*FindChannelById)(IWTSVirtualChannelManager* pChannelMgr, + UINT32 ChannelId); + const char* (*GetChannelName)(IWTSVirtualChannel* channel); + UINT (*DestroyListener)(IWTSVirtualChannelManager* pChannelMgr, IWTSListener* ppListener); + }; - /* Extended */ + struct s_IWTSPlugin + { + /* Used for the first call that is made from the client to the plug-in. */ + UINT (*Initialize)(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr); + /* Notifies the plug-in that the Remote Desktop Connection (RDC) client + has successfully connected to the Remote Desktop Session Host (RD + Session Host) server. */ + UINT (*Connected)(IWTSPlugin* pPlugin); + /* Notifies the plug-in that the Remote Desktop Connection (RDC) client + has disconnected from the RD Session Host server. */ + UINT (*Disconnected)(IWTSPlugin* pPlugin, DWORD dwDisconnectCode); + /* Notifies the plug-in that the Remote Desktop Connection (RDC) client + has terminated. */ + UINT (*Terminated)(IWTSPlugin* pPlugin); - void* pInterface; -}; + UINT (*Attached)(IWTSPlugin* pPlugin); -struct s_IWTSListenerCallback -{ - /* Accepts or denies a connection request for an incoming connection to - the associated listener. */ - UINT(*OnNewChannelConnection) - (IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, - BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback); -}; + UINT (*Detached)(IWTSPlugin* pPlugin); -struct s_IWTSVirtualChannelCallback -{ - UINT(*OnDataReceived) - (IWTSVirtualChannelCallback* pChannelCallback, - wStream* data); /**< Notifies the user about data that is being received. */ - UINT(*OnOpen) - (IWTSVirtualChannelCallback* - pChannelCallback); /**< Notifies the user that the channel has been opened. */ - UINT(*OnClose) - (IWTSVirtualChannelCallback* - pChannelCallback); /**< Notifies the user that the channel has been closed. */ -}; + /* Extended */ -/* The DVC Plugin entry points */ -typedef struct rdp_context rdpContext; /* forward declaration, necessary to avoid - * circular includes */ + void* pInterface; + }; -typedef struct S_IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS; -struct S_IDRDYNVC_ENTRY_POINTS -{ - UINT(*RegisterPlugin) - (IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin); - IWTSPlugin* (*GetPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name); - const ADDIN_ARGV* (*GetPluginData)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); - rdpSettings* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); - rdpContext* (*GetRdpContext)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); -}; + struct s_IWTSListenerCallback + { + /* Accepts or denies a connection request for an incoming connection to + the associated listener. */ + UINT(*OnNewChannelConnection) + (IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, + BOOL* pbAccept, IWTSVirtualChannelCallback** ppCallback); + }; -typedef UINT (*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS*); + struct s_IWTSVirtualChannelCallback + { + UINT(*OnDataReceived) + (IWTSVirtualChannelCallback* pChannelCallback, + wStream* data); /**< Notifies the user about data that is being received. */ + UINT(*OnOpen) + (IWTSVirtualChannelCallback* + pChannelCallback); /**< Notifies the user that the channel has been opened. */ + UINT(*OnClose) + (IWTSVirtualChannelCallback* + pChannelCallback); /**< Notifies the user that the channel has been closed. */ + }; -void* get_callback_by_name(const char* name, void** context); -void add_callback_by_name(const char* name, void* fkt, void* context); -void remove_callback_by_name(const char* name, void* context); + /* The DVC Plugin entry points */ + typedef struct rdp_context rdpContext; /* forward declaration, necessary to avoid + * circular includes */ + + typedef struct S_IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS; + struct S_IDRDYNVC_ENTRY_POINTS + { + UINT(*RegisterPlugin) + (IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin); + IWTSPlugin* (*GetPlugin)(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name); + const ADDIN_ARGV* (*GetPluginData)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); + rdpSettings* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); + rdpContext* (*GetRdpContext)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); + }; + + typedef UINT (*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS*); + + void* get_callback_by_name(const char* name, void** context); + void add_callback_by_name(const char* name, void* fkt, void* context); + void remove_callback_by_name(const char* name, void* context); + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_DVC_H */ diff --git a/include/freerdp/emulate/scard/smartcard_emulate.h b/include/freerdp/emulate/scard/smartcard_emulate.h index be1b7b385..f2e395a1f 100644 --- a/include/freerdp/emulate/scard/smartcard_emulate.h +++ b/include/freerdp/emulate/scard/smartcard_emulate.h @@ -27,326 +27,335 @@ #include #include -typedef struct smartcard_emulation_context SmartcardEmulationContext; +#ifdef __cplusplus +extern "C" +{ +#endif -FREERDP_API SmartcardEmulationContext* Emulate_New(const rdpSettings* settings); -FREERDP_API void Emulate_Free(SmartcardEmulationContext* context); + typedef struct smartcard_emulation_context SmartcardEmulationContext; -FREERDP_API BOOL Emulate_IsConfigured(SmartcardEmulationContext* context); + FREERDP_API SmartcardEmulationContext* Emulate_New(const rdpSettings* settings); + FREERDP_API void Emulate_Free(SmartcardEmulationContext* context); -FREERDP_API LONG WINAPI Emulate_SCardEstablishContext(SmartcardEmulationContext* smartcard, - DWORD dwScope, LPCVOID pvReserved1, - LPCVOID pvReserved2, - LPSCARDCONTEXT phContext); + FREERDP_API BOOL Emulate_IsConfigured(SmartcardEmulationContext* context); -FREERDP_API LONG WINAPI Emulate_SCardReleaseContext(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext); + FREERDP_API LONG WINAPI Emulate_SCardEstablishContext(SmartcardEmulationContext* smartcard, + DWORD dwScope, LPCVOID pvReserved1, + LPCVOID pvReserved2, + LPSCARDCONTEXT phContext); -FREERDP_API LONG WINAPI Emulate_SCardIsValidContext(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext); + FREERDP_API LONG WINAPI Emulate_SCardReleaseContext(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext); + + FREERDP_API LONG WINAPI Emulate_SCardIsValidContext(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext); -FREERDP_API LONG WINAPI Emulate_SCardListReaderGroupsA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPSTR mszGroups, - LPDWORD pcchGroups); + FREERDP_API LONG WINAPI Emulate_SCardListReaderGroupsA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPSTR mszGroups, + LPDWORD pcchGroups); -FREERDP_API LONG WINAPI Emulate_SCardListReaderGroupsW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPWSTR mszGroups, - LPDWORD pcchGroups); - -FREERDP_API LONG WINAPI Emulate_SCardListReadersA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR mszGroups, - LPSTR mszReaders, LPDWORD pcchReaders); - -FREERDP_API LONG WINAPI Emulate_SCardListReadersW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR mszGroups, - LPWSTR mszReaders, LPDWORD pcchReaders); - -FREERDP_API LONG WINAPI Emulate_SCardListCardsA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCBYTE pbAtr, - LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, - CHAR* mszCards, LPDWORD pcchCards); - -FREERDP_API LONG WINAPI Emulate_SCardListCardsW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCBYTE pbAtr, - LPCGUID rgquidInterfaces, DWORD cguidInterfaceCount, - WCHAR* mszCards, LPDWORD pcchCards); - -FREERDP_API LONG WINAPI Emulate_SCardListInterfacesA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szCard, - LPGUID pguidInterfaces, - LPDWORD pcguidInterfaces); - -FREERDP_API LONG WINAPI Emulate_SCardListInterfacesW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szCard, - LPGUID pguidInterfaces, - LPDWORD pcguidInterfaces); - -FREERDP_API LONG WINAPI Emulate_SCardGetProviderIdA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szCard, - LPGUID pguidProviderId); + FREERDP_API LONG WINAPI Emulate_SCardListReaderGroupsW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPWSTR mszGroups, + LPDWORD pcchGroups); -FREERDP_API LONG WINAPI Emulate_SCardGetProviderIdW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szCard, - LPGUID pguidProviderId); - -FREERDP_API LONG WINAPI Emulate_SCardGetCardTypeProviderNameA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, - CHAR* szProvider, - LPDWORD pcchProvider); - -FREERDP_API LONG WINAPI Emulate_SCardGetCardTypeProviderNameW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCWSTR szCardName, - DWORD dwProviderId, WCHAR* szProvider, - LPDWORD pcchProvider); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderGroupA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderGroupW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCWSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardForgetReaderGroupA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardForgetReaderGroupW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReaderName, - LPCSTR szDeviceName); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPCWSTR szDeviceName); - -FREERDP_API LONG WINAPI Emulate_SCardForgetReaderA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReaderName); - -FREERDP_API LONG WINAPI Emulate_SCardForgetReaderW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReaderName); - -FREERDP_API LONG WINAPI Emulate_SCardAddReaderToGroupA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReaderName, - LPCSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardAddReaderToGroupW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPCWSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardRemoveReaderFromGroupA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCSTR szReaderName, - LPCSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardRemoveReaderFromGroupW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCWSTR szReaderName, - LPCWSTR szGroupName); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceCardTypeA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szCardName, - LPCGUID pguidPrimaryProvider, - LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, - LPCBYTE pbAtrMask, DWORD cbAtrLen); - -FREERDP_API LONG WINAPI Emulate_SCardIntroduceCardTypeW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szCardName, - LPCGUID pguidPrimaryProvider, - LPCGUID rgguidInterfaces, - DWORD dwInterfaceCount, LPCBYTE pbAtr, - LPCBYTE pbAtrMask, DWORD cbAtrLen); - -FREERDP_API LONG WINAPI Emulate_SCardSetCardTypeProviderNameA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCSTR szCardName, DWORD dwProviderId, - LPCSTR szProvider); - -FREERDP_API LONG WINAPI Emulate_SCardSetCardTypeProviderNameW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPCWSTR szCardName, - DWORD dwProviderId, - LPCWSTR szProvider); - -FREERDP_API LONG WINAPI Emulate_SCardForgetCardTypeA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szCardName); - -FREERDP_API LONG WINAPI Emulate_SCardForgetCardTypeW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szCardName); - -FREERDP_API LONG WINAPI Emulate_SCardFreeMemory(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPVOID pvMem); - -FREERDP_API HANDLE WINAPI Emulate_SCardAccessStartedEvent(SmartcardEmulationContext* smartcard); - -FREERDP_API void WINAPI Emulate_SCardReleaseStartedEvent(SmartcardEmulationContext* smartcard); - -FREERDP_API LONG WINAPI Emulate_SCardLocateCardsA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR mszCards, - LPSCARD_READERSTATEA rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardLocateCardsW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR mszCards, - LPSCARD_READERSTATEW rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardLocateCardsByATRA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, - LPSCARD_READERSTATEA rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardLocateCardsByATRW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, - LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, - LPSCARD_READERSTATEW rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardGetStatusChangeA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, DWORD dwTimeout, - LPSCARD_READERSTATEA rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardGetStatusChangeW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, DWORD dwTimeout, - LPSCARD_READERSTATEW rgReaderStates, - DWORD cReaders); - -FREERDP_API LONG WINAPI Emulate_SCardCancel(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext); - -FREERDP_API LONG WINAPI Emulate_SCardConnectA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReader, - DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); - -FREERDP_API LONG WINAPI Emulate_SCardConnectW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReader, - DWORD dwShareMode, DWORD dwPreferredProtocols, - LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); - -FREERDP_API LONG WINAPI Emulate_SCardReconnect(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwShareMode, - DWORD dwPreferredProtocols, DWORD dwInitialization, - LPDWORD pdwActiveProtocol); - -FREERDP_API LONG WINAPI Emulate_SCardDisconnect(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwDisposition); - -FREERDP_API LONG WINAPI Emulate_SCardBeginTransaction(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard); - -FREERDP_API LONG WINAPI Emulate_SCardEndTransaction(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwDisposition); - -FREERDP_API LONG WINAPI Emulate_SCardCancelTransaction(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard); - -FREERDP_API LONG WINAPI Emulate_SCardState(SmartcardEmulationContext* smartcard, SCARDHANDLE hCard, - LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, - LPDWORD pcbAtrLen); - -FREERDP_API LONG WINAPI Emulate_SCardStatusA(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, LPSTR mszReaderNames, - LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); - -FREERDP_API LONG WINAPI Emulate_SCardStatusW(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, LPWSTR mszReaderNames, - LPDWORD pcchReaderLen, LPDWORD pdwState, - LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen); - -FREERDP_API LONG WINAPI Emulate_SCardTransmit(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, - LPCBYTE pbSendBuffer, DWORD cbSendLength, - LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer, - LPDWORD pcbRecvLength); - -FREERDP_API LONG WINAPI Emulate_SCardGetTransmitCount(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, LPDWORD pcTransmitCount); - -FREERDP_API LONG WINAPI Emulate_SCardControl(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwControlCode, - LPCVOID lpInBuffer, DWORD cbInBufferSize, - LPVOID lpOutBuffer, DWORD cbOutBufferSize, - LPDWORD lpBytesReturned); - -FREERDP_API LONG WINAPI Emulate_SCardGetAttrib(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, - LPDWORD pcbAttrLen); - -FREERDP_API LONG WINAPI Emulate_SCardSetAttrib(SmartcardEmulationContext* smartcard, - SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, - DWORD cbAttrLen); - -FREERDP_API LONG WINAPI Emulate_SCardUIDlgSelectCardA(SmartcardEmulationContext* smartcard, - LPOPENCARDNAMEA_EX pDlgStruc); - -FREERDP_API LONG WINAPI Emulate_SCardUIDlgSelectCardW(SmartcardEmulationContext* smartcard, - LPOPENCARDNAMEW_EX pDlgStruc); - -FREERDP_API LONG WINAPI Emulate_GetOpenCardNameA(SmartcardEmulationContext* smartcard, - LPOPENCARDNAMEA pDlgStruc); - -FREERDP_API LONG WINAPI Emulate_GetOpenCardNameW(SmartcardEmulationContext* smartcard, - LPOPENCARDNAMEW pDlgStruc); - -FREERDP_API LONG WINAPI Emulate_SCardDlgExtendedError(SmartcardEmulationContext* smartcard); - -FREERDP_API LONG WINAPI Emulate_SCardReadCacheA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, UUID* CardIdentifier, - DWORD FreshnessCounter, LPSTR LookupName, - PBYTE Data, DWORD* DataLen); - -FREERDP_API LONG WINAPI Emulate_SCardReadCacheW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, UUID* CardIdentifier, - DWORD FreshnessCounter, LPWSTR LookupName, - PBYTE Data, DWORD* DataLen); - -FREERDP_API LONG WINAPI Emulate_SCardWriteCacheA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, UUID* CardIdentifier, - DWORD FreshnessCounter, LPSTR LookupName, - PBYTE Data, DWORD DataLen); - -FREERDP_API LONG WINAPI Emulate_SCardWriteCacheW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, UUID* CardIdentifier, - DWORD FreshnessCounter, LPWSTR LookupName, - PBYTE Data, DWORD DataLen); - -FREERDP_API LONG WINAPI Emulate_SCardGetReaderIconA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReaderName, - LPBYTE pbIcon, LPDWORD pcbIcon); - -FREERDP_API LONG WINAPI Emulate_SCardGetReaderIconW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPBYTE pbIcon, LPDWORD pcbIcon); - -FREERDP_API LONG WINAPI Emulate_SCardGetDeviceTypeIdA(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCSTR szReaderName, - LPDWORD pdwDeviceTypeId); -FREERDP_API LONG WINAPI Emulate_SCardGetDeviceTypeIdW(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPDWORD pdwDeviceTypeId); - -FREERDP_API LONG WINAPI Emulate_SCardGetReaderDeviceInstanceIdA( - SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szReaderName, - LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); - -FREERDP_API LONG WINAPI Emulate_SCardGetReaderDeviceInstanceIdW( - SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szReaderName, - LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); -FREERDP_API LONG WINAPI Emulate_SCardListReadersWithDeviceInstanceIdA( - SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szDeviceInstanceId, - LPSTR mszReaders, LPDWORD pcchReaders); -FREERDP_API LONG WINAPI Emulate_SCardListReadersWithDeviceInstanceIdW( - SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szDeviceInstanceId, - LPWSTR mszReaders, LPDWORD pcchReaders); -FREERDP_API LONG WINAPI Emulate_SCardAudit(SmartcardEmulationContext* smartcard, - SCARDCONTEXT hContext, DWORD dwEvent); + FREERDP_API LONG WINAPI Emulate_SCardListReadersA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR mszGroups, + LPSTR mszReaders, LPDWORD pcchReaders); + + FREERDP_API LONG WINAPI Emulate_SCardListReadersW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR mszGroups, + LPWSTR mszReaders, LPDWORD pcchReaders); + + FREERDP_API LONG WINAPI Emulate_SCardListCardsA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, + DWORD cguidInterfaceCount, CHAR* mszCards, + LPDWORD pcchCards); + + FREERDP_API LONG WINAPI Emulate_SCardListCardsW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCBYTE pbAtr, + LPCGUID rgquidInterfaces, + DWORD cguidInterfaceCount, WCHAR* mszCards, + LPDWORD pcchCards); + + FREERDP_API LONG WINAPI Emulate_SCardListInterfacesA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidInterfaces, + LPDWORD pcguidInterfaces); + + FREERDP_API LONG WINAPI Emulate_SCardListInterfacesW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidInterfaces, + LPDWORD pcguidInterfaces); + + FREERDP_API LONG WINAPI Emulate_SCardGetProviderIdA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szCard, + LPGUID pguidProviderId); + + FREERDP_API LONG WINAPI Emulate_SCardGetProviderIdW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szCard, + LPGUID pguidProviderId); + + FREERDP_API LONG WINAPI Emulate_SCardGetCardTypeProviderNameA( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, CHAR* szProvider, LPDWORD pcchProvider); + + FREERDP_API LONG WINAPI Emulate_SCardGetCardTypeProviderNameW( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, WCHAR* szProvider, LPDWORD pcchProvider); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderGroupA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderGroupW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCWSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardForgetReaderGroupA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardForgetReaderGroupW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCWSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCSTR szReaderName, LPCSTR szDeviceName); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceReaderW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCWSTR szReaderName, + LPCWSTR szDeviceName); + + FREERDP_API LONG WINAPI Emulate_SCardForgetReaderA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szReaderName); + + FREERDP_API LONG WINAPI Emulate_SCardForgetReaderW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szReaderName); + + FREERDP_API LONG WINAPI Emulate_SCardAddReaderToGroupA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCSTR szReaderName, LPCSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardAddReaderToGroupW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCWSTR szReaderName, + LPCWSTR szGroupName); + + FREERDP_API LONG WINAPI + Emulate_SCardRemoveReaderFromGroupA(SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, + LPCSTR szReaderName, LPCSTR szGroupName); + + FREERDP_API LONG WINAPI + Emulate_SCardRemoveReaderFromGroupW(SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, + LPCWSTR szReaderName, LPCWSTR szGroupName); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceCardTypeA( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szCardName, + LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); + + FREERDP_API LONG WINAPI Emulate_SCardIntroduceCardTypeW( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szCardName, + LPCGUID pguidPrimaryProvider, LPCGUID rgguidInterfaces, DWORD dwInterfaceCount, + LPCBYTE pbAtr, LPCBYTE pbAtrMask, DWORD cbAtrLen); + + FREERDP_API LONG WINAPI Emulate_SCardSetCardTypeProviderNameA( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szCardName, + DWORD dwProviderId, LPCSTR szProvider); + + FREERDP_API LONG WINAPI Emulate_SCardSetCardTypeProviderNameW( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szCardName, + DWORD dwProviderId, LPCWSTR szProvider); + + FREERDP_API LONG WINAPI Emulate_SCardForgetCardTypeA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szCardName); + + FREERDP_API LONG WINAPI Emulate_SCardForgetCardTypeW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szCardName); + + FREERDP_API LONG WINAPI Emulate_SCardFreeMemory(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPVOID pvMem); + + FREERDP_API HANDLE WINAPI Emulate_SCardAccessStartedEvent(SmartcardEmulationContext* smartcard); + + FREERDP_API void WINAPI Emulate_SCardReleaseStartedEvent(SmartcardEmulationContext* smartcard); + + FREERDP_API LONG WINAPI Emulate_SCardLocateCardsA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR mszCards, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardLocateCardsW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR mszCards, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardLocateCardsByATRA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardLocateCardsByATRW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPSCARD_ATRMASK rgAtrMasks, DWORD cAtrs, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardGetStatusChangeA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEA rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardGetStatusChangeW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, DWORD dwTimeout, + LPSCARD_READERSTATEW rgReaderStates, + DWORD cReaders); + + FREERDP_API LONG WINAPI Emulate_SCardCancel(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext); + + FREERDP_API LONG WINAPI Emulate_SCardConnectA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); + + FREERDP_API LONG WINAPI Emulate_SCardConnectW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szReader, + DWORD dwShareMode, DWORD dwPreferredProtocols, + LPSCARDHANDLE phCard, LPDWORD pdwActiveProtocol); + + FREERDP_API LONG WINAPI Emulate_SCardReconnect(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwShareMode, + DWORD dwPreferredProtocols, + DWORD dwInitialization, + LPDWORD pdwActiveProtocol); + + FREERDP_API LONG WINAPI Emulate_SCardDisconnect(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwDisposition); + + FREERDP_API LONG WINAPI Emulate_SCardBeginTransaction(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard); + + FREERDP_API LONG WINAPI Emulate_SCardEndTransaction(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwDisposition); + + FREERDP_API LONG WINAPI Emulate_SCardCancelTransaction(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard); + + FREERDP_API LONG WINAPI Emulate_SCardState(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen); + + FREERDP_API LONG WINAPI Emulate_SCardStatusA(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, LPSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen); + + FREERDP_API LONG WINAPI Emulate_SCardStatusW(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, LPWSTR mszReaderNames, + LPDWORD pcchReaderLen, LPDWORD pdwState, + LPDWORD pdwProtocol, LPBYTE pbAtr, + LPDWORD pcbAtrLen); + + FREERDP_API LONG WINAPI Emulate_SCardTransmit(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci, + LPCBYTE pbSendBuffer, DWORD cbSendLength, + LPSCARD_IO_REQUEST pioRecvPci, + LPBYTE pbRecvBuffer, LPDWORD pcbRecvLength); + + FREERDP_API LONG WINAPI Emulate_SCardGetTransmitCount(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, + LPDWORD pcTransmitCount); + + FREERDP_API LONG WINAPI Emulate_SCardControl(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwControlCode, + LPCVOID lpInBuffer, DWORD cbInBufferSize, + LPVOID lpOutBuffer, DWORD cbOutBufferSize, + LPDWORD lpBytesReturned); + + FREERDP_API LONG WINAPI Emulate_SCardGetAttrib(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwAttrId, LPBYTE pbAttr, + LPDWORD pcbAttrLen); + + FREERDP_API LONG WINAPI Emulate_SCardSetAttrib(SmartcardEmulationContext* smartcard, + SCARDHANDLE hCard, DWORD dwAttrId, + LPCBYTE pbAttr, DWORD cbAttrLen); + + FREERDP_API LONG WINAPI Emulate_SCardUIDlgSelectCardA(SmartcardEmulationContext* smartcard, + LPOPENCARDNAMEA_EX pDlgStruc); + + FREERDP_API LONG WINAPI Emulate_SCardUIDlgSelectCardW(SmartcardEmulationContext* smartcard, + LPOPENCARDNAMEW_EX pDlgStruc); + + FREERDP_API LONG WINAPI Emulate_GetOpenCardNameA(SmartcardEmulationContext* smartcard, + LPOPENCARDNAMEA pDlgStruc); + + FREERDP_API LONG WINAPI Emulate_GetOpenCardNameW(SmartcardEmulationContext* smartcard, + LPOPENCARDNAMEW pDlgStruc); + + FREERDP_API LONG WINAPI Emulate_SCardDlgExtendedError(SmartcardEmulationContext* smartcard); + + FREERDP_API LONG WINAPI Emulate_SCardReadCacheA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, + PBYTE Data, DWORD* DataLen); + + FREERDP_API LONG WINAPI Emulate_SCardReadCacheW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, + PBYTE Data, DWORD* DataLen); + + FREERDP_API LONG WINAPI Emulate_SCardWriteCacheA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPSTR LookupName, + PBYTE Data, DWORD DataLen); + + FREERDP_API LONG WINAPI Emulate_SCardWriteCacheW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, UUID* CardIdentifier, + DWORD FreshnessCounter, LPWSTR LookupName, + PBYTE Data, DWORD DataLen); + + FREERDP_API LONG WINAPI Emulate_SCardGetReaderIconA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); + + FREERDP_API LONG WINAPI Emulate_SCardGetReaderIconW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPBYTE pbIcon, LPDWORD pcbIcon); + + FREERDP_API LONG WINAPI Emulate_SCardGetDeviceTypeIdA(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCSTR szReaderName, + LPDWORD pdwDeviceTypeId); + FREERDP_API LONG WINAPI Emulate_SCardGetDeviceTypeIdW(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, + LPCWSTR szReaderName, + LPDWORD pdwDeviceTypeId); + + FREERDP_API LONG WINAPI Emulate_SCardGetReaderDeviceInstanceIdA( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szReaderName, + LPSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); + + FREERDP_API LONG WINAPI Emulate_SCardGetReaderDeviceInstanceIdW( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szReaderName, + LPWSTR szDeviceInstanceId, LPDWORD pcchDeviceInstanceId); + FREERDP_API LONG WINAPI Emulate_SCardListReadersWithDeviceInstanceIdA( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCSTR szDeviceInstanceId, + LPSTR mszReaders, LPDWORD pcchReaders); + FREERDP_API LONG WINAPI Emulate_SCardListReadersWithDeviceInstanceIdW( + SmartcardEmulationContext* smartcard, SCARDCONTEXT hContext, LPCWSTR szDeviceInstanceId, + LPWSTR mszReaders, LPDWORD pcchReaders); + FREERDP_API LONG WINAPI Emulate_SCardAudit(SmartcardEmulationContext* smartcard, + SCARDCONTEXT hContext, DWORD dwEvent); + +#ifdef __cplusplus +} +#endif #endif /* WINPR_SMARTCARD_EMULATE_PRIVATE_H */ diff --git a/include/freerdp/extension.h b/include/freerdp/extension.h index 57eae102b..c7d751ac7 100644 --- a/include/freerdp/extension.h +++ b/include/freerdp/extension.h @@ -26,33 +26,42 @@ #define FREERDP_EXT_EXPORT_FUNC_NAME "FreeRDPExtensionEntry" -typedef struct rdp_ext_plugin rdpExtPlugin; - -struct rdp_ext_plugin +#ifdef __cplusplus +extern "C" { - void* ext; - int (*init)(rdpExtPlugin* plugin, freerdp* instance); - int (*uninit)(rdpExtPlugin* plugin, freerdp* instance); -}; +#endif -typedef UINT32(FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance); + typedef struct rdp_ext_plugin rdpExtPlugin; -typedef UINT32(FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin); -typedef UINT32(FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, - PFREERDP_EXTENSION_HOOK hook); -typedef UINT32(FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, - PFREERDP_EXTENSION_HOOK hook); + struct rdp_ext_plugin + { + void* ext; + int (*init)(rdpExtPlugin* plugin, freerdp* instance); + int (*uninit)(rdpExtPlugin* plugin, freerdp* instance); + }; -typedef struct -{ - void* ext; /* Reference to internal instance */ - PREGISTEREXTENSION pRegisterExtension; - PREGISTERPRECONNECTHOOK pRegisterPreConnectHook; - PREGISTERPOSTCONNECTHOOK pRegisterPostConnectHook; - void* data; -} FREERDP_EXTENSION_ENTRY_POINTS; -typedef FREERDP_EXTENSION_ENTRY_POINTS* PFREERDP_EXTENSION_ENTRY_POINTS; + typedef UINT32(FREERDP_CC* PFREERDP_EXTENSION_HOOK)(rdpExtPlugin* plugin, freerdp* instance); -typedef int(FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); + typedef UINT32(FREERDP_CC* PREGISTEREXTENSION)(rdpExtPlugin* plugin); + typedef UINT32(FREERDP_CC* PREGISTERPRECONNECTHOOK)(rdpExtPlugin* plugin, + PFREERDP_EXTENSION_HOOK hook); + typedef UINT32(FREERDP_CC* PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin* plugin, + PFREERDP_EXTENSION_HOOK hook); + + typedef struct + { + void* ext; /* Reference to internal instance */ + PREGISTEREXTENSION pRegisterExtension; + PREGISTERPRECONNECTHOOK pRegisterPreConnectHook; + PREGISTERPOSTCONNECTHOOK pRegisterPostConnectHook; + void* data; + } FREERDP_EXTENSION_ENTRY_POINTS; + typedef FREERDP_EXTENSION_ENTRY_POINTS* PFREERDP_EXTENSION_ENTRY_POINTS; + + typedef int(FREERDP_CC* PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_EXTENSION_H */ diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index 76af33f56..8868654e3 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -22,24 +22,6 @@ #ifndef FREERDP_H #define FREERDP_H -typedef struct rdp_rdp rdpRdp; -typedef struct rdp_gdi rdpGdi; -typedef struct rdp_rail rdpRail; -typedef struct rdp_cache rdpCache; -typedef struct rdp_channels rdpChannels; -typedef struct rdp_graphics rdpGraphics; -typedef struct rdp_metrics rdpMetrics; -typedef struct rdp_codecs rdpCodecs; -typedef struct rdp_transport rdpTransport; /* Opaque */ - -typedef struct rdp_freerdp freerdp; -typedef struct rdp_context rdpContext; -typedef struct rdp_freerdp_peer freerdp_peer; - -typedef struct rdp_client_context rdpClientContext; -typedef struct rdp_client_entry_points_v1 RDP_CLIENT_ENTRY_POINTS_V1; -typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS; - #include #include #include @@ -57,14 +39,32 @@ typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS; #include #include -typedef struct stream_dump_context rdpStreamDumpContext; -typedef struct SmartcardCertInfo_st SmartcardCertInfo; - #ifdef __cplusplus extern "C" { #endif + typedef struct stream_dump_context rdpStreamDumpContext; + typedef struct SmartcardCertInfo_st SmartcardCertInfo; + + typedef struct rdp_rdp rdpRdp; + typedef struct rdp_gdi rdpGdi; + typedef struct rdp_rail rdpRail; + typedef struct rdp_cache rdpCache; + typedef struct rdp_channels rdpChannels; + typedef struct rdp_graphics rdpGraphics; + typedef struct rdp_metrics rdpMetrics; + typedef struct rdp_codecs rdpCodecs; + typedef struct rdp_transport rdpTransport; /* Opaque */ + + typedef struct rdp_freerdp freerdp; + typedef struct rdp_context rdpContext; + typedef struct rdp_freerdp_peer freerdp_peer; + + typedef struct rdp_client_context rdpClientContext; + typedef struct rdp_client_entry_points_v1 RDP_CLIENT_ENTRY_POINTS_V1; + typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS; + #define MCS_BASE_CHANNEL_ID 1001 #define MCS_GLOBAL_CHANNEL_ID 1003 diff --git a/include/freerdp/gdi/gdi.h b/include/freerdp/gdi/gdi.h index a421de3e7..082629bd0 100644 --- a/include/freerdp/gdi/gdi.h +++ b/include/freerdp/gdi/gdi.h @@ -355,172 +355,172 @@ #define COMPLEXREGION 0x03 #endif -typedef struct -{ - BYTE objectType; -} GDIOBJECT; -typedef GDIOBJECT* HGDIOBJECT; - -typedef struct -{ - BYTE objectType; - INT32 left; - INT32 top; - INT32 right; - INT32 bottom; -} GDI_RECT; -typedef GDI_RECT* HGDI_RECT; - -typedef struct -{ - BYTE objectType; - INT32 x; /* left */ - INT32 y; /* top */ - INT32 w; /* width */ - INT32 h; /* height */ - BOOL null; /* null region */ -} GDI_RGN; -typedef GDI_RGN* HGDI_RGN; - -typedef struct -{ - BYTE objectType; - UINT32 format; - INT32 width; - INT32 height; - UINT32 scanline; - BYTE* data; - void (*free)(void*); -} GDI_BITMAP; -typedef GDI_BITMAP* HGDI_BITMAP; - -typedef struct -{ - BYTE objectType; - UINT32 style; - INT32 width; - INT32 posX; - INT32 posY; - UINT32 color; - UINT32 format; - const gdiPalette* palette; -} GDI_PEN; -typedef GDI_PEN* HGDI_PEN; - -typedef struct -{ - BYTE red; - BYTE green; - BYTE blue; -} GDI_PALETTEENTRY; - -typedef struct -{ - UINT16 count; - GDI_PALETTEENTRY* entries; -} GDI_PALETTE; -typedef GDI_PALETTE* HGDI_PALETTE; - -typedef struct -{ - INT32 x; - INT32 y; -} GDI_POINT; -typedef GDI_POINT* HGDI_POINT; - -typedef struct -{ - BYTE objectType; - int style; - HGDI_BITMAP pattern; - UINT32 color; - INT32 nXOrg; - INT32 nYOrg; -} GDI_BRUSH; -typedef GDI_BRUSH* HGDI_BRUSH; - -typedef struct -{ - UINT32 count; - INT32 ninvalid; - HGDI_RGN invalid; - HGDI_RGN cinvalid; -} GDI_WND; -typedef GDI_WND* HGDI_WND; - -typedef struct -{ - HGDIOBJECT selectedObject; - UINT32 format; - UINT32 bkColor; - UINT32 textColor; - HGDI_BRUSH brush; - HGDI_RGN clip; - HGDI_PEN pen; - HGDI_WND hwnd; - INT32 drawMode; - INT32 bkMode; -} GDI_DC; -typedef GDI_DC* HGDI_DC; - -struct gdi_bitmap -{ - rdpBitmap _p; - - HGDI_DC hdc; - HGDI_BITMAP bitmap; - HGDI_BITMAP org_bitmap; -}; -typedef struct gdi_bitmap gdiBitmap; - -struct gdi_glyph -{ - rdpBitmap _p; - - HGDI_DC hdc; - HGDI_BITMAP bitmap; - HGDI_BITMAP org_bitmap; -}; -typedef struct gdi_glyph gdiGlyph; - -struct rdp_gdi -{ - rdpContext* context; - - INT32 width; - INT32 height; - UINT32 stride; - UINT32 dstFormat; - UINT32 cursor_x; - UINT32 cursor_y; - - HGDI_DC hdc; - gdiBitmap* primary; - gdiBitmap* drawing; - UINT32 bitmap_size; - UINT32 bitmap_stride; - BYTE* primary_buffer; - gdiPalette palette; - gdiBitmap* image; - void (*free)(void*); - - BOOL inGfxFrame; - BOOL graphicsReset; /* deprecated, remove with FreeRDP v3 */ - BOOL suppressOutput; - UINT16 outputSurfaceId; - UINT32 frameId; - RdpgfxClientContext* gfx; - VideoClientContext* video; - GeometryClientContext* geometry; - - wLog* log; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct + { + BYTE objectType; + } GDIOBJECT; + typedef GDIOBJECT* HGDIOBJECT; + + typedef struct + { + BYTE objectType; + INT32 left; + INT32 top; + INT32 right; + INT32 bottom; + } GDI_RECT; + typedef GDI_RECT* HGDI_RECT; + + typedef struct + { + BYTE objectType; + INT32 x; /* left */ + INT32 y; /* top */ + INT32 w; /* width */ + INT32 h; /* height */ + BOOL null; /* null region */ + } GDI_RGN; + typedef GDI_RGN* HGDI_RGN; + + typedef struct + { + BYTE objectType; + UINT32 format; + INT32 width; + INT32 height; + UINT32 scanline; + BYTE* data; + void (*free)(void*); + } GDI_BITMAP; + typedef GDI_BITMAP* HGDI_BITMAP; + + typedef struct + { + BYTE objectType; + UINT32 style; + INT32 width; + INT32 posX; + INT32 posY; + UINT32 color; + UINT32 format; + const gdiPalette* palette; + } GDI_PEN; + typedef GDI_PEN* HGDI_PEN; + + typedef struct + { + BYTE red; + BYTE green; + BYTE blue; + } GDI_PALETTEENTRY; + + typedef struct + { + UINT16 count; + GDI_PALETTEENTRY* entries; + } GDI_PALETTE; + typedef GDI_PALETTE* HGDI_PALETTE; + + typedef struct + { + INT32 x; + INT32 y; + } GDI_POINT; + typedef GDI_POINT* HGDI_POINT; + + typedef struct + { + BYTE objectType; + int style; + HGDI_BITMAP pattern; + UINT32 color; + INT32 nXOrg; + INT32 nYOrg; + } GDI_BRUSH; + typedef GDI_BRUSH* HGDI_BRUSH; + + typedef struct + { + UINT32 count; + INT32 ninvalid; + HGDI_RGN invalid; + HGDI_RGN cinvalid; + } GDI_WND; + typedef GDI_WND* HGDI_WND; + + typedef struct + { + HGDIOBJECT selectedObject; + UINT32 format; + UINT32 bkColor; + UINT32 textColor; + HGDI_BRUSH brush; + HGDI_RGN clip; + HGDI_PEN pen; + HGDI_WND hwnd; + INT32 drawMode; + INT32 bkMode; + } GDI_DC; + typedef GDI_DC* HGDI_DC; + + struct gdi_bitmap + { + rdpBitmap _p; + + HGDI_DC hdc; + HGDI_BITMAP bitmap; + HGDI_BITMAP org_bitmap; + }; + typedef struct gdi_bitmap gdiBitmap; + + struct gdi_glyph + { + rdpBitmap _p; + + HGDI_DC hdc; + HGDI_BITMAP bitmap; + HGDI_BITMAP org_bitmap; + }; + typedef struct gdi_glyph gdiGlyph; + + struct rdp_gdi + { + rdpContext* context; + + INT32 width; + INT32 height; + UINT32 stride; + UINT32 dstFormat; + UINT32 cursor_x; + UINT32 cursor_y; + + HGDI_DC hdc; + gdiBitmap* primary; + gdiBitmap* drawing; + UINT32 bitmap_size; + UINT32 bitmap_stride; + BYTE* primary_buffer; + gdiPalette palette; + gdiBitmap* image; + void (*free)(void*); + + BOOL inGfxFrame; + BOOL graphicsReset; /* deprecated, remove with FreeRDP v3 */ + BOOL suppressOutput; + UINT16 outputSurfaceId; + UINT32 frameId; + RdpgfxClientContext* gfx; + VideoClientContext* video; + GeometryClientContext* geometry; + + wLog* log; + }; + FREERDP_API DWORD gdi_rop3_code(BYTE code); FREERDP_API const char* gdi_rop3_code_string(BYTE code); FREERDP_API const char* gdi_rop3_string(DWORD rop); diff --git a/include/freerdp/gdi/gfx.h b/include/freerdp/gdi/gfx.h index f99c40c2b..4e731b381 100644 --- a/include/freerdp/gdi/gfx.h +++ b/include/freerdp/gdi/gfx.h @@ -23,46 +23,46 @@ #include #include -struct gdi_gfx_surface -{ - UINT16 surfaceId; - rdpCodecs* codecs; - H264_CONTEXT* h264; - UINT32 width; - UINT32 height; - UINT32 mappedWidth; - UINT32 mappedHeight; - BYTE* data; - UINT32 scanline; - UINT32 format; - BOOL outputMapped; - UINT32 outputOriginX; - UINT32 outputOriginY; - REGION16 invalidRegion; - UINT64 windowId; - UINT32 outputTargetWidth; - UINT32 outputTargetHeight; - BOOL windowMapped; - BOOL handleInUpdateSurfaceArea; -}; -typedef struct gdi_gfx_surface gdiGfxSurface; - -struct gdi_gfx_cache_entry -{ - UINT64 cacheKey; - UINT32 width; - UINT32 height; - BYTE* data; - UINT32 scanline; - UINT32 format; -}; -typedef struct gdi_gfx_cache_entry gdiGfxCacheEntry; - #ifdef __cplusplus extern "C" { #endif + struct gdi_gfx_surface + { + UINT16 surfaceId; + rdpCodecs* codecs; + H264_CONTEXT* h264; + UINT32 width; + UINT32 height; + UINT32 mappedWidth; + UINT32 mappedHeight; + BYTE* data; + UINT32 scanline; + UINT32 format; + BOOL outputMapped; + UINT32 outputOriginX; + UINT32 outputOriginY; + REGION16 invalidRegion; + UINT64 windowId; + UINT32 outputTargetWidth; + UINT32 outputTargetHeight; + BOOL windowMapped; + BOOL handleInUpdateSurfaceArea; + }; + typedef struct gdi_gfx_surface gdiGfxSurface; + + struct gdi_gfx_cache_entry + { + UINT64 cacheKey; + UINT32 width; + UINT32 height; + BYTE* data; + UINT32 scanline; + UINT32 format; + }; + typedef struct gdi_gfx_cache_entry gdiGfxCacheEntry; + FREERDP_API BOOL gdi_graphics_pipeline_init(rdpGdi* gdi, RdpgfxClientContext* gfx); FREERDP_API BOOL gdi_graphics_pipeline_init_ex(rdpGdi* gdi, RdpgfxClientContext* gfx, pcRdpgfxMapWindowForSurface map, diff --git a/include/freerdp/graphics.h b/include/freerdp/graphics.h index e72202923..65e7ccae5 100644 --- a/include/freerdp/graphics.h +++ b/include/freerdp/graphics.h @@ -22,10 +22,6 @@ #ifndef FREERDP_GRAPHICS_H #define FREERDP_GRAPHICS_H -typedef struct rdp_bitmap rdpBitmap; -typedef struct rdp_pointer rdpPointer; -typedef struct rdp_glyph rdpGlyph; - #include #include #include @@ -36,6 +32,10 @@ extern "C" { #endif + typedef struct rdp_bitmap rdpBitmap; + typedef struct rdp_pointer rdpPointer; + typedef struct rdp_glyph rdpGlyph; + /* Bitmap Class */ typedef BOOL (*pBitmap_New)(rdpContext* context, rdpBitmap* bitmap); typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap); diff --git a/include/freerdp/heartbeat.h b/include/freerdp/heartbeat.h index 10710f5eb..8837927de 100644 --- a/include/freerdp/heartbeat.h +++ b/include/freerdp/heartbeat.h @@ -22,20 +22,20 @@ #include -typedef struct rdp_heartbeat rdpHeartbeat; - -typedef BOOL (*pServerHeartbeat)(freerdp* instance, BYTE period, BYTE count1, BYTE count2); - -struct rdp_heartbeat -{ - pServerHeartbeat ServerHeartbeat; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct rdp_heartbeat rdpHeartbeat; + + typedef BOOL (*pServerHeartbeat)(freerdp* instance, BYTE period, BYTE count1, BYTE count2); + + struct rdp_heartbeat + { + pServerHeartbeat ServerHeartbeat; + }; + FREERDP_API BOOL freerdp_heartbeat_send_heartbeat_pdu(freerdp_peer* peer, BYTE period, BYTE count1, BYTE count2); diff --git a/include/freerdp/input.h b/include/freerdp/input.h index 91a6bcf94..9c06191c6 100644 --- a/include/freerdp/input.h +++ b/include/freerdp/input.h @@ -20,8 +20,6 @@ #ifndef FREERDP_INPUT_H #define FREERDP_INPUT_H -typedef struct rdp_input rdpInput; - #include #include #include @@ -61,41 +59,43 @@ typedef struct rdp_input rdpInput; #define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4 -/* defined inside libfreerdp-core */ -typedef struct rdp_input_proxy rdpInputProxy; - -/* Input Interface */ - -typedef BOOL (*pSynchronizeEvent)(rdpInput* input, UINT32 flags); -typedef BOOL (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT8 code); -typedef BOOL (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code); -typedef BOOL (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); -typedef BOOL (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); -typedef BOOL (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates); -typedef BOOL (*pKeyboardPauseEvent)(rdpInput* input); - -struct rdp_input -{ - rdpContext* context; /* 0 */ - void* param1; /* 1 */ - UINT32 paddingA[16 - 2]; /* 2 */ - - pSynchronizeEvent SynchronizeEvent; /* 16 */ - pKeyboardEvent KeyboardEvent; /* 17 */ - pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */ - pMouseEvent MouseEvent; /* 19 */ - pExtendedMouseEvent ExtendedMouseEvent; /* 20 */ - pFocusInEvent FocusInEvent; /*21 */ - pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */ - - UINT32 paddingB[32 - 23]; /* 23 */ -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct rdp_input rdpInput; + + /* defined inside libfreerdp-core */ + typedef struct rdp_input_proxy rdpInputProxy; + + /* Input Interface */ + + typedef BOOL (*pSynchronizeEvent)(rdpInput* input, UINT32 flags); + typedef BOOL (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT8 code); + typedef BOOL (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code); + typedef BOOL (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); + typedef BOOL (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y); + typedef BOOL (*pFocusInEvent)(rdpInput* input, UINT16 toggleStates); + typedef BOOL (*pKeyboardPauseEvent)(rdpInput* input); + + struct rdp_input + { + rdpContext* context; /* 0 */ + void* param1; /* 1 */ + UINT32 paddingA[16 - 2]; /* 2 */ + + pSynchronizeEvent SynchronizeEvent; /* 16 */ + pKeyboardEvent KeyboardEvent; /* 17 */ + pUnicodeKeyboardEvent UnicodeKeyboardEvent; /* 18 */ + pMouseEvent MouseEvent; /* 19 */ + pExtendedMouseEvent ExtendedMouseEvent; /* 20 */ + pFocusInEvent FocusInEvent; /*21 */ + pKeyboardPauseEvent KeyboardPauseEvent; /* 22 */ + + UINT32 paddingB[32 - 23]; /* 23 */ + }; + FREERDP_API BOOL freerdp_input_send_synchronize_event(rdpInput* input, UINT32 flags); FREERDP_API BOOL freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT8 code); FREERDP_API BOOL freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, BOOL repeat, diff --git a/include/freerdp/listener.h b/include/freerdp/listener.h index a9f3b020f..79001df83 100644 --- a/include/freerdp/listener.h +++ b/include/freerdp/listener.h @@ -20,8 +20,6 @@ #ifndef FREERDP_LISTENER_H #define FREERDP_LISTENER_H -typedef struct rdp_freerdp_listener freerdp_listener; - #include #include #include @@ -32,6 +30,8 @@ extern "C" { #endif + typedef struct rdp_freerdp_listener freerdp_listener; + typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, UINT16 port); typedef BOOL (*psListenerOpenLocal)(freerdp_listener* instance, const char* path); diff --git a/include/freerdp/locale/keyboard.h b/include/freerdp/locale/keyboard.h index 763513f9e..ca912eb27 100644 --- a/include/freerdp/locale/keyboard.h +++ b/include/freerdp/locale/keyboard.h @@ -26,6 +26,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 #define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 #define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 @@ -219,11 +224,6 @@ typedef struct #define KBD_TYPE_NOKIA_9140 0x00000006 /* Nokia 9140 and similar keyboards */ #define KBD_TYPE_JAPANESE 0x00000007 /* Japanese keyboard */ -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API DWORD freerdp_keyboard_init(DWORD keyboardLayoutId); FREERDP_API DWORD freerdp_keyboard_init_ex(DWORD keyboardLayoutId, const char* keyboardRemappingList); diff --git a/include/freerdp/message.h b/include/freerdp/message.h index 2c277a507..1c47b9f07 100644 --- a/include/freerdp/message.h +++ b/include/freerdp/message.h @@ -17,8 +17,8 @@ * limitations under the License. */ -#ifndef FREERDP_CORE_MESSAGE_H -#define FREERDP_CORE_MESSAGE_H +#ifndef FREERDP_MESSAGE_H +#define FREERDP_MESSAGE_H #define GetMessageType(_id) (_id & 0xFF) #define GetMessageClass(_id) ((_id >> 16) & 0xFF) @@ -373,4 +373,4 @@ #define FREERDP_RDPEI_CHANNEL_DISMISS_HOVERING_CONTACT \ MakeMessageId(RdpeiChannel, DismissHoveringContact) -#endif /* FREERDP_CORE_MESSAGE_H */ +#endif /* FREERDP_MESSAGE_H */ diff --git a/include/freerdp/metrics.h b/include/freerdp/metrics.h index 6d6b7d40a..d148885f9 100644 --- a/include/freerdp/metrics.h +++ b/include/freerdp/metrics.h @@ -22,20 +22,20 @@ #include -struct rdp_metrics -{ - rdpContext* context; - - UINT64 TotalCompressedBytes; - UINT64 TotalUncompressedBytes; - double TotalCompressionRatio; -}; - #ifdef __cplusplus extern "C" { #endif + struct rdp_metrics + { + rdpContext* context; + + UINT64 TotalCompressedBytes; + UINT64 TotalUncompressedBytes; + double TotalCompressionRatio; + }; + FREERDP_API double metrics_write_bytes(rdpMetrics* metrics, UINT32 UncompressedBytes, UINT32 CompressedBytes); diff --git a/include/freerdp/peer.h b/include/freerdp/peer.h index 0c79365e0..d4f974ea8 100644 --- a/include/freerdp/peer.h +++ b/include/freerdp/peer.h @@ -32,10 +32,15 @@ #include #include -typedef BOOL (*psPeerContextNew)(freerdp_peer* peer, rdpContext* context); -typedef void (*psPeerContextFree)(freerdp_peer* peer, rdpContext* context); +#ifdef __cplusplus +extern "C" +{ +#endif -typedef BOOL (*psPeerInitialize)(freerdp_peer* peer); + typedef BOOL (*psPeerContextNew)(freerdp_peer* peer, rdpContext* context); + typedef void (*psPeerContextFree)(freerdp_peer* peer, rdpContext* context); + + typedef BOOL (*psPeerInitialize)(freerdp_peer* peer); #if defined(WITH_FREERDP_DEPRECATED) WINPR_DEPRECATED_VAR("Use psPeerGetEventHandle instead", typedef BOOL (*psPeerGetFileDescriptor)(freerdp_peer* peer, void** rfds, @@ -178,11 +183,6 @@ struct rdp_freerdp_peer ALIGN64 psSspiNtlmHashCallback SspiNtlmHashCallback; }; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API BOOL freerdp_peer_context_new(freerdp_peer* client); FREERDP_API BOOL freerdp_peer_context_new_ex(freerdp_peer* client, const rdpSettings* settings); FREERDP_API void freerdp_peer_context_free(freerdp_peer* client); diff --git a/include/freerdp/pointer.h b/include/freerdp/pointer.h index 731348785..f76813c26 100644 --- a/include/freerdp/pointer.h +++ b/include/freerdp/pointer.h @@ -32,76 +32,87 @@ #define SYSPTR_NULL 0x00000000 #define SYSPTR_DEFAULT 0x00007F00 -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 xPos; - UINT32 yPos; -} POINTER_POSITION_UPDATE; +#endif -typedef struct -{ - UINT32 type; -} POINTER_SYSTEM_UPDATE; + typedef struct + { + UINT32 xPos; + UINT32 yPos; + } POINTER_POSITION_UPDATE; -typedef struct -{ - UINT32 cacheIndex; - UINT32 xPos; - UINT32 yPos; - UINT32 width; - UINT32 height; - UINT32 lengthAndMask; - UINT32 lengthXorMask; - BYTE* xorMaskData; - BYTE* andMaskData; -} POINTER_COLOR_UPDATE; + typedef struct + { + UINT32 type; + } POINTER_SYSTEM_UPDATE; -typedef struct -{ - UINT16 xorBpp; - UINT16 cacheIndex; - UINT16 hotSpotX; - UINT16 hotSpotY; - UINT16 width; - UINT16 height; - UINT32 lengthAndMask; - UINT32 lengthXorMask; - BYTE* xorMaskData; - BYTE* andMaskData; -} POINTER_LARGE_UPDATE; + typedef struct + { + UINT32 cacheIndex; + UINT32 xPos; + UINT32 yPos; + UINT32 width; + UINT32 height; + UINT32 lengthAndMask; + UINT32 lengthXorMask; + BYTE* xorMaskData; + BYTE* andMaskData; + } POINTER_COLOR_UPDATE; -typedef struct -{ - UINT32 xorBpp; - POINTER_COLOR_UPDATE colorPtrAttr; -} POINTER_NEW_UPDATE; + typedef struct + { + UINT16 xorBpp; + UINT16 cacheIndex; + UINT16 hotSpotX; + UINT16 hotSpotY; + UINT16 width; + UINT16 height; + UINT32 lengthAndMask; + UINT32 lengthXorMask; + BYTE* xorMaskData; + BYTE* andMaskData; + } POINTER_LARGE_UPDATE; -typedef struct -{ - UINT32 cacheIndex; -} POINTER_CACHED_UPDATE; + typedef struct + { + UINT32 xorBpp; + POINTER_COLOR_UPDATE colorPtrAttr; + } POINTER_NEW_UPDATE; -typedef BOOL (*pPointerPosition)(rdpContext* context, - const POINTER_POSITION_UPDATE* pointer_position); -typedef BOOL (*pPointerSystem)(rdpContext* context, const POINTER_SYSTEM_UPDATE* pointer_system); -typedef BOOL (*pPointerColor)(rdpContext* context, const POINTER_COLOR_UPDATE* pointer_color); -typedef BOOL (*pPointerNew)(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new); -typedef BOOL (*pPointerCached)(rdpContext* context, const POINTER_CACHED_UPDATE* pointer_cached); -typedef BOOL (*pPointerLarge)(rdpContext* context, const POINTER_LARGE_UPDATE* pointer_large); + typedef struct + { + UINT32 cacheIndex; + } POINTER_CACHED_UPDATE; -struct rdp_pointer_update -{ - rdpContext* context; /* 0 */ - UINT32 paddingA[16 - 1]; /* 1 */ + typedef BOOL (*pPointerPosition)(rdpContext* context, + const POINTER_POSITION_UPDATE* pointer_position); + typedef BOOL (*pPointerSystem)(rdpContext* context, + const POINTER_SYSTEM_UPDATE* pointer_system); + typedef BOOL (*pPointerColor)(rdpContext* context, const POINTER_COLOR_UPDATE* pointer_color); + typedef BOOL (*pPointerNew)(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new); + typedef BOOL (*pPointerCached)(rdpContext* context, + const POINTER_CACHED_UPDATE* pointer_cached); + typedef BOOL (*pPointerLarge)(rdpContext* context, const POINTER_LARGE_UPDATE* pointer_large); - pPointerPosition PointerPosition; /* 16 */ - pPointerSystem PointerSystem; /* 17 */ - pPointerColor PointerColor; /* 18 */ - pPointerNew PointerNew; /* 19 */ - pPointerCached PointerCached; /* 20 */ - pPointerLarge PointerLarge; /* 21 */ - UINT32 paddingB[32 - 22]; /* 22 */ -}; -typedef struct rdp_pointer_update rdpPointerUpdate; + struct rdp_pointer_update + { + rdpContext* context; /* 0 */ + UINT32 paddingA[16 - 1]; /* 1 */ + + pPointerPosition PointerPosition; /* 16 */ + pPointerSystem PointerSystem; /* 17 */ + pPointerColor PointerColor; /* 18 */ + pPointerNew PointerNew; /* 19 */ + pPointerCached PointerCached; /* 20 */ + pPointerLarge PointerLarge; /* 21 */ + UINT32 paddingB[32 - 22]; /* 22 */ + }; + typedef struct rdp_pointer_update rdpPointerUpdate; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_UPDATE_POINTER_H */ diff --git a/include/freerdp/primary.h b/include/freerdp/primary.h index 0f6b6f26e..77f3b399c 100644 --- a/include/freerdp/primary.h +++ b/include/freerdp/primary.h @@ -22,27 +22,32 @@ #include -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 cacheIndex; - INT16 x; - INT16 y; - UINT32 cx; - UINT32 cy; - UINT32 cb; - BYTE* aj; -} GLYPH_DATA; +#endif -typedef struct -{ - UINT32 cacheIndex; - INT32 x; - INT32 y; - UINT32 cx; - UINT32 cy; - UINT32 cb; - BYTE* aj; -} GLYPH_DATA_V2; + typedef struct + { + UINT32 cacheIndex; + INT16 x; + INT16 y; + UINT32 cx; + UINT32 cy; + UINT32 cb; + BYTE* aj; + } GLYPH_DATA; + + typedef struct + { + UINT32 cacheIndex; + INT32 x; + INT32 y; + UINT32 cx; + UINT32 cy; + UINT32 cb; + BYTE* aj; + } GLYPH_DATA_V2; #define BACKMODE_TRANSPARENT 0x0001 #define BACKMODE_OPAQUE 0x0002 @@ -469,4 +474,8 @@ struct rdp_primary_update }; typedef struct rdp_primary_update rdpPrimaryUpdate; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_UPDATE_PRIMARY_H */ diff --git a/include/freerdp/primitives.h b/include/freerdp/primitives.h index e76dcdd48..cf6886301 100644 --- a/include/freerdp/primitives.h +++ b/include/freerdp/primitives.h @@ -26,7 +26,12 @@ #include -typedef INT32 pstatus_t; /* match IppStatus. */ +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef INT32 pstatus_t; /* match IppStatus. */ #define PRIMITIVES_SUCCESS (0) /* match ippStsNoErr */ /* Simple macro for address of an x,y location in 2d 4-byte memory block */ @@ -198,11 +203,6 @@ typedef enum PRIMITIVES_AUTODETECT /** detect the best routines */ } primitive_hints; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API primitives_t* primitives_get(void); FREERDP_API void primitives_set_hints(primitive_hints hints); FREERDP_API primitive_hints primitives_get_hints(void); diff --git a/include/freerdp/rail.h b/include/freerdp/rail.h index 9105786f7..111486610 100644 --- a/include/freerdp/rail.h +++ b/include/freerdp/rail.h @@ -25,6 +25,11 @@ #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define RAIL_SVC_CHANNEL_NAME "rail" /* DEPRECATED: RAIL PDU flags use the spec conformant naming with TS_ prefix */ @@ -573,11 +578,6 @@ typedef enum TS_RAIL_ORDER_EXEC_RESULT = 0x0080 } ORDER_TYPE; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API BOOL rail_read_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string); FREERDP_API BOOL utf8_string_to_rail_string(const char* string, RAIL_UNICODE_STRING* unicode_string); diff --git a/include/freerdp/secondary.h b/include/freerdp/secondary.h index 2c30ecc82..76ff13d61 100644 --- a/include/freerdp/secondary.h +++ b/include/freerdp/secondary.h @@ -23,6 +23,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define GLYPH_FRAGMENT_NOP 0x00 #define GLYPH_FRAGMENT_USE 0xFE #define GLYPH_FRAGMENT_ADD 0xFF @@ -185,4 +190,8 @@ struct rdp_secondary_update }; typedef struct rdp_secondary_update rdpSecondaryUpdate; +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_UPDATE_SECONDARY_H */ diff --git a/include/freerdp/server/ainput.h b/include/freerdp/server/ainput.h index 200de567a..b35b27d33 100644 --- a/include/freerdp/server/ainput.h +++ b/include/freerdp/server/ainput.h @@ -24,94 +24,94 @@ #include #include -typedef enum AINPUT_SERVER_OPEN_RESULT -{ - AINPUT_SERVER_OPEN_RESULT_OK = 0, - AINPUT_SERVER_OPEN_RESULT_CLOSED = 1, - AINPUT_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, - AINPUT_SERVER_OPEN_RESULT_ERROR = 3 -} AINPUT_SERVER_OPEN_RESULT; - -typedef struct _ainput_server_context ainput_server_context; - -typedef BOOL (*psAInputChannelIdAssigned)(ainput_server_context* context, UINT32 channelId); - -typedef UINT (*psAInputServerInitialize)(ainput_server_context* context, BOOL externalThread); -typedef UINT (*psAInputServerPoll)(ainput_server_context* context); -typedef BOOL (*psAInputServerChannelHandle)(ainput_server_context* context, HANDLE* handle); - -typedef UINT (*psAInputServerOpen)(ainput_server_context* context); -typedef UINT (*psAInputServerClose)(ainput_server_context* context); -typedef BOOL (*psAInputServerIsOpen)(ainput_server_context* context); - -typedef UINT (*psAInputServerOpenResult)(ainput_server_context* context, - AINPUT_SERVER_OPEN_RESULT result); -typedef UINT (*psAInputServerMouseEvent)(ainput_server_context* context, UINT64 timestamp, - UINT64 flags, INT32 x, INT32 y); - -struct _ainput_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* data; - - /*** APIs called by the server. ***/ - /** - * Open the ainput channel. - */ - psAInputServerOpen Open; - - /** - * Optional: Set thread handling. - * When externalThread=TRUE the application is responsible to call - * ainput_server_context_poll periodically to process input events. - * - * Defaults to externalThread=FALSE - */ - psAInputServerInitialize Initialize; - - /** - * @brief Poll When externalThread=TRUE call periodically from your main loop. - * if externalThread=FALSE do not call. - */ - psAInputServerPoll Poll; - - /** - * @brief Poll When externalThread=TRUE call to get a handle to wait for events. - * Will return FALSE until the handle is available. - */ - psAInputServerChannelHandle ChannelHandle; - - /** - * Close the ainput channel. - */ - psAInputServerClose Close; - /** - * Status of the ainput channel. - */ - psAInputServerIsOpen IsOpen; - - /*** Callbacks registered by the server. ***/ - - /** - * Receive ainput mouse event PDU. - */ - psAInputServerMouseEvent MouseEvent; - - rdpContext* rdpcontext; - - /** - * Callback, when the channel got its id assigned. - */ - psAInputChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef enum AINPUT_SERVER_OPEN_RESULT + { + AINPUT_SERVER_OPEN_RESULT_OK = 0, + AINPUT_SERVER_OPEN_RESULT_CLOSED = 1, + AINPUT_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, + AINPUT_SERVER_OPEN_RESULT_ERROR = 3 + } AINPUT_SERVER_OPEN_RESULT; + + typedef struct _ainput_server_context ainput_server_context; + + typedef BOOL (*psAInputChannelIdAssigned)(ainput_server_context* context, UINT32 channelId); + + typedef UINT (*psAInputServerInitialize)(ainput_server_context* context, BOOL externalThread); + typedef UINT (*psAInputServerPoll)(ainput_server_context* context); + typedef BOOL (*psAInputServerChannelHandle)(ainput_server_context* context, HANDLE* handle); + + typedef UINT (*psAInputServerOpen)(ainput_server_context* context); + typedef UINT (*psAInputServerClose)(ainput_server_context* context); + typedef BOOL (*psAInputServerIsOpen)(ainput_server_context* context); + + typedef UINT (*psAInputServerOpenResult)(ainput_server_context* context, + AINPUT_SERVER_OPEN_RESULT result); + typedef UINT (*psAInputServerMouseEvent)(ainput_server_context* context, UINT64 timestamp, + UINT64 flags, INT32 x, INT32 y); + + struct _ainput_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* data; + + /*** APIs called by the server. ***/ + /** + * Open the ainput channel. + */ + psAInputServerOpen Open; + + /** + * Optional: Set thread handling. + * When externalThread=TRUE the application is responsible to call + * ainput_server_context_poll periodically to process input events. + * + * Defaults to externalThread=FALSE + */ + psAInputServerInitialize Initialize; + + /** + * @brief Poll When externalThread=TRUE call periodically from your main loop. + * if externalThread=FALSE do not call. + */ + psAInputServerPoll Poll; + + /** + * @brief Poll When externalThread=TRUE call to get a handle to wait for events. + * Will return FALSE until the handle is available. + */ + psAInputServerChannelHandle ChannelHandle; + + /** + * Close the ainput channel. + */ + psAInputServerClose Close; + /** + * Status of the ainput channel. + */ + psAInputServerIsOpen IsOpen; + + /*** Callbacks registered by the server. ***/ + + /** + * Receive ainput mouse event PDU. + */ + psAInputServerMouseEvent MouseEvent; + + rdpContext* rdpcontext; + + /** + * Callback, when the channel got its id assigned. + */ + psAInputChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API ainput_server_context* ainput_server_context_new(HANDLE vcm); FREERDP_API void ainput_server_context_free(ainput_server_context* context); diff --git a/include/freerdp/server/audin.h b/include/freerdp/server/audin.h index 36037913d..49df4758b 100644 --- a/include/freerdp/server/audin.h +++ b/include/freerdp/server/audin.h @@ -30,93 +30,93 @@ #error "This header must not be included if CHANNEL_AUDIN_SERVER is not defined" #endif -typedef struct s_audin_server_context audin_server_context; - -typedef BOOL (*psAudinServerChannelIdAssigned)(audin_server_context* context, UINT32 channelId); - -typedef UINT (*psAudinServerSelectFormat)(audin_server_context* context, - size_t client_format_index); -typedef BOOL (*psAudinServerOpen)(audin_server_context* context); -typedef BOOL (*psAudinServerIsOpen)(audin_server_context* context); -typedef BOOL (*psAudinServerClose)(audin_server_context* context); - -typedef UINT (*psAudinServerOpening)(audin_server_context* context); -typedef UINT (*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); -typedef UINT (*psAudinServerReceiveSamples)(audin_server_context* context, - const AUDIO_FORMAT* format, wStream* buf, - size_t nframes); - -struct s_audin_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* data; - - /* Server supported formats. Set by server. */ - AUDIO_FORMAT* server_formats; - size_t num_server_formats; - - /* Server destination PCM audio format. Set by server. */ - AUDIO_FORMAT* dst_format; - - /* Server preferred frames per packet. */ - int frames_per_packet; - - /* Client supported formats. */ - AUDIO_FORMAT* client_formats; - size_t num_client_formats; - SSIZE_T selected_client_format; - - /*** APIs called by the server. ***/ - /** - * Choose the audio format to be received. The index argument is an index into - * the client_formats array and must be smaller than num_client_formats. - */ - psAudinServerSelectFormat SelectFormat; - /** - * Open the audio input stream. - */ - psAudinServerOpen Open; - - psAudinServerIsOpen IsOpen; - - /** - * Close the audio stream. - */ - psAudinServerClose Close; - - /*** Callbacks registered by the server. ***/ - /** - * It's ready to open the audio input stream. The server should examine client - * formats and call SelectFormat to choose the desired one in this callback. - */ - psAudinServerOpening Opening; - /** - * Client replied HRESULT of the open operation. - */ - psAudinServerOpenResult OpenResult; - /** - * Receive audio samples. Actual bytes in the buffer is: - * nframes * dst_format.nBitsPerSample * dst_format.nChannels / 8 - * Note that this callback is called from a different thread context so the - * server must be careful of thread synchronization. - */ - psAudinServerReceiveSamples ReceiveSamples; - - rdpContext* rdpcontext; - - /** - * Callback, when the channel got its id assigned. - */ - psAudinServerChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_audin_server_context audin_server_context; + + typedef BOOL (*psAudinServerChannelIdAssigned)(audin_server_context* context, UINT32 channelId); + + typedef UINT (*psAudinServerSelectFormat)(audin_server_context* context, + size_t client_format_index); + typedef BOOL (*psAudinServerOpen)(audin_server_context* context); + typedef BOOL (*psAudinServerIsOpen)(audin_server_context* context); + typedef BOOL (*psAudinServerClose)(audin_server_context* context); + + typedef UINT (*psAudinServerOpening)(audin_server_context* context); + typedef UINT (*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); + typedef UINT (*psAudinServerReceiveSamples)(audin_server_context* context, + const AUDIO_FORMAT* format, wStream* buf, + size_t nframes); + + struct s_audin_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* data; + + /* Server supported formats. Set by server. */ + AUDIO_FORMAT* server_formats; + size_t num_server_formats; + + /* Server destination PCM audio format. Set by server. */ + AUDIO_FORMAT* dst_format; + + /* Server preferred frames per packet. */ + int frames_per_packet; + + /* Client supported formats. */ + AUDIO_FORMAT* client_formats; + size_t num_client_formats; + SSIZE_T selected_client_format; + + /*** APIs called by the server. ***/ + /** + * Choose the audio format to be received. The index argument is an index into + * the client_formats array and must be smaller than num_client_formats. + */ + psAudinServerSelectFormat SelectFormat; + /** + * Open the audio input stream. + */ + psAudinServerOpen Open; + + psAudinServerIsOpen IsOpen; + + /** + * Close the audio stream. + */ + psAudinServerClose Close; + + /*** Callbacks registered by the server. ***/ + /** + * It's ready to open the audio input stream. The server should examine client + * formats and call SelectFormat to choose the desired one in this callback. + */ + psAudinServerOpening Opening; + /** + * Client replied HRESULT of the open operation. + */ + psAudinServerOpenResult OpenResult; + /** + * Receive audio samples. Actual bytes in the buffer is: + * nframes * dst_format.nBitsPerSample * dst_format.nChannels / 8 + * Note that this callback is called from a different thread context so the + * server must be careful of thread synchronization. + */ + psAudinServerReceiveSamples ReceiveSamples; + + rdpContext* rdpcontext; + + /** + * Callback, when the channel got its id assigned. + */ + psAudinServerChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API audin_server_context* audin_server_context_new(HANDLE vcm); FREERDP_API void audin_server_context_free(audin_server_context* context); diff --git a/include/freerdp/server/cliprdr.h b/include/freerdp/server/cliprdr.h index 9464a1349..1b273fdd5 100644 --- a/include/freerdp/server/cliprdr.h +++ b/include/freerdp/server/cliprdr.h @@ -29,111 +29,111 @@ #include #include -/** - * Server Interface - */ - -typedef struct s_cliprdr_server_context CliprdrServerContext; - -typedef UINT (*psCliprdrOpen)(CliprdrServerContext* context); -typedef UINT (*psCliprdrClose)(CliprdrServerContext* context); -typedef UINT (*psCliprdrStart)(CliprdrServerContext* context); -typedef UINT (*psCliprdrStop)(CliprdrServerContext* context); -typedef HANDLE (*psCliprdrGetEventHandle)(CliprdrServerContext* context); -typedef UINT (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); - -typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, - const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, - const CLIPRDR_CAPABILITIES* capabilities); -typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, - const CLIPRDR_MONITOR_READY* monitorReady); -typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, - const CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, - const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, - const CLIPRDR_FORMAT_LIST* formatList); -typedef UINT (*psCliprdrClientFormatListResponse)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*psCliprdrServerFormatListResponse)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef UINT (*psCliprdrClientLockClipboardData)( - CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*psCliprdrServerLockClipboardData)( - CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef UINT (*psCliprdrClientUnlockClipboardData)( - CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*psCliprdrServerUnlockClipboardData)( - CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef UINT (*psCliprdrClientFormatDataRequest)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*psCliprdrServerFormatDataRequest)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef UINT (*psCliprdrClientFormatDataResponse)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*psCliprdrServerFormatDataResponse)( - CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef UINT (*psCliprdrClientFileContentsRequest)( - CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*psCliprdrServerFileContentsRequest)( - CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef UINT (*psCliprdrClientFileContentsResponse)( - CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef UINT (*psCliprdrServerFileContentsResponse)( - CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); - -struct s_cliprdr_server_context -{ - void* handle; - void* custom; - - /* server clipboard capabilities - set by server - updated by the channel after client - * capability exchange */ - BOOL useLongFormatNames; - BOOL streamFileClipEnabled; - BOOL fileClipNoFilePaths; - BOOL canLockClipData; - - psCliprdrOpen Open; - psCliprdrClose Close; - psCliprdrStart Start; - psCliprdrStop Stop; - psCliprdrGetEventHandle GetEventHandle; - psCliprdrCheckEventHandle CheckEventHandle; - - psCliprdrServerCapabilities ServerCapabilities; - psCliprdrClientCapabilities ClientCapabilities; - psCliprdrMonitorReady MonitorReady; - psCliprdrTempDirectory TempDirectory; - psCliprdrClientFormatList ClientFormatList; - psCliprdrServerFormatList ServerFormatList; - psCliprdrClientFormatListResponse ClientFormatListResponse; - psCliprdrServerFormatListResponse ServerFormatListResponse; - psCliprdrClientLockClipboardData ClientLockClipboardData; - psCliprdrServerLockClipboardData ServerLockClipboardData; - psCliprdrClientUnlockClipboardData ClientUnlockClipboardData; - psCliprdrServerUnlockClipboardData ServerUnlockClipboardData; - psCliprdrClientFormatDataRequest ClientFormatDataRequest; - psCliprdrServerFormatDataRequest ServerFormatDataRequest; - psCliprdrClientFormatDataResponse ClientFormatDataResponse; - psCliprdrServerFormatDataResponse ServerFormatDataResponse; - psCliprdrClientFileContentsRequest ClientFileContentsRequest; - psCliprdrServerFileContentsRequest ServerFileContentsRequest; - psCliprdrClientFileContentsResponse ClientFileContentsResponse; - psCliprdrServerFileContentsResponse ServerFileContentsResponse; - - rdpContext* rdpcontext; - BOOL autoInitializationSequence; - UINT32 lastRequestedFormatId; - BOOL hasHugeFileSupport; -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Server Interface + */ + + typedef struct s_cliprdr_server_context CliprdrServerContext; + + typedef UINT (*psCliprdrOpen)(CliprdrServerContext* context); + typedef UINT (*psCliprdrClose)(CliprdrServerContext* context); + typedef UINT (*psCliprdrStart)(CliprdrServerContext* context); + typedef UINT (*psCliprdrStop)(CliprdrServerContext* context); + typedef HANDLE (*psCliprdrGetEventHandle)(CliprdrServerContext* context); + typedef UINT (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); + + typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, + const CLIPRDR_CAPABILITIES* capabilities); + typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, + const CLIPRDR_CAPABILITIES* capabilities); + typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, + const CLIPRDR_MONITOR_READY* monitorReady); + typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, + const CLIPRDR_TEMP_DIRECTORY* tempDirectory); + typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST* formatList); + typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, + const CLIPRDR_FORMAT_LIST* formatList); + typedef UINT (*psCliprdrClientFormatListResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); + typedef UINT (*psCliprdrServerFormatListResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); + typedef UINT (*psCliprdrClientLockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); + typedef UINT (*psCliprdrServerLockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); + typedef UINT (*psCliprdrClientUnlockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); + typedef UINT (*psCliprdrServerUnlockClipboardData)( + CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); + typedef UINT (*psCliprdrClientFormatDataRequest)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); + typedef UINT (*psCliprdrServerFormatDataRequest)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); + typedef UINT (*psCliprdrClientFormatDataResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); + typedef UINT (*psCliprdrServerFormatDataResponse)( + CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); + typedef UINT (*psCliprdrClientFileContentsRequest)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); + typedef UINT (*psCliprdrServerFileContentsRequest)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); + typedef UINT (*psCliprdrClientFileContentsResponse)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); + typedef UINT (*psCliprdrServerFileContentsResponse)( + CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); + + struct s_cliprdr_server_context + { + void* handle; + void* custom; + + /* server clipboard capabilities - set by server - updated by the channel after client + * capability exchange */ + BOOL useLongFormatNames; + BOOL streamFileClipEnabled; + BOOL fileClipNoFilePaths; + BOOL canLockClipData; + + psCliprdrOpen Open; + psCliprdrClose Close; + psCliprdrStart Start; + psCliprdrStop Stop; + psCliprdrGetEventHandle GetEventHandle; + psCliprdrCheckEventHandle CheckEventHandle; + + psCliprdrServerCapabilities ServerCapabilities; + psCliprdrClientCapabilities ClientCapabilities; + psCliprdrMonitorReady MonitorReady; + psCliprdrTempDirectory TempDirectory; + psCliprdrClientFormatList ClientFormatList; + psCliprdrServerFormatList ServerFormatList; + psCliprdrClientFormatListResponse ClientFormatListResponse; + psCliprdrServerFormatListResponse ServerFormatListResponse; + psCliprdrClientLockClipboardData ClientLockClipboardData; + psCliprdrServerLockClipboardData ServerLockClipboardData; + psCliprdrClientUnlockClipboardData ClientUnlockClipboardData; + psCliprdrServerUnlockClipboardData ServerUnlockClipboardData; + psCliprdrClientFormatDataRequest ClientFormatDataRequest; + psCliprdrServerFormatDataRequest ServerFormatDataRequest; + psCliprdrClientFormatDataResponse ClientFormatDataResponse; + psCliprdrServerFormatDataResponse ServerFormatDataResponse; + psCliprdrClientFileContentsRequest ClientFileContentsRequest; + psCliprdrServerFileContentsRequest ServerFileContentsRequest; + psCliprdrClientFileContentsResponse ClientFileContentsResponse; + psCliprdrServerFileContentsResponse ServerFileContentsResponse; + + rdpContext* rdpcontext; + BOOL autoInitializationSequence; + UINT32 lastRequestedFormatId; + BOOL hasHugeFileSupport; + }; + FREERDP_API CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm); FREERDP_API void cliprdr_server_context_free(CliprdrServerContext* context); diff --git a/include/freerdp/server/disp.h b/include/freerdp/server/disp.h index 37e8fdeb7..fadc64158 100644 --- a/include/freerdp/server/disp.h +++ b/include/freerdp/server/disp.h @@ -26,47 +26,47 @@ #include #include -typedef struct s_disp_server_private DispServerPrivate; -typedef struct s_disp_server_context DispServerContext; - -typedef BOOL (*psDispChannelIdAssigned)(DispServerContext* context, UINT32 channelId); - -typedef UINT (*psDispMonitorLayout)(DispServerContext* context, - const DISPLAY_CONTROL_MONITOR_LAYOUT_PDU* pdu); -typedef UINT (*psDispCaps)(DispServerContext* context); -typedef UINT (*psDispOpen)(DispServerContext* context); -typedef UINT (*psDispClose)(DispServerContext* context); - -struct s_disp_server_context -{ - void* custom; - HANDLE vcm; - - /* Server capabilities */ - UINT32 MaxNumMonitors; - UINT32 MaxMonitorAreaFactorA; - UINT32 MaxMonitorAreaFactorB; - - psDispOpen Open; - psDispClose Close; - - psDispMonitorLayout DispMonitorLayout; - psDispCaps DisplayControlCaps; - - DispServerPrivate* priv; - rdpContext* rdpcontext; - - /** - * Callback, when the channel got its id assigned. - */ - psDispChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_disp_server_private DispServerPrivate; + typedef struct s_disp_server_context DispServerContext; + + typedef BOOL (*psDispChannelIdAssigned)(DispServerContext* context, UINT32 channelId); + + typedef UINT (*psDispMonitorLayout)(DispServerContext* context, + const DISPLAY_CONTROL_MONITOR_LAYOUT_PDU* pdu); + typedef UINT (*psDispCaps)(DispServerContext* context); + typedef UINT (*psDispOpen)(DispServerContext* context); + typedef UINT (*psDispClose)(DispServerContext* context); + + struct s_disp_server_context + { + void* custom; + HANDLE vcm; + + /* Server capabilities */ + UINT32 MaxNumMonitors; + UINT32 MaxMonitorAreaFactorA; + UINT32 MaxMonitorAreaFactorB; + + psDispOpen Open; + psDispClose Close; + + psDispMonitorLayout DispMonitorLayout; + psDispCaps DisplayControlCaps; + + DispServerPrivate* priv; + rdpContext* rdpcontext; + + /** + * Callback, when the channel got its id assigned. + */ + psDispChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API DispServerContext* disp_server_context_new(HANDLE vcm); FREERDP_API void disp_server_context_free(DispServerContext* context); diff --git a/include/freerdp/server/drdynvc.h b/include/freerdp/server/drdynvc.h index d1d9d7a6d..c6848e428 100644 --- a/include/freerdp/server/drdynvc.h +++ b/include/freerdp/server/drdynvc.h @@ -26,31 +26,31 @@ #include #include -/** - * Server Interface - */ - -typedef struct s_drdynvc_server_context DrdynvcServerContext; -typedef struct s_drdynvc_server_private DrdynvcServerPrivate; - -typedef UINT (*psDrdynvcStart)(DrdynvcServerContext* context); -typedef UINT (*psDrdynvcStop)(DrdynvcServerContext* context); - -struct s_drdynvc_server_context -{ - HANDLE vcm; - - psDrdynvcStart Start; - psDrdynvcStop Stop; - - DrdynvcServerPrivate* priv; -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Server Interface + */ + + typedef struct s_drdynvc_server_context DrdynvcServerContext; + typedef struct s_drdynvc_server_private DrdynvcServerPrivate; + + typedef UINT (*psDrdynvcStart)(DrdynvcServerContext* context); + typedef UINT (*psDrdynvcStop)(DrdynvcServerContext* context); + + struct s_drdynvc_server_context + { + HANDLE vcm; + + psDrdynvcStart Start; + psDrdynvcStop Stop; + + DrdynvcServerPrivate* priv; + }; + FREERDP_API DrdynvcServerContext* drdynvc_server_context_new(HANDLE vcm); FREERDP_API void drdynvc_server_context_free(DrdynvcServerContext* context); diff --git a/include/freerdp/server/echo.h b/include/freerdp/server/echo.h index 776fbfd19..34e6aa29e 100644 --- a/include/freerdp/server/echo.h +++ b/include/freerdp/server/echo.h @@ -24,72 +24,72 @@ #include -typedef enum ECHO_SERVER_OPEN_RESULT -{ - ECHO_SERVER_OPEN_RESULT_OK = 0, - ECHO_SERVER_OPEN_RESULT_CLOSED = 1, - ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, - ECHO_SERVER_OPEN_RESULT_ERROR = 3 -} ECHO_SERVER_OPEN_RESULT; - -typedef struct s_echo_server_context echo_server_context; - -typedef BOOL (*psEchoServerChannelIdAssigned)(echo_server_context* context, UINT32 channelId); - -typedef UINT (*psEchoServerOpen)(echo_server_context* context); -typedef UINT (*psEchoServerClose)(echo_server_context* context); -typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, - UINT32 length); - -typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, - ECHO_SERVER_OPEN_RESULT result); -typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, - UINT32 length); - -struct s_echo_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* data; - - /*** APIs called by the server. ***/ - /** - * Open the echo channel. - */ - psEchoServerOpen Open; - /** - * Close the echo channel. - */ - psEchoServerClose Close; - /** - * Send echo request PDU. - */ - psEchoServerRequest Request; - - /*** Callbacks registered by the server. ***/ - /** - * Indicate whether the channel is opened successfully. - */ - psEchoServerOpenResult OpenResult; - /** - * Receive echo response PDU. - */ - psEchoServerResponse Response; - - rdpContext* rdpcontext; - - /** - * Callback, when the channel got its id assigned. - */ - psEchoServerChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef enum ECHO_SERVER_OPEN_RESULT + { + ECHO_SERVER_OPEN_RESULT_OK = 0, + ECHO_SERVER_OPEN_RESULT_CLOSED = 1, + ECHO_SERVER_OPEN_RESULT_NOTSUPPORTED = 2, + ECHO_SERVER_OPEN_RESULT_ERROR = 3 + } ECHO_SERVER_OPEN_RESULT; + + typedef struct s_echo_server_context echo_server_context; + + typedef BOOL (*psEchoServerChannelIdAssigned)(echo_server_context* context, UINT32 channelId); + + typedef UINT (*psEchoServerOpen)(echo_server_context* context); + typedef UINT (*psEchoServerClose)(echo_server_context* context); + typedef BOOL (*psEchoServerRequest)(echo_server_context* context, const BYTE* buffer, + UINT32 length); + + typedef UINT (*psEchoServerOpenResult)(echo_server_context* context, + ECHO_SERVER_OPEN_RESULT result); + typedef UINT (*psEchoServerResponse)(echo_server_context* context, const BYTE* buffer, + UINT32 length); + + struct s_echo_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* data; + + /*** APIs called by the server. ***/ + /** + * Open the echo channel. + */ + psEchoServerOpen Open; + /** + * Close the echo channel. + */ + psEchoServerClose Close; + /** + * Send echo request PDU. + */ + psEchoServerRequest Request; + + /*** Callbacks registered by the server. ***/ + /** + * Indicate whether the channel is opened successfully. + */ + psEchoServerOpenResult OpenResult; + /** + * Receive echo response PDU. + */ + psEchoServerResponse Response; + + rdpContext* rdpcontext; + + /** + * Callback, when the channel got its id assigned. + */ + psEchoServerChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API echo_server_context* echo_server_context_new(HANDLE vcm); FREERDP_API void echo_server_context_free(echo_server_context* context); diff --git a/include/freerdp/server/encomsp.h b/include/freerdp/server/encomsp.h index 489edd0c4..ef20fe154 100644 --- a/include/freerdp/server/encomsp.h +++ b/include/freerdp/server/encomsp.h @@ -28,70 +28,70 @@ #include -/** - * Server Interface - */ - -typedef struct s_encomsp_server_context EncomspServerContext; -typedef struct s_encomsp_server_private EncomspServerPrivate; - -typedef UINT (*psEncomspStart)(EncomspServerContext* context); -typedef UINT (*psEncomspStop)(EncomspServerContext* context); - -typedef UINT (*psEncomspFilterUpdated)(EncomspServerContext* context, - ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef UINT (*psEncomspApplicationCreated)(EncomspServerContext* context, - ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef UINT (*psEncomspApplicationRemoved)(EncomspServerContext* context, - ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef UINT (*psEncomspWindowCreated)(EncomspServerContext* context, - ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef UINT (*psEncomspWindowRemoved)(EncomspServerContext* context, - ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef UINT (*psEncomspShowWindow)(EncomspServerContext* context, - ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef UINT (*psEncomspParticipantCreated)(EncomspServerContext* context, - ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef UINT (*psEncomspParticipantRemoved)(EncomspServerContext* context, - ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef UINT (*psEncomspChangeParticipantControlLevel)( - EncomspServerContext* context, - ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef UINT (*psEncomspGraphicsStreamPaused)( - EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef UINT (*psEncomspGraphicsStreamResumed)( - EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); - -struct s_encomsp_server_context -{ - HANDLE vcm; - void* custom; - - psEncomspStart Start; - psEncomspStop Stop; - - psEncomspFilterUpdated FilterUpdated; - psEncomspApplicationCreated ApplicationCreated; - psEncomspApplicationRemoved ApplicationRemoved; - psEncomspWindowCreated WindowCreated; - psEncomspWindowRemoved WindowRemoved; - psEncomspShowWindow ShowWindow; - psEncomspParticipantCreated ParticipantCreated; - psEncomspParticipantRemoved ParticipantRemoved; - psEncomspChangeParticipantControlLevel ChangeParticipantControlLevel; - psEncomspGraphicsStreamPaused GraphicsStreamPaused; - psEncomspGraphicsStreamResumed GraphicsStreamResumed; - - EncomspServerPrivate* priv; - - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Server Interface + */ + + typedef struct s_encomsp_server_context EncomspServerContext; + typedef struct s_encomsp_server_private EncomspServerPrivate; + + typedef UINT (*psEncomspStart)(EncomspServerContext* context); + typedef UINT (*psEncomspStop)(EncomspServerContext* context); + + typedef UINT (*psEncomspFilterUpdated)(EncomspServerContext* context, + ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); + typedef UINT (*psEncomspApplicationCreated)( + EncomspServerContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); + typedef UINT (*psEncomspApplicationRemoved)( + EncomspServerContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); + typedef UINT (*psEncomspWindowCreated)(EncomspServerContext* context, + ENCOMSP_WINDOW_CREATED_PDU* windowCreated); + typedef UINT (*psEncomspWindowRemoved)(EncomspServerContext* context, + ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); + typedef UINT (*psEncomspShowWindow)(EncomspServerContext* context, + ENCOMSP_SHOW_WINDOW_PDU* showWindow); + typedef UINT (*psEncomspParticipantCreated)( + EncomspServerContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); + typedef UINT (*psEncomspParticipantRemoved)( + EncomspServerContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); + typedef UINT (*psEncomspChangeParticipantControlLevel)( + EncomspServerContext* context, + ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); + typedef UINT (*psEncomspGraphicsStreamPaused)( + EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); + typedef UINT (*psEncomspGraphicsStreamResumed)( + EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); + + struct s_encomsp_server_context + { + HANDLE vcm; + void* custom; + + psEncomspStart Start; + psEncomspStop Stop; + + psEncomspFilterUpdated FilterUpdated; + psEncomspApplicationCreated ApplicationCreated; + psEncomspApplicationRemoved ApplicationRemoved; + psEncomspWindowCreated WindowCreated; + psEncomspWindowRemoved WindowRemoved; + psEncomspShowWindow ShowWindow; + psEncomspParticipantCreated ParticipantCreated; + psEncomspParticipantRemoved ParticipantRemoved; + psEncomspChangeParticipantControlLevel ChangeParticipantControlLevel; + psEncomspGraphicsStreamPaused GraphicsStreamPaused; + psEncomspGraphicsStreamResumed GraphicsStreamResumed; + + EncomspServerPrivate* priv; + + rdpContext* rdpcontext; + }; + FREERDP_API EncomspServerContext* encomsp_server_context_new(HANDLE vcm); FREERDP_API void encomsp_server_context_free(EncomspServerContext* context); diff --git a/include/freerdp/server/gfxredir.h b/include/freerdp/server/gfxredir.h index e5c672514..cc4167582 100644 --- a/include/freerdp/server/gfxredir.h +++ b/include/freerdp/server/gfxredir.h @@ -26,72 +26,73 @@ #include #include -typedef struct s_gfxredir_server_private GfxRedirServerPrivate; -typedef struct s_gfxredir_server_context GfxRedirServerContext; - -typedef UINT (*psGfxRedirOpen)(GfxRedirServerContext* context); -typedef UINT (*psGfxRedirClose)(GfxRedirServerContext* context); - -typedef UINT (*psGfxRedirError)(GfxRedirServerContext* context, const GFXREDIR_ERROR_PDU* error); - -typedef UINT (*psGfxRedirGraphicsRedirectionLegacyCaps)( - GfxRedirServerContext* context, const GFXREDIR_LEGACY_CAPS_PDU* graphicsCaps); - -typedef UINT (*psGfxRedirGraphicsRedirectionCapsAdvertise)( - GfxRedirServerContext* context, const GFXREDIR_CAPS_ADVERTISE_PDU* graphicsCapsAdvertise); -typedef UINT (*psGfxRedirGraphicsRedirectionCapsConfirm)( - GfxRedirServerContext* context, const GFXREDIR_CAPS_CONFIRM_PDU* graphicsCapsConfirm); - -typedef UINT (*psGfxRedirOpenPool)(GfxRedirServerContext* context, - const GFXREDIR_OPEN_POOL_PDU* openPool); -typedef UINT (*psGfxRedirClosePool)(GfxRedirServerContext* context, - const GFXREDIR_CLOSE_POOL_PDU* closePool); - -typedef UINT (*psGfxRedirCreateBuffer)(GfxRedirServerContext* context, - const GFXREDIR_CREATE_BUFFER_PDU* createBuffer); -typedef UINT (*psGfxRedirDestroyBuffer)(GfxRedirServerContext* context, - const GFXREDIR_DESTROY_BUFFER_PDU* destroyBuffer); - -typedef UINT (*psGfxRedirPresentBuffer)(GfxRedirServerContext* context, - const GFXREDIR_PRESENT_BUFFER_PDU* presentBuffer); -typedef UINT (*psGfxRedirPresentBufferAck)(GfxRedirServerContext* context, - const GFXREDIR_PRESENT_BUFFER_ACK_PDU* presentBufferAck); - -struct s_gfxredir_server_context -{ - void* custom; - HANDLE vcm; - - psGfxRedirOpen Open; - psGfxRedirClose Close; - - psGfxRedirError Error; - - psGfxRedirGraphicsRedirectionLegacyCaps GraphicsRedirectionLegacyCaps; - - psGfxRedirGraphicsRedirectionCapsAdvertise GraphicsRedirectionCapsAdvertise; - psGfxRedirGraphicsRedirectionCapsConfirm GraphicsRedirectionCapsConfirm; - - psGfxRedirOpenPool OpenPool; - psGfxRedirClosePool ClosePool; - - psGfxRedirCreateBuffer CreateBuffer; - psGfxRedirDestroyBuffer DestroyBuffer; - - psGfxRedirPresentBuffer PresentBuffer; - psGfxRedirPresentBufferAck PresentBufferAck; - - GfxRedirServerPrivate* priv; - rdpContext* rdpcontext; - - UINT32 confirmedCapsVersion; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_gfxredir_server_private GfxRedirServerPrivate; + typedef struct s_gfxredir_server_context GfxRedirServerContext; + + typedef UINT (*psGfxRedirOpen)(GfxRedirServerContext* context); + typedef UINT (*psGfxRedirClose)(GfxRedirServerContext* context); + + typedef UINT (*psGfxRedirError)(GfxRedirServerContext* context, + const GFXREDIR_ERROR_PDU* error); + + typedef UINT (*psGfxRedirGraphicsRedirectionLegacyCaps)( + GfxRedirServerContext* context, const GFXREDIR_LEGACY_CAPS_PDU* graphicsCaps); + + typedef UINT (*psGfxRedirGraphicsRedirectionCapsAdvertise)( + GfxRedirServerContext* context, const GFXREDIR_CAPS_ADVERTISE_PDU* graphicsCapsAdvertise); + typedef UINT (*psGfxRedirGraphicsRedirectionCapsConfirm)( + GfxRedirServerContext* context, const GFXREDIR_CAPS_CONFIRM_PDU* graphicsCapsConfirm); + + typedef UINT (*psGfxRedirOpenPool)(GfxRedirServerContext* context, + const GFXREDIR_OPEN_POOL_PDU* openPool); + typedef UINT (*psGfxRedirClosePool)(GfxRedirServerContext* context, + const GFXREDIR_CLOSE_POOL_PDU* closePool); + + typedef UINT (*psGfxRedirCreateBuffer)(GfxRedirServerContext* context, + const GFXREDIR_CREATE_BUFFER_PDU* createBuffer); + typedef UINT (*psGfxRedirDestroyBuffer)(GfxRedirServerContext* context, + const GFXREDIR_DESTROY_BUFFER_PDU* destroyBuffer); + + typedef UINT (*psGfxRedirPresentBuffer)(GfxRedirServerContext* context, + const GFXREDIR_PRESENT_BUFFER_PDU* presentBuffer); + typedef UINT (*psGfxRedirPresentBufferAck)( + GfxRedirServerContext* context, const GFXREDIR_PRESENT_BUFFER_ACK_PDU* presentBufferAck); + + struct s_gfxredir_server_context + { + void* custom; + HANDLE vcm; + + psGfxRedirOpen Open; + psGfxRedirClose Close; + + psGfxRedirError Error; + + psGfxRedirGraphicsRedirectionLegacyCaps GraphicsRedirectionLegacyCaps; + + psGfxRedirGraphicsRedirectionCapsAdvertise GraphicsRedirectionCapsAdvertise; + psGfxRedirGraphicsRedirectionCapsConfirm GraphicsRedirectionCapsConfirm; + + psGfxRedirOpenPool OpenPool; + psGfxRedirClosePool ClosePool; + + psGfxRedirCreateBuffer CreateBuffer; + psGfxRedirDestroyBuffer DestroyBuffer; + + psGfxRedirPresentBuffer PresentBuffer; + psGfxRedirPresentBufferAck PresentBufferAck; + + GfxRedirServerPrivate* priv; + rdpContext* rdpcontext; + + UINT32 confirmedCapsVersion; + }; + FREERDP_API GfxRedirServerContext* gfxredir_server_context_new(HANDLE vcm); FREERDP_API void gfxredir_server_context_free(GfxRedirServerContext* context); diff --git a/include/freerdp/server/proxy/proxy_config.h b/include/freerdp/server/proxy/proxy_config.h index f6e46323d..bafa813ef 100644 --- a/include/freerdp/server/proxy/proxy_config.h +++ b/include/freerdp/server/proxy/proxy_config.h @@ -26,89 +26,89 @@ #include #include -typedef struct proxy_config proxyConfig; - -struct proxy_config -{ - /* server */ - char* Host; - UINT16 Port; - - /* target */ - BOOL FixedTarget; - char* TargetHost; - UINT16 TargetPort; - char* TargetUser; - char* TargetDomain; - char* TargetPassword; - - /* input */ - BOOL Keyboard; - BOOL Mouse; - BOOL Multitouch; - - /* server security */ - BOOL ServerTlsSecurity; - BOOL ServerRdpSecurity; - BOOL ServerNlaSecurity; - - /* client security */ - BOOL ClientNlaSecurity; - BOOL ClientTlsSecurity; - BOOL ClientRdpSecurity; - BOOL ClientAllowFallbackToTls; - - /* channels */ - BOOL GFX; - BOOL DisplayControl; - BOOL Clipboard; - BOOL AudioOutput; - BOOL AudioInput; - BOOL RemoteApp; - BOOL DeviceRedirection; - BOOL VideoRedirection; - BOOL CameraRedirection; - - BOOL PassthroughIsBlacklist; - char** Passthrough; - size_t PassthroughCount; - char** Intercept; - size_t InterceptCount; - - /* clipboard specific settings */ - BOOL TextOnly; - UINT32 MaxTextLength; - - /* gfx settings */ - BOOL DecodeGFX; - - /* modules */ - char** Modules; /* module file names to load */ - size_t ModulesCount; - - char** RequiredPlugins; /* required plugin names */ - size_t RequiredPluginsCount; - - char* CertificateFile; - char* CertificateContent; - - char* PrivateKeyFile; - char* PrivateKeyContent; - - /* Data extracted from CertificateContent or CertificateFile (evaluation in this order) */ - char* CertificatePEM; - size_t CertificatePEMLength; - - /* Data extracted from PrivateKeyContent or PrivateKeyFile (evaluation in this order) */ - char* PrivateKeyPEM; - size_t PrivateKeyPEMLength; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct proxy_config proxyConfig; + + struct proxy_config + { + /* server */ + char* Host; + UINT16 Port; + + /* target */ + BOOL FixedTarget; + char* TargetHost; + UINT16 TargetPort; + char* TargetUser; + char* TargetDomain; + char* TargetPassword; + + /* input */ + BOOL Keyboard; + BOOL Mouse; + BOOL Multitouch; + + /* server security */ + BOOL ServerTlsSecurity; + BOOL ServerRdpSecurity; + BOOL ServerNlaSecurity; + + /* client security */ + BOOL ClientNlaSecurity; + BOOL ClientTlsSecurity; + BOOL ClientRdpSecurity; + BOOL ClientAllowFallbackToTls; + + /* channels */ + BOOL GFX; + BOOL DisplayControl; + BOOL Clipboard; + BOOL AudioOutput; + BOOL AudioInput; + BOOL RemoteApp; + BOOL DeviceRedirection; + BOOL VideoRedirection; + BOOL CameraRedirection; + + BOOL PassthroughIsBlacklist; + char** Passthrough; + size_t PassthroughCount; + char** Intercept; + size_t InterceptCount; + + /* clipboard specific settings */ + BOOL TextOnly; + UINT32 MaxTextLength; + + /* gfx settings */ + BOOL DecodeGFX; + + /* modules */ + char** Modules; /* module file names to load */ + size_t ModulesCount; + + char** RequiredPlugins; /* required plugin names */ + size_t RequiredPluginsCount; + + char* CertificateFile; + char* CertificateContent; + + char* PrivateKeyFile; + char* PrivateKeyContent; + + /* Data extracted from CertificateContent or CertificateFile (evaluation in this order) */ + char* CertificatePEM; + size_t CertificatePEMLength; + + /* Data extracted from PrivateKeyContent or PrivateKeyFile (evaluation in this order) */ + char* PrivateKeyPEM; + size_t PrivateKeyPEMLength; + }; + /** * @brief pf_server_config_dump Dumps a default INI configuration file * @param file The file to write to. Existing files are truncated. diff --git a/include/freerdp/server/proxy/proxy_server.h b/include/freerdp/server/proxy/proxy_server.h index 740aa74f3..184330727 100644 --- a/include/freerdp/server/proxy/proxy_server.h +++ b/include/freerdp/server/proxy/proxy_server.h @@ -24,13 +24,13 @@ #include #include -typedef struct proxy_server proxyServer; - #ifdef __cplusplus extern "C" { #endif + typedef struct proxy_server proxyServer; + /** * @brief pf_server_new Creates a new proxy server instance * diff --git a/include/freerdp/server/proxy/proxy_types.h b/include/freerdp/server/proxy/proxy_types.h index 756164ec3..98ee4b16f 100644 --- a/include/freerdp/server/proxy/proxy_types.h +++ b/include/freerdp/server/proxy/proxy_types.h @@ -21,28 +21,37 @@ #ifndef FREERDP_SERVER_PROXY_TYPES_H #define FREERDP_SERVER_PROXY_TYPES_H -/** @brief how is handled a channel */ -typedef enum +#ifdef __cplusplus +extern "C" { - PF_UTILS_CHANNEL_NOT_HANDLED, /*!< channel not handled */ - PF_UTILS_CHANNEL_BLOCK, /*!< block and drop traffic on this channel */ - PF_UTILS_CHANNEL_PASSTHROUGH, /*!< pass traffic from this channel */ - PF_UTILS_CHANNEL_INTERCEPT /*!< inspect traffic from this channel */ -} pf_utils_channel_mode; +#endif -/** @brief result of a channel treatment */ -typedef enum -{ - PF_CHANNEL_RESULT_PASS, /*!< pass the packet as is */ - PF_CHANNEL_RESULT_DROP, /*!< drop the packet */ - PF_CHANNEL_RESULT_ERROR /*!< error during packet treatment */ -} PfChannelResult; -typedef enum -{ - PROXY_FETCH_TARGET_METHOD_DEFAULT, - PROXY_FETCH_TARGET_METHOD_CONFIG, - PROXY_FETCH_TARGET_METHOD_LOAD_BALANCE_INFO, - PROXY_FETCH_TARGET_USE_CUSTOM_ADDR -} ProxyFetchTargetMethod; + /** @brief how is handled a channel */ + typedef enum + { + PF_UTILS_CHANNEL_NOT_HANDLED, /*!< channel not handled */ + PF_UTILS_CHANNEL_BLOCK, /*!< block and drop traffic on this channel */ + PF_UTILS_CHANNEL_PASSTHROUGH, /*!< pass traffic from this channel */ + PF_UTILS_CHANNEL_INTERCEPT /*!< inspect traffic from this channel */ + } pf_utils_channel_mode; + + /** @brief result of a channel treatment */ + typedef enum + { + PF_CHANNEL_RESULT_PASS, /*!< pass the packet as is */ + PF_CHANNEL_RESULT_DROP, /*!< drop the packet */ + PF_CHANNEL_RESULT_ERROR /*!< error during packet treatment */ + } PfChannelResult; + typedef enum + { + PROXY_FETCH_TARGET_METHOD_DEFAULT, + PROXY_FETCH_TARGET_METHOD_CONFIG, + PROXY_FETCH_TARGET_METHOD_LOAD_BALANCE_INFO, + PROXY_FETCH_TARGET_USE_CUSTOM_ADDR + } ProxyFetchTargetMethod; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_SERVER_PROXY_TYPES_H */ diff --git a/include/freerdp/server/rail.h b/include/freerdp/server/rail.h index fdc0f0304..e566d5510 100644 --- a/include/freerdp/server/rail.h +++ b/include/freerdp/server/rail.h @@ -27,117 +27,118 @@ #include #include -typedef struct s_rail_server_context RailServerContext; -typedef struct s_rail_server_private RailServerPrivate; - -typedef UINT (*psRailStart)(RailServerContext* context); -typedef BOOL (*psRailStop)(RailServerContext* context); - -/* Client side callback types */ -typedef UINT (*psRailClientHandshake)(RailServerContext* context, - const RAIL_HANDSHAKE_ORDER* handshake); -typedef UINT (*psRailClientClientStatus)(RailServerContext* context, - const RAIL_CLIENT_STATUS_ORDER* clientStatus); -typedef UINT (*psRailClientExec)(RailServerContext* context, const RAIL_EXEC_ORDER* exec); -typedef UINT (*psRailClientSysparam)(RailServerContext* context, - const RAIL_SYSPARAM_ORDER* sysparam); -typedef UINT (*psRailClientActivate)(RailServerContext* context, - const RAIL_ACTIVATE_ORDER* activate); -typedef UINT (*psRailClientSysmenu)(RailServerContext* context, const RAIL_SYSMENU_ORDER* sysmenu); -typedef UINT (*psRailClientSyscommand)(RailServerContext* context, - const RAIL_SYSCOMMAND_ORDER* syscommand); -typedef UINT (*psRailClientNotifyEvent)(RailServerContext* context, - const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); -typedef UINT (*psRailClientGetAppidReq)(RailServerContext* context, - const RAIL_GET_APPID_REQ_ORDER* getAppidReq); -typedef UINT (*psRailClientWindowMove)(RailServerContext* context, - const RAIL_WINDOW_MOVE_ORDER* windowMove); -typedef UINT (*psRailClientSnapArrange)(RailServerContext* context, - const RAIL_SNAP_ARRANGE* snapArrange); -typedef UINT (*psRailClientLangbarInfo)(RailServerContext* context, - const RAIL_LANGBAR_INFO_ORDER* langbarInfo); -typedef UINT (*psRailClientLanguageImeInfo)(RailServerContext* context, - const RAIL_LANGUAGEIME_INFO_ORDER* languageImeInfo); -typedef UINT (*psRailClientCompartmentInfo)(RailServerContext* context, - const RAIL_COMPARTMENT_INFO_ORDER* compartmentInfo); -typedef UINT (*psRailClientCloak)(RailServerContext* context, const RAIL_CLOAK* cloak); - -/* Server side messages sending methods */ -typedef UINT (*psRailServerHandshake)(RailServerContext* context, - const RAIL_HANDSHAKE_ORDER* handshake); -typedef UINT (*psRailServerHandshakeEx)(RailServerContext* context, - const RAIL_HANDSHAKE_EX_ORDER* handshakeEx); -typedef UINT (*psRailServerSysparam)(RailServerContext* context, - const RAIL_SYSPARAM_ORDER* sysparam); -typedef UINT (*psRailServerLocalMoveSize)(RailServerContext* context, - const RAIL_LOCALMOVESIZE_ORDER* localMoveSize); -typedef UINT (*psRailServerMinMaxInfo)(RailServerContext* context, - const RAIL_MINMAXINFO_ORDER* minMaxInfo); -typedef UINT (*psRailServerTaskbarInfo)(RailServerContext* context, - const RAIL_TASKBAR_INFO_ORDER* taskbarInfo); -typedef UINT (*psRailServerLangbarInfo)(RailServerContext* context, - const RAIL_LANGBAR_INFO_ORDER* langbarInfo); -typedef UINT (*psRailServerExecResult)(RailServerContext* context, - const RAIL_EXEC_RESULT_ORDER* execResult); -typedef UINT (*psRailServerGetAppidResp)(RailServerContext* context, - const RAIL_GET_APPID_RESP_ORDER* getAppIdResp); -typedef UINT (*psRailServerZOrderSync)(RailServerContext* context, - const RAIL_ZORDER_SYNC* zOrderSync); -typedef UINT (*psRailServerCloak)(RailServerContext* context, const RAIL_CLOAK* cloak); -typedef UINT (*psRailServerPowerDisplayRequest)( - RailServerContext* context, const RAIL_POWER_DISPLAY_REQUEST* PowerDisplayRequest); -typedef UINT (*psRailServerGetAppidRespEx)(RailServerContext* context, - const RAIL_GET_APPID_RESP_EX* GetAppidRespEx); - -struct s_rail_server_context -{ - HANDLE vcm; - void* custom; - - psRailStart Start; - psRailStop Stop; - - /* Callbacks from client */ - psRailClientHandshake ClientHandshake; - psRailClientClientStatus ClientClientStatus; - psRailClientExec ClientExec; - psRailClientSysparam ClientSysparam; - psRailClientActivate ClientActivate; - psRailClientSysmenu ClientSysmenu; - psRailClientSyscommand ClientSyscommand; - psRailClientNotifyEvent ClientNotifyEvent; - psRailClientGetAppidReq ClientGetAppidReq; - psRailClientWindowMove ClientWindowMove; - psRailClientSnapArrange ClientSnapArrange; - psRailClientLangbarInfo ClientLangbarInfo; - psRailClientLanguageImeInfo ClientLanguageImeInfo; - psRailClientCompartmentInfo ClientCompartmentInfo; - psRailClientCloak ClientCloak; - - /* Methods for sending server side messages */ - psRailServerHandshake ServerHandshake; - psRailServerHandshakeEx ServerHandshakeEx; - psRailServerSysparam ServerSysparam; - psRailServerLocalMoveSize ServerLocalMoveSize; - psRailServerMinMaxInfo ServerMinMaxInfo; - psRailServerTaskbarInfo ServerTaskbarInfo; - psRailServerLangbarInfo ServerLangbarInfo; - psRailServerExecResult ServerExecResult; - psRailServerZOrderSync ServerZOrderSync; - psRailServerCloak ServerCloak; - psRailServerPowerDisplayRequest ServerPowerDisplayRequest; - psRailServerGetAppidResp ServerGetAppidResp; - psRailServerGetAppidRespEx ServerGetAppidRespEx; - - RailServerPrivate* priv; - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_rail_server_context RailServerContext; + typedef struct s_rail_server_private RailServerPrivate; + + typedef UINT (*psRailStart)(RailServerContext* context); + typedef BOOL (*psRailStop)(RailServerContext* context); + + /* Client side callback types */ + typedef UINT (*psRailClientHandshake)(RailServerContext* context, + const RAIL_HANDSHAKE_ORDER* handshake); + typedef UINT (*psRailClientClientStatus)(RailServerContext* context, + const RAIL_CLIENT_STATUS_ORDER* clientStatus); + typedef UINT (*psRailClientExec)(RailServerContext* context, const RAIL_EXEC_ORDER* exec); + typedef UINT (*psRailClientSysparam)(RailServerContext* context, + const RAIL_SYSPARAM_ORDER* sysparam); + typedef UINT (*psRailClientActivate)(RailServerContext* context, + const RAIL_ACTIVATE_ORDER* activate); + typedef UINT (*psRailClientSysmenu)(RailServerContext* context, + const RAIL_SYSMENU_ORDER* sysmenu); + typedef UINT (*psRailClientSyscommand)(RailServerContext* context, + const RAIL_SYSCOMMAND_ORDER* syscommand); + typedef UINT (*psRailClientNotifyEvent)(RailServerContext* context, + const RAIL_NOTIFY_EVENT_ORDER* notifyEvent); + typedef UINT (*psRailClientGetAppidReq)(RailServerContext* context, + const RAIL_GET_APPID_REQ_ORDER* getAppidReq); + typedef UINT (*psRailClientWindowMove)(RailServerContext* context, + const RAIL_WINDOW_MOVE_ORDER* windowMove); + typedef UINT (*psRailClientSnapArrange)(RailServerContext* context, + const RAIL_SNAP_ARRANGE* snapArrange); + typedef UINT (*psRailClientLangbarInfo)(RailServerContext* context, + const RAIL_LANGBAR_INFO_ORDER* langbarInfo); + typedef UINT (*psRailClientLanguageImeInfo)(RailServerContext* context, + const RAIL_LANGUAGEIME_INFO_ORDER* languageImeInfo); + typedef UINT (*psRailClientCompartmentInfo)(RailServerContext* context, + const RAIL_COMPARTMENT_INFO_ORDER* compartmentInfo); + typedef UINT (*psRailClientCloak)(RailServerContext* context, const RAIL_CLOAK* cloak); + + /* Server side messages sending methods */ + typedef UINT (*psRailServerHandshake)(RailServerContext* context, + const RAIL_HANDSHAKE_ORDER* handshake); + typedef UINT (*psRailServerHandshakeEx)(RailServerContext* context, + const RAIL_HANDSHAKE_EX_ORDER* handshakeEx); + typedef UINT (*psRailServerSysparam)(RailServerContext* context, + const RAIL_SYSPARAM_ORDER* sysparam); + typedef UINT (*psRailServerLocalMoveSize)(RailServerContext* context, + const RAIL_LOCALMOVESIZE_ORDER* localMoveSize); + typedef UINT (*psRailServerMinMaxInfo)(RailServerContext* context, + const RAIL_MINMAXINFO_ORDER* minMaxInfo); + typedef UINT (*psRailServerTaskbarInfo)(RailServerContext* context, + const RAIL_TASKBAR_INFO_ORDER* taskbarInfo); + typedef UINT (*psRailServerLangbarInfo)(RailServerContext* context, + const RAIL_LANGBAR_INFO_ORDER* langbarInfo); + typedef UINT (*psRailServerExecResult)(RailServerContext* context, + const RAIL_EXEC_RESULT_ORDER* execResult); + typedef UINT (*psRailServerGetAppidResp)(RailServerContext* context, + const RAIL_GET_APPID_RESP_ORDER* getAppIdResp); + typedef UINT (*psRailServerZOrderSync)(RailServerContext* context, + const RAIL_ZORDER_SYNC* zOrderSync); + typedef UINT (*psRailServerCloak)(RailServerContext* context, const RAIL_CLOAK* cloak); + typedef UINT (*psRailServerPowerDisplayRequest)( + RailServerContext* context, const RAIL_POWER_DISPLAY_REQUEST* PowerDisplayRequest); + typedef UINT (*psRailServerGetAppidRespEx)(RailServerContext* context, + const RAIL_GET_APPID_RESP_EX* GetAppidRespEx); + + struct s_rail_server_context + { + HANDLE vcm; + void* custom; + + psRailStart Start; + psRailStop Stop; + + /* Callbacks from client */ + psRailClientHandshake ClientHandshake; + psRailClientClientStatus ClientClientStatus; + psRailClientExec ClientExec; + psRailClientSysparam ClientSysparam; + psRailClientActivate ClientActivate; + psRailClientSysmenu ClientSysmenu; + psRailClientSyscommand ClientSyscommand; + psRailClientNotifyEvent ClientNotifyEvent; + psRailClientGetAppidReq ClientGetAppidReq; + psRailClientWindowMove ClientWindowMove; + psRailClientSnapArrange ClientSnapArrange; + psRailClientLangbarInfo ClientLangbarInfo; + psRailClientLanguageImeInfo ClientLanguageImeInfo; + psRailClientCompartmentInfo ClientCompartmentInfo; + psRailClientCloak ClientCloak; + + /* Methods for sending server side messages */ + psRailServerHandshake ServerHandshake; + psRailServerHandshakeEx ServerHandshakeEx; + psRailServerSysparam ServerSysparam; + psRailServerLocalMoveSize ServerLocalMoveSize; + psRailServerMinMaxInfo ServerMinMaxInfo; + psRailServerTaskbarInfo ServerTaskbarInfo; + psRailServerLangbarInfo ServerLangbarInfo; + psRailServerExecResult ServerExecResult; + psRailServerZOrderSync ServerZOrderSync; + psRailServerCloak ServerCloak; + psRailServerPowerDisplayRequest ServerPowerDisplayRequest; + psRailServerGetAppidResp ServerGetAppidResp; + psRailServerGetAppidRespEx ServerGetAppidRespEx; + + RailServerPrivate* priv; + rdpContext* rdpcontext; + }; + FREERDP_API RailServerContext* rail_server_context_new(HANDLE vcm); FREERDP_API void rail_server_context_free(RailServerContext* context); FREERDP_API UINT rail_server_handle_messages(RailServerContext* context); diff --git a/include/freerdp/server/rdpdr.h b/include/freerdp/server/rdpdr.h index d9b5412f9..88dd0c242 100644 --- a/include/freerdp/server/rdpdr.h +++ b/include/freerdp/server/rdpdr.h @@ -29,18 +29,23 @@ #include #include -/** - * Server Interface - */ - -typedef struct s_rdpdr_server_context RdpdrServerContext; -typedef struct s_rdpdr_server_private RdpdrServerPrivate; - -typedef struct +#ifdef __cplusplus +extern "C" { - UINT16 Component; - UINT16 PacketId; -} RDPDR_HEADER; +#endif + + /** + * Server Interface + */ + + typedef struct s_rdpdr_server_context RdpdrServerContext; + typedef struct s_rdpdr_server_private RdpdrServerPrivate; + + typedef struct + { + UINT16 Component; + UINT16 PacketId; + } RDPDR_HEADER; #ifndef __MINGW32__ typedef struct @@ -210,11 +215,6 @@ struct s_rdpdr_server_context rdpContext* rdpcontext; }; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API RdpdrServerContext* rdpdr_server_context_new(HANDLE vcm); FREERDP_API void rdpdr_server_context_free(RdpdrServerContext* context); diff --git a/include/freerdp/server/rdpecam-enumerator.h b/include/freerdp/server/rdpecam-enumerator.h index 3f1b77069..77bf0b175 100644 --- a/include/freerdp/server/rdpecam-enumerator.h +++ b/include/freerdp/server/rdpecam-enumerator.h @@ -23,107 +23,108 @@ #include #include -typedef struct _cam_dev_enum_server_context CamDevEnumServerContext; - -typedef UINT (*psCamDevEnumServerServerOpen)(CamDevEnumServerContext* context); -typedef UINT (*psCamDevEnumServerServerClose)(CamDevEnumServerContext* context); - -typedef BOOL (*psCamDevEnumServerServerChannelIdAssigned)(CamDevEnumServerContext* context, - UINT32 channelId); - -typedef UINT (*psCamDevEnumServerServerInitialize)(CamDevEnumServerContext* context, - BOOL externalThread); -typedef UINT (*psCamDevEnumServerServerPoll)(CamDevEnumServerContext* context); -typedef BOOL (*psCamDevEnumServerServerChannelHandle)(CamDevEnumServerContext* context, - HANDLE* handle); - -typedef UINT (*psCamDevEnumServerServerSelectVersionRequest)( - CamDevEnumServerContext* context, const CAM_SELECT_VERSION_REQUEST* selectVersionRequest); -typedef UINT (*psCamDevEnumServerServerSelectVersionResponse)( - CamDevEnumServerContext* context, const CAM_SELECT_VERSION_RESPONSE* selectVersionResponse); - -typedef UINT (*psCamDevEnumServerServerDeviceAddedNotification)( - CamDevEnumServerContext* context, const CAM_DEVICE_ADDED_NOTIFICATION* deviceAddedNotification); -typedef UINT (*psCamDevEnumServerServerDeviceRemovedNotification)( - CamDevEnumServerContext* context, - const CAM_DEVICE_REMOVED_NOTIFICATION* deviceRemovedNotification); - -struct _cam_dev_enum_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* userdata; - - /*** APIs called by the server. ***/ - - /** - * Optional: Set thread handling. - * When externalThread=TRUE, the application is responsible to call - * Poll() periodically to process channel events. - * - * Defaults to externalThread=FALSE - */ - psCamDevEnumServerServerInitialize Initialize; - - /** - * Open the camera device enumerator channel. - */ - psCamDevEnumServerServerOpen Open; - - /** - * Close the camera device enumerator channel. - */ - psCamDevEnumServerServerClose Close; - - /** - * Poll - * When externalThread=TRUE, call Poll() periodically from your main loop. - * If externalThread=FALSE do not call. - */ - psCamDevEnumServerServerPoll Poll; - - /** - * Retrieve the channel handle for use in conjunction with Poll(). - * If externalThread=FALSE do not call. - */ - psCamDevEnumServerServerChannelHandle ChannelHandle; - - /* - * Send a Select Version Response PDU. - */ - psCamDevEnumServerServerSelectVersionResponse SelectVersionResponse; - - /*** Callbacks registered by the server. ***/ - - /** - * Callback, when the channel got its id assigned. - */ - psCamDevEnumServerServerChannelIdAssigned ChannelIdAssigned; - - /** - * Callback for the Select Version Request PDU. - */ - psCamDevEnumServerServerSelectVersionRequest SelectVersionRequest; - - /** - * Callback for the Device Added Notification PDU. - */ - psCamDevEnumServerServerDeviceAddedNotification DeviceAddedNotification; - - /** - * Callback for the Device Removed Notification PDU. - */ - psCamDevEnumServerServerDeviceRemovedNotification DeviceRemovedNotification; - - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct _cam_dev_enum_server_context CamDevEnumServerContext; + + typedef UINT (*psCamDevEnumServerServerOpen)(CamDevEnumServerContext* context); + typedef UINT (*psCamDevEnumServerServerClose)(CamDevEnumServerContext* context); + + typedef BOOL (*psCamDevEnumServerServerChannelIdAssigned)(CamDevEnumServerContext* context, + UINT32 channelId); + + typedef UINT (*psCamDevEnumServerServerInitialize)(CamDevEnumServerContext* context, + BOOL externalThread); + typedef UINT (*psCamDevEnumServerServerPoll)(CamDevEnumServerContext* context); + typedef BOOL (*psCamDevEnumServerServerChannelHandle)(CamDevEnumServerContext* context, + HANDLE* handle); + + typedef UINT (*psCamDevEnumServerServerSelectVersionRequest)( + CamDevEnumServerContext* context, const CAM_SELECT_VERSION_REQUEST* selectVersionRequest); + typedef UINT (*psCamDevEnumServerServerSelectVersionResponse)( + CamDevEnumServerContext* context, const CAM_SELECT_VERSION_RESPONSE* selectVersionResponse); + + typedef UINT (*psCamDevEnumServerServerDeviceAddedNotification)( + CamDevEnumServerContext* context, + const CAM_DEVICE_ADDED_NOTIFICATION* deviceAddedNotification); + typedef UINT (*psCamDevEnumServerServerDeviceRemovedNotification)( + CamDevEnumServerContext* context, + const CAM_DEVICE_REMOVED_NOTIFICATION* deviceRemovedNotification); + + struct _cam_dev_enum_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* userdata; + + /*** APIs called by the server. ***/ + + /** + * Optional: Set thread handling. + * When externalThread=TRUE, the application is responsible to call + * Poll() periodically to process channel events. + * + * Defaults to externalThread=FALSE + */ + psCamDevEnumServerServerInitialize Initialize; + + /** + * Open the camera device enumerator channel. + */ + psCamDevEnumServerServerOpen Open; + + /** + * Close the camera device enumerator channel. + */ + psCamDevEnumServerServerClose Close; + + /** + * Poll + * When externalThread=TRUE, call Poll() periodically from your main loop. + * If externalThread=FALSE do not call. + */ + psCamDevEnumServerServerPoll Poll; + + /** + * Retrieve the channel handle for use in conjunction with Poll(). + * If externalThread=FALSE do not call. + */ + psCamDevEnumServerServerChannelHandle ChannelHandle; + + /* + * Send a Select Version Response PDU. + */ + psCamDevEnumServerServerSelectVersionResponse SelectVersionResponse; + + /*** Callbacks registered by the server. ***/ + + /** + * Callback, when the channel got its id assigned. + */ + psCamDevEnumServerServerChannelIdAssigned ChannelIdAssigned; + + /** + * Callback for the Select Version Request PDU. + */ + psCamDevEnumServerServerSelectVersionRequest SelectVersionRequest; + + /** + * Callback for the Device Added Notification PDU. + */ + psCamDevEnumServerServerDeviceAddedNotification DeviceAddedNotification; + + /** + * Callback for the Device Removed Notification PDU. + */ + psCamDevEnumServerServerDeviceRemovedNotification DeviceRemovedNotification; + + rdpContext* rdpcontext; + }; + FREERDP_API CamDevEnumServerContext* cam_dev_enum_server_context_new(HANDLE vcm); FREERDP_API void cam_dev_enum_server_context_free(CamDevEnumServerContext* context); diff --git a/include/freerdp/server/rdpecam.h b/include/freerdp/server/rdpecam.h index a28ff8740..43f6eeac2 100644 --- a/include/freerdp/server/rdpecam.h +++ b/include/freerdp/server/rdpecam.h @@ -23,251 +23,255 @@ #include #include -typedef struct camera_device_server_context CameraDeviceServerContext; - -typedef UINT (*psCameraDeviceServerOpen)(CameraDeviceServerContext* context); -typedef UINT (*psCameraDeviceServerClose)(CameraDeviceServerContext* context); - -typedef BOOL (*psCameraDeviceServerChannelIdAssigned)(CameraDeviceServerContext* context, - UINT32 channelId); - -typedef UINT (*psCameraDeviceServerInitialize)(CameraDeviceServerContext* context, - BOOL externalThread); -typedef UINT (*psCameraDeviceServerPoll)(CameraDeviceServerContext* context); -typedef BOOL (*psCameraDeviceServerChannelHandle)(CameraDeviceServerContext* context, - HANDLE* handle); - -typedef UINT (*psCameraDeviceServerSuccessResponse)(CameraDeviceServerContext* context, - const CAM_SUCCESS_RESPONSE* successResponse); -typedef UINT (*psCameraDeviceServerErrorResponse)(CameraDeviceServerContext* context, - const CAM_ERROR_RESPONSE* errorResponse); - -typedef UINT (*psCameraDeviceServerActivateDeviceRequest)( - CameraDeviceServerContext* context, const CAM_ACTIVATE_DEVICE_REQUEST* activateDeviceRequest); -typedef UINT (*psCameraDeviceServerDeactivateDeviceRequest)( - CameraDeviceServerContext* context, - const CAM_DEACTIVATE_DEVICE_REQUEST* deactivateDeviceRequest); - -typedef UINT (*psCameraDeviceServerStreamListRequest)( - CameraDeviceServerContext* context, const CAM_STREAM_LIST_REQUEST* streamListRequest); -typedef UINT (*psCameraDeviceServerStreamListResponse)( - CameraDeviceServerContext* context, const CAM_STREAM_LIST_RESPONSE* streamListResponse); - -typedef UINT (*psCameraDeviceServerMediaTypeListRequest)( - CameraDeviceServerContext* context, const CAM_MEDIA_TYPE_LIST_REQUEST* mediaTypeListRequest); -typedef UINT (*psCameraDeviceServerMediaTypeListResponse)( - CameraDeviceServerContext* context, const CAM_MEDIA_TYPE_LIST_RESPONSE* mediaTypeListResponse); - -typedef UINT (*psCameraDeviceServerCurrentMediaTypeRequest)( - CameraDeviceServerContext* context, - const CAM_CURRENT_MEDIA_TYPE_REQUEST* currentMediaTypeRequest); -typedef UINT (*psCameraDeviceServerCurrentMediaTypeResponse)( - CameraDeviceServerContext* context, - const CAM_CURRENT_MEDIA_TYPE_RESPONSE* currentMediaTypeResponse); - -typedef UINT (*psCameraDeviceServerStartStreamsRequest)( - CameraDeviceServerContext* context, const CAM_START_STREAMS_REQUEST* startStreamsRequest); -typedef UINT (*psCameraDeviceServerStopStreamsRequest)( - CameraDeviceServerContext* context, const CAM_STOP_STREAMS_REQUEST* stopStreamsRequest); - -typedef UINT (*psCameraDeviceServerSampleRequest)(CameraDeviceServerContext* context, - const CAM_SAMPLE_REQUEST* sampleRequest); -typedef UINT (*psCameraDeviceServerSampleResponse)(CameraDeviceServerContext* context, - const CAM_SAMPLE_RESPONSE* sampleResponse); -typedef UINT (*psCameraDeviceServerSampleErrorResponse)( - CameraDeviceServerContext* context, const CAM_SAMPLE_ERROR_RESPONSE* sampleErrorResponse); - -typedef UINT (*psCameraDeviceServerPropertyListRequest)( - CameraDeviceServerContext* context, const CAM_PROPERTY_LIST_REQUEST* propertyListRequest); -typedef UINT (*psCameraDeviceServerPropertyListResponse)( - CameraDeviceServerContext* context, const CAM_PROPERTY_LIST_RESPONSE* propertyListResponse); - -typedef UINT (*psCameraDeviceServerPropertyValueRequest)( - CameraDeviceServerContext* context, const CAM_PROPERTY_VALUE_REQUEST* propertyValueRequest); -typedef UINT (*psCameraDeviceServerPropertyValueResponse)( - CameraDeviceServerContext* context, const CAM_PROPERTY_VALUE_RESPONSE* propertyValueResponse); - -typedef UINT (*psCameraDeviceServerSetPropertyValueRequest)( - CameraDeviceServerContext* context, - const CAM_SET_PROPERTY_VALUE_REQUEST* setPropertyValueRequest); - -struct camera_device_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* userdata; - - /** - * Name of the virtual channel. Pointer owned by the CameraDeviceServerContext, - * meaning camera_device_server_context_free() takes care of freeing the pointer. - * - * Server implementations should sanitize the virtual channel name for invalid - * names, like names for other known channels - * ("ECHO", "AUDIO_PLAYBACK_DVC", etc.) - */ - char* virtualChannelName; - - /** - * Protocol version to be used. Every sent server to client PDU has the - * version value in the Header set to the following value. - */ - BYTE protocolVersion; - - /*** APIs called by the server. ***/ - - /** - * Optional: Set thread handling. - * When externalThread=TRUE, the application is responsible to call - * Poll() periodically to process channel events. - * - * Defaults to externalThread=FALSE - */ - psCameraDeviceServerInitialize Initialize; - - /** - * Open the camera device channel. - */ - psCameraDeviceServerOpen Open; - - /** - * Close the camera device channel. - */ - psCameraDeviceServerClose Close; - - /** - * Poll - * When externalThread=TRUE, call Poll() periodically from your main loop. - * If externalThread=FALSE do not call. - */ - psCameraDeviceServerPoll Poll; - - /** - * Retrieve the channel handle for use in conjunction with Poll(). - * If externalThread=FALSE do not call. - */ - psCameraDeviceServerChannelHandle ChannelHandle; - - /** - * For the following server to client PDUs, - * the message header does not have to be set. - */ - - /** - * Send a Activate Device Request PDU. - */ - psCameraDeviceServerActivateDeviceRequest ActivateDeviceRequest; - - /** - * Send a Deactivate Device Request PDU. - */ - psCameraDeviceServerDeactivateDeviceRequest DeactivateDeviceRequest; - - /** - * Send a Stream List Request PDU. - */ - psCameraDeviceServerStreamListRequest StreamListRequest; - - /** - * Send a Media Type List Request PDU. - */ - psCameraDeviceServerMediaTypeListRequest MediaTypeListRequest; - - /** - * Send a Current Media Type Request PDU. - */ - psCameraDeviceServerCurrentMediaTypeRequest CurrentMediaTypeRequest; - - /** - * Send a Start Streams Request PDU. - */ - psCameraDeviceServerStartStreamsRequest StartStreamsRequest; - - /** - * Send a Stop Streams Request PDU. - */ - psCameraDeviceServerStopStreamsRequest StopStreamsRequest; - - /** - * Send a Sample Request PDU. - */ - psCameraDeviceServerSampleRequest SampleRequest; - - /** - * Send a Property List Request PDU. - */ - psCameraDeviceServerPropertyListRequest PropertyListRequest; - - /** - * Send a Property Value Request PDU. - */ - psCameraDeviceServerPropertyValueRequest PropertyValueRequest; - - /** - * Send a Set Property Value Request PDU. - */ - psCameraDeviceServerSetPropertyValueRequest SetPropertyValueRequest; - - /*** Callbacks registered by the server. ***/ - - /** - * Callback, when the channel got its id assigned. - */ - psCameraDeviceServerChannelIdAssigned ChannelIdAssigned; - - /** - * Callback for the Success Response PDU. - */ - psCameraDeviceServerSuccessResponse SuccessResponse; - - /** - * Callback for the Error Response PDU. - */ - psCameraDeviceServerErrorResponse ErrorResponse; - - /** - * Callback for the Stream List Response PDU. - */ - psCameraDeviceServerStreamListResponse StreamListResponse; - - /** - * Callback for the Media Type List Response PDU. - */ - psCameraDeviceServerMediaTypeListResponse MediaTypeListResponse; - - /** - * Callback for the Current Media Type Response PDU. - */ - psCameraDeviceServerCurrentMediaTypeResponse CurrentMediaTypeResponse; - - /** - * Callback for the Sample Response PDU. - */ - psCameraDeviceServerSampleResponse SampleResponse; - - /** - * Callback for the Sample Error Response PDU. - */ - psCameraDeviceServerSampleErrorResponse SampleErrorResponse; - - /** - * Callback for the Property List Response PDU. - */ - psCameraDeviceServerPropertyListResponse PropertyListResponse; - - /** - * Callback for the Property Value Response PDU. - */ - psCameraDeviceServerPropertyValueResponse PropertyValueResponse; - - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct camera_device_server_context CameraDeviceServerContext; + + typedef UINT (*psCameraDeviceServerOpen)(CameraDeviceServerContext* context); + typedef UINT (*psCameraDeviceServerClose)(CameraDeviceServerContext* context); + + typedef BOOL (*psCameraDeviceServerChannelIdAssigned)(CameraDeviceServerContext* context, + UINT32 channelId); + + typedef UINT (*psCameraDeviceServerInitialize)(CameraDeviceServerContext* context, + BOOL externalThread); + typedef UINT (*psCameraDeviceServerPoll)(CameraDeviceServerContext* context); + typedef BOOL (*psCameraDeviceServerChannelHandle)(CameraDeviceServerContext* context, + HANDLE* handle); + + typedef UINT (*psCameraDeviceServerSuccessResponse)( + CameraDeviceServerContext* context, const CAM_SUCCESS_RESPONSE* successResponse); + typedef UINT (*psCameraDeviceServerErrorResponse)(CameraDeviceServerContext* context, + const CAM_ERROR_RESPONSE* errorResponse); + + typedef UINT (*psCameraDeviceServerActivateDeviceRequest)( + CameraDeviceServerContext* context, + const CAM_ACTIVATE_DEVICE_REQUEST* activateDeviceRequest); + typedef UINT (*psCameraDeviceServerDeactivateDeviceRequest)( + CameraDeviceServerContext* context, + const CAM_DEACTIVATE_DEVICE_REQUEST* deactivateDeviceRequest); + + typedef UINT (*psCameraDeviceServerStreamListRequest)( + CameraDeviceServerContext* context, const CAM_STREAM_LIST_REQUEST* streamListRequest); + typedef UINT (*psCameraDeviceServerStreamListResponse)( + CameraDeviceServerContext* context, const CAM_STREAM_LIST_RESPONSE* streamListResponse); + + typedef UINT (*psCameraDeviceServerMediaTypeListRequest)( + CameraDeviceServerContext* context, + const CAM_MEDIA_TYPE_LIST_REQUEST* mediaTypeListRequest); + typedef UINT (*psCameraDeviceServerMediaTypeListResponse)( + CameraDeviceServerContext* context, + const CAM_MEDIA_TYPE_LIST_RESPONSE* mediaTypeListResponse); + + typedef UINT (*psCameraDeviceServerCurrentMediaTypeRequest)( + CameraDeviceServerContext* context, + const CAM_CURRENT_MEDIA_TYPE_REQUEST* currentMediaTypeRequest); + typedef UINT (*psCameraDeviceServerCurrentMediaTypeResponse)( + CameraDeviceServerContext* context, + const CAM_CURRENT_MEDIA_TYPE_RESPONSE* currentMediaTypeResponse); + + typedef UINT (*psCameraDeviceServerStartStreamsRequest)( + CameraDeviceServerContext* context, const CAM_START_STREAMS_REQUEST* startStreamsRequest); + typedef UINT (*psCameraDeviceServerStopStreamsRequest)( + CameraDeviceServerContext* context, const CAM_STOP_STREAMS_REQUEST* stopStreamsRequest); + + typedef UINT (*psCameraDeviceServerSampleRequest)(CameraDeviceServerContext* context, + const CAM_SAMPLE_REQUEST* sampleRequest); + typedef UINT (*psCameraDeviceServerSampleResponse)(CameraDeviceServerContext* context, + const CAM_SAMPLE_RESPONSE* sampleResponse); + typedef UINT (*psCameraDeviceServerSampleErrorResponse)( + CameraDeviceServerContext* context, const CAM_SAMPLE_ERROR_RESPONSE* sampleErrorResponse); + + typedef UINT (*psCameraDeviceServerPropertyListRequest)( + CameraDeviceServerContext* context, const CAM_PROPERTY_LIST_REQUEST* propertyListRequest); + typedef UINT (*psCameraDeviceServerPropertyListResponse)( + CameraDeviceServerContext* context, const CAM_PROPERTY_LIST_RESPONSE* propertyListResponse); + + typedef UINT (*psCameraDeviceServerPropertyValueRequest)( + CameraDeviceServerContext* context, const CAM_PROPERTY_VALUE_REQUEST* propertyValueRequest); + typedef UINT (*psCameraDeviceServerPropertyValueResponse)( + CameraDeviceServerContext* context, + const CAM_PROPERTY_VALUE_RESPONSE* propertyValueResponse); + + typedef UINT (*psCameraDeviceServerSetPropertyValueRequest)( + CameraDeviceServerContext* context, + const CAM_SET_PROPERTY_VALUE_REQUEST* setPropertyValueRequest); + + struct camera_device_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* userdata; + + /** + * Name of the virtual channel. Pointer owned by the CameraDeviceServerContext, + * meaning camera_device_server_context_free() takes care of freeing the pointer. + * + * Server implementations should sanitize the virtual channel name for invalid + * names, like names for other known channels + * ("ECHO", "AUDIO_PLAYBACK_DVC", etc.) + */ + char* virtualChannelName; + + /** + * Protocol version to be used. Every sent server to client PDU has the + * version value in the Header set to the following value. + */ + BYTE protocolVersion; + + /*** APIs called by the server. ***/ + + /** + * Optional: Set thread handling. + * When externalThread=TRUE, the application is responsible to call + * Poll() periodically to process channel events. + * + * Defaults to externalThread=FALSE + */ + psCameraDeviceServerInitialize Initialize; + + /** + * Open the camera device channel. + */ + psCameraDeviceServerOpen Open; + + /** + * Close the camera device channel. + */ + psCameraDeviceServerClose Close; + + /** + * Poll + * When externalThread=TRUE, call Poll() periodically from your main loop. + * If externalThread=FALSE do not call. + */ + psCameraDeviceServerPoll Poll; + + /** + * Retrieve the channel handle for use in conjunction with Poll(). + * If externalThread=FALSE do not call. + */ + psCameraDeviceServerChannelHandle ChannelHandle; + + /** + * For the following server to client PDUs, + * the message header does not have to be set. + */ + + /** + * Send a Activate Device Request PDU. + */ + psCameraDeviceServerActivateDeviceRequest ActivateDeviceRequest; + + /** + * Send a Deactivate Device Request PDU. + */ + psCameraDeviceServerDeactivateDeviceRequest DeactivateDeviceRequest; + + /** + * Send a Stream List Request PDU. + */ + psCameraDeviceServerStreamListRequest StreamListRequest; + + /** + * Send a Media Type List Request PDU. + */ + psCameraDeviceServerMediaTypeListRequest MediaTypeListRequest; + + /** + * Send a Current Media Type Request PDU. + */ + psCameraDeviceServerCurrentMediaTypeRequest CurrentMediaTypeRequest; + + /** + * Send a Start Streams Request PDU. + */ + psCameraDeviceServerStartStreamsRequest StartStreamsRequest; + + /** + * Send a Stop Streams Request PDU. + */ + psCameraDeviceServerStopStreamsRequest StopStreamsRequest; + + /** + * Send a Sample Request PDU. + */ + psCameraDeviceServerSampleRequest SampleRequest; + + /** + * Send a Property List Request PDU. + */ + psCameraDeviceServerPropertyListRequest PropertyListRequest; + + /** + * Send a Property Value Request PDU. + */ + psCameraDeviceServerPropertyValueRequest PropertyValueRequest; + + /** + * Send a Set Property Value Request PDU. + */ + psCameraDeviceServerSetPropertyValueRequest SetPropertyValueRequest; + + /*** Callbacks registered by the server. ***/ + + /** + * Callback, when the channel got its id assigned. + */ + psCameraDeviceServerChannelIdAssigned ChannelIdAssigned; + + /** + * Callback for the Success Response PDU. + */ + psCameraDeviceServerSuccessResponse SuccessResponse; + + /** + * Callback for the Error Response PDU. + */ + psCameraDeviceServerErrorResponse ErrorResponse; + + /** + * Callback for the Stream List Response PDU. + */ + psCameraDeviceServerStreamListResponse StreamListResponse; + + /** + * Callback for the Media Type List Response PDU. + */ + psCameraDeviceServerMediaTypeListResponse MediaTypeListResponse; + + /** + * Callback for the Current Media Type Response PDU. + */ + psCameraDeviceServerCurrentMediaTypeResponse CurrentMediaTypeResponse; + + /** + * Callback for the Sample Response PDU. + */ + psCameraDeviceServerSampleResponse SampleResponse; + + /** + * Callback for the Sample Error Response PDU. + */ + psCameraDeviceServerSampleErrorResponse SampleErrorResponse; + + /** + * Callback for the Property List Response PDU. + */ + psCameraDeviceServerPropertyListResponse PropertyListResponse; + + /** + * Callback for the Property Value Response PDU. + */ + psCameraDeviceServerPropertyValueResponse PropertyValueResponse; + + rdpContext* rdpcontext; + }; + FREERDP_API CameraDeviceServerContext* camera_device_server_context_new(HANDLE vcm); FREERDP_API void camera_device_server_context_free(CameraDeviceServerContext* context); diff --git a/include/freerdp/server/rdpei.h b/include/freerdp/server/rdpei.h index 63aa709d6..c9dc83bc0 100644 --- a/include/freerdp/server/rdpei.h +++ b/include/freerdp/server/rdpei.h @@ -26,38 +26,38 @@ #include #include -typedef struct s_rdpei_server_context RdpeiServerContext; -typedef struct s_rdpei_server_private RdpeiServerPrivate; - -struct s_rdpei_server_context -{ - HANDLE vcm; - - RdpeiServerPrivate* priv; - - UINT32 clientVersion; - UINT16 maxTouchPoints; - UINT32 protocolFlags; - - /** callbacks that can be set by the user */ - UINT (*onClientReady)(RdpeiServerContext* context); - UINT (*onTouchEvent)(RdpeiServerContext* context, const RDPINPUT_TOUCH_EVENT* touchEvent); - UINT (*onPenEvent)(RdpeiServerContext* context, const RDPINPUT_PEN_EVENT* penEvent); - UINT (*onTouchReleased)(RdpeiServerContext* context, BYTE contactId); - - void* user_data; /* user data, useful for callbacks */ - - /** - * Callback, when the channel got its id assigned. - */ - BOOL (*onChannelIdAssigned)(RdpeiServerContext* context, UINT32 channelId); -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_rdpei_server_context RdpeiServerContext; + typedef struct s_rdpei_server_private RdpeiServerPrivate; + + struct s_rdpei_server_context + { + HANDLE vcm; + + RdpeiServerPrivate* priv; + + UINT32 clientVersion; + UINT16 maxTouchPoints; + UINT32 protocolFlags; + + /** callbacks that can be set by the user */ + UINT (*onClientReady)(RdpeiServerContext* context); + UINT (*onTouchEvent)(RdpeiServerContext* context, const RDPINPUT_TOUCH_EVENT* touchEvent); + UINT (*onPenEvent)(RdpeiServerContext* context, const RDPINPUT_PEN_EVENT* penEvent); + UINT (*onTouchReleased)(RdpeiServerContext* context, BYTE contactId); + + void* user_data; /* user data, useful for callbacks */ + + /** + * Callback, when the channel got its id assigned. + */ + BOOL (*onChannelIdAssigned)(RdpeiServerContext* context, UINT32 channelId); + }; + FREERDP_API RdpeiServerContext* rdpei_server_context_new(HANDLE vcm); FREERDP_API void rdpei_server_context_reset(RdpeiServerContext* context); FREERDP_API void rdpei_server_context_free(RdpeiServerContext* context); diff --git a/include/freerdp/server/rdpgfx.h b/include/freerdp/server/rdpgfx.h index f0fc11762..cd63f5616 100644 --- a/include/freerdp/server/rdpgfx.h +++ b/include/freerdp/server/rdpgfx.h @@ -23,109 +23,112 @@ #include #include -typedef struct s_rdpgfx_server_context RdpgfxServerContext; -typedef struct s_rdpgfx_server_private RdpgfxServerPrivate; - -typedef BOOL (*psRdpgfxServerOpen)(RdpgfxServerContext* context); -typedef BOOL (*psRdpgfxServerClose)(RdpgfxServerContext* context); - -typedef BOOL (*psRdpgfxServerChannelIdAssigned)(RdpgfxServerContext* context, UINT32 channelId); - -typedef UINT (*psRdpgfxResetGraphics)(RdpgfxServerContext* context, - const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); -typedef UINT (*psRdpgfxStartFrame)(RdpgfxServerContext* context, - const RDPGFX_START_FRAME_PDU* startFrame); -typedef UINT (*psRdpgfxEndFrame)(RdpgfxServerContext* context, - const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT (*psRdpgfxSurfaceCommand)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_COMMAND* cmd); -typedef UINT (*psRdpgfxSurfaceFrameCommand)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_COMMAND* cmd, - const RDPGFX_START_FRAME_PDU* startFrame, - const RDPGFX_END_FRAME_PDU* endFrame); -typedef UINT (*psRdpgfxDeleteEncodingContext)( - RdpgfxServerContext* context, const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); -typedef UINT (*psRdpgfxCreateSurface)(RdpgfxServerContext* context, - const RDPGFX_CREATE_SURFACE_PDU* createSurface); -typedef UINT (*psRdpgfxDeleteSurface)(RdpgfxServerContext* context, - const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); -typedef UINT (*psRdpgfxSolidFill)(RdpgfxServerContext* context, - const RDPGFX_SOLID_FILL_PDU* solidFill); -typedef UINT (*psRdpgfxSurfaceToSurface)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); -typedef UINT (*psRdpgfxSurfaceToCache)(RdpgfxServerContext* context, - const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); -typedef UINT (*psRdpgfxCacheToSurface)(RdpgfxServerContext* context, - const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); -typedef UINT (*psRdpgfxCacheImportOffer)(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); -typedef UINT (*psRdpgfxCacheImportReply)(RdpgfxServerContext* context, - const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); -typedef UINT (*psRdpgfxEvictCacheEntry)(RdpgfxServerContext* context, - const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); -typedef UINT (*psRdpgfxMapSurfaceToOutput)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); -typedef UINT (*psRdpgfxMapSurfaceToWindow)(RdpgfxServerContext* context, - const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); -typedef UINT (*psRdpgfxMapSurfaceToScaledOutput)( - RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); -typedef UINT (*psRdpgfxMapSurfaceToScaledWindow)( - RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); -typedef UINT (*psRdpgfxCapsAdvertise)(RdpgfxServerContext* context, - const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); -typedef UINT (*psRdpgfxCapsConfirm)(RdpgfxServerContext* context, - const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); -typedef UINT (*psRdpgfxFrameAcknowledge)(RdpgfxServerContext* context, - const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); -typedef UINT (*psRdpgfxQoeFrameAcknowledge)( - RdpgfxServerContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); - -struct s_rdpgfx_server_context -{ - HANDLE vcm; - void* custom; - - psRdpgfxServerOpen Open; - psRdpgfxServerClose Close; - - psRdpgfxResetGraphics ResetGraphics; - psRdpgfxStartFrame StartFrame; - psRdpgfxEndFrame EndFrame; - psRdpgfxSurfaceCommand SurfaceCommand; - psRdpgfxSurfaceFrameCommand SurfaceFrameCommand; - psRdpgfxDeleteEncodingContext DeleteEncodingContext; - psRdpgfxCreateSurface CreateSurface; - psRdpgfxDeleteSurface DeleteSurface; - psRdpgfxSolidFill SolidFill; - psRdpgfxSurfaceToSurface SurfaceToSurface; - psRdpgfxSurfaceToCache SurfaceToCache; - psRdpgfxCacheToSurface CacheToSurface; - psRdpgfxCacheImportOffer CacheImportOffer; - psRdpgfxCacheImportReply CacheImportReply; - psRdpgfxEvictCacheEntry EvictCacheEntry; - psRdpgfxMapSurfaceToOutput MapSurfaceToOutput; - psRdpgfxMapSurfaceToWindow MapSurfaceToWindow; - psRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput; - psRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow; - psRdpgfxCapsAdvertise CapsAdvertise; - psRdpgfxCapsConfirm CapsConfirm; - psRdpgfxFrameAcknowledge FrameAcknowledge; - psRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge; - - RdpgfxServerPrivate* priv; - rdpContext* rdpcontext; - - /** - * Callback, when the channel got its id assigned. - */ - psRdpgfxServerChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_rdpgfx_server_context RdpgfxServerContext; + typedef struct s_rdpgfx_server_private RdpgfxServerPrivate; + + typedef BOOL (*psRdpgfxServerOpen)(RdpgfxServerContext* context); + typedef BOOL (*psRdpgfxServerClose)(RdpgfxServerContext* context); + + typedef BOOL (*psRdpgfxServerChannelIdAssigned)(RdpgfxServerContext* context, UINT32 channelId); + + typedef UINT (*psRdpgfxResetGraphics)(RdpgfxServerContext* context, + const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); + typedef UINT (*psRdpgfxStartFrame)(RdpgfxServerContext* context, + const RDPGFX_START_FRAME_PDU* startFrame); + typedef UINT (*psRdpgfxEndFrame)(RdpgfxServerContext* context, + const RDPGFX_END_FRAME_PDU* endFrame); + typedef UINT (*psRdpgfxSurfaceCommand)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_COMMAND* cmd); + typedef UINT (*psRdpgfxSurfaceFrameCommand)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_COMMAND* cmd, + const RDPGFX_START_FRAME_PDU* startFrame, + const RDPGFX_END_FRAME_PDU* endFrame); + typedef UINT (*psRdpgfxDeleteEncodingContext)( + RdpgfxServerContext* context, + const RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); + typedef UINT (*psRdpgfxCreateSurface)(RdpgfxServerContext* context, + const RDPGFX_CREATE_SURFACE_PDU* createSurface); + typedef UINT (*psRdpgfxDeleteSurface)(RdpgfxServerContext* context, + const RDPGFX_DELETE_SURFACE_PDU* deleteSurface); + typedef UINT (*psRdpgfxSolidFill)(RdpgfxServerContext* context, + const RDPGFX_SOLID_FILL_PDU* solidFill); + typedef UINT (*psRdpgfxSurfaceToSurface)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); + typedef UINT (*psRdpgfxSurfaceToCache)(RdpgfxServerContext* context, + const RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); + typedef UINT (*psRdpgfxCacheToSurface)(RdpgfxServerContext* context, + const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); + typedef UINT (*psRdpgfxCacheImportOffer)(RdpgfxServerContext* context, + const RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); + typedef UINT (*psRdpgfxCacheImportReply)(RdpgfxServerContext* context, + const RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); + typedef UINT (*psRdpgfxEvictCacheEntry)(RdpgfxServerContext* context, + const RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); + typedef UINT (*psRdpgfxMapSurfaceToOutput)( + RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); + typedef UINT (*psRdpgfxMapSurfaceToWindow)( + RdpgfxServerContext* context, const RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); + typedef UINT (*psRdpgfxMapSurfaceToScaledOutput)( + RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_OUTPUT_PDU* surfaceToOutput); + typedef UINT (*psRdpgfxMapSurfaceToScaledWindow)( + RdpgfxServerContext* context, + const RDPGFX_MAP_SURFACE_TO_SCALED_WINDOW_PDU* surfaceToWindow); + typedef UINT (*psRdpgfxCapsAdvertise)(RdpgfxServerContext* context, + const RDPGFX_CAPS_ADVERTISE_PDU* capsAdvertise); + typedef UINT (*psRdpgfxCapsConfirm)(RdpgfxServerContext* context, + const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm); + typedef UINT (*psRdpgfxFrameAcknowledge)(RdpgfxServerContext* context, + const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge); + typedef UINT (*psRdpgfxQoeFrameAcknowledge)( + RdpgfxServerContext* context, const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge); + + struct s_rdpgfx_server_context + { + HANDLE vcm; + void* custom; + + psRdpgfxServerOpen Open; + psRdpgfxServerClose Close; + + psRdpgfxResetGraphics ResetGraphics; + psRdpgfxStartFrame StartFrame; + psRdpgfxEndFrame EndFrame; + psRdpgfxSurfaceCommand SurfaceCommand; + psRdpgfxSurfaceFrameCommand SurfaceFrameCommand; + psRdpgfxDeleteEncodingContext DeleteEncodingContext; + psRdpgfxCreateSurface CreateSurface; + psRdpgfxDeleteSurface DeleteSurface; + psRdpgfxSolidFill SolidFill; + psRdpgfxSurfaceToSurface SurfaceToSurface; + psRdpgfxSurfaceToCache SurfaceToCache; + psRdpgfxCacheToSurface CacheToSurface; + psRdpgfxCacheImportOffer CacheImportOffer; + psRdpgfxCacheImportReply CacheImportReply; + psRdpgfxEvictCacheEntry EvictCacheEntry; + psRdpgfxMapSurfaceToOutput MapSurfaceToOutput; + psRdpgfxMapSurfaceToWindow MapSurfaceToWindow; + psRdpgfxMapSurfaceToScaledOutput MapSurfaceToScaledOutput; + psRdpgfxMapSurfaceToScaledWindow MapSurfaceToScaledWindow; + psRdpgfxCapsAdvertise CapsAdvertise; + psRdpgfxCapsConfirm CapsConfirm; + psRdpgfxFrameAcknowledge FrameAcknowledge; + psRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge; + + RdpgfxServerPrivate* priv; + rdpContext* rdpcontext; + + /** + * Callback, when the channel got its id assigned. + */ + psRdpgfxServerChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API RdpgfxServerContext* rdpgfx_server_context_new(HANDLE vcm); FREERDP_API void rdpgfx_server_context_free(RdpgfxServerContext* context); FREERDP_API HANDLE rdpgfx_server_get_event_handle(RdpgfxServerContext* context); diff --git a/include/freerdp/server/rdpsnd.h b/include/freerdp/server/rdpsnd.h index 7f312d750..6c8355ca7 100644 --- a/include/freerdp/server/rdpsnd.h +++ b/include/freerdp/server/rdpsnd.h @@ -25,159 +25,160 @@ #include #include -typedef struct s_rdpsnd_server_context RdpsndServerContext; -typedef struct s_rdpsnd_server_context rdpsnd_server_context; -typedef struct s_rdpsnd_server_private RdpsndServerPrivate; - -typedef UINT (*psRdpsndStart)(RdpsndServerContext* context); -typedef UINT (*psRdpsndStop)(RdpsndServerContext* context); - -typedef BOOL (*psRdpsndChannelIdAssigned)(RdpsndServerContext* context, UINT32 channelId); - -typedef UINT (*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); -typedef UINT (*psRdpsndServerSendFormats)(RdpsndServerContext* context); -typedef UINT (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, - UINT16 client_format_index); -typedef UINT (*psRdpsndServerTraining)(RdpsndServerContext* context, UINT16 timestamp, - UINT16 packsize, BYTE* data); -typedef UINT (*psRdpsndServerTrainingConfirm)(RdpsndServerContext* context, UINT16 timestamp, - UINT16 packsize); -typedef UINT (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, - size_t nframes, UINT16 wTimestamp); -typedef UINT (*psRdpsndServerSendSamples2)(RdpsndServerContext* context, UINT16 formatNo, - const void* buf, size_t size, UINT16 timestamp, - UINT32 audioTimeStamp); -typedef UINT (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, - UINT16 wtimestamp); -typedef UINT (*psRdpsndServerSetVolume)(RdpsndServerContext* context, UINT16 left, UINT16 right); -typedef UINT (*psRdpsndServerClose)(RdpsndServerContext* context); - -typedef void (*psRdpsndServerActivated)(RdpsndServerContext* context); - -struct s_rdpsnd_server_context -{ - HANDLE vcm; - - psRdpsndStart Start; - psRdpsndStop Stop; - - RdpsndServerPrivate* priv; - - /* Server self-defined pointer. */ - void* data; - - /* Server to request to use dynamic virtual channel. */ - BOOL use_dynamic_virtual_channel; - - /* Server supported formats. Set by server. */ - AUDIO_FORMAT* server_formats; - size_t num_server_formats; - - /* Server source PCM audio format. Set by server. */ - AUDIO_FORMAT* src_format; - - /* Server audio latency, or buffer size, in milli-seconds. Set by server. */ - UINT32 latency; - - /* Client supported formats. */ - AUDIO_FORMAT* client_formats; - UINT16 num_client_formats; - UINT16 selected_client_format; - - /* Last sent audio block number. */ - UINT8 block_no; - - /*** APIs called by the server. ***/ - /** - * Initialize the channel. The caller should check the return value to see - * whether the initialization succeed. If not, the "Activated" callback - * will not be called and the server must not call any API on this context. - */ - psRdpsndServerInitialize Initialize; - - /** - * Choose the audio format to be sent. The index argument is an index into - * the client_formats array and must be smaller than num_client_formats. - */ - psRdpsndServerSelectFormat SelectFormat; - /** - * Send audio samples. Actually bytes in the buffer must be: - * nframes * src_format.nBitsPerSample * src_format.nChannels / 8 - */ - psRdpsndServerSendSamples SendSamples; - - /** - * Called when block confirm is received from the client - */ - psRdpsndServerConfirmBlock ConfirmBlock; - /** - * Set the volume level of the client. Valid range is between 0 and 0xFFFF. - */ - psRdpsndServerSetVolume SetVolume; - /** - * Close the audio stream. - */ - psRdpsndServerClose Close; - - /*** Callbacks registered by the server. ***/ - /** - * The channel has been activated. The server maybe choose audio format and - * start audio stream from this point. Note that this callback is called - * from a different thread context so the server must be careful of thread - * synchronization. - */ - psRdpsndServerActivated Activated; - - /** - * MS-RDPEA channel version the client announces - */ - UINT16 clientVersion; - - rdpContext* rdpcontext; - - /* dwFlags in CLIENT_AUDIO_VERSION_AND_FORMATS */ - UINT32 capsFlags; - /* dwVolume in CLIENT_AUDIO_VERSION_AND_FORMATS */ - UINT32 initialVolume; - /* dwPitch in CLIENT_AUDIO_VERSION_AND_FORMATS */ - UINT32 initialPitch; - - UINT16 qualityMode; - - /** - * Send server formats and version to the client. Automatically sent, when - * opening the channel. - * Also used to restart the protocol after sending the Close PDU. - */ - psRdpsndServerSendFormats SendFormats; - /** - * Send Training PDU. - */ - psRdpsndServerTraining Training; - - /** - * Send encoded audio samples using a Wave2 PDU. - * When successful, the block_no member is incremented. - */ - psRdpsndServerSendSamples2 SendSamples2; - - /** - * Called when a TrainingConfirm PDU is received from the client. - */ - psRdpsndServerTrainingConfirm TrainingConfirm; - - /** - * Callback, when the channel got its id assigned. - * Only called, when use_dynamic_virtual_channel=TRUE. - */ - psRdpsndChannelIdAssigned ChannelIdAssigned; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct s_rdpsnd_server_context RdpsndServerContext; + typedef struct s_rdpsnd_server_context rdpsnd_server_context; + typedef struct s_rdpsnd_server_private RdpsndServerPrivate; + + typedef UINT (*psRdpsndStart)(RdpsndServerContext* context); + typedef UINT (*psRdpsndStop)(RdpsndServerContext* context); + + typedef BOOL (*psRdpsndChannelIdAssigned)(RdpsndServerContext* context, UINT32 channelId); + + typedef UINT (*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); + typedef UINT (*psRdpsndServerSendFormats)(RdpsndServerContext* context); + typedef UINT (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, + UINT16 client_format_index); + typedef UINT (*psRdpsndServerTraining)(RdpsndServerContext* context, UINT16 timestamp, + UINT16 packsize, BYTE* data); + typedef UINT (*psRdpsndServerTrainingConfirm)(RdpsndServerContext* context, UINT16 timestamp, + UINT16 packsize); + typedef UINT (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, + size_t nframes, UINT16 wTimestamp); + typedef UINT (*psRdpsndServerSendSamples2)(RdpsndServerContext* context, UINT16 formatNo, + const void* buf, size_t size, UINT16 timestamp, + UINT32 audioTimeStamp); + typedef UINT (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, + UINT16 wtimestamp); + typedef UINT (*psRdpsndServerSetVolume)(RdpsndServerContext* context, UINT16 left, + UINT16 right); + typedef UINT (*psRdpsndServerClose)(RdpsndServerContext* context); + + typedef void (*psRdpsndServerActivated)(RdpsndServerContext* context); + + struct s_rdpsnd_server_context + { + HANDLE vcm; + + psRdpsndStart Start; + psRdpsndStop Stop; + + RdpsndServerPrivate* priv; + + /* Server self-defined pointer. */ + void* data; + + /* Server to request to use dynamic virtual channel. */ + BOOL use_dynamic_virtual_channel; + + /* Server supported formats. Set by server. */ + AUDIO_FORMAT* server_formats; + size_t num_server_formats; + + /* Server source PCM audio format. Set by server. */ + AUDIO_FORMAT* src_format; + + /* Server audio latency, or buffer size, in milli-seconds. Set by server. */ + UINT32 latency; + + /* Client supported formats. */ + AUDIO_FORMAT* client_formats; + UINT16 num_client_formats; + UINT16 selected_client_format; + + /* Last sent audio block number. */ + UINT8 block_no; + + /*** APIs called by the server. ***/ + /** + * Initialize the channel. The caller should check the return value to see + * whether the initialization succeed. If not, the "Activated" callback + * will not be called and the server must not call any API on this context. + */ + psRdpsndServerInitialize Initialize; + + /** + * Choose the audio format to be sent. The index argument is an index into + * the client_formats array and must be smaller than num_client_formats. + */ + psRdpsndServerSelectFormat SelectFormat; + /** + * Send audio samples. Actually bytes in the buffer must be: + * nframes * src_format.nBitsPerSample * src_format.nChannels / 8 + */ + psRdpsndServerSendSamples SendSamples; + + /** + * Called when block confirm is received from the client + */ + psRdpsndServerConfirmBlock ConfirmBlock; + /** + * Set the volume level of the client. Valid range is between 0 and 0xFFFF. + */ + psRdpsndServerSetVolume SetVolume; + /** + * Close the audio stream. + */ + psRdpsndServerClose Close; + + /*** Callbacks registered by the server. ***/ + /** + * The channel has been activated. The server maybe choose audio format and + * start audio stream from this point. Note that this callback is called + * from a different thread context so the server must be careful of thread + * synchronization. + */ + psRdpsndServerActivated Activated; + + /** + * MS-RDPEA channel version the client announces + */ + UINT16 clientVersion; + + rdpContext* rdpcontext; + + /* dwFlags in CLIENT_AUDIO_VERSION_AND_FORMATS */ + UINT32 capsFlags; + /* dwVolume in CLIENT_AUDIO_VERSION_AND_FORMATS */ + UINT32 initialVolume; + /* dwPitch in CLIENT_AUDIO_VERSION_AND_FORMATS */ + UINT32 initialPitch; + + UINT16 qualityMode; + + /** + * Send server formats and version to the client. Automatically sent, when + * opening the channel. + * Also used to restart the protocol after sending the Close PDU. + */ + psRdpsndServerSendFormats SendFormats; + /** + * Send Training PDU. + */ + psRdpsndServerTraining Training; + + /** + * Send encoded audio samples using a Wave2 PDU. + * When successful, the block_no member is incremented. + */ + psRdpsndServerSendSamples2 SendSamples2; + + /** + * Called when a TrainingConfirm PDU is received from the client. + */ + psRdpsndServerTrainingConfirm TrainingConfirm; + + /** + * Callback, when the channel got its id assigned. + * Only called, when use_dynamic_virtual_channel=TRUE. + */ + psRdpsndChannelIdAssigned ChannelIdAssigned; + }; + FREERDP_API RdpsndServerContext* rdpsnd_server_context_new(HANDLE vcm); FREERDP_API void rdpsnd_server_context_reset(RdpsndServerContext*); FREERDP_API void rdpsnd_server_context_free(RdpsndServerContext* context); diff --git a/include/freerdp/server/remdesk.h b/include/freerdp/server/remdesk.h index e8dabd964..ae828fddc 100644 --- a/include/freerdp/server/remdesk.h +++ b/include/freerdp/server/remdesk.h @@ -28,33 +28,33 @@ #include -/** - * Server Interface - */ - -typedef struct s_remdesk_server_context RemdeskServerContext; -typedef struct s_remdesk_server_private RemdeskServerPrivate; - -typedef UINT (*psRemdeskStart)(RemdeskServerContext* context); -typedef UINT (*psRemdeskStop)(RemdeskServerContext* context); - -struct s_remdesk_server_context -{ - HANDLE vcm; - void* custom; - - psRemdeskStart Start; - psRemdeskStop Stop; - - RemdeskServerPrivate* priv; - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + /** + * Server Interface + */ + + typedef struct s_remdesk_server_context RemdeskServerContext; + typedef struct s_remdesk_server_private RemdeskServerPrivate; + + typedef UINT (*psRemdeskStart)(RemdeskServerContext* context); + typedef UINT (*psRemdeskStop)(RemdeskServerContext* context); + + struct s_remdesk_server_context + { + HANDLE vcm; + void* custom; + + psRemdeskStart Start; + psRemdeskStop Stop; + + RemdeskServerPrivate* priv; + rdpContext* rdpcontext; + }; + FREERDP_API RemdeskServerContext* remdesk_server_context_new(HANDLE vcm); FREERDP_API void remdesk_server_context_free(RemdeskServerContext* context); diff --git a/include/freerdp/server/server-common.h b/include/freerdp/server/server-common.h index fa27be1e2..ae1ff0b82 100644 --- a/include/freerdp/server/server-common.h +++ b/include/freerdp/server/server-common.h @@ -29,8 +29,10 @@ extern "C" { #endif + FREERDP_API size_t server_audin_get_formats(AUDIO_FORMAT** dst_formats); FREERDP_API size_t server_rdpsnd_get_formats(AUDIO_FORMAT** dst_formats); + #ifdef __cplusplus } #endif diff --git a/include/freerdp/server/shadow.h b/include/freerdp/server/shadow.h index f9386ef8a..d011d5407 100644 --- a/include/freerdp/server/shadow.h +++ b/include/freerdp/server/shadow.h @@ -45,77 +45,87 @@ #include #include -typedef struct rdp_shadow_client rdpShadowClient; -typedef struct rdp_shadow_server rdpShadowServer; -typedef struct rdp_shadow_screen rdpShadowScreen; -typedef struct rdp_shadow_surface rdpShadowSurface; -typedef struct rdp_shadow_encoder rdpShadowEncoder; -typedef struct rdp_shadow_capture rdpShadowCapture; -typedef struct rdp_shadow_subsystem rdpShadowSubsystem; -typedef struct rdp_shadow_multiclient_event rdpShadowMultiClientEvent; - -typedef struct S_RDP_SHADOW_ENTRY_POINTS RDP_SHADOW_ENTRY_POINTS; -typedef int (*pfnShadowSubsystemEntry)(RDP_SHADOW_ENTRY_POINTS* pEntryPoints); - -typedef rdpShadowSubsystem* (*pfnShadowSubsystemNew)(void); -typedef void (*pfnShadowSubsystemFree)(rdpShadowSubsystem* subsystem); - -typedef int (*pfnShadowSubsystemInit)(rdpShadowSubsystem* subsystem); -typedef int (*pfnShadowSubsystemUninit)(rdpShadowSubsystem* subsystem); - -typedef int (*pfnShadowSubsystemStart)(rdpShadowSubsystem* subsystem); -typedef int (*pfnShadowSubsystemStop)(rdpShadowSubsystem* subsystem); - -typedef UINT32 (*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, UINT32 maxMonitors); - -typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, - const char* user, const char* domain, const char* password); -typedef BOOL (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); -typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); -typedef BOOL (*pfnShadowClientCapabilities)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); - -typedef BOOL (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, - UINT32 flags); -typedef BOOL (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, - UINT16 flags, UINT8 code); -typedef BOOL (*pfnShadowUnicodeKeyboardEvent)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, UINT16 flags, UINT16 code); -typedef BOOL (*pfnShadowMouseEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, - UINT16 flags, UINT16 x, UINT16 y); -typedef BOOL (*pfnShadowExtendedMouseEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, - UINT16 flags, UINT16 x, UINT16 y); - -typedef BOOL (*pfnShadowChannelAudinServerReceiveSamples)(rdpShadowSubsystem* subsystem, - rdpShadowClient* client, - const AUDIO_FORMAT* format, wStream* buf, - size_t nframes); - -struct rdp_shadow_client +#ifdef __cplusplus +extern "C" { - rdpContext context; +#endif - HANDLE thread; - BOOL activated; - BOOL first_frame; - BOOL inLobby; - BOOL mayView; - BOOL mayInteract; - BOOL suppressOutput; - UINT16 surfaceId; - wMessageQueue* MsgQueue; - CRITICAL_SECTION lock; - REGION16 invalidRegion; - rdpShadowServer* server; - rdpShadowEncoder* encoder; - rdpShadowSubsystem* subsystem; + typedef struct rdp_shadow_client rdpShadowClient; + typedef struct rdp_shadow_server rdpShadowServer; + typedef struct rdp_shadow_screen rdpShadowScreen; + typedef struct rdp_shadow_surface rdpShadowSurface; + typedef struct rdp_shadow_encoder rdpShadowEncoder; + typedef struct rdp_shadow_capture rdpShadowCapture; + typedef struct rdp_shadow_subsystem rdpShadowSubsystem; + typedef struct rdp_shadow_multiclient_event rdpShadowMultiClientEvent; - UINT32 pointerX; - UINT32 pointerY; + typedef struct S_RDP_SHADOW_ENTRY_POINTS RDP_SHADOW_ENTRY_POINTS; + typedef int (*pfnShadowSubsystemEntry)(RDP_SHADOW_ENTRY_POINTS* pEntryPoints); - HANDLE vcm; - EncomspServerContext* encomsp; - RemdeskServerContext* remdesk; - RdpsndServerContext* rdpsnd; + typedef rdpShadowSubsystem* (*pfnShadowSubsystemNew)(void); + typedef void (*pfnShadowSubsystemFree)(rdpShadowSubsystem* subsystem); + + typedef int (*pfnShadowSubsystemInit)(rdpShadowSubsystem* subsystem); + typedef int (*pfnShadowSubsystemUninit)(rdpShadowSubsystem* subsystem); + + typedef int (*pfnShadowSubsystemStart)(rdpShadowSubsystem* subsystem); + typedef int (*pfnShadowSubsystemStop)(rdpShadowSubsystem* subsystem); + + typedef UINT32 (*pfnShadowEnumMonitors)(MONITOR_DEF* monitors, UINT32 maxMonitors); + + typedef int (*pfnShadowAuthenticate)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + const char* user, const char* domain, + const char* password); + typedef BOOL (*pfnShadowClientConnect)(rdpShadowSubsystem* subsystem, rdpShadowClient* client); + typedef void (*pfnShadowClientDisconnect)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client); + typedef BOOL (*pfnShadowClientCapabilities)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client); + + typedef BOOL (*pfnShadowSynchronizeEvent)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, UINT32 flags); + typedef BOOL (*pfnShadowKeyboardEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT8 code); + typedef BOOL (*pfnShadowUnicodeKeyboardEvent)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, UINT16 flags, + UINT16 code); + typedef BOOL (*pfnShadowMouseEvent)(rdpShadowSubsystem* subsystem, rdpShadowClient* client, + UINT16 flags, UINT16 x, UINT16 y); + typedef BOOL (*pfnShadowExtendedMouseEvent)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, UINT16 flags, UINT16 x, + UINT16 y); + + typedef BOOL (*pfnShadowChannelAudinServerReceiveSamples)(rdpShadowSubsystem* subsystem, + rdpShadowClient* client, + const AUDIO_FORMAT* format, + wStream* buf, size_t nframes); + + struct rdp_shadow_client + { + rdpContext context; + + HANDLE thread; + BOOL activated; + BOOL first_frame; + BOOL inLobby; + BOOL mayView; + BOOL mayInteract; + BOOL suppressOutput; + UINT16 surfaceId; + wMessageQueue* MsgQueue; + CRITICAL_SECTION lock; + REGION16 invalidRegion; + rdpShadowServer* server; + rdpShadowEncoder* encoder; + rdpShadowSubsystem* subsystem; + + UINT32 pointerX; + UINT32 pointerY; + + HANDLE vcm; + EncomspServerContext* encomsp; + RemdeskServerContext* remdesk; + RdpsndServerContext* rdpsnd; #if defined(CHANNEL_AUDIN_SERVER) audin_server_context* audin; #endif @@ -124,7 +134,7 @@ struct rdp_shadow_client BOOL resizeRequested; UINT32 resizeWidth; UINT32 resizeHeight; -}; + }; struct rdp_shadow_server { @@ -285,11 +295,6 @@ typedef struct UINT16 right; } SHADOW_MSG_OUT_AUDIO_OUT_VOLUME; -#ifdef __cplusplus -extern "C" -{ -#endif - FREERDP_API void shadow_subsystem_set_entry_builtin(const char* name); FREERDP_API void shadow_subsystem_set_entry(pfnShadowSubsystemEntry pEntry); diff --git a/include/freerdp/server/telemetry.h b/include/freerdp/server/telemetry.h index 04f72ad2a..033db1667 100644 --- a/include/freerdp/server/telemetry.h +++ b/include/freerdp/server/telemetry.h @@ -23,81 +23,82 @@ #include #include -typedef struct _telemetry_server_context TelemetryServerContext; - -typedef UINT (*psTelemetryServerOpen)(TelemetryServerContext* context); -typedef UINT (*psTelemetryServerClose)(TelemetryServerContext* context); - -typedef BOOL (*psTelemetryServerChannelIdAssigned)(TelemetryServerContext* context, - UINT32 channelId); - -typedef UINT (*psTelemetryServerInitialize)(TelemetryServerContext* context, BOOL externalThread); -typedef UINT (*psTelemetryServerPoll)(TelemetryServerContext* context); -typedef BOOL (*psTelemetryServerChannelHandle)(TelemetryServerContext* context, HANDLE* handle); - -typedef UINT (*psTelemetryServerRdpTelemetry)(TelemetryServerContext* context, - const TELEMETRY_RDP_TELEMETRY_PDU* rdpTelemetry); - -struct _telemetry_server_context -{ - HANDLE vcm; - - /* Server self-defined pointer. */ - void* userdata; - - /*** APIs called by the server. ***/ - - /** - * Optional: Set thread handling. - * When externalThread=TRUE, the application is responsible to call - * Poll() periodically to process channel events. - * - * Defaults to externalThread=FALSE - */ - psTelemetryServerInitialize Initialize; - - /** - * Open the telemetry channel. - */ - psTelemetryServerOpen Open; - - /** - * Close the telemetry channel. - */ - psTelemetryServerClose Close; - - /** - * Poll - * When externalThread=TRUE, call Poll() periodically from your main loop. - * If externalThread=FALSE do not call. - */ - psTelemetryServerPoll Poll; - - /** - * Retrieve the channel handle for use in conjunction with Poll(). - * If externalThread=FALSE do not call. - */ - psTelemetryServerChannelHandle ChannelHandle; - - /*** Callbacks registered by the server. ***/ - - /** - * Callback, when the channel got its id assigned - */ - psTelemetryServerChannelIdAssigned ChannelIdAssigned; - /** - * Callback for the RDP Telemetry PDU. - */ - psTelemetryServerRdpTelemetry RdpTelemetry; - - rdpContext* rdpcontext; -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct _telemetry_server_context TelemetryServerContext; + + typedef UINT (*psTelemetryServerOpen)(TelemetryServerContext* context); + typedef UINT (*psTelemetryServerClose)(TelemetryServerContext* context); + + typedef BOOL (*psTelemetryServerChannelIdAssigned)(TelemetryServerContext* context, + UINT32 channelId); + + typedef UINT (*psTelemetryServerInitialize)(TelemetryServerContext* context, + BOOL externalThread); + typedef UINT (*psTelemetryServerPoll)(TelemetryServerContext* context); + typedef BOOL (*psTelemetryServerChannelHandle)(TelemetryServerContext* context, HANDLE* handle); + + typedef UINT (*psTelemetryServerRdpTelemetry)(TelemetryServerContext* context, + const TELEMETRY_RDP_TELEMETRY_PDU* rdpTelemetry); + + struct _telemetry_server_context + { + HANDLE vcm; + + /* Server self-defined pointer. */ + void* userdata; + + /*** APIs called by the server. ***/ + + /** + * Optional: Set thread handling. + * When externalThread=TRUE, the application is responsible to call + * Poll() periodically to process channel events. + * + * Defaults to externalThread=FALSE + */ + psTelemetryServerInitialize Initialize; + + /** + * Open the telemetry channel. + */ + psTelemetryServerOpen Open; + + /** + * Close the telemetry channel. + */ + psTelemetryServerClose Close; + + /** + * Poll + * When externalThread=TRUE, call Poll() periodically from your main loop. + * If externalThread=FALSE do not call. + */ + psTelemetryServerPoll Poll; + + /** + * Retrieve the channel handle for use in conjunction with Poll(). + * If externalThread=FALSE do not call. + */ + psTelemetryServerChannelHandle ChannelHandle; + + /*** Callbacks registered by the server. ***/ + + /** + * Callback, when the channel got its id assigned + */ + psTelemetryServerChannelIdAssigned ChannelIdAssigned; + /** + * Callback for the RDP Telemetry PDU. + */ + psTelemetryServerRdpTelemetry RdpTelemetry; + + rdpContext* rdpcontext; + }; + FREERDP_API TelemetryServerContext* telemetry_server_context_new(HANDLE vcm); FREERDP_API void telemetry_server_context_free(TelemetryServerContext* context); diff --git a/include/freerdp/session.h b/include/freerdp/session.h index db2a40491..12b803210 100644 --- a/include/freerdp/session.h +++ b/include/freerdp/session.h @@ -27,24 +27,33 @@ #define INFO_TYPE_LOGON_PLAIN_NOTIFY 0x00000002 #define INFO_TYPE_LOGON_EXTENDED_INF 0x00000003 -struct rdp_logon_info +#ifdef __cplusplus +extern "C" { - UINT32 sessionId; - char* username; - char* domain; -}; -typedef struct rdp_logon_info logon_info; +#endif -struct rdp_logon_info_ex -{ - BOOL haveCookie; - UINT32 LogonId; - BYTE ArcRandomBits[16]; + struct rdp_logon_info + { + UINT32 sessionId; + char* username; + char* domain; + }; + typedef struct rdp_logon_info logon_info; - BOOL haveErrorInfo; - UINT32 ErrorNotificationType; - UINT32 ErrorNotificationData; -}; -typedef struct rdp_logon_info_ex logon_info_ex; + struct rdp_logon_info_ex + { + BOOL haveCookie; + UINT32 LogonId; + BYTE ArcRandomBits[16]; + + BOOL haveErrorInfo; + UINT32 ErrorNotificationType; + UINT32 ErrorNotificationData; + }; + typedef struct rdp_logon_info_ex logon_info_ex; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_SESSION_H */ diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index f167eebea..423157c44 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -34,6 +34,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + /** \file * \brief This is the FreeRDP settings module. * @@ -1671,11 +1676,6 @@ enum rdp_settings_type RDP_SETTINGS_TYPE_POINTER }; -#ifdef __cplusplus -extern "C" -{ -#endif - /** * rdpSettings creation flags */ diff --git a/include/freerdp/streamdump.h b/include/freerdp/streamdump.h index 1ad9561c1..6092814d1 100644 --- a/include/freerdp/streamdump.h +++ b/include/freerdp/streamdump.h @@ -27,13 +27,13 @@ #include #include -typedef struct stream_dump_context rdpStreamDumpContext; - #ifdef __cplusplus extern "C" { #endif + typedef struct stream_dump_context rdpStreamDumpContext; + typedef enum { STREAM_MSG_SRV_RX = 1, diff --git a/include/freerdp/svc.h b/include/freerdp/svc.h index 3d6240d02..482ae24cd 100644 --- a/include/freerdp/svc.h +++ b/include/freerdp/svc.h @@ -35,38 +35,47 @@ #define FREERDP_CHANNEL_MAGIC_NUMBER 0x46524450 -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 cbSize; - UINT32 protocolVersion; - PVIRTUALCHANNELINIT pVirtualChannelInit; - PVIRTUALCHANNELOPEN pVirtualChannelOpen; - PVIRTUALCHANNELCLOSE pVirtualChannelClose; - PVIRTUALCHANNELWRITE pVirtualChannelWrite; +#endif - /* Extended Fields */ - UINT32 MagicNumber; /* identifies FreeRDP */ - void* pExtendedData; /* extended initial data */ - void* pInterface; /* channel callback interface, use after initialization */ - rdpContext* context; -} CHANNEL_ENTRY_POINTS_FREERDP; -typedef CHANNEL_ENTRY_POINTS_FREERDP* PCHANNEL_ENTRY_POINTS_FREERDP; + typedef struct + { + UINT32 cbSize; + UINT32 protocolVersion; + PVIRTUALCHANNELINIT pVirtualChannelInit; + PVIRTUALCHANNELOPEN pVirtualChannelOpen; + PVIRTUALCHANNELCLOSE pVirtualChannelClose; + PVIRTUALCHANNELWRITE pVirtualChannelWrite; -typedef struct -{ - UINT32 cbSize; - UINT32 protocolVersion; - PVIRTUALCHANNELINITEX pVirtualChannelInitEx; - PVIRTUALCHANNELOPENEX pVirtualChannelOpenEx; - PVIRTUALCHANNELCLOSEEX pVirtualChannelCloseEx; - PVIRTUALCHANNELWRITEEX pVirtualChannelWriteEx; + /* Extended Fields */ + UINT32 MagicNumber; /* identifies FreeRDP */ + void* pExtendedData; /* extended initial data */ + void* pInterface; /* channel callback interface, use after initialization */ + rdpContext* context; + } CHANNEL_ENTRY_POINTS_FREERDP; + typedef CHANNEL_ENTRY_POINTS_FREERDP* PCHANNEL_ENTRY_POINTS_FREERDP; - /* Extended Fields */ - UINT32 MagicNumber; /* identifies FreeRDP */ - void* pExtendedData; /* extended initial data */ - void* pInterface; /* channel callback interface, use after initialization */ - rdpContext* context; -} CHANNEL_ENTRY_POINTS_FREERDP_EX; -typedef CHANNEL_ENTRY_POINTS_FREERDP_EX* PCHANNEL_ENTRY_POINTS_FREERDP_EX; + typedef struct + { + UINT32 cbSize; + UINT32 protocolVersion; + PVIRTUALCHANNELINITEX pVirtualChannelInitEx; + PVIRTUALCHANNELOPENEX pVirtualChannelOpenEx; + PVIRTUALCHANNELCLOSEEX pVirtualChannelCloseEx; + PVIRTUALCHANNELWRITEEX pVirtualChannelWriteEx; + + /* Extended Fields */ + UINT32 MagicNumber; /* identifies FreeRDP */ + void* pExtendedData; /* extended initial data */ + void* pInterface; /* channel callback interface, use after initialization */ + rdpContext* context; + } CHANNEL_ENTRY_POINTS_FREERDP_EX; + typedef CHANNEL_ENTRY_POINTS_FREERDP_EX* PCHANNEL_ENTRY_POINTS_FREERDP_EX; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_SVC_H */ diff --git a/include/freerdp/transport_io.h b/include/freerdp/transport_io.h index 3e4f3733d..0fcbb02fb 100644 --- a/include/freerdp/transport_io.h +++ b/include/freerdp/transport_io.h @@ -22,8 +22,6 @@ #ifndef FREERDP_TRANSPORT_IO_H #define FREERDP_TRANSPORT_IO_H -typedef struct rdp_transport_io rdpTransportIo; - #include #include @@ -35,6 +33,8 @@ extern "C" { #endif + typedef struct rdp_transport_io rdpTransportIo; + typedef int (*pTCPConnect)(rdpContext* context, rdpSettings* settings, const char* hostname, int port, DWORD timeout); typedef BOOL (*pTransportFkt)(rdpTransport* transport); diff --git a/include/freerdp/types.h b/include/freerdp/types.h index f18719da9..b1557e1a9 100644 --- a/include/freerdp/types.h +++ b/include/freerdp/types.h @@ -32,18 +32,23 @@ #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif -typedef struct +#ifdef __cplusplus +extern "C" { - BYTE red; - BYTE green; - BYTE blue; -} PALETTE_ENTRY; +#endif -typedef struct -{ - UINT32 count; - PALETTE_ENTRY entries[256]; -} rdpPalette; + typedef struct + { + BYTE red; + BYTE green; + BYTE blue; + } PALETTE_ENTRY; + + typedef struct + { + UINT32 count; + PALETTE_ENTRY entries[256]; + } rdpPalette; #include @@ -85,6 +90,10 @@ typedef enum RDP_TRANSPORT_UDP_L } RDP_TRANSPORT_TYPE; +#ifdef __cplusplus +} +#endif + /* Plugin events */ #include diff --git a/include/freerdp/update.h b/include/freerdp/update.h index d1339d56e..d373a6d70 100644 --- a/include/freerdp/update.h +++ b/include/freerdp/update.h @@ -20,8 +20,6 @@ #ifndef FREERDP_UPDATE_H #define FREERDP_UPDATE_H -typedef struct rdp_update rdpUpdate; - #include #include #include @@ -44,201 +42,204 @@ typedef struct rdp_update rdpUpdate; /* Bitmap Updates */ #define EX_COMPRESSED_BITMAP_HEADER_PRESENT 0x01 -typedef struct -{ - UINT32 destLeft; - UINT32 destTop; - UINT32 destRight; - UINT32 destBottom; - UINT32 width; - UINT32 height; - UINT32 bitsPerPixel; - UINT32 flags; - UINT32 bitmapLength; - UINT32 cbCompFirstRowSize; - UINT32 cbCompMainBodySize; - UINT32 cbScanWidth; - UINT32 cbUncompressedSize; - BYTE* bitmapDataStream; - BOOL compressed; -} BITMAP_DATA; - -typedef struct -{ - UINT32 number; - BITMAP_DATA* rectangles; - BOOL skipCompression; -} BITMAP_UPDATE; - -/* Palette Updates */ - -typedef struct -{ - UINT32 number; - PALETTE_ENTRY entries[256]; -} PALETTE_UPDATE; - -/* Play Sound (System Beep) Updates */ - -typedef struct -{ - UINT32 duration; - UINT32 frequency; -} PLAY_SOUND_UPDATE; - -/* Surface Command Updates */ -typedef struct -{ - UINT32 highUniqueId; - UINT32 lowUniqueId; - UINT64 tmMilliseconds; - UINT64 tmSeconds; -} TS_COMPRESSED_BITMAP_HEADER_EX; - -typedef struct -{ - BYTE bpp; - BYTE flags; - UINT16 codecID; - UINT16 width; - UINT16 height; - UINT32 bitmapDataLength; - TS_COMPRESSED_BITMAP_HEADER_EX exBitmapDataHeader; - BYTE* bitmapData; -} TS_BITMAP_DATA_EX; - -enum SURFCMD_CMDTYPE -{ - CMDTYPE_SET_SURFACE_BITS = 0x0001, - CMDTYPE_FRAME_MARKER = 0x0004, - CMDTYPE_STREAM_SURFACE_BITS = 0x0006 -}; - -typedef struct -{ - UINT32 cmdType; - UINT32 destLeft; - UINT32 destTop; - UINT32 destRight; - UINT32 destBottom; - TS_BITMAP_DATA_EX bmp; - BOOL skipCompression; -} SURFACE_BITS_COMMAND; - -typedef struct -{ - UINT32 frameAction; - UINT32 frameId; -} SURFACE_FRAME_MARKER; - -enum SURFCMD_FRAMEACTION -{ - SURFACECMD_FRAMEACTION_BEGIN = 0x0000, - SURFACECMD_FRAMEACTION_END = 0x0001 -}; - -/** @brief status code as in 2.2.5.2 Server Status Info PDU */ -enum -{ - TS_STATUS_FINDING_DESTINATION = 0x00000401, - TS_STATUS_LOADING_DESTINATION = 0x00000402, - TS_STATUS_BRINGING_SESSION_ONLINE = 0x00000403, - TS_STATUS_REDIRECTING_TO_DESTINATION = 0x00000404, - TS_STATUS_VM_LOADING = 0x00000501, - TS_STATUS_VM_WAKING = 0x00000502, - TS_STATUS_VM_STARTING = 0x00000503, - TS_STATUS_VM_STARTING_MONITORING = 0x00000504, - TS_STATUS_VM_RETRYING_MONITORING = 0x00000505 -}; - -typedef struct -{ - UINT32 frameId; - UINT32 commandCount; - SURFACE_BITS_COMMAND* commands; -} SURFACE_FRAME; - -/* defined inside libfreerdp-core */ -typedef struct rdp_update_proxy rdpUpdateProxy; - -/* Update Interface */ - -typedef BOOL (*pBeginPaint)(rdpContext* context); -typedef BOOL (*pEndPaint)(rdpContext* context); -typedef BOOL (*pSetBounds)(rdpContext* context, const rdpBounds* bounds); - -typedef BOOL (*pSynchronize)(rdpContext* context); -typedef BOOL (*pDesktopResize)(rdpContext* context); -typedef BOOL (*pBitmapUpdate)(rdpContext* context, const BITMAP_UPDATE* bitmap); -typedef BOOL (*pPalette)(rdpContext* context, const PALETTE_UPDATE* palette); -typedef BOOL (*pPlaySound)(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound); -typedef BOOL (*pSetKeyboardIndicators)(rdpContext* context, UINT16 led_flags); - -typedef BOOL (*pRefreshRect)(rdpContext* context, BYTE count, const RECTANGLE_16* areas); -typedef BOOL (*pSuppressOutput)(rdpContext* context, BYTE allow, const RECTANGLE_16* area); -typedef BOOL (*pRemoteMonitors)(rdpContext* context, UINT32 count, const MONITOR_DEF* monitors); - -typedef BOOL (*pSurfaceCommand)(rdpContext* context, wStream* s); -typedef BOOL (*pSurfaceBits)(rdpContext* context, const SURFACE_BITS_COMMAND* surfaceBitsCommand); -typedef BOOL (*pSurfaceFrameMarker)(rdpContext* context, - const SURFACE_FRAME_MARKER* surfaceFrameMarker); -typedef BOOL (*pSurfaceFrameBits)(rdpContext* context, const SURFACE_BITS_COMMAND* cmd, BOOL first, - BOOL last, UINT32 frameId); -typedef BOOL (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId); - -typedef BOOL (*pSaveSessionInfo)(rdpContext* context, UINT32 type, void* data); -typedef BOOL (*pSetKeyboardImeStatus)(rdpContext* context, UINT16 imeId, UINT32 imeState, - UINT32 imeConvMode); -typedef BOOL (*pServerStatusInfo)(rdpContext* context, UINT32 status); - -struct rdp_update -{ - rdpContext* context; /* 0 */ - UINT32 paddingA[16 - 1]; /* 1 */ - - pBeginPaint BeginPaint; /* 16 */ - pEndPaint EndPaint; /* 17 */ - pSetBounds SetBounds; /* 18 */ - pSynchronize Synchronize; /* 19 */ - pDesktopResize DesktopResize; /* 20 */ - pBitmapUpdate BitmapUpdate; /* 21 */ - pPalette Palette; /* 22 */ - pPlaySound PlaySound; /* 23 */ - pSetKeyboardIndicators SetKeyboardIndicators; /* 24 */ - pSetKeyboardImeStatus SetKeyboardImeStatus; /* 25 */ - UINT32 paddingB[32 - 26]; /* 26 */ - - rdpPointerUpdate* pointer; /* 32 */ - rdpPrimaryUpdate* primary; /* 33 */ - rdpSecondaryUpdate* secondary; /* 34 */ - rdpAltSecUpdate* altsec; /* 35 */ - rdpWindowUpdate* window; /* 36 */ - UINT32 paddingC[48 - 37]; /* 37 */ - - pRefreshRect RefreshRect; /* 48 */ - pSuppressOutput SuppressOutput; /* 49 */ - pRemoteMonitors RemoteMonitors; /* 50 */ - UINT32 paddingD[64 - 51]; /* 51 */ - - pSurfaceCommand SurfaceCommand; /* 64 */ - pSurfaceBits SurfaceBits; /* 65 */ - pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */ - pSurfaceFrameBits SurfaceFrameBits; /* 67 */ - pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 68 */ - pSaveSessionInfo SaveSessionInfo; /* 69 */ - pServerStatusInfo ServerStatusInfo; /* 70 */ - /* if autoCalculateBitmapData is set to TRUE, the server automatically - * fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize. - */ - BOOL autoCalculateBitmapData; /* 71 */ - UINT32 paddingE[80 - 72]; /* 72 */ -}; - #ifdef __cplusplus extern "C" { #endif + typedef struct rdp_update rdpUpdate; + + typedef struct + { + UINT32 destLeft; + UINT32 destTop; + UINT32 destRight; + UINT32 destBottom; + UINT32 width; + UINT32 height; + UINT32 bitsPerPixel; + UINT32 flags; + UINT32 bitmapLength; + UINT32 cbCompFirstRowSize; + UINT32 cbCompMainBodySize; + UINT32 cbScanWidth; + UINT32 cbUncompressedSize; + BYTE* bitmapDataStream; + BOOL compressed; + } BITMAP_DATA; + + typedef struct + { + UINT32 number; + BITMAP_DATA* rectangles; + BOOL skipCompression; + } BITMAP_UPDATE; + + /* Palette Updates */ + + typedef struct + { + UINT32 number; + PALETTE_ENTRY entries[256]; + } PALETTE_UPDATE; + + /* Play Sound (System Beep) Updates */ + + typedef struct + { + UINT32 duration; + UINT32 frequency; + } PLAY_SOUND_UPDATE; + + /* Surface Command Updates */ + typedef struct + { + UINT32 highUniqueId; + UINT32 lowUniqueId; + UINT64 tmMilliseconds; + UINT64 tmSeconds; + } TS_COMPRESSED_BITMAP_HEADER_EX; + + typedef struct + { + BYTE bpp; + BYTE flags; + UINT16 codecID; + UINT16 width; + UINT16 height; + UINT32 bitmapDataLength; + TS_COMPRESSED_BITMAP_HEADER_EX exBitmapDataHeader; + BYTE* bitmapData; + } TS_BITMAP_DATA_EX; + + enum SURFCMD_CMDTYPE + { + CMDTYPE_SET_SURFACE_BITS = 0x0001, + CMDTYPE_FRAME_MARKER = 0x0004, + CMDTYPE_STREAM_SURFACE_BITS = 0x0006 + }; + + typedef struct + { + UINT32 cmdType; + UINT32 destLeft; + UINT32 destTop; + UINT32 destRight; + UINT32 destBottom; + TS_BITMAP_DATA_EX bmp; + BOOL skipCompression; + } SURFACE_BITS_COMMAND; + + typedef struct + { + UINT32 frameAction; + UINT32 frameId; + } SURFACE_FRAME_MARKER; + + enum SURFCMD_FRAMEACTION + { + SURFACECMD_FRAMEACTION_BEGIN = 0x0000, + SURFACECMD_FRAMEACTION_END = 0x0001 + }; + + /** @brief status code as in 2.2.5.2 Server Status Info PDU */ + enum + { + TS_STATUS_FINDING_DESTINATION = 0x00000401, + TS_STATUS_LOADING_DESTINATION = 0x00000402, + TS_STATUS_BRINGING_SESSION_ONLINE = 0x00000403, + TS_STATUS_REDIRECTING_TO_DESTINATION = 0x00000404, + TS_STATUS_VM_LOADING = 0x00000501, + TS_STATUS_VM_WAKING = 0x00000502, + TS_STATUS_VM_STARTING = 0x00000503, + TS_STATUS_VM_STARTING_MONITORING = 0x00000504, + TS_STATUS_VM_RETRYING_MONITORING = 0x00000505 + }; + + typedef struct + { + UINT32 frameId; + UINT32 commandCount; + SURFACE_BITS_COMMAND* commands; + } SURFACE_FRAME; + + /* defined inside libfreerdp-core */ + typedef struct rdp_update_proxy rdpUpdateProxy; + + /* Update Interface */ + + typedef BOOL (*pBeginPaint)(rdpContext* context); + typedef BOOL (*pEndPaint)(rdpContext* context); + typedef BOOL (*pSetBounds)(rdpContext* context, const rdpBounds* bounds); + + typedef BOOL (*pSynchronize)(rdpContext* context); + typedef BOOL (*pDesktopResize)(rdpContext* context); + typedef BOOL (*pBitmapUpdate)(rdpContext* context, const BITMAP_UPDATE* bitmap); + typedef BOOL (*pPalette)(rdpContext* context, const PALETTE_UPDATE* palette); + typedef BOOL (*pPlaySound)(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound); + typedef BOOL (*pSetKeyboardIndicators)(rdpContext* context, UINT16 led_flags); + + typedef BOOL (*pRefreshRect)(rdpContext* context, BYTE count, const RECTANGLE_16* areas); + typedef BOOL (*pSuppressOutput)(rdpContext* context, BYTE allow, const RECTANGLE_16* area); + typedef BOOL (*pRemoteMonitors)(rdpContext* context, UINT32 count, const MONITOR_DEF* monitors); + + typedef BOOL (*pSurfaceCommand)(rdpContext* context, wStream* s); + typedef BOOL (*pSurfaceBits)(rdpContext* context, + const SURFACE_BITS_COMMAND* surfaceBitsCommand); + typedef BOOL (*pSurfaceFrameMarker)(rdpContext* context, + const SURFACE_FRAME_MARKER* surfaceFrameMarker); + typedef BOOL (*pSurfaceFrameBits)(rdpContext* context, const SURFACE_BITS_COMMAND* cmd, + BOOL first, BOOL last, UINT32 frameId); + typedef BOOL (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId); + + typedef BOOL (*pSaveSessionInfo)(rdpContext* context, UINT32 type, void* data); + typedef BOOL (*pSetKeyboardImeStatus)(rdpContext* context, UINT16 imeId, UINT32 imeState, + UINT32 imeConvMode); + typedef BOOL (*pServerStatusInfo)(rdpContext* context, UINT32 status); + + struct rdp_update + { + rdpContext* context; /* 0 */ + UINT32 paddingA[16 - 1]; /* 1 */ + + pBeginPaint BeginPaint; /* 16 */ + pEndPaint EndPaint; /* 17 */ + pSetBounds SetBounds; /* 18 */ + pSynchronize Synchronize; /* 19 */ + pDesktopResize DesktopResize; /* 20 */ + pBitmapUpdate BitmapUpdate; /* 21 */ + pPalette Palette; /* 22 */ + pPlaySound PlaySound; /* 23 */ + pSetKeyboardIndicators SetKeyboardIndicators; /* 24 */ + pSetKeyboardImeStatus SetKeyboardImeStatus; /* 25 */ + UINT32 paddingB[32 - 26]; /* 26 */ + + rdpPointerUpdate* pointer; /* 32 */ + rdpPrimaryUpdate* primary; /* 33 */ + rdpSecondaryUpdate* secondary; /* 34 */ + rdpAltSecUpdate* altsec; /* 35 */ + rdpWindowUpdate* window; /* 36 */ + UINT32 paddingC[48 - 37]; /* 37 */ + + pRefreshRect RefreshRect; /* 48 */ + pSuppressOutput SuppressOutput; /* 49 */ + pRemoteMonitors RemoteMonitors; /* 50 */ + UINT32 paddingD[64 - 51]; /* 51 */ + + pSurfaceCommand SurfaceCommand; /* 64 */ + pSurfaceBits SurfaceBits; /* 65 */ + pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */ + pSurfaceFrameBits SurfaceFrameBits; /* 67 */ + pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 68 */ + pSaveSessionInfo SaveSessionInfo; /* 69 */ + pServerStatusInfo ServerStatusInfo; /* 70 */ + /* if autoCalculateBitmapData is set to TRUE, the server automatically + * fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize. + */ + BOOL autoCalculateBitmapData; /* 71 */ + UINT32 paddingE[80 - 72]; /* 72 */ + }; + FREERDP_API void rdp_update_lock(rdpUpdate* update); FREERDP_API void rdp_update_unlock(rdpUpdate* update); diff --git a/include/freerdp/utils/pcap.h b/include/freerdp/utils/pcap.h index a74c82510..5178f3802 100644 --- a/include/freerdp/utils/pcap.h +++ b/include/freerdp/utils/pcap.h @@ -23,46 +23,46 @@ #include #include -typedef struct -{ - UINT32 magic_number; /* magic number */ - UINT16 version_major; /* major version number */ - UINT16 version_minor; /* minor version number */ - INT32 thiszone; /* GMT to local correction */ - UINT32 sigfigs; /* accuracy of timestamps */ - UINT32 snaplen; /* max length of captured packets, in octets */ - UINT32 network; /* data link type */ -} pcap_header; - -typedef struct -{ - UINT32 ts_sec; /* timestamp seconds */ - UINT32 ts_usec; /* timestamp microseconds */ - UINT32 incl_len; /* number of octets of packet saved in file */ - UINT32 orig_len; /* actual length of packet */ -} pcap_record_header; - -typedef struct s_pcap_record pcap_record; - -struct s_pcap_record -{ - pcap_record_header header; - union - { - void* data; - const void* cdata; - }; - UINT32 length; - pcap_record* next; -}; - -typedef struct rdp_pcap rdpPcap; - #ifdef __cplusplus extern "C" { #endif + typedef struct + { + UINT32 magic_number; /* magic number */ + UINT16 version_major; /* major version number */ + UINT16 version_minor; /* minor version number */ + INT32 thiszone; /* GMT to local correction */ + UINT32 sigfigs; /* accuracy of timestamps */ + UINT32 snaplen; /* max length of captured packets, in octets */ + UINT32 network; /* data link type */ + } pcap_header; + + typedef struct + { + UINT32 ts_sec; /* timestamp seconds */ + UINT32 ts_usec; /* timestamp microseconds */ + UINT32 incl_len; /* number of octets of packet saved in file */ + UINT32 orig_len; /* actual length of packet */ + } pcap_record_header; + + typedef struct s_pcap_record pcap_record; + + struct s_pcap_record + { + pcap_record_header header; + union + { + void* data; + const void* cdata; + }; + UINT32 length; + pcap_record* next; + }; + + typedef struct rdp_pcap rdpPcap; + FREERDP_API rdpPcap* pcap_open(const char* name, BOOL write); FREERDP_API void pcap_close(rdpPcap* pcap); diff --git a/include/freerdp/utils/pod_arrays.h b/include/freerdp/utils/pod_arrays.h index e0ad4278e..30cff6bef 100644 --- a/include/freerdp/utils/pod_arrays.h +++ b/include/freerdp/utils/pod_arrays.h @@ -22,6 +22,11 @@ #include #include +#ifdef __cplusplus +extern "C" +{ +#endif + #define POD_ARRAYS_IMPL(T, TLOWER) \ typedef struct \ { \ @@ -124,11 +129,6 @@ a->nvalues = 0; \ } -#ifdef __cplusplus -extern "C" -{ -#endif - POD_ARRAYS_IMPL(UINT16, uint16) POD_ARRAYS_IMPL(UINT32, uint32) POD_ARRAYS_IMPL(UINT64, uint64) diff --git a/include/freerdp/utils/profiler.h b/include/freerdp/utils/profiler.h index 4cb31984e..29b9e32f0 100644 --- a/include/freerdp/utils/profiler.h +++ b/include/freerdp/utils/profiler.h @@ -23,13 +23,13 @@ #include #include -typedef struct S_PROFILER PROFILER; - #ifdef __cplusplus extern "C" { #endif + typedef struct S_PROFILER PROFILER; + FREERDP_API PROFILER* profiler_create(const char* name); FREERDP_API void profiler_free(PROFILER* profiler); @@ -40,10 +40,6 @@ extern "C" FREERDP_API void profiler_print(PROFILER* profiler); FREERDP_API void profiler_print_footer(void); -#ifdef __cplusplus -} -#endif - #ifdef WITH_PROFILER #define PROFILER_RENAME(prof, name) \ do \ @@ -96,4 +92,8 @@ extern "C" } while (0); #endif +#ifdef __cplusplus +} +#endif + #endif /* FREERDP_UTILS_PROFILER_H */ diff --git a/include/freerdp/utils/ringbuffer.h b/include/freerdp/utils/ringbuffer.h index b888855d7..3de191c81 100644 --- a/include/freerdp/utils/ringbuffer.h +++ b/include/freerdp/utils/ringbuffer.h @@ -23,29 +23,29 @@ #include #include -/** @brief ring buffer meta data */ -typedef struct -{ - size_t initialSize; - size_t freeSize; - size_t size; - size_t readPtr; - size_t writePtr; - BYTE* buffer; -} RingBuffer; - -/** @brief a piece of data in the ring buffer, exactly like a glibc iovec */ -typedef struct -{ - size_t size; - const BYTE* data; -} DataChunk; - #ifdef __cplusplus extern "C" { #endif + /** @brief ring buffer meta data */ + typedef struct + { + size_t initialSize; + size_t freeSize; + size_t size; + size_t readPtr; + size_t writePtr; + BYTE* buffer; + } RingBuffer; + + /** @brief a piece of data in the ring buffer, exactly like a glibc iovec */ + typedef struct + { + size_t size; + const BYTE* data; + } DataChunk; + /** * initialise a ringbuffer * diff --git a/include/freerdp/utils/signal.h b/include/freerdp/utils/signal.h index 977484558..febd0b0cf 100644 --- a/include/freerdp/utils/signal.h +++ b/include/freerdp/utils/signal.h @@ -23,11 +23,6 @@ #include #include -#ifndef _WIN32 -#include -#include -#endif - #ifdef __cplusplus extern "C" { diff --git a/include/freerdp/utils/smartcard_call.h b/include/freerdp/utils/smartcard_call.h index 052af0f47..947194a45 100644 --- a/include/freerdp/utils/smartcard_call.h +++ b/include/freerdp/utils/smartcard_call.h @@ -31,12 +31,13 @@ #include #include -typedef struct s_scard_call_context scard_call_context; - #ifdef __cplusplus extern "C" { #endif + + 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); diff --git a/include/freerdp/utils/smartcardlogon.h b/include/freerdp/utils/smartcardlogon.h index 2f9056d01..7a5346e2b 100644 --- a/include/freerdp/utils/smartcardlogon.h +++ b/include/freerdp/utils/smartcardlogon.h @@ -16,8 +16,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef LIBFREERDP_CORE_SMARTCARDLOGON_H -#define LIBFREERDP_CORE_SMARTCARDLOGON_H +#ifndef FREERDP_UTILS_SMARTCARDLOGON_H +#define FREERDP_UTILS_SMARTCARDLOGON_H #include #include @@ -59,4 +59,4 @@ extern "C" #ifdef __cplusplus } #endif -#endif /* LIBFREERDP_CORE_SMARTCARDLOGON_H */ +#endif /* FREERDP_UTILS_SMARTCARDLOGON_H */ diff --git a/include/freerdp/utils/stopwatch.h b/include/freerdp/utils/stopwatch.h index 9e044043b..c26725063 100644 --- a/include/freerdp/utils/stopwatch.h +++ b/include/freerdp/utils/stopwatch.h @@ -23,19 +23,19 @@ #include #include -typedef struct -{ - UINT64 start; - UINT64 end; - UINT64 elapsed; - UINT32 count; -} STOPWATCH; - #ifdef __cplusplus extern "C" { #endif + typedef struct + { + UINT64 start; + UINT64 end; + UINT64 elapsed; + UINT32 count; + } STOPWATCH; + FREERDP_API STOPWATCH* stopwatch_create(void); FREERDP_API void stopwatch_free(STOPWATCH* stopwatch); diff --git a/include/freerdp/window.h b/include/freerdp/window.h index f5e563a41..c5d396c5c 100644 --- a/include/freerdp/window.h +++ b/include/freerdp/window.h @@ -145,140 +145,149 @@ #define WS_EX_DECORATIONS 0x40000000 -typedef struct +#ifdef __cplusplus +extern "C" { - UINT32 windowId; - UINT32 fieldFlags; - UINT32 notifyIconId; -} WINDOW_ORDER_INFO; +#endif -typedef struct -{ - UINT32 cacheEntry; - UINT32 cacheId; - UINT32 bpp; - UINT32 width; - UINT32 height; - UINT32 cbColorTable; - UINT32 cbBitsMask; - UINT32 cbBitsColor; - BYTE* bitsMask; - BYTE* colorTable; - BYTE* bitsColor; -} ICON_INFO; + typedef struct + { + UINT32 windowId; + UINT32 fieldFlags; + UINT32 notifyIconId; + } WINDOW_ORDER_INFO; -typedef struct -{ - UINT32 cacheEntry; - UINT32 cacheId; -} CACHED_ICON_INFO; + typedef struct + { + UINT32 cacheEntry; + UINT32 cacheId; + UINT32 bpp; + UINT32 width; + UINT32 height; + UINT32 cbColorTable; + UINT32 cbBitsMask; + UINT32 cbBitsColor; + BYTE* bitsMask; + BYTE* colorTable; + BYTE* bitsColor; + } ICON_INFO; -typedef struct -{ - UINT32 timeout; - UINT32 flags; - RAIL_UNICODE_STRING text; - RAIL_UNICODE_STRING title; -} NOTIFY_ICON_INFOTIP; + typedef struct + { + UINT32 cacheEntry; + UINT32 cacheId; + } CACHED_ICON_INFO; -typedef struct -{ - UINT32 ownerWindowId; - UINT32 style; - UINT32 extendedStyle; - UINT32 showState; - RAIL_UNICODE_STRING titleInfo; - INT32 clientOffsetX; - INT32 clientOffsetY; - UINT32 clientAreaWidth; - UINT32 clientAreaHeight; - UINT32 RPContent; - UINT32 rootParentHandle; - INT32 windowOffsetX; - INT32 windowOffsetY; - INT32 windowClientDeltaX; - INT32 windowClientDeltaY; - UINT32 windowWidth; - UINT32 windowHeight; - UINT32 numWindowRects; - RECTANGLE_16* windowRects; - INT32 visibleOffsetX; - INT32 visibleOffsetY; - UINT32 resizeMarginLeft; - UINT32 resizeMarginTop; - UINT32 resizeMarginRight; - UINT32 resizeMarginBottom; - UINT32 numVisibilityRects; - RECTANGLE_16* visibilityRects; - RAIL_UNICODE_STRING OverlayDescription; - BYTE TaskbarButton; - UINT8 EnforceServerZOrder; - UINT8 AppBarState; - UINT8 AppBarEdge; -} WINDOW_STATE_ORDER; + typedef struct + { + UINT32 timeout; + UINT32 flags; + RAIL_UNICODE_STRING text; + RAIL_UNICODE_STRING title; + } NOTIFY_ICON_INFOTIP; -typedef struct -{ - ICON_INFO* iconInfo; -} WINDOW_ICON_ORDER; + typedef struct + { + UINT32 ownerWindowId; + UINT32 style; + UINT32 extendedStyle; + UINT32 showState; + RAIL_UNICODE_STRING titleInfo; + INT32 clientOffsetX; + INT32 clientOffsetY; + UINT32 clientAreaWidth; + UINT32 clientAreaHeight; + UINT32 RPContent; + UINT32 rootParentHandle; + INT32 windowOffsetX; + INT32 windowOffsetY; + INT32 windowClientDeltaX; + INT32 windowClientDeltaY; + UINT32 windowWidth; + UINT32 windowHeight; + UINT32 numWindowRects; + RECTANGLE_16* windowRects; + INT32 visibleOffsetX; + INT32 visibleOffsetY; + UINT32 resizeMarginLeft; + UINT32 resizeMarginTop; + UINT32 resizeMarginRight; + UINT32 resizeMarginBottom; + UINT32 numVisibilityRects; + RECTANGLE_16* visibilityRects; + RAIL_UNICODE_STRING OverlayDescription; + BYTE TaskbarButton; + UINT8 EnforceServerZOrder; + UINT8 AppBarState; + UINT8 AppBarEdge; + } WINDOW_STATE_ORDER; -typedef struct -{ - CACHED_ICON_INFO cachedIcon; -} WINDOW_CACHED_ICON_ORDER; + typedef struct + { + ICON_INFO* iconInfo; + } WINDOW_ICON_ORDER; -typedef struct -{ - UINT32 version; - RAIL_UNICODE_STRING toolTip; - NOTIFY_ICON_INFOTIP infoTip; - UINT32 state; - ICON_INFO icon; - CACHED_ICON_INFO cachedIcon; -} NOTIFY_ICON_STATE_ORDER; + typedef struct + { + CACHED_ICON_INFO cachedIcon; + } WINDOW_CACHED_ICON_ORDER; -typedef struct -{ - UINT32 activeWindowId; - UINT32 numWindowIds; - UINT32* windowIds; -} MONITORED_DESKTOP_ORDER; + typedef struct + { + UINT32 version; + RAIL_UNICODE_STRING toolTip; + NOTIFY_ICON_INFOTIP infoTip; + UINT32 state; + ICON_INFO icon; + CACHED_ICON_INFO cachedIcon; + } NOTIFY_ICON_STATE_ORDER; -typedef BOOL (*pWindowCreate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_STATE_ORDER* window_state); -typedef BOOL (*pWindowUpdate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_STATE_ORDER* window_state); -typedef BOOL (*pWindowIcon)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_ICON_ORDER* window_icon); -typedef BOOL (*pWindowCachedIcon)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const WINDOW_CACHED_ICON_ORDER* window_cached_icon); -typedef BOOL (*pWindowDelete)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); -typedef BOOL (*pNotifyIconCreate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const NOTIFY_ICON_STATE_ORDER* notify_icon_state); -typedef BOOL (*pNotifyIconUpdate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const NOTIFY_ICON_STATE_ORDER* notify_icon_state); -typedef BOOL (*pNotifyIconDelete)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); -typedef BOOL (*pMonitoredDesktop)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, - const MONITORED_DESKTOP_ORDER* monitored_desktop); -typedef BOOL (*pNonMonitoredDesktop)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); + typedef struct + { + UINT32 activeWindowId; + UINT32 numWindowIds; + UINT32* windowIds; + } MONITORED_DESKTOP_ORDER; -struct rdp_window_update -{ - rdpContext* context; /* 0 */ - UINT32 paddingA[16 - 1]; /* 1 */ + typedef BOOL (*pWindowCreate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_STATE_ORDER* window_state); + typedef BOOL (*pWindowUpdate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_STATE_ORDER* window_state); + typedef BOOL (*pWindowIcon)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_ICON_ORDER* window_icon); + typedef BOOL (*pWindowCachedIcon)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const WINDOW_CACHED_ICON_ORDER* window_cached_icon); + typedef BOOL (*pWindowDelete)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); + typedef BOOL (*pNotifyIconCreate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notify_icon_state); + typedef BOOL (*pNotifyIconUpdate)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const NOTIFY_ICON_STATE_ORDER* notify_icon_state); + typedef BOOL (*pNotifyIconDelete)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); + typedef BOOL (*pMonitoredDesktop)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo, + const MONITORED_DESKTOP_ORDER* monitored_desktop); + typedef BOOL (*pNonMonitoredDesktop)(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo); - pWindowCreate WindowCreate; /* 16 */ - pWindowUpdate WindowUpdate; /* 17 */ - pWindowIcon WindowIcon; /* 18 */ - pWindowCachedIcon WindowCachedIcon; /* 19 */ - pWindowDelete WindowDelete; /* 20 */ - pNotifyIconCreate NotifyIconCreate; /* 21 */ - pNotifyIconUpdate NotifyIconUpdate; /* 22 */ - pNotifyIconDelete NotifyIconDelete; /* 23 */ - pMonitoredDesktop MonitoredDesktop; /* 24 */ - pNonMonitoredDesktop NonMonitoredDesktop; /* 25 */ - UINT32 paddingB[32 - 26]; /* 26 */ -}; -typedef struct rdp_window_update rdpWindowUpdate; + struct rdp_window_update + { + rdpContext* context; /* 0 */ + UINT32 paddingA[16 - 1]; /* 1 */ + + pWindowCreate WindowCreate; /* 16 */ + pWindowUpdate WindowUpdate; /* 17 */ + pWindowIcon WindowIcon; /* 18 */ + pWindowCachedIcon WindowCachedIcon; /* 19 */ + pWindowDelete WindowDelete; /* 20 */ + pNotifyIconCreate NotifyIconCreate; /* 21 */ + pNotifyIconUpdate NotifyIconUpdate; /* 22 */ + pNotifyIconDelete NotifyIconDelete; /* 23 */ + pMonitoredDesktop MonitoredDesktop; /* 24 */ + pNonMonitoredDesktop NonMonitoredDesktop; /* 25 */ + UINT32 paddingB[32 - 26]; /* 26 */ + }; + typedef struct rdp_window_update rdpWindowUpdate; + +#ifdef __cplusplus +} +#endif #endif /* FREERDP_UPDATE_WINDOW_H */