Removed function pointer casts for shadow.
authorArmin Novak <armin.novak@thincast.com>
Tue, 3 Mar 2020 12:02:22 +0000 (13:02 +0100)
committerArmin Novak <armin.novak@thincast.com>
Tue, 3 Mar 2020 12:02:22 +0000 (13:02 +0100)
server/shadow/shadow_client.c

index cba1042..61bd747 100644 (file)
@@ -423,8 +423,9 @@ static BOOL shadow_client_refresh_request(rdpShadowClient* client)
        return MessageQueue_Dispatch(MsgPipe->In, &message);
 }
 
-static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, RECTANGLE_16* areas)
+static BOOL shadow_client_refresh_rect(rdpContext* context, BYTE count, const RECTANGLE_16* areas)
 {
+       rdpShadowClient* client = (rdpShadowClient*)context;
        RECTANGLE_16* rects;
 
        /* It is invalid if we have area count but no actual area */
@@ -452,8 +453,9 @@ static BOOL shadow_client_refresh_rect(rdpShadowClient* client, BYTE count, RECT
        return shadow_client_refresh_request(client);
 }
 
-static BOOL shadow_client_suppress_output(rdpShadowClient* client, BYTE allow, RECTANGLE_16* area)
+static BOOL shadow_client_suppress_output(rdpContext* context, BYTE allow, const RECTANGLE_16* area)
 {
+       rdpShadowClient* client = (rdpShadowClient*)context;
        RECTANGLE_16 region;
        client->suppressOutput = allow ? FALSE : TRUE;
 
@@ -497,7 +499,7 @@ static BOOL shadow_client_activate(freerdp_peer* peer)
        }
 
        /* Update full screen in next update */
-       return shadow_client_refresh_rect(client, 0, NULL);
+       return shadow_client_refresh_rect(&client->context, 0, NULL);
 }
 
 static BOOL shadow_client_logon(freerdp_peer* peer, SEC_WINNT_AUTH_IDENTITY* identity,
@@ -583,8 +585,9 @@ static INLINE void shadow_client_common_frame_acknowledge(rdpShadowClient* clien
        client->encoder->lastAckframeId = frameId;
 }
 
-static BOOL shadow_client_surface_frame_acknowledge(rdpShadowClient* client, UINT32 frameId)
+static BOOL shadow_client_surface_frame_acknowledge(rdpContext* context, UINT32 frameId)
 {
+       rdpShadowClient* client = (rdpShadowClient*)context;
        shadow_client_common_frame_acknowledge(client, frameId);
        /*
         * Reset queueDepth for legacy none RDPGFX acknowledge
@@ -689,7 +692,7 @@ static UINT shadow_client_rdpgfx_caps_advertise(RdpgfxServerContext* context,
 #endif
 
        /* Request full screen update for new gfx channel */
-       if (!shadow_client_refresh_rect((rdpShadowClient*)context->custom, 0, NULL))
+       if (!shadow_client_refresh_rect(&client->context, 0, NULL))
                return rc;
 
        if (shadow_client_caps_test_version(context, h264, capsAdvertise->capsSets,
@@ -1646,10 +1649,9 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
        peer->Logon = shadow_client_logon;
        shadow_input_register_callbacks(peer->input);
        peer->Initialize(peer);
-       peer->update->RefreshRect = (pRefreshRect)shadow_client_refresh_rect;
-       peer->update->SuppressOutput = (pSuppressOutput)shadow_client_suppress_output;
-       peer->update->SurfaceFrameAcknowledge =
-           (pSurfaceFrameAcknowledge)shadow_client_surface_frame_acknowledge;
+       peer->update->RefreshRect = shadow_client_refresh_rect;
+       peer->update->SuppressOutput = shadow_client_suppress_output;
+       peer->update->SurfaceFrameAcknowledge = shadow_client_surface_frame_acknowledge;
 
        if ((!client->vcm) || (!subsystem->updateEvent))
                goto out;