Listen to CHANNEL_EVENT_WRITE_CANCELLED and emit if queue is cleared.
This commit is contained in:
parent
1b78b59926
commit
1bcb799560
@ -872,6 +872,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_open_event_ex(LPVOID lpUserParam,
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -1271,6 +1271,7 @@ static void VCAPITYPE drdynvc_virtual_channel_open_event_ex(LPVOID lpUserParam,
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -1002,6 +1002,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam,
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -705,6 +705,7 @@ static VOID VCAPITYPE rail_virtual_channel_open_event_ex(LPVOID lpUserParam, DWO
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -232,6 +232,9 @@ static void VCAPITYPE VirtualChannelOpenEventEx(LPVOID lpUserParam, DWORD openHa
|
||||
dataReceived(plugin, pData, dataLength, totalLength, dataFlags);
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
free(lpUserParam);
|
||||
break;
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
SetEvent(plugin->writeComplete);
|
||||
free(lpUserParam);
|
||||
|
@ -1587,6 +1587,7 @@ static VOID VCAPITYPE rdpdr_virtual_channel_open_event_ex(LPVOID lpUserParam, DW
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -990,6 +990,7 @@ static VOID VCAPITYPE rdpsnd_virtual_channel_open_event_ex(LPVOID lpUserParam, D
|
||||
|
||||
break;
|
||||
|
||||
case CHANNEL_EVENT_WRITE_CANCELLED:
|
||||
case CHANNEL_EVENT_WRITE_COMPLETE:
|
||||
{
|
||||
wStream* s = (wStream*)lpUserParam;
|
||||
|
@ -38,7 +38,7 @@ static volatile LONG g_OpenHandleSeq =
|
||||
1; /* use global counter to ensure uniqueness across channel manager instances */
|
||||
static WINPR_TLS rdpChannelHandles g_ChannelHandles = { NULL, NULL };
|
||||
|
||||
static BOOL freerdp_channels_process_message_free(wMessage* message);
|
||||
static BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type);
|
||||
|
||||
static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name(
|
||||
rdpChannels* channels, const char* name)
|
||||
@ -86,7 +86,7 @@ static void channel_queue_message_free(wMessage* msg)
|
||||
return;
|
||||
|
||||
ev = (CHANNEL_OPEN_EVENT*)msg->wParam;
|
||||
freerdp_channels_process_message_free(msg);
|
||||
freerdp_channels_process_message_free(msg, CHANNEL_EVENT_WRITE_CANCELLED);
|
||||
free(ev);
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data,
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL freerdp_channels_process_message_free(wMessage* message)
|
||||
BOOL freerdp_channels_process_message_free(wMessage* message, DWORD type)
|
||||
{
|
||||
if (message->id == WMQ_QUIT)
|
||||
{
|
||||
@ -462,14 +462,14 @@ BOOL freerdp_channels_process_message_free(wMessage* message)
|
||||
if (pChannelOpenData->pChannelOpenEventProc)
|
||||
{
|
||||
pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle,
|
||||
CHANNEL_EVENT_WRITE_COMPLETE, item->UserData,
|
||||
type, item->UserData,
|
||||
item->DataLength, item->DataLength, 0);
|
||||
}
|
||||
else if (pChannelOpenData->pChannelOpenEventProcEx)
|
||||
{
|
||||
pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam,
|
||||
pChannelOpenData->OpenHandle,
|
||||
CHANNEL_EVENT_WRITE_COMPLETE, item->UserData,
|
||||
type, item->UserData,
|
||||
item->DataLength, item->DataLength, 0);
|
||||
}
|
||||
}
|
||||
@ -501,7 +501,7 @@ static BOOL freerdp_channels_process_message(freerdp* instance, wMessage* messag
|
||||
instance->SendChannelData(instance, channel->ChannelId, item->Data, item->DataLength);
|
||||
}
|
||||
|
||||
if (!freerdp_channels_process_message_free(message))
|
||||
if (!freerdp_channels_process_message_free(message, CHANNEL_EVENT_WRITE_COMPLETE))
|
||||
return FALSE;
|
||||
|
||||
IFCALL(message->Free, message);
|
||||
|
Loading…
Reference in New Issue
Block a user