From 52405a3e79bf46b6fcdabdeb14a5d3b6be2f2042 Mon Sep 17 00:00:00 2001 From: Martin Haimberger Date: Thu, 27 Aug 2015 05:25:09 -0700 Subject: [PATCH] Remove WIN32ERROR type All return values are UINT now. --- channels/audin/client/alsa/audin_alsa.c | 55 ++- channels/audin/client/audin_main.c | 153 +++++-- .../audin/client/opensles/audin_opensl_es.c | 51 ++- channels/audin/client/oss/audin_oss.c | 51 ++- channels/audin/client/pulse/audin_pulse.c | 54 ++- channels/audin/client/winmm/audin_winmm.c | 48 ++- channels/audin/server/audin.c | 65 ++- channels/client/CMakeLists.txt | 2 +- channels/client/tables.c.in | 1 - channels/cliprdr/client/cliprdr_format.c | 36 +- channels/cliprdr/client/cliprdr_format.h | 10 +- channels/cliprdr/client/cliprdr_main.c | 201 +++++++-- channels/cliprdr/client/cliprdr_main.h | 3 +- channels/cliprdr/server/cliprdr_main.c | 243 +++++++++-- channels/disp/client/disp_main.c | 77 +++- channels/drdynvc/client/drdynvc_main.c | 231 +++++++--- channels/drdynvc/client/drdynvc_main.h | 3 +- channels/drdynvc/server/drdynvc_main.c | 20 +- channels/drive/client/drive_main.c | 122 +++++- channels/echo/client/echo_main.c | 44 +- channels/echo/server/echo_main.c | 25 +- channels/encomsp/client/encomsp_main.c | 199 +++++++-- channels/encomsp/server/encomsp_main.c | 43 +- channels/parallel/client/parallel_main.c | 71 ++- channels/printer/client/printer_cups.c | 7 +- channels/printer/client/printer_main.c | 75 +++- channels/printer/client/printer_main.h | 2 +- channels/printer/client/printer_win.c | 7 +- channels/rail/client/rail_main.c | 212 +++++++-- channels/rail/client/rail_main.h | 2 +- channels/rail/client/rail_orders.c | 286 +++++++++--- channels/rail/client/rail_orders.h | 46 +- channels/rail/rail_common.c | 21 +- channels/rail/rail_common.h | 7 +- channels/rdpdr/client/devman.c | 14 +- channels/rdpdr/client/devman.h | 2 +- channels/rdpdr/client/irp.c | 16 +- channels/rdpdr/client/rdpdr_capabilities.c | 7 +- channels/rdpdr/client/rdpdr_capabilities.h | 2 +- channels/rdpdr/client/rdpdr_main.c | 156 +++++-- channels/rdpdr/client/rdpdr_main.h | 2 +- channels/rdpdr/server/rdpdr_main.c | 406 +++++++++++++++--- channels/rdpdr/server/rdpdr_main.h | 3 +- channels/rdpei/client/rdpei_main.c | 175 ++++++-- channels/rdpei/server/rdpei_main.c | 80 +++- channels/rdpgfx/client/rdpgfx_codec.c | 69 ++- channels/rdpgfx/client/rdpgfx_codec.h | 2 +- channels/rdpgfx/client/rdpgfx_common.c | 56 ++- channels/rdpgfx/client/rdpgfx_common.h | 16 +- channels/rdpgfx/client/rdpgfx_main.c | 256 ++++++++--- channels/rdpsnd/client/alsa/rdpsnd_alsa.c | 16 +- channels/rdpsnd/client/ios/rdpsnd_ios.c | 8 +- channels/rdpsnd/client/mac/rdpsnd_mac.c | 8 +- .../rdpsnd/client/opensles/rdpsnd_opensles.c | 10 +- channels/rdpsnd/client/oss/rdpsnd_oss.c | 7 +- channels/rdpsnd/client/pulse/rdpsnd_pulse.c | 17 +- channels/rdpsnd/client/rdpsnd_main.c | 162 +++++-- channels/rdpsnd/client/rdpsnd_main.h | 4 +- channels/rdpsnd/client/winmm/rdpsnd_winmm.c | 9 +- channels/rdpsnd/server/rdpsnd_main.c | 109 ++++- channels/remdesk/client/remdesk_main.c | 180 ++++++-- channels/remdesk/server/remdesk_main.c | 123 ++++-- channels/serial/client/serial_main.c | 52 ++- channels/smartcard/client/smartcard_main.c | 50 ++- channels/smartcard/client/smartcard_main.h | 4 +- channels/tsmf/client/tsmf_ifman.c | 171 ++++++-- channels/tsmf/client/tsmf_ifman.h | 46 +- channels/tsmf/client/tsmf_main.c | 57 ++- channels/tsmf/client/tsmf_media.c | 13 +- channels/tsmf/client/tsmf_media.h | 2 +- channels/urbdrc/client/urbdrc_main.c | 105 ++++- .../Android/FreeRDPCore/jni/android_cliprdr.c | 71 ++- client/Mac/Clipboard.h | 2 - client/Mac/Clipboard.m | 70 ++- client/Windows/wf_cliprdr.c | 71 ++- client/Windows/wf_rail.c | 56 ++- client/X11/xf_client.c | 7 +- client/X11/xf_cliprdr.c | 43 +- client/X11/xf_gfx.c | 156 ++++++- client/X11/xf_rail.c | 56 ++- include/freerdp/channels/rdpdr.h | 13 +- include/freerdp/client/audin.h | 14 +- include/freerdp/client/cliprdr.h | 41 +- include/freerdp/client/disp.h | 2 +- include/freerdp/client/drdynvc.h | 6 +- include/freerdp/client/encomsp.h | 23 +- include/freerdp/client/rail.h | 41 +- include/freerdp/client/rdpei.h | 13 +- include/freerdp/client/rdpgfx.h | 38 +- include/freerdp/client/rdpsnd.h | 5 +- include/freerdp/dvc.h | 29 +- include/freerdp/freerdp.h | 7 +- include/freerdp/server/audin.h | 9 +- include/freerdp/server/cliprdr.h | 50 +-- include/freerdp/server/drdynvc.h | 4 +- include/freerdp/server/echo.h | 9 +- include/freerdp/server/encomsp.h | 26 +- include/freerdp/server/rdpdr.h | 22 +- include/freerdp/server/rdpei.h | 16 +- include/freerdp/server/rdpsnd.h | 20 +- include/freerdp/server/remdesk.h | 4 +- libfreerdp/core/client.c | 19 +- libfreerdp/core/freerdp.c | 9 +- libfreerdp/gdi/gfx.c | 157 +++++-- server/Mac/mf_audin.c | 21 +- server/Sample/sf_audin.c | 22 +- server/shadow/shadow_audin.c | 21 +- server/shadow/shadow_encomsp.c | 7 +- winpr/include/winpr/win32error.h | 30 -- 109 files changed, 4752 insertions(+), 1346 deletions(-) delete mode 100644 winpr/include/winpr/win32error.h diff --git a/channels/audin/client/alsa/audin_alsa.c b/channels/audin/client/alsa/audin_alsa.c index 9ccd235cc..a3a7b3a02 100644 --- a/channels/audin/client/alsa/audin_alsa.c +++ b/channels/audin/client/alsa/audin_alsa.c @@ -102,11 +102,16 @@ static BOOL audin_alsa_set_params(AudinALSADevice* alsa, snd_pcm_t* capture_hand return TRUE; } -static WIN32ERROR audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, int size) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, int size) { int frames; int cframes; - WIN32ERROR ret = CHANNEL_RC_OK; + UINT ret = CHANNEL_RC_OK; int encoded_size; BYTE* encoded_data; int rbytes_per_frame; @@ -298,7 +303,12 @@ out: return NULL; } -static WIN32ERROR audin_alsa_free(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_free(IAudinDevice* device) { AudinALSADevice* alsa = (AudinALSADevice*) device; @@ -337,7 +347,12 @@ static BOOL audin_alsa_format_supported(IAudinDevice* device, audinFormat* forma return FALSE; } -static WIN32ERROR audin_alsa_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) { int bs; AudinALSADevice* alsa = (AudinALSADevice*) device; @@ -379,7 +394,12 @@ static WIN32ERROR audin_alsa_set_format(IAudinDevice* device, audinFormat* forma return CHANNEL_RC_OK; } -static WIN32ERROR audin_alsa_open(IAudinDevice* device, AudinReceive receive, void* user_data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_open(IAudinDevice* device, AudinReceive receive, void* user_data) { int tbytes_per_frame; AudinALSADevice* alsa = (AudinALSADevice*) device; @@ -416,9 +436,14 @@ error_out: return ERROR_INTERNAL_ERROR; } -static WIN32ERROR audin_alsa_close(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_close(IAudinDevice* device) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; AudinALSADevice* alsa = (AudinALSADevice*) device; if (alsa->stopEvent) @@ -453,7 +478,12 @@ COMMAND_LINE_ARGUMENT_A audin_alsa_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR audin_alsa_parse_addin_args(AudinALSADevice* device, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_alsa_parse_addin_args(AudinALSADevice* device, ADDIN_ARGV* args) { int status; DWORD flags; @@ -494,11 +524,16 @@ static WIN32ERROR audin_alsa_parse_addin_args(AudinALSADevice* device, ADDIN_ARG #define freerdp_audin_client_subsystem_entry alsa_freerdp_audin_client_subsystem_entry #endif -WIN32ERROR freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinALSADevice* alsa; - WIN32ERROR error; + UINT error; alsa = (AudinALSADevice*) calloc(1, sizeof(AudinALSADevice)); if (!alsa) diff --git a/channels/audin/client/audin_main.c b/channels/audin/client/audin_main.c index e34dfd8ec..455257066 100644 --- a/channels/audin/client/audin_main.c +++ b/channels/audin/client/audin_main.c @@ -34,7 +34,6 @@ #include #include -#include #include #include "audin_main.h" @@ -93,9 +92,14 @@ struct _AUDIN_PLUGIN rdpContext* rdpcontext; }; -static WIN32ERROR audin_process_version(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_process_version(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { - WIN32ERROR error; + UINT error; wStream* out; UINT32 Version; AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; @@ -120,7 +124,12 @@ static WIN32ERROR audin_process_version(IWTSVirtualChannelCallback* pChannelCall return error; } -static WIN32ERROR audin_send_incoming_data_pdu(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_send_incoming_data_pdu(IWTSVirtualChannelCallback* pChannelCallback) { BYTE out_data[1]; AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; @@ -129,13 +138,18 @@ static WIN32ERROR audin_send_incoming_data_pdu(IWTSVirtualChannelCallback* pChan return callback->channel->Write(callback->channel, 1, out_data, NULL); } -static WIN32ERROR audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin; UINT32 i; BYTE* fm; - WIN32ERROR error; + UINT error; wStream* out; UINT32 NumFormats; audinFormat format; @@ -237,9 +251,14 @@ out: return error; } -static WIN32ERROR audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 NewFormat) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 NewFormat) { - WIN32ERROR error; + UINT error; wStream* out; AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; @@ -259,9 +278,14 @@ static WIN32ERROR audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChan return error; } -static WIN32ERROR audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 Result) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 Result) { - WIN32ERROR error; + UINT error; wStream* out; AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; @@ -281,9 +305,14 @@ static WIN32ERROR audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannel return error; } -static WIN32ERROR audin_receive_wave_data(BYTE* data, int size, void* user_data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_receive_wave_data(BYTE* data, int size, void* user_data) { - WIN32ERROR error; + UINT error; wStream* out; AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) user_data; @@ -309,14 +338,19 @@ static WIN32ERROR audin_receive_wave_data(BYTE* data, int size, void* user_data) return error; } -static WIN32ERROR audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin; audinFormat* format; UINT32 initialFormat; UINT32 FramesPerPacket; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; Stream_Read_UINT32(s, FramesPerPacket); Stream_Read_UINT32(s, initialFormat); @@ -360,13 +394,18 @@ static WIN32ERROR audin_process_open(IWTSVirtualChannelCallback* pChannelCallbac return error; } -static WIN32ERROR audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallback, wStream* s) { AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; AUDIN_PLUGIN * audin = (AUDIN_PLUGIN*) callback->plugin; UINT32 NewFormat; audinFormat* format; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; Stream_Read_UINT32(s, NewFormat); @@ -409,9 +448,14 @@ static WIN32ERROR audin_process_format_change(IWTSVirtualChannelCallback* pChann return error; } -static WIN32ERROR audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) { - WIN32ERROR error; + UINT error; BYTE MessageId; Stream_Read_UINT8(data, MessageId); @@ -445,11 +489,16 @@ static WIN32ERROR audin_on_data_received(IWTSVirtualChannelCallback* pChannelCal return error; } -static WIN32ERROR audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) { AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback; AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DEBUG_DVC("..."); @@ -466,7 +515,12 @@ static WIN32ERROR audin_on_close(IWTSVirtualChannelCallback* pChannelCallback) return error; } -static WIN32ERROR audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { @@ -493,7 +547,12 @@ static WIN32ERROR audin_on_new_channel_connection(IWTSListenerCallback* pListene return CHANNEL_RC_OK; } -static WIN32ERROR audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; @@ -514,10 +573,15 @@ static WIN32ERROR audin_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChanne (IWTSListenerCallback*) audin->listener_callback, NULL); } -static WIN32ERROR audin_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_plugin_terminated(IWTSPlugin* pPlugin) { AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DEBUG_DVC("..."); @@ -544,7 +608,12 @@ static WIN32ERROR audin_plugin_terminated(IWTSPlugin* pPlugin) return CHANNEL_RC_OK; } -static WIN32ERROR audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice* device) { AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; @@ -560,11 +629,16 @@ static WIN32ERROR audin_register_device_plugin(IWTSPlugin* pPlugin, IAudinDevice return CHANNEL_RC_OK; } -static WIN32ERROR audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name, ADDIN_ARGV* args) { PFREERDP_AUDIN_DEVICE_ENTRY entry; FREERDP_AUDIN_DEVICE_ENTRY_POINTS entryPoints; - WIN32ERROR error; + UINT error; entry = (PFREERDP_AUDIN_DEVICE_ENTRY) freerdp_load_channel_addin_entry("audin", (LPSTR) name, NULL, 0); @@ -588,7 +662,12 @@ static WIN32ERROR audin_load_device_plugin(IWTSPlugin* pPlugin, const char* name return CHANNEL_RC_OK; } -WIN32ERROR audin_set_subsystem(AUDIN_PLUGIN* audin, char* subsystem) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT audin_set_subsystem(AUDIN_PLUGIN* audin, char* subsystem) { free(audin->subsystem); audin->subsystem = _strdup(subsystem); @@ -600,7 +679,12 @@ WIN32ERROR audin_set_subsystem(AUDIN_PLUGIN* audin, char* subsystem) return CHANNEL_RC_OK; } -WIN32ERROR audin_set_device_name(AUDIN_PLUGIN* audin, char* device_name) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT audin_set_device_name(AUDIN_PLUGIN* audin, char* device_name) { free(audin->device_name); audin->device_name = _strdup(device_name); @@ -628,7 +712,7 @@ static BOOL audin_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args) DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) pPlugin; - WIN32ERROR error; + UINT error; flags = COMMAND_LINE_SIGIL_NONE | COMMAND_LINE_SEPARATOR_COLON; @@ -688,9 +772,14 @@ static BOOL audin_process_addin_args(IWTSPlugin* pPlugin, ADDIN_ARGV* args) #define DVCPluginEntry audin_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; ADDIN_ARGV* args; AUDIN_PLUGIN* audin; diff --git a/channels/audin/client/opensles/audin_opensl_es.c b/channels/audin/client/opensles/audin_opensl_es.c index 01facfc4f..51917e4a3 100644 --- a/channels/audin/client/opensles/audin_opensl_es.c +++ b/channels/audin/client/opensles/audin_opensl_es.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -82,7 +81,7 @@ static void* audin_opensles_thread_func(void* arg) AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) arg; const size_t raw_size = opensles->frames_per_packet * opensles->bytes_per_channel; int rc = CHANNEL_RC_OK; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DWORD status; DEBUG_DVC("opensles=%p", opensles); @@ -178,7 +177,12 @@ out: return NULL; } -static WIN32ERROR audin_opensles_free(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_opensles_free(IAudinDevice* device) { AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; @@ -246,7 +250,12 @@ static BOOL audin_opensles_format_supported(IAudinDevice* device, audinFormat* f return FALSE; } -static WIN32ERROR audin_opensles_set_format(IAudinDevice* device, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_opensles_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) { int bs; @@ -311,7 +320,12 @@ static WIN32ERROR audin_opensles_set_format(IAudinDevice* device, return CHANNEL_RC_OK; } -static WIN32ERROR audin_opensles_open(IAudinDevice* device, AudinReceive receive, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_opensles_open(IAudinDevice* device, AudinReceive receive, void* user_data) { AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; @@ -360,9 +374,14 @@ error_out: return ERROR_INTERNAL_ERROR; } -static WIN32ERROR audin_opensles_close(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_opensles_close(IAudinDevice* device) { - WIN32ERROR error; + UINT error; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; DEBUG_DVC("device=%p", device); @@ -409,10 +428,15 @@ static COMMAND_LINE_ARGUMENT_A audin_opensles_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, ADDIN_ARGV* args) { - WIN32ERROR status; + UINT status; DWORD flags; COMMAND_LINE_ARGUMENT_A* arg; AudinOpenSLESDevice* opensles = (AudinOpenSLESDevice*) device; @@ -457,12 +481,17 @@ static WIN32ERROR audin_opensles_parse_addin_args(AudinOpenSLESDevice* device, opensles_freerdp_audin_client_subsystem_entry #endif -WIN32ERROR freerdp_audin_client_subsystem_entry( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_audin_client_subsystem_entry( PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinOpenSLESDevice* opensles; - WIN32ERROR error; + UINT error; DEBUG_DVC("pEntryPoints=%p", pEntryPoints); diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index 9169f49e1..40ff7c068 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -143,7 +142,12 @@ static BOOL audin_oss_format_supported(IAudinDevice* device, audinFormat* format return TRUE; } -static WIN32ERROR audin_oss_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_oss_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) { AudinOSSDevice* oss = (AudinOSSDevice*)device; @@ -172,7 +176,7 @@ static void* audin_oss_thread_func(void* arg) BYTE* buffer = NULL, *encoded_data; int tmp, buffer_size, encoded_size; AudinOSSDevice* oss = (AudinOSSDevice*)arg; - WIN32ERROR error; + UINT error; DWORD status; if (arg == NULL) @@ -192,7 +196,7 @@ static void* audin_oss_thread_func(void* arg) if ((pcm_handle = open(dev_name, O_RDONLY)) < 0) { OSS_LOG_ERR("sound dev open failed", errno); - error = (WIN32ERROR)ERROR_INTERNAL_ERROR; + error = ERROR_INTERNAL_ERROR; goto err_out; } @@ -341,7 +345,12 @@ err_out: return NULL; } -static WIN32ERROR audin_oss_open(IAudinDevice *device, AudinReceive receive, void *user_data) { +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_oss_open(IAudinDevice *device, AudinReceive receive, void *user_data) { AudinOSSDevice *oss = (AudinOSSDevice*)device; oss->receive = receive; @@ -364,9 +373,14 @@ static WIN32ERROR audin_oss_open(IAudinDevice *device, AudinReceive receive, voi return CHANNEL_RC_OK; } -static WIN32ERROR audin_oss_close(IAudinDevice *device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_oss_close(IAudinDevice *device) { - WIN32ERROR error; + UINT error; AudinOSSDevice *oss = (AudinOSSDevice*)device; if (device == NULL) @@ -393,7 +407,12 @@ static WIN32ERROR audin_oss_close(IAudinDevice *device) return CHANNEL_RC_OK; } -static WIN32ERROR audin_oss_free(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_oss_free(IAudinDevice* device) { AudinOSSDevice *oss = (AudinOSSDevice*)device; @@ -418,7 +437,12 @@ COMMAND_LINE_ARGUMENT_A audin_oss_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR audin_oss_parse_addin_args(AudinOSSDevice *device, ADDIN_ARGV *args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_oss_parse_addin_args(AudinOSSDevice *device, ADDIN_ARGV *args) { int status; char* str_num, *eptr; @@ -464,11 +488,16 @@ static WIN32ERROR audin_oss_parse_addin_args(AudinOSSDevice *device, ADDIN_ARGV #define freerdp_audin_client_subsystem_entry oss_freerdp_audin_client_subsystem_entry #endif -WIN32ERROR freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV *args; AudinOSSDevice *oss; - WIN32ERROR error; + UINT error; oss = (AudinOSSDevice*)calloc(1, sizeof(AudinOSSDevice)); if (!oss) diff --git a/channels/audin/client/pulse/audin_pulse.c b/channels/audin/client/pulse/audin_pulse.c index c617b09f8..829e50503 100644 --- a/channels/audin/client/pulse/audin_pulse.c +++ b/channels/audin/client/pulse/audin_pulse.c @@ -29,7 +29,6 @@ #include #include -#include #include @@ -90,7 +89,12 @@ static void audin_pulse_context_state_callback(pa_context* context, void* userda } } -static WIN32ERROR audin_pulse_connect(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_connect(IAudinDevice* device) { pa_context_state_t state; AudinPulseDevice* pulse = (AudinPulseDevice*) device; @@ -131,7 +135,12 @@ static WIN32ERROR audin_pulse_connect(IAudinDevice* device) return CHANNEL_RC_OK; } -static WIN32ERROR audin_pulse_free(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_free(IAudinDevice* device) { AudinPulseDevice* pulse = (AudinPulseDevice*) device; @@ -200,7 +209,12 @@ static BOOL audin_pulse_format_supported(IAudinDevice* device, audinFormat* form return FALSE; } -static WIN32ERROR audin_pulse_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) { int bs; pa_sample_spec sample_spec = { 0 }; @@ -288,7 +302,7 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length int encoded_size; BYTE* encoded_data; AudinPulseDevice* pulse = (AudinPulseDevice*) userdata; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; /* There is a race condition here where we may receive this callback * before the buffer has been set up in the main code. It's probably @@ -354,7 +368,12 @@ static void audin_pulse_stream_request_callback(pa_stream* stream, size_t length } -static WIN32ERROR audin_pulse_close(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_close(IAudinDevice* device) { AudinPulseDevice* pulse = (AudinPulseDevice*) device; @@ -378,7 +397,12 @@ static WIN32ERROR audin_pulse_close(IAudinDevice* device) return CHANNEL_RC_OK; } -static WIN32ERROR audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* user_data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* user_data) { pa_stream_state_t state; pa_buffer_attr buffer_attr = { 0 }; @@ -457,7 +481,12 @@ static COMMAND_LINE_ARGUMENT_A audin_pulse_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_ARGV* args) { int status; DWORD flags; @@ -498,11 +527,16 @@ static WIN32ERROR audin_pulse_parse_addin_args(AudinPulseDevice* device, ADDIN_A #define freerdp_audin_client_subsystem_entry pulse_freerdp_audin_client_subsystem_entry #endif -WIN32ERROR freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinPulseDevice* pulse; - WIN32ERROR error; + UINT error; pulse = (AudinPulseDevice*) calloc(1, sizeof(AudinPulseDevice)); if (!pulse) diff --git a/channels/audin/client/winmm/audin_winmm.c b/channels/audin/client/winmm/audin_winmm.c index 3317d4107..f26a37260 100644 --- a/channels/audin/client/winmm/audin_winmm.c +++ b/channels/audin/client/winmm/audin_winmm.c @@ -60,7 +60,7 @@ static void CALLBACK waveInProc(HWAVEIN hWaveIn, UINT uMsg, DWORD_PTR dwInstance { AudinWinmmDevice* winmm = (AudinWinmmDevice*) dwInstance; PWAVEHDR pWaveHdr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; MMRESULT mmResult; switch(uMsg) @@ -165,7 +165,12 @@ static DWORD audin_winmm_thread_func(void* arg) return 0; } -static WIN32ERROR audin_winmm_free(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_winmm_free(IAudinDevice* device) { UINT32 i; AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; @@ -182,10 +187,15 @@ static WIN32ERROR audin_winmm_free(IAudinDevice* device) return CHANNEL_RC_OK; } -static WIN32ERROR audin_winmm_close(IAudinDevice* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_winmm_close(IAudinDevice* device) { DWORD status; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; SetEvent(winmm->stopEvent); @@ -210,7 +220,12 @@ static WIN32ERROR audin_winmm_close(IAudinDevice* device) return error; } -static WIN32ERROR audin_winmm_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_winmm_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket) { UINT32 i; AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; @@ -274,7 +289,12 @@ static BOOL audin_winmm_format_supported(IAudinDevice* device, audinFormat* form return FALSE; } -static WIN32ERROR audin_winmm_open(IAudinDevice* device, AudinReceive receive, void* user_data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_winmm_open(IAudinDevice* device, AudinReceive receive, void* user_data) { AudinWinmmDevice* winmm = (AudinWinmmDevice*) device; @@ -304,7 +324,12 @@ static COMMAND_LINE_ARGUMENT_A audin_winmm_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_ARGV* args) { int status; DWORD flags; @@ -345,11 +370,16 @@ static WIN32ERROR audin_winmm_parse_addin_args(AudinWinmmDevice* device, ADDIN_A #define freerdp_audin_client_subsystem_entry winmm_freerdp_audin_client_subsystem_entry #endif -WIN32ERROR freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_audin_client_subsystem_entry(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; AudinWinmmDevice* winmm; - WIN32ERROR error; + UINT error; winmm = (AudinWinmmDevice*) calloc(1, sizeof(AudinWinmmDevice)); if (!winmm) diff --git a/channels/audin/server/audin.c b/channels/audin/server/audin.c index daf449870..621af836b 100644 --- a/channels/audin/server/audin.c +++ b/channels/audin/server/audin.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -65,7 +64,12 @@ typedef struct _audin_server } audin_server; -static WIN32ERROR audin_server_select_format(audin_server_context* context, int client_format_index) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_select_format(audin_server_context* context, int client_format_index) { audin_server* audin = (audin_server*) context; @@ -84,7 +88,12 @@ static WIN32ERROR audin_server_select_format(audin_server_context* context, int return CHANNEL_RC_OK; } -static WIN32ERROR audin_server_send_version(audin_server* audin, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_send_version(audin_server* audin, wStream* s) { ULONG written; @@ -98,7 +107,12 @@ static WIN32ERROR audin_server_send_version(audin_server* audin, wStream* s) return CHANNEL_RC_OK; } -static WIN32ERROR audin_server_recv_version(audin_server* audin, wStream* s, UINT32 length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_recv_version(audin_server* audin, wStream* s, UINT32 length) { UINT32 Version; @@ -119,7 +133,12 @@ static WIN32ERROR audin_server_recv_version(audin_server* audin, wStream* s, UIN return CHANNEL_RC_OK; } -static WIN32ERROR audin_server_send_formats(audin_server* audin, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_send_formats(audin_server* audin, wStream* s) { int i; UINT32 nAvgBytesPerSec; @@ -166,10 +185,15 @@ static WIN32ERROR audin_server_send_formats(audin_server* audin, wStream* s) return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), &written) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_recv_formats(audin_server* audin, wStream* s, UINT32 length) { int i; - WIN32ERROR success = CHANNEL_RC_OK; + UINT success = CHANNEL_RC_OK; if (length < 8) { @@ -220,7 +244,12 @@ static WIN32ERROR audin_server_recv_formats(audin_server* audin, wStream* s, UIN return success; } -static WIN32ERROR audin_server_send_open(audin_server* audin, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_send_open(audin_server* audin, wStream* s) { ULONG written; @@ -253,11 +282,16 @@ static WIN32ERROR audin_server_send_open(audin_server* audin, wStream* s) return WTSVirtualChannelWrite(audin->audin_channel, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), &written) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR audin_server_recv_open_reply(audin_server* audin, wStream* s, UINT32 length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_recv_open_reply(audin_server* audin, wStream* s, UINT32 length) { UINT32 Result; - WIN32ERROR success = CHANNEL_RC_OK; + UINT success = CHANNEL_RC_OK; if (length < 4) { @@ -275,7 +309,12 @@ static WIN32ERROR audin_server_recv_open_reply(audin_server* audin, wStream* s, return success; } -static WIN32ERROR audin_server_recv_data(audin_server* audin, wStream* s, UINT32 length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT audin_server_recv_data(audin_server* audin, wStream* s, UINT32 length) { AUDIO_FORMAT* format; int sbytes_per_sample; @@ -283,7 +322,7 @@ static WIN32ERROR audin_server_recv_data(audin_server* audin, wStream* s, UINT32 BYTE* src; int size; int frames; - WIN32ERROR success = CHANNEL_RC_OK; + UINT success = CHANNEL_RC_OK; if (audin->context.selected_client_format < 0) { @@ -352,7 +391,7 @@ static void* audin_server_thread_func(void* arg) HANDLE ChannelEvent; DWORD BytesReturned = 0; audin_server* audin = (audin_server*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DWORD status; buffer = NULL; diff --git a/channels/client/CMakeLists.txt b/channels/client/CMakeLists.txt index 14700be9d..1b20dfe75 100644 --- a/channels/client/CMakeLists.txt +++ b/channels/client/CMakeLists.txt @@ -39,7 +39,7 @@ foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES}) if(${${STATIC_MODULE}_CLIENT_ENTRY} STREQUAL "VirtualChannelEntry") set(ENTRY_POINT_IMPORT "extern BOOL VCAPITYPE ${ENTRY_POINT_NAME}(PCHANNEL_ENTRY_POINTS);") else() - set(ENTRY_POINT_IMPORT "extern WIN32ERROR ${ENTRY_POINT_NAME}();") + set(ENTRY_POINT_IMPORT "extern UINT ${ENTRY_POINT_NAME}();") endif() set(${STATIC_ENTRY}_IMPORTS "${${STATIC_ENTRY}_IMPORTS}\n${ENTRY_POINT_IMPORT}") set(${STATIC_ENTRY}_TABLE "${${STATIC_ENTRY}_TABLE}\n\t{ \"${STATIC_MODULE_CHANNEL}\", ${ENTRY_POINT_NAME} },") diff --git a/channels/client/tables.c.in b/channels/client/tables.c.in index 919738a04..60f052c8d 100644 --- a/channels/client/tables.c.in +++ b/channels/client/tables.c.in @@ -20,7 +20,6 @@ */ #include "tables.h" -#include ${CLIENT_STATIC_ENTRY_IMPORTS} diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index cf2a4ad68..9ab3225ac 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -34,7 +34,12 @@ #include "cliprdr_main.h" #include "cliprdr_format.h" -WIN32ERROR cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) { UINT32 index; UINT32 position; @@ -45,7 +50,7 @@ WIN32ERROR cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT3 CLIPRDR_FORMAT* formats = NULL; CLIPRDR_FORMAT_LIST formatList; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!context->custom) { @@ -213,11 +218,16 @@ error_out: return error; } -WIN32ERROR cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatListResponse"); @@ -238,11 +248,16 @@ WIN32ERROR cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* return error; } -WIN32ERROR cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) { CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatDataRequest"); @@ -266,11 +281,16 @@ WIN32ERROR cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* return error; } -WIN32ERROR cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags) { CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "ServerFormatDataResponse"); diff --git a/channels/cliprdr/client/cliprdr_format.h b/channels/cliprdr/client/cliprdr_format.h index 26589b87a..11fb1bebf 100644 --- a/channels/cliprdr/client/cliprdr_format.h +++ b/channels/cliprdr/client/cliprdr_format.h @@ -23,11 +23,9 @@ #ifndef __CLIPRDR_FORMAT_H #define __CLIPRDR_FORMAT_H -#include - -WIN32ERROR cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -WIN32ERROR cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -WIN32ERROR cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); -WIN32ERROR cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); +UINT cliprdr_process_format_list(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); +UINT cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); +UINT cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); +UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 dataLen, UINT16 msgFlags); #endif /* __CLIPRDR_FORMAT_H */ diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 53f238429..708663381 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -80,11 +80,16 @@ wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataLen) return s; } -WIN32ERROR cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s) { UINT32 pos; UINT32 dataLen; - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; pos = Stream_GetPosition(s); @@ -135,14 +140,19 @@ void cliprdr_print_general_capability_flags(UINT32 flags) WLog_INFO(TAG, "}"); } -static WIN32ERROR cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream* s) { UINT32 version; UINT32 generalFlags; CLIPRDR_CAPABILITIES capabilities; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!context) { @@ -193,13 +203,18 @@ static WIN32ERROR cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wSt return error; } -static WIN32ERROR cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16 length, UINT16 flags) { UINT16 index; UINT16 lengthCapability; UINT16 cCapabilitiesSets; UINT16 capabilitySetType; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; Stream_Read_UINT16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */ Stream_Seek_UINT16(s); /* pad1 (2 bytes) */ @@ -231,11 +246,16 @@ static WIN32ERROR cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, return error; } -static WIN32ERROR cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, UINT16 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, UINT16 length, UINT16 flags) { CLIPRDR_MONITOR_READY monitorReady; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "MonitorReady"); @@ -271,11 +291,16 @@ static WIN32ERROR cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* return error; } -static WIN32ERROR cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) { CLIPRDR_FILE_CONTENTS_REQUEST request; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "FileContentsRequest"); @@ -311,11 +336,16 @@ static WIN32ERROR cliprdr_process_filecontents_request(cliprdrPlugin* cliprdr, w return error; } -static WIN32ERROR cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) { CLIPRDR_FILE_CONTENTS_RESPONSE response; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "FileContentsResponse"); @@ -348,11 +378,16 @@ static WIN32ERROR cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, return error; } -static WIN32ERROR cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) { CLIPRDR_LOCK_CLIPBOARD_DATA lockClipboardData; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "LockClipData"); @@ -381,11 +416,16 @@ static WIN32ERROR cliprdr_process_lock_clipdata(cliprdrPlugin* cliprdr, wStream* return error; } -static WIN32ERROR cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s, UINT32 length, UINT16 flags) { CLIPRDR_UNLOCK_CLIPBOARD_DATA unlockClipboardData; CliprdrClientContext* context = cliprdr_get_client_interface(cliprdr); - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(cliprdr->log, WLOG_DEBUG, "UnlockClipData"); @@ -415,12 +455,17 @@ static WIN32ERROR cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStrea return error; } -static WIN32ERROR cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) { UINT16 msgType; UINT16 msgFlags; UINT32 dataLen; - WIN32ERROR error; + UINT error; Stream_Read_UINT16(s, msgType); /* msgType (2 bytes) */ Stream_Read_UINT16(s, msgFlags); /* msgFlags (2 bytes) */ @@ -498,7 +543,12 @@ static WIN32ERROR cliprdr_order_recv(cliprdrPlugin* cliprdr, wStream* s) * Callback Interface */ -WIN32ERROR cliprdr_client_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) { wStream* s; CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet; @@ -525,7 +575,12 @@ WIN32ERROR cliprdr_client_capabilities(CliprdrClientContext* context, CLIPRDR_CA return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_temp_directory(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_temp_directory(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory) { int length; wStream* s; @@ -559,7 +614,12 @@ WIN32ERROR cliprdr_temp_directory(CliprdrClientContext* context, CLIPRDR_TEMP_DI return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) { wStream* s; UINT32 index; @@ -675,7 +735,12 @@ WIN32ERROR cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FOR return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -695,7 +760,12 @@ WIN32ERROR cliprdr_client_format_list_response(CliprdrClientContext* context, CL return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -716,7 +786,12 @@ WIN32ERROR cliprdr_client_lock_clipboard_data(CliprdrClientContext* context, CLI return cliprdr_packet_send(cliprdr, s);; } -WIN32ERROR cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -736,7 +811,12 @@ WIN32ERROR cliprdr_client_unlock_clipboard_data(CliprdrClientContext* context, C return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -759,7 +839,12 @@ WIN32ERROR cliprdr_client_format_data_request(CliprdrClientContext* context, CLI return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -780,7 +865,12 @@ WIN32ERROR cliprdr_client_format_data_response(CliprdrClientContext* context, CL return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -807,7 +897,12 @@ WIN32ERROR cliprdr_client_file_contents_request(CliprdrClientContext* context, C return cliprdr_packet_send(cliprdr, s); } -WIN32ERROR cliprdr_client_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_client_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wStream* s; cliprdrPlugin* cliprdr = (cliprdrPlugin*) context->handle; @@ -845,7 +940,12 @@ WIN32ERROR cliprdr_client_file_contents_response(CliprdrClientContext* context, static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR cliprdr_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) g_InitHandles = ListDictionary_New(TRUE); @@ -880,7 +980,12 @@ void cliprdr_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR cliprdr_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -922,7 +1027,12 @@ void cliprdr_remove_open_handle_data(DWORD openHandle) } } -static WIN32ERROR cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_virtual_channel_event_data_received(cliprdrPlugin* cliprdr, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -981,7 +1091,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event(DWORD openHandle, UINT LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { cliprdrPlugin* cliprdr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; cliprdr = (cliprdrPlugin*) cliprdr_get_open_handle_data(openHandle); @@ -1015,7 +1125,7 @@ static void* cliprdr_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; cliprdrPlugin* cliprdr = (cliprdrPlugin*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -1053,10 +1163,15 @@ static void* cliprdr_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr, LPVOID pData, UINT32 dataLength) { UINT32 status; - WIN32ERROR error; + UINT error; status = cliprdr->channelEntryPoints.pVirtualChannelOpen(cliprdr->InitHandle, &cliprdr->OpenHandle, cliprdr->channelDef.name, cliprdr_virtual_channel_open_event); @@ -1092,7 +1207,12 @@ static WIN32ERROR cliprdr_virtual_channel_event_connected(cliprdrPlugin* cliprdr return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) { UINT rc; @@ -1124,7 +1244,12 @@ static WIN32ERROR cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* clip return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprdr) { cliprdr_remove_init_handle_data(cliprdr->InitHandle); @@ -1135,7 +1260,7 @@ static WIN32ERROR cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprd static VOID VCAPITYPE cliprdr_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { cliprdrPlugin* cliprdr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; cliprdr = (cliprdrPlugin*) cliprdr_get_init_handle_data(pInitHandle); diff --git a/channels/cliprdr/client/cliprdr_main.h b/channels/cliprdr/client/cliprdr_main.h index aea958921..e80141347 100644 --- a/channels/cliprdr/client/cliprdr_main.h +++ b/channels/cliprdr/client/cliprdr_main.h @@ -23,7 +23,6 @@ #define __CLIPRDR_MAIN_H #include -#include #include #include @@ -54,7 +53,7 @@ struct cliprdr_plugin typedef struct cliprdr_plugin cliprdrPlugin; wStream* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataLen); -WIN32ERROR cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out); +UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* data_out); CliprdrClientContext* cliprdr_get_client_interface(cliprdrPlugin* cliprdr); diff --git a/channels/cliprdr/server/cliprdr_main.c b/channels/cliprdr/server/cliprdr_main.c index 6de11d79f..4480f9716 100644 --- a/channels/cliprdr/server/cliprdr_main.c +++ b/channels/cliprdr/server/cliprdr_main.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "cliprdr_main.h" @@ -87,7 +86,12 @@ wStream* cliprdr_server_packet_new(UINT16 msgType, UINT16 msgFlags, UINT32 dataL return s; } -WIN32ERROR cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) { UINT32 pos; BOOL status; @@ -109,7 +113,12 @@ WIN32ERROR cliprdr_server_packet_send(CliprdrServerPrivate* cliprdr, wStream* s) return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR cliprdr_server_capabilities(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_capabilities(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities) { wStream* s; CLIPRDR_GENERAL_CAPABILITY_SET* generalCapabilitySet; @@ -138,7 +147,12 @@ static WIN32ERROR cliprdr_server_capabilities(CliprdrServerContext* context, CLI return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_monitor_ready(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_monitor_ready(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -159,7 +173,12 @@ static WIN32ERROR cliprdr_server_monitor_ready(CliprdrServerContext* context, CL return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_format_list(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_format_list(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList) { wStream* s; UINT32 index; @@ -274,7 +293,12 @@ static WIN32ERROR cliprdr_server_format_list(CliprdrServerContext* context, CLIP return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_format_list_response(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_format_list_response(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -295,7 +319,12 @@ static WIN32ERROR cliprdr_server_format_list_response(CliprdrServerContext* cont return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_lock_clipboard_data(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -316,7 +345,12 @@ static WIN32ERROR cliprdr_server_lock_clipboard_data(CliprdrServerContext* conte return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_unlock_clipboard_data(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -337,7 +371,12 @@ static WIN32ERROR cliprdr_server_unlock_clipboard_data(CliprdrServerContext* con return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_format_data_request(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_format_data_request(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -360,7 +399,12 @@ static WIN32ERROR cliprdr_server_format_data_request(CliprdrServerContext* conte return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_format_data_response(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_format_data_response(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -381,7 +425,12 @@ static WIN32ERROR cliprdr_server_format_data_response(CliprdrServerContext* cont return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_file_contents_request(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_file_contents_request(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -408,7 +457,12 @@ static WIN32ERROR cliprdr_server_file_contents_request(CliprdrServerContext* con return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_file_contents_response(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_file_contents_response(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wStream* s; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -441,7 +495,12 @@ static WIN32ERROR cliprdr_server_file_contents_response(CliprdrServerContext* co return cliprdr_server_packet_send(cliprdr, s); } -static WIN32ERROR cliprdr_server_receive_general_capability(CliprdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_general_capability(CliprdrServerContext* context, wStream* s) { UINT32 version; UINT32 generalFlags; @@ -465,13 +524,18 @@ static WIN32ERROR cliprdr_server_receive_general_capability(CliprdrServerContext return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_server_receive_capabilities(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_capabilities(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { UINT16 index; UINT16 cCapabilitiesSets; UINT16 capabilitySetType; UINT16 lengthCapability; - WIN32ERROR error; + UINT error; WLog_DBG(TAG, "CliprdrClientCapabilities"); @@ -503,14 +567,19 @@ static WIN32ERROR cliprdr_server_receive_capabilities(CliprdrServerContext* cont return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_server_receive_temporary_directory(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_temporary_directory(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { int length; WCHAR* wszTempDir; CLIPRDR_TEMP_DIRECTORY tempDirectory; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; size_t slength; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if ((slength = Stream_GetRemainingLength(s)) < 520) { @@ -549,7 +618,12 @@ static WIN32ERROR cliprdr_server_receive_temporary_directory(CliprdrServerContex return error; } -static WIN32ERROR cliprdr_server_receive_format_list(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_format_list(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { UINT32 index; UINT32 dataLen; @@ -561,7 +635,7 @@ static WIN32ERROR cliprdr_server_receive_format_list(CliprdrServerContext* conte CLIPRDR_FORMAT* formats = NULL; CLIPRDR_FORMAT_LIST formatList; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; dataLen = header->dataLen; asciiNames = (header->msgFlags & CB_ASCII_NAMES) ? TRUE : FALSE; @@ -713,10 +787,15 @@ static WIN32ERROR cliprdr_server_receive_format_list(CliprdrServerContext* conte return error; } -static WIN32ERROR cliprdr_server_receive_format_list_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_format_list_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_LIST_RESPONSE formatListResponse; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientFormatListResponse"); @@ -731,10 +810,15 @@ static WIN32ERROR cliprdr_server_receive_format_list_response(CliprdrServerConte return error; } -static WIN32ERROR cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_lock_clipdata(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_LOCK_CLIPBOARD_DATA lockClipboardData; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientLockClipData"); @@ -757,10 +841,15 @@ static WIN32ERROR cliprdr_server_receive_lock_clipdata(CliprdrServerContext* con return error; } -static WIN32ERROR cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_UNLOCK_CLIPBOARD_DATA unlockClipboardData; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientUnlockClipData"); @@ -783,10 +872,15 @@ static WIN32ERROR cliprdr_server_receive_unlock_clipdata(CliprdrServerContext* c return error; } -static WIN32ERROR cliprdr_server_receive_format_data_request(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_format_data_request(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_DATA_REQUEST formatDataRequest; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientFormatDataRequest"); @@ -809,10 +903,15 @@ static WIN32ERROR cliprdr_server_receive_format_data_request(CliprdrServerContex return error; } -static WIN32ERROR cliprdr_server_receive_format_data_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_format_data_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_FORMAT_DATA_RESPONSE formatDataResponse; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientFormatDataResponse"); @@ -842,10 +941,15 @@ static WIN32ERROR cliprdr_server_receive_format_data_response(CliprdrServerConte return error; } -static WIN32ERROR cliprdr_server_receive_filecontents_request(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_filecontents_request(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_FILE_CONTENTS_REQUEST request; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientFileContentsRequest"); @@ -874,10 +978,15 @@ static WIN32ERROR cliprdr_server_receive_filecontents_request(CliprdrServerConte return error; } -static WIN32ERROR cliprdr_server_receive_filecontents_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_filecontents_response(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { CLIPRDR_FILE_CONTENTS_RESPONSE response; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "CliprdrClientFileContentsResponse"); @@ -903,9 +1012,14 @@ static WIN32ERROR cliprdr_server_receive_filecontents_response(CliprdrServerCont return error; } -static WIN32ERROR cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_receive_pdu(CliprdrServerContext* context, wStream* s, CLIPRDR_HEADER* header) { - WIN32ERROR error; + UINT error; WLog_DBG(TAG, "CliprdrServerReceivePdu: msgType: %d msgFlags: 0x%08X dataLen: %d", header->msgType, header->msgFlags, header->dataLen); @@ -970,14 +1084,19 @@ static WIN32ERROR cliprdr_server_receive_pdu(CliprdrServerContext* context, wStr return error; } -static WIN32ERROR cliprdr_server_init(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_init(CliprdrServerContext* context) { UINT32 generalFlags; CLIPRDR_CAPABILITIES capabilities; CLIPRDR_MONITOR_READY monitorReady; CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - WIN32ERROR error; + UINT error; ZeroMemory(&capabilities, sizeof(capabilities)); ZeroMemory(&monitorReady, sizeof(monitorReady)); @@ -1013,7 +1132,12 @@ static WIN32ERROR cliprdr_server_init(CliprdrServerContext* context) return error; } -WIN32ERROR cliprdr_server_read(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT cliprdr_server_read(CliprdrServerContext* context) { wStream* s; int position; @@ -1021,7 +1145,7 @@ WIN32ERROR cliprdr_server_read(CliprdrServerContext* context) DWORD BytesReturned; CLIPRDR_HEADER header; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - WIN32ERROR error; + UINT error; DWORD status; s = cliprdr->s; @@ -1164,7 +1288,7 @@ static void* cliprdr_server_thread(void* arg) HANDLE ChannelEvent; CliprdrServerContext* context = (CliprdrServerContext*) arg; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - WIN32ERROR error; + UINT error; ChannelEvent = context->GetEventHandle(context); @@ -1227,7 +1351,12 @@ out: return NULL; } -static WIN32ERROR cliprdr_server_open(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_open(CliprdrServerContext* context) { void* buffer = NULL; DWORD BytesReturned = 0; @@ -1265,7 +1394,12 @@ static WIN32ERROR cliprdr_server_open(CliprdrServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_server_close(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_close(CliprdrServerContext* context) { CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; @@ -1284,10 +1418,15 @@ static WIN32ERROR cliprdr_server_close(CliprdrServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_server_start(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_start(CliprdrServerContext* context) { CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; - WIN32ERROR error; + UINT error; if (!cliprdr->ChannelHandle) { @@ -1316,9 +1455,14 @@ static WIN32ERROR cliprdr_server_start(CliprdrServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR cliprdr_server_stop(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_stop(CliprdrServerContext* context) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; CliprdrServerPrivate* cliprdr = (CliprdrServerPrivate*) context->handle; if (cliprdr->StopEvent) @@ -1346,7 +1490,12 @@ static HANDLE cliprdr_server_get_event_handle(CliprdrServerContext* context) return cliprdr->ChannelEvent; } -static WIN32ERROR cliprdr_server_check_event_handle(CliprdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT cliprdr_server_check_event_handle(CliprdrServerContext* context) { return cliprdr_server_read(context); } diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index 88cef628e..6486388ba 100644 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -35,7 +35,6 @@ #include #include #include -#include #include @@ -74,9 +73,14 @@ struct _DISP_PLUGIN }; typedef struct _DISP_PLUGIN DISP_PLUGIN; -WIN32ERROR disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* callback, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) { - WIN32ERROR status; + UINT status; wStream* s; UINT32 type; UINT32 index; @@ -163,7 +167,12 @@ WIN32ERROR disp_send_display_control_monitor_layout_pdu(DISP_CHANNEL_CALLBACK* c return status; } -WIN32ERROR disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) { DISP_PLUGIN* disp; @@ -184,7 +193,12 @@ WIN32ERROR disp_recv_display_control_caps_pdu(DISP_CHANNEL_CALLBACK* callback, w return CHANNEL_RC_OK; } -WIN32ERROR disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) { UINT32 type; UINT32 length; @@ -211,20 +225,35 @@ WIN32ERROR disp_recv_pdu(DISP_CHANNEL_CALLBACK* callback, wStream* s) } } -static WIN32ERROR disp_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT disp_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) { DISP_CHANNEL_CALLBACK* callback = (DISP_CHANNEL_CALLBACK*) pChannelCallback; return disp_recv_pdu(callback, data); } -static WIN32ERROR disp_on_close(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT disp_on_close(IWTSVirtualChannelCallback* pChannelCallback) { free(pChannelCallback); return CHANNEL_RC_OK; } -static WIN32ERROR disp_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT disp_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { @@ -251,9 +280,14 @@ static WIN32ERROR disp_on_new_channel_connection(IWTSListenerCallback* pListener return CHANNEL_RC_OK; } -static WIN32ERROR disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - WIN32ERROR status; + UINT status; DISP_PLUGIN* disp = (DISP_PLUGIN*) pPlugin; disp->listener_callback = (DISP_LISTENER_CALLBACK*) calloc(1, sizeof(DISP_LISTENER_CALLBACK)); @@ -276,7 +310,12 @@ static WIN32ERROR disp_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannel return status; } -static WIN32ERROR disp_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT disp_plugin_terminated(IWTSPlugin* pPlugin) { free(pPlugin); return CHANNEL_RC_OK; @@ -286,7 +325,12 @@ static WIN32ERROR disp_plugin_terminated(IWTSPlugin* pPlugin) * Channel Client Interface */ -WIN32ERROR disp_send_monitor_layout(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT disp_send_monitor_layout(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors) { DISP_PLUGIN* disp = (DISP_PLUGIN*) context->handle; DISP_CHANNEL_CALLBACK* callback = disp->listener_callback->channel_callback; @@ -298,9 +342,14 @@ WIN32ERROR disp_send_monitor_layout(DispClientContext* context, UINT32 NumMonito #define DVCPluginEntry disp_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DISP_PLUGIN* disp; DispClientContext* context; diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 6586842b8..73e320502 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -32,13 +32,23 @@ static void dvcman_channel_free(void* channel); -static WIN32ERROR dvcman_get_configuration(IWTSListener* pListener, void** ppPropertyBag) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT dvcman_get_configuration(IWTSListener* pListener, void** ppPropertyBag) { *ppPropertyBag = NULL; return ERROR_INTERNAL_ERROR; } -static WIN32ERROR dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, const char* pszChannelName, UINT32 ulFlags, IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener) { @@ -85,7 +95,12 @@ static WIN32ERROR dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr, } } -static WIN32ERROR dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT dvcman_register_plugin(IDRDYNVC_ENTRY_POINTS* pEntryPoints, const char* name, IWTSPlugin* pPlugin) { DVCMAN* dvcman = ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->dvcman; @@ -221,7 +236,12 @@ IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin) return (IWTSVirtualChannelManager*) dvcman; } -WIN32ERROR dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args, rdpSettings* settings) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_load_addin(IWTSVirtualChannelManager* pChannelMgr, ADDIN_ARGV* args, rdpSettings* settings) { DVCMAN_ENTRY_POINTS entryPoints; PDVC_PLUGIN_ENTRY pDVCPluginEntry = NULL; @@ -319,7 +339,7 @@ void dvcman_free(IWTSVirtualChannelManager* pChannelMgr) IWTSPlugin* pPlugin; DVCMAN_LISTENER* listener; DVCMAN* dvcman = (DVCMAN*) pChannelMgr; - WIN32ERROR error; + UINT error; ArrayList_Free(dvcman->channels); @@ -348,12 +368,17 @@ void dvcman_free(IWTSVirtualChannelManager* pChannelMgr) free(dvcman); } -WIN32ERROR dvcman_init(IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_init(IWTSVirtualChannelManager* pChannelMgr) { int i; IWTSPlugin* pPlugin; DVCMAN* dvcman = (DVCMAN*) pChannelMgr; - WIN32ERROR error; + UINT error; for (i = 0; i < dvcman->num_plugins; i++) { @@ -370,9 +395,14 @@ WIN32ERROR dvcman_init(IWTSVirtualChannelManager* pChannelMgr) return CHANNEL_RC_OK; } -static WIN32ERROR dvcman_write_channel(IWTSVirtualChannel* pChannel, UINT32 cbSize, BYTE* pBuffer, void* pReserved) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT dvcman_write_channel(IWTSVirtualChannel* pChannel, UINT32 cbSize, BYTE* pBuffer, void* pReserved) { - WIN32ERROR status; + UINT status; DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel; EnterCriticalSection(&(channel->lock)); @@ -384,7 +414,12 @@ static WIN32ERROR dvcman_write_channel(IWTSVirtualChannel* pChannel, UINT32 cbSi return status; } -static WIN32ERROR dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) { DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel; @@ -393,7 +428,12 @@ static WIN32ERROR dvcman_close_channel_iface(IWTSVirtualChannel* pChannel) return CHANNEL_RC_OK; } -WIN32ERROR dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName) { int i; int bAccept; @@ -402,7 +442,7 @@ WIN32ERROR dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 DrdynvcClientContext* context; IWTSVirtualChannelCallback* pCallback; DVCMAN* dvcman = (DVCMAN*) pChannelMgr; - WIN32ERROR error; + UINT error; if (!(channel = dvcman_channel_new(pChannelMgr, ChannelId, ChannelName))) { @@ -462,11 +502,16 @@ WIN32ERROR dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 return ERROR_INTERNAL_ERROR; } -WIN32ERROR dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) { DVCMAN_CHANNEL* channel; IWTSVirtualChannelCallback* pCallback; - WIN32ERROR error; + UINT error; channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); @@ -490,13 +535,18 @@ WIN32ERROR dvcman_open_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 Ch return CHANNEL_RC_OK; } -WIN32ERROR dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId) { DVCMAN_CHANNEL* channel; IWTSVirtualChannel* ichannel; DrdynvcClientContext* context; DVCMAN* dvcman = (DVCMAN*) pChannelMgr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; channel = (DVCMAN_CHANNEL*) dvcman_find_channel_by_id(pChannelMgr, ChannelId); @@ -537,7 +587,12 @@ WIN32ERROR dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 C return CHANNEL_RC_OK; } -WIN32ERROR dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, UINT32 length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, UINT32 length) { DVCMAN_CHANNEL* channel; @@ -564,9 +619,14 @@ WIN32ERROR dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannel return CHANNEL_RC_OK; } -WIN32ERROR dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, wStream* data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, wStream* data) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; DVCMAN_CHANNEL* channel; size_t dataSize = Stream_GetRemainingLength(data); @@ -631,9 +691,14 @@ static UINT drdynvc_write_variable_uint(wStream* s, UINT32 val) return cb; } -WIN32ERROR drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) { - WIN32ERROR status; + UINT status; if (!drdynvc) { @@ -655,14 +720,19 @@ WIN32ERROR drdynvc_send(drdynvcPlugin* drdynvc, wStream* s) return status; } -WIN32ERROR drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* data, UINT32 dataSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* data, UINT32 dataSize) { wStream* data_out; unsigned long pos = 0; UINT32 cbChId; UINT32 cbLen; unsigned long chunkLength; - WIN32ERROR status; + UINT status; WLog_DBG(TAG, "write_data: ChannelId=%d size=%d", ChannelId, dataSize); @@ -755,9 +825,14 @@ WIN32ERROR drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* da return CHANNEL_RC_OK; } -static WIN32ERROR drdynvc_send_capability_response(drdynvcPlugin* drdynvc) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_send_capability_response(drdynvcPlugin* drdynvc) { - WIN32ERROR status; + UINT status; wStream* s; WLog_DBG(TAG, "capability_response"); @@ -784,9 +859,14 @@ static WIN32ERROR drdynvc_send_capability_response(drdynvcPlugin* drdynvc) return status; } -static WIN32ERROR drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { - WIN32ERROR status; + UINT status; WLog_DBG(TAG, "capability_request Sp=%d cbChId=%d", Sp, cbChId); @@ -833,13 +913,18 @@ static UINT32 drdynvc_read_variable_uint(wStream* s, int cbLen) return val; } -static WIN32ERROR drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { unsigned long pos; - WIN32ERROR status; + UINT status; UINT32 ChannelId; wStream* data_out; - WIN32ERROR channel_status; + UINT channel_status; if (drdynvc->state == DRDYNVC_STATE_CAPABILITIES) { @@ -913,9 +998,14 @@ static WIN32ERROR drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, return status; } -static WIN32ERROR drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { - WIN32ERROR status; + UINT status; UINT32 Length; UINT32 ChannelId; @@ -931,7 +1021,12 @@ static WIN32ERROR drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); } -static WIN32ERROR drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { UINT32 ChannelId; @@ -941,10 +1036,15 @@ static WIN32ERROR drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChI return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, s); } -static WIN32ERROR drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, wStream* s) { int value; - WIN32ERROR error; + UINT error; UINT32 ChannelId; wStream* data_out; @@ -980,7 +1080,12 @@ static WIN32ERROR drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, return error; } -static WIN32ERROR drdynvc_order_recv(drdynvcPlugin* drdynvc, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_order_recv(drdynvcPlugin* drdynvc, wStream* s) { int value; int Cmd; @@ -1029,7 +1134,12 @@ static WIN32ERROR drdynvc_order_recv(drdynvcPlugin* drdynvc, wStream* s) static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR drdynvc_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT drdynvc_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) g_InitHandles = ListDictionary_New(TRUE); @@ -1067,7 +1177,12 @@ void drdynvc_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR drdynvc_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT drdynvc_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -1109,7 +1224,12 @@ void drdynvc_remove_open_handle_data(DWORD openHandle) } } -static WIN32ERROR drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_virtual_channel_event_data_received(drdynvcPlugin* drdynvc, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -1168,7 +1288,7 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event(DWORD openHandle, UINT LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { drdynvcPlugin* drdynvc; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; drdynvc = (drdynvcPlugin*) drdynvc_get_open_handle_data(openHandle); @@ -1202,7 +1322,7 @@ static void* drdynvc_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; drdynvcPlugin* drdynvc = (drdynvcPlugin*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -1242,13 +1362,18 @@ static void* drdynvc_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_virtual_channel_event_connected(drdynvcPlugin* drdynvc, LPVOID pData, UINT32 dataLength) { UINT32 status; UINT32 index; ADDIN_ARGV* args; rdpSettings* settings; - WIN32ERROR error; + UINT error; status = drdynvc->channelEntryPoints.pVirtualChannelOpen(drdynvc->InitHandle, &drdynvc->OpenHandle, drdynvc->channelDef.name, drdynvc_virtual_channel_open_event); @@ -1315,9 +1440,14 @@ error: return error; } -static WIN32ERROR drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdynvc) { - WIN32ERROR status; + UINT status; if (MessageQueue_PostQuit(drdynvc->queue, 0) && (WaitForSingleObject(drdynvc->thread, INFINITE) == WAIT_FAILED)) { @@ -1356,7 +1486,12 @@ static WIN32ERROR drdynvc_virtual_channel_event_disconnected(drdynvcPlugin* drdy return status; } -static WIN32ERROR drdynvc_virtual_channel_event_terminated(drdynvcPlugin* drdynvc) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_virtual_channel_event_terminated(drdynvcPlugin* drdynvc) { drdynvc_remove_init_handle_data(drdynvc->InitHandle); free(drdynvc); @@ -1366,7 +1501,7 @@ static WIN32ERROR drdynvc_virtual_channel_event_terminated(drdynvcPlugin* drdynv static void VCAPITYPE drdynvc_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { drdynvcPlugin* drdynvc; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; drdynvc = (drdynvcPlugin*) drdynvc_get_init_handle_data(pInitHandle); @@ -1417,7 +1552,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) drdynvcPlugin* drdynvc; DrdynvcClientContext* context; CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx; - WIN32ERROR error; + UINT error; drdynvc = (drdynvcPlugin*) calloc(1, sizeof(drdynvcPlugin)); diff --git a/channels/drdynvc/client/drdynvc_main.h b/channels/drdynvc/client/drdynvc_main.h index cdd19f979..be8877021 100644 --- a/channels/drdynvc/client/drdynvc_main.h +++ b/channels/drdynvc/client/drdynvc_main.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -139,6 +138,6 @@ struct drdynvc_plugin IWTSVirtualChannelManager* channel_mgr; }; -WIN32ERROR drdynvc_write_data(drdynvcPlugin* plugin, UINT32 ChannelId, BYTE* data, UINT32 data_size); +UINT drdynvc_write_data(drdynvcPlugin* plugin, UINT32 ChannelId, BYTE* data, UINT32 data_size); #endif diff --git a/channels/drdynvc/server/drdynvc_main.c b/channels/drdynvc/server/drdynvc_main.c index b15d5adb9..c83c88a99 100644 --- a/channels/drdynvc/server/drdynvc_main.c +++ b/channels/drdynvc/server/drdynvc_main.c @@ -27,8 +27,6 @@ #include #include #include -#include - #include "drdynvc_main.h" @@ -46,7 +44,7 @@ static void* drdynvc_server_thread(void* arg) HANDLE ChannelEvent; DWORD BytesReturned; DrdynvcServerContext* context; - WIN32ERROR error = ERROR_INTERNAL_ERROR; + UINT error = ERROR_INTERNAL_ERROR; context = (DrdynvcServerContext*) arg; @@ -113,7 +111,12 @@ static void* drdynvc_server_thread(void* arg) return NULL; } -static WIN32ERROR drdynvc_server_start(DrdynvcServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_server_start(DrdynvcServerContext* context) { context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "drdynvc"); @@ -140,9 +143,14 @@ static WIN32ERROR drdynvc_server_start(DrdynvcServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR drdynvc_server_stop(DrdynvcServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drdynvc_server_stop(DrdynvcServerContext* context) { - WIN32ERROR error; + UINT error; SetEvent(context->priv->StopEvent); if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c index f949894b6..e2a5a39ab 100644 --- a/channels/drive/client/drive_main.c +++ b/channels/drive/client/drive_main.c @@ -109,7 +109,12 @@ static DRIVE_FILE* drive_get_file_by_id(DRIVE_DEVICE* drive, UINT32 id) return file; } -static WIN32ERROR drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) { int status; void* key; @@ -200,7 +205,12 @@ static WIN32ERROR drive_process_irp_create(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_close(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_close(DRIVE_DEVICE* drive, IRP* irp) { void* key; DRIVE_FILE* file; @@ -224,7 +234,12 @@ static WIN32ERROR drive_process_irp_close(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_read(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_read(DRIVE_DEVICE* drive, IRP* irp) { DRIVE_FILE* file; UINT32 Length; @@ -281,7 +296,12 @@ static WIN32ERROR drive_process_irp_read(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_write(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_write(DRIVE_DEVICE* drive, IRP* irp) { DRIVE_FILE* file; UINT32 Length; @@ -315,7 +335,12 @@ static WIN32ERROR drive_process_irp_write(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_query_information(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_query_information(DRIVE_DEVICE* drive, IRP* irp) { DRIVE_FILE* file; UINT32 FsInformationClass; @@ -336,7 +361,12 @@ static WIN32ERROR drive_process_irp_query_information(DRIVE_DEVICE* drive, IRP* return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* irp) { DRIVE_FILE* file; UINT32 FsInformationClass; @@ -365,7 +395,12 @@ static WIN32ERROR drive_process_irp_set_information(DRIVE_DEVICE* drive, IRP* ir return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, IRP* irp) { UINT32 FsInformationClass; wStream* output = irp->output; @@ -482,7 +517,12 @@ static WIN32ERROR drive_process_irp_query_volume_information(DRIVE_DEVICE* drive /* http://msdn.microsoft.com/en-us/library/cc241518.aspx */ -static WIN32ERROR drive_process_irp_silent_ignore(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_silent_ignore(DRIVE_DEVICE* drive, IRP* irp) { UINT32 FsInformationClass; wStream* output = irp->output; @@ -494,7 +534,12 @@ static WIN32ERROR drive_process_irp_silent_ignore(DRIVE_DEVICE* drive, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* irp) { char* path = NULL; int status; @@ -535,7 +580,12 @@ static WIN32ERROR drive_process_irp_query_directory(DRIVE_DEVICE* drive, IRP* ir return irp->Complete(irp); } -static WIN32ERROR drive_process_irp_directory_control(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_directory_control(DRIVE_DEVICE* drive, IRP* irp) { switch (irp->MinorFunction) { @@ -556,15 +606,25 @@ static WIN32ERROR drive_process_irp_directory_control(DRIVE_DEVICE* drive, IRP* return CHANNEL_RC_OK; } -static WIN32ERROR drive_process_irp_device_control(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp_device_control(DRIVE_DEVICE* drive, IRP* irp) { Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */ return irp->Complete(irp); } -static WIN32ERROR drive_process_irp(DRIVE_DEVICE* drive, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_process_irp(DRIVE_DEVICE* drive, IRP* irp) { - WIN32ERROR error; + UINT error; irp->IoStatus = STATUS_SUCCESS; @@ -623,7 +683,7 @@ static void* drive_thread_func(void* arg) IRP* irp; wMessage message; DRIVE_DEVICE* drive = (DRIVE_DEVICE*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -660,7 +720,12 @@ static void* drive_thread_func(void* arg) return NULL; } -static WIN32ERROR drive_irp_request(DEVICE* device, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_irp_request(DEVICE* device, IRP* irp) { DRIVE_DEVICE* drive = (DRIVE_DEVICE*) device; if (!MessageQueue_Post(drive->IrpQueue, NULL, 0, (void*) irp, NULL)) @@ -671,10 +736,15 @@ static WIN32ERROR drive_irp_request(DEVICE* device, IRP* irp) return CHANNEL_RC_OK; } -static WIN32ERROR drive_free(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_free(DEVICE* device) { DRIVE_DEVICE* drive = (DRIVE_DEVICE*) device; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (MessageQueue_PostQuit(drive->IrpQueue, 0) && (WaitForSingleObject(drive->thread, INFINITE) == WAIT_FAILED)) { @@ -694,11 +764,16 @@ static WIN32ERROR drive_free(DEVICE* device) return error; } -WIN32ERROR drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, char* name, char* path) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT drive_register_drive_path(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, char* name, char* path) { int i, length; DRIVE_DEVICE* drive; - WIN32ERROR error; + UINT error; #ifdef WIN32 /* @@ -788,10 +863,15 @@ out_error: UINT sys_code_page = 0; -WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { RDPDR_DRIVE* drive; - WIN32ERROR error; + UINT error; #ifdef WIN32 char* dev; int len; diff --git a/channels/echo/client/echo_main.c b/channels/echo/client/echo_main.c index 5e2a13901..871b75b89 100644 --- a/channels/echo/client/echo_main.c +++ b/channels/echo/client/echo_main.c @@ -61,7 +61,12 @@ struct _ECHO_PLUGIN ECHO_LISTENER_CALLBACK* listener_callback; }; -static WIN32ERROR echo_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) { ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*) pChannelCallback; BYTE* pBuffer = Stream_Pointer(data); @@ -71,7 +76,12 @@ static WIN32ERROR echo_on_data_received(IWTSVirtualChannelCallback* pChannelCall return callback->channel->Write(callback->channel, cbSize, pBuffer, NULL); } -static WIN32ERROR echo_on_close(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_on_close(IWTSVirtualChannelCallback* pChannelCallback) { ECHO_CHANNEL_CALLBACK* callback = (ECHO_CHANNEL_CALLBACK*) pChannelCallback; @@ -80,7 +90,12 @@ static WIN32ERROR echo_on_close(IWTSVirtualChannelCallback* pChannelCallback) return CHANNEL_RC_OK; } -static WIN32ERROR echo_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { @@ -106,7 +121,12 @@ static WIN32ERROR echo_on_new_channel_connection(IWTSListenerCallback* pListener return CHANNEL_RC_OK; } -static WIN32ERROR echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { ECHO_PLUGIN* echo = (ECHO_PLUGIN*) pPlugin; @@ -126,7 +146,12 @@ static WIN32ERROR echo_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannel (IWTSListenerCallback*) echo->listener_callback, NULL); } -static WIN32ERROR echo_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_plugin_terminated(IWTSPlugin* pPlugin) { ECHO_PLUGIN* echo = (ECHO_PLUGIN*) pPlugin; @@ -139,9 +164,14 @@ static WIN32ERROR echo_plugin_terminated(IWTSPlugin* pPlugin) #define DVCPluginEntry echo_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; ECHO_PLUGIN* echo; echo = (ECHO_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "echo"); diff --git a/channels/echo/server/echo_main.c b/channels/echo/server/echo_main.c index 80ff59a58..58cc81261 100644 --- a/channels/echo/server/echo_main.c +++ b/channels/echo/server/echo_main.c @@ -53,7 +53,12 @@ typedef struct _echo_server } echo_server; -static WIN32ERROR echo_server_open_channel(echo_server* echo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_server_open_channel(echo_server* echo) { DWORD Error; HANDLE hEvent; @@ -110,7 +115,7 @@ static void* echo_server_thread_func(void* arg) HANDLE ChannelEvent; DWORD BytesReturned = 0; echo_server* echo = (echo_server*) arg; - WIN32ERROR error; + UINT error; DWORD status; if ((error = echo_server_open_channel(echo))) @@ -239,7 +244,12 @@ out: return NULL; } -static WIN32ERROR echo_server_open(echo_server_context* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_server_open(echo_server_context* context) { echo_server* echo = (echo_server*) context; @@ -262,9 +272,14 @@ static WIN32ERROR echo_server_open(echo_server_context* context) return CHANNEL_RC_OK; } -static WIN32ERROR echo_server_close(echo_server_context* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT echo_server_close(echo_server_context* context) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; echo_server* echo = (echo_server*) context; if (echo->thread) diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index c5ff21bfd..3386c6384 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -31,7 +31,12 @@ #include "encomsp_main.h" -static WIN32ERROR encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) { if (Stream_GetRemainingLength(s) < ENCOMSP_ORDER_HEADER_SIZE) { @@ -45,7 +50,12 @@ static WIN32ERROR encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) return CHANNEL_RC_OK; } -static WIN32ERROR encomsp_write_header(wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_write_header(wStream* s, ENCOMSP_ORDER_HEADER* header) { Stream_Write_UINT16(s, header->Type); /* Type (2 bytes) */ Stream_Write_UINT16(s, header->Length); /* Length (2 bytes) */ @@ -53,7 +63,12 @@ static WIN32ERROR encomsp_write_header(wStream* s, ENCOMSP_ORDER_HEADER* header) return CHANNEL_RC_OK; } -static WIN32ERROR encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) { ZeroMemory(str, sizeof(ENCOMSP_UNICODE_STRING)); @@ -89,9 +104,14 @@ EncomspClientContext* encomsp_get_client_interface(encomspPlugin* encomsp) return pInterface; } -WIN32ERROR encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) { - WIN32ERROR status; + UINT status; if (!encomsp) return ERROR_INVALID_HANDLE; @@ -111,12 +131,17 @@ WIN32ERROR encomsp_virtual_channel_write(encomspPlugin* encomsp, wStream* s) return status; } -static WIN32ERROR encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_FILTER_UPDATED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -161,12 +186,17 @@ static WIN32ERROR encomsp_recv_filter_updated_pdu(encomspPlugin* encomsp, wStrea return error; } -static WIN32ERROR encomsp_recv_application_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_application_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_APPLICATION_CREATED_PDU pdu; - WIN32ERROR error; + UINT error; context = encomsp_get_client_interface(encomsp); @@ -218,12 +248,17 @@ static WIN32ERROR encomsp_recv_application_created_pdu(encomspPlugin* encomsp, w return error; } -static WIN32ERROR encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_APPLICATION_REMOVED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -268,12 +303,17 @@ static WIN32ERROR encomsp_recv_application_removed_pdu(encomspPlugin* encomsp, w return error; } -static WIN32ERROR encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_WINDOW_CREATED_PDU pdu; - WIN32ERROR error; + UINT error; context = encomsp_get_client_interface(encomsp); @@ -326,12 +366,17 @@ static WIN32ERROR encomsp_recv_window_created_pdu(encomspPlugin* encomsp, wStrea return error; } -static WIN32ERROR encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_WINDOW_REMOVED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -376,12 +421,17 @@ static WIN32ERROR encomsp_recv_window_removed_pdu(encomspPlugin* encomsp, wStrea return error; } -static WIN32ERROR encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_SHOW_WINDOW_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -426,12 +476,17 @@ static WIN32ERROR encomsp_recv_show_window_pdu(encomspPlugin* encomsp, wStream* return error; } -static WIN32ERROR encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_PARTICIPANT_CREATED_PDU pdu; - WIN32ERROR error; + UINT error; context = encomsp_get_client_interface(encomsp); @@ -485,12 +540,17 @@ static WIN32ERROR encomsp_recv_participant_created_pdu(encomspPlugin* encomsp, w return error; } -static WIN32ERROR encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_PARTICIPANT_REMOVED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -537,12 +597,17 @@ static WIN32ERROR encomsp_recv_participant_removed_pdu(encomspPlugin* encomsp, w return error; } -static WIN32ERROR encomsp_recv_change_participant_control_level_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_change_participant_control_level_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -588,11 +653,16 @@ static WIN32ERROR encomsp_recv_change_participant_control_level_pdu(encomspPlugi return error; } -static WIN32ERROR encomsp_send_change_participant_control_level_pdu(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_send_change_participant_control_level_pdu(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) { wStream* s; encomspPlugin* encomsp; - WIN32ERROR error; + UINT error; encomsp = (encomspPlugin*) context->handle; @@ -620,12 +690,17 @@ static WIN32ERROR encomsp_send_change_participant_control_level_pdu(EncomspClien return encomsp_virtual_channel_write(encomsp, s); } -static WIN32ERROR encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -662,12 +737,17 @@ static WIN32ERROR encomsp_recv_graphics_stream_paused_pdu(encomspPlugin* encomsp return error; } -static WIN32ERROR encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encomsp, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; EncomspClientContext* context; ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = encomsp_get_client_interface(encomsp); @@ -704,9 +784,14 @@ static WIN32ERROR encomsp_recv_graphics_stream_resumed_pdu(encomspPlugin* encoms return error; } -static WIN32ERROR encomsp_process_receive(encomspPlugin* encomsp, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_process_receive(encomspPlugin* encomsp, wStream* s) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; ENCOMSP_ORDER_HEADER header; while (Stream_GetRemainingLength(s) > 0) @@ -829,7 +914,12 @@ static void encomsp_process_connect(encomspPlugin* encomsp) static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR encomsp_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT encomsp_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) { @@ -866,7 +956,12 @@ void encomsp_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR encomsp_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT encomsp_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -933,7 +1028,12 @@ int encomsp_send(encomspPlugin* encomsp, wStream* s) return status; } -static WIN32ERROR encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_virtual_channel_event_data_received(encomspPlugin* encomsp, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -987,7 +1087,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event(DWORD openHandle, UINT LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { encomspPlugin* encomsp; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; encomsp = (encomspPlugin*) encomsp_get_open_handle_data(openHandle); @@ -1022,7 +1122,7 @@ static void* encomsp_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; encomspPlugin* encomsp = (encomspPlugin*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; encomsp_process_connect(encomsp); @@ -1063,10 +1163,15 @@ static void* encomsp_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_virtual_channel_event_connected(encomspPlugin* encomsp, LPVOID pData, UINT32 dataLength) { UINT32 status; - WIN32ERROR error; + UINT error; status = encomsp->channelEntryPoints.pVirtualChannelOpen(encomsp->InitHandle, &encomsp->OpenHandle, encomsp->channelDef.name, encomsp_virtual_channel_open_event); @@ -1101,7 +1206,12 @@ static WIN32ERROR encomsp_virtual_channel_event_connected(encomspPlugin* encomsp return CHANNEL_RC_OK; } -static WIN32ERROR encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) { UINT rc; @@ -1137,7 +1247,12 @@ static WIN32ERROR encomsp_virtual_channel_event_disconnected(encomspPlugin* enco } -static WIN32ERROR encomsp_virtual_channel_event_terminated(encomspPlugin* encomsp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_virtual_channel_event_terminated(encomspPlugin* encomsp) { encomsp_remove_init_handle_data(encomsp->InitHandle); free(encomsp); @@ -1147,7 +1262,7 @@ static WIN32ERROR encomsp_virtual_channel_event_terminated(encomspPlugin* encoms static void VCAPITYPE encomsp_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { encomspPlugin* encomsp; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; encomsp = (encomspPlugin*) encomsp_get_init_handle_data(pInitHandle); @@ -1192,7 +1307,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) EncomspClientContext* context; CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx; BOOL isFreerdp = FALSE; - WIN32ERROR error; + UINT error; encomsp = (encomspPlugin*) calloc(1, sizeof(encomspPlugin)); if (!encomsp) diff --git a/channels/encomsp/server/encomsp_main.c b/channels/encomsp/server/encomsp_main.c index b915c0ed0..ce2ca6c19 100644 --- a/channels/encomsp/server/encomsp_main.c +++ b/channels/encomsp/server/encomsp_main.c @@ -33,7 +33,12 @@ #define TAG CHANNELS_TAG("encomsp.server") -static WIN32ERROR encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_read_header(wStream* s, ENCOMSP_ORDER_HEADER* header) { if (Stream_GetRemainingLength(s) < ENCOMSP_ORDER_HEADER_SIZE) return ERROR_INVALID_DATA; @@ -76,11 +81,16 @@ static int encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str) #endif -static WIN32ERROR encomsp_recv_change_participant_control_level_pdu(EncomspServerContext* context, wStream* s, ENCOMSP_ORDER_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_recv_change_participant_control_level_pdu(EncomspServerContext* context, wStream* s, ENCOMSP_ORDER_HEADER* header) { int beg, end; ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; beg = ((int) Stream_GetPosition(s)) - ENCOMSP_ORDER_HEADER_SIZE; @@ -121,9 +131,14 @@ static WIN32ERROR encomsp_recv_change_participant_control_level_pdu(EncomspServe return error; } -static WIN32ERROR encomsp_server_receive_pdu(EncomspServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_server_receive_pdu(EncomspServerContext* context, wStream* s) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; ENCOMSP_ORDER_HEADER header; while (Stream_GetRemainingLength(s) > 0) @@ -167,7 +182,7 @@ static void* encomsp_server_thread(void* arg) DWORD BytesReturned; ENCOMSP_ORDER_HEADER* header; EncomspServerContext* context; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DWORD status; context = (EncomspServerContext*) arg; @@ -265,7 +280,12 @@ out: return NULL; } -static WIN32ERROR encomsp_server_start(EncomspServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_server_start(EncomspServerContext* context) { context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "encomsp"); @@ -290,9 +310,14 @@ static WIN32ERROR encomsp_server_start(EncomspServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR encomsp_server_stop(EncomspServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_server_stop(EncomspServerContext* context) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; SetEvent(context->priv->StopEvent); if (WaitForSingleObject(context->priv->Thread, INFINITE) == WAIT_FAILED) diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c index c1d67a8e6..2bd90f242 100644 --- a/channels/parallel/client/parallel_main.c +++ b/channels/parallel/client/parallel_main.c @@ -74,7 +74,12 @@ struct _PARALLEL_DEVICE }; typedef struct _PARALLEL_DEVICE PARALLEL_DEVICE; -static WIN32ERROR parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; @@ -120,7 +125,12 @@ static WIN32ERROR parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* ir return irp->Complete(irp); } -static WIN32ERROR parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp) { if (close(parallel->file) < 0) { @@ -136,7 +146,12 @@ static WIN32ERROR parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp return irp->Complete(irp); } -static WIN32ERROR parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) { UINT32 Length; UINT64 Offset; @@ -185,7 +200,12 @@ static WIN32ERROR parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) return irp->Complete(irp); } -static WIN32ERROR parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp) { UINT32 len; UINT32 Length; @@ -219,15 +239,25 @@ static WIN32ERROR parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp return irp->Complete(irp); } -static WIN32ERROR parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp) { Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */ return irp->Complete(irp); } -static WIN32ERROR parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp) { - WIN32ERROR error; + UINT error; switch (irp->MajorFunction) { @@ -284,7 +314,7 @@ static void* parallel_thread_func(void* arg) IRP* irp; wMessage message; PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -320,7 +350,12 @@ static void* parallel_thread_func(void* arg) return NULL; } -static WIN32ERROR parallel_irp_request(DEVICE* device, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_irp_request(DEVICE* device, IRP* irp) { PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device; @@ -332,9 +367,14 @@ static WIN32ERROR parallel_irp_request(DEVICE* device, IRP* irp) return CHANNEL_RC_OK; } -static WIN32ERROR parallel_free(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT parallel_free(DEVICE* device) { - WIN32ERROR error; + UINT error; PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device; if (MessageQueue_PostQuit(parallel->queue, 0) && (WaitForSingleObject(parallel->thread, INFINITE) == WAIT_FAILED)) @@ -356,7 +396,12 @@ static WIN32ERROR parallel_free(DEVICE* device) #define DeviceServiceEntry parallel_DeviceServiceEntry #endif -WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { char* name; char* path; @@ -364,7 +409,7 @@ WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) size_t length; RDPDR_PARALLEL* device; PARALLEL_DEVICE* parallel; - WIN32ERROR error; + UINT error; device = (RDPDR_PARALLEL*) pEntryPoints->device; name = device->Name; diff --git a/channels/printer/client/printer_cups.c b/channels/printer/client/printer_cups.c index a80cecc32..d498ff6f6 100644 --- a/channels/printer/client/printer_cups.c +++ b/channels/printer/client/printer_cups.c @@ -78,7 +78,12 @@ static void printer_cups_get_printjob_name(char* buf, int size) t->tm_hour, t->tm_min, t->tm_sec); } -static WIN32ERROR printer_cups_write_printjob(rdpPrintJob* printjob, BYTE* data, int size) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_cups_write_printjob(rdpPrintJob* printjob, BYTE* data, int size) { rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*) printjob; diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index f9562f739..561c253f7 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -66,7 +66,12 @@ struct _PRINTER_DEVICE rdpContext* rdpcontext; }; -static WIN32ERROR printer_process_irp_create(PRINTER_DEVICE* printer_dev, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_process_irp_create(PRINTER_DEVICE* printer_dev, IRP* irp) { rdpPrintJob* printjob = NULL; @@ -86,7 +91,12 @@ static WIN32ERROR printer_process_irp_create(PRINTER_DEVICE* printer_dev, IRP* i return irp->Complete(irp); } -static WIN32ERROR printer_process_irp_close(PRINTER_DEVICE* printer_dev, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_process_irp_close(PRINTER_DEVICE* printer_dev, IRP* irp) { rdpPrintJob* printjob = NULL; @@ -107,12 +117,17 @@ static WIN32ERROR printer_process_irp_close(PRINTER_DEVICE* printer_dev, IRP* ir return irp->Complete(irp); } -static WIN32ERROR printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp) { UINT32 Length; UINT64 Offset; rdpPrintJob* printjob = NULL; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; Stream_Read_UINT32(irp->input, Length); Stream_Read_UINT64(irp->input, Offset); @@ -143,15 +158,25 @@ static WIN32ERROR printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* ir return irp->Complete(irp); } -static WIN32ERROR printer_process_irp_device_control(PRINTER_DEVICE* printer_dev, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_process_irp_device_control(PRINTER_DEVICE* printer_dev, IRP* irp) { Stream_Write_UINT32(irp->output, 0); /* OutputBufferLength */ return irp->Complete(irp); } -static WIN32ERROR printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_process_irp(PRINTER_DEVICE* printer_dev, IRP* irp) { - WIN32ERROR error; + UINT error; switch (irp->MajorFunction) { case IRP_MJ_CREATE: @@ -199,7 +224,7 @@ static void* printer_thread_func(void* arg) IRP* irp; PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) arg; HANDLE obj[] = {printer_dev->event, printer_dev->stopEvent}; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -241,7 +266,12 @@ static void* printer_thread_func(void* arg) return NULL; } -static WIN32ERROR printer_irp_request(DEVICE* device, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_irp_request(DEVICE* device, IRP* irp) { PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device; @@ -251,11 +281,16 @@ static WIN32ERROR printer_irp_request(DEVICE* device, IRP* irp) return CHANNEL_RC_OK; } -static WIN32ERROR printer_free(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_free(DEVICE* device) { IRP* irp; PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device; - WIN32ERROR error; + UINT error; SetEvent(printer_dev->stopEvent); if (WaitForSingleObject(printer_dev->thread, INFINITE) == WAIT_FAILED) @@ -283,7 +318,12 @@ static WIN32ERROR printer_free(DEVICE* device) return CHANNEL_RC_OK; } -WIN32ERROR printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* printer) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* printer) { char* port; UINT32 Flags; @@ -294,7 +334,7 @@ WIN32ERROR printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinte UINT32 CachedFieldsLen; BYTE* CachedPrinterConfigData; PRINTER_DEVICE* printer_dev; - WIN32ERROR error; + UINT error; port = malloc(10); if (!port) @@ -411,7 +451,12 @@ error_out: #define DeviceServiceEntry printer_DeviceServiceEntry #endif -WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { int i; char* name; @@ -420,7 +465,7 @@ WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) rdpPrinter** printers; RDPDR_PRINTER* device; rdpPrinterDriver* driver = NULL; - WIN32ERROR error; + UINT error; #ifdef WITH_CUPS driver = printer_cups_get_driver(); diff --git a/channels/printer/client/printer_main.h b/channels/printer/client/printer_main.h index 65c520e79..8a2c85082 100644 --- a/channels/printer/client/printer_main.h +++ b/channels/printer/client/printer_main.h @@ -66,7 +66,7 @@ struct rdp_printer pcFreePrinter Free; }; -typedef WIN32ERROR (*pcWritePrintJob) (rdpPrintJob* printjob, BYTE* data, int size); +typedef UINT (*pcWritePrintJob) (rdpPrintJob* printjob, BYTE* data, int size); typedef void (*pcClosePrintJob) (rdpPrintJob* printjob); struct rdp_print_job diff --git a/channels/printer/client/printer_win.c b/channels/printer/client/printer_win.c index efecb5f88..f30beebab 100644 --- a/channels/printer/client/printer_win.c +++ b/channels/printer/client/printer_win.c @@ -77,7 +77,12 @@ static void printer_win_get_printjob_name(char* buf, int size) t->tm_hour, t->tm_min, t->tm_sec); } -static WIN32ERROR printer_win_write_printjob(rdpPrintJob* printjob, BYTE* data, int size) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT printer_win_write_printjob(rdpPrintJob* printjob, BYTE* data, int size) { rdpWinPrintJob* win_printjob = (rdpWinPrintJob*) printjob; diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index f04211279..4294cf64a 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -40,9 +40,14 @@ RailClientContext* rail_get_client_interface(railPlugin* rail) return pInterface; } -WIN32ERROR rail_send(railPlugin* rail, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send(railPlugin* rail, wStream* s) { - WIN32ERROR status; + UINT status; if (!rail) { @@ -64,7 +69,12 @@ WIN32ERROR rail_send(railPlugin* rail, wStream* s) return status; } -WIN32ERROR rail_send_channel_data(railPlugin* rail, void* data, size_t length) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_channel_data(railPlugin* rail, void* data, size_t length) { wStream* s = NULL; @@ -83,7 +93,12 @@ WIN32ERROR rail_send_channel_data(railPlugin* rail, void* data, size_t length) * Callback Interface */ -WIN32ERROR rail_client_execute(RailClientContext* context, RAIL_EXEC_ORDER* exec) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_execute(RailClientContext* context, RAIL_EXEC_ORDER* exec) { char* exeOrFile; railPlugin* rail = (railPlugin*) context->handle; @@ -106,19 +121,29 @@ WIN32ERROR rail_client_execute(RailClientContext* context, RAIL_EXEC_ORDER* exec return rail_send_client_exec_order(rail, exec); } -WIN32ERROR rail_client_activate(RailClientContext* context, RAIL_ACTIVATE_ORDER* activate) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_activate(RailClientContext* context, RAIL_ACTIVATE_ORDER* activate) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_activate_order(rail, activate); } -WIN32ERROR rail_send_client_sysparam(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_sysparam(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { wStream* s; int length; railPlugin* rail = (railPlugin*) context->handle; - WIN32ERROR error; + UINT error; length = RAIL_SYSPARAM_ORDER_LENGTH; @@ -165,9 +190,14 @@ WIN32ERROR rail_send_client_sysparam(RailClientContext* context, RAIL_SYSPARAM_O return error; } -WIN32ERROR rail_client_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (sysparam->params & SPI_MASK_SET_HIGH_CONTRAST) { @@ -242,105 +272,190 @@ WIN32ERROR rail_client_system_param(RailClientContext* context, RAIL_SYSPARAM_OR return error; } -WIN32ERROR rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_client_system_command(RailClientContext* context, RAIL_SYSCOMMAND_ORDER* syscommand) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_system_command(RailClientContext* context, RAIL_SYSCOMMAND_ORDER* syscommand) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_syscommand_order(rail, syscommand); } -WIN32ERROR rail_client_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_handshake_order(rail, handshake); } -WIN32ERROR rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_client_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_handshake_ex_order(rail, handshakeEx); } -WIN32ERROR rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_client_notify_event(RailClientContext* context, RAIL_NOTIFY_EVENT_ORDER* notifyEvent) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_notify_event(RailClientContext* context, RAIL_NOTIFY_EVENT_ORDER* notifyEvent) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_notify_event_order(rail, notifyEvent); } -WIN32ERROR rail_client_window_move(RailClientContext* context, RAIL_WINDOW_MOVE_ORDER* windowMove) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_window_move(RailClientContext* context, RAIL_WINDOW_MOVE_ORDER* windowMove) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_window_move_order(rail, windowMove); } -WIN32ERROR rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_client_information(RailClientContext* context, RAIL_CLIENT_STATUS_ORDER* clientStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_information(RailClientContext* context, RAIL_CLIENT_STATUS_ORDER* clientStatus) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_status_order(rail, clientStatus); } -WIN32ERROR rail_client_system_menu(RailClientContext* context, RAIL_SYSMENU_ORDER* sysmenu) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_system_menu(RailClientContext* context, RAIL_SYSMENU_ORDER* sysmenu) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_sysmenu_order(rail, sysmenu); } -WIN32ERROR rail_client_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_langbar_info_order(rail, langBarInfo); } -WIN32ERROR rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } -WIN32ERROR rail_client_get_appid_request(RailClientContext* context, RAIL_GET_APPID_REQ_ORDER* getAppIdReq) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_client_get_appid_request(RailClientContext* context, RAIL_GET_APPID_REQ_ORDER* getAppIdReq) { railPlugin* rail = (railPlugin*) context->handle; return rail_send_client_get_appid_req_order(rail, getAppIdReq); } -WIN32ERROR rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { return CHANNEL_RC_OK; /* stub - should be registered by client */ } @@ -350,7 +465,12 @@ WIN32ERROR rail_server_get_appid_response(RailClientContext* context, RAIL_GET_A static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR rail_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) { @@ -387,7 +507,12 @@ void rail_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR rail_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -428,7 +553,12 @@ void rail_remove_open_handle_data(DWORD openHandle) } } -static WIN32ERROR rail_virtual_channel_event_data_received(railPlugin* rail, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rail_virtual_channel_event_data_received(railPlugin* rail, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -484,7 +614,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event(DWORD openHandle, UINT eve LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { railPlugin* rail; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rail = (railPlugin*) rail_get_open_handle_data(openHandle); @@ -520,7 +650,7 @@ static void* rail_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; railPlugin* rail = (railPlugin*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -558,9 +688,14 @@ static void* rail_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData, UINT32 dataLength) { - WIN32ERROR status; + UINT status; status = rail->channelEntryPoints.pVirtualChannelOpen(rail->InitHandle, &rail->OpenHandle, rail->channelDef.name, rail_virtual_channel_open_event); @@ -596,7 +731,12 @@ static WIN32ERROR rail_virtual_channel_event_connected(railPlugin* rail, LPVOID return CHANNEL_RC_OK; } -static WIN32ERROR rail_virtual_channel_event_disconnected(railPlugin* rail) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) { UINT rc; if (MessageQueue_PostQuit(rail->queue, 0) && (WaitForSingleObject(rail->thread, INFINITE) == WAIT_FAILED)) @@ -639,7 +779,7 @@ static void rail_virtual_channel_event_terminated(railPlugin* rail) static VOID VCAPITYPE rail_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { railPlugin* rail; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rail = (railPlugin*) rail_get_init_handle_data(pInitHandle); @@ -682,7 +822,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) RailClientContext* context; CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx; BOOL isFreerdp = FALSE; - WIN32ERROR error; + UINT error; rail = (railPlugin*) calloc(1, sizeof(railPlugin)); if (!rail) diff --git a/channels/rail/client/rail_main.h b/channels/rail/client/rail_main.h index 91a15ae3f..ff8238608 100644 --- a/channels/rail/client/rail_main.h +++ b/channels/rail/client/rail_main.h @@ -54,6 +54,6 @@ struct rail_plugin typedef struct rail_plugin railPlugin; RailClientContext* rail_get_client_interface(railPlugin* rail); -WIN32ERROR rail_send_channel_data(railPlugin* rail, void* data, size_t length); +UINT rail_send_channel_data(railPlugin* rail, void* data, size_t length); #endif /* FREERDP_CHANNEL_CLIENT_RAIL_MAIN_H */ diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index f43b92d68..570740ee0 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -31,7 +31,12 @@ #include "rail_orders.h" -static WIN32ERROR rail_write_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rail_write_unicode_string(wStream* s, RAIL_UNICODE_STRING* unicode_string) { if (!Stream_EnsureRemainingCapacity(s, 2 + unicode_string->length)) { @@ -44,7 +49,12 @@ static WIN32ERROR rail_write_unicode_string(wStream* s, RAIL_UNICODE_STRING* uni return CHANNEL_RC_OK; } -static WIN32ERROR rail_write_unicode_string_value(wStream* s, RAIL_UNICODE_STRING* unicode_string) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rail_write_unicode_string_value(wStream* s, RAIL_UNICODE_STRING* unicode_string) { if (unicode_string->length > 0) { @@ -59,7 +69,12 @@ static WIN32ERROR rail_write_unicode_string_value(wStream* s, RAIL_UNICODE_STRIN return CHANNEL_RC_OK; } -WIN32ERROR rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) { UINT16 orderLength; @@ -75,7 +90,12 @@ WIN32ERROR rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) return rail_send_channel_data(rail, Stream_Buffer(s), orderLength); } -WIN32ERROR rail_write_high_contrast(wStream* s, RAIL_HIGH_CONTRAST* highContrast) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_write_high_contrast(wStream* s, RAIL_HIGH_CONTRAST* highContrast) { highContrast->colorSchemeLength = highContrast->colorScheme.length + 2; Stream_Write_UINT32(s, highContrast->flags); /* flags (4 bytes) */ @@ -83,7 +103,12 @@ WIN32ERROR rail_write_high_contrast(wStream* s, RAIL_HIGH_CONTRAST* highContrast return rail_write_unicode_string(s, &highContrast->colorScheme); /* colorScheme */ } -WIN32ERROR rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* execResult) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* execResult) { if (Stream_GetRemainingLength(s) < 8) { @@ -99,7 +124,12 @@ WIN32ERROR rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER return rail_read_unicode_string(s, &execResult->exeOrFile) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; /* exeOrFile */ } -WIN32ERROR rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam) { BYTE body; @@ -129,7 +159,12 @@ WIN32ERROR rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysp return CHANNEL_RC_OK; } -WIN32ERROR rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo) { if (Stream_GetRemainingLength(s) < 20) { @@ -150,7 +185,12 @@ WIN32ERROR rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* return CHANNEL_RC_OK; } -WIN32ERROR rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { UINT16 isMoveSizeStart; @@ -172,7 +212,12 @@ WIN32ERROR rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_O return CHANNEL_RC_OK; } -WIN32ERROR rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* getAppidResp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* getAppidResp) { if (Stream_GetRemainingLength(s) < 516) { @@ -186,7 +231,12 @@ WIN32ERROR rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP return CHANNEL_RC_OK; } -WIN32ERROR rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbarInfo) { if (Stream_GetRemainingLength(s) < 4) { @@ -204,9 +254,14 @@ void rail_write_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* client Stream_Write_UINT32(s, clientStatus->flags); /* flags (4 bytes) */ } -WIN32ERROR rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) { - WIN32ERROR error; + UINT error; Stream_Write_UINT16(s, exec->flags); /* flags (2 bytes) */ Stream_Write_UINT16(s, exec->exeOrFile.length); /* exeOrFileLength (2 bytes) */ Stream_Write_UINT16(s, exec->workingDir.length); /* workingDirLength (2 bytes) */ @@ -229,10 +284,15 @@ WIN32ERROR rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec) return error; } -WIN32ERROR rail_write_client_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_write_client_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam) { BYTE body; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; Stream_Write_UINT32(s, sysparam->param); /* systemParam (4 bytes) */ @@ -336,10 +396,15 @@ void rail_write_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbarI Stream_Write_UINT32(s, langbarInfo->languageBarStatus); /* languageBarStatus (4 bytes) */ } -WIN32ERROR rail_recv_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_handshake_order(s, handshake))) { @@ -357,10 +422,15 @@ WIN32ERROR rail_recv_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* han return error; } -WIN32ERROR rail_recv_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_handshake_ex_order(s, handshakeEx))) { @@ -379,10 +449,15 @@ WIN32ERROR rail_recv_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDE return error; } -WIN32ERROR rail_recv_exec_result_order(railPlugin* rail, RAIL_EXEC_RESULT_ORDER* execResult, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_exec_result_order(railPlugin* rail, RAIL_EXEC_RESULT_ORDER* execResult, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; ZeroMemory(execResult, sizeof(RAIL_EXEC_RESULT_ORDER)); @@ -403,10 +478,15 @@ WIN32ERROR rail_recv_exec_result_order(railPlugin* rail, RAIL_EXEC_RESULT_ORDER* return error; } -WIN32ERROR rail_recv_server_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_server_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_server_sysparam_order(s, sysparam))) { @@ -424,10 +504,15 @@ WIN32ERROR rail_recv_server_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER return error; } -WIN32ERROR rail_recv_server_minmaxinfo_order(railPlugin* rail, RAIL_MINMAXINFO_ORDER* minMaxInfo, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_server_minmaxinfo_order(railPlugin* rail, RAIL_MINMAXINFO_ORDER* minMaxInfo, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_server_minmaxinfo_order(s, minMaxInfo))) { @@ -445,10 +530,15 @@ WIN32ERROR rail_recv_server_minmaxinfo_order(railPlugin* rail, RAIL_MINMAXINFO_O return error; } -WIN32ERROR rail_recv_server_localmovesize_order(railPlugin* rail, RAIL_LOCALMOVESIZE_ORDER* localMoveSize, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_server_localmovesize_order(railPlugin* rail, RAIL_LOCALMOVESIZE_ORDER* localMoveSize, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_server_localmovesize_order(s, localMoveSize))) { @@ -466,10 +556,15 @@ WIN32ERROR rail_recv_server_localmovesize_order(railPlugin* rail, RAIL_LOCALMOVE return error; } -WIN32ERROR rail_recv_server_get_appid_resp_order(railPlugin* rail, RAIL_GET_APPID_RESP_ORDER* getAppIdResp, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_server_get_appid_resp_order(railPlugin* rail, RAIL_GET_APPID_RESP_ORDER* getAppIdResp, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_server_get_appid_resp_order(s, getAppIdResp))) { @@ -487,10 +582,15 @@ WIN32ERROR rail_recv_server_get_appid_resp_order(railPlugin* rail, RAIL_GET_APPI return error; } -WIN32ERROR rail_recv_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_recv_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo, wStream* s) { RailClientContext* context = rail_get_client_interface(rail); - WIN32ERROR error; + UINT error; if ((error = rail_read_langbar_info_order(s, langBarInfo))) { @@ -508,11 +608,16 @@ WIN32ERROR rail_recv_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDE return error; } -WIN32ERROR rail_order_recv(railPlugin* rail, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_order_recv(railPlugin* rail, wStream* s) { UINT16 orderType; UINT16 orderLength; - WIN32ERROR error; + UINT error; if ((error = rail_read_pdu_header(s, &orderType, &orderLength))) { @@ -582,10 +687,15 @@ WIN32ERROR rail_order_recv(railPlugin* rail, wStream* s) return CHANNEL_RC_OK; } -WIN32ERROR rail_send_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_HANDSHAKE_ORDER_LENGTH); if (!s) @@ -600,10 +710,15 @@ WIN32ERROR rail_send_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* han return error; } -WIN32ERROR rail_send_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_HANDSHAKE_EX_ORDER_LENGTH); if (!s) { @@ -617,10 +732,15 @@ WIN32ERROR rail_send_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDE return error; } -WIN32ERROR rail_send_client_status_order(railPlugin* rail, RAIL_CLIENT_STATUS_ORDER* clientStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_status_order(railPlugin* rail, RAIL_CLIENT_STATUS_ORDER* clientStatus) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_CLIENT_STATUS_ORDER_LENGTH); if (!s) @@ -635,10 +755,15 @@ WIN32ERROR rail_send_client_status_order(railPlugin* rail, RAIL_CLIENT_STATUS_OR return error; } -WIN32ERROR rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec) { wStream* s; - WIN32ERROR error; + UINT error; size_t length; length = RAIL_EXEC_ORDER_LENGTH + @@ -667,11 +792,16 @@ WIN32ERROR rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec) return error; } -WIN32ERROR rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam) { wStream* s; int length; - WIN32ERROR error; + UINT error; length = RAIL_SYSPARAM_ORDER_LENGTH; @@ -718,9 +848,14 @@ WIN32ERROR rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER return error; } -WIN32ERROR rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (sysparam->params & SPI_MASK_SET_HIGH_CONTRAST) { @@ -795,10 +930,15 @@ WIN32ERROR rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDE return error; } -WIN32ERROR rail_send_client_activate_order(railPlugin* rail, RAIL_ACTIVATE_ORDER* activate) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_activate_order(railPlugin* rail, RAIL_ACTIVATE_ORDER* activate) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_ACTIVATE_ORDER_LENGTH); if (!s) @@ -813,10 +953,15 @@ WIN32ERROR rail_send_client_activate_order(railPlugin* rail, RAIL_ACTIVATE_ORDER return error; } -WIN32ERROR rail_send_client_sysmenu_order(railPlugin* rail, RAIL_SYSMENU_ORDER* sysmenu) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_sysmenu_order(railPlugin* rail, RAIL_SYSMENU_ORDER* sysmenu) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_SYSMENU_ORDER_LENGTH); if (!s) @@ -831,10 +976,15 @@ WIN32ERROR rail_send_client_sysmenu_order(railPlugin* rail, RAIL_SYSMENU_ORDER* return error; } -WIN32ERROR rail_send_client_syscommand_order(railPlugin* rail, RAIL_SYSCOMMAND_ORDER* syscommand) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_syscommand_order(railPlugin* rail, RAIL_SYSCOMMAND_ORDER* syscommand) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_SYSCOMMAND_ORDER_LENGTH); if (!s) @@ -849,10 +999,15 @@ WIN32ERROR rail_send_client_syscommand_order(railPlugin* rail, RAIL_SYSCOMMAND_O return error; } -WIN32ERROR rail_send_client_notify_event_order(railPlugin* rail, RAIL_NOTIFY_EVENT_ORDER* notifyEvent) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_notify_event_order(railPlugin* rail, RAIL_NOTIFY_EVENT_ORDER* notifyEvent) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_NOTIFY_EVENT_ORDER_LENGTH); if (!s) @@ -867,10 +1022,15 @@ WIN32ERROR rail_send_client_notify_event_order(railPlugin* rail, RAIL_NOTIFY_EVE return error; } -WIN32ERROR rail_send_client_window_move_order(railPlugin* rail, RAIL_WINDOW_MOVE_ORDER* windowMove) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_window_move_order(railPlugin* rail, RAIL_WINDOW_MOVE_ORDER* windowMove) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_WINDOW_MOVE_ORDER_LENGTH); if (!s) @@ -885,10 +1045,15 @@ WIN32ERROR rail_send_client_window_move_order(railPlugin* rail, RAIL_WINDOW_MOVE return error; } -WIN32ERROR rail_send_client_get_appid_req_order(railPlugin* rail, RAIL_GET_APPID_REQ_ORDER* getAppIdReq) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_get_appid_req_order(railPlugin* rail, RAIL_GET_APPID_REQ_ORDER* getAppIdReq) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_GET_APPID_REQ_ORDER_LENGTH); if (!s) @@ -903,10 +1068,15 @@ WIN32ERROR rail_send_client_get_appid_req_order(railPlugin* rail, RAIL_GET_APPID return error; } -WIN32ERROR rail_send_client_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_send_client_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo) { wStream* s; - WIN32ERROR error; + UINT error; s = rail_pdu_init(RAIL_LANGBAR_INFO_ORDER_LENGTH); if (!s) diff --git a/channels/rail/client/rail_orders.h b/channels/rail/client/rail_orders.h index c6dbb9214..d7e807b9e 100644 --- a/channels/rail/client/rail_orders.h +++ b/channels/rail/client/rail_orders.h @@ -29,16 +29,16 @@ #define TAG CHANNELS_TAG("rail.client") -WIN32ERROR rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* exec_result); -WIN32ERROR rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam); -WIN32ERROR rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo); -WIN32ERROR rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize); -WIN32ERROR rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp); -WIN32ERROR rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info); +UINT rail_read_server_exec_result_order(wStream* s, RAIL_EXEC_RESULT_ORDER* exec_result); +UINT rail_read_server_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam); +UINT rail_read_server_minmaxinfo_order(wStream* s, RAIL_MINMAXINFO_ORDER* minmaxinfo); +UINT rail_read_server_localmovesize_order(wStream* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize); +UINT rail_read_server_get_appid_resp_order(wStream* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp); +UINT rail_read_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info); void rail_write_client_status_order(wStream* s, RAIL_CLIENT_STATUS_ORDER* client_status); -WIN32ERROR rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec); -WIN32ERROR rail_write_client_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam); +UINT rail_write_client_exec_order(wStream* s, RAIL_EXEC_ORDER* exec); +UINT rail_write_client_sysparam_order(wStream* s, RAIL_SYSPARAM_ORDER* sysparam); void rail_write_client_activate_order(wStream* s, RAIL_ACTIVATE_ORDER* activate); void rail_write_client_sysmenu_order(wStream* s, RAIL_SYSMENU_ORDER* sysmenu); void rail_write_client_syscommand_order(wStream* s, RAIL_SYSCOMMAND_ORDER* syscommand); @@ -47,21 +47,21 @@ void rail_write_client_window_move_order(wStream* s, RAIL_WINDOW_MOVE_ORDER* win void rail_write_client_get_appid_req_order(wStream* s, RAIL_GET_APPID_REQ_ORDER* get_appid_req); void rail_write_langbar_info_order(wStream* s, RAIL_LANGBAR_INFO_ORDER* langbar_info); -WIN32ERROR rail_order_recv(railPlugin* rail, wStream* s); -WIN32ERROR rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType); +UINT rail_order_recv(railPlugin* rail, wStream* s); +UINT rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType); -WIN32ERROR rail_send_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake); -WIN32ERROR rail_send_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); -WIN32ERROR rail_send_client_status_order(railPlugin* rail, RAIL_CLIENT_STATUS_ORDER* clientStatus); -WIN32ERROR rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec); -WIN32ERROR rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam); -WIN32ERROR rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam); -WIN32ERROR rail_send_client_activate_order(railPlugin* rail, RAIL_ACTIVATE_ORDER* activate); -WIN32ERROR rail_send_client_sysmenu_order(railPlugin* rail, RAIL_SYSMENU_ORDER* sysmenu); -WIN32ERROR rail_send_client_syscommand_order(railPlugin* rail, RAIL_SYSCOMMAND_ORDER* syscommand); -WIN32ERROR rail_send_client_notify_event_order(railPlugin* rail, RAIL_NOTIFY_EVENT_ORDER* notifyEvent); -WIN32ERROR rail_send_client_window_move_order(railPlugin* rail, RAIL_WINDOW_MOVE_ORDER* windowMove); -WIN32ERROR rail_send_client_get_appid_req_order(railPlugin* rail, RAIL_GET_APPID_REQ_ORDER* getAppIdReq); -WIN32ERROR rail_send_client_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo); +UINT rail_send_handshake_order(railPlugin* rail, RAIL_HANDSHAKE_ORDER* handshake); +UINT rail_send_handshake_ex_order(railPlugin* rail, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); +UINT rail_send_client_status_order(railPlugin* rail, RAIL_CLIENT_STATUS_ORDER* clientStatus); +UINT rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec); +UINT rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam); +UINT rail_send_client_sysparams_order(railPlugin* rail, RAIL_SYSPARAM_ORDER* sysparam); +UINT rail_send_client_activate_order(railPlugin* rail, RAIL_ACTIVATE_ORDER* activate); +UINT rail_send_client_sysmenu_order(railPlugin* rail, RAIL_SYSMENU_ORDER* sysmenu); +UINT rail_send_client_syscommand_order(railPlugin* rail, RAIL_SYSCOMMAND_ORDER* syscommand); +UINT rail_send_client_notify_event_order(railPlugin* rail, RAIL_NOTIFY_EVENT_ORDER* notifyEvent); +UINT rail_send_client_window_move_order(railPlugin* rail, RAIL_WINDOW_MOVE_ORDER* windowMove); +UINT rail_send_client_get_appid_req_order(railPlugin* rail, RAIL_GET_APPID_REQ_ORDER* getAppIdReq); +UINT rail_send_client_langbar_info_order(railPlugin* rail, RAIL_LANGBAR_INFO_ORDER* langBarInfo); #endif /* __RAIL_ORDERS_H */ diff --git a/channels/rail/rail_common.c b/channels/rail/rail_common.c index 82dc22b57..3c05eb59d 100644 --- a/channels/rail/rail_common.c +++ b/channels/rail/rail_common.c @@ -70,7 +70,12 @@ void rail_string_to_unicode_string(char* string, RAIL_UNICODE_STRING* unicode_st unicode_string->length = (UINT16) length; } -WIN32ERROR rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength) { if (Stream_GetRemainingLength(s) < 4) return ERROR_INVALID_DATA; @@ -97,7 +102,12 @@ wStream* rail_pdu_init(size_t length) return s; } -WIN32ERROR rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake) { if (Stream_GetRemainingLength(s) < 4) return ERROR_INVALID_DATA; @@ -112,7 +122,12 @@ void rail_write_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake) Stream_Write_UINT32(s, handshake->buildNumber); /* buildNumber (4 bytes) */ } -WIN32ERROR rail_read_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rail_read_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { if (Stream_GetRemainingLength(s) < 8) return ERROR_INVALID_DATA; diff --git a/channels/rail/rail_common.h b/channels/rail/rail_common.h index 3a552cd1d..15d65d4c7 100644 --- a/channels/rail/rail_common.h +++ b/channels/rail/rail_common.h @@ -25,7 +25,6 @@ #define FREERDP_CHANNEL_RAIL_COMMON_H #include -#include extern const char* const RAIL_ORDER_TYPE_STRINGS[]; @@ -46,13 +45,13 @@ extern const char* const RAIL_ORDER_TYPE_STRINGS[]; #define RAIL_LANGBAR_INFO_ORDER_LENGTH 4 /* fixed */ void rail_string_to_unicode_string(char* string, RAIL_UNICODE_STRING* unicode_string); -WIN32ERROR rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake); +UINT rail_read_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake); void rail_write_handshake_order(wStream* s, RAIL_HANDSHAKE_ORDER* handshake); -WIN32ERROR rail_read_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); +UINT rail_read_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); void rail_write_handshake_ex_order(wStream* s, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); wStream* rail_pdu_init(size_t length); -WIN32ERROR rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength); +UINT rail_read_pdu_header(wStream* s, UINT16* orderType, UINT16* orderLength); void rail_write_pdu_header(wStream* s, UINT16 orderType, UINT16 orderLength); #endif /* FREERDP_CHANNEL_RAIL_COMMON_H */ diff --git a/channels/rdpdr/client/devman.c b/channels/rdpdr/client/devman.c index 259908ea5..c33dacf71 100644 --- a/channels/rdpdr/client/devman.c +++ b/channels/rdpdr/client/devman.c @@ -89,7 +89,12 @@ void devman_unregister_device(DEVMAN* devman, void* key) devman_device_free(device); } -static WIN32ERROR devman_register_device(DEVMAN* devman, DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT devman_register_device(DEVMAN* devman, DEVICE* device) { void* key = NULL; @@ -120,7 +125,12 @@ static char SMARTCARD_SERVICE_NAME[] = "smartcard"; static char SERIAL_SERVICE_NAME[] = "serial"; static char PARALLEL_SERVICE_NAME[] = "parallel"; -WIN32ERROR devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device, rdpContext* rdpcontext) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device, rdpContext* rdpcontext) { char* ServiceName = NULL; DEVICE_SERVICE_ENTRY_POINTS ep; diff --git a/channels/rdpdr/client/devman.h b/channels/rdpdr/client/devman.h index d5589b527..c99a17940 100644 --- a/channels/rdpdr/client/devman.h +++ b/channels/rdpdr/client/devman.h @@ -26,7 +26,7 @@ #include "rdpdr_main.h" void devman_unregister_device(DEVMAN* devman, void* key); -WIN32ERROR devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device, rdpContext* rdpcontext); +UINT devman_load_device_service(DEVMAN* devman, RDPDR_DEVICE* device, rdpContext* rdpcontext); DEVICE* devman_get_device_by_id(DEVMAN* devman, UINT32 id); DEVMAN* devman_new(rdpdrPlugin* rdpdr); diff --git a/channels/rdpdr/client/irp.c b/channels/rdpdr/client/irp.c index b9deaed25..2d1f96506 100644 --- a/channels/rdpdr/client/irp.c +++ b/channels/rdpdr/client/irp.c @@ -35,7 +35,12 @@ #include "devman.h" #include "irp.h" -static WIN32ERROR irp_free(IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT irp_free(IRP* irp) { if (!irp) return CHANNEL_RC_OK; @@ -47,11 +52,16 @@ static WIN32ERROR irp_free(IRP* irp) return CHANNEL_RC_OK; } -static WIN32ERROR irp_complete(IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT irp_complete(IRP* irp) { int pos; rdpdrPlugin* rdpdr; - WIN32ERROR error; + UINT error; rdpdr = (rdpdrPlugin*) irp->devman->plugin; diff --git a/channels/rdpdr/client/rdpdr_capabilities.c b/channels/rdpdr/client/rdpdr_capabilities.c index 943200788..26f6d529e 100644 --- a/channels/rdpdr/client/rdpdr_capabilities.c +++ b/channels/rdpdr/client/rdpdr_capabilities.c @@ -169,7 +169,12 @@ void rdpdr_process_capability_request(rdpdrPlugin* rdpdr, wStream* s) } } -WIN32ERROR rdpdr_send_capability_response(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpdr_send_capability_response(rdpdrPlugin* rdpdr) { wStream* s; diff --git a/channels/rdpdr/client/rdpdr_capabilities.h b/channels/rdpdr/client/rdpdr_capabilities.h index a4fdf82fd..bc2ef8b9e 100644 --- a/channels/rdpdr/client/rdpdr_capabilities.h +++ b/channels/rdpdr/client/rdpdr_capabilities.h @@ -26,6 +26,6 @@ #include "rdpdr_main.h" void rdpdr_process_capability_request(rdpdrPlugin* rdpdr, wStream* s); -WIN32ERROR rdpdr_send_capability_response(rdpdrPlugin* rdpdr); +UINT rdpdr_send_capability_response(rdpdrPlugin* rdpdr); #endif /* FREERDP_CHANNEL_RDPDR_CLIENT_CAPABILITIES_H */ diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index 11ee06e38..88e82e10d 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -64,9 +64,19 @@ struct _DEVICE_DRIVE_EXT char* path; }; -static WIN32ERROR rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn); +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn); -static WIN32ERROR rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, UINT32 count, UINT32 ids[]) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, UINT32 count, UINT32 ids[]) { UINT32 i; wStream* s; @@ -96,7 +106,7 @@ LRESULT CALLBACK hotplug_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { rdpdrPlugin *rdpdr; PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam; - WIN32ERROR error; + UINT error; rdpdr = (rdpdrPlugin *)GetWindowLongPtr(hWnd, GWLP_USERDATA); @@ -248,9 +258,14 @@ static void* drive_hotplug_thread_func(void* arg) return NULL; } -static WIN32ERROR drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (rdpdr->hotplug_wnd && !PostMessage(rdpdr->hotplug_wnd, WM_QUIT, 0, 0)) { error = GetLastError(); @@ -355,7 +370,12 @@ static char* get_word(char* str, unsigned int* offset) return word; } -static WIN32ERROR handle_hotplug(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT handle_hotplug(rdpdrPlugin* rdpdr) { FILE *f; size_t len; @@ -371,7 +391,7 @@ static WIN32ERROR handle_hotplug(rdpdrPlugin* rdpdr) DEVICE_DRIVE_EXT *device_ext; ULONG_PTR *keys; UINT32 ids[1]; - WIN32ERROR error; + UINT error; f = fopen("/proc/mounts", "r"); if (f == NULL) @@ -492,7 +512,7 @@ static void* drive_hotplug_thread_func(void* arg) fd_set rfds; struct timeval tv; int rv; - WIN32ERROR error; + UINT error; DWORD status; rdpdr = (rdpdrPlugin*) arg; @@ -560,9 +580,14 @@ out: return NULL; } -static WIN32ERROR drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) { - WIN32ERROR error; + UINT error; if (rdpdr->hotplugThread) { if (rdpdr->stopEvent) @@ -582,12 +607,17 @@ static WIN32ERROR drive_hotplug_thread_terminate(rdpdrPlugin* rdpdr) #endif -static WIN32ERROR rdpdr_process_connect(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_process_connect(rdpdrPlugin* rdpdr) { UINT32 index; RDPDR_DEVICE* device; rdpSettings* settings; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rdpdr->devman = devman_new(rdpdr); if (!rdpdr->devman) @@ -636,7 +666,12 @@ static void rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, wStream* s rdpdr->sequenceId++; } -static WIN32ERROR rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr) { wStream* s; @@ -657,7 +692,12 @@ static WIN32ERROR rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr) return rdpdr_send(rdpdr, s); } -static WIN32ERROR rdpdr_send_client_name_request(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_send_client_name_request(rdpdrPlugin* rdpdr) { wStream* s; WCHAR* computerNameW = NULL; @@ -711,7 +751,12 @@ static void rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, wStream* s } } -static WIN32ERROR rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL userLoggedOn) { int i; BYTE c; @@ -800,10 +845,15 @@ static WIN32ERROR rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BO return rdpdr_send(rdpdr, s); } -static WIN32ERROR rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) { IRP* irp; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; irp = irp_new(rdpdr->devman, s); @@ -821,13 +871,18 @@ static WIN32ERROR rdpdr_process_irp(rdpdrPlugin* rdpdr, wStream* s) return error; } -static WIN32ERROR rdpdr_process_init(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_process_init(rdpdrPlugin* rdpdr) { int index; int keyCount; DEVICE* device; ULONG_PTR* pKeys; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; pKeys = NULL; keyCount = ListDictionary_GetKeys(rdpdr->devman->devices, &pKeys); @@ -849,13 +904,18 @@ static WIN32ERROR rdpdr_process_init(rdpdrPlugin* rdpdr) return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) { UINT16 component; UINT16 packetId; UINT32 deviceId; UINT32 status; - WIN32ERROR error; + UINT error; Stream_Read_UINT16(s, component); /* Component (2 bytes) */ Stream_Read_UINT16(s, packetId); /* PacketId (2 bytes) */ @@ -969,7 +1029,12 @@ static WIN32ERROR rdpdr_process_receive(rdpdrPlugin* rdpdr, wStream* s) static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR rdpdr_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpdr_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) { @@ -1006,7 +1071,12 @@ void rdpdr_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR rdpdr_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpdr_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -1048,9 +1118,14 @@ void rdpdr_remove_open_handle_data(DWORD openHandle) } } -WIN32ERROR rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) { - WIN32ERROR status; + UINT status; rdpdrPlugin* plugin = (rdpdrPlugin*) rdpdr; if (!plugin) @@ -1073,7 +1148,12 @@ WIN32ERROR rdpdr_send(rdpdrPlugin* rdpdr, wStream* s) return status; } -static WIN32ERROR rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_virtual_channel_event_data_received(rdpdrPlugin* rdpdr, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -1135,7 +1215,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event(DWORD openHandle, UINT ev LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { rdpdrPlugin* rdpdr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rdpdr = (rdpdrPlugin*) rdpdr_get_open_handle_data(openHandle); @@ -1170,7 +1250,7 @@ static void* rdpdr_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; rdpdrPlugin* rdpdr = (rdpdrPlugin*) arg; - WIN32ERROR error; + UINT error; if ((error = rdpdr_process_connect(rdpdr))) { @@ -1210,10 +1290,15 @@ static void* rdpdr_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVOID pData, UINT32 dataLength) { UINT32 status; - WIN32ERROR error; + UINT error; status = rdpdr->channelEntryPoints.pVirtualChannelOpen(rdpdr->InitHandle, &rdpdr->OpenHandle, rdpdr->channelDef.name, rdpdr_virtual_channel_open_event); @@ -1247,9 +1332,14 @@ static WIN32ERROR rdpdr_virtual_channel_event_connected(rdpdrPlugin* rdpdr, LPVO return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_virtual_channel_event_disconnected(rdpdrPlugin* rdpdr) { - WIN32ERROR error; + UINT error; if (MessageQueue_PostQuit(rdpdr->queue, 0) && (WaitForSingleObject(rdpdr->thread, INFINITE) == WAIT_FAILED)) { @@ -1303,7 +1393,7 @@ static void rdpdr_virtual_channel_event_terminated(rdpdrPlugin* rdpdr) static VOID VCAPITYPE rdpdr_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { rdpdrPlugin* rdpdr; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rdpdr = (rdpdrPlugin*) rdpdr_get_init_handle_data(pInitHandle); diff --git a/channels/rdpdr/client/rdpdr_main.h b/channels/rdpdr/client/rdpdr_main.h index 8ba82fa58..7f93acbd3 100644 --- a/channels/rdpdr/client/rdpdr_main.h +++ b/channels/rdpdr/client/rdpdr_main.h @@ -70,6 +70,6 @@ struct rdpdr_plugin rdpContext* rdpcontext; }; -WIN32ERROR rdpdr_send(rdpdrPlugin* rdpdr, wStream* s); +UINT rdpdr_send(rdpdrPlugin* rdpdr, wStream* s); #endif /* FREERDP_CHANNEL_RDPDR_CLIENT_MAIN_H */ diff --git a/channels/rdpdr/server/rdpdr_main.c b/channels/rdpdr/server/rdpdr_main.c index 4ac05d35d..074d3e4fe 100644 --- a/channels/rdpdr/server/rdpdr_main.c +++ b/channels/rdpdr/server/rdpdr_main.c @@ -64,7 +64,12 @@ static RDPDR_IRP* rdpdr_server_dequeue_irp(RdpdrServerContext* context, UINT32 c return irp; } -static WIN32ERROR rdpdr_server_send_announce_request(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_announce_request(RdpdrServerContext* context) { wStream* s; BOOL status; @@ -98,7 +103,12 @@ static WIN32ERROR rdpdr_server_send_announce_request(RdpdrServerContext* context return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_receive_announce_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_announce_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { UINT32 ClientId; UINT16 VersionMajor; @@ -121,7 +131,12 @@ static WIN32ERROR rdpdr_server_receive_announce_response(RdpdrServerContext* con return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_receive_client_name_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_client_name_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { UINT32 UnicodeFlag; UINT32 ComputerNameLen; @@ -171,7 +186,12 @@ static WIN32ERROR rdpdr_server_receive_client_name_request(RdpdrServerContext* c return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_read_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) { if (Stream_GetRemainingLength(s) < 8) { @@ -185,7 +205,12 @@ static WIN32ERROR rdpdr_server_read_capability_set_header(wStream* s, RDPDR_CAPA return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_capability_set_header(wStream* s, RDPDR_CAPABILITY_HEADER* header) { if (!Stream_EnsureRemainingCapacity(s, 8)) { @@ -199,7 +224,12 @@ static WIN32ERROR rdpdr_server_write_capability_set_header(wStream* s, RDPDR_CAP return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_read_general_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_general_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) { UINT32 ioCode1; UINT32 extraFlags1; @@ -239,7 +269,12 @@ static WIN32ERROR rdpdr_server_read_general_capability_set(RdpdrServerContext* c return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_general_capability_set(RdpdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_general_capability_set(RdpdrServerContext* context, wStream* s) { UINT32 ioCode1; UINT32 extendedPdu; @@ -299,12 +334,22 @@ static WIN32ERROR rdpdr_server_write_general_capability_set(RdpdrServerContext* return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_read_printer_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_printer_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_printer_capability_set(RdpdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_printer_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; @@ -320,12 +365,22 @@ static WIN32ERROR rdpdr_server_write_printer_capability_set(RdpdrServerContext* return rdpdr_server_write_capability_set_header(s, &header); } -static WIN32ERROR rdpdr_server_read_port_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_port_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_port_capability_set(RdpdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_port_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; @@ -341,12 +396,22 @@ static WIN32ERROR rdpdr_server_write_port_capability_set(RdpdrServerContext* con return rdpdr_server_write_capability_set_header(s, &header); } -static WIN32ERROR rdpdr_server_read_drive_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_drive_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_drive_capability_set(RdpdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_drive_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; @@ -362,12 +427,22 @@ static WIN32ERROR rdpdr_server_write_drive_capability_set(RdpdrServerContext* co return rdpdr_server_write_capability_set_header(s, &header); } -static WIN32ERROR rdpdr_server_read_smartcard_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_smartcard_capability_set(RdpdrServerContext* context, wStream* s, RDPDR_CAPABILITY_HEADER* header) { return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_write_smartcard_capability_set(RdpdrServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_write_smartcard_capability_set(RdpdrServerContext* context, wStream* s) { RDPDR_CAPABILITY_HEADER header; @@ -383,14 +458,19 @@ static WIN32ERROR rdpdr_server_write_smartcard_capability_set(RdpdrServerContext return rdpdr_server_write_capability_set_header(s, &header); } -static WIN32ERROR rdpdr_server_send_core_capability_request(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_core_capability_request(RdpdrServerContext* context) { wStream* s; BOOL status; RDPDR_HEADER header; UINT16 numCapabilities; ULONG written; - WIN32ERROR error; + UINT error; WLog_DBG(TAG, "RdpdrServerSendCoreCapabilityRequest"); @@ -473,10 +553,15 @@ static WIN32ERROR rdpdr_server_send_core_capability_request(RdpdrServerContext* return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_receive_core_capability_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_core_capability_response(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { int i; - WIN32ERROR status; + UINT status; UINT16 numCapabilities; RDPDR_CAPABILITY_HEADER capabilityHeader; @@ -550,7 +635,12 @@ static WIN32ERROR rdpdr_server_receive_core_capability_response(RdpdrServerConte return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_send_client_id_confirm(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_client_id_confirm(RdpdrServerContext* context) { wStream* s; BOOL status; @@ -584,7 +674,12 @@ static WIN32ERROR rdpdr_server_send_client_id_confirm(RdpdrServerContext* contex return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_receive_device_list_announce_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_device_list_announce_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { int i; UINT32 DeviceCount; @@ -671,7 +766,12 @@ static WIN32ERROR rdpdr_server_receive_device_list_announce_request(RdpdrServerC return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_receive_device_list_remove_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_device_list_remove_request(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { int i; UINT32 DeviceCount; @@ -741,13 +841,18 @@ static WIN32ERROR rdpdr_server_receive_device_list_remove_request(RdpdrServerCon return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_receive_device_io_completion(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_device_io_completion(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { UINT32 deviceId; UINT32 completionId; UINT32 ioStatus; RDPDR_IRP* irp; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 12) { @@ -777,7 +882,12 @@ static WIN32ERROR rdpdr_server_receive_device_io_completion(RdpdrServerContext* return error; } -static WIN32ERROR rdpdr_server_send_user_logged_on(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_user_logged_on(RdpdrServerContext* context) { wStream* s; BOOL status; @@ -808,9 +918,14 @@ static WIN32ERROR rdpdr_server_send_user_logged_on(RdpdrServerContext* context) return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_receive_pdu(RdpdrServerContext* context, wStream* s, RDPDR_HEADER* header) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "RdpdrServerReceivePdu: Component: 0x%04X PacketId: 0x%04X", header->Component, header->PacketId); @@ -936,7 +1051,7 @@ static void* rdpdr_server_thread(void* arg) HANDLE ChannelEvent; DWORD BytesReturned; RdpdrServerContext* context; - WIN32ERROR error; + UINT error; context = (RdpdrServerContext*) arg; buffer = NULL; @@ -1030,7 +1145,12 @@ out: return NULL; } -static WIN32ERROR rdpdr_server_start(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_start(RdpdrServerContext* context) { context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "rdpdr"); @@ -1056,9 +1176,14 @@ static WIN32ERROR rdpdr_server_start(RdpdrServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_stop(RdpdrServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_stop(RdpdrServerContext* context) { - WIN32ERROR error; + UINT error; if (context->priv->StopEvent) { SetEvent(context->priv->StopEvent); @@ -1094,7 +1219,12 @@ static void rdpdr_server_write_device_iorequest( Stream_Write_UINT32(s, minorFunction); /* MinorFunction (4 bytes) */ } -static WIN32ERROR rdpdr_server_read_file_directory_information(wStream* s, FILE_DIRECTORY_INFORMATION* fdi) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_read_file_directory_information(wStream* s, FILE_DIRECTORY_INFORMATION* fdi) { UINT32 fileNameLength; @@ -1129,7 +1259,12 @@ static WIN32ERROR rdpdr_server_read_file_directory_information(wStream* s, FILE_ return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_send_device_create_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_create_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 completionId, @@ -1181,7 +1316,12 @@ static WIN32ERROR rdpdr_server_send_device_create_request( return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_send_device_close_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_close_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 fileId, @@ -1214,7 +1354,12 @@ static WIN32ERROR rdpdr_server_send_device_close_request( return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_send_device_read_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_read_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 fileId, @@ -1253,7 +1398,12 @@ static WIN32ERROR rdpdr_server_send_device_read_request( return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_send_device_write_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_write_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 fileId, @@ -1294,7 +1444,12 @@ static WIN32ERROR rdpdr_server_send_device_write_request( return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_send_device_query_directory_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_query_directory_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 fileId, @@ -1343,7 +1498,12 @@ static WIN32ERROR rdpdr_server_send_device_query_directory_request( return status? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpdr_server_send_device_file_rename_request( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_send_device_file_rename_request( RdpdrServerContext* context, UINT32 deviceId, UINT32 fileId, @@ -1411,7 +1571,12 @@ static void rdpdr_server_convert_slashes(char* path, int size) * Drive Create Directory ************************************************/ -static WIN32ERROR rdpdr_server_drive_create_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_create_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, "RdpdrServerDriveCreateDirectoryCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", deviceId, completionId, ioStatus); @@ -1425,7 +1590,12 @@ static WIN32ERROR rdpdr_server_drive_create_directory_callback2(RdpdrServerConte return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_create_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_create_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; @@ -1470,7 +1640,12 @@ static WIN32ERROR rdpdr_server_drive_create_directory_callback1(RdpdrServerConte return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } -static WIN32ERROR rdpdr_server_drive_create_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_create_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) { RDPDR_IRP* irp; @@ -1506,7 +1681,12 @@ static WIN32ERROR rdpdr_server_drive_create_directory(RdpdrServerContext* contex * Drive Delete Directory ************************************************/ -static WIN32ERROR rdpdr_server_drive_delete_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, "RdpdrServerDriveDeleteDirectoryCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", deviceId, completionId, ioStatus); @@ -1520,7 +1700,12 @@ static WIN32ERROR rdpdr_server_drive_delete_directory_callback2(RdpdrServerConte return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_delete_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; @@ -1565,7 +1750,12 @@ static WIN32ERROR rdpdr_server_drive_delete_directory_callback1(RdpdrServerConte return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } -static WIN32ERROR rdpdr_server_drive_delete_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) { RDPDR_IRP* irp; @@ -1601,9 +1791,14 @@ static WIN32ERROR rdpdr_server_drive_delete_directory(RdpdrServerContext* contex * Drive Query Directory ************************************************/ -static WIN32ERROR rdpdr_server_drive_query_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_query_directory_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { - WIN32ERROR error; + UINT error; UINT32 length; FILE_DIRECTORY_INFORMATION fdi; @@ -1668,7 +1863,12 @@ static WIN32ERROR rdpdr_server_drive_query_directory_callback2(RdpdrServerContex return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_query_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_query_directory_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; @@ -1713,7 +1913,12 @@ static WIN32ERROR rdpdr_server_drive_query_directory_callback1(RdpdrServerContex return rdpdr_server_send_device_query_directory_request(context, deviceId, fileId, irp->CompletionId, irp->PathName); } -static WIN32ERROR rdpdr_server_drive_query_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_query_directory(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) { RDPDR_IRP* irp; @@ -1749,7 +1954,12 @@ static WIN32ERROR rdpdr_server_drive_query_directory(RdpdrServerContext* context * Drive Open File ************************************************/ -static WIN32ERROR rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_open_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; @@ -1775,7 +1985,12 @@ static WIN32ERROR rdpdr_server_drive_open_file_callback(RdpdrServerContext* cont return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_open_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, UINT32 createDisposition) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_open_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, UINT32 createDisposition) { RDPDR_IRP* irp; @@ -1811,7 +2026,12 @@ static WIN32ERROR rdpdr_server_drive_open_file(RdpdrServerContext* context, void * Drive Read File ************************************************/ -static WIN32ERROR rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_read_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 length; char* buffer = NULL; @@ -1848,7 +2068,12 @@ static WIN32ERROR rdpdr_server_drive_read_file_callback(RdpdrServerContext* cont return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_read_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_read_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset) { RDPDR_IRP* irp; @@ -1881,7 +2106,12 @@ static WIN32ERROR rdpdr_server_drive_read_file(RdpdrServerContext* context, void * Drive Write File ************************************************/ -static WIN32ERROR rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_write_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 length; @@ -1912,7 +2142,12 @@ static WIN32ERROR rdpdr_server_drive_write_file_callback(RdpdrServerContext* con return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_write_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, UINT32 length, UINT32 offset) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_write_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, UINT32 length, UINT32 offset) { RDPDR_IRP* irp; @@ -1945,7 +2180,12 @@ static WIN32ERROR rdpdr_server_drive_write_file(RdpdrServerContext* context, voi * Drive Close File ************************************************/ -static WIN32ERROR rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_close_file_callback(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, "RdpdrServerDriveCloseFileCallback: deviceId=%d, completionId=%d, ioStatus=0x%x", deviceId, completionId, ioStatus); @@ -1959,7 +2199,12 @@ static WIN32ERROR rdpdr_server_drive_close_file_callback(RdpdrServerContext* con return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_close_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_close_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId) { RDPDR_IRP* irp; @@ -1992,7 +2237,12 @@ static WIN32ERROR rdpdr_server_drive_close_file(RdpdrServerContext* context, voi * Drive Delete File ************************************************/ -static WIN32ERROR rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, "RdpdrServerDriveDeleteFileCallback2: deviceId=%d, completionId=%d, ioStatus=0x%x", deviceId, completionId, ioStatus); @@ -2006,7 +2256,12 @@ static WIN32ERROR rdpdr_server_drive_delete_file_callback2(RdpdrServerContext* c return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; @@ -2051,7 +2306,12 @@ static WIN32ERROR rdpdr_server_drive_delete_file_callback1(RdpdrServerContext* c return rdpdr_server_send_device_close_request(context, deviceId, fileId, irp->CompletionId); } -static WIN32ERROR rdpdr_server_drive_delete_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_delete_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path) { RDPDR_IRP* irp; @@ -2088,7 +2348,12 @@ static WIN32ERROR rdpdr_server_drive_delete_file(RdpdrServerContext* context, vo * Drive Rename File ************************************************/ -static WIN32ERROR rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { WLog_DBG(TAG, "RdpdrServerDriveRenameFileCallback3: deviceId=%d, completionId=%d, ioStatus=0x%x", deviceId, completionId, ioStatus); @@ -2099,7 +2364,12 @@ static WIN32ERROR rdpdr_server_drive_rename_file_callback3(RdpdrServerContext* c return CHANNEL_RC_OK; } -static WIN32ERROR rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 length; @@ -2134,7 +2404,12 @@ static WIN32ERROR rdpdr_server_drive_rename_file_callback2(RdpdrServerContext* c return rdpdr_server_send_device_close_request(context, deviceId, irp->FileId, irp->CompletionId); } -static WIN32ERROR rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* context, wStream* s, RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus) { UINT32 fileId; UINT8 information; @@ -2179,7 +2454,12 @@ static WIN32ERROR rdpdr_server_drive_rename_file_callback1(RdpdrServerContext* c return rdpdr_server_send_device_file_rename_request(context, deviceId, fileId, irp->CompletionId, irp->ExtraBuffer); } -static WIN32ERROR rdpdr_server_drive_rename_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpdr_server_drive_rename_file(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath) { RDPDR_IRP* irp; diff --git a/channels/rdpdr/server/rdpdr_main.h b/channels/rdpdr/server/rdpdr_main.h index 21e3742a5..dc09aadf3 100644 --- a/channels/rdpdr/server/rdpdr_main.h +++ b/channels/rdpdr/server/rdpdr_main.h @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -83,7 +82,7 @@ struct _RDPDR_IRP char PathName[256]; char ExtraBuffer[256]; void *CallbackData; - WIN32ERROR (*Callback)(RdpdrServerContext* context, wStream* s, struct _RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus); + UINT (*Callback)(RdpdrServerContext* context, wStream* s, struct _RDPDR_IRP* irp, UINT32 deviceId, UINT32 completionId, UINT32 ioStatus); }; typedef struct _RDPDR_IRP RDPDR_IRP; diff --git a/channels/rdpei/client/rdpei_main.c b/channels/rdpei/client/rdpei_main.c index 435819aeb..7494d4b0e 100644 --- a/channels/rdpei/client/rdpei_main.c +++ b/channels/rdpei/client/rdpei_main.c @@ -110,7 +110,12 @@ struct _RDPEI_PLUGIN }; typedef struct _RDPEI_PLUGIN RDPEI_PLUGIN; -WIN32ERROR rdpei_send_frame(RdpeiClientContext* context); +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_send_frame(RdpeiClientContext* context); const char* RDPEI_EVENTID_STRINGS[] = { @@ -123,7 +128,12 @@ const char* RDPEI_EVENTID_STRINGS[] = "EVENTID_DISMISS_HOVERING_CONTACT" }; -WIN32ERROR rdpei_add_frame(RdpeiClientContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_add_frame(RdpeiClientContext* context) { int i; RDPINPUT_CONTACT_DATA* contact; @@ -164,7 +174,7 @@ static void* rdpei_schedule_thread(void* arg) RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) arg; RdpeiClientContext* context = (RdpeiClientContext*) rdpei->iface.pInterface; HANDLE hdl[] = {rdpei->event, rdpei->stopEvent}; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!rdpei) { @@ -225,9 +235,14 @@ out: return NULL; } -WIN32ERROR rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId, UINT32 pduLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 eventId, UINT32 pduLength) { - WIN32ERROR status; + UINT status; Stream_SetPosition(s, 0); Stream_Write_UINT16(s, eventId); /* eventId (2 bytes) */ @@ -244,9 +259,14 @@ WIN32ERROR rdpei_send_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s, UINT16 e return status; } -WIN32ERROR rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_send_cs_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback) { - WIN32ERROR status; + UINT status; wStream* s; UINT32 flags; UINT32 pduLength; @@ -298,7 +318,12 @@ void rdpei_print_contact_flags(UINT32 contactFlags) WLog_DBG(TAG, " CONTACT_FLAG_CANCELED"); } -WIN32ERROR rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) { UINT32 index; int rectSize = 2; @@ -381,9 +406,14 @@ WIN32ERROR rdpei_write_touch_frame(wStream* s, RDPINPUT_TOUCH_FRAME* frame) return CHANNEL_RC_OK; } -WIN32ERROR rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT_TOUCH_FRAME* frame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT_TOUCH_FRAME* frame) { - WIN32ERROR status; + UINT status; wStream* s; UINT32 pduLength; @@ -421,7 +451,12 @@ WIN32ERROR rdpei_send_touch_event_pdu(RDPEI_CHANNEL_CALLBACK* callback, RDPINPUT return status; } -WIN32ERROR rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { UINT32 protocolVersion; @@ -438,10 +473,15 @@ WIN32ERROR rdpei_recv_sc_ready_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) return CHANNEL_RC_OK; } -WIN32ERROR rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; IFCALLRET(rdpei->SuspendTouch, error, rdpei); if (error) @@ -450,10 +490,15 @@ WIN32ERROR rdpei_recv_suspend_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStrea return error; } -WIN32ERROR rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { RdpeiClientContext* rdpei = (RdpeiClientContext*) callback->plugin->pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; IFCALLRET(rdpei->ResumeTouch, error, rdpei); if (error) @@ -462,11 +507,16 @@ WIN32ERROR rdpei_recv_resume_touch_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream return error; } -WIN32ERROR rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 eventId; UINT32 pduLength; - WIN32ERROR error; + UINT error; Stream_Read_UINT16(s, eventId); /* eventId (2 bytes) */ Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */ @@ -514,14 +564,24 @@ WIN32ERROR rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) return CHANNEL_RC_OK; } -static WIN32ERROR rdpei_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpei_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) { RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*) pChannelCallback; return rdpei_recv_pdu(callback, data); } -static WIN32ERROR rdpei_on_close(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpei_on_close(IWTSVirtualChannelCallback* pChannelCallback) { RDPEI_CHANNEL_CALLBACK* callback = (RDPEI_CHANNEL_CALLBACK*) pChannelCallback; @@ -530,7 +590,12 @@ static WIN32ERROR rdpei_on_close(IWTSVirtualChannelCallback* pChannelCallback) return CHANNEL_RC_OK; } -static WIN32ERROR rdpei_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpei_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { @@ -556,9 +621,14 @@ static WIN32ERROR rdpei_on_new_channel_connection(IWTSListenerCallback* pListene return CHANNEL_RC_OK; } -static WIN32ERROR rdpei_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpei_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - WIN32ERROR error; + UINT error; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) pPlugin; rdpei->listener_callback = (RDPEI_LISTENER_CALLBACK*) calloc(1 ,sizeof(RDPEI_LISTENER_CALLBACK)); @@ -612,10 +682,15 @@ error_out: return error; } -static WIN32ERROR rdpei_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpei_plugin_terminated(IWTSPlugin* pPlugin) { RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) pPlugin; - WIN32ERROR error; + UINT error; if (!pPlugin) return ERROR_INVALID_PARAMETER; @@ -653,12 +728,17 @@ int rdpei_get_version(RdpeiClientContext* context) return rdpei->version; } -WIN32ERROR rdpei_send_frame(RdpeiClientContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_send_frame(RdpeiClientContext* context) { UINT64 currentTime; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; RDPEI_CHANNEL_CALLBACK* callback = rdpei->listener_callback->channel_callback; - WIN32ERROR error; + UINT error; currentTime = GetTickCount64(); @@ -684,7 +764,12 @@ WIN32ERROR rdpei_send_frame(RdpeiClientContext* context) return error; } -WIN32ERROR rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact) { RDPINPUT_CONTACT_POINT* contactPoint; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; @@ -702,14 +787,19 @@ WIN32ERROR rdpei_add_contact(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* return CHANNEL_RC_OK; } -WIN32ERROR rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; /* Create a new contact point in an empty slot */ @@ -749,14 +839,19 @@ WIN32ERROR rdpei_touch_begin(RdpeiClientContext* context, int externalId, int x, return error; } -WIN32ERROR rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_touch_update(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; for (i = 0; i < rdpei->maxTouchContacts; i++) { @@ -795,7 +890,12 @@ WIN32ERROR rdpei_touch_update(RdpeiClientContext* context, int externalId, int x return error; } -WIN32ERROR rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, int y, int* contactId) { unsigned int i; int contactIdlocal = -1; @@ -803,7 +903,7 @@ WIN32ERROR rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, i RDPINPUT_CONTACT_DATA contact; RDPINPUT_CONTACT_POINT* contactPoint = NULL; RDPEI_PLUGIN* rdpei = (RDPEI_PLUGIN*) context->handle; - WIN32ERROR error; + UINT error; for (i = 0; i < rdpei->maxTouchContacts; i++) { @@ -859,9 +959,14 @@ WIN32ERROR rdpei_touch_end(RdpeiClientContext* context, int externalId, int x, i #define DVCPluginEntry rdpei_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR error; + UINT error; RDPEI_PLUGIN* rdpei = NULL; RdpeiClientContext* context = NULL; diff --git a/channels/rdpei/server/rdpei_main.c b/channels/rdpei/server/rdpei_main.c index dfb5afd15..cd1708632 100644 --- a/channels/rdpei/server/rdpei_main.c +++ b/channels/rdpei/server/rdpei_main.c @@ -92,7 +92,12 @@ out_free: return NULL; } -WIN32ERROR rdpei_server_init(RdpeiServerContext *context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_server_init(RdpeiServerContext *context) { void *buffer = NULL; DWORD bytesReturned; @@ -150,9 +155,14 @@ HANDLE rdpei_server_get_event_handle(RdpeiServerContext *context) } -static WIN32ERROR read_cs_ready_message(RdpeiServerContext *context, wStream *s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT read_cs_ready_message(RdpeiServerContext *context, wStream *s) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 10) { WLog_ERR(TAG, "Not enought data!"); @@ -180,7 +190,12 @@ static WIN32ERROR read_cs_ready_message(RdpeiServerContext *context, wStream *s) return error; } -static WIN32ERROR read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDPINPUT_CONTACT_DATA *contactData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT read_touch_contact_data(RdpeiServerContext *context, wStream *s, RDPINPUT_CONTACT_DATA *contactData) { if (Stream_GetRemainingLength(s) < 1) { @@ -228,11 +243,16 @@ static WIN32ERROR read_touch_contact_data(RdpeiServerContext *context, wStream * return CHANNEL_RC_OK; } -static WIN32ERROR read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_TOUCH_FRAME *frame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT read_touch_frame(RdpeiServerContext *context, wStream *s, RDPINPUT_TOUCH_FRAME *frame) { int i; RDPINPUT_CONTACT_DATA *contact; - WIN32ERROR error; + UINT error; if (!rdpei_read_2byte_unsigned(s, &frame->contactCount) || !rdpei_read_8byte_unsigned(s, &frame->frameOffset)) { @@ -260,13 +280,18 @@ static WIN32ERROR read_touch_frame(RdpeiServerContext *context, wStream *s, RDPI return CHANNEL_RC_OK; } -static WIN32ERROR read_touch_event(RdpeiServerContext *context, wStream *s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT read_touch_event(RdpeiServerContext *context, wStream *s) { UINT32 frameCount; int i; RDPINPUT_TOUCH_EVENT *event = &context->priv->touchEvent; RDPINPUT_TOUCH_FRAME *frame; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!rdpei_read_4byte_unsigned(s, &event->encodeTime) || !rdpei_read_2byte_unsigned(s, &frameCount)) { @@ -303,9 +328,14 @@ out_cleanup: } -static WIN32ERROR read_dismiss_hovering_contact(RdpeiServerContext *context, wStream *s) { +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT read_dismiss_hovering_contact(RdpeiServerContext *context, wStream *s) { BYTE contactId; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 1) { @@ -323,11 +353,16 @@ static WIN32ERROR read_dismiss_hovering_contact(RdpeiServerContext *context, wSt } -WIN32ERROR rdpei_server_handle_messages(RdpeiServerContext *context) { +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_server_handle_messages(RdpeiServerContext *context) { DWORD bytesReturned; RdpeiServerPrivate *priv = context->priv; wStream *s = priv->inputStream; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (!WTSVirtualChannelRead(priv->channelHandle, 0, (PCHAR)Stream_Pointer(s), priv->expectedBytes, &bytesReturned)) { @@ -415,7 +450,12 @@ WIN32ERROR rdpei_server_handle_messages(RdpeiServerContext *context) { } -WIN32ERROR rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version) { ULONG written; RdpeiServerPrivate *priv = context->priv; @@ -449,7 +489,12 @@ WIN32ERROR rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 versio return CHANNEL_RC_OK; } -WIN32ERROR rdpei_server_suspend(RdpeiServerContext *context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_server_suspend(RdpeiServerContext *context) { ULONG written; RdpeiServerPrivate *priv = context->priv; @@ -488,7 +533,12 @@ WIN32ERROR rdpei_server_suspend(RdpeiServerContext *context) } -WIN32ERROR rdpei_server_resume(RdpeiServerContext *context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpei_server_resume(RdpeiServerContext *context) { ULONG written; RdpeiServerPrivate *priv = context->priv; diff --git a/channels/rdpgfx/client/rdpgfx_codec.c b/channels/rdpgfx/client/rdpgfx_codec.c index 0afb6a347..099d06f7b 100644 --- a/channels/rdpgfx/client/rdpgfx_codec.c +++ b/channels/rdpgfx/client/rdpgfx_codec.c @@ -33,32 +33,57 @@ #define TAG CHANNELS_TAG("rdpgfx.client") -WIN32ERROR rdpgfx_decode_uncompressed(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_uncompressed(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_decode_remotefx(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_remotefx(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_decode_clear(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_clear(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_decode_planar(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_planar(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H264_METABLOCK* meta) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H264_METABLOCK* meta) { UINT32 index; RDPGFX_RECT16* regionRect; RDPGFX_H264_QUANT_QUALITY* quantQualityVal; - WIN32ERROR error; + UINT error; meta->regionRects = NULL; meta->quantQualityVals = NULL; @@ -136,9 +161,14 @@ error_out: return error; } -WIN32ERROR rdpgfx_decode_h264(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_h264(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { - WIN32ERROR error; + UINT error; wStream* s; RDPGFX_H264_BITMAP_STREAM h264; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; @@ -177,19 +207,34 @@ WIN32ERROR rdpgfx_decode_h264(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) return error; } -WIN32ERROR rdpgfx_decode_alpha(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_alpha(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_decode_progressive(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode_progressive(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; switch (cmd->codecId) { diff --git a/channels/rdpgfx/client/rdpgfx_codec.h b/channels/rdpgfx/client/rdpgfx_codec.h index 1b681eb8b..45f7ef79f 100644 --- a/channels/rdpgfx/client/rdpgfx_codec.h +++ b/channels/rdpgfx/client/rdpgfx_codec.h @@ -29,6 +29,6 @@ #include "rdpgfx_main.h" -WIN32ERROR rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd); +UINT rdpgfx_decode(RDPGFX_PLUGIN* gfx, RDPGFX_SURFACE_COMMAND* cmd); #endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_CODEC_H */ diff --git a/channels/rdpgfx/client/rdpgfx_common.c b/channels/rdpgfx/client/rdpgfx_common.c index 13ae3c407..8b6e07389 100644 --- a/channels/rdpgfx/client/rdpgfx_common.c +++ b/channels/rdpgfx/client/rdpgfx_common.c @@ -90,7 +90,12 @@ const char* rdpgfx_get_codec_id_string(UINT16 codecId) return "RDPGFX_CODECID_UNKNOWN"; } -WIN32ERROR rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) { if (Stream_GetRemainingLength(s) < 8) { @@ -105,7 +110,12 @@ WIN32ERROR rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header) { Stream_Write_UINT16(s, header->cmdId); /* cmdId (2 bytes) */ Stream_Write_UINT16(s, header->flags); /* flags (2 bytes) */ @@ -114,7 +124,12 @@ WIN32ERROR rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16) { if (Stream_GetRemainingLength(s) < 4) { @@ -128,7 +143,12 @@ WIN32ERROR rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16) { Stream_Write_UINT16(s, point16->x); /* x (2 bytes) */ Stream_Write_UINT16(s, point16->y); /* y (2 bytes) */ @@ -136,7 +156,12 @@ WIN32ERROR rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16) { if (Stream_GetRemainingLength(s) < 8) { @@ -152,7 +177,12 @@ WIN32ERROR rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16) { Stream_Write_UINT16(s, rect16->left); /* left (2 bytes) */ Stream_Write_UINT16(s, rect16->top); /* top (2 bytes) */ @@ -162,7 +192,12 @@ WIN32ERROR rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32) { if (Stream_GetRemainingLength(s) < 4) { @@ -178,7 +213,12 @@ WIN32ERROR rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_write_color32(wStream* s, RDPGFX_COLOR32* color32) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_write_color32(wStream* s, RDPGFX_COLOR32* color32) { Stream_Write_UINT8(s, color32->B); /* B (1 byte) */ Stream_Write_UINT8(s, color32->G); /* G (1 byte) */ diff --git a/channels/rdpgfx/client/rdpgfx_common.h b/channels/rdpgfx/client/rdpgfx_common.h index 921965f2f..188102cd8 100644 --- a/channels/rdpgfx/client/rdpgfx_common.h +++ b/channels/rdpgfx/client/rdpgfx_common.h @@ -30,17 +30,17 @@ const char* rdpgfx_get_cmd_id_string(UINT16 cmdId); const char* rdpgfx_get_codec_id_string(UINT16 codecId); -WIN32ERROR rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header); -WIN32ERROR rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header); +UINT rdpgfx_read_header(wStream* s, RDPGFX_HEADER* header); +UINT rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header); -WIN32ERROR rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16); -WIN32ERROR rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16); +UINT rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16); +UINT rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16); -WIN32ERROR rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16); -WIN32ERROR rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16); +UINT rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16); +UINT rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16); -WIN32ERROR rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32); -WIN32ERROR rdpgfx_write_color32(wStream* s, RDPGFX_COLOR32* color32); +UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32); +UINT rdpgfx_write_color32(wStream* s, RDPGFX_COLOR32* color32); #endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_COMMON_H */ diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index 394fe6935..f58e5cbe0 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -45,9 +45,14 @@ #define TAG CHANNELS_TAG("rdpgfx.client") -WIN32ERROR rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) { - WIN32ERROR error; + UINT error; wStream* s; UINT16 index; RDPGFX_PLUGIN* gfx; @@ -125,7 +130,12 @@ WIN32ERROR rdpgfx_send_caps_advertise_pdu(RDPGFX_CHANNEL_CALLBACK* callback) return error; } -WIN32ERROR rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_CAPSET capsSet; UINT32 capsDataLength; @@ -149,9 +159,14 @@ WIN32ERROR rdpgfx_recv_caps_confirm_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStre return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, RDPGFX_FRAME_ACKNOWLEDGE_PDU* pdu) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, RDPGFX_FRAME_ACKNOWLEDGE_PDU* pdu) { - WIN32ERROR error; + UINT error; wStream* s; RDPGFX_HEADER header; @@ -187,7 +202,12 @@ WIN32ERROR rdpgfx_send_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { int pad; UINT32 index; @@ -195,7 +215,7 @@ WIN32ERROR rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wSt RDPGFX_RESET_GRAPHICS_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 12) { @@ -257,12 +277,17 @@ WIN32ERROR rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wSt return error; } -WIN32ERROR rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_EVICT_CACHE_ENTRY_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) { @@ -284,13 +309,18 @@ WIN32ERROR rdpgfx_recv_evict_cache_entry_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_CACHE_IMPORT_REPLY_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) { @@ -334,12 +364,17 @@ WIN32ERROR rdpgfx_recv_cache_import_reply_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_CREATE_SURFACE_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 7) { @@ -365,12 +400,17 @@ WIN32ERROR rdpgfx_recv_create_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wSt return error; } -WIN32ERROR rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_DELETE_SURFACE_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 2) { @@ -392,12 +432,17 @@ WIN32ERROR rdpgfx_recv_delete_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wSt return error; } -WIN32ERROR rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_START_FRAME_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 8) { @@ -423,13 +468,18 @@ WIN32ERROR rdpgfx_recv_start_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStrea return error; } -WIN32ERROR rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_END_FRAME_PDU pdu; RDPGFX_FRAME_ACKNOWLEDGE_PDU ack; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 4) { @@ -475,13 +525,18 @@ WIN32ERROR rdpgfx_recv_end_frame_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* return error; } -WIN32ERROR rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_COMMAND cmd; RDPGFX_WIRE_TO_SURFACE_PDU_1 pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(s) < 17) { @@ -547,13 +602,18 @@ WIN32ERROR rdpgfx_recv_wire_to_surface_1_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_COMMAND cmd; RDPGFX_WIRE_TO_SURFACE_PDU_2 pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 13) { @@ -599,12 +659,17 @@ WIN32ERROR rdpgfx_recv_wire_to_surface_2_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_DELETE_ENCODING_CONTEXT_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 6) { @@ -628,14 +693,19 @@ WIN32ERROR rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* call return error; } -WIN32ERROR rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_RECT16* fillRect; RDPGFX_SOLID_FILL_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(s) < 8) { @@ -691,14 +761,19 @@ WIN32ERROR rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream return error; } -WIN32ERROR rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_POINT16* destPt; RDPGFX_SURFACE_TO_SURFACE_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(s) < 14) { @@ -759,12 +834,17 @@ WIN32ERROR rdpgfx_recv_surface_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, return error; } -WIN32ERROR rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_SURFACE_TO_CACHE_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(s) < 20) { @@ -797,14 +877,19 @@ WIN32ERROR rdpgfx_recv_surface_to_cache_pdu(RDPGFX_CHANNEL_CALLBACK* callback, w return error; } -WIN32ERROR rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 index; RDPGFX_POINT16* destPt; RDPGFX_CACHE_TO_SURFACE_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 6) { @@ -856,12 +941,17 @@ WIN32ERROR rdpgfx_recv_cache_to_surface_pdu(RDPGFX_CHANNEL_CALLBACK* callback, w return error; } -WIN32ERROR rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 12) { @@ -887,12 +977,17 @@ WIN32ERROR rdpgfx_recv_map_surface_to_output_pdu(RDPGFX_CHANNEL_CALLBACK* callba return error; } -WIN32ERROR rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { RDPGFX_MAP_SURFACE_TO_WINDOW_PDU pdu; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 18) { @@ -918,12 +1013,17 @@ WIN32ERROR rdpgfx_recv_map_surface_to_window_pdu(RDPGFX_CHANNEL_CALLBACK* callba return error; } -WIN32ERROR rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) { int beg, end; RDPGFX_HEADER header; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - WIN32ERROR error; + UINT error; beg = Stream_GetPosition(s); @@ -1049,7 +1149,12 @@ WIN32ERROR rdpgfx_recv_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s) return error; } -static WIN32ERROR rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { wStream* s; int status = 0; @@ -1057,7 +1162,7 @@ static WIN32ERROR rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCa BYTE* pDstData = NULL; RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; status = zgfx_decompress(gfx->zgfx, Stream_Pointer(data), Stream_GetRemainingLength(data), &pDstData, &DstSize, 0); @@ -1088,7 +1193,12 @@ static WIN32ERROR rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCa return error; } -static WIN32ERROR rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback) { RDPGFX_CHANNEL_CALLBACK* callback = (RDPGFX_CHANNEL_CALLBACK*) pChannelCallback; @@ -1097,7 +1207,12 @@ static WIN32ERROR rdpgfx_on_open(IWTSVirtualChannelCallback* pChannelCallback) return rdpgfx_send_caps_advertise_pdu(callback); } -static WIN32ERROR rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) { int count; int index; @@ -1158,7 +1273,12 @@ static WIN32ERROR rdpgfx_on_close(IWTSVirtualChannelCallback* pChannelCallback) return CHANNEL_RC_OK; } -static WIN32ERROR rdpgfx_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { @@ -1186,9 +1306,14 @@ static WIN32ERROR rdpgfx_on_new_channel_connection(IWTSListenerCallback* pListen return CHANNEL_RC_OK; } -static WIN32ERROR rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - WIN32ERROR error; + UINT error; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) pPlugin; gfx->listener_callback = (RDPGFX_LISTENER_CALLBACK*) calloc(1, sizeof(RDPGFX_LISTENER_CALLBACK)); @@ -1213,14 +1338,19 @@ static WIN32ERROR rdpgfx_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChann return error; } -static WIN32ERROR rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) { int count; int index; ULONG_PTR* pKeys = NULL; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) pPlugin; RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_DBG(TAG, "Terminated"); @@ -1293,7 +1423,12 @@ static WIN32ERROR rdpgfx_plugin_terminated(IWTSPlugin* pPlugin) return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_set_surface_data(RdpgfxClientContext* context, UINT16 surfaceId, void* pData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_set_surface_data(RdpgfxClientContext* context, UINT16 surfaceId, void* pData) { ULONG_PTR key; RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; @@ -1308,7 +1443,12 @@ WIN32ERROR rdpgfx_set_surface_data(RdpgfxClientContext* context, UINT16 surfaceI return CHANNEL_RC_OK; } -WIN32ERROR rdpgfx_get_surface_ids(RdpgfxClientContext* context, UINT16** ppSurfaceIds, UINT16* count_out) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_get_surface_ids(RdpgfxClientContext* context, UINT16** ppSurfaceIds, UINT16* count_out) { int count; int index; @@ -1357,7 +1497,12 @@ void* rdpgfx_get_surface_data(RdpgfxClientContext* context, UINT16 surfaceId) return pData; } -WIN32ERROR rdpgfx_set_cache_slot_data(RdpgfxClientContext* context, UINT16 cacheSlot, void* pData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpgfx_set_cache_slot_data(RdpgfxClientContext* context, UINT16 cacheSlot, void* pData) { RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) context->handle; @@ -1386,9 +1531,14 @@ void* rdpgfx_get_cache_slot_data(RdpgfxClientContext* context, UINT16 cacheSlot) #define DVCPluginEntry rdpgfx_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; RDPGFX_PLUGIN* gfx; RdpgfxClientContext* context; diff --git a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c index 5767e3bbe..736105fe5 100644 --- a/channels/rdpsnd/client/alsa/rdpsnd_alsa.c +++ b/channels/rdpsnd/client/alsa/rdpsnd_alsa.c @@ -603,7 +603,12 @@ static COMMAND_LINE_ARGUMENT_A rdpsnd_alsa_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) { int status; DWORD flags; @@ -646,11 +651,16 @@ static WIN32ERROR rdpsnd_alsa_parse_addin_args(rdpsndDevicePlugin* device, ADDIN #define freerdp_rdpsnd_client_subsystem_entry alsa_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndAlsaPlugin* alsa; - WIN32ERROR error; + UINT error; alsa = (rdpsndAlsaPlugin*) calloc(1, sizeof(rdpsndAlsaPlugin)); if (!alsa) diff --git a/channels/rdpsnd/client/ios/rdpsnd_ios.c b/channels/rdpsnd/client/ios/rdpsnd_ios.c index 22668640a..f307b2318 100644 --- a/channels/rdpsnd/client/ios/rdpsnd_ios.c +++ b/channels/rdpsnd/client/ios/rdpsnd_ios.c @@ -27,7 +27,6 @@ #include #include -#include #import @@ -284,7 +283,12 @@ static void rdpsnd_ios_free(rdpsndDevicePlugin* device) #define freerdp_rdpsnd_client_subsystem_entry ios_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { rdpsndIOSPlugin* p = (rdpsndIOSPlugin*) calloc(1, sizeof(rdpsndIOSPlugin)); diff --git a/channels/rdpsnd/client/mac/rdpsnd_mac.c b/channels/rdpsnd/client/mac/rdpsnd_mac.c index 567723581..00588f52a 100644 --- a/channels/rdpsnd/client/mac/rdpsnd_mac.c +++ b/channels/rdpsnd/client/mac/rdpsnd_mac.c @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -291,7 +290,12 @@ static void rdpsnd_mac_play(rdpsndDevicePlugin* device, BYTE* data, int size) #define freerdp_rdpsnd_client_subsystem_entry mac_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { rdpsndMacPlugin* mac; diff --git a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c index 208b3d6a5..d0400149f 100644 --- a/channels/rdpsnd/client/opensles/rdpsnd_opensles.c +++ b/channels/rdpsnd/client/opensles/rdpsnd_opensles.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -435,12 +434,17 @@ static int rdpsnd_opensles_parse_addin_args(rdpsndDevicePlugin* device, opensles_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry( +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry( PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndopenslesPlugin* opensles; - WIN32ERROR error; + UINT error; DEBUG_SND("pEntryPoints=%p", pEntryPoints); diff --git a/channels/rdpsnd/client/oss/rdpsnd_oss.c b/channels/rdpsnd/client/oss/rdpsnd_oss.c index 4f1e913e8..df01ec008 100644 --- a/channels/rdpsnd/client/oss/rdpsnd_oss.c +++ b/channels/rdpsnd/client/oss/rdpsnd_oss.c @@ -479,7 +479,12 @@ static int rdpsnd_oss_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* a #define freerdp_rdpsnd_client_subsystem_entry oss_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndOssPlugin* oss; diff --git a/channels/rdpsnd/client/pulse/rdpsnd_pulse.c b/channels/rdpsnd/client/pulse/rdpsnd_pulse.c index cb9fb8353..13899ec00 100644 --- a/channels/rdpsnd/client/pulse/rdpsnd_pulse.c +++ b/channels/rdpsnd/client/pulse/rdpsnd_pulse.c @@ -39,7 +39,6 @@ #include #include -#include #include "rdpsnd_main.h" @@ -594,7 +593,12 @@ COMMAND_LINE_ARGUMENT_A rdpsnd_pulse_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV* args) { int status; DWORD flags; @@ -634,11 +638,16 @@ static WIN32ERROR rdpsnd_pulse_parse_addin_args(rdpsndDevicePlugin* device, ADDI #define freerdp_rdpsnd_client_subsystem_entry pulse_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndPulsePlugin* pulse; - WIN32ERROR ret; + UINT ret; pulse = (rdpsndPulsePlugin*) calloc(1, sizeof(rdpsndPulsePlugin)); if (!pulse) diff --git a/channels/rdpsnd/client/rdpsnd_main.c b/channels/rdpsnd/client/rdpsnd_main.c index 94dec903f..155dd22c8 100644 --- a/channels/rdpsnd/client/rdpsnd_main.c +++ b/channels/rdpsnd/client/rdpsnd_main.c @@ -92,7 +92,12 @@ struct rdpsnd_plugin rdpContext* rdpcontext; }; -static WIN32ERROR rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave); +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave); static void* rdpsnd_schedule_thread(void* arg) { @@ -103,7 +108,7 @@ static void* rdpsnd_schedule_thread(void* arg) RDPSND_WAVE* wave; rdpsndPlugin* rdpsnd = (rdpsndPlugin*) arg; HANDLE events[2]; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DWORD status; events[0] = MessageQueue_Event(rdpsnd->MsgPipe->Out); @@ -180,7 +185,12 @@ static void* rdpsnd_schedule_thread(void* arg) return NULL; } -WIN32ERROR rdpsnd_send_quality_mode_pdu(rdpsndPlugin* rdpsnd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_send_quality_mode_pdu(rdpsndPlugin* rdpsnd) { wStream* pdu; @@ -254,7 +264,12 @@ static void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd) #endif } -WIN32ERROR rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd) { int index; wStream* pdu; @@ -323,13 +338,18 @@ WIN32ERROR rdpsnd_send_client_audio_formats(rdpsndPlugin* rdpsnd) return rdpsnd_virtual_channel_write(rdpsnd, pdu); } -WIN32ERROR rdpsnd_recv_server_audio_formats_pdu(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_recv_server_audio_formats_pdu(rdpsndPlugin* rdpsnd, wStream* s) { int index; UINT16 wVersion; AUDIO_FORMAT* format; UINT16 wNumberOfFormats; - WIN32ERROR ret = ERROR_BAD_LENGTH; + UINT ret = ERROR_BAD_LENGTH; rdpsnd_free_audio_formats(rdpsnd->ServerFormats, rdpsnd->NumberOfServerFormats); rdpsnd->NumberOfServerFormats = 0; @@ -407,7 +427,12 @@ out_fail: return ret; } -WIN32ERROR rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, UINT16 wPackSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, UINT16 wPackSize) { wStream* pdu; @@ -430,7 +455,12 @@ WIN32ERROR rdpsnd_send_training_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeSt return rdpsnd_virtual_channel_write(rdpsnd, pdu); } -static WIN32ERROR rdpsnd_recv_training_pdu(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_recv_training_pdu(rdpsndPlugin* rdpsnd, wStream* s) { UINT16 wTimeStamp; UINT16 wPackSize; @@ -447,7 +477,12 @@ static WIN32ERROR rdpsnd_recv_training_pdu(rdpsndPlugin* rdpsnd, wStream* s) return rdpsnd_send_training_confirm_pdu(rdpsnd, wTimeStamp, wPackSize); } -static WIN32ERROR rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, UINT16 BodySize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, UINT16 BodySize) { UINT16 wFormatNo; AUDIO_FORMAT* format; @@ -497,7 +532,12 @@ static WIN32ERROR rdpsnd_recv_wave_info_pdu(rdpsndPlugin* rdpsnd, wStream* s, UI return CHANNEL_RC_OK; } -WIN32ERROR rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, BYTE cConfirmedBlockNo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, BYTE cConfirmedBlockNo) { wStream* pdu; @@ -518,7 +558,12 @@ WIN32ERROR rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, return rdpsnd_virtual_channel_write(rdpsnd, pdu); } -WIN32ERROR rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave) { WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveConfirm: cBlockNo: %d wTimeStamp: %d wTimeDiff: %d", wave->cBlockNo, wave->wTimeStampB, wave->wTimeStampB - wave->wTimeStampA); @@ -526,7 +571,12 @@ WIN32ERROR rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave) return rdpsnd_send_wave_confirm_pdu(rdpsnd, wave->wTimeStampB, wave->cBlockNo); } -static WIN32ERROR rdpsnd_device_send_wave_confirm_pdu(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_device_send_wave_confirm_pdu(rdpsndDevicePlugin* device, RDPSND_WAVE* wave) { if (device->DisableConfirmThread) return rdpsnd_confirm_wave(device->rdpsnd, wave); @@ -541,13 +591,18 @@ static WIN32ERROR rdpsnd_device_send_wave_confirm_pdu(rdpsndDevicePlugin* device } -static WIN32ERROR rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_recv_wave_pdu(rdpsndPlugin* rdpsnd, wStream* s) { int size; BYTE* data; RDPSND_WAVE* wave; AUDIO_FORMAT* format; - WIN32ERROR status; + UINT status; rdpsnd->expectingWave = FALSE; @@ -633,7 +688,12 @@ static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd) rdpsnd->isOpen = FALSE; } -static WIN32ERROR rdpsnd_recv_volume_pdu(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_recv_volume_pdu(rdpsndPlugin* rdpsnd, wStream* s) { UINT32 dwVolume; @@ -653,11 +713,16 @@ static WIN32ERROR rdpsnd_recv_volume_pdu(rdpsndPlugin* rdpsnd, wStream* s) return CHANNEL_RC_OK; } -static WIN32ERROR rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_recv_pdu(rdpsndPlugin* rdpsnd, wStream* s) { BYTE msgType; UINT16 BodySize; - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; if (rdpsnd->expectingWave) { @@ -723,11 +788,16 @@ static void rdpsnd_register_device_plugin(rdpsndPlugin* rdpsnd, rdpsndDevicePlug device->WaveConfirm = rdpsnd_device_send_wave_confirm_pdu; } -static WIN32ERROR rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name, ADDIN_ARGV* args) { PFREERDP_RDPSND_DEVICE_ENTRY entry; FREERDP_RDPSND_DEVICE_ENTRY_POINTS entryPoints;\ - WIN32ERROR error; + UINT error; entry = (PFREERDP_RDPSND_DEVICE_ENTRY) freerdp_load_channel_addin_entry("rdpsnd", (LPSTR) name, NULL, 0); @@ -770,7 +840,12 @@ COMMAND_LINE_ARGUMENT_A rdpsnd_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* args) { int status; DWORD flags; @@ -854,10 +929,15 @@ static WIN32ERROR rdpsnd_process_addin_args(rdpsndPlugin* rdpsnd, ADDIN_ARGV* ar return CHANNEL_RC_OK; } -static WIN32ERROR rdpsnd_process_connect(rdpsndPlugin* rdpsnd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_process_connect(rdpsndPlugin* rdpsnd) { ADDIN_ARGV* args; - WIN32ERROR status = ERROR_INTERNAL_ERROR; + UINT status = ERROR_INTERNAL_ERROR; char *subsystem_name = NULL, *device_name = NULL; rdpsnd->latency = -1; @@ -1075,9 +1155,14 @@ void rdpsnd_remove_open_handle_data(DWORD openHandle) } } -WIN32ERROR rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) { - WIN32ERROR status; + UINT status; if (!rdpsnd) { @@ -1099,7 +1184,12 @@ WIN32ERROR rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s) return status; } -static WIN32ERROR rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_virtual_channel_event_data_received(rdpsndPlugin* plugin, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* s; @@ -1157,7 +1247,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event(DWORD openHandle, UINT e LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { rdpsndPlugin* rdpsnd; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; rdpsnd = (rdpsndPlugin*) rdpsnd_get_open_handle_data(openHandle); @@ -1191,7 +1281,7 @@ static void* rdpsnd_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; rdpsndPlugin* rdpsnd = (rdpsndPlugin*) arg; - WIN32ERROR error; + UINT error; if ((error = rdpsnd_process_connect(rdpsnd))) { @@ -1239,7 +1329,12 @@ out: return NULL; } -static WIN32ERROR rdpsnd_virtual_channel_event_connected(rdpsndPlugin* plugin, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_virtual_channel_event_connected(rdpsndPlugin* plugin, LPVOID pData, UINT32 dataLength) { UINT32 status; @@ -1279,9 +1374,14 @@ static WIN32ERROR rdpsnd_virtual_channel_event_connected(rdpsndPlugin* plugin, L return CHANNEL_RC_OK; } -static WIN32ERROR rdpsnd_virtual_channel_event_disconnected(rdpsndPlugin* rdpsnd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_virtual_channel_event_disconnected(rdpsndPlugin* rdpsnd) { - WIN32ERROR error; + UINT error; MessagePipe_PostQuit(rdpsnd->MsgPipe, 0); if (WaitForSingleObject(rdpsnd->thread, INFINITE) == WAIT_FAILED) @@ -1352,7 +1452,7 @@ static void rdpsnd_virtual_channel_event_terminated(rdpsndPlugin* rdpsnd) static VOID VCAPITYPE rdpsnd_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { rdpsndPlugin* plugin; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; plugin = (rdpsndPlugin*) rdpsnd_get_init_handle_data(pInitHandle); diff --git a/channels/rdpsnd/client/rdpsnd_main.h b/channels/rdpsnd/client/rdpsnd_main.h index 7a06205cf..cd6a15273 100644 --- a/channels/rdpsnd/client/rdpsnd_main.h +++ b/channels/rdpsnd/client/rdpsnd_main.h @@ -21,8 +21,6 @@ #ifndef __RDPSND_MAIN_H #define __RDPSND_MAIN_H -#include - #include #include #include @@ -37,6 +35,6 @@ #define DEBUG_SND(fmt, ...) do { } while (0) #endif -WIN32ERROR rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s); +UINT rdpsnd_virtual_channel_write(rdpsndPlugin* rdpsnd, wStream* s); #endif /* __RDPSND_MAIN_H */ diff --git a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c index 70e232dd3..a9d54f441 100644 --- a/channels/rdpsnd/client/winmm/rdpsnd_winmm.c +++ b/channels/rdpsnd/client/winmm/rdpsnd_winmm.c @@ -33,12 +33,10 @@ #include #include -#include #include #include #include -#include #include "rdpsnd_main.h" @@ -339,7 +337,12 @@ static void rdpsnd_winmm_parse_addin_args(rdpsndDevicePlugin* device, ADDIN_ARGV #define freerdp_rdpsnd_client_subsystem_entry winmm_freerdp_rdpsnd_client_subsystem_entry #endif -WIN32ERROR freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_rdpsnd_client_subsystem_entry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) { ADDIN_ARGV* args; rdpsndWinmmPlugin* winmm; diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 6c93ecf1b..7bd0310b0 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -35,7 +35,12 @@ #include "rdpsnd_main.h" -WIN32ERROR rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) { int pos; UINT16 i; @@ -85,11 +90,16 @@ WIN32ERROR rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s) return status ? CHANNEL_RC_OK: ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream* s) { UINT16 timestamp; BYTE confirmBlockNum; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 4) { @@ -108,7 +118,12 @@ static WIN32ERROR rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, w return error; } -static WIN32ERROR rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, wStream* s) { UINT16 quality; @@ -124,13 +139,18 @@ static WIN32ERROR rdpsnd_server_recv_quality_mode(RdpsndServerContext* context, return CHANNEL_RC_OK; } -static WIN32ERROR rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_recv_formats(RdpsndServerContext* context, wStream* s) { int i, num_known_format = 0; UINT32 flags, vol, pitch; UINT16 udpPort; BYTE lastblock; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (Stream_GetRemainingLength(s) < 20) { @@ -222,7 +242,7 @@ static void* rdpsnd_server_thread(void* arg) DWORD nCount, status; HANDLE events[8]; RdpsndServerContext* context; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; context = (RdpsndServerContext *)arg; nCount = 0; @@ -273,13 +293,23 @@ out: return NULL; } -static WIN32ERROR rdpsnd_server_initialize(RdpsndServerContext* context, BOOL ownThread) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_initialize(RdpsndServerContext* context, BOOL ownThread) { context->priv->ownThread = ownThread; return context->Start(context); } -static WIN32ERROR rdpsnd_server_select_format(RdpsndServerContext* context, int client_format_index) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_select_format(RdpsndServerContext* context, int client_format_index) { int bs; int out_buffer_size; @@ -346,7 +376,12 @@ static WIN32ERROR rdpsnd_server_select_format(RdpsndServerContext* context, int return CHANNEL_RC_OK; } -static WIN32ERROR rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, UINT16 wTimestamp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, UINT16 wTimestamp) { int size; BYTE* src; @@ -357,7 +392,7 @@ static WIN32ERROR rdpsnd_server_send_audio_pdu(RdpsndServerContext* context, UIN int tbytes_per_frame; ULONG written; wStream* s = context->priv->rdpsnd_pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; format = &context->client_formats[context->selected_client_format]; tbytes_per_frame = format->nChannels * context->priv->src_bytes_per_sample; @@ -455,11 +490,16 @@ out: return error; } -static WIN32ERROR rdpsnd_server_send_samples(RdpsndServerContext* context, const void* buf, int nframes, UINT16 wTimestamp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_send_samples(RdpsndServerContext* context, const void* buf, int nframes, UINT16 wTimestamp) { int cframes; int cframesize; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (context->selected_client_format < 0) return ERROR_INVALID_DATA; @@ -486,7 +526,12 @@ static WIN32ERROR rdpsnd_server_send_samples(RdpsndServerContext* context, const return error; } -static WIN32ERROR rdpsnd_server_set_volume(RdpsndServerContext* context, int left, int right) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_set_volume(RdpsndServerContext* context, int left, int right) { int pos; BOOL status; @@ -510,13 +555,18 @@ static WIN32ERROR rdpsnd_server_set_volume(RdpsndServerContext* context, int lef return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpsnd_server_close(RdpsndServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_close(RdpsndServerContext* context) { int pos; BOOL status; ULONG written; wStream* s = context->priv->rdpsnd_pdu; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (context->selected_client_format < 0) return ERROR_INVALID_DATA; @@ -546,12 +596,17 @@ static WIN32ERROR rdpsnd_server_close(RdpsndServerContext* context) return status ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR rdpsnd_server_start(RdpsndServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_start(RdpsndServerContext* context) { void *buffer = NULL; DWORD bytesReturned; RdpsndServerPrivate *priv = context->priv; - WIN32ERROR error = ERROR_INTERNAL_ERROR; + UINT error = ERROR_INTERNAL_ERROR; priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "rdpsnd"); if (!priv->ChannelHandle) @@ -613,9 +668,14 @@ out_close: return error; } -static WIN32ERROR rdpsnd_server_stop(RdpsndServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT rdpsnd_server_stop(RdpsndServerContext* context) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; if (context->priv->ownThread) { if (context->priv->StopEvent) @@ -739,10 +799,15 @@ HANDLE rdpsnd_server_get_event_handle(RdpsndServerContext *context) * ERROR_NO_DATA if no data could be read this time * otherwise error */ -WIN32ERROR rdpsnd_server_handle_messages(RdpsndServerContext *context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT rdpsnd_server_handle_messages(RdpsndServerContext *context) { DWORD bytesReturned; - WIN32ERROR ret = CHANNEL_RC_OK; + UINT ret = CHANNEL_RC_OK; RdpsndServerPrivate *priv = context->priv; wStream *s = priv->input_stream; diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index 82985c35d..7a74705a8 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -40,7 +40,12 @@ RemdeskClientContext* remdesk_get_client_interface(remdeskPlugin* remdesk) return pInterface; } -static WIN32ERROR remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* s) { UINT32 status; @@ -60,7 +65,12 @@ static WIN32ERROR remdesk_virtual_channel_write(remdeskPlugin* remdesk, wStream* return status; } -WIN32ERROR remdesk_generate_expert_blob(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT remdesk_generate_expert_blob(remdeskPlugin* remdesk) { char* name; char* pass; @@ -114,7 +124,12 @@ WIN32ERROR remdesk_generate_expert_blob(remdeskPlugin* remdesk) return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; UINT32 ChannelNameLen; @@ -164,7 +179,12 @@ static WIN32ERROR remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int index; UINT32 ChannelNameLen; @@ -187,14 +207,24 @@ static WIN32ERROR remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADE return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) { remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*) ctlHeader); Stream_Write_UINT32(s, ctlHeader->msgType); /* msgType (4 bytes) */ return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, UINT32 msgSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, UINT32 msgSize) { ctlHeader->msgType = msgType; strcpy(ctlHeader->ChannelName, REMDESK_CHANNEL_CTL_NAME); @@ -202,12 +232,22 @@ static WIN32ERROR remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_recv_ctl_server_announce_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_server_announce_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) { return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) { UINT32 versionMajor; UINT32 versionMinor; @@ -226,11 +266,16 @@ static WIN32ERROR remdesk_recv_ctl_version_info_pdu(remdeskPlugin* remdesk, wStr return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) { wStream* s; REMDESK_CTL_VERSION_INFO_PDU pdu; - WIN32ERROR error; + UINT error; remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERSIONINFO, 8); @@ -259,7 +304,12 @@ static WIN32ERROR remdesk_send_ctl_version_info_pdu(remdeskPlugin* remdesk) return error; } -static WIN32ERROR remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header, UINT32 *pResult) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header, UINT32 *pResult) { UINT32 result; @@ -276,10 +326,15 @@ static WIN32ERROR remdesk_recv_ctl_result_pdu(remdeskPlugin* remdesk, wStream* s return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_authenticate_pdu(remdeskPlugin* remdesk) { int status; - WIN32ERROR error; + UINT error; wStream* s = NULL; int cbExpertBlobW = 0; WCHAR* expertBlobW = NULL; @@ -347,10 +402,15 @@ out: return error; } -static WIN32ERROR remdesk_send_ctl_remote_control_desktop_pdu(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_remote_control_desktop_pdu(remdeskPlugin* remdesk) { int status; - WIN32ERROR error; + UINT error; wStream* s = NULL; int cbRaConnectionStringW = 0; WCHAR* raConnectionStringW = NULL; @@ -395,10 +455,15 @@ out: return error; } -static WIN32ERROR remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_verify_password_pdu(remdeskPlugin* remdesk) { int status; - WIN32ERROR error; + UINT error; wStream* s; int cbExpertBlobW = 0; WCHAR* expertBlobW = NULL; @@ -449,9 +514,14 @@ out: return error; } -static WIN32ERROR remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) { - WIN32ERROR error; + UINT error; wStream* s; REMDESK_CTL_EXPERT_ON_VISTA_PDU pdu; @@ -483,9 +553,14 @@ static WIN32ERROR remdesk_send_ctl_expert_on_vista_pdu(remdeskPlugin* remdesk) return remdesk_virtual_channel_write(remdesk, s); } -static WIN32ERROR remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDESK_CHANNEL_HEADER* header) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; UINT32 msgType = 0; UINT32 result = 0; @@ -591,9 +666,14 @@ static WIN32ERROR remdesk_recv_ctl_pdu(remdeskPlugin* remdesk, wStream* s, REMDE return error; } -static WIN32ERROR remdesk_process_receive(remdeskPlugin* remdesk, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_process_receive(remdeskPlugin* remdesk, wStream* s) { - WIN32ERROR status; + UINT status; REMDESK_CHANNEL_HEADER header; #if 0 @@ -649,7 +729,12 @@ static void remdesk_process_connect(remdeskPlugin* remdesk) static wListDictionary* g_InitHandles = NULL; static wListDictionary* g_OpenHandles = NULL; -WIN32ERROR remdesk_add_init_handle_data(void* pInitHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT remdesk_add_init_handle_data(void* pInitHandle, void* pUserData) { if (!g_InitHandles) { @@ -678,7 +763,12 @@ void remdesk_remove_init_handle_data(void* pInitHandle) } } -WIN32ERROR remdesk_add_open_handle_data(DWORD openHandle, void* pUserData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT remdesk_add_open_handle_data(DWORD openHandle, void* pUserData) { void* pOpenHandle = (void*) (size_t) openHandle; @@ -711,9 +801,14 @@ void remdesk_remove_open_handle_data(DWORD openHandle) } } -WIN32ERROR remdesk_send(remdeskPlugin* remdesk, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT remdesk_send(remdeskPlugin* remdesk, wStream* s) { - WIN32ERROR status = 0; + UINT status = 0; remdeskPlugin* plugin = (remdeskPlugin*) remdesk; if (!plugin) @@ -736,7 +831,12 @@ WIN32ERROR remdesk_send(remdeskPlugin* remdesk, wStream* s) return status; } -static WIN32ERROR remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_virtual_channel_event_data_received(remdeskPlugin* remdesk, void* pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { wStream* data_in; @@ -792,7 +892,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_open_event(DWORD openHandle, UINT LPVOID pData, UINT32 dataLength, UINT32 totalLength, UINT32 dataFlags) { remdeskPlugin* remdesk; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; remdesk = (remdeskPlugin*) remdesk_get_open_handle_data(openHandle); @@ -831,7 +931,7 @@ static void* remdesk_virtual_channel_client_thread(void* arg) wStream* data; wMessage message; remdeskPlugin* remdesk = (remdeskPlugin*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; remdesk_process_connect(remdesk); @@ -870,10 +970,15 @@ static void* remdesk_virtual_channel_client_thread(void* arg) return NULL; } -static WIN32ERROR remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, LPVOID pData, UINT32 dataLength) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_virtual_channel_event_connected(remdeskPlugin* remdesk, LPVOID pData, UINT32 dataLength) { UINT32 status; - WIN32ERROR error; + UINT error; status = remdesk->channelEntryPoints.pVirtualChannelOpen(remdesk->InitHandle, &remdesk->OpenHandle, remdesk->channelDef.name, remdesk_virtual_channel_open_event); @@ -915,7 +1020,12 @@ error_out: return error; } -static WIN32ERROR remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) { UINT rc; @@ -959,7 +1069,7 @@ static void remdesk_virtual_channel_event_terminated(remdeskPlugin* remdesk) static VOID VCAPITYPE remdesk_virtual_channel_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength) { remdeskPlugin* remdesk; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; remdesk = (remdeskPlugin*) remdesk_get_init_handle_data(pInitHandle); @@ -995,7 +1105,7 @@ static VOID VCAPITYPE remdesk_virtual_channel_init_event(LPVOID pInitHandle, UIN BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints) { UINT rc; - WIN32ERROR error; + UINT error; remdeskPlugin* remdesk; RemdeskClientContext* context = NULL; diff --git a/channels/remdesk/server/remdesk_main.c b/channels/remdesk/server/remdesk_main.c index c932daf19..cf33f76aa 100644 --- a/channels/remdesk/server/remdesk_main.c +++ b/channels/remdesk/server/remdesk_main.c @@ -29,7 +29,12 @@ #include "remdesk_main.h" -static WIN32ERROR remdesk_virtual_channel_write(RemdeskServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_virtual_channel_write(RemdeskServerContext* context, wStream* s) { BOOL status; ULONG BytesWritten = 0; @@ -40,7 +45,12 @@ static WIN32ERROR remdesk_virtual_channel_write(RemdeskServerContext* context, w return (status) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR; } -static WIN32ERROR remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; UINT32 ChannelNameLen; @@ -90,7 +100,12 @@ static WIN32ERROR remdesk_read_channel_header(wStream* s, REMDESK_CHANNEL_HEADER return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADER* header) { int index; UINT32 ChannelNameLen; @@ -113,9 +128,14 @@ static WIN32ERROR remdesk_write_channel_header(wStream* s, REMDESK_CHANNEL_HEADE return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHeader) { - WIN32ERROR error; + UINT error; if ((error = remdesk_write_channel_header(s, (REMDESK_CHANNEL_HEADER*) ctlHeader))) { WLog_ERR(TAG, "remdesk_write_channel_header failed with error %lu!", error); @@ -125,7 +145,12 @@ static WIN32ERROR remdesk_write_ctl_header(wStream* s, REMDESK_CTL_HEADER* ctlHe return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, UINT32 msgSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT32 msgType, UINT32 msgSize) { ctlHeader->msgType = msgType; strcpy(ctlHeader->ChannelName, REMDESK_CHANNEL_CTL_NAME); @@ -133,11 +158,16 @@ static WIN32ERROR remdesk_prepare_ctl_header(REMDESK_CTL_HEADER* ctlHeader, UINT return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_send_ctl_result_pdu(RemdeskServerContext* context, UINT32 result) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_result_pdu(RemdeskServerContext* context, UINT32 result) { wStream* s; REMDESK_CTL_RESULT_PDU pdu; - WIN32ERROR error; + UINT error; pdu.result = result; @@ -173,11 +203,16 @@ out: return error; } -static WIN32ERROR remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_send_ctl_version_info_pdu(RemdeskServerContext* context) { wStream* s; REMDESK_CTL_VERSION_INFO_PDU pdu; - WIN32ERROR error; + UINT error; if ((error = remdesk_prepare_ctl_header(&(pdu.ctlHeader), REMDESK_CTL_VERSIONINFO, 8))) { @@ -214,7 +249,12 @@ out: return error; } -static WIN32ERROR remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) { UINT32 versionMajor; UINT32 versionMinor; @@ -231,7 +271,12 @@ static WIN32ERROR remdesk_recv_ctl_version_info_pdu(RemdeskServerContext* contex return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_recv_ctl_remote_control_desktop_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_remote_control_desktop_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; int cchStringW; @@ -240,7 +285,7 @@ static WIN32ERROR remdesk_recv_ctl_remote_control_desktop_pdu(RemdeskServerConte int cbRaConnectionStringW = 0; WCHAR* raConnectionStringW = NULL; REMDESK_CTL_REMOTE_CONTROL_DESKTOP_PDU pdu; - WIN32ERROR error; + UINT error; msgLength = header->DataLength - 4; @@ -281,7 +326,12 @@ static WIN32ERROR remdesk_recv_ctl_remote_control_desktop_pdu(RemdeskServerConte return error; } -static WIN32ERROR remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; int cchStringW; @@ -358,13 +408,18 @@ static WIN32ERROR remdesk_recv_ctl_authenticate_pdu(RemdeskServerContext* contex return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) { int status; int cbExpertBlobW = 0; WCHAR* expertBlobW = NULL; REMDESK_CTL_VERIFY_PASSWORD_PDU pdu; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(s) < 8) { @@ -391,9 +446,14 @@ static WIN32ERROR remdesk_recv_ctl_verify_password_pdu(RemdeskServerContext* con return error; } -static WIN32ERROR remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s, REMDESK_CHANNEL_HEADER* header) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; UINT32 msgType = 0; if (Stream_GetRemainingLength(s) < 4) @@ -466,9 +526,14 @@ static WIN32ERROR remdesk_recv_ctl_pdu(RemdeskServerContext* context, wStream* s return error; } -static WIN32ERROR remdesk_server_receive_pdu(RemdeskServerContext* context, wStream* s) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_server_receive_pdu(RemdeskServerContext* context, wStream* s) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; REMDESK_CHANNEL_HEADER header; #if 0 @@ -531,7 +596,7 @@ static void* remdesk_server_thread(void* arg) HANDLE ChannelEvent; DWORD BytesReturned; RemdeskServerContext* context; - WIN32ERROR error; + UINT error; context = (RemdeskServerContext*) arg; @@ -641,7 +706,12 @@ out: return NULL; } -static WIN32ERROR remdesk_server_start(RemdeskServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_server_start(RemdeskServerContext* context) { context->priv->ChannelHandle = WTSVirtualChannelOpen(context->vcm, WTS_CURRENT_SESSION, "remdesk"); @@ -669,9 +739,14 @@ static WIN32ERROR remdesk_server_start(RemdeskServerContext* context) return CHANNEL_RC_OK; } -static WIN32ERROR remdesk_server_stop(RemdeskServerContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT remdesk_server_stop(RemdeskServerContext* context) { - WIN32ERROR error; + UINT error; SetEvent(context->priv->StopEvent); diff --git a/channels/serial/client/serial_main.c b/channels/serial/client/serial_main.c index 870d007d7..548fa5675 100644 --- a/channels/serial/client/serial_main.c +++ b/channels/serial/client/serial_main.c @@ -230,7 +230,12 @@ static void serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp) Stream_Zero(irp->output, 5); /* Padding (5 bytes) */ } -static WIN32ERROR serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp) { UINT32 Length; UINT64 Offset; @@ -328,7 +333,12 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp) } -static WIN32ERROR serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp) { UINT32 IoControlCode; UINT32 InputBufferLength; @@ -410,9 +420,14 @@ static WIN32ERROR serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* return CHANNEL_RC_OK; } -static WIN32ERROR serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) { - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; WLog_Print(serial->log, WLOG_DEBUG, "IRP MajorFunction: 0x%04X MinorFunction: 0x%04X\n", irp->MajorFunction, irp->MinorFunction); @@ -451,7 +466,7 @@ static WIN32ERROR serial_process_irp(SERIAL_DEVICE* serial, IRP* irp) static void* irp_thread_func(void* arg) { IRP_THREAD_DATA *data = (IRP_THREAD_DATA*)arg; - WIN32ERROR error; + UINT error; /* blocks until the end of the request */ if ((error = serial_process_irp(data->serial, data->irp))) @@ -694,7 +709,7 @@ static void* serial_thread_func(void* arg) IRP* irp; wMessage message; SERIAL_DEVICE* serial = (SERIAL_DEVICE*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; while (1) { @@ -732,7 +747,12 @@ static void* serial_thread_func(void* arg) } -static WIN32ERROR serial_irp_request(DEVICE* device, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT serial_irp_request(DEVICE* device, IRP* irp) { SERIAL_DEVICE* serial = (SERIAL_DEVICE*) device; @@ -755,9 +775,14 @@ static WIN32ERROR serial_irp_request(DEVICE* device, IRP* irp) } -static WIN32ERROR serial_free(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT serial_free(DEVICE* device) { - WIN32ERROR error; + UINT error; SERIAL_DEVICE* serial = (SERIAL_DEVICE*) device; WLog_Print(serial->log, WLOG_DEBUG, "freeing"); @@ -790,7 +815,12 @@ static WIN32ERROR serial_free(DEVICE* device) #define DeviceServiceEntry serial_DeviceServiceEntry #endif -WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { char* name; char* path; @@ -800,7 +830,7 @@ WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) int i, len; SERIAL_DEVICE* serial; #endif /* __linux__ */ - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; device = (RDPDR_SERIAL*) pEntryPoints->device; name = device->Name; diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index 7f0942da7..cf20a5c27 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -42,7 +42,7 @@ void* smartcard_context_thread(SMARTCARD_CONTEXT* pContext) wMessage message; SMARTCARD_DEVICE* smartcard; SMARTCARD_OPERATION* operation; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; smartcard = pContext->smartcard; @@ -238,9 +238,14 @@ static void smartcard_release_all_contexts(SMARTCARD_DEVICE* smartcard) { } -static WIN32ERROR smartcard_free(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT smartcard_free(DEVICE* device) { - WIN32ERROR error; + UINT error; SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) device; /** @@ -294,7 +299,12 @@ static WIN32ERROR smartcard_free(DEVICE* device) * At that time, we need to cancel all outstanding IRPs. */ -static WIN32ERROR smartcard_init(DEVICE* device) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT smartcard_init(DEVICE* device) { SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) device; @@ -303,7 +313,12 @@ static WIN32ERROR smartcard_init(DEVICE* device) return CHANNEL_RC_OK; } -WIN32ERROR smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { void* key; @@ -318,7 +333,12 @@ WIN32ERROR smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) * http://musclecard.996296.n3.nabble.com/Multiple-threads-and-SCardGetStatusChange-td4430.html */ -WIN32ERROR smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp) { void* key; LONG status; @@ -485,7 +505,7 @@ static void* smartcard_thread_func(void* arg) HANDLE hEvents[2]; wMessage message; SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; nCount = 0; hEvents[nCount++] = MessageQueue_Event(smartcard->IrpQueue); @@ -626,7 +646,12 @@ out: return NULL; } -static WIN32ERROR smartcard_irp_request(DEVICE* device, IRP* irp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT smartcard_irp_request(DEVICE* device, IRP* irp) { SMARTCARD_DEVICE* smartcard = (SMARTCARD_DEVICE*) device; if (!MessageQueue_Post(smartcard->IrpQueue, NULL, 0, (void*) irp, NULL)) @@ -640,7 +665,12 @@ static WIN32ERROR smartcard_irp_request(DEVICE* device, IRP* irp) /* smartcard is always built-in */ #define DeviceServiceEntry smartcard_DeviceServiceEntry -WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) { char* name; char* path; @@ -648,7 +678,7 @@ WIN32ERROR DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints) int ck; RDPDR_SMARTCARD* device; SMARTCARD_DEVICE* smartcard; - WIN32ERROR error = CHANNEL_RC_NO_MEMORY; + UINT error = CHANNEL_RC_NO_MEMORY; device = (RDPDR_SMARTCARD*) pEntryPoints->device; diff --git a/channels/smartcard/client/smartcard_main.h b/channels/smartcard/client/smartcard_main.h index 96d925c62..10cdb5038 100644 --- a/channels/smartcard/client/smartcard_main.h +++ b/channels/smartcard/client/smartcard_main.h @@ -125,8 +125,8 @@ struct _SMARTCARD_DEVICE SMARTCARD_CONTEXT* smartcard_context_new(SMARTCARD_DEVICE* smartcard, SCARDCONTEXT hContext); void smartcard_context_free(SMARTCARD_CONTEXT* pContext); -WIN32ERROR smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); -WIN32ERROR smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); +UINT smartcard_complete_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); +UINT smartcard_process_irp(SMARTCARD_DEVICE* smartcard, IRP* irp); LONG smartcard_irp_device_control_decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation); LONG smartcard_irp_device_control_call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation); diff --git a/channels/tsmf/client/tsmf_ifman.c b/channels/tsmf/client/tsmf_ifman.c index e0fd97a12..392377210 100644 --- a/channels/tsmf/client/tsmf_ifman.c +++ b/channels/tsmf/client/tsmf_ifman.c @@ -39,7 +39,12 @@ #include "tsmf_ifman.h" -WIN32ERROR tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman) { UINT32 CapabilityValue; @@ -57,7 +62,12 @@ WIN32ERROR tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) { UINT32 i; UINT32 v; @@ -120,7 +130,12 @@ WIN32ERROR tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) { UINT32 numMediaType; UINT32 PlatformCookie; @@ -151,9 +166,14 @@ WIN32ERROR tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; TSMF_PRESENTATION* presentation; DEBUG_TSMF(""); @@ -182,10 +202,15 @@ WIN32ERROR tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman) return status; } -WIN32ERROR tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext) { UINT32 StreamId; - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; TSMF_STREAM* stream; TSMF_PRESENTATION* presentation; @@ -217,7 +242,12 @@ WIN32ERROR tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext) return status; } -WIN32ERROR tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman) { DEBUG_TSMF(""); if (!Stream_EnsureRemainingCapacity(ifman->output, 8)) @@ -229,7 +259,12 @@ WIN32ERROR tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_remove_stream(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_remove_stream(TSMF_IFMAN* ifman) { int status = CHANNEL_RC_OK; UINT32 StreamId; @@ -274,9 +309,14 @@ float tsmf_stream_read_float(wStream *s) return fValue; } -WIN32ERROR tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; float Left, Top; float Right, Bottom; TSMF_PRESENTATION* presentation; @@ -309,7 +349,12 @@ WIN32ERROR tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman) return status; } -WIN32ERROR tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -336,7 +381,12 @@ WIN32ERROR tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; UINT32 newVolume; @@ -369,7 +419,12 @@ WIN32ERROR tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman) return 0; } -WIN32ERROR tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -395,14 +450,24 @@ WIN32ERROR tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_set_video_window(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_set_video_window(TSMF_IFMAN* ifman) { DEBUG_TSMF(""); ifman->output_pending = TRUE; return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; UINT32 numGeometryInfo; @@ -413,7 +478,7 @@ WIN32ERROR tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) UINT32 cbVisibleRect; RDP_RECT *rects = NULL; int num_rects = 0; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; int i; int pos; @@ -468,21 +533,36 @@ WIN32ERROR tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman) return error; } -WIN32ERROR tsmf_ifman_set_allocator(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_set_allocator(TSMF_IFMAN* ifman) { DEBUG_TSMF(""); ifman->output_pending = TRUE; return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_notify_preroll(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_notify_preroll(TSMF_IFMAN* ifman) { DEBUG_TSMF(""); ifman->output_pending = TRUE; return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_sample(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; TSMF_STREAM* stream; @@ -492,7 +572,7 @@ WIN32ERROR tsmf_ifman_on_sample(TSMF_IFMAN* ifman) UINT64 ThrottleDuration; UINT32 SampleExtensions; UINT32 cbData; - WIN32ERROR error; + UINT error; if (Stream_GetRemainingLength(ifman->input) < 60) return ERROR_INVALID_DATA; @@ -548,7 +628,12 @@ WIN32ERROR tsmf_ifman_on_sample(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_flush(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_flush(TSMF_IFMAN* ifman) { UINT32 StreamId; TSMF_PRESENTATION* presentation; @@ -575,7 +660,12 @@ WIN32ERROR tsmf_ifman_on_flush(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman) { UINT32 StreamId; TSMF_STREAM* stream; @@ -610,7 +700,12 @@ WIN32ERROR tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -638,7 +733,12 @@ WIN32ERROR tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -659,7 +759,12 @@ WIN32ERROR tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -679,7 +784,12 @@ WIN32ERROR tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; @@ -706,7 +816,12 @@ WIN32ERROR tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman) return CHANNEL_RC_OK; } -WIN32ERROR tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman) { DEBUG_TSMF(""); diff --git a/channels/tsmf/client/tsmf_ifman.h b/channels/tsmf/client/tsmf_ifman.h index 056d4db67..84d0406bc 100644 --- a/channels/tsmf/client/tsmf_ifman.h +++ b/channels/tsmf/client/tsmf_ifman.h @@ -42,29 +42,29 @@ struct _TSMF_IFMAN UINT32 output_interface_id; }; -WIN32ERROR tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext); -WIN32ERROR tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_remove_stream(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_set_video_window(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_set_allocator(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_notify_preroll(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_sample(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_flush(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman); -WIN32ERROR tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman); +UINT tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman); +UINT tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman); +UINT tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman); +UINT tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext); +UINT tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman); +UINT tsmf_ifman_remove_stream(TSMF_IFMAN* ifman); +UINT tsmf_ifman_set_source_video_rect(TSMF_IFMAN* ifman); +UINT tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman); +UINT tsmf_ifman_set_video_window(TSMF_IFMAN* ifman); +UINT tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman); +UINT tsmf_ifman_set_allocator(TSMF_IFMAN* ifman); +UINT tsmf_ifman_notify_preroll(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_sample(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_flush(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_playback_paused(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_playback_restarted(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman); +UINT tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN* ifman); #endif diff --git a/channels/tsmf/client/tsmf_main.c b/channels/tsmf/client/tsmf_main.c index 9a336c85c..0c8bdea3a 100644 --- a/channels/tsmf/client/tsmf_main.c +++ b/channels/tsmf/client/tsmf_main.c @@ -77,12 +77,17 @@ BOOL tsmf_playback_ack(IWTSVirtualChannelCallback *pChannelCallback, return (status == 0); } -static WIN32ERROR tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream *data) { int length; wStream *input; wStream *output; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; BOOL processed = FALSE; TSMF_IFMAN ifman; UINT32 MessageId; @@ -309,7 +314,12 @@ out: return error; } -static WIN32ERROR tsmf_on_close(IWTSVirtualChannelCallback *pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_on_close(IWTSVirtualChannelCallback *pChannelCallback) { TSMF_STREAM* stream; TSMF_PRESENTATION* presentation; @@ -333,7 +343,12 @@ static WIN32ERROR tsmf_on_close(IWTSVirtualChannelCallback *pChannelCallback) return CHANNEL_RC_OK; } -static WIN32ERROR tsmf_on_new_channel_connection(IWTSListenerCallback *pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_on_new_channel_connection(IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, int *pbAccept, @@ -361,9 +376,14 @@ static WIN32ERROR tsmf_on_new_channel_connection(IWTSListenerCallback *pListener return CHANNEL_RC_OK; } -static WIN32ERROR tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { - WIN32ERROR status; + UINT status; TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; DEBUG_TSMF(""); @@ -385,7 +405,12 @@ static WIN32ERROR tsmf_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannel return status; } -static WIN32ERROR tsmf_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_plugin_terminated(IWTSPlugin* pPlugin) { TSMF_PLUGIN* tsmf = (TSMF_PLUGIN*) pPlugin; @@ -405,7 +430,12 @@ COMMAND_LINE_ARGUMENT_A tsmf_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR tsmf_process_addin_args(IWTSPlugin *pPlugin, ADDIN_ARGV *args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT tsmf_process_addin_args(IWTSPlugin *pPlugin, ADDIN_ARGV *args) { int status; DWORD flags; @@ -458,12 +488,17 @@ static WIN32ERROR tsmf_process_addin_args(IWTSPlugin *pPlugin, ADDIN_ARGV *args) #define DVCPluginEntry tsmf_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR status = 0; + UINT status = 0; TSMF_PLUGIN* tsmf; TsmfClientContext* context; - WIN32ERROR error = CHANNEL_RC_NO_MEMORY; + UINT error = CHANNEL_RC_NO_MEMORY; tsmf = (TSMF_PLUGIN*) pEntryPoints->GetPlugin(pEntryPoints, "tsmf"); diff --git a/channels/tsmf/client/tsmf_media.c b/channels/tsmf/client/tsmf_media.c index 6d968bb57..09b43efb8 100644 --- a/channels/tsmf/client/tsmf_media.c +++ b/channels/tsmf/client/tsmf_media.c @@ -600,7 +600,7 @@ static void* tsmf_stream_ack_func(void *arg) { HANDLE hdl[2]; TSMF_STREAM* stream = (TSMF_STREAM*) arg; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DEBUG_TSMF("in %d", stream->stream_id); hdl[0] = stream->stopEvent; @@ -649,7 +649,7 @@ static void* tsmf_stream_playback_func(void *arg) TSMF_SAMPLE* sample; TSMF_STREAM* stream = (TSMF_STREAM *) arg; TSMF_PRESENTATION* presentation = stream->presentation; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; DWORD status; DEBUG_TSMF("in %d", stream->stream_id); @@ -854,11 +854,16 @@ BOOL tsmf_presentation_start(TSMF_PRESENTATION* presentation) return ret; } -WIN32ERROR tsmf_presentation_sync(TSMF_PRESENTATION* presentation) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT tsmf_presentation_sync(TSMF_PRESENTATION* presentation) { UINT32 index; UINT32 count; - WIN32ERROR error; + UINT error; ArrayList_Lock(presentation->stream_list); count = ArrayList_Count(presentation->stream_list); diff --git a/channels/tsmf/client/tsmf_media.h b/channels/tsmf/client/tsmf_media.h index 311ed8be4..f697080f6 100644 --- a/channels/tsmf/client/tsmf_media.h +++ b/channels/tsmf/client/tsmf_media.h @@ -40,7 +40,7 @@ TSMF_PRESENTATION *tsmf_presentation_new(const BYTE *guid, IWTSVirtualChannelCal TSMF_PRESENTATION *tsmf_presentation_find_by_id(const BYTE *guid); BOOL tsmf_presentation_start(TSMF_PRESENTATION *presentation); BOOL tsmf_presentation_stop(TSMF_PRESENTATION *presentation); -WIN32ERROR tsmf_presentation_sync(TSMF_PRESENTATION *presentation); +UINT tsmf_presentation_sync(TSMF_PRESENTATION *presentation); BOOL tsmf_presentation_paused(TSMF_PRESENTATION *presentation); BOOL tsmf_presentation_restarted(TSMF_PRESENTATION *presentation); BOOL tsmf_presentation_volume_changed(TSMF_PRESENTATION *presentation, UINT32 newVolume, UINT32 muted); diff --git a/channels/urbdrc/client/urbdrc_main.c b/channels/urbdrc/client/urbdrc_main.c index d4473c725..d69205d60 100644 --- a/channels/urbdrc/client/urbdrc_main.c +++ b/channels/urbdrc/client/urbdrc_main.c @@ -232,13 +232,18 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data) #endif -static WIN32ERROR urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId) { UINT32 InterfaceId; UINT32 Version; UINT32 out_size; char * out_data; - WIN32ERROR ret; + UINT ret; WLog_VRB(TAG, ""); data_read_UINT32(data + 0, Version); @@ -261,7 +266,12 @@ static WIN32ERROR urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* cal return ret; } -static WIN32ERROR urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId) { UINT32 InterfaceId; UINT32 out_size; @@ -269,7 +279,7 @@ static WIN32ERROR urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callbac UINT32 MinorVersion; UINT32 Capabilities; char* out_data; - WIN32ERROR ret; + UINT ret; WLog_VRB(TAG, ""); data_read_UINT32(data + 0, MajorVersion); @@ -320,7 +330,12 @@ static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, UINT32 M return 0; } -static WIN32ERROR urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVICE* pdev) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVICE* pdev) { char* out_data; UINT32 InterfaceId; @@ -331,7 +346,7 @@ static WIN32ERROR urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, char* composite_str = "USB\\COMPOSITE"; int size, out_offset, cchCompatIds, bcdUSB; ISOCH_CALLBACK_QUEUE *cb_queue; - WIN32ERROR ret; + UINT ret; WLog_VRB(TAG, ""); InterfaceId = ((STREAM_ID_PROXY<<30) | CLIENT_DEVICE_SINK); @@ -434,12 +449,17 @@ static WIN32ERROR urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, return ret; } -static WIN32ERROR urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize) { UINT32 MessageId; UINT32 FunctionId; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; data_read_UINT32(pBuffer + 0, MessageId); data_read_UINT32(pBuffer + 4, FunctionId); @@ -1103,12 +1123,17 @@ void* urbdrc_new_device_create(void* arg) return 0; } -static WIN32ERROR urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize) { int i; UINT32 MessageId; UINT32 FunctionId; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) callback->plugin; WLog_DBG(TAG, "..."); @@ -1165,7 +1190,12 @@ static WIN32ERROR urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* c return error; } -static WIN32ERROR urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data) { URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback; URBDRC_PLUGIN* urbdrc; @@ -1173,7 +1203,7 @@ static WIN32ERROR urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCa UINT32 InterfaceTemp; UINT32 InterfaceId; UINT32 Mask; - WIN32ERROR error = CHANNEL_RC_OK; + UINT error = CHANNEL_RC_OK; char* pBuffer = (char*)Stream_Pointer(data); UINT32 cbSize = Stream_GetRemainingLength(data); @@ -1255,7 +1285,12 @@ static WIN32ERROR urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCa return 0; } -static WIN32ERROR urbdrc_on_close(IWTSVirtualChannelCallback * pChannelCallback) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_on_close(IWTSVirtualChannelCallback * pChannelCallback) { URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback; URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) callback->plugin; @@ -1294,7 +1329,12 @@ static WIN32ERROR urbdrc_on_close(IWTSVirtualChannelCallback * pChannelCallback) return CHANNEL_RC_OK; } -static WIN32ERROR urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCallback, IWTSVirtualChannel * pChannel, BYTE* pData, int* pbAccept, IWTSVirtualChannelCallback** ppCallback) { URBDRC_LISTENER_CALLBACK* listener_callback = (URBDRC_LISTENER_CALLBACK*) pListenerCallback; @@ -1315,7 +1355,12 @@ static WIN32ERROR urbdrc_on_new_channel_connection(IWTSListenerCallback* pListen return CHANNEL_RC_OK; } -static WIN32ERROR urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChannelManager* pChannelMgr) { URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) pPlugin; IUDEVMAN* udevman = NULL; @@ -1345,7 +1390,12 @@ static WIN32ERROR urbdrc_plugin_initialize(IWTSPlugin* pPlugin, IWTSVirtualChann (IWTSListenerCallback*) urbdrc->listener_callback, NULL); } -static WIN32ERROR urbdrc_plugin_terminated(IWTSPlugin* pPlugin) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_plugin_terminated(IWTSPlugin* pPlugin) { URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) pPlugin; IUDEVMAN* udevman = urbdrc->udevman; @@ -1401,7 +1451,12 @@ static void urbdrc_register_udevman_addin(IWTSPlugin* pPlugin, IUDEVMAN* udevman urbdrc->udevman = udevman; } -static WIN32ERROR urbdrc_load_udevman_addin(IWTSPlugin* pPlugin, const char* name, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_load_udevman_addin(IWTSPlugin* pPlugin, const char* name, ADDIN_ARGV* args) { PFREERDP_URBDRC_DEVICE_ENTRY entry; FREERDP_URBDRC_SERVICE_ENTRY_POINTS entryPoints; @@ -1437,7 +1492,12 @@ COMMAND_LINE_ARGUMENT_A urbdrc_args[] = { NULL, 0, NULL, NULL, NULL, -1, NULL, NULL } }; -static WIN32ERROR urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* args) { int status; DWORD flags; @@ -1483,9 +1543,14 @@ static WIN32ERROR urbdrc_process_addin_args(URBDRC_PLUGIN* urbdrc, ADDIN_ARGV* a #define DVCPluginEntry urbdrc_DVCPluginEntry #endif -WIN32ERROR DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints) { - WIN32ERROR status = 0; + UINT status = 0; ADDIN_ARGV* args; URBDRC_PLUGIN* urbdrc; diff --git a/client/Android/FreeRDPCore/jni/android_cliprdr.c b/client/Android/FreeRDPCore/jni/android_cliprdr.c index 7bfdf87e8..eadda67bd 100644 --- a/client/Android/FreeRDPCore/jni/android_cliprdr.c +++ b/client/Android/FreeRDPCore/jni/android_cliprdr.c @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -120,7 +119,12 @@ int android_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr) return 1; } -WIN32ERROR android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady) { androidContext* afc = (androidContext*) cliprdr->custom; @@ -131,7 +135,12 @@ WIN32ERROR android_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_ return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities) { UINT32 index; CLIPRDR_CAPABILITY_SET* capabilitySet; @@ -155,7 +164,12 @@ WIN32ERROR android_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CL return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList) { UINT32 index; CLIPRDR_FORMAT* format; @@ -210,22 +224,42 @@ WIN32ERROR android_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLI return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { BYTE* data; UINT32 size; @@ -256,7 +290,12 @@ WIN32ERROR android_cliprdr_server_format_data_request(CliprdrClientContext* clip return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BYTE* data; UINT32 size; @@ -317,12 +356,22 @@ WIN32ERROR android_cliprdr_server_format_data_response(CliprdrClientContext* cli return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { return CHANNEL_RC_OK; } -WIN32ERROR android_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT android_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { return CHANNEL_RC_OK; } diff --git a/client/Mac/Clipboard.h b/client/Mac/Clipboard.h index 294430d6d..5883d3b09 100644 --- a/client/Mac/Clipboard.h +++ b/client/Mac/Clipboard.h @@ -25,8 +25,6 @@ #import "freerdp/channels/channels.h" #import "freerdp/client/cliprdr.h" -#import "winpr/win32error.h" - int mac_cliprdr_send_client_format_list(CliprdrClientContext* cliprdr); void mac_cliprdr_init(mfContext* mfc, CliprdrClientContext* cliprdr); diff --git a/client/Mac/Clipboard.m b/client/Mac/Clipboard.m index 9202f0818..57b7b49df 100644 --- a/client/Mac/Clipboard.m +++ b/client/Mac/Clipboard.m @@ -121,7 +121,12 @@ int mac_cliprdr_send_client_capabilities(CliprdrClientContext* cliprdr) return 1; } -WIN32ERROR mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONITOR_READY* monitorReady) { mfContext* mfc = (mfContext*) cliprdr->custom; @@ -132,7 +137,12 @@ WIN32ERROR mac_cliprdr_monitor_ready(CliprdrClientContext* cliprdr, CLIPRDR_MONI return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRDR_CAPABILITIES* capabilities) { UINT32 index; CLIPRDR_CAPABILITY_SET* capabilitySet; @@ -156,7 +166,12 @@ WIN32ERROR mac_cliprdr_server_capabilities(CliprdrClientContext* cliprdr, CLIPRD return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST* formatList) { UINT32 index; CLIPRDR_FORMAT* format; @@ -218,22 +233,42 @@ WIN32ERROR mac_cliprdr_server_format_list(CliprdrClientContext* cliprdr, CLIPRDR return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_format_list_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_lock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* cliprdr, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { BYTE* data; UINT32 size; @@ -264,7 +299,12 @@ WIN32ERROR mac_cliprdr_server_format_data_request(CliprdrClientContext* cliprdr, return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BYTE* data; UINT32 size; @@ -332,12 +372,22 @@ WIN32ERROR mac_cliprdr_server_format_data_response(CliprdrClientContext* cliprdr return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_file_contents_request(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { return CHANNEL_RC_OK; } -WIN32ERROR mac_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT mac_cliprdr_server_file_contents_response(CliprdrClientContext* cliprdr, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { return CHANNEL_RC_OK; } diff --git a/client/Windows/wf_cliprdr.c b/client/Windows/wf_cliprdr.c index 8680703a2..dc1868ff0 100644 --- a/client/Windows/wf_cliprdr.c +++ b/client/Windows/wf_cliprdr.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -1446,7 +1445,12 @@ int wf_cliprdr_send_client_capabilities(wfClipboard* clipboard) return 1; } -static WIN32ERROR wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) { wfClipboard* clipboard = (wfClipboard*) context->custom; @@ -1457,7 +1461,12 @@ static WIN32ERROR wf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRD return CHANNEL_RC_OK; } -static WIN32ERROR wf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) { UINT32 index; CLIPRDR_CAPABILITY_SET* capabilitySet; @@ -1481,7 +1490,12 @@ static WIN32ERROR wf_cliprdr_server_capabilities(CliprdrClientContext* context, return CHANNEL_RC_OK; } -static WIN32ERROR wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) { UINT32 i, j; formatMapping* mapping; @@ -1535,25 +1549,45 @@ static WIN32ERROR wf_cliprdr_server_format_list(CliprdrClientContext* context, C return CHANNEL_RC_OK; } -static WIN32ERROR wf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { wfClipboard* clipboard = (wfClipboard*) context->custom; return CHANNEL_RC_OK; } -WIN32ERROR wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT wf_cliprdr_server_lock_clipboard_data(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData) { wfClipboard* clipboard = (wfClipboard*) context->custom; return CHANNEL_RC_OK; } -WIN32ERROR wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT wf_cliprdr_server_unlock_clipboard_data(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData) { wfClipboard* clipboard = (wfClipboard*) context->custom; return CHANNEL_RC_OK; } -static WIN32ERROR wf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { int size = 0; char* buff = NULL; @@ -1744,7 +1778,12 @@ exit: return CHANNEL_RC_OK; } -static WIN32ERROR wf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BYTE* data; HANDLE hMem; @@ -1761,7 +1800,12 @@ static WIN32ERROR wf_cliprdr_server_format_data_response(CliprdrClientContext* c return CHANNEL_RC_OK; } -WIN32ERROR wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { UINT32 uSize = 0; BYTE* pData = NULL; @@ -1935,7 +1979,12 @@ error: return ERROR_INTERNAL_ERROR; } -WIN32ERROR wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT wf_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse) { wfClipboard* clipboard = (wfClipboard*) context->custom; diff --git a/client/Windows/wf_rail.c b/client/Windows/wf_rail.c index c93144eab..c00a465ac 100644 --- a/client/Windows/wf_rail.c +++ b/client/Windows/wf_rail.c @@ -860,18 +860,33 @@ void wf_rail_register_update_callbacks(rdpUpdate* update) /* RemoteApp Virtual Channel Extension */ -static WIN32ERROR wf_rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) { WLog_DBG(TAG, "RailServerExecuteResult: 0x%04X", execResult->rawResult); return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) { RAIL_EXEC_ORDER exec; RAIL_SYSPARAM_ORDER sysparam; @@ -936,27 +951,52 @@ static WIN32ERROR wf_rail_server_handshake(RailClientContext* context, RAIL_HAND return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) { return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) { return CHANNEL_RC_OK; } -static WIN32ERROR wf_rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT wf_rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { return CHANNEL_RC_OK; } diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index da8abe214..a788ab2b1 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -725,7 +725,12 @@ void xf_toggle_control(xfContext* xfc) xfc->controlToggle = !xfc->controlToggle; } -WIN32ERROR xf_encomsp_participant_created(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_encomsp_participant_created(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated) { return CHANNEL_RC_OK; } diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 8977c9cb7..ea38b8ac9 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -786,7 +785,12 @@ int xf_cliprdr_send_client_format_data_request(xfClipboard* clipboard, UINT32 fo return 1; } -static WIN32ERROR xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady) { xfClipboard* clipboard = (xfClipboard*) context->custom; @@ -797,14 +801,24 @@ static WIN32ERROR xf_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRD return CHANNEL_RC_OK; } -static WIN32ERROR xf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities) { //xfClipboard* clipboard = (xfClipboard*) context->custom; return CHANNEL_RC_OK; } -static WIN32ERROR xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList) { int i, j; CLIPRDR_FORMAT* format; @@ -878,14 +892,24 @@ static WIN32ERROR xf_cliprdr_server_format_list(CliprdrClientContext* context, C return CHANNEL_RC_OK; } -static WIN32ERROR xf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse) { //xfClipboard* clipboard = (xfClipboard*) context->custom; return CHANNEL_RC_OK; } -static WIN32ERROR xf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest) { xfCliprdrFormat* format = NULL; UINT32 formatId = formatDataRequest->requestedFormatId; @@ -922,7 +946,12 @@ static WIN32ERROR xf_cliprdr_server_format_data_request(CliprdrClientContext* co return CHANNEL_RC_OK; } -static WIN32ERROR xf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse) { BOOL bSuccess; BYTE* pSrcData; diff --git a/client/X11/xf_gfx.c b/client/X11/xf_gfx.c index e9e7d7214..dc9251c45 100644 --- a/client/X11/xf_gfx.c +++ b/client/X11/xf_gfx.c @@ -26,7 +26,12 @@ #define TAG CLIENT_TAG("x11") -WIN32ERROR xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { UINT16 count; int index; @@ -200,7 +205,12 @@ int xf_OutputExpose(xfContext* xfc, int x, int y, int width, int height) return status; } -WIN32ERROR xf_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame) { xfContext* xfc = (xfContext*) context->custom; @@ -209,7 +219,12 @@ WIN32ERROR xf_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* s return CHANNEL_RC_OK; } -WIN32ERROR xf_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame) { xfContext* xfc = (xfContext*) context->custom; @@ -220,7 +235,12 @@ WIN32ERROR xf_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFr return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_Uncompressed(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_Uncompressed(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { xfGfxSurface* surface; RECTANGLE_16 invalidRect; @@ -246,7 +266,12 @@ WIN32ERROR xf_SurfaceCommand_Uncompressed(xfContext* xfc, RdpgfxClientContext* c return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_RemoteFX(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_RemoteFX(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int j; UINT16 i; @@ -331,7 +356,12 @@ WIN32ERROR xf_SurfaceCommand_RemoteFX(xfContext* xfc, RdpgfxClientContext* conte return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_ClearCodec(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_ClearCodec(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; BYTE* DstData = NULL; @@ -370,7 +400,12 @@ WIN32ERROR xf_SurfaceCommand_ClearCodec(xfContext* xfc, RdpgfxClientContext* con return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_Planar(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_Planar(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; BYTE* DstData = NULL; @@ -403,7 +438,12 @@ WIN32ERROR xf_SurfaceCommand_Planar(xfContext* xfc, RdpgfxClientContext* context return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_H264(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_H264(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; UINT32 i; @@ -453,7 +493,12 @@ WIN32ERROR xf_SurfaceCommand_H264(xfContext* xfc, RdpgfxClientContext* context, return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status = 0; xfGfxSurface* surface; @@ -486,7 +531,12 @@ WIN32ERROR xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand_Progressive(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand_Progressive(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int i, j; int status; @@ -583,9 +633,14 @@ WIN32ERROR xf_SurfaceCommand_Progressive(xfContext* xfc, RdpgfxClientContext* co return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; xfContext* xfc = (xfContext*) context->custom; switch (cmd->codecId) @@ -625,12 +680,22 @@ WIN32ERROR xf_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAN return status; } -WIN32ERROR xf_DeleteEncodingContext(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_DeleteEncodingContext(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) { return CHANNEL_RC_OK; } -WIN32ERROR xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface) { size_t size; UINT32 bytesPerPixel; @@ -698,7 +763,12 @@ WIN32ERROR xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_ return CHANNEL_RC_OK; } -WIN32ERROR xf_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface) { xfGfxSurface* surface = NULL; xfContext* xfc = (xfContext*) context->custom; @@ -722,7 +792,12 @@ WIN32ERROR xf_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_ return CHANNEL_RC_OK; } -WIN32ERROR xf_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) { UINT16 index; UINT32 color; @@ -769,7 +844,12 @@ WIN32ERROR xf_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* sol return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) { UINT16 index; BOOL sameSurface; @@ -829,7 +909,12 @@ WIN32ERROR xf_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_S return CHANNEL_RC_OK; } -WIN32ERROR xf_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache) { size_t size; RDPGFX_RECT16* rect; @@ -877,7 +962,12 @@ WIN32ERROR xf_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CAC return CHANNEL_RC_OK; } -WIN32ERROR xf_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) { UINT16 index; RDPGFX_POINT16* destPt; @@ -914,12 +1004,22 @@ WIN32ERROR xf_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFA return CHANNEL_RC_OK; } -WIN32ERROR xf_CacheImportReply(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_CacheImportReply(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) { return CHANNEL_RC_OK; } -WIN32ERROR xf_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry) { xfGfxCacheEntry* cacheEntry; @@ -936,7 +1036,12 @@ WIN32ERROR xf_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_E return CHANNEL_RC_OK; } -WIN32ERROR xf_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) { xfGfxSurface* surface; @@ -951,7 +1056,12 @@ WIN32ERROR xf_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFAC return CHANNEL_RC_OK; } -WIN32ERROR xf_MapSurfaceToWindow(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT xf_MapSurfaceToWindow(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) { return CHANNEL_RC_OK; } diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index ae5e269ef..a87d7c409 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -634,7 +634,12 @@ void xf_rail_register_update_callbacks(rdpUpdate* update) /* RemoteApp Virtual Channel Extension */ -static WIN32ERROR xf_rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_execute_result(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult) { xfContext* xfc = (xfContext*) context->custom; @@ -652,12 +657,22 @@ static WIN32ERROR xf_rail_server_execute_result(RailClientContext* context, RAIL return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_system_param(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam) { return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_handshake(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake) { RAIL_EXEC_ORDER exec; RAIL_SYSPARAM_ORDER sysparam; @@ -722,12 +737,22 @@ static WIN32ERROR xf_rail_server_handshake(RailClientContext* context, RAIL_HAND return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_handshake_ex(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx) { return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_local_move_size(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize) { int x = 0, y = 0; int direction = 0; @@ -827,7 +852,12 @@ static WIN32ERROR xf_rail_server_local_move_size(RailClientContext* context, RAI return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_min_max_info(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo) { xfAppWindow* appWindow = NULL; xfContext* xfc = (xfContext*) context->custom; @@ -847,12 +877,22 @@ static WIN32ERROR xf_rail_server_min_max_info(RailClientContext* context, RAIL_M return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_language_bar_info(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo) { return CHANNEL_RC_OK; } -static WIN32ERROR xf_rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT xf_rail_server_get_appid_response(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp) { return CHANNEL_RC_OK; } diff --git a/include/freerdp/channels/rdpdr.h b/include/freerdp/channels/rdpdr.h index d259cd6b4..2e7d051ff 100644 --- a/include/freerdp/channels/rdpdr.h +++ b/include/freerdp/channels/rdpdr.h @@ -32,7 +32,6 @@ #include #include #include -#include #include @@ -317,9 +316,9 @@ typedef struct _DEVICE DEVICE; typedef struct _IRP IRP; typedef struct _DEVMAN DEVMAN; -typedef WIN32ERROR (*pcIRPRequest)(DEVICE* device, IRP* irp); -typedef WIN32ERROR (*pcInitDevice)(DEVICE* device); -typedef WIN32ERROR (*pcFreeDevice)(DEVICE* device); +typedef UINT (*pcIRPRequest)(DEVICE* device, IRP* irp); +typedef UINT (*pcInitDevice)(DEVICE* device); +typedef UINT (*pcFreeDevice)(DEVICE* device); struct _DEVICE { @@ -334,7 +333,7 @@ struct _DEVICE pcFreeDevice Free; }; -typedef WIN32ERROR (*pcIRPResponse)(IRP* irp); +typedef UINT (*pcIRPResponse)(IRP* irp); struct _IRP { @@ -365,7 +364,7 @@ struct _DEVMAN wListDictionary* devices; }; -typedef WIN32ERROR (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); +typedef UINT (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device); struct _DEVICE_SERVICE_ENTRY_POINTS { @@ -378,6 +377,6 @@ struct _DEVICE_SERVICE_ENTRY_POINTS typedef struct _DEVICE_SERVICE_ENTRY_POINTS DEVICE_SERVICE_ENTRY_POINTS; typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS; -typedef WIN32ERROR (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); +typedef UINT (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS); #endif /* FREERDP_CHANNEL_RDPDR_H */ diff --git a/include/freerdp/client/audin.h b/include/freerdp/client/audin.h index 6e2125c42..87eec5d2d 100644 --- a/include/freerdp/client/audin.h +++ b/include/freerdp/client/audin.h @@ -29,7 +29,7 @@ * Subsystem Interface */ -typedef WIN32ERROR (*AudinReceive) (BYTE* data, int size, void* userData); +typedef UINT (*AudinReceive) (BYTE* data, int size, void* userData); typedef struct audin_format audinFormat; struct audin_format @@ -46,16 +46,16 @@ struct audin_format typedef struct _IAudinDevice IAudinDevice; struct _IAudinDevice { - WIN32ERROR (*Open) (IAudinDevice* devplugin, AudinReceive receive, void* userData); + UINT (*Open) (IAudinDevice* devplugin, AudinReceive receive, void* userData); BOOL (*FormatSupported) (IAudinDevice* devplugin, audinFormat* format); - WIN32ERROR (*SetFormat) (IAudinDevice* devplugin, audinFormat* format, UINT32 FramesPerPacket); - WIN32ERROR (*Close) (IAudinDevice* devplugin); - WIN32ERROR (*Free) (IAudinDevice* devplugin); + UINT (*SetFormat) (IAudinDevice* devplugin, audinFormat* format, UINT32 FramesPerPacket); + UINT (*Close) (IAudinDevice* devplugin); + UINT (*Free) (IAudinDevice* devplugin); }; #define AUDIN_DEVICE_EXPORT_FUNC_NAME "freerdp_audin_client_subsystem_entry" -typedef WIN32ERROR (*PREGISTERAUDINDEVICE)(IWTSPlugin* plugin, IAudinDevice* device); +typedef UINT (*PREGISTERAUDINDEVICE)(IWTSPlugin* plugin, IAudinDevice* device); struct _FREERDP_AUDIN_DEVICE_ENTRY_POINTS { @@ -67,7 +67,7 @@ struct _FREERDP_AUDIN_DEVICE_ENTRY_POINTS typedef struct _FREERDP_AUDIN_DEVICE_ENTRY_POINTS FREERDP_AUDIN_DEVICE_ENTRY_POINTS; typedef FREERDP_AUDIN_DEVICE_ENTRY_POINTS* PFREERDP_AUDIN_DEVICE_ENTRY_POINTS; -typedef WIN32ERROR (*PFREERDP_AUDIN_DEVICE_ENTRY)(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints); +typedef UINT (*PFREERDP_AUDIN_DEVICE_ENTRY)(PFREERDP_AUDIN_DEVICE_ENTRY_POINTS pEntryPoints); #endif /* FREERDP_CHANNEL_CLIENT_AUDIN_H */ diff --git a/include/freerdp/client/cliprdr.h b/include/freerdp/client/cliprdr.h index f5576a0df..cb4b69cdf 100644 --- a/include/freerdp/client/cliprdr.h +++ b/include/freerdp/client/cliprdr.h @@ -23,7 +23,6 @@ #define FREERDP_CHANNEL_CLIENT_CLIPRDR_H #include -#include #include #include @@ -35,26 +34,26 @@ typedef struct _cliprdr_client_context CliprdrClientContext; -typedef WIN32ERROR (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities); -typedef WIN32ERROR (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities); -typedef WIN32ERROR (*pcCliprdrMonitorReady)(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady); -typedef WIN32ERROR (*pcCliprdrTempDirectory)(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef WIN32ERROR (*pcCliprdrClientFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList); -typedef WIN32ERROR (*pcCliprdrServerFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList); -typedef WIN32ERROR (*pcCliprdrClientFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef WIN32ERROR (*pcCliprdrServerFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef WIN32ERROR (*pcCliprdrClientLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef WIN32ERROR (*pcCliprdrServerLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef WIN32ERROR (*pcCliprdrClientUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef WIN32ERROR (*pcCliprdrServerUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef WIN32ERROR (*pcCliprdrClientFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef WIN32ERROR (*pcCliprdrServerFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef WIN32ERROR (*pcCliprdrClientFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef WIN32ERROR (*pcCliprdrServerFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef WIN32ERROR (*pcCliprdrClientFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef WIN32ERROR (*pcCliprdrServerFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef WIN32ERROR (*pcCliprdrClientFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef WIN32ERROR (*pcCliprdrServerFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady); +typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory); +typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*pcCliprdrClientFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*pcCliprdrServerFormatListResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*pcCliprdrClientLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*pcCliprdrServerLockClipboardData)(CliprdrClientContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*pcCliprdrClientUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*pcCliprdrServerUnlockClipboardData)(CliprdrClientContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*pcCliprdrClientFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*pcCliprdrServerFormatDataRequest)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*pcCliprdrClientFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*pcCliprdrServerFormatDataResponse)(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*pcCliprdrClientFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*pcCliprdrServerFileContentsRequest)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*pcCliprdrClientFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*pcCliprdrServerFileContentsResponse)(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); struct _cliprdr_client_context { diff --git a/include/freerdp/client/disp.h b/include/freerdp/client/disp.h index 2a9cb5a04..be21164ed 100644 --- a/include/freerdp/client/disp.h +++ b/include/freerdp/client/disp.h @@ -52,7 +52,7 @@ typedef struct _DISPLAY_CONTROL_MONITOR_LAYOUT DISPLAY_CONTROL_MONITOR_LAYOUT; typedef struct _disp_client_context DispClientContext; -typedef WIN32ERROR (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); +typedef UINT (*pcDispSendMonitorLayout)(DispClientContext* context, UINT32 NumMonitors, DISPLAY_CONTROL_MONITOR_LAYOUT* Monitors); struct _disp_client_context { diff --git a/include/freerdp/client/drdynvc.h b/include/freerdp/client/drdynvc.h index 862b00683..89d172340 100644 --- a/include/freerdp/client/drdynvc.h +++ b/include/freerdp/client/drdynvc.h @@ -22,8 +22,6 @@ #ifndef FREERDP_CHANNEL_CLIENT_DRDYNVC_H #define FREERDP_CHANNEL_CLIENT_DRDYNVC_H -#include - /** * Client Interface */ @@ -31,8 +29,8 @@ typedef struct _drdynvc_client_context DrdynvcClientContext; typedef int (*pcDrdynvcGetVersion)(DrdynvcClientContext* context); -typedef WIN32ERROR (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, void* pInterface); -typedef WIN32ERROR (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, void* pInterface); +typedef UINT (*pcDrdynvcOnChannelConnected)(DrdynvcClientContext* context, const char* name, void* pInterface); +typedef UINT (*pcDrdynvcOnChannelDisconnected)(DrdynvcClientContext* context, const char* name, void* pInterface); struct _drdynvc_client_context { diff --git a/include/freerdp/client/encomsp.h b/include/freerdp/client/encomsp.h index f2230a576..3be18cd74 100644 --- a/include/freerdp/client/encomsp.h +++ b/include/freerdp/client/encomsp.h @@ -23,7 +23,6 @@ #define FREERDP_CHANNEL_CLIENT_ENCOMSP_H #include -#include /** * Client Interface @@ -31,17 +30,17 @@ typedef struct _encomsp_client_context EncomspClientContext; -typedef WIN32ERROR (*pcEncomspFilterUpdated)(EncomspClientContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef WIN32ERROR (*pcEncomspApplicationCreated)(EncomspClientContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef WIN32ERROR (*pcEncomspApplicationRemoved)(EncomspClientContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef WIN32ERROR (*pcEncomspWindowCreated)(EncomspClientContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef WIN32ERROR (*pcEncomspWindowRemoved)(EncomspClientContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef WIN32ERROR (*pcEncomspShowWindow)(EncomspClientContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef WIN32ERROR (*pcEncomspParticipantCreated)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef WIN32ERROR (*pcEncomspParticipantRemoved)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef WIN32ERROR (*pcEncomspChangeParticipantControlLevel)(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef WIN32ERROR (*pcEncomspGraphicsStreamPaused)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef WIN32ERROR (*pcEncomspGraphicsStreamResumed)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); +typedef UINT (*pcEncomspFilterUpdated)(EncomspClientContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); +typedef UINT (*pcEncomspApplicationCreated)(EncomspClientContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); +typedef UINT (*pcEncomspApplicationRemoved)(EncomspClientContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); +typedef UINT (*pcEncomspWindowCreated)(EncomspClientContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); +typedef UINT (*pcEncomspWindowRemoved)(EncomspClientContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); +typedef UINT (*pcEncomspShowWindow)(EncomspClientContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); +typedef UINT (*pcEncomspParticipantCreated)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); +typedef UINT (*pcEncomspParticipantRemoved)(EncomspClientContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); +typedef UINT (*pcEncomspChangeParticipantControlLevel)(EncomspClientContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); +typedef UINT (*pcEncomspGraphicsStreamPaused)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); +typedef UINT (*pcEncomspGraphicsStreamResumed)(EncomspClientContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); struct _encomsp_client_context { diff --git a/include/freerdp/client/rail.h b/include/freerdp/client/rail.h index 79d974234..f492f5f51 100644 --- a/include/freerdp/client/rail.h +++ b/include/freerdp/client/rail.h @@ -26,7 +26,6 @@ #include #include #include -#include /** * Client Interface @@ -36,26 +35,26 @@ typedef struct _rail_client_context RailClientContext; -typedef WIN32ERROR (*pcRailClientExecute)(RailClientContext* context, RAIL_EXEC_ORDER* exec); -typedef WIN32ERROR (*pcRailClientActivate)(RailClientContext* context, RAIL_ACTIVATE_ORDER* activate); -typedef WIN32ERROR (*pcRailClientSystemParam)(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam); -typedef WIN32ERROR (*pcRailServerSystemParam)(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam); -typedef WIN32ERROR (*pcRailClientSystemCommand)(RailClientContext* context, RAIL_SYSCOMMAND_ORDER* syscommand); -typedef WIN32ERROR (*pcRailClientHandshake)(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake); -typedef WIN32ERROR (*pcRailServerHandshake)(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake); -typedef WIN32ERROR (*pcRailClientHandshakeEx)(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); -typedef WIN32ERROR (*pcRailServerHandshakeEx)(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); -typedef WIN32ERROR (*pcRailClientNotifyEvent)(RailClientContext* context, RAIL_NOTIFY_EVENT_ORDER* notifyEvent); -typedef WIN32ERROR (*pcRailClientWindowMove)(RailClientContext* context, RAIL_WINDOW_MOVE_ORDER* windowMove); -typedef WIN32ERROR (*pcRailServerLocalMoveSize)(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize); -typedef WIN32ERROR (*pcRailServerMinMaxInfo)(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo); -typedef WIN32ERROR (*pcRailClientInformation)(RailClientContext* context, RAIL_CLIENT_STATUS_ORDER* clientStatus); -typedef WIN32ERROR (*pcRailClientSystemMenu)(RailClientContext* context, RAIL_SYSMENU_ORDER* sysmenu); -typedef WIN32ERROR (*pcRailClientLanguageBarInfo)(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo); -typedef WIN32ERROR (*pcRailServerLanguageBarInfo)(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo); -typedef WIN32ERROR (*pcRailServerExecuteResult)(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult); -typedef WIN32ERROR (*pcRailClientGetAppIdRequest)(RailClientContext* context, RAIL_GET_APPID_REQ_ORDER* getAppIdReq); -typedef WIN32ERROR (*pcRailServerGetAppIdResponse)(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp); +typedef UINT (*pcRailClientExecute)(RailClientContext* context, RAIL_EXEC_ORDER* exec); +typedef UINT (*pcRailClientActivate)(RailClientContext* context, RAIL_ACTIVATE_ORDER* activate); +typedef UINT (*pcRailClientSystemParam)(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam); +typedef UINT (*pcRailServerSystemParam)(RailClientContext* context, RAIL_SYSPARAM_ORDER* sysparam); +typedef UINT (*pcRailClientSystemCommand)(RailClientContext* context, RAIL_SYSCOMMAND_ORDER* syscommand); +typedef UINT (*pcRailClientHandshake)(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake); +typedef UINT (*pcRailServerHandshake)(RailClientContext* context, RAIL_HANDSHAKE_ORDER* handshake); +typedef UINT (*pcRailClientHandshakeEx)(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); +typedef UINT (*pcRailServerHandshakeEx)(RailClientContext* context, RAIL_HANDSHAKE_EX_ORDER* handshakeEx); +typedef UINT (*pcRailClientNotifyEvent)(RailClientContext* context, RAIL_NOTIFY_EVENT_ORDER* notifyEvent); +typedef UINT (*pcRailClientWindowMove)(RailClientContext* context, RAIL_WINDOW_MOVE_ORDER* windowMove); +typedef UINT (*pcRailServerLocalMoveSize)(RailClientContext* context, RAIL_LOCALMOVESIZE_ORDER* localMoveSize); +typedef UINT (*pcRailServerMinMaxInfo)(RailClientContext* context, RAIL_MINMAXINFO_ORDER* minMaxInfo); +typedef UINT (*pcRailClientInformation)(RailClientContext* context, RAIL_CLIENT_STATUS_ORDER* clientStatus); +typedef UINT (*pcRailClientSystemMenu)(RailClientContext* context, RAIL_SYSMENU_ORDER* sysmenu); +typedef UINT (*pcRailClientLanguageBarInfo)(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo); +typedef UINT (*pcRailServerLanguageBarInfo)(RailClientContext* context, RAIL_LANGBAR_INFO_ORDER* langBarInfo); +typedef UINT (*pcRailServerExecuteResult)(RailClientContext* context, RAIL_EXEC_RESULT_ORDER* execResult); +typedef UINT (*pcRailClientGetAppIdRequest)(RailClientContext* context, RAIL_GET_APPID_REQ_ORDER* getAppIdReq); +typedef UINT (*pcRailServerGetAppIdResponse)(RailClientContext* context, RAIL_GET_APPID_RESP_ORDER* getAppIdResp); struct _rail_client_context { diff --git a/include/freerdp/client/rdpei.h b/include/freerdp/client/rdpei.h index 21f291fc4..30a011f24 100644 --- a/include/freerdp/client/rdpei.h +++ b/include/freerdp/client/rdpei.h @@ -23,7 +23,6 @@ #define FREERDP_CHANNEL_CLIENT_RDPEI_H #include -#include /** * Client Interface @@ -32,14 +31,14 @@ typedef struct _rdpei_client_context RdpeiClientContext; typedef int (*pcRdpeiGetVersion)(RdpeiClientContext* context); -typedef WIN32ERROR (*pcRdpeiAddContact)(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact); +typedef UINT (*pcRdpeiAddContact)(RdpeiClientContext* context, RDPINPUT_CONTACT_DATA* contact); -typedef WIN32ERROR (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); -typedef WIN32ERROR (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); -typedef WIN32ERROR (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); +typedef UINT (*pcRdpeiTouchBegin)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); +typedef UINT (*pcRdpeiTouchUpdate)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); +typedef UINT (*pcRdpeiTouchEnd)(RdpeiClientContext* context, int externalId, int x, int y, int* contactId); -typedef WIN32ERROR (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); -typedef WIN32ERROR (*pcRdpeiResumeTouch)(RdpeiClientContext* context); +typedef UINT (*pcRdpeiSuspendTouch)(RdpeiClientContext* context); +typedef UINT (*pcRdpeiResumeTouch)(RdpeiClientContext* context); struct _rdpei_client_context { diff --git a/include/freerdp/client/rdpgfx.h b/include/freerdp/client/rdpgfx.h index adaaca6e0..7ffc5d636 100644 --- a/include/freerdp/client/rdpgfx.h +++ b/include/freerdp/client/rdpgfx.h @@ -30,27 +30,27 @@ typedef struct _rdpgfx_client_context RdpgfxClientContext; -typedef WIN32ERROR (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); -typedef WIN32ERROR (*pcRdpgfxStartFrame)(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame); -typedef WIN32ERROR (*pcRdpgfxEndFrame)(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame); -typedef WIN32ERROR (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd); -typedef WIN32ERROR (*pcRdpgfxDeleteEncodingContext)(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); -typedef WIN32ERROR (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface); -typedef WIN32ERROR (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface); -typedef WIN32ERROR (*pcRdpgfxSolidFill)(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill); -typedef WIN32ERROR (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); -typedef WIN32ERROR (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); -typedef WIN32ERROR (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); -typedef WIN32ERROR (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); -typedef WIN32ERROR (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); -typedef WIN32ERROR (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); -typedef WIN32ERROR (*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); -typedef WIN32ERROR (*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); +typedef UINT (*pcRdpgfxResetGraphics)(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics); +typedef UINT (*pcRdpgfxStartFrame)(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame); +typedef UINT (*pcRdpgfxEndFrame)(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame); +typedef UINT (*pcRdpgfxSurfaceCommand)(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd); +typedef UINT (*pcRdpgfxDeleteEncodingContext)(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext); +typedef UINT (*pcRdpgfxCreateSurface)(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface); +typedef UINT (*pcRdpgfxDeleteSurface)(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface); +typedef UINT (*pcRdpgfxSolidFill)(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill); +typedef UINT (*pcRdpgfxSurfaceToSurface)(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface); +typedef UINT (*pcRdpgfxSurfaceToCache)(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache); +typedef UINT (*pcRdpgfxCacheToSurface)(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface); +typedef UINT (*pcRdpgfxCacheImportOffer)(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_OFFER_PDU* cacheImportOffer); +typedef UINT (*pcRdpgfxCacheImportReply)(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply); +typedef UINT (*pcRdpgfxEvictCacheEntry)(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry); +typedef UINT (*pcRdpgfxMapSurfaceToOutput)(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput); +typedef UINT (*pcRdpgfxMapSurfaceToWindow)(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow); -typedef WIN32ERROR (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, void* pData); +typedef UINT (*pcRdpgfxSetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId, void* pData); typedef void* (*pcRdpgfxGetSurfaceData)(RdpgfxClientContext* context, UINT16 surfaceId); -typedef WIN32ERROR (*pcRdpgfxGetSurfaceIds)(RdpgfxClientContext* context, UINT16** ppSurfaceIds, UINT16* count); -typedef WIN32ERROR (*pcRdpgfxSetCacheSlotData)(RdpgfxClientContext* context, UINT16 cacheSlot, void* pData); +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); struct _rdpgfx_client_context diff --git a/include/freerdp/client/rdpsnd.h b/include/freerdp/client/rdpsnd.h index b7e8b76ce..6f4ba8b61 100644 --- a/include/freerdp/client/rdpsnd.h +++ b/include/freerdp/client/rdpsnd.h @@ -22,7 +22,6 @@ #define FREERDP_CHANNEL_CLIENT_RDPSND_H #include -#include /** * Subsystem Interface @@ -63,7 +62,7 @@ typedef void (*pcFree) (rdpsndDevicePlugin* device); typedef BOOL (*pcWaveDecode) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); typedef void (*pcWavePlay) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); -typedef WIN32ERROR (*pcWaveConfirm) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); +typedef UINT (*pcWaveConfirm) (rdpsndDevicePlugin* device, RDPSND_WAVE* wave); struct rdpsnd_device_plugin { @@ -99,7 +98,7 @@ struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS typedef struct _FREERDP_RDPSND_DEVICE_ENTRY_POINTS FREERDP_RDPSND_DEVICE_ENTRY_POINTS; typedef FREERDP_RDPSND_DEVICE_ENTRY_POINTS* PFREERDP_RDPSND_DEVICE_ENTRY_POINTS; -typedef WIN32ERROR (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); +typedef UINT (*PFREERDP_RDPSND_DEVICE_ENTRY)(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints); #endif /* FREERDP_CHANNEL_CLIENT_RDPSND_H */ diff --git a/include/freerdp/dvc.h b/include/freerdp/dvc.h index 29f1e81e6..696cb8886 100644 --- a/include/freerdp/dvc.h +++ b/include/freerdp/dvc.h @@ -55,7 +55,6 @@ #include #include -#include typedef struct _IWTSVirtualChannelManager IWTSVirtualChannelManager; typedef struct _IWTSListener IWTSListener; @@ -68,7 +67,7 @@ typedef struct _IWTSVirtualChannelCallback IWTSVirtualChannelCallback; struct _IWTSListener { /* Retrieves the listener-specific configuration. */ - WIN32ERROR (*GetConfiguration)(IWTSListener *pListener, + UINT (*GetConfiguration)(IWTSListener *pListener, void **ppPropertyBag); void *pInterface; @@ -77,19 +76,19 @@ struct _IWTSListener struct _IWTSVirtualChannel { /* Starts a write request on the channel. */ - WIN32ERROR (*Write)(IWTSVirtualChannel *pChannel, + UINT (*Write)(IWTSVirtualChannel *pChannel, ULONG cbSize, BYTE *pBuffer, void *pReserved); /* Closes the channel. */ - WIN32ERROR (*Close)(IWTSVirtualChannel *pChannel); + UINT (*Close)(IWTSVirtualChannel *pChannel); }; struct _IWTSVirtualChannelManager { /* Returns an instance of a listener object that listens on a specific endpoint, or creates a static channel. */ - WIN32ERROR (*CreateListener)(IWTSVirtualChannelManager *pChannelMgr, + UINT (*CreateListener)(IWTSVirtualChannelManager *pChannelMgr, const char *pszChannelName, ULONG ulFlags, IWTSListenerCallback *pListenerCallback, @@ -103,19 +102,19 @@ struct _IWTSVirtualChannelManager struct _IWTSPlugin { /* Used for the first call that is made from the client to the plug-in. */ - WIN32ERROR (*Initialize)(IWTSPlugin *pPlugin, + 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. */ - WIN32ERROR (*Connected)(IWTSPlugin *pPlugin); + UINT (*Connected)(IWTSPlugin *pPlugin); /* Notifies the plug-in that the Remote Desktop Connection (RDC) client has disconnected from the RD Session Host server. */ - WIN32ERROR (*Disconnected)(IWTSPlugin *pPlugin, + UINT (*Disconnected)(IWTSPlugin *pPlugin, DWORD dwDisconnectCode); /* Notifies the plug-in that the Remote Desktop Connection (RDC) client has terminated. */ - WIN32ERROR (*Terminated)(IWTSPlugin *pPlugin); + UINT (*Terminated)(IWTSPlugin *pPlugin); /* Extended */ @@ -126,7 +125,7 @@ struct _IWTSListenerCallback { /* Accepts or denies a connection request for an incoming connection to the associated listener. */ - WIN32ERROR (*OnNewChannelConnection)(IWTSListenerCallback *pListenerCallback, + UINT (*OnNewChannelConnection)(IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, BOOL *pbAccept, @@ -136,18 +135,18 @@ struct _IWTSListenerCallback struct _IWTSVirtualChannelCallback { /* Notifies the user about data that is being received. */ - WIN32ERROR (*OnDataReceived) (IWTSVirtualChannelCallback* pChannelCallback, wStream* data); + UINT (*OnDataReceived) (IWTSVirtualChannelCallback* pChannelCallback, wStream* data); /* Notifies the user that the channel has been opened. */ - WIN32ERROR (*OnOpen) (IWTSVirtualChannelCallback* pChannelCallback); + UINT (*OnOpen) (IWTSVirtualChannelCallback* pChannelCallback); /* Notifies the user that the channel has been closed. */ - WIN32ERROR (*OnClose) (IWTSVirtualChannelCallback* pChannelCallback); + UINT (*OnClose) (IWTSVirtualChannelCallback* pChannelCallback); }; /* The DVC Plugin entry points */ typedef struct _IDRDYNVC_ENTRY_POINTS IDRDYNVC_ENTRY_POINTS; struct _IDRDYNVC_ENTRY_POINTS { - WIN32ERROR (*RegisterPlugin)(IDRDYNVC_ENTRY_POINTS *pEntryPoints, + UINT (*RegisterPlugin)(IDRDYNVC_ENTRY_POINTS *pEntryPoints, const char *name, IWTSPlugin *pPlugin); IWTSPlugin *(*GetPlugin)(IDRDYNVC_ENTRY_POINTS *pEntryPoints, const char *name); @@ -155,7 +154,7 @@ struct _IDRDYNVC_ENTRY_POINTS void* (*GetRdpSettings)(IDRDYNVC_ENTRY_POINTS* pEntryPoints); }; -typedef WIN32ERROR (*PDVC_PLUGIN_ENTRY)(IDRDYNVC_ENTRY_POINTS *); +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); diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index efc4d6605..4dfa2ee20 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -49,7 +49,6 @@ typedef RDP_CLIENT_ENTRY_POINTS_V1 RDP_CLIENT_ENTRY_POINTS; #include #include -#include #include #include @@ -112,7 +111,7 @@ struct rdp_context ALIGN64 wPubSub* pubSub; /* (offset 18) */ ALIGN64 HANDLE channelErrorEvent; /* (offset 19)*/ - ALIGN64 WIN32ERROR channelErrorNum; /*(offset 20)*/ + ALIGN64 UINT channelErrorNum; /*(offset 20)*/ ALIGN64 char* errorDescription; /*(offset 21)*/ UINT64 paddingB[32 - 22]; /* 22 */ @@ -286,9 +285,9 @@ FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError); FREERDP_API ULONG freerdp_get_transport_sent(rdpContext* context, BOOL resetCount); FREERDP_API HANDLE getChannelErrorEventHandle(rdpContext* context); -FREERDP_API WIN32ERROR getChannelError(rdpContext* context); +FREERDP_API UINT getChannelError(rdpContext* context); FREERDP_API const char* getChannelErrorDescription(rdpContext* context); -FREERDP_API void setChannelError(rdpContext* context, WIN32ERROR errorNum, char* description); +FREERDP_API void setChannelError(rdpContext* context, UINT errorNum, char* description); FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context); #ifdef __cplusplus diff --git a/include/freerdp/server/audin.h b/include/freerdp/server/audin.h index d44141198..a10c99773 100644 --- a/include/freerdp/server/audin.h +++ b/include/freerdp/server/audin.h @@ -25,17 +25,16 @@ #include #include #include -#include typedef struct _audin_server_context audin_server_context; -typedef WIN32ERROR (*psAudinServerSelectFormat)(audin_server_context* context, int client_format_index); +typedef UINT (*psAudinServerSelectFormat)(audin_server_context* context, int client_format_index); typedef BOOL (*psAudinServerOpen)(audin_server_context* context); typedef BOOL (*psAudinServerClose)(audin_server_context* context); -typedef WIN32ERROR (*psAudinServerOpening)(audin_server_context* context); -typedef WIN32ERROR (*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); -typedef WIN32ERROR (*psAudinServerReceiveSamples)(audin_server_context* context, const void* buf, int nframes); +typedef UINT (*psAudinServerOpening)(audin_server_context* context); +typedef UINT (*psAudinServerOpenResult)(audin_server_context* context, UINT32 result); +typedef UINT (*psAudinServerReceiveSamples)(audin_server_context* context, const void* buf, int nframes); struct _audin_server_context { diff --git a/include/freerdp/server/cliprdr.h b/include/freerdp/server/cliprdr.h index 1477dc689..e111c1533 100644 --- a/include/freerdp/server/cliprdr.h +++ b/include/freerdp/server/cliprdr.h @@ -35,33 +35,33 @@ typedef struct _cliprdr_server_context CliprdrServerContext; -typedef WIN32ERROR (*psCliprdrOpen)(CliprdrServerContext* context); -typedef WIN32ERROR (*psCliprdrClose)(CliprdrServerContext* context); -typedef WIN32ERROR (*psCliprdrStart)(CliprdrServerContext* context); -typedef WIN32ERROR (*psCliprdrStop)(CliprdrServerContext* context); +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 WIN32ERROR (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); +typedef UINT (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); -typedef WIN32ERROR (*psCliprdrServerCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities); -typedef WIN32ERROR (*psCliprdrClientCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities); -typedef WIN32ERROR (*psCliprdrMonitorReady)(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady); -typedef WIN32ERROR (*psCliprdrTempDirectory)(CliprdrServerContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory); -typedef WIN32ERROR (*psCliprdrClientFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList); -typedef WIN32ERROR (*psCliprdrServerFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList); -typedef WIN32ERROR (*psCliprdrClientFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef WIN32ERROR (*psCliprdrServerFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); -typedef WIN32ERROR (*psCliprdrClientLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef WIN32ERROR (*psCliprdrServerLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); -typedef WIN32ERROR (*psCliprdrClientUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef WIN32ERROR (*psCliprdrServerUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); -typedef WIN32ERROR (*psCliprdrClientFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef WIN32ERROR (*psCliprdrServerFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); -typedef WIN32ERROR (*psCliprdrClientFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef WIN32ERROR (*psCliprdrServerFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); -typedef WIN32ERROR (*psCliprdrClientFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef WIN32ERROR (*psCliprdrServerFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); -typedef WIN32ERROR (*psCliprdrClientFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); -typedef WIN32ERROR (*psCliprdrServerFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, CLIPRDR_CAPABILITIES* capabilities); +typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, CLIPRDR_MONITOR_READY* monitorReady); +typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, CLIPRDR_TEMP_DIRECTORY* tempDirectory); +typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST* formatList); +typedef UINT (*psCliprdrClientFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*psCliprdrServerFormatListResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); +typedef UINT (*psCliprdrClientLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*psCliprdrServerLockClipboardData)(CliprdrServerContext* context, CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); +typedef UINT (*psCliprdrClientUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*psCliprdrServerUnlockClipboardData)(CliprdrServerContext* context, CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); +typedef UINT (*psCliprdrClientFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*psCliprdrServerFormatDataRequest)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); +typedef UINT (*psCliprdrClientFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*psCliprdrServerFormatDataResponse)(CliprdrServerContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); +typedef UINT (*psCliprdrClientFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*psCliprdrServerFileContentsRequest)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); +typedef UINT (*psCliprdrClientFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); +typedef UINT (*psCliprdrServerFileContentsResponse)(CliprdrServerContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); struct _cliprdr_server_context { diff --git a/include/freerdp/server/drdynvc.h b/include/freerdp/server/drdynvc.h index ed8cedc8d..dd50cd27f 100644 --- a/include/freerdp/server/drdynvc.h +++ b/include/freerdp/server/drdynvc.h @@ -33,8 +33,8 @@ typedef struct _drdynvc_client_context DrdynvcServerContext; typedef struct _drdynvc_server_private DrdynvcServerPrivate; -typedef WIN32ERROR (*psDrdynvcStart)(DrdynvcServerContext* context); -typedef WIN32ERROR (*psDrdynvcStop)(DrdynvcServerContext* context); +typedef UINT (*psDrdynvcStart)(DrdynvcServerContext* context); +typedef UINT (*psDrdynvcStop)(DrdynvcServerContext* context); struct _drdynvc_client_context { diff --git a/include/freerdp/server/echo.h b/include/freerdp/server/echo.h index fbf21dc20..c4f3cdf4f 100644 --- a/include/freerdp/server/echo.h +++ b/include/freerdp/server/echo.h @@ -23,7 +23,6 @@ #define FREERDP_CHANNEL_ECHO_SERVER_H #include -#include typedef enum ECHO_SERVER_OPEN_RESULT { @@ -35,12 +34,12 @@ typedef enum ECHO_SERVER_OPEN_RESULT typedef struct _echo_server_context echo_server_context; -typedef WIN32ERROR (*psEchoServerOpen)(echo_server_context* context); -typedef WIN32ERROR (*psEchoServerClose)(echo_server_context* context); +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 WIN32ERROR (*psEchoServerOpenResult)(echo_server_context* context, ECHO_SERVER_OPEN_RESULT result); -typedef WIN32ERROR (*psEchoServerResponse)(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 _echo_server_context { diff --git a/include/freerdp/server/encomsp.h b/include/freerdp/server/encomsp.h index dbc9e84d3..f8485a434 100644 --- a/include/freerdp/server/encomsp.h +++ b/include/freerdp/server/encomsp.h @@ -35,20 +35,20 @@ typedef struct _encomsp_server_context EncomspServerContext; typedef struct _encomsp_server_private EncomspServerPrivate; -typedef WIN32ERROR (*psEncomspStart)(EncomspServerContext* context); -typedef WIN32ERROR (*psEncomspStop)(EncomspServerContext* context); +typedef UINT (*psEncomspStart)(EncomspServerContext* context); +typedef UINT (*psEncomspStop)(EncomspServerContext* context); -typedef WIN32ERROR (*psEncomspFilterUpdated)(EncomspServerContext* context, ENCOMSP_FILTER_UPDATED_PDU* filterUpdated); -typedef WIN32ERROR (*psEncomspApplicationCreated)(EncomspServerContext* context, ENCOMSP_APPLICATION_CREATED_PDU* applicationCreated); -typedef WIN32ERROR (*psEncomspApplicationRemoved)(EncomspServerContext* context, ENCOMSP_APPLICATION_REMOVED_PDU* applicationRemoved); -typedef WIN32ERROR (*psEncomspWindowCreated)(EncomspServerContext* context, ENCOMSP_WINDOW_CREATED_PDU* windowCreated); -typedef WIN32ERROR (*psEncomspWindowRemoved)(EncomspServerContext* context, ENCOMSP_WINDOW_REMOVED_PDU* windowRemoved); -typedef WIN32ERROR (*psEncomspShowWindow)(EncomspServerContext* context, ENCOMSP_SHOW_WINDOW_PDU* showWindow); -typedef WIN32ERROR (*psEncomspParticipantCreated)(EncomspServerContext* context, ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated); -typedef WIN32ERROR (*psEncomspParticipantRemoved)(EncomspServerContext* context, ENCOMSP_PARTICIPANT_REMOVED_PDU* participantRemoved); -typedef WIN32ERROR (*psEncomspChangeParticipantControlLevel)(EncomspServerContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* changeParticipantControlLevel); -typedef WIN32ERROR (*psEncomspGraphicsStreamPaused)(EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_PAUSED_PDU* graphicsStreamPaused); -typedef WIN32ERROR (*psEncomspGraphicsStreamResumed)(EncomspServerContext* context, ENCOMSP_GRAPHICS_STREAM_RESUMED_PDU* graphicsStreamResumed); +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 _encomsp_server_context { diff --git a/include/freerdp/server/rdpdr.h b/include/freerdp/server/rdpdr.h index b9802133e..27c41e4ed 100644 --- a/include/freerdp/server/rdpdr.h +++ b/include/freerdp/server/rdpdr.h @@ -50,18 +50,18 @@ struct _FILE_DIRECTORY_INFORMATION }; typedef struct _FILE_DIRECTORY_INFORMATION FILE_DIRECTORY_INFORMATION; -typedef WIN32ERROR (*psRdpdrStart)(RdpdrServerContext* context); -typedef WIN32ERROR (*psRdpdrStop)(RdpdrServerContext* context); +typedef UINT (*psRdpdrStart)(RdpdrServerContext* context); +typedef UINT (*psRdpdrStop)(RdpdrServerContext* context); -typedef WIN32ERROR (*psRdpdrDriveCreateDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef WIN32ERROR (*psRdpdrDriveDeleteDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef WIN32ERROR (*psRdpdrDriveQueryDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef WIN32ERROR (*psRdpdrDriveOpenFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, UINT32 createDisposition); -typedef WIN32ERROR (*psRdpdrDriveReadFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset); -typedef WIN32ERROR (*psRdpdrDriveWriteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, UINT32 length, UINT32 offset); -typedef WIN32ERROR (*psRdpdrDriveCloseFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId); -typedef WIN32ERROR (*psRdpdrDriveDeleteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); -typedef WIN32ERROR (*psRdpdrDriveRenameFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath); +typedef UINT (*psRdpdrDriveCreateDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveDeleteDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveQueryDirectory)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveOpenFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path, UINT32 desiredAccess, UINT32 createDisposition); +typedef UINT (*psRdpdrDriveReadFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, UINT32 length, UINT32 offset); +typedef UINT (*psRdpdrDriveWriteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId, const char* buffer, UINT32 length, UINT32 offset); +typedef UINT (*psRdpdrDriveCloseFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, UINT32 fileId); +typedef UINT (*psRdpdrDriveDeleteFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* path); +typedef UINT (*psRdpdrDriveRenameFile)(RdpdrServerContext* context, void* callbackData, UINT32 deviceId, const char* oldPath, const char* newPath); typedef void (*psRdpdrOnDriveCreate)(RdpdrServerContext* context, UINT32 deviceId, const char* name); typedef void (*psRdpdrOnDriveDelete)(RdpdrServerContext* context, UINT32 deviceId); diff --git a/include/freerdp/server/rdpei.h b/include/freerdp/server/rdpei.h index f04ec4d1f..74af11f36 100644 --- a/include/freerdp/server/rdpei.h +++ b/include/freerdp/server/rdpei.h @@ -41,9 +41,9 @@ struct _rdpei_server_context UINT32 protocolFlags; /** callbacks that can be set by the user */ - WIN32ERROR (*onClientReady)(RdpeiServerContext *context); - WIN32ERROR (*onTouchEvent)(RdpeiServerContext *context, RDPINPUT_TOUCH_EVENT *touchEvent); - WIN32ERROR (*onTouchReleased)(RdpeiServerContext *context, BYTE contactId); + UINT (*onClientReady)(RdpeiServerContext *context); + UINT (*onTouchEvent)(RdpeiServerContext *context, RDPINPUT_TOUCH_EVENT *touchEvent); + UINT (*onTouchReleased)(RdpeiServerContext *context, BYTE contactId); void *user_data; /* user data, useful for callbacks */ }; @@ -56,12 +56,12 @@ 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); FREERDP_API HANDLE rdpei_server_get_event_handle(RdpeiServerContext *context); -FREERDP_API WIN32ERROR rdpei_server_init(RdpeiServerContext *context); -FREERDP_API WIN32ERROR rdpei_server_handle_messages(RdpeiServerContext *context); +FREERDP_API UINT rdpei_server_init(RdpeiServerContext *context); +FREERDP_API UINT rdpei_server_handle_messages(RdpeiServerContext *context); -FREERDP_API WIN32ERROR rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version); -FREERDP_API WIN32ERROR rdpei_server_suspend(RdpeiServerContext *context); -FREERDP_API WIN32ERROR rdpei_server_resume(RdpeiServerContext *context); +FREERDP_API UINT rdpei_server_send_sc_ready(RdpeiServerContext *context, UINT32 version); +FREERDP_API UINT rdpei_server_suspend(RdpeiServerContext *context); +FREERDP_API UINT rdpei_server_resume(RdpeiServerContext *context); #ifdef __cplusplus } diff --git a/include/freerdp/server/rdpsnd.h b/include/freerdp/server/rdpsnd.h index a2e2fe8ec..701bca69f 100644 --- a/include/freerdp/server/rdpsnd.h +++ b/include/freerdp/server/rdpsnd.h @@ -29,15 +29,15 @@ typedef struct _rdpsnd_server_context RdpsndServerContext; typedef struct _rdpsnd_server_context rdpsnd_server_context; typedef struct _rdpsnd_server_private RdpsndServerPrivate; -typedef WIN32ERROR (*psRdpsndStart)(RdpsndServerContext* context); -typedef WIN32ERROR (*psRdpsndStop)(RdpsndServerContext* context); +typedef UINT (*psRdpsndStart)(RdpsndServerContext* context); +typedef UINT (*psRdpsndStop)(RdpsndServerContext* context); -typedef WIN32ERROR (*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); -typedef WIN32ERROR (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, int client_format_index); -typedef WIN32ERROR (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, int nframes, UINT16 wTimestamp); -typedef WIN32ERROR (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, UINT16 wtimestamp); -typedef WIN32ERROR (*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right); -typedef WIN32ERROR (*psRdpsndServerClose)(RdpsndServerContext* context); +typedef UINT (*psRdpsndServerInitialize)(RdpsndServerContext* context, BOOL ownThread); +typedef UINT (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, int client_format_index); +typedef UINT (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, int nframes, UINT16 wTimestamp); +typedef UINT (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, UINT16 wtimestamp); +typedef UINT (*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right); +typedef UINT (*psRdpsndServerClose)(RdpsndServerContext* context); typedef void (*psRdpsndServerActivated)(RdpsndServerContext* context); @@ -124,8 +124,8 @@ 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); FREERDP_API HANDLE rdpsnd_server_get_event_handle(RdpsndServerContext *context); -FREERDP_API WIN32ERROR rdpsnd_server_handle_messages(RdpsndServerContext *context); -FREERDP_API WIN32ERROR rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s); +FREERDP_API UINT rdpsnd_server_handle_messages(RdpsndServerContext *context); +FREERDP_API UINT rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s); #ifdef __cplusplus diff --git a/include/freerdp/server/remdesk.h b/include/freerdp/server/remdesk.h index d442949a9..181e36690 100644 --- a/include/freerdp/server/remdesk.h +++ b/include/freerdp/server/remdesk.h @@ -35,8 +35,8 @@ typedef struct _remdesk_server_context RemdeskServerContext; typedef struct _remdesk_server_private RemdeskServerPrivate; -typedef WIN32ERROR (*psRemdeskStart)(RemdeskServerContext* context); -typedef WIN32ERROR (*psRemdeskStop)(RemdeskServerContext* context); +typedef UINT (*psRemdeskStart)(RemdeskServerContext* context); +typedef UINT (*psRemdeskStop)(RemdeskServerContext* context); struct _remdesk_server_context { diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index a6fd74190..604f1923f 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -28,7 +28,6 @@ #include "rdp.h" #include "client.h" -#include #define TAG FREERDP_TAG("core.client") @@ -157,9 +156,14 @@ void freerdp_channels_free(rdpChannels* channels) free(channels); } -WIN32ERROR freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, const char* name, void* pInterface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, const char* name, void* pInterface) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; ChannelConnectedEventArgs e; rdpChannels* channels = (rdpChannels*) context->custom; freerdp* instance = channels->instance; @@ -172,9 +176,14 @@ WIN32ERROR freerdp_drdynvc_on_channel_connected(DrdynvcClientContext* context, c return status; } -WIN32ERROR freerdp_drdynvc_on_channel_disconnected(DrdynvcClientContext* context, const char* name, void* pInterface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT freerdp_drdynvc_on_channel_disconnected(DrdynvcClientContext* context, const char* name, void* pInterface) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; ChannelDisconnectedEventArgs e; rdpChannels* channels = (rdpChannels*) context->custom; freerdp* instance = channels->instance; diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 010046b38..2cd8f89a6 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -759,7 +759,12 @@ FREERDP_API BOOL checkChannelErrorEvent(rdpContext* context) return TRUE; } -FREERDP_API WIN32ERROR getChannelError(rdpContext* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +FREERDP_API UINT getChannelError(rdpContext* context) { return context->channelErrorNum; } @@ -767,7 +772,7 @@ FREERDP_API const char* getChannelErrorDescription(rdpContext* context) { return context->errorDescription; } -FREERDP_API void setChannelError(rdpContext* context, WIN32ERROR errorNum, char* description) +FREERDP_API void setChannelError(rdpContext* context, UINT errorNum, char* description) { context->channelErrorNum = errorNum; strncpy(context->errorDescription, description, 499); diff --git a/libfreerdp/gdi/gfx.c b/libfreerdp/gdi/gfx.c index 80d38daa7..5c9bf724d 100644 --- a/libfreerdp/gdi/gfx.c +++ b/libfreerdp/gdi/gfx.c @@ -24,11 +24,15 @@ #include #include #include -#include #define TAG FREERDP_TAG("gdi") -WIN32ERROR gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { UINT32 DesktopWidth; UINT32 DesktopHeight; @@ -130,7 +134,12 @@ int gdi_OutputExpose(rdpGdi* gdi, int x, int y, int width, int height) return 1; } -WIN32ERROR gdi_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* startFrame) { rdpGdi* gdi = (rdpGdi*) context->custom; @@ -139,7 +148,12 @@ WIN32ERROR gdi_StartFrame(RdpgfxClientContext* context, RDPGFX_START_FRAME_PDU* return CHANNEL_RC_OK; } -WIN32ERROR gdi_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endFrame) { rdpGdi* gdi = (rdpGdi*) context->custom; @@ -150,7 +164,12 @@ WIN32ERROR gdi_EndFrame(RdpgfxClientContext* context, RDPGFX_END_FRAME_PDU* endF return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_Uncompressed(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_Uncompressed(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { gdiGfxSurface* surface; RECTANGLE_16 invalidRect; @@ -176,7 +195,12 @@ WIN32ERROR gdi_SurfaceCommand_Uncompressed(rdpGdi* gdi, RdpgfxClientContext* con return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int j; UINT16 i; @@ -261,7 +285,12 @@ WIN32ERROR gdi_SurfaceCommand_RemoteFX(rdpGdi* gdi, RdpgfxClientContext* context return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; BYTE* DstData = NULL; @@ -301,7 +330,12 @@ WIN32ERROR gdi_SurfaceCommand_ClearCodec(rdpGdi* gdi, RdpgfxClientContext* conte return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_Planar(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_Planar(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; BYTE* DstData = NULL; @@ -334,7 +368,12 @@ WIN32ERROR gdi_SurfaceCommand_Planar(rdpGdi* gdi, RdpgfxClientContext* context, return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_H264(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_H264(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status; UINT32 i; @@ -381,7 +420,12 @@ WIN32ERROR gdi_SurfaceCommand_H264(rdpGdi* gdi, RdpgfxClientContext* context, RD return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status = 0; gdiGfxSurface* surface; @@ -415,7 +459,12 @@ WIN32ERROR gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, R return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int i, j; int status; @@ -512,9 +561,14 @@ WIN32ERROR gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* cont return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { - WIN32ERROR status = CHANNEL_RC_OK; + UINT status = CHANNEL_RC_OK; rdpGdi* gdi = (rdpGdi*) context->custom; switch (cmd->codecId) @@ -554,12 +608,22 @@ WIN32ERROR gdi_SurfaceCommand(RdpgfxClientContext* context, RDPGFX_SURFACE_COMMA return status; } -WIN32ERROR gdi_DeleteEncodingContext(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_DeleteEncodingContext(RdpgfxClientContext* context, RDPGFX_DELETE_ENCODING_CONTEXT_PDU* deleteEncodingContext) { return CHANNEL_RC_OK; } -WIN32ERROR gdi_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* createSurface) { gdiGfxSurface* surface; rdpGdi* gdi = (rdpGdi*) context->custom; @@ -590,7 +654,12 @@ WIN32ERROR gdi_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE return CHANNEL_RC_OK; } -WIN32ERROR gdi_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE_PDU* deleteSurface) { gdiGfxSurface* surface; rdpGdi* gdi = (rdpGdi*) context->custom; @@ -611,7 +680,12 @@ WIN32ERROR gdi_DeleteSurface(RdpgfxClientContext* context, RDPGFX_DELETE_SURFACE return CHANNEL_RC_OK; } -WIN32ERROR gdi_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) { UINT16 index; UINT32 color; @@ -661,7 +735,12 @@ WIN32ERROR gdi_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* so return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE_PDU* surfaceToSurface) { UINT16 index; BOOL sameSurface; @@ -720,7 +799,12 @@ WIN32ERROR gdi_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_ return CHANNEL_RC_OK; } -WIN32ERROR gdi_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache) { RDPGFX_RECT16* rect; gdiGfxSurface* surface; @@ -763,7 +847,12 @@ WIN32ERROR gdi_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CA return CHANNEL_RC_OK; } -WIN32ERROR gdi_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) { UINT16 index; RDPGFX_POINT16* destPt; @@ -800,12 +889,22 @@ WIN32ERROR gdi_CacheToSurface(RdpgfxClientContext* context, RDPGFX_CACHE_TO_SURF return CHANNEL_RC_OK; } -WIN32ERROR gdi_CacheImportReply(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_CacheImportReply(RdpgfxClientContext* context, RDPGFX_CACHE_IMPORT_REPLY_PDU* cacheImportReply) { return CHANNEL_RC_OK; } -WIN32ERROR gdi_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ENTRY_PDU* evictCacheEntry) { gdiGfxCacheEntry* cacheEntry; @@ -822,7 +921,12 @@ WIN32ERROR gdi_EvictCacheEntry(RdpgfxClientContext* context, RDPGFX_EVICT_CACHE_ return CHANNEL_RC_OK; } -WIN32ERROR gdi_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_OUTPUT_PDU* surfaceToOutput) { rdpGdi* gdi = (rdpGdi*) context->custom; @@ -831,7 +935,12 @@ WIN32ERROR gdi_MapSurfaceToOutput(RdpgfxClientContext* context, RDPGFX_MAP_SURFA return CHANNEL_RC_OK; } -WIN32ERROR gdi_MapSurfaceToWindow(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +UINT gdi_MapSurfaceToWindow(RdpgfxClientContext* context, RDPGFX_MAP_SURFACE_TO_WINDOW_PDU* surfaceToWindow) { return CHANNEL_RC_OK; } diff --git a/server/Mac/mf_audin.c b/server/Mac/mf_audin.c index 368a4b4de..a1240d9ab 100644 --- a/server/Mac/mf_audin.c +++ b/server/Mac/mf_audin.c @@ -36,18 +36,33 @@ static const AUDIO_FORMAT supported_audio_formats[] = { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL } }; -static WIN32ERROR mf_peer_audin_opening(audin_server_context* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT mf_peer_audin_opening(audin_server_context* context) { context->SelectFormat(context, 0); return CHANNEL_RC_OK; } -static WIN32ERROR mf_peer_audin_open_result(audin_server_context* context, UINT32 result) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT mf_peer_audin_open_result(audin_server_context* context, UINT32 result) { return CHANNEL_RC_OK; } -static WIN32ERROR mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes) { return CHANNEL_RC_OK; } diff --git a/server/Sample/sf_audin.c b/server/Sample/sf_audin.c index f5069c76d..cfc2ea170 100644 --- a/server/Sample/sf_audin.c +++ b/server/Sample/sf_audin.c @@ -30,7 +30,6 @@ #include "sf_audin.h" #include -#include #define TAG SERVER_TAG("sample") static const AUDIO_FORMAT test_audio_formats[] = @@ -39,7 +38,12 @@ static const AUDIO_FORMAT test_audio_formats[] = { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL } }; -static WIN32ERROR sf_peer_audin_opening(audin_server_context* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT sf_peer_audin_opening(audin_server_context* context) { WLog_DBG(TAG, "AUDIN opening."); /* Simply choose the first format supported by the client. */ @@ -47,13 +51,23 @@ static WIN32ERROR sf_peer_audin_opening(audin_server_context* context) return CHANNEL_RC_OK; } -static WIN32ERROR sf_peer_audin_open_result(audin_server_context* context, UINT32 result) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT sf_peer_audin_open_result(audin_server_context* context, UINT32 result) { WLog_DBG(TAG, "AUDIN open result %d.", result); return CHANNEL_RC_OK; } -static WIN32ERROR sf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT sf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes) { WLog_DBG(TAG, "AUDIN receive %d frames.", nframes); return CHANNEL_RC_OK; diff --git a/server/shadow/shadow_audin.c b/server/shadow/shadow_audin.c index 87184bdd0..6e35f3f3e 100644 --- a/server/shadow/shadow_audin.c +++ b/server/shadow/shadow_audin.c @@ -34,7 +34,12 @@ static const AUDIO_FORMAT default_supported_audio_formats[] = { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL } }; -static WIN32ERROR AudinServerOpening(audin_server_context* context) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT AudinServerOpening(audin_server_context* context) { AUDIO_FORMAT* agreed_format = NULL; int i = 0, j = 0; @@ -64,12 +69,22 @@ static WIN32ERROR AudinServerOpening(audin_server_context* context) context->SelectFormat(context, i); return CHANNEL_RC_OK; } -static WIN32ERROR AudinServerOpenResult(audin_server_context* context, UINT32 result) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT AudinServerOpenResult(audin_server_context* context, UINT32 result) { WLog_INFO(TAG, "AUDIN open result %u.\n", result); return CHANNEL_RC_OK; } -static WIN32ERROR AudinServerReceiveSamples(audin_server_context* context, const void* buf, int nframes) +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT AudinServerReceiveSamples(audin_server_context* context, const void* buf, int nframes) { rdpShadowClient* client = (rdpShadowClient* )context->data; rdpShadowSubsystem* subsystem = client->server->subsystem; diff --git a/server/shadow/shadow_encomsp.c b/server/shadow/shadow_encomsp.c index cabcc86a3..e74bea61b 100644 --- a/server/shadow/shadow_encomsp.c +++ b/server/shadow/shadow_encomsp.c @@ -29,7 +29,12 @@ #define TAG SERVER_TAG("shadow") -static WIN32ERROR encomsp_change_participant_control_level(EncomspServerContext* context, +/** + * Function description + * + * @return 0 on success, otherwise a Win32 error code + */ +static UINT encomsp_change_participant_control_level(EncomspServerContext* context, ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU* pdu) { BOOL inLobby; diff --git a/winpr/include/winpr/win32error.h b/winpr/include/winpr/win32error.h deleted file mode 100644 index 6e6194d89..000000000 --- a/winpr/include/winpr/win32error.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * WinPR: Windows Portable Runtime - * C Run-Time Library Routines - * - * Copyright 2015 Thincast Technologies GmbH - * Copyright 2015 DI (FH) Martin Haimberger - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -#ifndef WIN32ERROR_H -#define WIN32ERROR_H - -#include - -typedef UINT WIN32ERROR; - -#endif /* WIN32ERROR_H */