wStream* rdp_send_stream_init(rdpRdp* rdp) { wStream* s; s = transport_send_stream_init(rdp->transport, 2048); rdp_init_stream(rdp, s); return s; }
wStream* license_send_stream_init(rdpLicense* license) { wStream* s; BOOL do_crypt = license->rdp->do_crypt; license->rdp->sec_flags = SEC_LICENSE_PKT; /** * Encryption of licensing packets is optional even if the rdp security * layer is used. If the peer has not indicated that it is capable of * processing encrypted licensing packets (rdp->do_crypt_license) we turn * off encryption (via rdp->do_crypt) before initializing the rdp stream * and reenable it afterwards. */ if (do_crypt) { license->rdp->sec_flags |= SEC_LICENSE_ENCRYPT_CS; license->rdp->do_crypt = license->rdp->do_crypt_license; } s = transport_send_stream_init(license->rdp->transport, 4096); if (!s) return NULL; rdp_init_stream(license->rdp, s); license->rdp->do_crypt = do_crypt; license->PacketHeaderLength = Stream_GetPosition(s); Stream_Seek(s, LICENSE_PREAMBLE_LENGTH); return s; }
wStream* license_send_stream_init(rdpLicense* license) { wStream* s; license->rdp->sec_flags = SEC_LICENSE_PKT; if (license->rdp->do_crypt) license->rdp->sec_flags |= SEC_LICENSE_ENCRYPT_CS; s = transport_send_stream_init(license->rdp->transport, 4096); rdp_init_stream(license->rdp, s); license->PacketHeaderLength = Stream_GetPosition(s); Stream_Seek(s, LICENSE_PREAMBLE_LENGTH); return s; }
BOOL rdp_send_client_info(rdpRdp* rdp) { wStream* s; BOOL status; rdp->sec_flags |= SEC_INFO_PKT; s = Stream_New(NULL, 2048); rdp_init_stream(rdp, s); rdp_write_info_packet(s, rdp->settings); status = rdp_send(rdp, s, MCS_GLOBAL_CHANNEL_ID); Stream_Free(s, TRUE); return status; }