Merge pull request #6501 from kubistika/server_wts_api_extended

server: add WTSVirtualChannelManagerCheckFileDescriptorEx API
This commit is contained in:
Martin Fleisz 2020-10-14 11:14:00 +02:00 committed by GitHub
commit 0eec7c0e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 8 deletions

View File

@ -59,6 +59,7 @@ extern "C"
FREERDP_API void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds,
int* fds_count);
FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer);
FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptorEx(HANDLE hServer, BOOL autoOpen);
FREERDP_API HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer);
FREERDP_API BOOL WTSVirtualChannelManagerIsChannelJoined(HANDLE hServer, const char* name);
FREERDP_API BYTE WTSVirtualChannelManagerGetDrdynvcState(HANDLE hServer);

View File

@ -150,7 +150,16 @@ struct _rdpgfx_client_context
PROFILER_DEFINE(SurfaceProfiler)
};
FREERDP_API RdpgfxClientContext* rdpgfx_client_context_new(rdpSettings* settings);
FREERDP_API void rdpgfx_client_context_free(RdpgfxClientContext* context);
#ifdef __cplusplus
extern "C"
{
#endif
FREERDP_API RdpgfxClientContext* rdpgfx_client_context_new(rdpSettings* settings);
FREERDP_API void rdpgfx_client_context_free(RdpgfxClientContext* context);
#ifdef __cplusplus
}
#endif
#endif /* FREERDP_CHANNEL_RDPGFX_CLIENT_RDPGFX_H */

View File

@ -450,16 +450,16 @@ void WTSVirtualChannelManagerGetFileDescriptor(HANDLE hServer, void** fds, int*
#endif
}
BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer)
static BOOL WTSVirtualChannelManagerOpen(WTSVirtualChannelManager* vcm)
{
wMessage message;
BOOL status = TRUE;
rdpPeerChannel* channel;
UINT32 dynvc_caps;
WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer;
if (!vcm)
return FALSE;
if ((vcm->drdynvc_state == DRDYNVC_STATE_NONE) && vcm->client->activated)
{
rdpPeerChannel* channel;
UINT32 dynvc_caps;
/* Initialize drdynvc channel once and only once. */
vcm->drdynvc_state = DRDYNVC_STATE_INITIALIZED;
channel =
@ -476,6 +476,26 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer)
}
}
return TRUE;
}
BOOL WTSVirtualChannelManagerCheckFileDescriptorEx(HANDLE hServer, BOOL autoOpen)
{
wMessage message;
BOOL status = TRUE;
WTSVirtualChannelManager* vcm;
if (!hServer || hServer == INVALID_HANDLE_VALUE)
return FALSE;
vcm = (WTSVirtualChannelManager*)hServer;
if (autoOpen)
{
if (!WTSVirtualChannelManagerOpen(vcm))
return FALSE;
}
while (MessageQueue_Peek(vcm->queue, &message, TRUE))
{
BYTE* buffer;
@ -499,6 +519,11 @@ BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer)
return status;
}
BOOL WTSVirtualChannelManagerCheckFileDescriptor(HANDLE hServer)
{
return WTSVirtualChannelManagerCheckFileDescriptorEx(hServer, TRUE);
}
HANDLE WTSVirtualChannelManagerGetEventHandle(HANDLE hServer)
{
WTSVirtualChannelManager* vcm = (WTSVirtualChannelManager*)hServer;