• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ out_uint8s函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: rdp_out_bitmapcache_rev2_capset

void rdp_out_bitmapcache_rev2_capset(rdpRdp * rdp, STREAM s)
{
	capsetHeaderRef header;
	uint16 flag;

	header = rdp_skip_capset_header(s);
	flag = ALLOW_CACHE_WAITING_LIST_FLAG;
	if (rdp->settings->bitmap_cache_persist_enable)
		flag |= PERSISTENT_KEYS_EXPECTED_FLAG;
	out_uint16_le(s, flag); /* CacheFlags */
	out_uint8s(s, 1); /* pad */
	out_uint8(s, 3); /* numCellCaches */

	/* max cell size for cache 0 is 16x16, 1 = 32x32, 2 = 64x64, etc */
	out_uint32_le(s, BMPCACHE2_C0_CELLS);
	out_uint32_le(s, BMPCACHE2_C1_CELLS);
	if (pstcache_init(rdp->pcache, 2))
	{
		out_uint32_le(s, BMPCACHE2_NUM_PSTCELLS | BMPCACHE2_FLAG_PERSIST);
	}
	else
	{
		out_uint32_le(s, BMPCACHE2_C2_CELLS);
	}
	out_uint8s(s, 20);	/* other bitmap caches not used */
	rdp_out_capset_header(s, header, CAPSET_TYPE_BITMAPCACHE_REV2);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:27,代码来源:capabilities.c


示例2: rdpdr_send_available

static void
rdpdr_send_available(RDPCLIENT * This)
{

	uint8 magic[4] = "rDAD";
	uint32 driverlen, printerlen, bloblen;
	int i;
	STREAM s;
	PRINTER *printerinfo;

	s = channel_init(This, This->rdpdr.channel, announcedata_size(This));
	out_uint8a(s, magic, 4);
	out_uint32_le(s, This->num_devices);

	for (i = 0; i < This->num_devices; i++)
	{
		out_uint32_le(s, This->rdpdr_device[i].device_type);
		out_uint32_le(s, i);	/* RDP Device ID */
		/* Is it possible to use share names longer than 8 chars?
		   /astrand */
		out_uint8p(s, This->rdpdr_device[i].name, 8);

		switch (This->rdpdr_device[i].device_type)
		{
			case DEVICE_TYPE_PRINTER:
				printerinfo = (PRINTER *) This->rdpdr_device[i].pdevice_data;

				driverlen = 2 * strlen(printerinfo->driver) + 2;
				printerlen = 2 * strlen(printerinfo->printer) + 2;
				bloblen = printerinfo->bloblen;

				out_uint32_le(s, 24 + driverlen + printerlen + bloblen);	/* length of extra info */
				out_uint32_le(s, printerinfo->default_printer ? 2 : 0);
				out_uint8s(s, 8);	/* unknown */
				out_uint32_le(s, driverlen);
				out_uint32_le(s, printerlen);
				out_uint32_le(s, bloblen);
				rdp_out_unistr(This, s, printerinfo->driver, driverlen - 2);
				rdp_out_unistr(This, s, printerinfo->printer, printerlen - 2);
				out_uint8a(s, printerinfo->blob, bloblen);

				if (printerinfo->blob)
					xfree(printerinfo->blob);	/* Blob is sent twice if reconnecting */
				break;
			default:
				out_uint32(s, 0);
		}
	}
#if 0
	out_uint32_le(s, 0x20);	/* Device type 0x20 - smart card */
	out_uint32_le(s, 0);
	out_uint8p(s, "SCARD", 5);
	out_uint8s(s, 3);
	out_uint32(s, 0);
#endif

	s_mark_end(s);
	channel_send(This, s, This->rdpdr.channel);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:59,代码来源:rdpdr.c


示例3: rdp_out_order_caps

/* Output order capability set */
static void rdp_out_order_caps(STREAM s) {
	uint8 order_caps[32];

	memset(order_caps, 0, 32);
	order_caps[0] = 1; /* dest blt */
	order_caps[1] = 1; /* pat blt */
	order_caps[2] = 1; /* screen blt */
	order_caps[3] = (g_bitmap_cache ? 1 : 0); /* memblt */
	order_caps[4] = 0; /* triblt */
	order_caps[8] = 1; /* line */
	order_caps[9] = 1; /* line */
	order_caps[10] = 1; /* rect */
	order_caps[11] = (g_desktop_save ? 1 : 0); /* desksave */
	order_caps[13] = 1; /* memblt */
	order_caps[14] = 1; /* triblt */
	order_caps[20] = (g_polygon_ellipse_orders ? 1 : 0); /* polygon */
	order_caps[21] = (g_polygon_ellipse_orders ? 1 : 0); /* polygon2 */
	order_caps[22] = 1; /* polyline */
	order_caps[25] = (g_polygon_ellipse_orders ? 1 : 0); /* ellipse */
	order_caps[26] = (g_polygon_ellipse_orders ? 1 : 0); /* ellipse2 */
	order_caps[27] = 1; /* text2 */
	out_uint16_le(s, RDP_CAPSET_ORDER);
	out_uint16_le(s, RDP_CAPLEN_ORDER);

	out_uint8s(s, 20);
	/* Terminal desc, pad */
	out_uint16_le(s, 1);
	/* Cache X granularity */
	out_uint16_le(s, 20);
	/* Cache Y granularity */
	out_uint16(s, 0);
	/* Pad */
	out_uint16_le(s, 1);
	/* Max order level */
	out_uint16_le(s, 0x147);
	/* Number of fonts */
	out_uint16_le(s, 0x2a);
	/* Capability flags */
	out_uint8p(s, order_caps, 32);
	/* Orders supported */
	out_uint16_le(s, 0x6a1);
	/* Text capability flags */
	out_uint8s(s, 6);
	/* Pad */
	out_uint32_le(s, g_desktop_save == False ? 0 : 0x38400);
	/* Desktop cache size */
	out_uint32(s, 0);
	/* Unknown */
	out_uint32_le(s, 0x4e4);
	/* Unknown */
}
开发者ID:Watchet,项目名称:openssl-android,代码行数:52,代码来源:rdp.c


示例4: dev_redir_process_close_io_request

int APP_CC
dev_redir_process_close_io_request(int completion_id)
{
	struct stream* s;

	log_message(&log_conf, LOG_LEVEL_DEBUG, "chansrv[dev_redir_process_close_io_request]:"
	  		"close file : %s",actions[completion_id].path);
	make_stream(s);
	init_stream(s,1100);
	actions[completion_id].last_req = IRP_MJ_CLOSE;
	out_uint16_le(s, RDPDR_CTYP_CORE);
	out_uint16_le(s, PAKID_CORE_DEVICE_IOREQUEST);
	out_uint32_le(s, actions[completion_id].device);
	out_uint32_le(s, actions[completion_id].file_id);
	out_uint32_le(s, completion_id);
	out_uint32_le(s, IRP_MJ_CLOSE);   	/* major version */
	out_uint32_le(s, 0);								/* minor version */
	out_uint8s(s,32);
	s_mark_end(s);
	dev_redir_send(s);
	actions[completion_id].message_id++;
	free_stream(s);
	return 0;
	free_stream(s);
}
开发者ID:Oyatsumi,项目名称:ulteo4Kode4kids,代码行数:25,代码来源:devredir.c


示例5: rdp_out_bitmap_codecs_capset

void rdp_out_bitmap_codecs_capset(rdpRdp * rdp, STREAM s)
{
	capsetHeaderRef header;
	uint8 * count_ptr;
	int index;
	int out_count;
	int out_bytes;
	STREAM ls;

	//printf("rdp_out_bitmap_codecs_capset:\n");
	out_count = 0;
	header = rdp_skip_capset_header(s);
	count_ptr = s->p;
	out_uint8s(s, 1);
	for (index = 0; index < MAX_BITMAP_CODECS; index++)
	{
		ls = rdp->out_codec_caps[index];
		if (ls != NULL)
		{
			out_bytes = (int) (ls->end - ls->data);
			out_uint8a(s, ls->data, out_bytes);
			stream_delete(ls);
			rdp->out_codec_caps[index] = NULL;
			out_count++;
		}
	}
	*count_ptr = out_count;
	rdp_out_capset_header(s, header, CAPSET_TYPE_BITMAP_CODECS);
	//hexdump(count_ptr, s->p - count_ptr);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:30,代码来源:capabilities.c


示例6: sound_send_training

static int
sound_send_training(void)
{
    struct stream *s;
    int bytes;
    int time;
    char *size_ptr;

    print_got_here();

    make_stream(s);
    init_stream(s, 8182);
    out_uint16_le(s, SNDC_TRAINING);
    size_ptr = s->p;
    out_uint16_le(s, 0); /* size, set later */
    time = g_time2();
    g_training_sent_time = time;
    out_uint16_le(s, time);
    out_uint16_le(s, 1024);
    out_uint8s(s, (1024 - 4));
    s_mark_end(s);
    bytes = (int)((s->end - s->data) - 4);
    size_ptr[0] = bytes;
    size_ptr[1] = bytes >> 8;
    bytes = (int)(s->end - s->data);
    send_channel_data(g_rdpsnd_chan_id, s->data, bytes);
    free_stream(s);
    return 0;
}
开发者ID:OSgenie,项目名称:xrdp,代码行数:29,代码来源:sound.c


示例7: cliprdr_send_capability

void cliprdr_send_capability()
{
	/* this message is ignored by rdp applet */
	struct stream* s;

	make_stream(s);
	init_stream(s,1024);

	log_message(l_config, LOG_LEVEL_DEBUG, "vchannel_cliprdr[cliprdr_send_capability]:");
	/* clip header */
	out_uint16_le(s, CB_CLIP_CAPS);                        /* msg type */
	out_uint16_le(s, 0x00);                                /* msg flag */
	out_uint32_le(s, 0);                                   /* msg size */
	/* we only support one capability for now */
	out_uint16_le(s, 1);                                   /* cCapabilitiesSets */
	out_uint8s(s, 16);                                     /* pad */
	/* CLIPRDR_CAPS_SET */
	out_uint16_le(s, CB_CAPSTYPE_GENERAL);                 /* capabilitySetType */
	out_uint16_le(s, 92);                                  /* lengthCapability */
	out_uint32_le(s, CB_CAPS_VERSION_1);                   /* version */
	out_uint32_le(s, 0);                                   /* general flags */


	s_mark_end(s);
	cliprdr_send(s);
	free_stream(s);

}
开发者ID:Oyatsumi,项目名称:ulteo4Kode4kids,代码行数:28,代码来源:main.c


示例8: rdp_send_confirm_active

/* Send a confirm active PDU */
static void rdp_send_confirm_active(void) {
	STREAM s;
	uint32 sec_flags = g_encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG;
	uint16 caplen = RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER
			+ RDP_CAPLEN_COLCACHE + RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL
			+ RDP_CAPLEN_SHARE + RDP_CAPLEN_BRUSHCACHE + 0x58 + 0x08 + 0x08
			+ 0x34 /* unknown caps */+ 4 /* w2k fix, sessionid */;

	if (g_use_rdp5) {
		caplen += RDP_CAPLEN_BMPCACHE2;
		caplen += RDP_CAPLEN_NEWPOINTER;
	} else {
		caplen += RDP_CAPLEN_BMPCACHE;
		caplen += RDP_CAPLEN_POINTER;
	}

	s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));

	out_uint16_le(s, 2 + 14 + caplen + sizeof(RDP_SOURCE));
	out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10));
	/* Version 1 */
	out_uint16_le(s, (g_mcs_userid + 1001));

	out_uint32_le(s, g_rdp_shareid);
	out_uint16_le(s, 0x3ea);
	/* userid */
	out_uint16_le(s, sizeof(RDP_SOURCE));
	out_uint16_le(s, caplen);

	out_uint8p(s, RDP_SOURCE, sizeof(RDP_SOURCE));
	out_uint16_le(s, 0xe);
	/* num_caps */
	out_uint8s(s, 2);
	/* pad */

	rdp_out_general_caps(s);
	rdp_out_bitmap_caps(s);
	rdp_out_order_caps(s);
	if (g_use_rdp5) {
		rdp_out_bmpcache2_caps(s);
		rdp_out_newpointer_caps(s);
	} else {
		rdp_out_bmpcache_caps(s);
		rdp_out_pointer_caps(s);
	}
	rdp_out_colcache_caps(s);
	rdp_out_activate_caps(s);
	rdp_out_control_caps(s);
	rdp_out_share_caps(s);
	rdp_out_brushcache_caps(s);

	rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d); /* CAPSTYPE_INPUT */
	rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c); /* CAPSTYPE_SOUND */
	rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e); /* CAPSTYPE_FONT */
	rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10); /* CAPSTYPE_GLYPHCACHE */

	s_mark_end(s);
	sec_send(s, sec_flags);
}
开发者ID:Watchet,项目名称:openssl-android,代码行数:60,代码来源:rdp.c


示例9: rdp_out_order_capset

void rdp_out_order_capset(rdpRdp * rdp, STREAM s)
{
	uint8 orderSupport[32];
	capsetHeaderRef header;

	header = rdp_skip_capset_header(s);

	memset(orderSupport, 0, 32);
	orderSupport[NEG_DSTBLT_INDEX] = 1;
	orderSupport[NEG_PATBLT_INDEX] = 1;
	orderSupport[NEG_SCRBLT_INDEX] = 1;
	orderSupport[NEG_MEMBLT_INDEX] = (rdp->settings->bitmap_cache ? 1 : 0);
	orderSupport[NEG_MEM3BLT_INDEX] = (rdp->settings->triblt ? 1 : 0);
	// orderSupport[NEG_DRAWNINEGRID_INDEX] = 1;
	orderSupport[NEG_LINETO_INDEX] = 1;
	orderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = 1;
	orderSupport[NEG_SAVEBITMAP_INDEX] = (rdp->settings->desktop_save ? 1 : 0);
	// orderSupport[NEG_MULTIDSTBLT_INDEX] = 1;
	orderSupport[NEG_MULTIPATBLT_INDEX] = 1;
	// orderSupport[NEG_MULTISCRBLT_INDEX] = 1;
	orderSupport[NEG_MULTIOPAQUERECT_INDEX] = 1;
	orderSupport[NEG_FAST_INDEX_INDEX] = 1;
	orderSupport[NEG_POLYGON_SC_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);
	orderSupport[NEG_POLYGON_CB_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);
	orderSupport[NEG_POLYLINE_INDEX] = 1;
	orderSupport[NEG_FAST_GLYPH_INDEX] = 1;
/*	orderSupport[NEG_ELLIPSE_SC_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);*/
/*	orderSupport[NEG_ELLIPSE_CB_INDEX] = (rdp->settings->polygon_ellipse_orders ? 1 : 0);*/
	orderSupport[NEG_INDEX_INDEX] = 1;

	out_uint8s(s, 16); /* terminalDescriptor, ignored and should be set to zero */
	out_uint32_le(s, 0); /* pad */
	out_uint16_le(s, 1); /* desktopSaveXGranularity */
	out_uint16_le(s, 20); /* desktopSaveYGranularity */
	out_uint16_le(s, 0); /* pad */
	out_uint16_le(s, 1); /* maximumOrderLevel */
	out_uint16_le(s, 0); /* numberFonts, ignored and should be set to zero */

	out_uint16_le(s,
		NEGOTIATEORDERSUPPORT |
		ZEROBOUNDSDELTASSUPPORT |
		COLORINDEXSUPPORT ); /* orderFlags */

	out_uint8p(s, orderSupport, 32); /* orderSupport */
	out_uint16_le(s, 0); /* textFlags, must be ignored */
	out_uint16_le(s, 0); /* orderSupportExFlags */
	out_uint32_le(s, 0); /* pad */
	out_uint32_le(s, rdp->settings->desktop_save == False ? 0 : 0x38400); /* desktopSaveSize */
	out_uint16_le(s, 0); /* pad */
	out_uint16_le(s, 0); /* pad */

	/* See [MSDN-CP]: http://msdn.microsoft.com/en-us/library/dd317756/ */
	out_uint16_le(s, 0x04E4); /* textANSICodePage, 0x04E4 is "ANSI Latin 1 Western European (Windows)" */
	out_uint16_le(s, 0); /* pad */

	rdp_out_capset_header(s, header, CAPSET_TYPE_ORDER);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:57,代码来源:capabilities.c


示例10: sound_send_wave_data

static int
sound_send_wave_data(char *data, int data_bytes)
{
    struct stream *s;
    int bytes;
    int time;
    char *size_ptr;

    print_got_here();

    if ((data_bytes < 4) || (data_bytes > 128 * 1024))
    {
        LOG(0, ("sound_send_wave_data: bad data_bytes %d", data_bytes));
    }

    /* part one of 2 PDU wave info */

    LOG(10, ("sound_send_wave_data: sending %d bytes", data_bytes));

    make_stream(s);
    init_stream(s, data_bytes);
    out_uint16_le(s, SNDC_WAVE);
    size_ptr = s->p;
    out_uint16_le(s, 0); /* size, set later */
    time = g_time2();
    out_uint16_le(s, time);
    out_uint16_le(s, 0); /* wFormatNo */
    g_cBlockNo++;
    out_uint8(s, g_cBlockNo);

    LOG(10, ("sound_send_wave_data: sending time %d, g_cBlockNo %d",
             time & 0xffff, g_cBlockNo & 0xff));

    out_uint8s(s, 3);
    out_uint8a(s, data, 4);
    s_mark_end(s);
    bytes = (int)((s->end - s->data) - 4);
    bytes += data_bytes;
    bytes -= 4;
    size_ptr[0] = bytes;
    size_ptr[1] = bytes >> 8;
    bytes = (int)(s->end - s->data);
    send_channel_data(g_rdpsnd_chan_id, s->data, bytes);

    /* part two of 2 PDU wave info */
    init_stream(s, data_bytes);
    out_uint32_le(s, 0);
    out_uint8a(s, data + 4, data_bytes - 4);
    s_mark_end(s);
    bytes = (int)(s->end - s->data);
    send_channel_data(g_rdpsnd_chan_id, s->data, bytes);
    free_stream(s);
    return 0;
}
开发者ID:OSgenie,项目名称:xrdp,代码行数:54,代码来源:sound.c


示例11: cliprdr_send_format_list

void cliprdr_send_format_list()
{
	struct stream* s;

	make_stream(s);
	init_stream(s,1024);

	log_message(l_config, LOG_LEVEL_DEBUG, "vchannel_cliprdr[cliprdr_send_format_list_response]:");
	/* clip header */
	out_uint16_le(s, CB_FORMAT_LIST);                      /* msg type */
	out_uint16_le(s, 0);                                   /* msg flag */
	out_uint32_le(s, 72);                                  /* msg size */
	/* we only send one format */
	out_uint32_le(s, CF_TEXT);                             /* Format Id */
	out_uint8s(s, 32);
	out_uint32_le(s, CF_UNICODETEXT);                      /* Format Id */
	out_uint8s(s, 32);

	s_mark_end(s);
	cliprdr_send(s);
	free_stream(s);

}
开发者ID:Oyatsumi,项目名称:ulteo4Kode4kids,代码行数:23,代码来源:main.c


示例12: rdp_send_confirm_active

/* Send a confirm active PDU */
static BOOL
rdp_send_confirm_active(RDPCLIENT * This)
{
	STREAM s;
	uint32 sec_flags = This->encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG;
	uint16 caplen =
		RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER +
		RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
		RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
		RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE +
		0x58 + 0x08 + 0x08 + 0x34 /* unknown caps */  +
		4 /* w2k fix, why? */ ;

	s = sec_init(This, sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));

	if(s == NULL)
		return False;

	out_uint16_le(s, 2 + 14 + caplen + sizeof(RDP_SOURCE));
	out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10));	/* Version 1 */
	out_uint16_le(s, (This->mcs_userid + 1001));

	out_uint32_le(s, This->rdp_shareid);
	out_uint16_le(s, 0x3ea);	/* userid */
	out_uint16_le(s, sizeof(RDP_SOURCE));
	out_uint16_le(s, caplen);

	out_uint8p(s, RDP_SOURCE, sizeof(RDP_SOURCE));
	out_uint16_le(s, 0xd);	/* num_caps */
	out_uint8s(s, 2);	/* pad */

	rdp_out_general_caps(This, s);
	rdp_out_bitmap_caps(This, s);
	rdp_out_order_caps(This, s);
	This->use_rdp5 ? rdp_out_bmpcache2_caps(This, s) : rdp_out_bmpcache_caps(This, s);
	rdp_out_colcache_caps(s);
	rdp_out_activate_caps(s);
	rdp_out_control_caps(s);
	rdp_out_pointer_caps(s);
	rdp_out_share_caps(s);

	rdp_out_unknown_caps(s, 0x0d, 0x58, caps_0x0d);	/* international? */
	rdp_out_unknown_caps(s, 0x0c, 0x08, caps_0x0c);
	rdp_out_unknown_caps(s, 0x0e, 0x08, caps_0x0e);
	rdp_out_unknown_caps(s, 0x10, 0x34, caps_0x10);	/* glyph cache? */

	s_mark_end(s);
	return sec_send(This, s, sec_flags);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:50,代码来源:rdp.c


示例13: rdp_out_bmpcache_caps

/* Output bitmap cache capability set */
static void
rdp_out_bmpcache_caps(STREAM s)
{
    int Bpp;
    out_uint16_le(s, RDP_CAPSET_BMPCACHE);
    out_uint16_le(s, RDP_CAPLEN_BMPCACHE);

    Bpp = (g_server_depth + 7) / 8;	/* bytes per pixel */
    out_uint8s(s, 24);	/* unused */
    out_uint16_le(s, 0x258);	/* entries */
    out_uint16_le(s, 0x100 * Bpp);	/* max cell size */
    out_uint16_le(s, 0x12c);	/* entries */
    out_uint16_le(s, 0x400 * Bpp);	/* max cell size */
    out_uint16_le(s, 0x106);	/* entries */
    out_uint16_le(s, 0x1000 * Bpp);	/* max cell size */
}
开发者ID:z0x010,项目名称:rdesktop,代码行数:17,代码来源:rdp.c


示例14: licence_present

/* Send a Licensing packet with Client License Information */
static void
licence_present(rdpLicence * licence, uint8 * client_random, uint8 * rsa_data,
                uint8 * licence_data, int licence_size, uint8 * hwid, uint8 * signature)
{
    uint32 sec_flags = SEC_LICENSE_PKT;
    uint16 length =
        16 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE +
        licence_size + LICENCE_HWID_SIZE + LICENCE_SIGNATURE_SIZE;
    STREAM s;

    s = sec_init(licence->sec, sec_flags, length + 4);

    /* Licensing Preamble (LICENSE_PREAMBLE) */
    out_uint8(s, LICENSE_INFO);	/* bMsgType LICENSE_INFO */
    out_uint8(s, 2);	/* bVersion PREAMBLE_VERSION_2_0 */
    out_uint16_le(s, length);

    /* Client License Information: */
    out_uint32_le(s, 1);	/* PreferredKeyExchangeAlg KEY_EXCHANGE_ALG_RSA */
    out_uint16_le(s, 0);	/* PlatformId, unknown platform and ISV */
    out_uint16_le(s, 0x0201);	/* PlatformId, build/version */

    out_uint8p(s, client_random, SEC_RANDOM_SIZE);	/* ClientRandom */

    /* Licensing Binary Blob with EncryptedPreMasterSecret: */
    out_uint16_le(s, 0);	/* wBlobType should be 0x0002 (BB_RANDOM_BLOB) */
    out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));	/* wBlobLen */
    out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);	/* 48 bit random number encrypted for server */
    out_uint8s(s, SEC_PADDING_SIZE);

    /* Licensing Binary Blob with LicenseInfo: */
    out_uint16_le(s, 1);	/* wBlobType BB_DATA_BLOB */
    out_uint16_le(s, licence_size);	/* wBlobLen */
    out_uint8p(s, licence_data, licence_size);	/* CAL issued by servers license server */

    /* Licensing Binary Blob with EncryptedHWID */
    out_uint16_le(s, 1);	/* wBlobType BB_DATA_BLOB */
    out_uint16_le(s, LICENCE_HWID_SIZE);	/* wBlobLen */
    out_uint8p(s, hwid, LICENCE_HWID_SIZE);	/* RC4-encrypted Client Hardware Identification */

    out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);	/* MACData */

    s_mark_end(s);
    sec_send(licence->sec, s, sec_flags);
}
开发者ID:nidelius,项目名称:FreeRDP,代码行数:46,代码来源:licence.c


示例15: licence_send_request

/* Send a Licensing packet with Client New License Request */
static void
licence_send_request(rdpLicence * licence, uint8 * client_random, uint8 * rsa_data, char *user,
                     char *host)
{
    uint32 sec_flags = SEC_LICENSE_PKT;
    uint16 userlen = strlen(user) + 1;
    uint16 hostlen = strlen(host) + 1;
    uint16 length = 128 + userlen + hostlen;
    STREAM s;

    s = sec_init(licence->sec, sec_flags, length + 2);

    /* Licensing Preamble (LICENSE_PREAMBLE) */
    out_uint8(s, NEW_LICENSE_REQUEST);	/* NEW_LICENSE_REQUEST */
    out_uint8(s, 2);	/* PREAMBLE_VERSION_2_0 */
    out_uint16_le(s, length);

    out_uint32_le(s, 1);	/* PreferredKeyExchangeAlg KEY_EXCHANGE_ALG_RSA */
    out_uint16_le(s, 0);	/* PlatformId, unknown platform and ISV */
    out_uint16_le(s, 0xff01);	/* PlatformId, build/version */

    out_uint8p(s, client_random, SEC_RANDOM_SIZE);	/* ClientRandom */

    /* Licensing Binary Blob with EncryptedPreMasterSecret: */
    out_uint16_le(s, 0);	/* wBlobType should be 0x0002 (BB_RANDOM_BLOB) */
    out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));	/* wBlobLen */
    out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);	/* 48 bit random number encrypted for server */
    out_uint8s(s, SEC_PADDING_SIZE);

    /* Licensing Binary Blob with ClientUserName: */
    out_uint16_le(s, LICENCE_TAG_USER);	/* wBlobType BB_CLIENT_USER_NAME_BLOB */
    out_uint16_le(s, userlen);	/* wBlobLen */
    out_uint8p(s, user, userlen);

    /* Licensing Binary Blob with ClientMachineName: */
    out_uint16_le(s, LICENCE_TAG_HOST);	/* wBlobType BB_CLIENT_MACHINE_NAME_BLOB */
    out_uint16_le(s, hostlen);	/* wBlobLen */
    out_uint8p(s, host, hostlen);

    s_mark_end(s);
    sec_send(licence->sec, s, sec_flags);
}
开发者ID:nidelius,项目名称:FreeRDP,代码行数:43,代码来源:licence.c


示例16: licence_present

/* Present an existing licence to the server */
static BOOL
licence_present(RDPCLIENT * This, uint8 * client_random, uint8 * rsa_data,
		uint8 * licence_data, int licence_size, uint8 * hwid, uint8 * signature)
{
	uint32 sec_flags = SEC_LICENCE_NEG;
	uint16 length =
		16 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE +
		licence_size + LICENCE_HWID_SIZE + LICENCE_SIGNATURE_SIZE;
	STREAM s;

	s = sec_init(This, sec_flags, length + 4);

	if(s == NULL)
		return False;

	out_uint8(s, LICENCE_TAG_PRESENT);
	out_uint8(s, 2);	/* version */
	out_uint16_le(s, length);

	out_uint32_le(s, 1);
	out_uint16(s, 0);
	out_uint16_le(s, 0x0201);

	out_uint8p(s, client_random, SEC_RANDOM_SIZE);
	out_uint16(s, 0);
	out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));
	out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);
	out_uint8s(s, SEC_PADDING_SIZE);

	out_uint16_le(s, 1);
	out_uint16_le(s, licence_size);
	out_uint8p(s, licence_data, licence_size);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_HWID_SIZE);
	out_uint8p(s, hwid, LICENCE_HWID_SIZE);

	out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);

	s_mark_end(s);
	return sec_send(This, s, sec_flags);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:43,代码来源:licence.c


示例17: rdp_out_bitmapcache_capset

void rdp_out_bitmapcache_capset(rdpRdp * rdp, STREAM s)
{
	int Bpp;
	int size;
	capsetHeaderRef header;

	header = rdp_skip_capset_header(s);
	Bpp = (rdp->settings->server_depth + 7) / 8; /* bytes per pixel */
	out_uint8s(s, 24); /* pad */
	out_uint16_le(s, 0x258); /* Cache1Entries */
	size = 0x100 * Bpp;
	out_uint16_le(s, size); /* Cache1MaximumCellSize */
	out_uint16_le(s, 0x12c); /* Cache2Entries */
	size = 0x400 * Bpp;
	out_uint16_le(s, size); /* Cache2MaximumCellSize */
	out_uint16_le(s, 0x106); /* Cache3Entries */
	size = 0x1000 * Bpp;
	out_uint16_le(s, size); /* Cache3MaximumCellSize */
	rdp_out_capset_header(s, header, CAPSET_TYPE_BITMAPCACHE);
}
开发者ID:roman-b,项目名称:FreeRDP,代码行数:20,代码来源:capabilities.c


示例18: rdp_out_bmpcache2_caps

/* Output bitmap cache v2 capability set */
static void rdp_out_bmpcache2_caps(STREAM s) {
	out_uint16_le(s, RDP_CAPSET_BMPCACHE2);
	out_uint16_le(s, RDP_CAPLEN_BMPCACHE2);

	out_uint16_le(s, g_bitmap_cache_persist_enable ? 2 : 0);
	/* version */

	out_uint16_be(s, 3);
	/* number of caches in this set */

	/* max cell size for cache 0 is 16x16, 1 = 32x32, 2 = 64x64, etc */
	out_uint32_le(s, BMPCACHE2_C0_CELLS);
	out_uint32_le(s, BMPCACHE2_C1_CELLS);
	if (pstcache_init(2)) {
		out_uint32_le(s, BMPCACHE2_NUM_PSTCELLS | BMPCACHE2_FLAG_PERSIST);
	} else {
		out_uint32_le(s, BMPCACHE2_C2_CELLS);
	}out_uint8s(s, 20);
	/* other bitmap caches not used */
}
开发者ID:Watchet,项目名称:openssl-android,代码行数:21,代码来源:rdp.c


示例19: rdp_send_confirm_active

/* Send a confirm active PDU */
static void
rdp_send_confirm_active(void)
{
	STREAM s;
	uint32 sec_flags = g_encryption ? (RDP5_FLAG | SEC_ENCRYPT) : RDP5_FLAG;
	uint16 caplen =
		RDP_CAPLEN_GENERAL + RDP_CAPLEN_BITMAP + RDP_CAPLEN_ORDER +
		RDP_CAPLEN_BMPCACHE + RDP_CAPLEN_COLCACHE +
		RDP_CAPLEN_ACTIVATE + RDP_CAPLEN_CONTROL +
		RDP_CAPLEN_POINTER + RDP_CAPLEN_SHARE + RDP_CAPLEN_UNKNOWN + 4 /* w2k fix, why? */ ;

	s = sec_init(sec_flags, 6 + 14 + caplen + sizeof(RDP_SOURCE));

	out_uint16_le(s, 2 + 14 + caplen + sizeof(RDP_SOURCE));
	out_uint16_le(s, (RDP_PDU_CONFIRM_ACTIVE | 0x10));	/* Version 1 */
	out_uint16_le(s, (g_mcs_userid + 1001));

	out_uint32_le(s, g_rdp_shareid);
	out_uint16_le(s, 0x3ea);	/* userid */
	out_uint16_le(s, sizeof(RDP_SOURCE));
	out_uint16_le(s, caplen);

	out_uint8p(s, RDP_SOURCE, sizeof(RDP_SOURCE));
	out_uint16_le(s, 0xd);	/* num_caps */
	out_uint8s(s, 2);	/* pad */

	rdp_out_general_caps(s);
	rdp_out_bitmap_caps(s);
	rdp_out_order_caps(s);
	rdp_out_bmpcache_caps(s);
	rdp_out_colcache_caps(s);
	rdp_out_activate_caps(s);
	rdp_out_control_caps(s);
	rdp_out_pointer_caps(s);
	rdp_out_share_caps(s);
	rdp_out_unknown_caps(s);

	s_mark_end(s);
	sec_send(s, sec_flags);
}
开发者ID:z0x010,项目名称:rdesktop,代码行数:41,代码来源:rdp.c


示例20: licence_present

/* Present an existing licence to the server */
static void
licence_present(RDConnectionRef conn, uint8 * client_random, uint8 * rsa_data,
		uint8 * licence_data, int licence_size, uint8 * hwid, uint8 * signature)
{
	uint32 sec_flags = SEC_LICENCE_NEG;
	uint16 length =
		16 + SEC_RANDOM_SIZE + SEC_MODULUS_SIZE + SEC_PADDING_SIZE +
		licence_size + LICENCE_HWID_SIZE + LICENCE_SIGNATURE_SIZE;
	RDStreamRef s;

	s = sec_init(conn, sec_flags, length + 4);

	out_uint8(s, LICENCE_TAG_PRESENT);
	out_uint8(s, 2);	/* version */
	out_uint16_le(s, length);

	out_uint32_le(s, 1);
	out_uint16(s, 0);
	out_uint16_le(s, 0x0201);

	out_uint8p(s, client_random, SEC_RANDOM_SIZE);
	out_uint16(s, 0);
	out_uint16_le(s, (SEC_MODULUS_SIZE + SEC_PADDING_SIZE));
	out_uint8p(s, rsa_data, SEC_MODULUS_SIZE);
	out_uint8s(s, SEC_PADDING_SIZE);

	out_uint16_le(s, 1);
	out_uint16_le(s, licence_size);
	out_uint8p(s, licence_data, licence_size);

	out_uint16_le(s, 1);
	out_uint16_le(s, LICENCE_HWID_SIZE);
	out_uint8p(s, hwid, LICENCE_HWID_SIZE);

	out_uint8p(s, signature, LICENCE_SIGNATURE_SIZE);

	s_mark_end(s);
	sec_send(conn, s, sec_flags);
}
开发者ID:3990995,项目名称:CoRD,代码行数:40,代码来源:licence.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ outb函数代码示例发布时间:2022-05-30
下一篇:
C++ out_uint8p函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap