}
}
+BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
+{
+ UINT32 index;
+ UINT32 flags;
+ UINT32 monitorCount;
+ UINT32 monitorAttributeSize;
+ MONITOR_ATTRIBUTES* monitorAttributesArray;
+
+ if (blockLength < 8)
+ return FALSE;
+
+ Stream_Read_UINT32(s, flags); /* flags */
+ Stream_Read_UINT32(s, monitorAttributeSize); /* monitorAttributeSize */
+ Stream_Read_UINT32(s, monitorCount); /* monitorCount */
+
+ if (monitorAttributeSize != 20)
+ return FALSE;
+
+ if (blockLength < (12 + (monitorCount * monitorAttributeSize)))
+ return FALSE;
+
+ monitorAttributesArray = (MONITOR_ATTRIBUTES*) malloc(sizeof(MONITOR_ATTRIBUTES) * monitorCount);
+ ZeroMemory(monitorAttributesArray, sizeof(MONITOR_ATTRIBUTES) * monitorCount);
+
+ for (index = 0; index < monitorCount; index++)
+ {
+ Stream_Read_UINT32(s, monitorAttributesArray[index].physicalWidth); /* physicalWidth */
+ Stream_Read_UINT32(s, monitorAttributesArray[index].physicalHeight); /* physicalHeight */
+ Stream_Read_UINT32(s, monitorAttributesArray[index].orientation); /* orientation */
+ Stream_Read_UINT32(s, monitorAttributesArray[index].desktopScaleFactor); /* desktopScaleFactor */
+ Stream_Read_UINT32(s, monitorAttributesArray[index].deviceScaleFactor); /* deviceScaleFactor */
+ }
+
+ free(monitorAttributesArray);
+
+ return TRUE;
+}
+
+void gcc_write_client_monitor_extended_data(wStream* s, rdpSettings* settings)
+{
+
+}
+
+ /**
+ * Read a client message channel data block (TS_UD_CS_MCS_MSGCHANNEL).\n
+ * @msdn{jj217627}
+ * @param s stream
+ * @param settings rdp settings
+ */
+
BOOL gcc_read_client_message_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
{
- fprintf(stderr, "CS_MCS_MSGCHANNEL\n");
+ UINT32 flags;
+
+ if (blockLength < 4)
+ return FALSE;
+
+ Stream_Read_UINT32(s, flags);
+
return TRUE;
}
+ /**
+ * Write a client message channel data block (TS_UD_CS_MCS_MSGCHANNEL).\n
+ * @msdn{jj217627}
+ * @param s stream
+ * @param settings rdp settings
+ */
+
void gcc_write_client_message_channel_data(wStream* s, rdpSettings* settings)
{
- instance = (freerdp*)settings->instance;
+ if (settings->NetworkAutoDetect ||
+ settings->SupportHeartbeatPdu ||
+ settings->SupportMultitransport)
+ {
+ gcc_write_user_data_header(s, CS_MCS_MSGCHANNEL, 8);
+
+ Stream_Write_UINT32(s, 0); /* flags */
+ }
+ }
+
+ BOOL gcc_read_server_message_channel_data(wStream* s, rdpSettings* settings)
+ {
+ freerdp* instance;
+ UINT16 MCSChannelId;
+
+ if (Stream_GetRemainingLength(s) < 2)
+ return FALSE;
++
+ Stream_Read_UINT16(s, MCSChannelId); /* MCSChannelId */
+
+ /* Save the MCS message channel id */
- fprintf(stderr, "SC_MCS_MSGCHANNEL\n");
++ instance = (freerdp*) settings->instance;
+ instance->context->rdp->mcs->message_channel_id = MCSChannelId;
+
+ return TRUE;
+ }
+
+ void gcc_write_server_message_channel_data(wStream* s, rdpSettings* settings)
+ {
++ UINT16 mcsChannelId = 0;
+
++ gcc_write_user_data_header(s, SC_MCS_MSGCHANNEL, 6);
++
++ Stream_Write_UINT16(s, mcsChannelId); /* mcsChannelId (2 bytes) */
}
+ /**
+ * Read a client multitransport channel data block (TS_UD_CS_MULTITRANSPORT).\n
+ * @msdn{jj217498}
+ * @param s stream
+ * @param settings rdp settings
+ */
+
BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
{
- fprintf(stderr, "CS_MULTITRANSPORT\n");
+ UINT32 flags;
+
+ if (blockLength < 4)
+ return FALSE;
+
+ Stream_Read_UINT32(s, flags);
+
return TRUE;
}
+ /**
+ * Write a client multitransport channel data block (TS_UD_CS_MULTITRANSPORT).\n
+ * @msdn{jj217498}
+ * @param s stream
+ * @param settings rdp settings
+ */
+
void gcc_write_client_multitransport_channel_data(wStream* s, rdpSettings* settings)
{
- fprintf(stderr, "SC_MULTITRANSPORT\n");
-}
+ if (settings->MultitransportFlags != 0)
+ {
+ gcc_write_user_data_header(s, CS_MULTITRANSPORT, 8);
+
+ Stream_Write_UINT32(s, settings->MultitransportFlags); /* flags */
+ }
+ }
+
+ BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpSettings* settings)
+ {
+ UINT32 flags;
+
+ if (Stream_GetRemainingLength(s) < 4)
+ return FALSE;
+
+ Stream_Read_UINT32(s, flags); /* flags */
+
+ return TRUE;
+ }
+
+ void gcc_write_server_multitransport_channel_data(wStream* s, rdpSettings* settings)
+ {
++ UINT32 flags = 0;
++
++ gcc_write_user_data_header(s, SC_MULTITRANSPORT, 8);
+
++ Stream_Write_UINT32(s, flags); /* flags (4 bytes) */
+}
void gcc_write_conference_create_request(wStream* s, wStream* user_data);
BOOL gcc_read_conference_create_response(wStream* s, rdpSettings* settings);
void gcc_write_conference_create_response(wStream* s, wStream* user_data);
-BOOL gcc_read_client_data_blocks(wStream* s, rdpSettings *settings, int length);
-void gcc_write_client_data_blocks(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings *settings, int length);
-void gcc_write_server_data_blocks(wStream* s, rdpSettings *settings);
+BOOL gcc_read_client_data_blocks(wStream* s, rdpSettings* settings, int length);
+void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings);
+BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length);
+void gcc_write_server_data_blocks(wStream* s, rdpSettings* settings);
BOOL gcc_read_user_data_header(wStream* s, UINT16* type, UINT16* length);
void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length);
-BOOL gcc_read_client_core_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_core_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_core_data(wStream* s, rdpSettings *settings);
-void gcc_write_server_core_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_security_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_security_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_security_data(wStream* s, rdpSettings *settings);
-void gcc_write_server_security_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_network_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_network_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_network_data(wStream* s, rdpSettings *settings);
-void gcc_write_server_network_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_cluster_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_cluster_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_monitor_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_monitor_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_message_channel_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_message_channel_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_message_channel_data(wStream* s, rdpSettings *settings);
-void gcc_write_server_message_channel_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpSettings *settings, UINT16 blockLength);
-void gcc_write_client_multitransport_channel_data(wStream* s, rdpSettings *settings);
-BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpSettings *settings);
-void gcc_write_server_multitransport_channel_data(wStream* s, rdpSettings *settings);
+BOOL gcc_read_client_core_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_core_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_server_core_data(wStream* s, rdpSettings* settings);
+void gcc_write_server_core_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_security_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_security_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_server_security_data(wStream* s, rdpSettings* settings);
+void gcc_write_server_security_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_network_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_network_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_server_network_data(wStream* s, rdpSettings* settings);
+void gcc_write_server_network_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_cluster_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_cluster_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_monitor_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_monitor_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_monitor_extended_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_message_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_message_channel_data(wStream* s, rdpSettings* settings);
++BOOL gcc_read_server_message_channel_data(wStream* s, rdpSettings* settings);
+void gcc_write_server_message_channel_data(wStream* s, rdpSettings* settings);
+BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength);
+void gcc_write_client_multitransport_channel_data(wStream* s, rdpSettings* settings);
++BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpSettings* settings);
+void gcc_write_server_multitransport_channel_data(wStream* s, rdpSettings* settings);
#endif /* FREERDP_CORE_GCC_H */