Fixed arguments for peer->ReceiveChannelData
authorArmin Novak <armin.novak@thincast.com>
Wed, 4 Mar 2020 13:52:19 +0000 (14:52 +0100)
committerArmin Novak <armin.novak@thincast.com>
Wed, 4 Mar 2020 13:52:19 +0000 (14:52 +0100)
include/freerdp/peer.h
libfreerdp/core/server.c
server/proxy/pf_server.c

index e1a76a0..ac6ea8c 100644 (file)
@@ -54,7 +54,7 @@ typedef BOOL (*psPeerClientCapabilities)(freerdp_peer* peer);
 typedef int (*psPeerSendChannelData)(freerdp_peer* peer, UINT16 channelId, const BYTE* data,
                                      int size);
 typedef int (*psPeerReceiveChannelData)(freerdp_peer* peer, UINT16 channelId, const BYTE* data,
-                                        int size, int flags, int totalSize);
+                                        size_t size, UINT32 flags, size_t totalSize);
 
 typedef HANDLE (*psPeerVirtualChannelOpen)(freerdp_peer* peer, const char* name, UINT32 flags);
 typedef BOOL (*psPeerVirtualChannelClose)(freerdp_peer* peer, HANDLE hChannel);
index 2b438dc..46573fc 100644 (file)
@@ -359,13 +359,13 @@ static BOOL wts_write_drdynvc_create_request(wStream* s, UINT32 ChannelId, const
 }
 
 static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, const BYTE* data,
-                                  int s, int flags, int t)
+                                  size_t s, UINT32 flags, size_t t)
 {
        BOOL ret = TRUE;
        const size_t size = (size_t)s;
        const size_t totalSize = (size_t)t;
-       if ((s < 0) || (t < 0))
-               return FALSE;
+
+       WINPR_UNUSED(channelId);
 
        if (flags & CHANNEL_FLAG_FIRST)
        {
@@ -400,8 +400,8 @@ static BOOL WTSProcessChannelData(rdpPeerChannel* channel, UINT16 channelId, con
        return ret;
 }
 
-static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, const BYTE* data, int size,
-                                 int flags, int totalSize)
+static int WTSReceiveChannelData(freerdp_peer* client, UINT16 channelId, const BYTE* data,
+                                 size_t size, UINT32 flags, size_t totalSize)
 {
        UINT32 i;
        BOOL status = FALSE;
index edfa381..b044971 100644 (file)
@@ -199,7 +199,8 @@ static BOOL pf_server_adjust_monitor_layout(freerdp_peer* peer)
 }
 
 static int pf_server_receive_channel_data_hook(freerdp_peer* peer, UINT16 channelId,
-                                               const BYTE* data, int size, int flags, int totalSize)
+                                               const BYTE* data, size_t size, UINT32 flags,
+                                               size_t totalSize)
 {
        pServerContext* ps = (pServerContext*)peer->context;
        pClientContext* pc = ps->pdata->pc;