BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp) { wStream* s; s = rdp_data_pdu_init(rdp); rdp_write_client_persistent_key_list_pdu(s, rdp->settings); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_BITMAP_CACHE_PERSISTENT_LIST, rdp->mcs->userId); }
BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp) { wStream* s = rdp_data_pdu_init(rdp); Stream_Write_UINT16(s, CTRLACTION_GRANTED_CONTROL); /* action (2 bytes) */ Stream_Write_UINT16(s, rdp->mcs->userId); /* grantId (2 bytes) */ Stream_Write_UINT32(s, 0x03EA); /* controlId (4 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); }
static void update_send_frame_acknowledge(rdpRdp* rdp, UINT32 frameId) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_UINT32(s, frameId); rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, rdp->mcs->user_id); }
BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action) { wStream* s; s = rdp_data_pdu_init(rdp); rdp_write_client_control_pdu(s, action); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); }
BOOL rdp_send_server_synchronize_pdu(rdpRdp* rdp) { wStream* s; s = rdp_data_pdu_init(rdp); rdp_write_synchronize_pdu(s, rdp->settings); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SYNCHRONIZE, rdp->mcs->userId); }
boolean rdp_send_client_control_pdu(rdpRdp* rdp, uint16 action) { STREAM* s; s = rdp_data_pdu_init(rdp); rdp_write_client_control_pdu(s, action); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id); }
boolean rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags) { STREAM* s; s = rdp_data_pdu_init(rdp); rdp_write_client_font_list_pdu(s, flags); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_LIST, rdp->mcs->user_id); }
BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags) { wStream* s; s = rdp_data_pdu_init(rdp); rdp_write_client_font_list_pdu(s, flags); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_LIST, rdp->mcs->userId); }
boolean rdp_send_client_synchronize_pdu(rdpRdp* rdp) { STREAM* s; s = rdp_data_pdu_init(rdp); rdp_write_synchronize_pdu(s, rdp->settings); return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SYNCHRONIZE, rdp->mcs->user_id); }
BOOL rdp_send_server_font_map_pdu(rdpRdp* rdp) { wStream* s; s = rdp_data_pdu_init(rdp); Stream_Write_UINT16(s, 0); /* numberEntries (2 bytes) */ Stream_Write_UINT16(s, 0); /* totalNumEntries (2 bytes) */ Stream_Write_UINT16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */ Stream_Write_UINT16(s, 4); /* entrySize (2 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->userId); }
void rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp) { STREAM* s; s = rdp_data_pdu_init(rdp); rdp_write_client_persistent_key_list_pdu(s, rdp->settings); rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_BITMAP_CACHE_PERSISTENT_LIST, rdp->mcs->user_id); }
BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp) { wStream* s; s = rdp_data_pdu_init(rdp); Stream_Write_UINT16(s, CTRLACTION_COOPERATE); /* action (2 bytes) */ Stream_Write_UINT16(s, 0); /* grantId (2 bytes) */ Stream_Write_UINT32(s, 0); /* controlId (4 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->userId); }
int rdp_send_frame_ack(rdpRdp* rdp, int frame) { STREAM* s; if (rdp->settings->frame_acknowledge == 0) { return 0; } s = rdp_data_pdu_init(rdp); stream_write_uint32(s, frame); rdp_send_data_pdu(rdp, s, 56, rdp->mcs->user_id); return 0; }
static void update_send_suppress_output(rdpContext* context, BYTE allow, RECTANGLE_16* area) { STREAM* s; rdpRdp* rdp = context->rdp; if (rdp->settings->SuppressOutput) { s = rdp_data_pdu_init(rdp); update_write_suppress_output(s, allow, area); rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SUPPRESS_OUTPUT, rdp->mcs->user_id); } }
static void update_send_refresh_rect(rdpContext* context, BYTE count, RECTANGLE_16* areas) { STREAM* s; rdpRdp* rdp = context->rdp; if (rdp->settings->RefreshRect) { s = rdp_data_pdu_init(rdp); update_write_refresh_rect(s, count, areas); rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_REFRESH_RECT, rdp->mcs->user_id); } }
static void update_send_frame_acknowledge(rdpContext* context, UINT32 frameId) { wStream* s; rdpRdp* rdp = context->rdp; if (rdp->settings->ReceivedCapabilities[CAPSET_TYPE_FRAME_ACKNOWLEDGE]) { s = rdp_data_pdu_init(rdp); Stream_Write_UINT32(s, frameId); rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FRAME_ACKNOWLEDGE, rdp->mcs->user_id); Stream_Release(s); } }
boolean rdp_send_server_font_map_pdu(rdpRdp* rdp) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_uint16(s, 0); /* numberEntries (2 bytes) */ stream_write_uint16(s, 0); /* totalNumEntries (2 bytes) */ stream_write_uint16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */ stream_write_uint16(s, 4); /* entrySize (2 bytes) */ return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->user_id); }
BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_UINT16(s, CTRLACTION_COOPERATE); /* action (2 bytes) */ stream_write_UINT16(s, 0); /* grantId (2 bytes) */ stream_write_UINT32(s, 0); /* controlId (4 bytes) */ rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id); return TRUE; }
int rdp_send_invalidate(rdpRdp* rdp, int code, int x, int y, int w, int h) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_uint8(s, 1); stream_seek(s, 3); stream_write_uint16(s, x); stream_write_uint16(s, y); stream_write_uint16(s, x + w); stream_write_uint16(s, y + h); rdp_send_data_pdu(rdp, s, 33, rdp->mcs->user_id); /* PDUTYPE2_REFRESH_RECT */ return 0; }
boolean rdp_send_server_control_granted_pdu(rdpRdp* rdp) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_uint16(s, CTRLACTION_GRANTED_CONTROL); /* action (2 bytes) */ stream_write_uint16(s, rdp->mcs->user_id); /* grantId (2 bytes) */ stream_write_uint32(s, 0x03EA); /* controlId (4 bytes) */ rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id); return true; }
/* this one is not hooked up yet */ int rdp_send_suppress_output(rdpRdp* rdp, int code, int x, int y, int w, int h) { STREAM* s; s = rdp_data_pdu_init(rdp); stream_write_uint32(s, code); switch (code) { case 0: /* shut the server up */ break; case 1: /* receive data again */ printf("x %d y %d w %d h %d\n", x, y, w, h); stream_write_uint16(s, x); stream_write_uint16(s, y); stream_write_uint16(s, w); stream_write_uint16(s, h); break; } rdp_send_data_pdu(rdp, s, 35, rdp->mcs->user_id); /* RDP_DATA_PDU_SUPPRESS_OUTPUT */ return 0; }
BOOL rdp_server_accept_client_font_list_pdu(rdpRdp* rdp, wStream* s) { rdpSettings* settings = rdp->settings; freerdp_peer* peer = rdp->context->peer; if (!rdp_recv_client_font_list_pdu(s)) return FALSE; if (settings->SupportMonitorLayoutPdu && settings->MonitorCount && peer->AdjustMonitorsLayout && peer->AdjustMonitorsLayout(peer)) { /* client supports the monitorLayout PDU, let's send him the monitors if any */ wStream* st = rdp_data_pdu_init(rdp); BOOL r; if (!st) return FALSE; if (!rdp_write_monitor_layout_pdu(st, settings->MonitorCount, settings->MonitorDefArray)) { Stream_Release(st); return FALSE; } r = rdp_send_data_pdu(rdp, st, DATA_PDU_TYPE_MONITOR_LAYOUT, 0); if (!r) return FALSE; } if (!rdp_send_server_font_map_pdu(rdp)) return FALSE; if (rdp_server_transition_to_state(rdp, CONNECTION_STATE_ACTIVE) < 0) return FALSE; return TRUE; }
void rdp_send_client_input_pdu(rdpRdp* rdp, STREAM* s) { rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_INPUT, rdp->mcs->user_id); }
BOOL rdp_send_client_input_pdu(rdpRdp* rdp, wStream* s) { return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_INPUT, rdp->mcs->userId); }