当前位置: 首页>>代码示例>>C++>>正文


C++ CHANNEL_OPEN_DATA::pChannelOpenEventProcEx方法代码示例

本文整理汇总了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;
}
开发者ID:kdienes,项目名称:FreeRDP,代码行数:50,代码来源:client.c

示例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;
}
开发者ID:kdienes,项目名称:FreeRDP,代码行数:52,代码来源:client.c


注:本文中的CHANNEL_OPEN_DATA::pChannelOpenEventProcEx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。