22 static BOOL display_write_monitor_layout_pdu(
wStream* s, UINT32 monitorCount,
25 if (!Stream_EnsureRemainingCapacity(s, 4 + (monitorCount * 20)))
28 Stream_Write_UINT32(s, monitorCount);
30 for (UINT32 index = 0; index < monitorCount; index++)
32 const MONITOR_DEF* monitor = &monitorDefArray[index];
34 Stream_Write_INT32(s, monitor->left);
35 Stream_Write_INT32(s, monitor->top);
36 Stream_Write_INT32(s, monitor->right);
37 Stream_Write_INT32(s, monitor->bottom);
38 Stream_Write_UINT32(s, monitor->flags);
44 BOOL display_convert_rdp_monitor_to_monitor_def(UINT32 monitorCount,
50 if (!monitorDefArray || !result || (*result))
58 for (UINT32 index = 0; index < monitorCount; index++)
60 const rdpMonitor* monitor = &monitorDefArray[index];
63 current->left = monitor->x;
64 current->top = monitor->y;
65 current->right = monitor->x + monitor->width - 1;
66 current->bottom = monitor->y + monitor->height - 1;
67 current->flags = monitor->is_primary ? MONITOR_PRIMARY : 0x0;
74 BOOL freerdp_display_send_monitor_layout(rdpContext* context, UINT32 monitorCount,
77 rdpRdp* rdp = context->rdp;
78 wStream* st = rdp_data_pdu_init(rdp);
83 if (!display_write_monitor_layout_pdu(st, monitorCount, monitorDefArray))
89 return rdp_send_data_pdu(rdp, st, DATA_PDU_TYPE_MONITOR_LAYOUT, 0);