mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[channel,server] fix unguarded use of functions
If functions of channel_<name>_server are used guard them so the code compiles if the channel is not compiled in.
This commit is contained in:
@@ -41,26 +41,16 @@ UINT shadow_client_channels_post_connect(rdpShadowClient* client)
|
||||
|
||||
shadow_client_audin_init(client);
|
||||
|
||||
if (freerdp_settings_get_bool(client->context.settings, FreeRDP_SupportGraphicsPipeline))
|
||||
{
|
||||
shadow_client_rdpgfx_init(client);
|
||||
}
|
||||
shadow_client_rdpgfx_init(client);
|
||||
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
void shadow_client_channels_free(rdpShadowClient* client)
|
||||
{
|
||||
if (freerdp_settings_get_bool(client->context.settings, FreeRDP_SupportGraphicsPipeline))
|
||||
{
|
||||
shadow_client_rdpgfx_uninit(client);
|
||||
}
|
||||
|
||||
shadow_client_rdpgfx_uninit(client);
|
||||
shadow_client_audin_uninit(client);
|
||||
|
||||
shadow_client_rdpsnd_uninit(client);
|
||||
|
||||
shadow_client_remdesk_uninit(client);
|
||||
|
||||
shadow_client_encomsp_uninit(client);
|
||||
}
|
||||
|
||||
@@ -2196,10 +2196,12 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
events[nCount++] = ChannelEvent;
|
||||
events[nCount++] = MessageQueue_Event(MsgQueue);
|
||||
|
||||
#if defined(CHANNEL_RDPGFX_SERVER)
|
||||
HANDLE gfxevent = rdpgfx_server_get_event_handle(client->rdpgfx);
|
||||
|
||||
if (gfxevent)
|
||||
events[nCount++] = gfxevent;
|
||||
#endif
|
||||
|
||||
status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
|
||||
|
||||
@@ -2329,6 +2331,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CHANNEL_RDPGFX_SERVER)
|
||||
if (gfxevent)
|
||||
{
|
||||
if (WaitForSingleObject(gfxevent, 0) == WAIT_OBJECT_0)
|
||||
@@ -2336,6 +2339,7 @@ static DWORD WINAPI shadow_client_thread(LPVOID arg)
|
||||
rdpgfx_server_handle_messages(client->rdpgfx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (WaitForSingleObject(MessageQueue_Event(MsgQueue), 0) == WAIT_OBJECT_0)
|
||||
{
|
||||
|
||||
@@ -29,11 +29,13 @@ int shadow_client_rdpgfx_init(rdpShadowClient* client)
|
||||
{
|
||||
WINPR_ASSERT(client);
|
||||
|
||||
if (!freerdp_settings_get_bool(client->context.settings, FreeRDP_SupportGraphicsPipeline))
|
||||
return 1;
|
||||
|
||||
#if defined(CHANNEL_RDPGFX_SERVER)
|
||||
RdpgfxServerContext* rdpgfx = client->rdpgfx = rdpgfx_server_context_new(client->vcm);
|
||||
if (!rdpgfx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
rdpgfx->rdpcontext = &client->context;
|
||||
|
||||
@@ -41,15 +43,19 @@ int shadow_client_rdpgfx_init(rdpShadowClient* client)
|
||||
|
||||
if (!IFCALLRESULT(CHANNEL_RC_OK, rdpgfx->Initialize, rdpgfx, TRUE))
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void shadow_client_rdpgfx_uninit(rdpShadowClient* client)
|
||||
{
|
||||
WINPR_ASSERT(client);
|
||||
if (client->rdpgfx)
|
||||
{
|
||||
#if defined(CHANNEL_RDPGFX_SERVER)
|
||||
rdpgfx_server_context_free(client->rdpgfx);
|
||||
#endif
|
||||
client->rdpgfx = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user