[server] add WINPR_ATTR_NODISCARD macro

This commit is contained in:
akallabeth
2026-01-23 13:15:46 +01:00
committed by Armin Novak
parent 15c9fd0300
commit b2f325251a
77 changed files with 613 additions and 233 deletions

View File

@@ -112,6 +112,7 @@ static const char* openstatus2str(PfDynChannelOpenStatus status)
dyn_log_((log), (level), (dynChannel), (cmd), (isBackData), __func__, __FILE__, __LINE__, \
__VA_ARGS__)
WINPR_ATTR_NODISCARD
static const char* getDirection(BOOL isBackData)
{
return isBackData ? "B->F" : "F->B";
@@ -145,6 +146,7 @@ static void dyn_log_(wLog* log, DWORD level, const pServerDynamicChannelContext*
free(msg);
}
WINPR_ATTR_NODISCARD
static PfChannelResult data_cb(pServerContext* ps, pServerDynamicChannelContext* channel,
BOOL isBackData, ChannelStateTracker* tracker, BOOL firstPacket,
BOOL lastPacket)
@@ -174,6 +176,27 @@ static PfChannelResult data_cb(pServerContext* ps, pServerDynamicChannelContext*
return dyn.result;
}
static void DynamicChannelContext_free(void* ptr)
{
pServerDynamicChannelContext* c = (pServerDynamicChannelContext*)ptr;
if (!c)
return;
if (c->backTracker.currentPacket)
Stream_Free(c->backTracker.currentPacket, TRUE);
if (c->frontTracker.currentPacket)
Stream_Free(c->frontTracker.currentPacket, TRUE);
if (c->channelDataDtor)
c->channelDataDtor(&c->channelData);
free(c->channelName);
free(c);
}
WINPR_ATTR_MALLOC(DynamicChannelContext_free, 1)
WINPR_ATTR_NODISCARD
static pServerDynamicChannelContext* DynamicChannelContext_new(wLog* log, pServerContext* ps,
const char* name, UINT32 id)
{
@@ -210,31 +233,14 @@ static pServerDynamicChannelContext* DynamicChannelContext_new(wLog* log, pServe
return ret;
}
static void DynamicChannelContext_free(void* ptr)
{
pServerDynamicChannelContext* c = (pServerDynamicChannelContext*)ptr;
if (!c)
return;
if (c->backTracker.currentPacket)
Stream_Free(c->backTracker.currentPacket, TRUE);
if (c->frontTracker.currentPacket)
Stream_Free(c->frontTracker.currentPacket, TRUE);
if (c->channelDataDtor)
c->channelDataDtor(&c->channelData);
free(c->channelName);
free(c);
}
WINPR_ATTR_NODISCARD
static UINT32 ChannelId_Hash(const void* key)
{
const UINT32* v = (const UINT32*)key;
return *v;
}
WINPR_ATTR_NODISCARD
static BOOL ChannelId_Compare(const void* objA, const void* objB)
{
const UINT32* v1 = objA;
@@ -242,6 +248,7 @@ static BOOL ChannelId_Compare(const void* objA, const void* objB)
return (*v1 == *v2);
}
WINPR_ATTR_NODISCARD
static DynvcReadResult dynvc_read_varInt(wLog* log, wStream* s, size_t len, UINT64* varInt,
BOOL last)
{
@@ -271,6 +278,7 @@ static DynvcReadResult dynvc_read_varInt(wLog* log, wStream* s, size_t len, UINT
return DYNCVC_READ_OK;
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerPeekHandleByMode(ChannelStateTracker* tracker,
DynChannelTrackerState* trackerState,
pServerDynamicChannelContext* dynChannel,
@@ -332,6 +340,7 @@ static PfChannelResult DynvcTrackerPeekHandleByMode(ChannelStateTracker* tracker
return result;
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleClose(ChannelStateTracker* tracker,
pServerDynamicChannelContext* dynChannel,
DynChannelContext* dynChannelContext,
@@ -358,6 +367,7 @@ static PfChannelResult DynvcTrackerHandleClose(ChannelStateTracker* tracker,
return channelTracker_flushCurrent(tracker, firstPacket, lastPacket, !isBackData);
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleCreateBack(ChannelStateTracker* tracker, wStream* s,
DWORD flags, proxyData* pdata,
pServerDynamicChannelContext* dynChannel,
@@ -431,6 +441,7 @@ static PfChannelResult DynvcTrackerHandleCreateBack(ChannelStateTracker* tracker
return channelTracker_flushCurrent(tracker, firstPacket, lastPacket, FALSE);
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleCreateFront(ChannelStateTracker* tracker, wStream* s,
DWORD flags,
WINPR_ATTR_UNUSED proxyData* pdata,
@@ -458,6 +469,7 @@ static PfChannelResult DynvcTrackerHandleCreateFront(ChannelStateTracker* tracke
return channelTracker_flushCurrent(tracker, firstPacket, lastPacket, TRUE);
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleCreate(ChannelStateTracker* tracker, wStream* s,
DWORD flags,
pServerDynamicChannelContext* dynChannel,
@@ -488,6 +500,7 @@ static PfChannelResult DynvcTrackerHandleCreate(ChannelStateTracker* tracker, wS
dynChannelId);
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleCmdDATA(ChannelStateTracker* tracker,
pServerDynamicChannelContext* dynChannel,
wStream* s, BYTE cmd, UINT64 Length,
@@ -622,6 +635,7 @@ static PfChannelResult DynvcTrackerHandleCmdDATA(ChannelStateTracker* tracker,
lastPacket);
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerHandleCmd(ChannelStateTracker* tracker,
pServerDynamicChannelContext* dynChannel, wStream* s,
BYTE cmd, UINT32 flags, UINT64 Length,
@@ -684,6 +698,7 @@ static PfChannelResult DynvcTrackerHandleCmd(ChannelStateTracker* tracker,
}
}
WINPR_ATTR_NODISCARD
static PfChannelResult DynvcTrackerPeekFn(ChannelStateTracker* tracker, BOOL firstPacket,
BOOL lastPacket)
{
@@ -805,6 +820,7 @@ static void DynChannelContext_free(void* context)
free(c);
}
WINPR_ATTR_NODISCARD
static const char* dynamic_context(void* arg)
{
proxyData* pdata = arg;
@@ -813,6 +829,8 @@ static const char* dynamic_context(void* arg)
return pdata->session_id;
}
WINPR_ATTR_MALLOC(DynChannelContext_free, 1)
WINPR_ATTR_NODISCARD
static DynChannelContext* DynChannelContext_new(proxyData* pdata,
pServerStaticChannelContext* channel)
{
@@ -862,6 +880,7 @@ fail:
return NULL;
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_dynvc_back_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,
@@ -876,6 +895,7 @@ static PfChannelResult pf_dynvc_back_data(proxyData* pdata,
return channelTracker_update(dyn->backTracker, xdata, xsize, flags, totalSize);
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_dynvc_front_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,

View File

@@ -21,6 +21,7 @@
#include <freerdp/server/proxy/proxy_context.h>
BOOL pf_channel_setup_drdynvc(proxyData* pdata, pServerStaticChannelContext* channel);
WINPR_ATTR_NODISCARD BOOL pf_channel_setup_drdynvc(proxyData* pdata,
pServerStaticChannelContext* channel);
#endif /* SERVER_PROXY_CHANNELS_PF_CHANNEL_DRDYNVC_H_ */

View File

@@ -143,6 +143,7 @@ typedef struct
__FILE__, (size_t)__LINE__)
#define Stream_CheckAndLogRequiredLengthRx(srv, log, s, len) \
Stream_CheckAndLogRequiredLengthRx_(srv, log, s, len, 1, __func__, __FILE__, __LINE__)
WINPR_ATTR_NODISCARD
static BOOL Stream_CheckAndLogRequiredLengthRx_(BOOL srv, wLog* log, wStream* s, size_t nmemb,
size_t size, const char* fkt, const char* file,
size_t line)
@@ -154,6 +155,7 @@ static BOOL Stream_CheckAndLogRequiredLengthRx_(BOOL srv, wLog* log, wStream* s,
line);
}
WINPR_ATTR_NODISCARD
static const char* rdpdr_server_state_to_string(pf_channel_server_state state)
{
switch (state)
@@ -173,6 +175,7 @@ static const char* rdpdr_server_state_to_string(pf_channel_server_state state)
}
}
WINPR_ATTR_NODISCARD
static const char* rdpdr_client_state_to_string(pf_channel_client_state state)
{
switch (state)
@@ -190,6 +193,7 @@ static const char* rdpdr_client_state_to_string(pf_channel_client_state state)
}
}
WINPR_ATTR_NODISCARD
static wStream* rdpdr_get_send_buffer(pf_channel_common_context* rdpdr, UINT16 component,
UINT16 PacketID, size_t capacity)
{
@@ -204,6 +208,7 @@ static wStream* rdpdr_get_send_buffer(pf_channel_common_context* rdpdr, UINT16 c
return rdpdr->s;
}
WINPR_ATTR_NODISCARD
static wStream* rdpdr_client_get_send_buffer(pf_channel_client_context* rdpdr, UINT16 component,
UINT16 PacketID, size_t capacity)
{
@@ -211,6 +216,7 @@ static wStream* rdpdr_client_get_send_buffer(pf_channel_client_context* rdpdr, U
return rdpdr_get_send_buffer(&rdpdr->common, component, PacketID, capacity);
}
WINPR_ATTR_NODISCARD
static wStream* rdpdr_server_get_send_buffer(pf_channel_server_context* rdpdr, UINT16 component,
UINT16 PacketID, size_t capacity)
{
@@ -218,6 +224,7 @@ static wStream* rdpdr_server_get_send_buffer(pf_channel_server_context* rdpdr, U
return rdpdr_get_send_buffer(&rdpdr->common, component, PacketID, capacity);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_client_send(wLog* log, pClientContext* pc, wStream* s)
{
UINT16 channelId = 0;
@@ -249,6 +256,7 @@ static UINT rdpdr_client_send(wLog* log, pClientContext* pc, wStream* s)
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_seal_send_free_request(pf_channel_server_context* context, wStream* s)
{
BOOL status = 0;
@@ -267,6 +275,7 @@ static UINT rdpdr_seal_send_free_request(pf_channel_server_context* context, wSt
return (status) ? CHANNEL_RC_OK : ERROR_INTERNAL_ERROR;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_process_server_header(BOOL server, wLog* log, wStream* s, UINT16 component,
UINT16 PacketId, size_t expect)
{
@@ -314,6 +323,7 @@ static BOOL rdpdr_process_server_header(BOOL server, wLog* log, wStream* s, UINT
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_check_version(BOOL server, wLog* log, UINT16 versionMajor, UINT16 versionMinor,
UINT16 component, UINT16 PacketId)
{
@@ -343,6 +353,7 @@ static BOOL rdpdr_check_version(BOOL server, wLog* log, UINT16 versionMajor, UIN
return TRUE;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_server_announce_request(pf_channel_client_context* rdpdr, wStream* s)
{
const UINT16 component = RDPDR_CTYP_CORE;
@@ -373,6 +384,7 @@ static UINT rdpdr_process_server_announce_request(pf_channel_client_context* rdp
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_server_send_announce_request(pf_channel_server_context* context)
{
wStream* s =
@@ -386,6 +398,7 @@ static UINT rdpdr_server_send_announce_request(pf_channel_server_context* contex
return rdpdr_seal_send_free_request(context, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_client_announce_reply(pf_channel_server_context* rdpdr, wStream* s)
{
const UINT16 component = RDPDR_CTYP_CORE;
@@ -430,6 +443,7 @@ static UINT rdpdr_process_client_announce_reply(pf_channel_server_context* rdpdr
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_client_announce_reply(pClientContext* pc, pf_channel_client_context* rdpdr)
{
wStream* s =
@@ -443,6 +457,7 @@ static UINT rdpdr_send_client_announce_reply(pClientContext* pc, pf_channel_clie
return rdpdr_client_send(rdpdr->log, pc, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_client_name_request(pf_channel_server_context* rdpdr, wStream* s,
pClientContext* pc)
{
@@ -489,6 +504,7 @@ static UINT rdpdr_process_client_name_request(pf_channel_server_context* rdpdr,
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_client_name_request(pClientContext* pc, pf_channel_client_context* rdpdr)
{
wStream* s = NULL;
@@ -521,6 +537,7 @@ static UINT rdpdr_send_client_name_request(pClientContext* pc, pf_channel_client
#define rdpdr_ignore_capset(srv, log, s, header) \
rdpdr_ignore_capset_((srv), (log), (s), header, __func__)
WINPR_ATTR_NODISCARD
static UINT rdpdr_ignore_capset_(WINPR_ATTR_UNUSED BOOL srv, WINPR_ATTR_UNUSED wLog* log,
wStream* s, const RDPDR_CAPABILITY_HEADER* header,
WINPR_ATTR_UNUSED const char* fkt)
@@ -532,6 +549,7 @@ static UINT rdpdr_ignore_capset_(WINPR_ATTR_UNUSED BOOL srv, WINPR_ATTR_UNUSED w
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_client_process_general_capset(pf_channel_client_context* rdpdr, wStream* s,
const RDPDR_CAPABILITY_HEADER* header)
{
@@ -539,6 +557,7 @@ static UINT rdpdr_client_process_general_capset(pf_channel_client_context* rdpdr
return rdpdr_ignore_capset(FALSE, rdpdr->log, s, header);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_printer_capset(pf_channel_client_context* rdpdr, wStream* s,
const RDPDR_CAPABILITY_HEADER* header)
{
@@ -546,6 +565,7 @@ static UINT rdpdr_process_printer_capset(pf_channel_client_context* rdpdr, wStre
return rdpdr_ignore_capset(FALSE, rdpdr->log, s, header);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_port_capset(pf_channel_client_context* rdpdr, wStream* s,
const RDPDR_CAPABILITY_HEADER* header)
{
@@ -553,6 +573,7 @@ static UINT rdpdr_process_port_capset(pf_channel_client_context* rdpdr, wStream*
return rdpdr_ignore_capset(FALSE, rdpdr->log, s, header);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_drive_capset(pf_channel_client_context* rdpdr, wStream* s,
const RDPDR_CAPABILITY_HEADER* header)
{
@@ -560,6 +581,7 @@ static UINT rdpdr_process_drive_capset(pf_channel_client_context* rdpdr, wStream
return rdpdr_ignore_capset(FALSE, rdpdr->log, s, header);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_smartcard_capset(pf_channel_client_context* rdpdr, wStream* s,
const RDPDR_CAPABILITY_HEADER* header)
{
@@ -567,6 +589,7 @@ static UINT rdpdr_process_smartcard_capset(pf_channel_client_context* rdpdr, wSt
return rdpdr_ignore_capset(FALSE, rdpdr->log, s, header);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_server_core_capability_request(pf_channel_client_context* rdpdr,
wStream* s)
{
@@ -638,6 +661,7 @@ static UINT rdpdr_process_server_core_capability_request(pf_channel_client_conte
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_write_general_capset(wLog* log, pf_channel_common_context* rdpdr, wStream* s)
{
WINPR_ASSERT(rdpdr);
@@ -662,6 +686,7 @@ static BOOL rdpdr_write_general_capset(wLog* log, pf_channel_common_context* rdp
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_write_printer_capset(wLog* log, pf_channel_common_context* rdpdr, wStream* s)
{
WINPR_ASSERT(rdpdr);
@@ -674,6 +699,7 @@ static BOOL rdpdr_write_printer_capset(wLog* log, pf_channel_common_context* rdp
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_write_port_capset(wLog* log, pf_channel_common_context* rdpdr, wStream* s)
{
WINPR_ASSERT(rdpdr);
@@ -686,6 +712,7 @@ static BOOL rdpdr_write_port_capset(wLog* log, pf_channel_common_context* rdpdr,
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_write_drive_capset(wLog* log, pf_channel_common_context* rdpdr, wStream* s)
{
WINPR_ASSERT(rdpdr);
@@ -698,6 +725,7 @@ static BOOL rdpdr_write_drive_capset(wLog* log, pf_channel_common_context* rdpdr
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_write_smartcard_capset(wLog* log, pf_channel_common_context* rdpdr, wStream* s)
{
WINPR_ASSERT(rdpdr);
@@ -710,6 +738,7 @@ static BOOL rdpdr_write_smartcard_capset(wLog* log, pf_channel_common_context* r
return TRUE;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_server_capability_request(pf_channel_server_context* rdpdr)
{
wStream* s =
@@ -731,6 +760,7 @@ static UINT rdpdr_send_server_capability_request(pf_channel_server_context* rdpd
return rdpdr_seal_send_free_request(rdpdr, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_client_capability_response(pf_channel_server_context* rdpdr, wStream* s)
{
const UINT16 component = RDPDR_CTYP_CORE;
@@ -800,6 +830,7 @@ static UINT rdpdr_process_client_capability_response(pf_channel_server_context*
return status;
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_client_capability_response(pClientContext* pc,
pf_channel_client_context* rdpdr)
{
@@ -825,6 +856,7 @@ static UINT rdpdr_send_client_capability_response(pClientContext* pc,
return rdpdr_client_send(rdpdr->log, pc, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_server_clientid_confirm(pf_channel_server_context* rdpdr)
{
wStream* s = NULL;
@@ -838,6 +870,7 @@ static UINT rdpdr_send_server_clientid_confirm(pf_channel_server_context* rdpdr)
return rdpdr_seal_send_free_request(rdpdr, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_server_clientid_confirm(pf_channel_client_context* rdpdr, wStream* s)
{
UINT16 versionMajor = 0;
@@ -886,6 +919,7 @@ static UINT rdpdr_process_server_clientid_confirm(pf_channel_client_context* rdp
return CHANNEL_RC_OK;
}
WINPR_ATTR_NODISCARD
static BOOL
rdpdr_process_server_capability_request_or_clientid_confirm(pf_channel_client_context* rdpdr,
wStream* s)
@@ -943,6 +977,7 @@ rdpdr_process_server_capability_request_or_clientid_confirm(pf_channel_client_co
}
#if defined(WITH_PROXY_EMULATE_SMARTCARD)
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_emulated_scard_device_list_announce_request(pClientContext* pc,
pf_channel_client_context* rdpdr)
{
@@ -963,6 +998,7 @@ static UINT rdpdr_send_emulated_scard_device_list_announce_request(pClientContex
return rdpdr_client_send(rdpdr->log, pc, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_send_emulated_scard_device_remove(pClientContext* pc,
pf_channel_client_context* rdpdr)
{
@@ -979,6 +1015,7 @@ static UINT rdpdr_send_emulated_scard_device_remove(pClientContext* pc,
return rdpdr_client_send(rdpdr->log, pc, s);
}
WINPR_ATTR_NODISCARD
static UINT rdpdr_process_server_device_announce_response(pf_channel_client_context* rdpdr,
wStream* s)
{
@@ -1021,6 +1058,7 @@ static UINT rdpdr_process_server_device_announce_response(pf_channel_client_cont
}
#endif
WINPR_ATTR_NODISCARD
static BOOL pf_channel_rdpdr_rewrite_device_list_to(wStream* s, UINT32 fromVersion,
UINT32 toVersion)
{
@@ -1108,6 +1146,7 @@ fail:
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_rdpdr_rewrite_device_list(pf_channel_client_context* rdpdr,
pServerContext* ps, wStream* s, BOOL toServer)
{
@@ -1152,6 +1191,7 @@ static BOOL pf_channel_rdpdr_rewrite_device_list(pf_channel_client_context* rdpd
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_rdpdr_client_send_to_server(pf_channel_client_context* rdpdr,
pServerContext* ps, wStream* s)
{
@@ -1179,9 +1219,11 @@ static BOOL pf_channel_rdpdr_client_send_to_server(pf_channel_client_context* rd
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_send_client_queue(pClientContext* pc, pf_channel_client_context* rdpdr);
#if defined(WITH_PROXY_EMULATE_SMARTCARD)
WINPR_ATTR_NODISCARD
static BOOL rdpdr_process_server_loggedon_request(pServerContext* ps, pClientContext* pc,
pf_channel_client_context* rdpdr, wStream* s,
UINT16 component, UINT16 packetid)
@@ -1196,6 +1238,7 @@ static BOOL rdpdr_process_server_loggedon_request(pServerContext* ps, pClientCon
return pf_channel_rdpdr_client_send_to_server(rdpdr, ps, s);
}
WINPR_ATTR_NODISCARD
static BOOL filter_smartcard_io_requests(pf_channel_client_context* rdpdr, wStream* s,
UINT16* pPacketid)
{
@@ -1266,14 +1309,14 @@ fail:
BOOL pf_channel_send_client_queue(pClientContext* pc, pf_channel_client_context* rdpdr)
{
UINT16 channelId = 0;
WINPR_ASSERT(pc);
WINPR_ASSERT(rdpdr);
if (rdpdr->state != STATE_CLIENT_CHANNEL_RUNNING)
return FALSE;
channelId = freerdp_channels_get_id_by_name(pc->context.instance, RDPDR_SVC_CHANNEL_NAME);
const UINT16 channelId =
freerdp_channels_get_id_by_name(pc->context.instance, RDPDR_SVC_CHANNEL_NAME);
if ((channelId == 0) || (channelId == UINT16_MAX))
return TRUE;
@@ -1300,6 +1343,7 @@ BOOL pf_channel_send_client_queue(pClientContext* pc, pf_channel_client_context*
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL rdpdr_handle_server_announce_request(pClientContext* pc,
pf_channel_client_context* rdpdr, wStream* s)
{
@@ -1397,7 +1441,8 @@ BOOL pf_channel_rdpdr_client_handle(pClientContext* pc, UINT16 channelId, const
#endif
{
rdpdr->state = STATE_CLIENT_CHANNEL_RUNNING;
pf_channel_send_client_queue(pc, rdpdr);
if (!pf_channel_send_client_queue(pc, rdpdr))
return FALSE;
}
break;
@@ -1485,6 +1530,7 @@ static void pf_channel_rdpdr_client_context_free(InterceptContextMapEntry* base)
free(entry);
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_rdpdr_common_context_new(pf_channel_common_context* common,
void (*fkt)(InterceptContextMapEntry*))
{
@@ -1514,6 +1560,7 @@ static BOOL pf_channel_rdpdr_common_context_new(pf_channel_common_context* commo
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_rdpdr_client_pass_message(pServerContext* ps, pClientContext* pc,
WINPR_ATTR_UNUSED UINT16 channelId,
const char* channel_name, wStream* s)
@@ -1532,11 +1579,11 @@ static BOOL pf_channel_rdpdr_client_pass_message(pServerContext* ps, pClientCont
return FALSE;
if (!Queue_Enqueue(rdpdr->queue, s))
return FALSE;
pf_channel_send_client_queue(pc, rdpdr);
return TRUE;
return pf_channel_send_client_queue(pc, rdpdr);
}
#if defined(WITH_PROXY_EMULATE_SMARTCARD)
WINPR_ATTR_NODISCARD
static BOOL filter_smartcard_device_list_remove(pf_channel_server_context* rdpdr, wStream* s)
{
size_t pos = 0;
@@ -1580,6 +1627,7 @@ static BOOL filter_smartcard_device_list_remove(pf_channel_server_context* rdpdr
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL filter_smartcard_device_io_request(pf_channel_server_context* rdpdr, wStream* s)
{
UINT32 DeviceID = 0;
@@ -1589,6 +1637,7 @@ static BOOL filter_smartcard_device_io_request(pf_channel_server_context* rdpdr,
return ArrayList_Contains(rdpdr->blockedDevices, (void*)(size_t)DeviceID);
}
WINPR_ATTR_NODISCARD
static BOOL filter_smartcard_device_list_announce(pf_channel_server_context* rdpdr, wStream* s)
{
UINT32 count = 0;
@@ -1636,6 +1685,7 @@ static BOOL filter_smartcard_device_list_announce(pf_channel_server_context* rdp
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL filter_smartcard_device_list_announce_request(pf_channel_server_context* rdpdr,
wStream* s)
{
@@ -1692,6 +1742,8 @@ fail:
}
#endif
WINPR_ATTR_MALLOC(Stream_Free, 1)
WINPR_ATTR_NODISCARD
static void* stream_copy(const void* obj)
{
const wStream* src = obj;
@@ -1710,6 +1762,7 @@ static void stream_free(void* obj)
Stream_Free(s, TRUE);
}
WINPR_ATTR_NODISCARD
static const char* pf_channel_rdpdr_client_context(void* arg)
{
pClientContext* pc = arg;
@@ -1777,6 +1830,7 @@ static void pf_channel_rdpdr_server_context_free(InterceptContextMapEntry* base)
free(entry);
}
WINPR_ATTR_NODISCARD
static const char* pf_channel_rdpdr_server_context(void* arg)
{
pServerContext* ps = arg;
@@ -1839,6 +1893,7 @@ void pf_channel_rdpdr_server_free(pServerContext* ps)
HashTable_Remove(ps->interceptContextMap, RDPDR_SVC_CHANNEL_NAME);
}
WINPR_ATTR_NODISCARD
static pf_channel_server_context* get_channel(pServerContext* ps, BOOL send)
{
pf_channel_server_context* rdpdr = NULL;
@@ -1972,6 +2027,7 @@ BOOL pf_channel_rdpdr_client_reset(pClientContext* pc)
return TRUE;
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_rdpdr_back_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,
@@ -1992,6 +2048,7 @@ static PfChannelResult pf_rdpdr_back_data(proxyData* pdata,
return PF_CHANNEL_RESULT_DROP;
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_rdpdr_front_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,

View File

@@ -23,25 +23,28 @@
#include <freerdp/server/proxy/proxy_context.h>
BOOL pf_channel_setup_rdpdr(pServerContext* ps, pServerStaticChannelContext* channel);
WINPR_ATTR_NODISCARD BOOL pf_channel_setup_rdpdr(pServerContext* ps,
pServerStaticChannelContext* channel);
void pf_channel_rdpdr_client_free(pClientContext* pc);
BOOL pf_channel_rdpdr_client_new(pClientContext* pc);
WINPR_ATTR_NODISCARD BOOL pf_channel_rdpdr_client_new(pClientContext* pc);
BOOL pf_channel_rdpdr_client_reset(pClientContext* pc);
BOOL pf_channel_rdpdr_client_handle(pClientContext* pc, UINT16 channelId, const char* channel_name,
const BYTE* xdata, size_t xsize, UINT32 flags,
size_t totalSize);
WINPR_ATTR_NODISCARD BOOL pf_channel_rdpdr_client_handle(pClientContext* pc, UINT16 channelId,
const char* channel_name,
const BYTE* xdata, size_t xsize,
UINT32 flags, size_t totalSize);
void pf_channel_rdpdr_server_free(pServerContext* ps);
BOOL pf_channel_rdpdr_server_new(pServerContext* ps);
WINPR_ATTR_NODISCARD BOOL pf_channel_rdpdr_server_new(pServerContext* ps);
BOOL pf_channel_rdpdr_server_announce(pServerContext* ps);
BOOL pf_channel_rdpdr_server_handle(pServerContext* ps, UINT16 channelId, const char* channel_name,
const BYTE* xdata, size_t xsize, UINT32 flags,
size_t totalSize);
WINPR_ATTR_NODISCARD BOOL pf_channel_rdpdr_server_announce(pServerContext* ps);
WINPR_ATTR_NODISCARD BOOL pf_channel_rdpdr_server_handle(pServerContext* ps, UINT16 channelId,
const char* channel_name,
const BYTE* xdata, size_t xsize,
UINT32 flags, size_t totalSize);
#endif /* FREERDP_SERVER_PROXY_RDPDR_H */

View File

@@ -58,6 +58,7 @@ typedef struct
pf_scard_send_fkt_t send_fkt;
} pf_channel_client_queue_element;
WINPR_ATTR_NODISCARD
static pf_channel_client_context* scard_get_client_context(pClientContext* pc)
{
pf_channel_client_context* scard = NULL;
@@ -71,6 +72,7 @@ static pf_channel_client_context* scard_get_client_context(pClientContext* pc)
return scard;
}
WINPR_ATTR_NODISCARD
static BOOL pf_channel_client_write_iostatus(wStream* out, const SMARTCARD_OPERATION* op,
NTSTATUS ioStatus)
{
@@ -111,6 +113,9 @@ struct thread_arg
};
static void queue_free(void* obj);
WINPR_ATTR_MALLOC(queue_free, 1)
WINPR_ATTR_NODISCARD
static void* queue_copy(const void* obj);
static VOID irp_thread(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE Instance, PVOID Context,
@@ -133,6 +138,7 @@ static VOID irp_thread(WINPR_ATTR_UNUSED PTP_CALLBACK_INSTANCE Instance, PVOID C
ArrayList_Remove(scard->workObjects, Work);
}
WINPR_ATTR_NODISCARD
static BOOL start_irp_thread(pf_channel_client_context* scard,
const pf_channel_client_queue_element* e)
{
@@ -308,6 +314,8 @@ static void queue_free(void* obj)
free(element);
}
WINPR_ATTR_MALLOC(queue_free, 1)
WINPR_ATTR_NODISCARD
static void* queue_copy(const void* obj)
{
const pf_channel_client_queue_element* other = obj;

View File

@@ -26,14 +26,15 @@
typedef UINT (*pf_scard_send_fkt_t)(wLog* log, pClientContext*, wStream*);
BOOL pf_channel_smartcard_client_new(pClientContext* pc);
WINPR_ATTR_NODISCARD BOOL pf_channel_smartcard_client_new(pClientContext* pc);
void pf_channel_smartcard_client_free(pClientContext* pc);
BOOL pf_channel_smartcard_client_reset(pClientContext* pc);
BOOL pf_channel_smartcard_client_emulate(pClientContext* pc);
WINPR_ATTR_NODISCARD BOOL pf_channel_smartcard_client_emulate(pClientContext* pc);
BOOL pf_channel_smartcard_client_handle(wLog* log, pClientContext* pc, wStream* s, wStream* out,
pf_scard_send_fkt_t fkt);
BOOL pf_channel_smartcard_server_handle(pServerContext* ps, wStream* s);
WINPR_ATTR_NODISCARD BOOL pf_channel_smartcard_client_handle(wLog* log, pClientContext* pc,
wStream* s, wStream* out,
pf_scard_send_fkt_t fkt);
WINPR_ATTR_NODISCARD BOOL pf_channel_smartcard_server_handle(pServerContext* ps, wStream* s);
#endif /* FREERDP_SERVER_PROXY_SCARD_H */

View File

@@ -35,6 +35,7 @@
static proxyServer* server = NULL;
#if defined(_WIN32)
WINPR_ATTR_NODISCARD
static const char* strsignal(int signum)
{
switch (signum)
@@ -83,12 +84,14 @@ static int usage(const char* app)
return 0;
}
WINPR_ATTR_NODISCARD
static int version(const char* app)
{
printf("%s version %s", app, freerdp_get_version_string());
return 0;
}
WINPR_ATTR_NODISCARD
static int buildconfig(WINPR_ATTR_UNUSED const char* app)
{
printf("This is FreeRDP version %s (%s)\n", FREERDP_VERSION_FULL, FREERDP_GIT_REVISION);

View File

@@ -41,6 +41,7 @@ struct sChannelStateTracker
proxyData* pdata;
};
WINPR_ATTR_NODISCARD
static BOOL channelTracker_resetCurrentPacket(ChannelStateTracker* tracker)
{
WINPR_ASSERT(tracker);
@@ -224,6 +225,7 @@ PfChannelResult channelTracker_flushCurrent(ChannelStateTracker* t, BOOL first,
return r ? PF_CHANNEL_RESULT_DROP : PF_CHANNEL_RESULT_ERROR;
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_channel_generic_back_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,
@@ -258,6 +260,7 @@ static PfChannelResult pf_channel_generic_back_data(proxyData* pdata,
}
}
WINPR_ATTR_NODISCARD
static PfChannelResult pf_channel_generic_front_data(proxyData* pdata,
const pServerStaticChannelContext* channel,
const BYTE* xdata, size_t xsize, UINT32 flags,

View File

@@ -41,25 +41,26 @@ ChannelStateTracker* channelTracker_new(pServerStaticChannelContext* channel,
ChannelTrackerPeekFn fn, void* data);
BOOL channelTracker_setMode(ChannelStateTracker* tracker, ChannelTrackerMode mode);
ChannelTrackerMode channelTracker_getMode(ChannelStateTracker* tracker);
WINPR_ATTR_NODISCARD ChannelTrackerMode channelTracker_getMode(ChannelStateTracker* tracker);
BOOL channelTracker_setPData(ChannelStateTracker* tracker, proxyData* pdata);
proxyData* channelTracker_getPData(ChannelStateTracker* tracker);
WINPR_ATTR_NODISCARD BOOL channelTracker_setPData(ChannelStateTracker* tracker, proxyData* pdata);
WINPR_ATTR_NODISCARD proxyData* channelTracker_getPData(ChannelStateTracker* tracker);
BOOL channelTracker_setCustomData(ChannelStateTracker* tracker, void* data);
void* channelTracker_getCustomData(ChannelStateTracker* tracker);
WINPR_ATTR_NODISCARD BOOL channelTracker_setCustomData(ChannelStateTracker* tracker, void* data);
WINPR_ATTR_NODISCARD void* channelTracker_getCustomData(ChannelStateTracker* tracker);
wStream* channelTracker_getCurrentPacket(ChannelStateTracker* tracker);
WINPR_ATTR_NODISCARD wStream* channelTracker_getCurrentPacket(ChannelStateTracker* tracker);
size_t channelTracker_getCurrentPacketSize(ChannelStateTracker* tracker);
WINPR_ATTR_NODISCARD size_t channelTracker_getCurrentPacketSize(ChannelStateTracker* tracker);
BOOL channelTracker_setCurrentPacketSize(ChannelStateTracker* tracker, size_t size);
PfChannelResult channelTracker_update(ChannelStateTracker* tracker, const BYTE* xdata, size_t xsize,
UINT32 flags, size_t totalSize);
WINPR_ATTR_NODISCARD PfChannelResult channelTracker_update(ChannelStateTracker* tracker,
const BYTE* xdata, size_t xsize,
UINT32 flags, size_t totalSize);
PfChannelResult channelTracker_flushCurrent(ChannelStateTracker* t, BOOL first, BOOL last,
BOOL toBack);
WINPR_ATTR_NODISCARD PfChannelResult channelTracker_flushCurrent(ChannelStateTracker* t, BOOL first,
BOOL last, BOOL toBack);
BOOL pf_channel_setup_generic(pServerStaticChannelContext* channel);
WINPR_ATTR_NODISCARD BOOL pf_channel_setup_generic(pServerStaticChannelContext* channel);
#endif /* SERVER_PROXY_PF_CHANNEL_H_ */

View File

@@ -52,6 +52,8 @@
#define TAG PROXY_TAG("client")
static void channel_data_free(void* obj);
WINPR_ATTR_NODISCARD
static BOOL proxy_server_reactivate(rdpContext* ps, const rdpContext* pc)
{
WINPR_ASSERT(ps);
@@ -120,6 +122,7 @@ static void pf_client_on_activated(void* ctx, WINPR_ATTR_UNUSED const ActivatedE
pf_server_register_update_callbacks(peer->context->update);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_load_rdpsnd(pClientContext* pc)
{
rdpContext* context = (rdpContext*)pc;
@@ -141,6 +144,7 @@ static BOOL pf_client_load_rdpsnd(pClientContext* pc)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_use_peer_load_balance_info(pClientContext* pc)
{
pServerContext* ps = NULL;
@@ -163,6 +167,7 @@ static BOOL pf_client_use_peer_load_balance_info(pClientContext* pc)
lb_info_len);
}
WINPR_ATTR_NODISCARD
static BOOL str_is_empty(const char* str)
{
if (!str)
@@ -172,6 +177,7 @@ static BOOL str_is_empty(const char* str)
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_use_proxy_smartcard_auth(const rdpSettings* settings)
{
BOOL enable = freerdp_settings_get_bool(settings, FreeRDP_SmartcardLogon);
@@ -190,6 +196,7 @@ static BOOL pf_client_use_proxy_smartcard_auth(const rdpSettings* settings)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_pre_connect(freerdp* instance)
{
pClientContext* pc = NULL;
@@ -301,6 +308,7 @@ typedef struct
UINT32 backId;
} UpdateBackIdArgs;
WINPR_ATTR_NODISCARD
static BOOL updateBackIdFn(WINPR_ATTR_UNUSED const void* key, void* value, void* arg)
{
pServerStaticChannelContext* current = (pServerStaticChannelContext*)value;
@@ -317,6 +325,7 @@ static BOOL updateBackIdFn(WINPR_ATTR_UNUSED const void* key, void* value, void*
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_update_back_id(pServerContext* ps, const char* name, UINT32 backId)
{
UpdateBackIdArgs res = { ps, name, backId };
@@ -324,6 +333,7 @@ static BOOL pf_client_update_back_id(pServerContext* ps, const char* name, UINT3
return HashTable_Foreach(ps->channelsByFrontId, updateBackIdFn, &res) == FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_load_channels(freerdp* instance)
{
pClientContext* pc = NULL;
@@ -419,6 +429,7 @@ static BOOL pf_client_load_channels(freerdp* instance)
return pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_LOAD_CHANNELS, pc->pdata, pc);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channelId,
const BYTE* xdata, size_t xsize, UINT32 flags,
size_t totalSize)
@@ -467,6 +478,7 @@ static BOOL pf_client_receive_channel_data_hook(freerdp* instance, UINT16 channe
}
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_on_server_heartbeat(freerdp* instance, BYTE period, BYTE count1, BYTE count2)
{
pClientContext* pc = NULL;
@@ -482,6 +494,7 @@ static BOOL pf_client_on_server_heartbeat(freerdp* instance, BYTE period, BYTE c
return freerdp_heartbeat_send_heartbeat_pdu(ps->context.peer, period, count1, count2);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_channel_data(pClientContext* pc, const proxyChannelDataEventInfo* ev)
{
WINPR_ASSERT(pc);
@@ -490,6 +503,7 @@ static BOOL pf_client_send_channel_data(pClientContext* pc, const proxyChannelDa
return Queue_Enqueue(pc->cached_server_channel_data, ev);
}
WINPR_ATTR_NODISCARD
static BOOL sendQueuedChannelData(pClientContext* pc)
{
BOOL rc = TRUE;
@@ -535,6 +549,7 @@ static BOOL sendQueuedChannelData(pClientContext* pc)
* If required, register pointer callbacks to change the local mouse cursor
* when hovering over the RDP window
*/
WINPR_ATTR_NODISCARD
static BOOL pf_client_post_connect(freerdp* instance)
{
WINPR_ASSERT(instance);
@@ -567,7 +582,8 @@ static BOOL pf_client_post_connect(freerdp* instance)
pc->connected = TRUE;
/* Send cached channel data */
sendQueuedChannelData(pc);
if (!sendQueuedChannelData(pc))
return FALSE;
/*
* after the connection fully established and settings were negotiated with target server,
@@ -603,7 +619,7 @@ static void pf_client_post_disconnect(freerdp* instance)
pf_channel_rdpdr_client_free(pc);
pc->connected = FALSE;
pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_DISCONNECT, pc->pdata, pc);
(void)pf_modules_run_hook(pc->pdata->module, HOOK_TYPE_CLIENT_POST_DISCONNECT, pc->pdata, pc);
PubSub_UnsubscribeErrorInfo(instance->context->pubSub, pf_client_on_error_info);
gdi_free(instance);
@@ -613,6 +629,7 @@ static void pf_client_post_disconnect(freerdp* instance)
proxy_data_abort_connect(pdata);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_redirect(freerdp* instance)
{
if (!instance)
@@ -638,6 +655,7 @@ static BOOL pf_client_redirect(freerdp* instance)
* returns TRUE if in case of connection failure, the client should try again without NLA.
* Otherwise, returns FALSE.
*/
WINPR_ATTR_NODISCARD
static BOOL pf_client_should_retry_without_nla(pClientContext* pc)
{
rdpSettings* settings = NULL;
@@ -657,6 +675,7 @@ static BOOL pf_client_should_retry_without_nla(pClientContext* pc)
return config->ClientTlsSecurity || config->ClientRdpSecurity;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_set_security_settings(pClientContext* pc)
{
WINPR_ASSERT(pc);
@@ -689,6 +708,7 @@ static BOOL pf_client_set_security_settings(pClientContext* pc)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_connect_without_nla(pClientContext* pc)
{
freerdp* instance = NULL;
@@ -717,6 +737,7 @@ static BOOL pf_client_connect_without_nla(pClientContext* pc)
return freerdp_connect(instance);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_connect(freerdp* instance)
{
pClientContext* pc = NULL;
@@ -772,6 +793,7 @@ out:
* Connects RDP, loops while running and handles event and dispatch, cleans up
* after the connection ends.
*/
WINPR_ATTR_NODISCARD
static DWORD WINAPI pf_client_thread_proc(pClientContext* pc)
{
freerdp* instance = NULL;
@@ -845,17 +867,19 @@ static DWORD WINAPI pf_client_thread_proc(pClientContext* pc)
break;
}
sendQueuedChannelData(pc);
if (!sendQueuedChannelData(pc))
break;
}
freerdp_disconnect(instance);
end:
pf_modules_run_hook(pdata->module, HOOK_TYPE_CLIENT_UNINIT_CONNECT, pdata, pc);
(void)pf_modules_run_hook(pdata->module, HOOK_TYPE_CLIENT_UNINIT_CONNECT, pdata, pc);
return 0;
}
WINPR_ATTR_NODISCARD
static int pf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
{
const char* str_data = freerdp_get_logon_error_info_data(data);
@@ -884,6 +908,7 @@ static void pf_client_context_free(freerdp* instance, rdpContext* context)
HashTable_Free(pc->interceptContextMap);
}
WINPR_ATTR_NODISCARD
static int pf_client_verify_X509_certificate(freerdp* instance, const BYTE* data, size_t length,
const char* hostname, UINT16 port, DWORD flags)
{
@@ -937,6 +962,8 @@ void channel_data_free(void* obj)
}
}
WINPR_ATTR_MALLOC(channel_data_free, 1)
WINPR_ATTR_NODISCARD
static void* channel_data_copy(const void* obj)
{
union
@@ -973,6 +1000,7 @@ fail:
return NULL;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_client_new(freerdp* instance, rdpContext* context)
{
wObject* obj = NULL;
@@ -1016,6 +1044,7 @@ static BOOL pf_client_client_new(freerdp* instance, rdpContext* context)
return TRUE;
}
WINPR_ATTR_NODISCARD
static int pf_client_client_stop(rdpContext* context)
{
pClientContext* pc = (pClientContext*)context;

View File

@@ -26,6 +26,6 @@
#include <winpr/wtypes.h>
int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
DWORD WINAPI pf_client_start(LPVOID arg);
WINPR_ATTR_NODISCARD DWORD WINAPI pf_client_start(LPVOID arg);
#endif /* FREERDP_SERVER_PROXY_PFCLIENT_H */

View File

@@ -59,6 +59,8 @@
static const char* bool_str_true = "true";
static const char* bool_str_false = "false";
WINPR_ATTR_NODISCARD
static const char* boolstr(BOOL rc)
{
return rc ? bool_str_true : bool_str_false;
@@ -129,6 +131,7 @@ static char** pf_config_parse_comma_separated_list(const char* list, size_t* cou
return CommandLineParseCommaSeparatedValues(list, count);
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char* key,
UINT16* result, BOOL required)
{
@@ -154,6 +157,7 @@ static BOOL pf_config_get_uint16(wIniFile* ini, const char* section, const char*
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* key,
UINT32* result, BOOL required)
{
@@ -178,6 +182,7 @@ static BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char*
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_get_bool(wIniFile* ini, const char* section, const char* key, BOOL fallback)
{
int num_value = 0;
@@ -204,6 +209,7 @@ static BOOL pf_config_get_bool(wIniFile* ini, const char* section, const char* k
return FALSE;
}
WINPR_ATTR_NODISCARD
static const char* pf_config_get_str(wIniFile* ini, const char* section, const char* key,
BOOL required)
{
@@ -221,6 +227,7 @@ static const char* pf_config_get_str(wIniFile* ini, const char* section, const c
return value;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_server(wIniFile* ini, proxyConfig* config)
{
WINPR_ASSERT(config);
@@ -241,6 +248,7 @@ static BOOL pf_config_load_server(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_target(wIniFile* ini, proxyConfig* config)
{
const char* target_value = NULL;
@@ -298,6 +306,7 @@ static BOOL pf_config_load_target(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_channels(wIniFile* ini, proxyConfig* config)
{
WINPR_ASSERT(config);
@@ -323,6 +332,7 @@ static BOOL pf_config_load_channels(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_input(wIniFile* ini, proxyConfig* config)
{
WINPR_ASSERT(config);
@@ -332,6 +342,7 @@ static BOOL pf_config_load_input(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_security(wIniFile* ini, proxyConfig* config)
{
WINPR_ASSERT(config);
@@ -353,6 +364,7 @@ static BOOL pf_config_load_security(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_modules(wIniFile* ini, proxyConfig* config)
{
const char* modules_to_load = NULL;
@@ -369,6 +381,7 @@ static BOOL pf_config_load_modules(wIniFile* ini, proxyConfig* config)
return TRUE;
}
WINPR_ATTR_NODISCARD
static char* pf_config_decode_base64(const char* data, const char* name, size_t* pLength)
{
const char* headers[] = { "-----BEGIN PUBLIC KEY-----", "-----BEGIN RSA PUBLIC KEY-----",
@@ -439,6 +452,7 @@ static char* pf_config_decode_base64(const char* data, const char* name, size_t*
return decoded;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_load_certificates(wIniFile* ini, proxyConfig* config)
{
const char* tmp1 = NULL;
@@ -921,6 +935,7 @@ const char** pf_config_modules(const proxyConfig* config)
return cnv.cppc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_copy_string(char** dst, const char* src)
{
*dst = NULL;
@@ -929,6 +944,7 @@ static BOOL pf_config_copy_string(char** dst, const char* src)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_copy_string_n(char** dst, const char* src, size_t size)
{
*dst = NULL;
@@ -945,6 +961,7 @@ static BOOL pf_config_copy_string_n(char** dst, const char* src, size_t size)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_config_copy_string_list(char*** dst, size_t* size, char** src, size_t srcSize)
{
WINPR_ASSERT(dst);
@@ -1040,6 +1057,7 @@ static const char config_plugin_name[] = "config";
static const char config_plugin_desc[] =
"A plugin filtering according to proxy configuration file rules";
WINPR_ATTR_NODISCARD
static BOOL config_plugin_unload(proxyPlugin* plugin)
{
WINPR_ASSERT(plugin);
@@ -1054,6 +1072,7 @@ static BOOL config_plugin_unload(proxyPlugin* plugin)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_keyboard_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED proxyData* pdata,
void* param)
{
@@ -1079,6 +1098,7 @@ static BOOL config_plugin_keyboard_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_unicode_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED proxyData* pdata,
void* param)
{
@@ -1104,6 +1124,7 @@ static BOOL config_plugin_unicode_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED p
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_mouse_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED proxyData* pdata,
void* param)
{
@@ -1128,6 +1149,7 @@ static BOOL config_plugin_mouse_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED pro
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_mouse_ex_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED proxyData* pdata,
void* param)
{
@@ -1152,6 +1174,7 @@ static BOOL config_plugin_mouse_ex_event(proxyPlugin* plugin, WINPR_ATTR_UNUSED
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_client_channel_data(WINPR_ATTR_UNUSED proxyPlugin* plugin,
WINPR_ATTR_UNUSED proxyData* pdata, void* param)
{
@@ -1166,6 +1189,7 @@ static BOOL config_plugin_client_channel_data(WINPR_ATTR_UNUSED proxyPlugin* plu
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_server_channel_data(WINPR_ATTR_UNUSED proxyPlugin* plugin,
WINPR_ATTR_UNUSED proxyData* pdata, void* param)
{
@@ -1180,6 +1204,7 @@ static BOOL config_plugin_server_channel_data(WINPR_ATTR_UNUSED proxyPlugin* plu
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_dynamic_channel_create(proxyPlugin* plugin,
WINPR_ATTR_UNUSED proxyData* pdata, void* param)
{
@@ -1246,6 +1271,7 @@ static BOOL config_plugin_dynamic_channel_create(proxyPlugin* plugin,
return accept;
}
WINPR_ATTR_NODISCARD
static BOOL config_plugin_channel_create(proxyPlugin* plugin, WINPR_ATTR_UNUSED proxyData* pdata,
void* param)
{

View File

@@ -38,12 +38,14 @@
#define TAG PROXY_TAG("server")
WINPR_ATTR_NODISCARD
static UINT32 ChannelId_Hash(const void* key)
{
const UINT32* v = (const UINT32*)key;
return *v;
}
WINPR_ATTR_NODISCARD
static BOOL ChannelId_Compare(const void* pv1, const void* pv2)
{
const UINT32* v1 = pv1;
@@ -53,6 +55,7 @@ static BOOL ChannelId_Compare(const void* pv1, const void* pv2)
return (*v1 == *v2);
}
WINPR_ATTR_NODISCARD
static BOOL dyn_intercept(pServerContext* ps, const char* name)
{
if (strncmp(DRDYNVC_SVC_CHANNEL_NAME, name, sizeof(DRDYNVC_SVC_CHANNEL_NAME)) != 0)
@@ -129,6 +132,8 @@ static void HashStaticChannelContext_free(void* ptr)
/* Proxy context initialization callback */
static void client_to_proxy_context_free(freerdp_peer* client, rdpContext* ctx);
WINPR_ATTR_NODISCARD
static BOOL client_to_proxy_context_new(freerdp_peer* client, rdpContext* ctx)
{
wObject* obj = NULL;
@@ -222,6 +227,7 @@ BOOL pf_context_init_server_context(freerdp_peer* client)
return freerdp_peer_context_new(client);
}
WINPR_ATTR_NODISCARD
static BOOL pf_context_revert_str_settings(rdpSettings* dst, const rdpSettings* before, size_t nr,
const FreeRDP_Settings_Keys_String* ids)
{

View File

@@ -29,6 +29,7 @@
#include "proxy_modules.h"
WINPR_ATTR_NODISCARD
static BOOL pf_server_check_and_sync_input_state(pClientContext* pc)
{
WINPR_ASSERT(pc);
@@ -44,6 +45,7 @@ static BOOL pf_server_check_and_sync_input_state(pClientContext* pc)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_synchronize_event(rdpInput* input, UINT32 flags)
{
pServerContext* ps = NULL;
@@ -63,6 +65,7 @@ static BOOL pf_server_synchronize_event(rdpInput* input, UINT32 flags)
return pf_server_check_and_sync_input_state(pc);
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_keyboard_event(rdpInput* input, UINT16 flags, UINT8 code)
{
const proxyConfig* config = NULL;
@@ -96,6 +99,7 @@ static BOOL pf_server_keyboard_event(rdpInput* input, UINT16 flags, UINT8 code)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
const proxyConfig* config = NULL;
@@ -127,6 +131,7 @@ static BOOL pf_server_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
proxyMouseEventInfo event = { 0 };
@@ -161,6 +166,7 @@ static BOOL pf_server_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT1
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
const proxyConfig* config = NULL;

View File

@@ -48,6 +48,7 @@ struct proxy_module
wArrayList* handles;
};
WINPR_ATTR_NODISCARD
static const char* pf_modules_get_filter_type_string(PF_FILTER_TYPE result)
{
switch (result)
@@ -85,6 +86,7 @@ static const char* pf_modules_get_filter_type_string(PF_FILTER_TYPE result)
}
}
WINPR_ATTR_NODISCARD
static const char* pf_modules_get_hook_type_string(PF_HOOK_TYPE result)
{
switch (result)
@@ -130,6 +132,7 @@ static const char* pf_modules_get_hook_type_string(PF_HOOK_TYPE result)
}
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_proxy_ArrayList_ForEachFkt(void* data, size_t index, va_list ap)
{
proxyPlugin* plugin = (proxyPlugin*)data;
@@ -239,6 +242,7 @@ BOOL pf_modules_run_hook(proxyModule* module, PF_HOOK_TYPE type, proxyData* pdat
custom);
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_ArrayList_ForEachFkt(void* data, size_t index, va_list ap)
{
proxyPlugin* plugin = (proxyPlugin*)data;
@@ -340,6 +344,7 @@ BOOL pf_modules_run_filter(proxyModule* module, PF_FILTER_TYPE type, proxyData*
* @context: current session server's rdpContext instance.
* @info: pointer to per-session data.
*/
WINPR_ATTR_NODISCARD
static BOOL pf_modules_set_plugin_data(WINPR_ATTR_UNUSED proxyPluginsManager* mgr,
const char* plugin_name, proxyData* pdata, void* data)
{
@@ -371,6 +376,7 @@ static BOOL pf_modules_set_plugin_data(WINPR_ATTR_UNUSED proxyPluginsManager* mg
* if there's no data related to `plugin_name` in `context` (current session), a NULL will be
* returned.
*/
WINPR_ATTR_NODISCARD
static void* pf_modules_get_plugin_data(WINPR_ATTR_UNUSED proxyPluginsManager* mgr,
const char* plugin_name, proxyData* pdata)
{
@@ -393,6 +399,7 @@ static void pf_modules_abort_connect(WINPR_ATTR_UNUSED proxyPluginsManager* mgr,
proxy_data_abort_connect(pdata);
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_register_ArrayList_ForEachFkt(void* data, size_t index, va_list ap)
{
proxyPlugin* plugin = (proxyPlugin*)data;
@@ -408,6 +415,7 @@ static BOOL pf_modules_register_ArrayList_ForEachFkt(void* data, size_t index, v
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_register_plugin(proxyPluginsManager* mgr,
const proxyPlugin* plugin_to_register)
{
@@ -435,6 +443,7 @@ static BOOL pf_modules_register_plugin(proxyPluginsManager* mgr,
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_load_ArrayList_ForEachFkt(void* data, size_t index, va_list ap)
{
proxyPlugin* plugin = (proxyPlugin*)data;
@@ -461,6 +470,7 @@ BOOL pf_modules_is_plugin_loaded(proxyModule* module, const char* plugin_name)
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_print_ArrayList_ForEachFkt(void* data, size_t index, va_list ap)
{
proxyPlugin* plugin = (proxyPlugin*)data;
@@ -488,6 +498,7 @@ void pf_modules_list_loaded_plugins(proxyModule* module)
ArrayList_ForEach(module->plugins, pf_modules_print_ArrayList_ForEachFkt);
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_load_static_module(const char* module_name, proxyModule* module,
void* userdata)
{
@@ -527,6 +538,7 @@ error:
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_load_dynamic_module(const char* module_path, proxyModule* module,
void* userdata)
{
@@ -563,6 +575,7 @@ error:
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_try_load_dynamic_module(const char* module_path, proxyModule* module,
void* userdata, size_t count, const char* names[])
{
@@ -582,6 +595,7 @@ static BOOL pf_modules_try_load_dynamic_module(const char* module_path, proxyMod
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_modules_load_module(const char* module_path, const char* module_name,
proxyModule* module, void* userdata)
{
@@ -628,6 +642,8 @@ static void free_plugin(void* obj)
free(plugin);
}
WINPR_ATTR_MALLOC(free_plugin, 1)
WINPR_ATTR_NODISCARD
static void* new_plugin(const void* obj)
{
const proxyPlugin* src = obj;

View File

@@ -63,6 +63,7 @@ typedef struct
freerdp_peer* client;
} peer_thread_args;
WINPR_ATTR_NODISCARD
static BOOL pf_server_parse_target_from_routing_token(rdpContext* context, rdpSettings* settings,
FreeRDP_Settings_Keys_String targetID,
FreeRDP_Settings_Keys_UInt32 portID)
@@ -108,6 +109,7 @@ static BOOL pf_server_parse_target_from_routing_token(rdpContext* context, rdpSe
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_get_target_info(rdpContext* context, rdpSettings* settings,
const proxyConfig* config)
{
@@ -204,6 +206,7 @@ static BOOL pf_server_get_target_info(rdpContext* context, rdpSettings* settings
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_setup_channels(freerdp_peer* peer)
{
BOOL rc = FALSE;
@@ -283,6 +286,7 @@ fail:
* The server may start sending graphics output and receiving keyboard/mouse
* input after this callback returns.
*/
WINPR_ATTR_NODISCARD
static BOOL pf_server_post_connect(freerdp_peer* peer)
{
pServerContext* ps = NULL;
@@ -345,6 +349,7 @@ static BOOL pf_server_post_connect(freerdp_peer* peer)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_activate(freerdp_peer* peer)
{
pServerContext* ps = NULL;
@@ -369,6 +374,7 @@ static BOOL pf_server_activate(freerdp_peer* peer)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_logon(freerdp_peer* peer, const SEC_WINNT_AUTH_IDENTITY* identity,
BOOL automatic)
{
@@ -392,6 +398,7 @@ static BOOL pf_server_logon(freerdp_peer* peer, const SEC_WINNT_AUTH_IDENTITY* i
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_adjust_monitor_layout(WINPR_ATTR_UNUSED freerdp_peer* peer)
{
WINPR_ASSERT(peer);
@@ -399,6 +406,7 @@ static BOOL pf_server_adjust_monitor_layout(WINPR_ATTR_UNUSED freerdp_peer* peer
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 channelId,
const BYTE* data, size_t size, UINT32 flags,
size_t totalSize)
@@ -461,6 +469,7 @@ original_cb:
totalSize);
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
{
WINPR_ASSERT(peer);
@@ -572,6 +581,7 @@ static BOOL pf_server_initialize_peer_connection(freerdp_peer* peer)
*
* arg is a pointer to a freerdp_peer representing the client.
*/
WINPR_ATTR_NODISCARD
static DWORD WINAPI pf_server_handle_peer(LPVOID arg)
{
HANDLE eventHandles[MAXIMUM_WAIT_OBJECTS] = { 0 };
@@ -714,7 +724,7 @@ fail:
/* Abort the client. */
proxy_data_abort_connect(pdata);
pf_modules_run_hook(pdata->module, HOOK_TYPE_SERVER_SESSION_END, pdata, client);
(void)pf_modules_run_hook(pdata->module, HOOK_TYPE_SERVER_SESSION_END, pdata, client);
PROXY_LOG_INFO(TAG, ps, "freeing server's channels");
@@ -752,6 +762,7 @@ out_free_peer:
return 0;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_start_peer(freerdp_peer* client)
{
HANDLE hThread = NULL;
@@ -787,6 +798,7 @@ static BOOL pf_server_start_peer(freerdp_peer* client)
return ResumeThread(hThread) != (DWORD)-1;
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_peer_accepted(freerdp_listener* listener, freerdp_peer* client)
{
WINPR_ASSERT(listener);
@@ -910,6 +922,7 @@ fail:
return FALSE;
}
WINPR_ATTR_NODISCARD
static BOOL are_all_required_modules_loaded(proxyModule* module, const proxyConfig* config)
{
for (size_t i = 0; i < pf_config_required_plugins_count(config); i++)

View File

@@ -35,6 +35,7 @@
#define TAG PROXY_TAG("update")
WINPR_ATTR_NODISCARD
static BOOL pf_server_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas)
{
pServerContext* ps = (pServerContext*)context;
@@ -48,6 +49,7 @@ static BOOL pf_server_refresh_rect(rdpContext* context, BYTE count, const RECTAN
return pc->update->RefreshRect(pc, count, areas);
}
WINPR_ATTR_NODISCARD
static BOOL pf_server_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area)
{
pServerContext* ps = (pServerContext*)context;
@@ -67,6 +69,7 @@ static BOOL pf_server_suppress_output(rdpContext* context, BYTE allow, const REC
* This function is called whenever a new frame starts.
* It can be used to reset invalidated areas.
*/
WINPR_ATTR_NODISCARD
static BOOL pf_client_begin_paint(rdpContext* context)
{
pClientContext* pc = (pClientContext*)context;
@@ -88,6 +91,7 @@ static BOOL pf_client_begin_paint(rdpContext* context)
* frame. Read out the changed areas and blit them to your output device.
* The image buffer will have the format specified by gdi_init
*/
WINPR_ATTR_NODISCARD
static BOOL pf_client_end_paint(rdpContext* context)
{
pClientContext* pc = (pClientContext*)context;
@@ -113,6 +117,7 @@ static BOOL pf_client_end_paint(rdpContext* context)
return TRUE;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bitmap)
{
pClientContext* pc = (pClientContext*)context;
@@ -129,6 +134,7 @@ static BOOL pf_client_bitmap_update(rdpContext* context, const BITMAP_UPDATE* bi
return ps->update->BitmapUpdate(ps, bitmap);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_desktop_resize(rdpContext* context)
{
pClientContext* pc = (pClientContext*)context;
@@ -151,6 +157,7 @@ static BOOL pf_client_desktop_resize(rdpContext* context)
return ps->update->DesktopResize(ps);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_remote_monitors(rdpContext* context, UINT32 count,
const MONITOR_DEF* monitors)
{
@@ -166,6 +173,7 @@ static BOOL pf_client_remote_monitors(rdpContext* context, UINT32 count,
return freerdp_display_send_monitor_layout(ps, count, monitors);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_system(rdpContext* context,
const POINTER_SYSTEM_UPDATE* pointer_system)
{
@@ -184,6 +192,7 @@ static BOOL pf_client_send_pointer_system(rdpContext* context,
return ps->update->pointer->PointerSystem(ps, pointer_system);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_position(rdpContext* context,
const POINTER_POSITION_UPDATE* pointerPosition)
{
@@ -202,6 +211,7 @@ static BOOL pf_client_send_pointer_position(rdpContext* context,
return ps->update->pointer->PointerPosition(ps, pointerPosition);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_color(rdpContext* context,
const POINTER_COLOR_UPDATE* pointer_color)
{
@@ -220,6 +230,7 @@ static BOOL pf_client_send_pointer_color(rdpContext* context,
return ps->update->pointer->PointerColor(ps, pointer_color);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_large(rdpContext* context,
const POINTER_LARGE_UPDATE* pointer_large)
{
@@ -238,6 +249,7 @@ static BOOL pf_client_send_pointer_large(rdpContext* context,
return ps->update->pointer->PointerLarge(ps, pointer_large);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_new(rdpContext* context, const POINTER_NEW_UPDATE* pointer_new)
{
pClientContext* pc = (pClientContext*)context;
@@ -255,6 +267,7 @@ static BOOL pf_client_send_pointer_new(rdpContext* context, const POINTER_NEW_UP
return ps->update->pointer->PointerNew(ps, pointer_new);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_send_pointer_cached(rdpContext* context,
const POINTER_CACHED_UPDATE* pointer_cached)
{
@@ -273,6 +286,7 @@ static BOOL pf_client_send_pointer_cached(rdpContext* context,
return ps->update->pointer->PointerCached(ps, pointer_cached);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_save_session_info(rdpContext* context, UINT32 type, void* data)
{
logon_info* logonInfo = NULL;
@@ -307,6 +321,7 @@ static BOOL pf_client_save_session_info(rdpContext* context, UINT32 type, void*
return ps->update->SaveSessionInfo(ps, type, data);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_server_status_info(rdpContext* context, UINT32 status)
{
pClientContext* pc = (pClientContext*)context;
@@ -324,6 +339,7 @@ static BOOL pf_client_server_status_info(rdpContext* context, UINT32 status)
return ps->update->ServerStatusInfo(ps, status);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_set_keyboard_indicators(rdpContext* context, UINT16 led_flags)
{
pClientContext* pc = (pClientContext*)context;
@@ -341,6 +357,7 @@ static BOOL pf_client_set_keyboard_indicators(rdpContext* context, UINT16 led_fl
return ps->update->SetKeyboardIndicators(ps, led_flags);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_set_keyboard_ime_status(rdpContext* context, UINT16 imeId, UINT32 imeState,
UINT32 imeConvMode)
{
@@ -359,6 +376,7 @@ static BOOL pf_client_set_keyboard_ime_status(rdpContext* context, UINT16 imeId,
return ps->update->SetKeyboardImeStatus(ps, imeId, imeState, imeConvMode);
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_window_create(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const WINDOW_STATE_ORDER* windowState)
{
@@ -382,6 +400,7 @@ static BOOL pf_client_window_create(rdpContext* context, const WINDOW_ORDER_INFO
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_window_update(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const WINDOW_STATE_ORDER* windowState)
{
@@ -405,6 +424,7 @@ static BOOL pf_client_window_update(rdpContext* context, const WINDOW_ORDER_INFO
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_window_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const WINDOW_ICON_ORDER* windowIcon)
{
@@ -428,6 +448,7 @@ static BOOL pf_client_window_icon(rdpContext* context, const WINDOW_ORDER_INFO*
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_window_cached_icon(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const WINDOW_CACHED_ICON_ORDER* windowCachedIcon)
{
@@ -451,6 +472,7 @@ static BOOL pf_client_window_cached_icon(rdpContext* context, const WINDOW_ORDER
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_window_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo)
{
BOOL rc = 0;
@@ -473,6 +495,7 @@ static BOOL pf_client_window_delete(rdpContext* context, const WINDOW_ORDER_INFO
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_notify_icon_create(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
@@ -496,6 +519,7 @@ static BOOL pf_client_notify_icon_create(rdpContext* context, const WINDOW_ORDER
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_notify_icon_update(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const NOTIFY_ICON_STATE_ORDER* notifyIconState)
{
@@ -519,6 +543,7 @@ static BOOL pf_client_notify_icon_update(rdpContext* context, const WINDOW_ORDER
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_notify_icon_delete(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo)
{
BOOL rc = 0;
@@ -542,6 +567,7 @@ static BOOL pf_client_notify_icon_delete(rdpContext* context, const WINDOW_ORDER
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo,
const MONITORED_DESKTOP_ORDER* monitoredDesktop)
{
@@ -565,6 +591,7 @@ static BOOL pf_client_monitored_desktop(rdpContext* context, const WINDOW_ORDER_
return rc;
}
WINPR_ATTR_NODISCARD
static BOOL pf_client_non_monitored_desktop(rdpContext* context, const WINDOW_ORDER_INFO* orderInfo)
{
BOOL rc = 0;

View File

@@ -35,9 +35,10 @@
* e.g. proxy client and server are termination points and data passed
* between.
*/
pf_utils_channel_mode pf_utils_get_channel_mode(const proxyConfig* config, const char* name);
const char* pf_utils_channel_mode_string(pf_utils_channel_mode mode);
WINPR_ATTR_NODISCARD pf_utils_channel_mode pf_utils_get_channel_mode(const proxyConfig* config,
const char* name);
WINPR_ATTR_NODISCARD const char* pf_utils_channel_mode_string(pf_utils_channel_mode mode);
BOOL pf_utils_is_passthrough(const proxyConfig* config);
WINPR_ATTR_NODISCARD BOOL pf_utils_is_passthrough(const proxyConfig* config);
#endif /* FREERDP_SERVER_PROXY_PFUTILS_H */

View File

@@ -74,6 +74,10 @@ extern "C"
{
#endif
void pf_modules_free(proxyModule* module);
WINPR_ATTR_MALLOC(pf_modules_free, 1)
WINPR_ATTR_NODISCARD
proxyModule* pf_modules_new(const char* root_dir, const char** modules, size_t count);
/**
@@ -81,18 +85,20 @@ extern "C"
* @param ep A module entry point function, must NOT be NULL
* @return TRUE for success, FALSE otherwise
*/
BOOL pf_modules_add(proxyModule* module, proxyModuleEntryPoint ep, void* userdata);
WINPR_ATTR_NODISCARD BOOL pf_modules_add(proxyModule* module, proxyModuleEntryPoint ep,
void* userdata);
BOOL pf_modules_is_plugin_loaded(proxyModule* module, const char* plugin_name);
WINPR_ATTR_NODISCARD BOOL pf_modules_is_plugin_loaded(proxyModule* module,
const char* plugin_name);
void pf_modules_list_loaded_plugins(proxyModule* module);
BOOL pf_modules_run_filter(proxyModule* module, PF_FILTER_TYPE type, proxyData* pdata,
void* param);
WINPR_ATTR_NODISCARD BOOL pf_modules_run_filter(proxyModule* module, PF_FILTER_TYPE type,
proxyData* pdata, void* param);
WINPR_ATTR_NODISCARD
BOOL pf_modules_run_hook(proxyModule* module, PF_HOOK_TYPE type, proxyData* pdata,
void* custom);
void pf_modules_free(proxyModule* module);
#ifdef __cplusplus
}
#endif