Skip to content
This repository
Browse code

libfreerdp-client: initial support for .rdp file parsing

  • Loading branch information...
commit beefa1a21d1206a0b854ab612d4e4fadc665382b 1 parent a319285
Marc-André Moreau authored October 27, 2012
4  .gitignore
@@ -28,6 +28,10 @@ _CPack_Packages
28 28
 *.cproject
29 29
 *.settings
30 30
 
  31
+# .rdp files
  32
+*.rdp
  33
+*.RDP
  34
+
31 35
 # Documentation
32 36
 docs/api
33 37
 client/X11/xfreerdp.1
14  client/X11/xfreerdp.c
@@ -59,6 +59,8 @@
59 59
 #include <freerdp/client/channels.h>
60 60
 #include <freerdp/rail.h>
61 61
 
  62
+#include <freerdp/client/file.h>
  63
+
62 64
 #include <winpr/crt.h>
63 65
 #include <winpr/synch.h>
64 66
 
@@ -480,6 +482,7 @@ int _xf_error_handler(Display* d, XErrorEvent* ev)
480 482
 BOOL xf_pre_connect(freerdp* instance)
481 483
 {
482 484
 	xfInfo* xfi;
  485
+	rdpFile* file;
483 486
 	BOOL bitmap_cache;
484 487
 	rdpSettings* settings;
485 488
 	int arg_parse_result;
@@ -504,6 +507,17 @@ BOOL xf_pre_connect(freerdp* instance)
504 507
 	}
505 508
 
506 509
 	settings = instance->settings;
  510
+
  511
+	if (settings->connection_file)
  512
+	{
  513
+		file = (rdpFile*) malloc(sizeof(rdpFile));
  514
+		ZeroMemory(file, sizeof(rdpFile));
  515
+
  516
+		printf("Using connection file: %s\n", settings->connection_file);
  517
+
  518
+		freerdp_client_parse_rdp_file(file, settings->connection_file);
  519
+	}
  520
+
507 521
 	bitmap_cache = settings->bitmap_cache;
508 522
 
509 523
 	settings->os_major_type = OSMAJORTYPE_UNIX;
10  client/common/CMakeLists.txt
@@ -38,9 +38,19 @@ set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION_FULL}
38 38
 set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS}
39 39
 	${FREERDP_CHANNELS_CLIENT_LIBS})
40 40
 
  41
+set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHIC_BUILD}
  42
+	MODULE winpr
  43
+	MODULES winpr-crt)
  44
+
41 45
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
  46
+
42 47
 set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
43 48
 
44 49
 install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
45 50
 
46 51
 set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")
  52
+
  53
+if(BUILD_TESTING)
  54
+	add_subdirectory(test)
  55
+endif()
  56
+
362  client/common/file.c
@@ -30,3 +30,365 @@
30 30
  * RDP Settings for Remote Desktop Services in Windows Server 2008 R2:
31 31
  * http://technet.microsoft.com/en-us/library/ff393699/
32 32
  */
  33
+
  34
+#include <stdio.h>
  35
+#include <stdlib.h>
  36
+#include <string.h>
  37
+
  38
+#ifdef HAVE_UNISTD_H
  39
+#include <unistd.h>
  40
+#endif
  41
+
  42
+#include <winpr/crt.h>
  43
+
  44
+#include <freerdp/utils/hexdump.h>
  45
+
  46
+static BYTE BOM_UTF16_LE[2] = { 0xFF, 0xFE };
  47
+static WCHAR CR_LF_STR_W[] = { '\r', '\n', '\0' };
  48
+
  49
+BOOL freerdp_client_rdp_file_set_integer(rdpFile* file, char* name, int value)
  50
+{
  51
+	if (_stricmp(name, "use multimon") == 0)
  52
+		file->UseMultiMon = value;
  53
+	else if (_stricmp(name, "screen mode id") == 0)
  54
+		file->ScreenModeId = value;
  55
+	else if (_stricmp(name, "span monitors") == 0)
  56
+		file->SpanMonitors = value;
  57
+	else if (_stricmp(name, "smartsizing") == 0)
  58
+		file->SmartSizing = value;
  59
+	else if (_stricmp(name, "enablesuperpan") == 0)
  60
+		file->EnableSuperSpan = value;
  61
+	else if (_stricmp(name, "superpanaccelerationfactor") == 0)
  62
+		file->SuperSpanAccelerationFactor = value;
  63
+	else if (_stricmp(name, "desktopwidth") == 0)
  64
+		file->DesktopWidth = value;
  65
+	else if (_stricmp(name, "desktopheight") == 0)
  66
+		file->DesktopHeight = value;
  67
+	else if (_stricmp(name, "desktop size id") == 0)
  68
+		file->DesktopSizeId = value;
  69
+	else if (_stricmp(name, "session bpp") == 0)
  70
+		file->SessionBpp = value;
  71
+	else if (_stricmp(name, "compression") == 0)
  72
+		file->Compression = value;
  73
+	else if (_stricmp(name, "keyboardhook") == 0)
  74
+		file->KeyboardHook = value;
  75
+	else if (_stricmp(name, "disable ctrl+alt+del") == 0)
  76
+		file->DisableCtrlAltDel = value;
  77
+	else if (_stricmp(name, "audiomode") == 0)
  78
+		file->AudioMode = value;
  79
+	else if (_stricmp(name, "audioqualitymode") == 0)
  80
+		file->AudioQualityMode = value;
  81
+	else if (_stricmp(name, "audiocapturemode") == 0)
  82
+		file->AudioCaptureMode = value;
  83
+	else if (_stricmp(name, "videoplaybackmode") == 0)
  84
+		file->VideoPlaybackMode = value;
  85
+	else if (_stricmp(name, "connection type") == 0)
  86
+		file->ConnectionType = value;
  87
+	else if (_stricmp(name, "networkautodetect") == 0)
  88
+		file->NetworkAutoDetect = value;
  89
+	else if (_stricmp(name, "bandwidthautodetect") == 0)
  90
+		file->BandwidthAutoDetect = value;
  91
+	else if (_stricmp(name, "pinconnectionbar") == 0)
  92
+		file->PinConnectionBar = value;
  93
+	else if (_stricmp(name, "displayconnectionbar") == 0)
  94
+		file->DisplayConnectionBar = value;
  95
+	else if (_stricmp(name, "workspaceid") == 0)
  96
+		file->WorkspaceId = value;
  97
+	else if (_stricmp(name, "enableworkspacereconnect") == 0)
  98
+		file->EnableWorkspaceReconnect = value;
  99
+	else if (_stricmp(name, "disable wallpaper") == 0)
  100
+		file->DisableWallpaper = value;
  101
+	else if (_stricmp(name, "allow font smoothing") == 0)
  102
+		file->AllowFontSmoothing = value;
  103
+	else if (_stricmp(name, "allow desktop composition") == 0)
  104
+		file->AllowDesktopComposition = value;
  105
+	else if (_stricmp(name, "disable full window drag") == 0)
  106
+		file->DisableFullWindowDrag = value;
  107
+	else if (_stricmp(name, "disable menu anims") == 0)
  108
+		file->DisableMenuAnims = value;
  109
+	else if (_stricmp(name, "disable themes") == 0)
  110
+		file->DisableThemes = value;
  111
+	else if (_stricmp(name, "disable cursor setting") == 0)
  112
+		file->DisableCursorSetting = value;
  113
+	else if (_stricmp(name, "bitmapcachesize") == 0)
  114
+		file->BitmapCacheSize = value;
  115
+	else if (_stricmp(name, "bitmapcachepersistenable") == 0)
  116
+		file->BitmapCachePersistEnable = value;
  117
+	else if (_stricmp(name, "server port") == 0)
  118
+		file->ServerPort = value;
  119
+	else if (_stricmp(name, "redirectdrives") == 0)
  120
+		file->RedirectDrives = value;
  121
+	else if (_stricmp(name, "redirectprinters") == 0)
  122
+		file->RedirectPrinters = value;
  123
+	else if (_stricmp(name, "redirectcomports") == 0)
  124
+		file->RedirectComPorts = value;
  125
+	else if (_stricmp(name, "redirectsmartcards") == 0)
  126
+		file->RedirectSmartCards = value;
  127
+	else if (_stricmp(name, "redirectclipboard") == 0)
  128
+		file->RedirectClipboard = value;
  129
+	else if (_stricmp(name, "redirectposdevices") == 0)
  130
+		file->RedirectPosDevices = value;
  131
+	else if (_stricmp(name, "redirectdirectx") == 0)
  132
+		file->RedirectDirectX = value;
  133
+	else if (_stricmp(name, "disableprinterredirection") == 0)
  134
+		file->DisablePrinterRedirection = value;
  135
+	else if (_stricmp(name, "disableclipboardredirection") == 0)
  136
+		file->DisableClipboardRedirection = value;
  137
+	else if (_stricmp(name, "connect to console") == 0)
  138
+		file->ConnectToConsole = value;
  139
+	else if (_stricmp(name, "administrative session") == 0)
  140
+		file->AdministrativeSession = value;
  141
+	else if (_stricmp(name, "autoreconnection enabled") == 0)
  142
+		file->AutoReconnectionEnabled = value;
  143
+	else if (_stricmp(name, "autoreconnect max retries") == 0)
  144
+		file->AutoReconnectMaxRetries = value;
  145
+	else if (_stricmp(name, "public mode") == 0)
  146
+		file->PublicMode = value;
  147
+	else if (_stricmp(name, "authentication level") == 0)
  148
+		file->AuthenticationLevel = value;
  149
+	else if (_stricmp(name, "promptcredentialonce") == 0)
  150
+		file->PromptCredentialOnce = value;
  151
+	else if (_stricmp(name, "prompt for credentials") == 0)
  152
+		file->PromptForCredentials = value;
  153
+	else if (_stricmp(name, "promptcredentialonce") == 0)
  154
+		file->PromptForCredentialsOnce = value;
  155
+	else if (_stricmp(name, "negotiate security layer") == 0)
  156
+		file->NegotiateSecurityLayer = value;
  157
+	else if (_stricmp(name, "enablecredsspsupport") == 0)
  158
+		file->EnableCredSSPSupport = value;
  159
+	else if (_stricmp(name, "remoteapplicationmode") == 0)
  160
+		file->RemoteApplicationMode = value;
  161
+	else if (_stricmp(name, "remoteapplicationexpandcmdline") == 0)
  162
+		file->RemoteApplicationExpandCmdLine = value;
  163
+	else if (_stricmp(name, "remoteapplicationexpandworkingdir") == 0)
  164
+		file->RemoteApplicationExpandWorkingDir = value;
  165
+	else if (_stricmp(name, "disableconnectionsharing") == 0)
  166
+		file->DisableConnectionSharing = value;
  167
+	else if (_stricmp(name, "disableremoteappcapscheck") == 0)
  168
+		file->DisableRemoteAppCapsCheck = value;
  169
+	else if (_stricmp(name, "gatewayusagemethod") == 0)
  170
+		file->GatewayUsageMethod = value;
  171
+	else if (_stricmp(name, "gatewayprofileusagemethod") == 0)
  172
+		file->GatewayProfileUsageMethod = value;
  173
+	else if (_stricmp(name, "gatewaycredentialssource") == 0)
  174
+		file->GatewayCredentialsSource = value;
  175
+	else if (_stricmp(name, "use redirection server name") == 0)
  176
+		file->UseRedirectionServerName = value;
  177
+	else if (_stricmp(name, "rdgiskdcproxy") == 0)
  178
+		file->RdgIsKdcProxy = value;
  179
+	else
  180
+		return FALSE;
  181
+
  182
+	return TRUE;
  183
+}
  184
+
  185
+void freerdp_client_parse_rdp_file_integer_unicode(rdpFile* file, WCHAR* name, WCHAR* value)
  186
+{
  187
+	int length;
  188
+	int ivalue;
  189
+	char* nameA;
  190
+	char* valueA;
  191
+
  192
+	length = _wcslen(name);
  193
+	nameA = (char*) malloc(length + 1);
  194
+	WideCharToMultiByte(CP_UTF8, 0, name, length, nameA, length, NULL, NULL);
  195
+	nameA[length] = '\0';
  196
+
  197
+	length = _wcslen(value);
  198
+	valueA = (char*) malloc(length + 1);
  199
+	WideCharToMultiByte(CP_UTF8, 0, value, length, valueA, length, NULL, NULL);
  200
+	valueA[length] = '\0';
  201
+
  202
+	ivalue = atoi(valueA);
  203
+	freerdp_client_rdp_file_set_integer(file, nameA, ivalue);
  204
+
  205
+	free(nameA);
  206
+	free(valueA);
  207
+}
  208
+
  209
+BOOL freerdp_client_rdp_file_set_string(rdpFile* file, char* name, char* value)
  210
+{
  211
+	if (_stricmp(name, "username") == 0)
  212
+		file->Username = value;
  213
+	else if (_stricmp(name, "domain") == 0)
  214
+		file->Domain = value;
  215
+	else if (_stricmp(name, "full address") == 0)
  216
+		file->FullAddress = value;
  217
+	else if (_stricmp(name, "alternate full address") == 0)
  218
+		file->AlternateFullAddress = value;
  219
+	else if (_stricmp(name, "usbdevicestoredirect") == 0)
  220
+		file->UsbDevicesToRedirect = value;
  221
+	else if (_stricmp(name, "loadbalanceinfo") == 0)
  222
+		file->LoadBalanceInfo = value;
  223
+	else if (_stricmp(name, "remoteapplicationname") == 0)
  224
+		file->RemoteApplicationName = value;
  225
+	else if (_stricmp(name, "remoteapplicationicon") == 0)
  226
+		file->RemoteApplicationIcon = value;
  227
+	else if (_stricmp(name, "remoteapplicationprogram") == 0)
  228
+		file->RemoteApplicationProgram = value;
  229
+	else if (_stricmp(name, "remoteapplicationfile") == 0)
  230
+		file->RemoteApplicationFile = value;
  231
+	else if (_stricmp(name, "remoteapplicationcmdline") == 0)
  232
+		file->RemoteApplicationCmdLine = value;
  233
+	else if (_stricmp(name, "alternate shell") == 0)
  234
+		file->AlternateShell = value;
  235
+	else if (_stricmp(name, "shell working directory") == 0)
  236
+		file->ShellWorkingDirectory = value;
  237
+	else if (_stricmp(name, "gatewayhostname") == 0)
  238
+		file->GatewayHostname = value;
  239
+	else if (_stricmp(name, "kdcproxyname") == 0)
  240
+		file->KdcProxyName = value;
  241
+	else if (_stricmp(name, "drivestoredirect") == 0)
  242
+		file->DrivesToRedirect = value;
  243
+	else if (_stricmp(name, "devicestoredirect") == 0)
  244
+		file->DevicesToRedirect = value;
  245
+	else if (_stricmp(name, "winposstr") == 0)
  246
+		file->WinPosStr = value;
  247
+	else
  248
+		return FALSE;
  249
+
  250
+	return TRUE;
  251
+}
  252
+
  253
+void freerdp_client_parse_rdp_file_string_unicode(rdpFile* file, WCHAR* name, WCHAR* value)
  254
+{
  255
+	int length;
  256
+	char* nameA;
  257
+	char* valueA;
  258
+
  259
+	length = _wcslen(name);
  260
+	nameA = (char*) malloc(length + 1);
  261
+	WideCharToMultiByte(CP_UTF8, 0, name, length, nameA, length, NULL, NULL);
  262
+	nameA[length] = '\0';
  263
+
  264
+	length = _wcslen(value);
  265
+	valueA = (char*) malloc(length + 1);
  266
+	WideCharToMultiByte(CP_UTF8, 0, value, length, valueA, length, NULL, NULL);
  267
+	valueA[length] = '\0';
  268
+
  269
+	if (!freerdp_client_rdp_file_set_string(file, nameA, valueA))
  270
+		free(valueA);
  271
+
  272
+	free(nameA);
  273
+}
  274
+
  275
+BOOL freerdp_client_parse_rdp_file_buffer_ascii(rdpFile* file, BYTE* buffer, size_t size)
  276
+{
  277
+	return FALSE;
  278
+}
  279
+
  280
+BOOL freerdp_client_parse_rdp_file_buffer_unicode(rdpFile* file, BYTE* buffer, size_t size)
  281
+{
  282
+	int length;
  283
+	WCHAR* line;
  284
+	WCHAR* type;
  285
+	WCHAR* context;
  286
+	WCHAR *d1, *d2;
  287
+	WCHAR *beg, *end;
  288
+	WCHAR *name, *value;
  289
+
  290
+	line = wcstok_s((WCHAR*) buffer, CR_LF_STR_W, &context);
  291
+
  292
+	while (line != NULL)
  293
+	{
  294
+		length = _wcslen(line);
  295
+
  296
+		if (length > 1)
  297
+		{
  298
+			beg = line;
  299
+			end = &line[length - 1];
  300
+
  301
+			d1 = _wcschr(line, ':');
  302
+
  303
+			if (!d1)
  304
+				goto next_line; /* not first delimiter */
  305
+
  306
+			type = &d1[1];
  307
+			d2 = _wcschr(type, ':');
  308
+
  309
+			if (!d2)
  310
+				goto next_line; /* no second delimiter */
  311
+
  312
+			if ((d2 - d1) != 2)
  313
+				goto next_line; /* improper type length */
  314
+
  315
+			if (d2 == end)
  316
+				goto next_line; /* no value */
  317
+
  318
+			*d1 = 0;
  319
+			*d2 = 0;
  320
+			name = beg;
  321
+			value = &d2[1];
  322
+
  323
+			if (*type == 'i')
  324
+			{
  325
+				/* integer type */
  326
+				freerdp_client_parse_rdp_file_integer_unicode(file, name, value);
  327
+			}
  328
+			else if (*type == 's')
  329
+			{
  330
+				/* string type */
  331
+				freerdp_client_parse_rdp_file_string_unicode(file, name, value);
  332
+			}
  333
+			else if (*type == 'b')
  334
+			{
  335
+				/* binary type */
  336
+			}
  337
+		}
  338
+
  339
+next_line:
  340
+		line = wcstok_s(NULL, CR_LF_STR_W, &context);
  341
+	}
  342
+
  343
+	return TRUE;
  344
+}
  345
+
  346
+BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, BYTE* buffer, size_t size)
  347
+{
  348
+	if (size < 2)
  349
+		return FALSE;
  350
+
  351
+	if ((buffer[0] == BOM_UTF16_LE[0]) && (buffer[1] == BOM_UTF16_LE[1]))
  352
+		return freerdp_client_parse_rdp_file_buffer_unicode(file, &buffer[2], size - 2);
  353
+
  354
+	return freerdp_client_parse_rdp_file_buffer_ascii(file, buffer, size);
  355
+}
  356
+
  357
+BOOL freerdp_client_parse_rdp_file(rdpFile* file, char* name)
  358
+{
  359
+	BYTE* buffer;
  360
+	FILE* fp = NULL;
  361
+	size_t read_size;
  362
+	long int file_size;
  363
+
  364
+	fp = fopen(name, "r");
  365
+
  366
+	if (!fp)
  367
+		return FALSE;
  368
+
  369
+	fseek(fp, 0, SEEK_END);
  370
+	file_size = ftell(fp);
  371
+	fseek(fp, 0, SEEK_SET);
  372
+
  373
+	if (file_size < 1)
  374
+		return FALSE;
  375
+
  376
+	buffer = (BYTE*) malloc(file_size);
  377
+
  378
+	read_size = fread(buffer, file_size, 1, fp);
  379
+
  380
+	if (!read_size)
  381
+	{
  382
+		if (!ferror(fp))
  383
+			read_size = file_size;
  384
+	}
  385
+
  386
+	if (read_size < 1)
  387
+	{
  388
+		free(buffer);
  389
+		buffer = NULL;
  390
+		return FALSE;
  391
+	}
  392
+
  393
+	return freerdp_client_parse_rdp_file_buffer(file, buffer, file_size);
  394
+}
3  client/common/test/.gitignore
... ...
@@ -0,0 +1,3 @@
  1
+TestClient
  2
+TestClient.c
  3
+
28  client/common/test/CMakeLists.txt
... ...
@@ -0,0 +1,28 @@
  1
+
  2
+set(MODULE_NAME "TestClient")
  3
+set(MODULE_PREFIX "TEST_CLIENT")
  4
+
  5
+set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
  6
+
  7
+set(${MODULE_PREFIX}_TESTS
  8
+	TestClientRdpFile.c)
  9
+
  10
+create_test_sourcelist(${MODULE_PREFIX}_SRCS
  11
+	${${MODULE_PREFIX}_DRIVER}
  12
+	${${MODULE_PREFIX}_TESTS})
  13
+
  14
+add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
  15
+
  16
+set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client)
  17
+
  18
+target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
  19
+
  20
+set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
  21
+
  22
+foreach(test ${${MODULE_PREFIX}_TESTS})
  23
+	get_filename_component(TestName ${test} NAME_WE)
  24
+	add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
  25
+endforeach()
  26
+
  27
+set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/Client/Test")
  28
+
296  client/common/test/TestClientRdpFile.c
... ...
@@ -0,0 +1,296 @@
  1
+
  2
+#include <stdio.h>
  3
+#include <winpr/crt.h>
  4
+#include <winpr/windows.h>
  5
+
  6
+#include <freerdp/client/file.h>
  7
+
  8
+static BYTE testRdpFileUTF16[] =
  9
+{
  10
+	0xff, 0xfe, 0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x65, 0x00,
  11
+	0x6e, 0x00, 0x20, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00,
  12
+	0x20, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  13
+	0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00,
  14
+	0x20, 0x00, 0x6d, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x74, 0x00, 0x69, 0x00,
  15
+	0x6d, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  16
+	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00,
  17
+	0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x77, 0x00, 0x69, 0x00,
  18
+	0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  19
+	0x31, 0x00, 0x39, 0x00, 0x32, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00,
  20
+	0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00,
  21
+	0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00,
  22
+	0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x30, 0x00,
  23
+	0x38, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x65, 0x00,
  24
+	0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00,
  25
+	0x62, 0x00, 0x70, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  26
+	0x33, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x77, 0x00, 0x69, 0x00,
  27
+	0x6e, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x73, 0x00, 0x74, 0x00,
  28
+	0x72, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x2c, 0x00,
  29
+	0x31, 0x00, 0x2c, 0x00, 0x35, 0x00, 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00,
  30
+	0x32, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x33, 0x00,
  31
+	0x35, 0x00, 0x33, 0x00, 0x2c, 0x00, 0x38, 0x00, 0x31, 0x00, 0x31, 0x00,
  32
+	0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00,
  33
+	0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00,
  34
+	0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
  35
+	0x0a, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x62, 0x00, 0x6f, 0x00,
  36
+	0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x6f, 0x00,
  37
+	0x6b, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00,
  38
+	0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00,
  39
+	0x63, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00,
  40
+	0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
  41
+	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x76, 0x00,
  42
+	0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x6c, 0x00,
  43
+	0x61, 0x00, 0x79, 0x00, 0x62, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00,
  44
+	0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00,
  45
+	0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00,
  46
+	0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
  47
+	0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x74, 0x00, 0x79, 0x00, 0x70, 0x00,
  48
+	0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x37, 0x00, 0x0d, 0x00,
  49
+	0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, 0x00, 0x77, 0x00, 0x6f, 0x00,
  50
+	0x72, 0x00, 0x6b, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00,
  51
+	0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00,
  52
+	0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00,
  53
+	0x62, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x77, 0x00, 0x69, 0x00,
  54
+	0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00,
  55
+	0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00,
  56
+	0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
  57
+	0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6c, 0x00,
  58
+	0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
  59
+	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
  60
+	0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  61
+	0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00,
  62
+	0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00,
  63
+	0x6b, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00,
  64
+	0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
  65
+	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  66
+	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00,
  67
+	0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x77, 0x00,
  68
+	0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x70, 0x00, 0x61, 0x00, 0x70, 0x00,
  69
+	0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
  70
+	0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00,
  71
+	0x77, 0x00, 0x20, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00,
  72
+	0x20, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00,
  73
+	0x68, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00,
  74
+	0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00,
  75
+	0x6c, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, 0x64, 0x00, 0x65, 0x00,
  76
+	0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00,
  77
+	0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00,
  78
+	0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00,
  79
+	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
  80
+	0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
  81
+	0x20, 0x00, 0x66, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00,
  82
+	0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x77, 0x00,
  83
+	0x20, 0x00, 0x64, 0x00, 0x72, 0x00, 0x61, 0x00, 0x67, 0x00, 0x3a, 0x00,
  84
+	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
  85
+	0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
  86
+	0x20, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x20, 0x00,
  87
+	0x61, 0x00, 0x6e, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x73, 0x00, 0x3a, 0x00,
  88
+	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
  89
+	0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
  90
+	0x20, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00,
  91
+	0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
  92
+	0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00,
  93
+	0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00,
  94
+	0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00,
  95
+	0x74, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00,
  96
+	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x62, 0x00,
  97
+	0x69, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x63, 0x00,
  98
+	0x61, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x70, 0x00, 0x65, 0x00,
  99
+	0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00,
  100
+	0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x3a, 0x00,
  101
+	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x66, 0x00,
  102
+	0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00,
  103
+	0x64, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x3a, 0x00,
  104
+	0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, 0x42, 0x00, 0x31, 0x00,
  105
+	0x2d, 0x00, 0x57, 0x00, 0x37, 0x00, 0x2d, 0x00, 0x44, 0x00, 0x4d, 0x00,
  106
+	0x2d, 0x00, 0x30, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00,
  107
+	0x62, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00,
  108
+	0x6b, 0x00, 0x65, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00,
  109
+	0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00,
  110
+	0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00,
  111
+	0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
  112
+	0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
  113
+	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00,
  114
+	0x6e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x3a, 0x00,
  115
+	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00,
  116
+	0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00,
  117
+	0x74, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00,
  118
+	0x72, 0x00, 0x74, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  119
+	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
  120
+	0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x73, 0x00,
  121
+	0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x63, 0x00, 0x61, 0x00,
  122
+	0x72, 0x00, 0x64, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  123
+	0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
  124
+	0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x63, 0x00,
  125
+	0x6c, 0x00, 0x69, 0x00, 0x70, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00,
  126
+	0x72, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
  127
+	0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00,
  128
+	0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x6f, 0x00,
  129
+	0x73, 0x00, 0x64, 0x00, 0x65, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00,
  130
+	0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
  131
+	0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00,
  132
+	0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
  133
+	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
  134
+	0x20, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00,
  135
+	0x65, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
  136
+	0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x68, 0x00,
  137
+	0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00,
  138
+	0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6c, 0x00,
  139
+	0x65, 0x00, 0x76, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x69, 0x00,
  140
+	0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00,
  141
+	0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x20, 0x00, 0x66, 0x00,
  142
+	0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
  143
+	0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
  144
+	0x6c, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
  145
+	0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x67, 0x00, 0x6f, 0x00,
  146
+	0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00,
  147
+	0x73, 0x00, 0x65, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, 0x69, 0x00,
  148
+	0x74, 0x00, 0x79, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00,
  149
+	0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
  150
+	0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00,
  151
+	0x74, 0x00, 0x65, 0x00, 0x61, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6c, 0x00,
  152
+	0x69, 0x00, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00,
  153
+	0x6e, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
  154
+	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00,
  155
+	0x6c, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00,
  156
+	0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00,
  157
+	0x6c, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00,
  158
+	0x0a, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00,
  159
+	0x20, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x69, 0x00,
  160
+	0x6e, 0x00, 0x67, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
  161
+	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x79, 0x00,
  162
+	0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00,
  163
+	0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00,
  164
+	0x68, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6e, 0x00, 0x61, 0x00,
  165
+	0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00,
  166
+	0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x32, 0x00,
  167
+	0x4b, 0x00, 0x38, 0x00, 0x52, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x47, 0x00,
  168
+	0x57, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x62, 0x00, 0x31, 0x00,
  169
+	0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00,
  170
+	0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00,
  171
+	0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
  172
+	0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x75, 0x00, 0x73, 0x00, 0x61, 0x00,
  173
+	0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00,
  174
+	0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
  175
+	0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
  176
+	0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
  177
+	0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
  178
+	0x6c, 0x00, 0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x75, 0x00, 0x72, 0x00,
  179
+	0x63, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
  180
+	0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
  181
+	0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
  182
+	0x66, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x75, 0x00, 0x73, 0x00,
  183
+	0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00,
  184
+	0x68, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  185
+	0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
  186
+	0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
  187
+	0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
  188
+	0x6c, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x63, 0x00, 0x65, 0x00, 0x3a, 0x00,
  189
+	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00,
  190
+	0x73, 0x00, 0x65, 0x00, 0x20, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
  191
+	0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
  192
+	0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00,
  193
+	0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x6e, 0x00, 0x61, 0x00,
  194
+	0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
  195
+	0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x64, 0x00, 0x67, 0x00, 0x69, 0x00,
  196
+	0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, 0x70, 0x00, 0x72, 0x00,
  197
+	0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
  198
+	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00,
  199
+	0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x6e, 0x00,
  200
+	0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00,
  201
+	0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x72, 0x00, 0x69, 0x00, 0x76, 0x00,
  202
+	0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00,
  203
+	0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00,
  204
+	0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x2a, 0x00, 0x0d, 0x00, 0x0a, 0x00,
  205
+	0x75, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00,
  206
+	0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00,
  207
+	0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x5c, 0x00, 0x4a, 0x00, 0x6f, 0x00,
  208
+	0x68, 0x00, 0x6e, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x65, 0x00, 0x0d, 0x00,
  209
+	0x0a, 0x00
  210
+};
  211
+
  212
+/*
  213
+screen mode id:i:2
  214
+use multimon:i:0
  215
+desktopwidth:i:1920
  216
+desktopheight:i:1080
  217
+session bpp:i:32
  218
+winposstr:s:0,1,553,211,1353,811
  219
+compression:i:1
  220
+keyboardhook:i:2
  221
+audiocapturemode:i:0
  222
+videoplaybackmode:i:1
  223
+connection type:i:7
  224
+networkautodetect:i:1
  225
+bandwidthautodetect:i:1
  226
+displayconnectionbar:i:1
  227
+enableworkspacereconnect:i:0
  228
+disable wallpaper:i:0
  229
+allow font smoothing:i:0
  230
+allow desktop composition:i:0
  231
+disable full window drag:i:1
  232
+disable menu anims:i:1
  233
+disable themes:i:0
  234
+disable cursor setting:i:0
  235
+bitmapcachepersistenable:i:1
  236
+full address:s:LAB1-W7-DM-01.lab1.awake.local
  237
+audiomode:i:0
  238
+redirectprinters:i:1
  239
+redirectcomports:i:0
  240
+redirectsmartcards:i:1
  241
+redirectclipboard:i:1
  242
+redirectposdevices:i:0
  243
+autoreconnection enabled:i:1
  244
+authentication level:i:2
  245
+prompt for credentials:i:0
  246
+negotiate security layer:i:1
  247
+remoteapplicationmode:i:0
  248
+alternate shell:s:
  249
+shell working directory:s:
  250
+gatewayhostname:s:LAB1-W2K8R2-GW.lab1.awake.local
  251
+gatewayusagemethod:i:1
  252
+gatewaycredentialssource:i:0
  253
+gatewayprofileusagemethod:i:1
  254
+promptcredentialonce:i:1
  255
+use redirection server name:i:0
  256
+rdgiskdcproxy:i:0
  257
+kdcproxyname:s:
  258
+drivestoredirect:s:*
  259
+username:s:LAB1\JohnDoe
  260
+ */
  261
+
  262
+int TestClientRdpFile(int argc, char* argv[])
  263
+{
  264
+	rdpFile* file;
  265
+
  266
+	file = (rdpFile*) malloc(sizeof(rdpFile));
  267
+	ZeroMemory(file, sizeof(rdpFile));
  268
+
  269
+	freerdp_client_parse_rdp_file_buffer(file, testRdpFileUTF16, sizeof(testRdpFileUTF16));
  270
+
  271
+	if (file->UseMultiMon != 0)
  272
+	{
  273
+		printf("UseMultiMon mismatch: Actual: %d, Expected: %d\n", file->UseMultiMon, 0);
  274
+		return -1;
  275
+	}
  276
+
  277
+	if (file->ScreenModeId != 2)
  278
+	{
  279
+		printf("ScreenModeId mismatch: Actual: %d, Expected: %d\n", file->ScreenModeId, 2);
  280
+		return -1;
  281
+	}
  282
+
  283
+	if (file->GatewayProfileUsageMethod != 1)
  284
+	{
  285
+		printf("GatewayProfileUsageMethod mismatch: Actual: %d, Expected: %d\n", file->GatewayProfileUsageMethod, 1);
  286
+		return -1;
  287
+	}
  288
+
  289
+	if (strcmp(file->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0)
  290
+	{
  291
+		printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n",
  292
+				file->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local");
  293
+	}
  294
+
  295
+	return 0;
  296
+}
14  include/freerdp/client/file.h
@@ -20,6 +20,7 @@
20 20
 #ifndef FREERDP_CLIENT_RDP_FILE
21 21
 #define FREERDP_CLIENT_RDP_FILE
22 22
 
  23
+#include <freerdp/api.h>
23 24
 #include <freerdp/freerdp.h>
24 25
 
25 26
 struct rdp_file
@@ -98,7 +99,7 @@ struct rdp_file
98 99
 	DWORD PromptForCredentialsOnce; /* promptcredentialonce */
99 100
 	DWORD NegotiateSecurityLayer; /* negotiate security layer */
100 101
 	DWORD EnableCredSSPSupport; /* enablecredsspsupport */
101  
-	LPSTR LoadBalanceInfo; /* LoadBalanceInfo */
  102
+	LPSTR LoadBalanceInfo; /* loadbalanceinfo */
102 103
 
103 104
 	DWORD RemoteApplicationMode; /* remoteapplicationmode */
104 105
 	LPSTR RemoteApplicationName; /* remoteapplicationname */
@@ -115,14 +116,14 @@ struct rdp_file
115 116
 	LPSTR ShellWorkingDirectory; /* shell working directory */
116 117
 
117 118
 	LPSTR GatewayHostname; /* gatewayhostname */
118  
-	LPSTR GatewayUsageMethod; /* gatewayusagemethod */
119  
-	LPSTR GatewayProfileUsageMethod; /* gatewayprofileusagemethod */
120  
-	LPSTR GatewayCredentialsSource; /* gatewaycredentialssource */
  119
+	DWORD GatewayUsageMethod; /* gatewayusagemethod */
  120
+	DWORD GatewayProfileUsageMethod; /* gatewayprofileusagemethod */
  121
+	DWORD GatewayCredentialsSource; /* gatewaycredentialssource */
121 122
 
122 123
 	DWORD UseRedirectionServerName; /* use redirection server name */
123 124
 
124 125
 	DWORD RdgIsKdcProxy; /* rdgiskdcproxy */
125  
-	DWORD KdcProxyName; /* kdcproxyname */
  126
+	LPSTR KdcProxyName; /* kdcproxyname */
126 127
 
127 128
 	LPSTR DrivesToRedirect; /* drivestoredirect */
128 129
 	LPSTR DevicesToRedirect; /* devicestoredirect */
@@ -131,4 +132,7 @@ struct rdp_file
131 132
 
132 133
 typedef struct rdp_file rdpFile;
133 134
 
  135
+FREERDP_API BOOL freerdp_client_parse_rdp_file(rdpFile* file, char* name);
  136
+FREERDP_API BOOL freerdp_client_parse_rdp_file_buffer(rdpFile* file, BYTE* buffer, size_t size);
  137
+
134 138
 #endif /* FREERDP_CLIENT_RDP_FILE */
3  include/freerdp/settings.h
@@ -302,7 +302,8 @@ struct rdp_settings
302 302
 	ALIGN64 UINT32 preconnection_id; /* 73 */
303 303
 	ALIGN64 char* preconnection_blob; /* 74 */
304 304
 	ALIGN64 char* computer_name; /* 75 */
305  
-	UINT64 paddingC[80 - 76]; /* 76 */
  305
+	ALIGN64 char* connection_file; /* 76 */
  306
+	UINT64 paddingC[80 - 77]; /* 77 */
306 307
 
307 308
 	/* User Interface Parameters */
308 309
 	ALIGN64 BOOL sw_gdi; /* 80 */
18  libfreerdp/core/http.c
@@ -149,24 +149,6 @@ void http_request_set_auth_param(HttpRequest* http_request, char* auth_param)
149 149
 	http_request->AuthParam = _strdup(auth_param);
150 150
 }
151 151
 
152  
-#ifndef _WIN32
153  
-
154  
-errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix)
155  
-{
156  
-	int length;
157  
-
158  
-	length = snprintf(NULL, 0, "%d", value);
159  
-
160  
-	if (sizeInCharacters < length)
161  
-		return -1;
162  
-
163  
-	snprintf(buffer, length + 1, "%d", value);
164  
-
165  
-	return 0;
166  
-}
167  
-
168  
-#endif
169  
-
170 152
 char* http_encode_body_line(char* param, char* value)
171 153
 {
172 154
 	char* line;
71  libfreerdp/utils/args.c
@@ -100,16 +100,31 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
100 100
 
101 101
 	while (index < argc)
102 102
 	{
  103
+		if (index == 1)
  104
+		{
  105
+			p = strstr(argv[index], ".rdp");
  106
+
  107
+			if (!p)
  108
+				p = strstr(argv[index], ".RDP");
  109
+
  110
+			if (p)
  111
+			{
  112
+				settings->connection_file = _strdup(argv[index]);
  113
+				index++;
  114
+				continue;
  115
+			}
  116
+		}
  117
+
103 118
 		if ((strcmp("-h", argv[index]) == 0 ) || (strcmp("--help", argv[index]) == 0 ))
104 119
 		{
105 120
 			printf("\n"
106 121
 				"FreeRDP - A Free Remote Desktop Protocol Client\n"
107 122
 				"See http://www.freerdp.com for more information\n"
108 123
 				"\n"
109  
-				"Usage: %s [options] server:port\n"
  124
+				"Usage: %s [file] [options] server:port\n"
110 125
 				"  -0: connect to console session\n"
111 126
 				"  -a: set color depth in bit, default is 16\n"
112  
-				"  -c: initial working directory\n"
  127
+				"  -c: shell working directory\n"
113 128
 				"  -D: hide window decorations\n"
114 129
 				"  -T: window title\n"
115 130
 				"  -d: domain\n"
@@ -869,58 +884,76 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
869 884
 		 You can prompt for username, password, domain and hostname to avoid disclosing
870 885
 		 these settings to ps. */
871 886
 
872  
-	if (settings->from_stdin) {
  887
+	if (settings->from_stdin)
  888
+	{
873 889
 		/* username */
874  
-		if (NULL == settings->username) {
  890
+		if (NULL == settings->username)
  891
+		{
875 892
 			char input[512];
876 893
 			input[0] = '\0';
877 894
 			printf("username: ");
878  
-			if (scanf("%511s", input) > 0) {
  895
+
  896
+			if (scanf("%511s", input) > 0)
  897
+			{
879 898
 				settings->username = _strdup(input);
880 899
 			}
881 900
 		}
882 901
 		/* password */
883  
-		if (NULL == settings->password) {
  902
+		if (NULL == settings->password)
  903
+		{
884 904
 			settings->password = malloc(512 * sizeof(char));
  905
+
885 906
 			if (isatty(STDIN_FILENO))
  907
+			{
886 908
 				freerdp_passphrase_read("password: ", settings->password, 512, settings->from_stdin);
887  
-			else {
  909
+			}
  910
+			else
  911
+			{
888 912
 				printf("password: ");
889  
-				if (scanf("%511s", settings->password) <= 0) {
  913
+
  914
+				if (scanf("%511s", settings->password) <= 0)
  915
+				{
890 916
 					free(settings->password);
891 917
 					settings->password = NULL;
892 918
 				}
893 919
 			}
894 920
 		}
895 921
 		/* domain */
896  
-		if (NULL == settings->domain) {
  922
+		if (NULL == settings->domain)
  923
+		{
897 924
 			char input[512];
898 925
 			input[0] = '\0';
  926
+
899 927
 			printf("domain (control-D to skip): ");
900  
-			if (scanf("%511s", input) > 0) {
901  
-				/* Try to catch the cases where the string is NULL-ish right
902  
-				   at the get go */
903  
-				if (input[0] != '\0' && !(input[0] == '.' && input[1] == '\0')) {
  928
+
  929
+			if (scanf("%511s", input) > 0)
  930
+			{
  931
+				/* Try to catch the cases where the string is NULL-ish right at the get go */
  932
+				if (input[0] != '\0' && !(input[0] == '.' && input[1] == '\0'))
904 933
 					settings->domain = _strdup(input);
905  
-				}
906 934
 			}
907 935
 		}
908 936
 		/* hostname */
909  
-		if (NULL == settings->hostname) {
  937
+		if (NULL == settings->hostname)
  938
+		{
910 939
 			char input[512];
911 940
 			input[0] = '\0';
  941
+
912 942
 			printf("hostname: ");
913  
-			if (scanf("%511s", input) > 0) {
  943
+
  944
+			if (scanf("%511s", input) > 0)
914 945
 				freerdp_parse_hostname(settings, input);
915  
-			}
916 946
 		}
917 947
 	}
918 948
 
919 949
 	/* Must have a hostname. Do you? */
920  
-	if (NULL == settings->hostname) {
  950
+	if (NULL == settings->hostname)
  951
+	{
921 952
 		printf("missing server name\n");
922 953
 		return FREERDP_ARGS_PARSE_FAILURE;
923  
-	} else {
  954
+	}
  955
+	else
  956
+	{
924 957
 		return index;
925 958
 	}
926 959
 
4  winpr/include/winpr/crt.h
@@ -50,6 +50,10 @@ WINPR_API size_t _aligned_msize(void* memblock, size_t alignment, size_t offset)
50 50
 
51 51
 WINPR_API void _aligned_free(void* memblock);
52 52
 
  53
+/* Data Conversion */
  54
+
  55
+WINPR_API errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix);
  56
+
53 57
 /* Buffer Manipulation */
54 58
 
55 59
 WINPR_API errno_t memmove_s(void* dest, size_t numberOfElements, const void* src, size_t count);
9  winpr/include/winpr/string.h
@@ -49,7 +49,11 @@ WINPR_API WCHAR* _wcsdup(const WCHAR* strSource);
49 49
 
50 50
 WINPR_API int _stricmp(const char* string1, const char* string2);
51 51
 
  52
+WINPR_API size_t _wcslen(const WCHAR* str);
  53
+WINPR_API WCHAR* _wcschr(const WCHAR* str, WCHAR c);
  54
+
52 55
 WINPR_API char* strtok_s(char* strToken, const char* strDelimit, char** context);
  56
+WINPR_API WCHAR* wcstok_s(WCHAR* strToken, const WCHAR* strDelimit, WCHAR** context);
53 57
 
54 58
 WINPR_API LPSTR CharUpperA(LPSTR lpsz);
55 59
 WINPR_API LPWSTR CharUpperW(LPWSTR lpsz);
@@ -149,6 +153,11 @@ WINPR_API int lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
149 153
 
150 154
 #define	 sprintf_s	snprintf
151 155
 
  156
+#else
  157
+
  158
+#define _wcslen		wcslen
  159
+#define _wcschr		wcschr
  160
+
152 161
 #endif
153 162
 
154 163
 #endif /* WINPR_CRT_STRING_H */
1  winpr/libwinpr/crt/CMakeLists.txt
@@ -20,6 +20,7 @@ set(MODULE_PREFIX "WINPR_CRT")
20 20
 
21 21
 set(${MODULE_PREFIX}_SRCS
22 22
 	alignment.c
  23
+	conversion.c
23 24
 	buffer.c
24 25
 	memory.c
25 26
 	string.c)
45  winpr/libwinpr/crt/conversion.c
... ...
@@ -0,0 +1,45 @@
  1
+/**
  2
+ * WinPR: Windows Portable Runtime
  3
+ * Data Conversion
  4
+ *
  5
+ * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
  6
+ *
  7
+ * Licensed under the Apache License, Version 2.0 (the "License");
  8
+ * you may not use this file except in compliance with the License.
  9
+ * You may obtain a copy of the License at
  10
+ *
  11
+ *     http://www.apache.org/licenses/LICENSE-2.0
  12
+ *
  13
+ * Unless required by applicable law or agreed to in writing, software
  14
+ * distributed under the License is distributed on an "AS IS" BASIS,
  15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+ * See the License for the specific language governing permissions and
  17
+ * limitations under the License.
  18
+ */
  19
+
  20
+#ifdef HAVE_CONFIG_H
  21
+#include "config.h"
  22
+#endif
  23
+
  24
+#include <winpr/crt.h>
  25
+
  26
+/* Data Conversion: http://msdn.microsoft.com/en-us/library/0heszx3w/ */
  27
+
  28
+#ifndef _WIN32
  29
+
  30
+errno_t _itoa_s(int value, char* buffer, size_t sizeInCharacters, int radix)
  31
+{
  32
+	int length;
  33
+
  34
+	length = snprintf(NULL, 0, "%d", value);
  35
+
  36
+	if (sizeInCharacters < length)
  37
+		return -1;
  38
+
  39
+	snprintf(buffer, length + 1, "%d", value);
  40
+
  41
+	return 0;
  42
+}
  43
+
  44
+#endif
  45
+
50  winpr/libwinpr/crt/string.c
@@ -74,11 +74,61 @@ int _stricmp(const char* string1, const char* string2)
74 74
 	return strcasecmp(string1, string2);
75 75
 }
76 76
 
  77
+/* _wcslen -> wcslen */
  78
+
  79
+size_t _wcslen(const WCHAR* str)
  80
+{
  81
+	WCHAR* p = (WCHAR*) str;
  82
+
  83
+	while (*p)
  84
+		p++;
  85
+
  86
+	return (p - str);
  87
+}
  88
+
  89
+/* _wcschr -> wcschr */
  90
+
  91
+WCHAR* _wcschr(const WCHAR* str, WCHAR c)
  92
+{
  93
+	WCHAR* p = (WCHAR*) str;
  94
+
  95
+	while (*p && (*p != c))
  96
+		p++;
  97
+
  98
+	return ((*p == c) ? p : NULL);
  99
+}
  100
+
77 101
 char* strtok_s(char* strToken, const char* strDelimit, char** context)
78 102
 {
79 103
 	return strtok_r(strToken, strDelimit, context);
80 104
 }
81 105
 
  106
+WCHAR* wcstok_s(WCHAR* strToken, const WCHAR* strDelimit, WCHAR** context)
  107
+{
  108
+	WCHAR* nextToken;
  109
+
  110
+	if (!strToken)
  111
+		strToken = *context;
  112
+
  113
+	while (*strToken && _wcschr(strDelimit, *strToken))
  114
+		strToken++;
  115
+
  116
+	if (!*strToken)
  117
+		return NULL;
  118
+
  119
+	nextToken = strToken++;
  120
+
  121
+	while (*strToken && !(_wcschr(strDelimit, *strToken)))
  122
+		strToken++;
  123
+
  124
+	if (*strToken)
  125
+		*strToken++ = 0;
  126
+
  127
+	*context = strToken;
  128
+
  129
+	return nextToken;
  130
+}
  131
+
82 132
 /* Windows API Sets - api-ms-win-core-string-l2-1-0.dll
83 133
  * http://msdn.microsoft.com/en-us/library/hh802935/
84 134
  */
3  winpr/libwinpr/crt/test/CMakeLists.txt
@@ -5,7 +5,8 @@ set(MODULE_PREFIX "TEST_CRT")
5 5
 set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
6 6