Add support for standard Remote Assistance Connection String 2 without the extensions of the invitation file format.
@@ -743,9 +743,8 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu
size_t length;
p = strstr(buffer, "UPLOADINFO");
- if (!p)
- return -1;
-
+ if (p)
+ {
p = strstr(p + sizeof("UPLOADINFO") - 1, "TYPE=\"");
if (!p)
@@ -977,6 +976,27 @@ int freerdp_assistance_parse_file_buffer(rdpAssistanceFile* file, const char* bu
return 1;
}
+ p = strstr(buffer, "<E>");
+ if(p)
+ {
+ q = strstr(buffer, "</E>");
+ if (!q)
+ return -1;
+
+ q += sizeof("</E>") - 1;
+ length = q - p;
+ file->ConnectionString2 = (char*) malloc(length + 1);
+
+ CopyMemory(file->ConnectionString2, p, length);
+ file->ConnectionString2[length] = '\0';
+
+ if (!freerdp_assistance_parse_connection_string2(file))
+ return -1;
+ }
+
+ return 1;
+}
+
int freerdp_assistance_parse_file(rdpAssistanceFile* file, const char* name, const char* password)
{
int status;
@@ -1078,9 +1098,6 @@ BOOL freerdp_assistance_populate_settings_from_assistance_file(rdpAssistanceFile
if (freerdp_set_param_string(settings, FreeRDP_RemoteAssistancePassword, file->password) != 0)
return FALSE;
- if (freerdp_set_param_string(settings, FreeRDP_Username, file->Username) != 0)
- return FALSE;
-
settings->RemoteAssistanceMode = TRUE;
freerdp_set_param_uint32(settings, FreeRDP_ServerPort, file->MachinePorts[0]);
freerdp_target_net_addresses_free(settings);
