本文整理汇总了C++中CHANNEL_OPEN_DATA::pChannelOpenEventProcEx方法的典型用法代码示例。如果您正苦于以下问题:C++ CHANNEL_OPEN_DATA::pChannelOpenEventProcEx方法的具体用法?C++ CHANNEL_OPEN_DATA::pChannelOpenEventProcEx怎么用?C++ CHANNEL_OPEN_DATA::pChannelOpenEventProcEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHANNEL_OPEN_DATA
的用法示例。
在下文中一共展示了CHANNEL_OPEN_DATA::pChannelOpenEventProcEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: freerdp_channels_data
int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data,
int dataSize, int flags, int totalSize)
{
UINT32 index;
rdpMcs* mcs;
rdpChannels* channels;
rdpMcsChannel* channel = NULL;
CHANNEL_OPEN_DATA* pChannelOpenData;
mcs = instance->context->rdp->mcs;
channels = instance->context->channels;
if (!channels || !mcs)
{
return 1;
}
for (index = 0; index < mcs->channelCount; index++)
{
if (mcs->channels[index].ChannelId == channelId)
{
channel = &mcs->channels[index];
break;
}
}
if (!channel)
{
return 1;
}
pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, channel->Name);
if (!pChannelOpenData)
{
return 1;
}
if (pChannelOpenData->pChannelOpenEventProc)
{
pChannelOpenData->pChannelOpenEventProc(
pChannelOpenData->OpenHandle, CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, totalSize, flags);
}
else if (pChannelOpenData->pChannelOpenEventProcEx)
{
pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam,
pChannelOpenData->OpenHandle, CHANNEL_EVENT_DATA_RECEIVED, data, dataSize, totalSize, flags);
}
return 0;
}
示例2: freerdp_channels_process_sync
/**
* called only from main thread
*/
static int freerdp_channels_process_sync(rdpChannels* channels,
freerdp* instance)
{
int status = TRUE;
wMessage message;
rdpMcsChannel* channel;
CHANNEL_OPEN_EVENT* item;
CHANNEL_OPEN_DATA* pChannelOpenData;
while (MessageQueue_Peek(channels->queue, &message, TRUE))
{
if (message.id == WMQ_QUIT)
{
status = FALSE;
break;
}
if (message.id == 0)
{
item = (CHANNEL_OPEN_EVENT*) message.wParam;
if (!item)
break;
pChannelOpenData = item->pChannelOpenData;
channel = freerdp_channels_find_channel_by_name(instance->context->rdp, pChannelOpenData->name);
if (channel)
instance->SendChannelData(instance, channel->ChannelId, item->Data, item->DataLength);
if (pChannelOpenData->pChannelOpenEventProc)
{
pChannelOpenData->pChannelOpenEventProc(
pChannelOpenData->OpenHandle, CHANNEL_EVENT_WRITE_COMPLETE, item->UserData, item->DataLength,
item->DataLength, 0);
}
else if (pChannelOpenData->pChannelOpenEventProcEx)
{
pChannelOpenData->pChannelOpenEventProcEx(pChannelOpenData->lpUserParam,
pChannelOpenData->OpenHandle, CHANNEL_EVENT_WRITE_COMPLETE, item->UserData, item->DataLength,
item->DataLength, 0);
}
free(item);
}
}
return status;
}