本文整理汇总了C++中CHANNEL_OPEN_DATA::pChannelOpenEventProc方法的典型用法代码示例。如果您正苦于以下问题:C++ CHANNEL_OPEN_DATA::pChannelOpenEventProc方法的具体用法?C++ CHANNEL_OPEN_DATA::pChannelOpenEventProc怎么用?C++ CHANNEL_OPEN_DATA::pChannelOpenEventProc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHANNEL_OPEN_DATA
的用法示例。
在下文中一共展示了CHANNEL_OPEN_DATA::pChannelOpenEventProc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: freerdp_channels_process_sync
/**
* called only from main thread
*/
static int freerdp_channels_process_sync(rdpChannels* channels, freerdp* instance)
{
int rc = TRUE;
wMessage message;
wMessage* event;
rdpChannel* channel;
CHANNEL_OPEN_EVENT* item;
CHANNEL_OPEN_DATA* pChannelOpenData;
while (MessageQueue_Peek(channels->MsgPipe->Out, &message, TRUE))
{
if (message.id == WMQ_QUIT)
{
rc = FALSE;
break;
}
if (message.id == 0)
{
item = (CHANNEL_OPEN_EVENT*) message.wParam;
if (!item)
break;
pChannelOpenData = &channels->openDataList[item->Index];
channel = freerdp_channels_find_channel_by_name(channels, instance->settings,
pChannelOpenData->name, &item->Index);
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);
}
free(item);
}
else if (message.id == 1)
{
event = (wMessage*) message.wParam;
/**
* Ignore for now, the same event is being pushed on the In queue,
* and we're pushing it on the Out queue just to wake other threads
*/
}
}
return rc;
}
示例2: 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;
}
示例3: 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;
}
示例4: freerdp_channels_send_event
/**
* Send a plugin-defined event to the plugin.
* called only from main thread
* @param channels the channel manager instance
* @param event an event object created by freerdp_event_new()
*/
FREERDP_API int freerdp_channels_send_event(rdpChannels* channels, wMessage* event)
{
const char* name = NULL;
CHANNEL_OPEN_DATA* pChannelOpenData;
switch (GetMessageClass(event->id))
{
case DebugChannel_Class:
name = "rdpdbg";
break;
case CliprdrChannel_Class:
name = "cliprdr";
break;
case TsmfChannel_Class:
name = "tsmf";
break;
case RailChannel_Class:
name = "rail";
break;
}
if (!name)
{
DEBUG_CHANNELS("unknown event_class %d", GetMessageClass(event->id));
freerdp_event_free(event);
return 1;
}
pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, name);
if (!pChannelOpenData)
{
DEBUG_CHANNELS("could not find channel name %s", name);
freerdp_event_free(event);
return 1;
}
if (pChannelOpenData->pChannelOpenEventProc)
{
pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle, CHANNEL_EVENT_USER,
event, sizeof(wMessage), sizeof(wMessage), 0);
}
return 0;
}
示例5: freerdp_channels_data
/**
* data coming from the server to the client
* called only from main thread
*/
int freerdp_channels_data(freerdp* instance, int channel_id, void* data, int data_size, int flags, int total_size)
{
int index;
rdpChannel* channel;
rdpChannels* channels;
CHANNEL_OPEN_DATA* pChannelOpenData;
channels = freerdp_channels_find_by_instance(instance);
if (!channels)
{
DEBUG_CHANNELS("could not find channel manager");
return 1;
}
channel = freerdp_channels_find_channel_by_id(channels, instance->settings, channel_id, &index);
if (!channel)
{
DEBUG_CHANNELS("could not find channel id");
return 1;
}
pChannelOpenData = freerdp_channels_find_channel_open_data_by_name(channels, channel->Name);
if (!pChannelOpenData)
{
DEBUG_CHANNELS("could not find channel name");
return 1;
}
if (pChannelOpenData->pChannelOpenEventProc)
{
pChannelOpenData->pChannelOpenEventProc(pChannelOpenData->OpenHandle,
CHANNEL_EVENT_DATA_RECEIVED, data, data_size, total_size, flags);
}
return 0;
}