libfreerdp-core: add channel_id argument to rdp_write_header and rdp_send.

This commit is contained in:
Vic Lee 2011-08-03 12:34:55 +08:00
parent aa2320c9b8
commit 95a76fa888
4 changed files with 12 additions and 10 deletions

View File

@ -352,7 +352,7 @@ void rdp_send_client_info(rdpRdp* rdp)
rdp_write_security_header(s, SEC_INFO_PKT);
rdp_write_info_packet(s, rdp->settings);
rdp_send(rdp, s);
rdp_send(rdp, s, MCS_GLOBAL_CHANNEL_ID);
}
void rdp_recv_logon_info_v1(rdpRdp* rdp, STREAM* s)

View File

@ -141,7 +141,7 @@ void license_send(rdpLicense* license, STREAM* s, uint8 type)
wMsgSize = length - LICENSE_PACKET_HEADER_LENGTH;
flags = EXTENDED_ERROR_MSG_SUPPORTED | PREAMBLE_VERSION_3_0;
rdp_write_header(license->rdp, s, length);
rdp_write_header(license->rdp, s, length, MCS_GLOBAL_CHANNEL_ID);
rdp_write_security_header(s, sec_flags);
license_write_preamble(s, type, flags, wMsgSize);

View File

@ -174,13 +174,14 @@ STREAM* rdp_data_pdu_init(rdpRdp* rdp)
* @param rdp rdp module
* @param s stream
* @param length RDP packet length
* @param channel_id channel id
*/
void rdp_write_header(rdpRdp* rdp, STREAM* s, int length)
void rdp_write_header(rdpRdp* rdp, STREAM* s, int length, uint16 channel_id)
{
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_SendDataRequest, length);
per_write_integer16(s, rdp->mcs->user_id, MCS_BASE_CHANNEL_ID); /* initiator */
per_write_integer16(s, MCS_GLOBAL_CHANNEL_ID, 0); /* channelId */
per_write_integer16(s, channel_id, 0); /* channelId */
stream_write_uint8(s, 0x70); /* dataPriority + segmentation */
length = (length - RDP_PACKET_HEADER_LENGTH) | 0x8000;
@ -191,16 +192,17 @@ void rdp_write_header(rdpRdp* rdp, STREAM* s, int length)
* Send an RDP packet.\n
* @param rdp RDP module
* @param s stream
* @param channel_id channel id
*/
void rdp_send(rdpRdp* rdp, STREAM* s)
void rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id)
{
int length;
length = stream_get_length(s);
stream_set_pos(s, 0);
rdp_write_header(rdp, s, length);
rdp_write_header(rdp, s, length, channel_id);
stream_set_pos(s, length);
transport_write(rdp->transport, s);
@ -213,7 +215,7 @@ void rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id)
length = stream_get_length(s);
stream_set_pos(s, 0);
rdp_write_header(rdp, s, length);
rdp_write_header(rdp, s, length, MCS_GLOBAL_CHANNEL_ID);
rdp_write_share_control_header(s, length, type, channel_id);
stream_set_pos(s, length);
@ -227,7 +229,7 @@ void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id)
length = stream_get_length(s);
stream_set_pos(s, 0);
rdp_write_header(rdp, s, length);
rdp_write_header(rdp, s, length, MCS_GLOBAL_CHANNEL_ID);
rdp_write_share_control_header(s, length, PDU_TYPE_DATA, channel_id);
rdp_write_share_data_header(s, length, type, rdp->settings->share_id);

View File

@ -227,7 +227,7 @@ void rdp_read_share_data_header(STREAM* s, uint16* length, uint8* type, uint32*
void rdp_write_share_data_header(STREAM* s, uint16 length, uint8 type, uint32 share_id);
STREAM* rdp_send_stream_init(rdpRdp* rdp);
void rdp_write_header(rdpRdp* rdp, STREAM* s, int length);
void rdp_write_header(rdpRdp* rdp, STREAM* s, int length, uint16 channel_id);
STREAM* rdp_pdu_init(rdpRdp* rdp);
void rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
@ -235,7 +235,7 @@ void rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
STREAM* rdp_data_pdu_init(rdpRdp* rdp);
void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
void rdp_send(rdpRdp* rdp, STREAM* s);
void rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id);
void rdp_recv(rdpRdp* rdp);
int rdp_send_channel_data(rdpRdp* rdp, int channel_id, uint8* data, int size);