Esempio n. 1
0
/* Respond to a demand active PDU */
static void process_demand_active(STREAM s) {
	uint8 type;
	uint16 len_src_descriptor, len_combined_caps;

	in_uint32_le(s, g_rdp_shareid);
	in_uint16_le(s, len_src_descriptor);
	in_uint16_le(s, len_combined_caps);
	in_uint8s(s, len_src_descriptor);

	DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", g_rdp_shareid));
	rdp_process_server_caps(s, len_combined_caps);

	rdp_send_confirm_active();
	rdp_send_synchronise();
	rdp_send_control(RDP_CTL_COOPERATE);
	rdp_send_control(RDP_CTL_REQUEST_CONTROL);
	rdp_recv(&type); /* RDP_PDU_SYNCHRONIZE */
	rdp_recv(&type); /* RDP_CTL_COOPERATE */
	rdp_recv(&type); /* RDP_CTL_GRANT_CONTROL */
	rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0,
			g_numlock_sync ? ui_get_numlock_state(read_keyboard_state()) : 0,
			0);

	if (g_use_rdp5) {
		rdp_enum_bmpcache2();
		rdp_send_fonts(3);
	} else {
		rdp_send_fonts(1);
		rdp_send_fonts(2);
	}

	rdp_recv(&type); /* RDP_PDU_UNKNOWN 0x28 (Fonts?) */
	reset_order_state();
}
Esempio n. 2
0
/* Respond to a demand active PDU */
static BOOL
process_demand_active(RDPCLIENT * This, STREAM s)
{
	uint8 type;
	uint16 len_src_descriptor, len_combined_caps;

	in_uint32_le(s, This->rdp_shareid);
	in_uint16_le(s, len_src_descriptor);
	in_uint16_le(s, len_combined_caps);
	in_uint8s(s, len_src_descriptor);

	DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", This->rdp_shareid));
	rdp_process_server_caps(This, s, len_combined_caps);

	if
	(
		!rdp_send_confirm_active(This) ||
		!rdp_send_synchronise(This) ||
		!rdp_send_control(This, RDP_CTL_COOPERATE) ||
		!rdp_send_control(This, RDP_CTL_REQUEST_CONTROL) ||
		!rdp_recv(This, &type) ||	/* RDP_PDU_SYNCHRONIZE */
		!rdp_recv(This, &type) ||	/* RDP_CTL_COOPERATE */
		!rdp_recv(This, &type) ||	/* RDP_CTL_GRANT_CONTROL */
		!rdp_send_input(This, 0, RDP_INPUT_SYNCHRONIZE, 0,
				   /*This->numlock_sync ? ui_get_numlock_state(This, read_keyboard_state(This)) :*/ 0, 0) // TODO: keyboard mess
	)
		return False;

	if (This->use_rdp5)
	{
		if(!rdp_enum_bmpcache2(This) || !rdp_send_fonts(This, 3))
			return False;
	}
	else
	{
		if(!rdp_send_fonts(This, 1) || !rdp_send_fonts(This, 2))
			return False;
	}

	if(!rdp_recv(This, &type))	/* RDP_PDU_UNKNOWN 0x28 (Fonts?) */
		return False;

	reset_order_state(This);
	return True;
}
Esempio n. 3
0
/* Respond to a demand active PDU */
static void
process_demand_active(STREAM s)
{
	uint8 type;

	in_uint32_le(s, g_rdp_shareid);

	DEBUG(("DEMAND_ACTIVE(id=0x%x)\n", g_rdp_shareid));

	rdp_send_confirm_active();
	rdp_send_synchronise();
	rdp_send_control(RDP_CTL_COOPERATE);
	rdp_send_control(RDP_CTL_REQUEST_CONTROL);
	rdp_recv(&type);	/* RDP_PDU_SYNCHRONIZE */
	rdp_recv(&type);	/* RDP_CTL_COOPERATE */
	rdp_recv(&type);	/* RDP_CTL_GRANT_CONTROL */
	rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, ui_get_numlock_state(read_keyboard_state()), 0);
	rdp_send_fonts(1);
	rdp_send_fonts(2);
	rdp_recv(&type);	/* RDP_PDU_UNKNOWN 0x28 */
	reset_order_state();
}