libfreerdp-core: make use of rdpMcs* instead of rdpSettings* in most GCC functions

This commit is contained in:
Marc-André Moreau 2014-02-13 17:50:38 -05:00
parent e5990fa60c
commit c5b14a5e0a
4 changed files with 130 additions and 102 deletions

View File

@ -137,7 +137,7 @@ BYTE h221_sc_key[4] = "McDn";
* @param settings rdp settings
*/
BOOL gcc_read_conference_create_request(wStream* s, rdpSettings* settings)
BOOL gcc_read_conference_create_request(wStream* s, rdpMcs* mcs)
{
UINT16 length;
BYTE choice;
@ -181,7 +181,7 @@ BOOL gcc_read_conference_create_request(wStream* s, rdpSettings* settings)
return FALSE;
if (Stream_GetRemainingLength(s) < length)
return FALSE;
if (!gcc_read_client_data_blocks(s, settings, length))
if (!gcc_read_client_data_blocks(s, mcs, length))
return FALSE;
return TRUE;
@ -194,14 +194,14 @@ BOOL gcc_read_conference_create_request(wStream* s, rdpSettings* settings)
* @param user_data client data blocks
*/
void gcc_write_conference_create_request(wStream* s, wStream* user_data)
void gcc_write_conference_create_request(wStream* s, wStream* userData)
{
/* ConnectData */
per_write_choice(s, 0); /* From Key select object (0) of type OBJECT_IDENTIFIER */
per_write_object_identifier(s, t124_02_98_oid); /* ITU-T T.124 (02/98) OBJECT_IDENTIFIER */
/* ConnectData::connectPDU (OCTET_STRING) */
per_write_length(s, Stream_GetPosition(user_data) + 14); /* connectPDU length */
per_write_length(s, Stream_GetPosition(userData) + 14); /* connectPDU length */
/* ConnectGCCPDU */
per_write_choice(s, 0); /* From ConnectGCCPDU select conferenceCreateRequest (0) of type ConferenceCreateRequest */
@ -219,10 +219,10 @@ void gcc_write_conference_create_request(wStream* s, wStream* user_data)
per_write_octet_string(s, h221_cs_key, 4, 4); /* h221NonStandard, client-to-server H.221 key, "Duca" */
/* userData::value (OCTET_STRING) */
per_write_octet_string(s, user_data->buffer, Stream_GetPosition(user_data), 0); /* array of client data blocks */
per_write_octet_string(s, userData->buffer, Stream_GetPosition(userData), 0); /* array of client data blocks */
}
BOOL gcc_read_conference_create_response(wStream* s, rdpSettings* settings)
BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs)
{
UINT16 length;
UINT32 tag;
@ -272,7 +272,7 @@ BOOL gcc_read_conference_create_response(wStream* s, rdpSettings* settings)
if (!per_read_length(s, &length))
return FALSE;
if (!gcc_read_server_data_blocks(s, settings, length))
if (!gcc_read_server_data_blocks(s, mcs, length))
{
fprintf(stderr, "gcc_read_conference_create_response: gcc_read_server_data_blocks failed\n");
return FALSE;
@ -315,7 +315,7 @@ void gcc_write_conference_create_response(wStream* s, wStream* userData)
per_write_octet_string(s, userData->buffer, Stream_GetPosition(userData), 0); /* array of server data blocks */
}
BOOL gcc_read_client_data_blocks(wStream* s, rdpSettings* settings, int length)
BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length)
{
UINT16 type;
UINT16 blockLength;
@ -334,42 +334,42 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpSettings* settings, int length)
switch (type)
{
case CS_CORE:
if (!gcc_read_client_core_data(s, settings, blockLength - 4))
if (!gcc_read_client_core_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_SECURITY:
if (!gcc_read_client_security_data(s, settings, blockLength - 4))
if (!gcc_read_client_security_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_NET:
if (!gcc_read_client_network_data(s, settings, blockLength - 4))
if (!gcc_read_client_network_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_CLUSTER:
if (!gcc_read_client_cluster_data(s, settings, blockLength - 4))
if (!gcc_read_client_cluster_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_MONITOR:
if (!gcc_read_client_monitor_data(s, settings, blockLength - 4))
if (!gcc_read_client_monitor_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_MCS_MSGCHANNEL:
if (!gcc_read_client_message_channel_data(s, settings, blockLength - 4))
if (!gcc_read_client_message_channel_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_MONITOR_EX:
if (!gcc_read_client_monitor_extended_data(s, settings, blockLength - 4))
if (!gcc_read_client_monitor_extended_data(s, mcs, blockLength - 4))
return FALSE;
break;
case CS_MULTITRANSPORT:
if (!gcc_read_client_multitransport_channel_data(s, settings, blockLength - 4))
if (!gcc_read_client_multitransport_channel_data(s, mcs, blockLength - 4))
return FALSE;
break;
@ -394,12 +394,14 @@ BOOL gcc_read_client_data_blocks(wStream* s, rdpSettings* settings, int length)
return TRUE;
}
void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings)
void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs)
{
gcc_write_client_core_data(s, settings);
gcc_write_client_cluster_data(s, settings);
gcc_write_client_security_data(s, settings);
gcc_write_client_network_data(s, settings);
rdpSettings* settings = mcs->settings;
gcc_write_client_core_data(s, mcs);
gcc_write_client_cluster_data(s, mcs);
gcc_write_client_security_data(s, mcs);
gcc_write_client_network_data(s, mcs);
/* extended client data supported */
@ -407,10 +409,10 @@ void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings)
{
if (settings->SpanMonitors)
{
gcc_write_client_monitor_data(s, settings);
gcc_write_client_monitor_data(s, mcs);
}
gcc_write_client_message_channel_data(s, settings);
gcc_write_client_multitransport_channel_data(s, settings);
gcc_write_client_message_channel_data(s, mcs);
gcc_write_client_multitransport_channel_data(s, mcs);
}
else
{
@ -421,7 +423,7 @@ void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings)
if (settings->ForceMultimon)
{
fprintf(stderr, "Sending multi monitor information anyway (may break connectivity!)\n");
gcc_write_client_monitor_data(s, settings);
gcc_write_client_monitor_data(s, mcs);
}
else
{
@ -431,7 +433,7 @@ void gcc_write_client_data_blocks(wStream* s, rdpSettings* settings)
}
}
BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length)
{
UINT16 type;
UINT16 offset = 0;
@ -451,7 +453,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
switch (type)
{
case SC_CORE:
if (!gcc_read_server_core_data(s, settings))
if (!gcc_read_server_core_data(s, mcs))
{
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_core_data failed\n");
return FALSE;
@ -459,7 +461,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
break;
case SC_SECURITY:
if (!gcc_read_server_security_data(s, settings))
if (!gcc_read_server_security_data(s, mcs))
{
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_security_data failed\n");
return FALSE;
@ -467,7 +469,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
break;
case SC_NET:
if (!gcc_read_server_network_data(s, settings))
if (!gcc_read_server_network_data(s, mcs))
{
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_network_data failed\n");
return FALSE;
@ -475,7 +477,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
break;
case SC_MCS_MSGCHANNEL:
if (!gcc_read_server_message_channel_data(s, settings))
if (!gcc_read_server_message_channel_data(s, mcs))
{
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_message_channel_data failed\n");
return FALSE;
@ -483,7 +485,7 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
break;
case SC_MULTITRANSPORT:
if (!gcc_read_server_multitransport_channel_data(s, settings))
if (!gcc_read_server_multitransport_channel_data(s, mcs))
{
fprintf(stderr, "gcc_read_server_data_blocks: gcc_read_server_multitransport_channel_data failed\n");
return FALSE;
@ -501,11 +503,11 @@ BOOL gcc_read_server_data_blocks(wStream* s, rdpSettings* settings, int length)
return TRUE;
}
void gcc_write_server_data_blocks(wStream* s, rdpSettings* settings)
void gcc_write_server_data_blocks(wStream* s, rdpMcs* mcs)
{
gcc_write_server_core_data(s, settings); /* serverCoreData */
gcc_write_server_network_data(s, settings); /* serverNetworkData */
gcc_write_server_security_data(s, settings); /* serverSecurityData */
gcc_write_server_core_data(s, mcs); /* serverCoreData */
gcc_write_server_network_data(s, mcs); /* serverNetworkData */
gcc_write_server_security_data(s, mcs); /* serverSecurityData */
/* TODO: Send these GCC data blocks only when the client sent them */
//gcc_write_server_message_channel_data(s, settings); /* serverMessageChannelData */
@ -547,7 +549,7 @@ void gcc_write_user_data_header(wStream* s, UINT16 type, UINT16 length)
* @param settings rdp settings
*/
BOOL gcc_read_client_core_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
char* str = NULL;
UINT32 version;
@ -562,6 +564,7 @@ BOOL gcc_read_client_core_data(wStream* s, rdpSettings* settings, UINT16 blockLe
UINT16 desktopOrientation = 0;
UINT32 desktopScaleFactor = 0;
UINT32 deviceScaleFactor = 0;
rdpSettings* settings = mcs->settings;
/* Length of all required fields, until imeFileName */
if (blockLength < 128)
@ -747,7 +750,7 @@ BOOL gcc_read_client_core_data(wStream* s, rdpSettings* settings, UINT16 blockLe
* @param settings rdp settings
*/
void gcc_write_client_core_data(wStream* s, rdpSettings* settings)
void gcc_write_client_core_data(wStream* s, rdpMcs* mcs)
{
UINT32 version;
WCHAR* clientName = NULL;
@ -758,6 +761,7 @@ void gcc_write_client_core_data(wStream* s, rdpSettings* settings)
UINT16 earlyCapabilityFlags;
WCHAR* clientDigProductId = NULL;
int clientDigProductIdLength;
rdpSettings* settings = mcs->settings;
gcc_write_user_data_header(s, CS_CORE, 216);
@ -851,11 +855,12 @@ void gcc_write_client_core_data(wStream* s, rdpSettings* settings)
Stream_Write_UINT32(s, settings->SelectedProtocol); /* serverSelectedProtocol */
}
BOOL gcc_read_server_core_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs)
{
UINT32 version;
UINT32 clientRequestedProtocols;
UINT32 earlyCapabilityFlags;
rdpSettings* settings = mcs->settings;
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
@ -880,8 +885,10 @@ BOOL gcc_read_server_core_data(wStream* s, rdpSettings* settings)
return TRUE;
}
void gcc_write_server_core_data(wStream* s, rdpSettings* settings)
void gcc_write_server_core_data(wStream* s, rdpMcs* mcs)
{
rdpSettings* settings = mcs->settings;
gcc_write_user_data_header(s, SC_CORE, 16);
Stream_Write_UINT32(s, settings->RdpVersion == 4 ? RDP_VERSION_4 : RDP_VERSION_5_PLUS);
@ -896,8 +903,10 @@ void gcc_write_server_core_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_security_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
rdpSettings* settings = mcs->settings;
if (blockLength < 8)
return FALSE;
@ -921,8 +930,10 @@ BOOL gcc_read_client_security_data(wStream* s, rdpSettings* settings, UINT16 blo
* @param settings rdp settings
*/
void gcc_write_client_security_data(wStream* s, rdpSettings* settings)
void gcc_write_client_security_data(wStream* s, rdpMcs* mcs)
{
rdpSettings* settings = mcs->settings;
gcc_write_user_data_header(s, CS_SECURITY, 12);
if (settings->DisableEncryption)
@ -938,13 +949,15 @@ void gcc_write_client_security_data(wStream* s, rdpSettings* settings)
}
}
BOOL gcc_read_server_security_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs)
{
BYTE* data;
UINT32 length;
rdpSettings* settings = mcs->settings;
if (Stream_GetRemainingLength(s) < 8)
return FALSE;
Stream_Read_UINT32(s, settings->EncryptionMethods); /* encryptionMethod */
Stream_Read_UINT32(s, settings->EncryptionLevel); /* encryptionLevel */
@ -959,6 +972,7 @@ BOOL gcc_read_server_security_data(wStream* s, rdpSettings* settings)
if (Stream_GetRemainingLength(s) < 8)
return FALSE;
Stream_Read_UINT32(s, settings->ServerRandomLength); /* serverRandomLen */
Stream_Read_UINT32(s, settings->ServerCertificateLength); /* serverCertLen */
@ -1044,7 +1058,7 @@ const BYTE tssk_exponent[] =
0x5b, 0x7b, 0x88, 0xc0
};
void gcc_write_server_security_data(wStream* s, rdpSettings* settings)
void gcc_write_server_security_data(wStream* s, rdpMcs* mcs)
{
CryptoMd5 md5;
BYTE* sigData;
@ -1052,6 +1066,7 @@ void gcc_write_server_security_data(wStream* s, rdpSettings* settings)
BYTE encryptedSignature[TSSK_KEY_LENGTH];
BYTE signature[sizeof(initial_signature)];
UINT32 headerLen, serverRandomLen, serverCertLen, wPublicKeyBlobLen;
rdpSettings* settings = mcs->settings;
if (!settings->DisableEncryption)
{
@ -1173,9 +1188,10 @@ void gcc_write_server_security_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_network_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 i;
rdpSettings* settings = mcs->settings;
if (blockLength < 4)
return FALSE;
@ -1207,10 +1223,11 @@ BOOL gcc_read_client_network_data(wStream* s, rdpSettings* settings, UINT16 bloc
* @param settings rdp settings
*/
void gcc_write_client_network_data(wStream* s, rdpSettings* settings)
void gcc_write_client_network_data(wStream* s, rdpMcs* mcs)
{
UINT32 i;
UINT16 length;
rdpSettings* settings = mcs->settings;
if (settings->ChannelCount > 0)
{
@ -1229,12 +1246,13 @@ void gcc_write_client_network_data(wStream* s, rdpSettings* settings)
}
}
BOOL gcc_read_server_network_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs)
{
int i;
UINT16 MCSChannelId;
UINT16 channelCount, channelsToTreat;
UINT16 channelId;
rdpSettings* settings = mcs->settings;
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
@ -1269,9 +1287,10 @@ BOOL gcc_read_server_network_data(wStream* s, rdpSettings* settings)
return TRUE;
}
void gcc_write_server_network_data(wStream* s, rdpSettings* settings)
void gcc_write_server_network_data(wStream* s, rdpMcs* mcs)
{
UINT32 i;
rdpSettings* settings = mcs->settings;
gcc_write_user_data_header(s, SC_NET, 8 + settings->ChannelCount * 2 + (settings->ChannelCount % 2 == 1 ? 2 : 0));
@ -1294,10 +1313,11 @@ void gcc_write_server_network_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_cluster_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 flags;
UINT32 redirectedSessionId;
rdpSettings* settings = mcs->settings;
if (blockLength < 8)
return FALSE;
@ -1318,9 +1338,10 @@ BOOL gcc_read_client_cluster_data(wStream* s, rdpSettings* settings, UINT16 bloc
* @param settings rdp settings
*/
void gcc_write_client_cluster_data(wStream* s, rdpSettings* settings)
void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs)
{
UINT32 flags;
rdpSettings* settings = mcs->settings;
gcc_write_user_data_header(s, CS_CLUSTER, 12);
@ -1340,7 +1361,7 @@ void gcc_write_client_cluster_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_monitor_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 index;
UINT32 flags;
@ -1380,11 +1401,12 @@ BOOL gcc_read_client_monitor_data(wStream* s, rdpSettings* settings, UINT16 bloc
* @param settings rdp settings
*/
void gcc_write_client_monitor_data(wStream* s, rdpSettings* settings)
void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs)
{
int i;
UINT16 length;
UINT32 left, top, right, bottom, flags;
rdpSettings* settings = mcs->settings;
if (settings->MonitorCount > 1)
{
@ -1411,7 +1433,7 @@ void gcc_write_client_monitor_data(wStream* s, rdpSettings* settings)
}
}
BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 index;
UINT32 flags;
@ -1449,7 +1471,7 @@ BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpSettings* settings, UI
return TRUE;
}
void gcc_write_client_monitor_extended_data(wStream* s, rdpSettings* settings)
void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs)
{
}
@ -1461,7 +1483,7 @@ void gcc_write_client_monitor_extended_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_message_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 flags;
@ -1480,8 +1502,10 @@ BOOL gcc_read_client_message_channel_data(wStream* s, rdpSettings* settings, UIN
* @param settings rdp settings
*/
void gcc_write_client_message_channel_data(wStream* s, rdpSettings* settings)
void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs)
{
rdpSettings* settings = mcs->settings;
if (settings->NetworkAutoDetect ||
settings->SupportHeartbeatPdu ||
settings->SupportMultitransport)
@ -1492,9 +1516,8 @@ void gcc_write_client_message_channel_data(wStream* s, rdpSettings* settings)
}
}
BOOL gcc_read_server_message_channel_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_server_message_channel_data(wStream* s, rdpMcs* mcs)
{
freerdp* instance;
UINT16 MCSChannelId;
if (Stream_GetRemainingLength(s) < 2)
@ -1503,13 +1526,12 @@ BOOL gcc_read_server_message_channel_data(wStream* s, rdpSettings* settings)
Stream_Read_UINT16(s, MCSChannelId); /* MCSChannelId */
/* Save the MCS message channel id */
instance = (freerdp*) settings->instance;
instance->context->rdp->mcs->messageChannelId = MCSChannelId;
mcs->messageChannelId = MCSChannelId;
return TRUE;
}
void gcc_write_server_message_channel_data(wStream* s, rdpSettings* settings)
void gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs)
{
UINT16 mcsChannelId = 0;
@ -1525,7 +1547,7 @@ void gcc_write_server_message_channel_data(wStream* s, rdpSettings* settings)
* @param settings rdp settings
*/
BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpSettings* settings, UINT16 blockLength)
BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength)
{
UINT32 flags;
@ -1544,8 +1566,10 @@ BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpSettings* settin
* @param settings rdp settings
*/
void gcc_write_client_multitransport_channel_data(wStream* s, rdpSettings* settings)
void gcc_write_client_multitransport_channel_data(wStream* s, rdpMcs* mcs)
{
rdpSettings* settings = mcs->settings;
if (settings->MultitransportFlags != 0)
{
gcc_write_user_data_header(s, CS_MULTITRANSPORT, 8);
@ -1554,7 +1578,7 @@ void gcc_write_client_multitransport_channel_data(wStream* s, rdpSettings* setti
}
}
BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpSettings* settings)
BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpMcs* mcs)
{
UINT32 flags;
@ -1566,7 +1590,7 @@ BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpSettings* settin
return TRUE;
}
void gcc_write_server_multitransport_channel_data(wStream* s, rdpSettings* settings)
void gcc_write_server_multitransport_channel_data(wStream* s, rdpMcs* mcs)
{
UINT32 flags = 0;

View File

@ -29,41 +29,41 @@
#include <winpr/stream.h>
BOOL gcc_read_conference_create_request(wStream* s, rdpSettings* settings);
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_conference_create_request(wStream* s, rdpMcs* mcs);
void gcc_write_conference_create_request(wStream* s, wStream* userData);
BOOL gcc_read_conference_create_response(wStream* s, rdpMcs* mcs);
void gcc_write_conference_create_response(wStream* s, wStream* userData);
BOOL gcc_read_client_data_blocks(wStream* s, rdpMcs* mcs, int length);
void gcc_write_client_data_blocks(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_data_blocks(wStream* s, rdpMcs* mcs, int length);
void gcc_write_server_data_blocks(wStream* s, rdpMcs* mcs);
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_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);
BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_core_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_core_data(wStream* s, rdpMcs* mcs);
void gcc_write_server_core_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_security_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_security_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_security_data(wStream* s, rdpMcs* mcs);
void gcc_write_server_security_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_network_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_network_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_network_data(wStream* s, rdpMcs* mcs);
void gcc_write_server_network_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_cluster_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_cluster_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_monitor_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_monitor_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_monitor_extended_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_monitor_extended_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_message_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_message_channel_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_message_channel_data(wStream* s, rdpMcs* mcs);
void gcc_write_server_message_channel_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_client_multitransport_channel_data(wStream* s, rdpMcs* mcs, UINT16 blockLength);
void gcc_write_client_multitransport_channel_data(wStream* s, rdpMcs* mcs);
BOOL gcc_read_server_multitransport_channel_data(wStream* s, rdpMcs* mcs);
void gcc_write_server_multitransport_channel_data(wStream* s, rdpMcs* mcs);
#endif /* FREERDP_CORE_GCC_H */

View File

@ -485,7 +485,7 @@ BOOL mcs_recv_connect_initial(rdpMcs* mcs, wStream* s)
if (!ber_read_octet_string_tag(s, &length) || ((int) Stream_GetRemainingLength(s)) < length)
return FALSE;
if (!gcc_read_conference_create_request(s, mcs->transport->settings))
if (!gcc_read_conference_create_request(s, mcs))
return FALSE;
if (!mcs_merge_domain_parameters(&mcs->targetParameters, &mcs->minimumParameters,
@ -580,7 +580,7 @@ BOOL mcs_send_connect_initial(rdpMcs* mcs)
wStream* client_data;
client_data = Stream_New(NULL, 512);
gcc_write_client_data_blocks(client_data, mcs->transport->settings);
gcc_write_client_data_blocks(client_data, mcs);
gcc_CCrq = Stream_New(NULL, 1024);
gcc_write_conference_create_request(gcc_CCrq, client_data);
@ -637,7 +637,7 @@ BOOL mcs_recv_connect_response(rdpMcs* mcs, wStream* s)
return FALSE;
}
if (!gcc_read_conference_create_response(s, mcs->transport->settings))
if (!gcc_read_conference_create_response(s, mcs))
{
fprintf(stderr, "mcs_recv_connect_response: gcc_read_conference_create_response failed\n");
return FALSE;
@ -662,7 +662,7 @@ BOOL mcs_send_connect_response(rdpMcs* mcs)
wStream* server_data;
server_data = Stream_New(NULL, 512);
gcc_write_server_data_blocks(server_data, mcs->transport->settings);
gcc_write_server_data_blocks(server_data, mcs);
gcc_CCrsp = Stream_New(NULL, 512);
gcc_write_conference_create_response(gcc_CCrsp, server_data);
@ -1041,9 +1041,12 @@ rdpMcs* mcs_new(rdpTransport* transport)
ZeroMemory(mcs, sizeof(rdpMcs));
mcs->transport = transport;
mcs->settings = transport->settings;
mcs_init_domain_parameters(&mcs->targetParameters, 34, 2, 0, 0xFFFF);
mcs_init_domain_parameters(&mcs->minimumParameters, 1, 1, 1, 0x420);
mcs_init_domain_parameters(&mcs->maximumParameters, 0xFFFF, 0xFC17, 0xFFFF, 0xFFFF);
mcs_init_domain_parameters(&mcs->domainParameters, 0, 0, 0, 0xFFFF);
}
return mcs;

View File

@ -126,6 +126,7 @@ typedef struct
struct rdp_mcs
{
rdpTransport* transport;
rdpSettings* settings;
UINT16 userId;
UINT16 messageChannelId;