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


C++ Stream_Write_UINT8函数代码示例

本文整理汇总了C++中Stream_Write_UINT8函数的典型用法代码示例。如果您正苦于以下问题:C++ Stream_Write_UINT8函数的具体用法?C++ Stream_Write_UINT8怎么用?C++ Stream_Write_UINT8使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Stream_Write_UINT8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: autodetect_send_netchar_result

static BOOL autodetect_send_netchar_result(rdpContext* context, UINT16 sequenceNumber)
{
	wStream* s;

	s = rdp_message_channel_pdu_init(context->rdp);

	if (!s)
		return FALSE;

	WLog_DBG(AUTODETECT_TAG, "sending Bandwidth Network Characteristics Result PDU");

	if (context->rdp->autodetect->netCharBandwidth > 0)
	{
		Stream_Write_UINT8(s, 0x12); /* headerLength (1 byte) */
		Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */
		Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */
		Stream_Write_UINT16(s, 0x08C0); /* requestType (2 bytes) */
		Stream_Write_UINT32(s, context->rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */
		Stream_Write_UINT32(s, context->rdp->autodetect->netCharBandwidth); /* bandwidth (4 bytes) */
		Stream_Write_UINT32(s, context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */
	}
	else
	{
		Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */
		Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */
		Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */
		Stream_Write_UINT16(s, 0x0840); /* requestType (2 bytes) */
		Stream_Write_UINT32(s, context->rdp->autodetect->netCharBaseRTT); /* baseRTT (4 bytes) */
		Stream_Write_UINT32(s, context->rdp->autodetect->netCharAverageRTT); /* averageRTT (4 bytes) */
	}

	return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
}
开发者ID:BenoitDevolutions,项目名称:FreeRDP,代码行数:33,代码来源:autodetect.c

示例2: autodetect_send_bandwidth_measure_stop

static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 payloadLength, UINT16 sequenceNumber, UINT16 requestType)
{
	UINT16 i;
	wStream* s;

	s = rdp_message_channel_pdu_init(context->rdp);

	if (!s)
		return FALSE;

	WLog_DBG(AUTODETECT_TAG, "sending Bandwidth Measure Stop PDU -> payloadLength=%u");

	/* 4-bytes aligned */
	payloadLength &= ~3;

	Stream_Write_UINT8(s, requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME ? 0x08 : 0x06); /* headerLength (1 byte) */
	Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */
	Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */
	Stream_Write_UINT16(s, requestType); /* requestType (2 bytes) */
	if (requestType == RDP_BW_STOP_REQUEST_TYPE_CONNECTTIME)
	{
		Stream_Write_UINT16(s, payloadLength); /* payloadLength (2 bytes) */
		if (payloadLength > 0)
		{
			Stream_EnsureRemainingCapacity(s, payloadLength);
			/* Random data (better measurement in case the line is compressed) */
			for (i = 0; i < payloadLength / 4; i++)
			{
				Stream_Write_UINT32(s, rand());
			}
		}
	}

	return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
}
开发者ID:BenoitDevolutions,项目名称:FreeRDP,代码行数:35,代码来源:autodetect.c

示例3: rfx_compose_message_context

static void rfx_compose_message_context(RFX_CONTEXT* context, wStream* s)
{
	UINT16 properties;

	Stream_Write_UINT16(s, WBT_CONTEXT); /* CodecChannelT.blockType */
	Stream_Write_UINT32(s, 13); /* CodecChannelT.blockLen */
	Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */
	Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */
	Stream_Write_UINT8(s, 0); /* ctxId */
	Stream_Write_UINT16(s, CT_TILE_64x64); /* tileSize */

	/* properties */
	properties = context->flags; /* flags */
	properties |= (COL_CONV_ICT << 3); /* cct */
	properties |= (CLW_XFORM_DWT_53_A << 5); /* xft */
	properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) << 9); /* et */
	properties |= (SCALAR_QUANTIZATION << 13); /* qt */
	Stream_Write_UINT16(s, properties);

	/* properties in tilesets: note that this has different format from the one in TS_RFX_CONTEXT */
	properties = 1; /* lt */
	properties |= (context->flags << 1); /* flags */
	properties |= (COL_CONV_ICT << 4); /* cct */
	properties |= (CLW_XFORM_DWT_53_A << 6); /* xft */
	properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) << 10); /* et */
	properties |= (SCALAR_QUANTIZATION << 14); /* qt */
	context->properties = properties;
}
开发者ID:authentic8,项目名称:FreeRDP,代码行数:28,代码来源:rfx.c

示例4: guac_rdpsnd_training_handler

/* server is getting a feel of the round trip time */
void guac_rdpsnd_training_handler(guac_rdpsndPlugin* rdpsnd,
        wStream* input_stream, guac_rdpsnd_pdu_header* header) {

    int data_size;
    wStream* output_stream;

    /* Get associated client data */
    guac_client* client = rdpsnd->client;
    guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;

    /* Read timestamp and data size */
    Stream_Read_UINT16(input_stream, rdpsnd->server_timestamp);
    Stream_Read_UINT16(input_stream, data_size);

    /* Send training response */
    output_stream = Stream_New(NULL, 8);
    Stream_Write_UINT8(output_stream, SNDC_TRAINING);
    Stream_Write_UINT8(output_stream, 0);
    Stream_Write_UINT16(output_stream, 4);
    Stream_Write_UINT16(output_stream, rdpsnd->server_timestamp);
    Stream_Write_UINT16(output_stream, data_size);

    pthread_mutex_lock(&(rdp_client->rdp_lock));
    svc_plugin_send((rdpSvcPlugin*) rdpsnd, output_stream);
    pthread_mutex_unlock(&(rdp_client->rdp_lock));

}
开发者ID:Hasib786,项目名称:guacamole-server,代码行数:28,代码来源:rdpsnd_messages.c

示例5: autodetect_send_bandwidth_measure_payload

BOOL autodetect_send_bandwidth_measure_payload(rdpContext* context, UINT16 payloadLength, UINT16 sequenceNumber)
{
	UINT16 i;
	wStream* s;

	s = rdp_message_channel_pdu_init(context->rdp);

	if (!s)
		return FALSE;

	WLog_DBG(AUTODETECT_TAG, "sending Bandwidth Measure Payload PDU -> payloadLength=%u");

	/* 4-bytes aligned */
	payloadLength &= ~3;

	if (!Stream_EnsureRemainingCapacity(s, 8 + payloadLength))
	{
		Stream_Release(s);
		return FALSE;
	}
	Stream_Write_UINT8(s, 0x08); /* headerLength (1 byte) */
	Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_REQUEST); /* headerTypeId (1 byte) */
	Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */
	Stream_Write_UINT16(s, RDP_BW_PAYLOAD_REQUEST_TYPE); /* requestType (2 bytes) */
	Stream_Write_UINT16(s, payloadLength); /* payloadLength (2 bytes) */
	/* Random data (better measurement in case the line is compressed) */
	for (i = 0; i < payloadLength / 4; i++)
	{
		Stream_Write_UINT32(s, rand());
	}

	return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
}
开发者ID:AMV007,项目名称:FreeRDP,代码行数:33,代码来源:autodetect.c

示例6: update_send_cache_glyph_v2

static void update_send_cache_glyph_v2(rdpContext* context, CACHE_GLYPH_V2_ORDER* cache_glyph_v2)
{
	wStream* s;
	UINT16 flags;
	int bm, em;
	int headerLength;
	INT16 orderLength;
	rdpUpdate* update = context->update;

	flags = 0;
	headerLength = 6;

	s = update->us;
	bm = Stream_GetPosition(s);

	Stream_EnsureRemainingCapacity(s, headerLength);
	Stream_Seek(s, headerLength);

	update_write_cache_glyph_v2_order(s, cache_glyph_v2, &flags);
	em = Stream_GetPosition(s);

	orderLength = (em - bm) - 13;

	Stream_SetPosition(s, bm);
	Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY | ORDER_TYPE_CHANGE); /* controlFlags (1 byte) */
	Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */
	Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */
	Stream_Write_UINT8(s, ORDER_TYPE_CACHE_GLYPH); /* orderType (1 byte) */
	Stream_SetPosition(s, em);

	update->numberOrders++;
}
开发者ID:chenkaigithub,项目名称:FreeRDP,代码行数:32,代码来源:update.c

示例7: license_write_preamble

void license_write_preamble(wStream* s, BYTE bMsgType, BYTE flags, UINT16 wMsgSize)
{
	/* preamble (4 bytes) */
	Stream_Write_UINT8(s, bMsgType); /* bMsgType (1 byte) */
	Stream_Write_UINT8(s, flags); /* flags (1 byte) */
	Stream_Write_UINT16(s, wMsgSize); /* wMsgSize (2 bytes) */
}
开发者ID:BUGgs,项目名称:FreeRDP,代码行数:7,代码来源:license.c

示例8: rfx_compose_message_region

static void rfx_compose_message_region(RFX_CONTEXT* context, wStream* s,
	const RFX_RECT* rects, int num_rects)
{
	int size;
	int i;

	size = 15 + num_rects * 8;
	Stream_EnsureRemainingCapacity(s, size);

	Stream_Write_UINT16(s, WBT_REGION); /* CodecChannelT.blockType */
	Stream_Write_UINT32(s, size); /* set CodecChannelT.blockLen later */
	Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId */
	Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId */
	Stream_Write_UINT8(s, 1); /* regionFlags */
	Stream_Write_UINT16(s, num_rects); /* numRects */

	for (i = 0; i < num_rects; i++)
	{
		Stream_Write_UINT16(s, rects[i].x);
		Stream_Write_UINT16(s, rects[i].y);
		Stream_Write_UINT16(s, rects[i].width);
		Stream_Write_UINT16(s, rects[i].height);
	}

	Stream_Write_UINT16(s, CBT_REGION); /* regionType */
	Stream_Write_UINT16(s, 1); /* numTilesets */
}
开发者ID:authentic8,项目名称:FreeRDP,代码行数:27,代码来源:rfx.c

示例9: rdpsnd_server_close

static BOOL rdpsnd_server_close(RdpsndServerContext* context)
{
	int pos;
	BOOL status;
	wStream* s = context->priv->rdpsnd_pdu;

	if (context->selected_client_format < 0)
		return FALSE;

	if (context->priv->out_pending_frames > 0)
	{
		if (!rdpsnd_server_send_audio_pdu(context))
			return FALSE;
	}

	context->selected_client_format = -1;

	Stream_Write_UINT8(s, SNDC_CLOSE);
	Stream_Write_UINT8(s, 0);
	Stream_Seek_UINT16(s);

	pos = Stream_GetPosition(s);
	Stream_SetPosition(s, 2);
	Stream_Write_UINT16(s, pos - 4);
	Stream_SetPosition(s, pos);
	status = WTSVirtualChannelWrite(context->priv->ChannelHandle, (PCHAR) Stream_Buffer(s), Stream_GetPosition(s), NULL);
	Stream_SetPosition(s, 0);

	return status;
}
开发者ID:iteleport,项目名称:FreeRDP,代码行数:30,代码来源:rdpsnd_main.c

示例10: update_send_cache_brush

static void update_send_cache_brush(rdpContext* context, CACHE_BRUSH_ORDER* cache_brush)
{
	wStream* s;
	UINT16 flags;
	int bm, em;
	int headerLength;
	INT16 orderLength;
	rdpUpdate* update = context->update;

	flags = 0;
	headerLength = 6;

	update_check_flush(context, headerLength + update_approximate_cache_brush_order(cache_brush, &flags));

	s = update->us;
	bm = Stream_GetPosition(s);

	Stream_EnsureRemainingCapacity(s, headerLength);
	Stream_Seek(s, headerLength);

	update_write_cache_brush_order(s, cache_brush, &flags);
	em = Stream_GetPosition(s);

	orderLength = (em - bm) - 13;

	Stream_SetPosition(s, bm);
	Stream_Write_UINT8(s, ORDER_STANDARD | ORDER_SECONDARY); /* controlFlags (1 byte) */
	Stream_Write_UINT16(s, orderLength); /* orderLength (2 bytes) */
	Stream_Write_UINT16(s, flags); /* extraFlags (2 bytes) */
	Stream_Write_UINT8(s, ORDER_TYPE_CACHE_BRUSH); /* orderType (1 byte) */
	Stream_SetPosition(s, em);

	update->numberOrders++;
}
开发者ID:Gilsondc,项目名称:FreeRDP,代码行数:34,代码来源:update.c

示例11: rdpgfx_write_h264_metablock

/**
 * Function description
 *
 * @return 0 on success, otherwise a Win32 error code
 */
static UINT rdpgfx_write_h264_metablock(wStream* s, RDPGFX_H264_METABLOCK* meta)
{
	UINT32 index;
	RECTANGLE_16* regionRect;
	RDPGFX_H264_QUANT_QUALITY* quantQualityVal;
	UINT error = CHANNEL_RC_OK;
	Stream_Write_UINT32(s, meta->numRegionRects); /* numRegionRects (4 bytes) */

	for (index = 0; index < meta->numRegionRects; index++)
	{
		regionRect = &(meta->regionRects[index]);

		if ((error = rdpgfx_write_rect16(s, regionRect)))
		{
			WLog_ERR(TAG, "rdpgfx_write_rect16 failed with error %u!", error);
			return error;
		}
	}

	for (index = 0; index < meta->numRegionRects; index++)
	{
		quantQualityVal = &(meta->quantQualityVals[index]);
		Stream_Write_UINT8(s, quantQualityVal->qp
		                   | (quantQualityVal->r << 6)
		                   | (quantQualityVal->p << 7)); /* qpVal (1 byte) */
		/* qualityVal (1 byte) */
		Stream_Write_UINT8(s, quantQualityVal->qualityVal);
	}

	return error;
}
开发者ID:dcatonR1,项目名称:FreeRDP,代码行数:36,代码来源:rdpgfx_main.c

示例12: rdg_send_handshake

static BOOL rdg_send_handshake(rdpRdg* rdg)
{
	wStream* s;
	BOOL status;
	s = Stream_New(NULL, 14);

	if (!s)
		return FALSE;

	Stream_Write_UINT16(s, PKT_TYPE_HANDSHAKE_REQUEST); /* Type (2 bytes) */
	Stream_Write_UINT16(s, 0); /* Reserved (2 bytes) */
	Stream_Write_UINT32(s, 14); /* PacketLength (4 bytes) */
	Stream_Write_UINT8(s, 1); /* VersionMajor (1 byte) */
	Stream_Write_UINT8(s, 0); /* VersionMinor (1 byte) */
	Stream_Write_UINT16(s, 0); /* ClientVersion (2 bytes), must be 0 */
	Stream_Write_UINT16(s, rdg->extAuth); /* ExtendedAuthentication (2 bytes) */
	Stream_SealLength(s);
	status = rdg_write_packet(rdg, s);
	Stream_Free(s, TRUE);

	if (status)
	{
		rdg->state = RDG_CLIENT_STATE_HANDSHAKE;
	}

	return status;
}
开发者ID:mfleisz,项目名称:FreeRDP,代码行数:27,代码来源:rdg.c

示例13: rfx_write_message_region

BOOL rfx_write_message_region(RFX_CONTEXT* context, wStream* s, RFX_MESSAGE* message)
{
	int i;
	UINT32 blockLen;

	blockLen = 15 + (message->numRects * 8);
	if (!Stream_EnsureRemainingCapacity(s, blockLen))
		return FALSE;

	Stream_Write_UINT16(s, WBT_REGION); /* CodecChannelT.blockType (2 bytes) */
	Stream_Write_UINT32(s, blockLen); /* set CodecChannelT.blockLen (4 bytes) */
	Stream_Write_UINT8(s, 1); /* CodecChannelT.codecId (1 byte) */
	Stream_Write_UINT8(s, 0); /* CodecChannelT.channelId (1 byte) */
	Stream_Write_UINT8(s, 1); /* regionFlags (1 byte) */
	Stream_Write_UINT16(s, message->numRects); /* numRects (2 bytes) */

	for (i = 0; i < message->numRects; i++)
	{
		/* Clipping rectangles are relative to destLeft, destTop */

		Stream_Write_UINT16(s, message->rects[i].x); /* x (2 bytes) */
		Stream_Write_UINT16(s, message->rects[i].y); /* y (2 bytes) */
		Stream_Write_UINT16(s, message->rects[i].width); /* width (2 bytes) */
		Stream_Write_UINT16(s, message->rects[i].height); /* height (2 bytes) */
	}

	Stream_Write_UINT16(s, CBT_REGION); /* regionType (2 bytes) */
	Stream_Write_UINT16(s, 1); /* numTilesets (2 bytes) */

	return TRUE;
}
开发者ID:C4rt,项目名称:FreeRDP,代码行数:31,代码来源:rfx.c

示例14: input_send_fastpath_focus_in_event

BOOL input_send_fastpath_focus_in_event(rdpInput* input, UINT16 toggleStates)
{
	wStream* s;
	rdpRdp* rdp = input->context->rdp;
	BYTE eventFlags = 0;

	s = fastpath_input_pdu_init_header(rdp->fastpath);
	if (!s)
		return FALSE;
	/* send a tab up like mstsc.exe */
	eventFlags = FASTPATH_INPUT_KBDFLAGS_RELEASE | FASTPATH_INPUT_EVENT_SCANCODE << 5;
	Stream_Write_UINT8(s, eventFlags); /* Key Release event (1 byte) */
	Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */

	/* send the toggle key states */
	eventFlags = (toggleStates & 0x1F) | FASTPATH_INPUT_EVENT_SYNC << 5;
	Stream_Write_UINT8(s, eventFlags); /* toggle state (1 byte) */

	/* send another tab up like mstsc.exe */
	eventFlags = FASTPATH_INPUT_KBDFLAGS_RELEASE | FASTPATH_INPUT_EVENT_SCANCODE << 5;
	Stream_Write_UINT8(s, eventFlags); /* Key Release event (1 byte) */
	Stream_Write_UINT8(s, 0x0f); /* keyCode (1 byte) */

	return fastpath_send_multiple_input_pdu(rdp->fastpath, s, 3);
}
开发者ID:BUGgs,项目名称:FreeRDP,代码行数:25,代码来源:input.c

示例15: autodetect_send_bandwidth_measure_results

static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 responseType, UINT16 sequenceNumber)
{
	wStream* s;
	UINT32 timeDelta;
	
	/* Compute the total time */
	timeDelta = GetTickCount() - rdp->autodetect->bandwidthMeasureStartTime;
	
	/* Send the result PDU to the server */

	s = rdp_message_channel_pdu_init(rdp);

	if (!s)
		return FALSE;

	WLog_DBG(AUTODETECT_TAG, "sending Bandwidth Measure Results PDU -> timeDelta=%u, byteCount=%u", timeDelta, rdp->autodetect->bandwidthMeasureByteCount);

	Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */
	Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */
	Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */
	Stream_Write_UINT16(s, responseType); /* responseType (1 byte) */
	Stream_Write_UINT32(s, timeDelta); /* timeDelta (4 bytes) */
	Stream_Write_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */

	return rdp_send_message_channel_pdu(rdp, s, SEC_AUTODETECT_RSP);
}
开发者ID:BenoitDevolutions,项目名称:FreeRDP,代码行数:26,代码来源:autodetect.c


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