Blame client/common/test/TestClientRdpFile.c

Packit 1fb8d4
Packit 1fb8d4
#include <stdio.h>
Packit 1fb8d4
#include <winpr/crt.h>
Packit 1fb8d4
#include <winpr/windows.h>
Packit Service 5a9772
#include <winpr/path.h>
Packit Service 5a9772
#include <winpr/crypto.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/client/file.h>
Packit 1fb8d4
Packit Service 5a9772
static const BYTE testRdpFileUTF16[] = {
Packit Service 5a9772
	0xff, 0xfe, 0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x20, 0x00,
Packit Service 5a9772
	0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x20, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x20, 0x00, 0x6d, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x77, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x39, 0x00,
Packit Service 5a9772
	0x32, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x30, 0x00, 0x38, 0x00, 0x30, 0x00,
Packit Service 5a9772
	0x0d, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x20, 0x00, 0x62, 0x00, 0x70, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x33, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x70, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x73, 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x30, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x35, 0x00, 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00,
Packit Service 5a9772
	0x32, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x33, 0x00, 0x35, 0x00, 0x33, 0x00,
Packit Service 5a9772
	0x2c, 0x00, 0x38, 0x00, 0x31, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6d, 0x00, 0x70, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x79, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x68, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x6f, 0x00, 0x6b, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x76, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00,
Packit Service 5a9772
	0x62, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
Packit Service 5a9772
	0x20, 0x00, 0x74, 0x00, 0x79, 0x00, 0x70, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x37, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, 0x00, 0x77, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x6b, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
Packit Service 5a9772
	0x0d, 0x00, 0x0a, 0x00, 0x62, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x77, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6c, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00,
Packit Service 5a9772
	0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x70, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x70, 0x00, 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
Packit Service 5a9772
	0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00,
Packit Service 5a9772
	0x66, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x20, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x74, 0x00, 0x68, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x77, 0x00, 0x20, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x20, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00,
Packit Service 5a9772
	0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x66, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00,
Packit Service 5a9772
	0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x61, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x20, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x20, 0x00, 0x61, 0x00, 0x6e, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x6d, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x20, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x73, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00,
Packit Service 5a9772
	0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, 0x74, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x62, 0x00, 0x69, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x70, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x66, 0x00,
Packit Service 5a9772
	0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00, 0x64, 0x00, 0x72, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00,
Packit Service 5a9772
	0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x37, 0x00, 0x2d, 0x00, 0x44, 0x00, 0x4d, 0x00,
Packit Service 5a9772
	0x2d, 0x00, 0x30, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x62, 0x00, 0x31, 0x00,
Packit Service 5a9772
	0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x2e, 0x00, 0x6c, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00,
Packit Service 5a9772
	0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x74, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x63, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x64, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x63, 0x00, 0x6c, 0x00, 0x69, 0x00, 0x70, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x64, 0x00, 0x65, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
Packit Service 5a9772
	0x20, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x76, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x20, 0x00, 0x66, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x67, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x63, 0x00, 0x75, 0x00, 0x72, 0x00, 0x69, 0x00, 0x74, 0x00, 0x79, 0x00, 0x20, 0x00, 0x6c, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x79, 0x00, 0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
Packit Service 5a9772
	0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x61, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6c, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00,
Packit Service 5a9772
	0x0a, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x77, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x20, 0x00, 0x64, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x79, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x74, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00,
Packit Service 5a9772
	0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x32, 0x00, 0x4b, 0x00, 0x38, 0x00,
Packit Service 5a9772
	0x52, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x47, 0x00, 0x57, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x62, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x75, 0x00,
Packit Service 5a9772
	0x73, 0x00, 0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x6c, 0x00, 0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x75, 0x00, 0x72, 0x00, 0x63, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x66, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x75, 0x00, 0x73, 0x00, 0x61, 0x00, 0x67, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x65, 0x00,
Packit Service 5a9772
	0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00,
Packit Service 5a9772
	0x73, 0x00, 0x65, 0x00, 0x20, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x73, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x6e, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x64, 0x00, 0x67, 0x00, 0x69, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00,
Packit Service 5a9772
	0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, 0x70, 0x00, 0x72, 0x00,
Packit Service 5a9772
	0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00,
Packit Service 5a9772
	0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x72, 0x00, 0x69, 0x00, 0x76, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00,
Packit Service 5a9772
	0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x2a, 0x00,
Packit Service 5a9772
	0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00,
Packit Service 5a9772
	0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, 0x42, 0x00,
Packit Service 5a9772
	0x31, 0x00, 0x5c, 0x00, 0x4a, 0x00, 0x6f, 0x00, 0x68, 0x00, 0x6e, 0x00, 0x44, 0x00, 0x6f, 0x00,
Packit Service 5a9772
	0x65, 0x00, 0x0d, 0x00, 0x0a, 0x00
Packit 1fb8d4
};
Packit 1fb8d4
Packit Service 5a9772
static char testRdpFileUTF8[] = "screen mode id:i:2\n"
Packit Service 5a9772
                                "use multimon:i:0\n"
Packit Service 5a9772
                                "desktopwidth:i:1920\n"
Packit Service 5a9772
                                "desktopheight:i:1080\n"
Packit Service 5a9772
                                "session bpp:i:32\n"
Packit Service 5a9772
                                "winposstr:s:0,1,553,211,1353,811\n"
Packit Service 5a9772
                                "compression:i:1\n"
Packit Service 5a9772
                                "keyboardhook:i:2\n"
Packit Service 5a9772
                                "audiocapturemode:i:0\n"
Packit Service 5a9772
                                "videoplaybackmode:i:1\n"
Packit Service 5a9772
                                "connection type:i:7\n"
Packit Service 5a9772
                                "networkautodetect:i:1\n"
Packit Service 5a9772
                                "bandwidthautodetect:i:1\n"
Packit Service 5a9772
                                "displayconnectionbar:i:1\n"
Packit Service 5a9772
                                "enableworkspacereconnect:i:0\n"
Packit Service 5a9772
                                "disable wallpaper:i:0\n"
Packit Service 5a9772
                                "allow font smoothing:i:0\n"
Packit Service 5a9772
                                "allow desktop composition:i:0\n"
Packit Service 5a9772
                                "disable full window drag:i:1\n"
Packit Service 5a9772
                                "disable menu anims:i:1\n"
Packit Service 5a9772
                                "disable themes:i:0\n"
Packit Service 5a9772
                                "disable cursor setting:i:0\n"
Packit Service 5a9772
                                "bitmapcachepersistenable:i:1\n"
Packit Service 5a9772
                                "full address:s:LAB1-W7-DM-01.lab1.awake.local\n"
Packit Service 5a9772
                                "alternate full address:s:LAB1-W7-DM-01.lab1.awake.global\n"
Packit Service 5a9772
                                "audiomode:i:0\n"
Packit Service 5a9772
                                "redirectprinters:i:1\n"
Packit Service 5a9772
                                "redirectcomports:i:0\n"
Packit Service 5a9772
                                "redirectsmartcards:i:1\n"
Packit Service 5a9772
                                "redirectclipboard:i:1\n"
Packit Service 5a9772
                                "redirectposdevices:i:0\n"
Packit Service 5a9772
                                "autoreconnection enabled:i:1\n"
Packit Service 5a9772
                                "authentication level:i:2\n"
Packit Service 5a9772
                                "prompt for credentials:i:0\n"
Packit Service 5a9772
                                "negotiate security layer:i:1\n"
Packit Service 5a9772
                                "remoteapplicationmode:i:0\n"
Packit Service 5a9772
                                "alternate shell:s:\n"
Packit Service 5a9772
                                "shell working directory:s:\n"
Packit Service 5a9772
                                "gatewayhostname:s:LAB1-W2K8R2-GW.lab1.awake.local\n"
Packit Service 5a9772
                                "gatewayusagemethod:i:1\n"
Packit Service 5a9772
                                "gatewaycredentialssource:i:0\n"
Packit Service 5a9772
                                "gatewayprofileusagemethod:i:1\n"
Packit Service 5a9772
                                "promptcredentialonce:i:1\n"
Packit Service 5a9772
                                "use redirection server name:i:0\n"
Packit Service 5a9772
                                "rdgiskdcproxy:i:0\n"
Packit Service 5a9772
                                "kdcproxyname:s:\n"
Packit Service 5a9772
                                "drivestoredirect:s:*\n"
Packit Service 5a9772
                                "username:s:LAB1\\JohnDoe\n"
Packit Service 5a9772
                                "vendor integer:i:123\n"
Packit Service 5a9772
                                "vendor string:s:microsoft\n";
Packit Service 5a9772
Packit Service 5a9772
static char* append(const char* fmt, ...)
Packit Service 5a9772
{
Packit Service 5a9772
	int rc;
Packit Service 5a9772
	char* dst;
Packit Service 5a9772
	va_list ap;
Packit Service 5a9772
Packit Service 5a9772
	va_start(ap, fmt);
Packit Service 5a9772
	rc = vsnprintf(NULL, 0, fmt, ap);
Packit Service 5a9772
	va_end(ap);
Packit Service 5a9772
	if (rc < 0)
Packit Service 5a9772
		return NULL;
Packit Service 5a9772
	dst = malloc((size_t)rc + 1);
Packit Service 5a9772
	if (!dst)
Packit Service 5a9772
		return NULL;
Packit Service 5a9772
Packit Service 5a9772
	va_start(ap, fmt);
Packit Service 5a9772
	rc = vsnprintf(dst, (size_t)rc + 1, fmt, ap);
Packit Service 5a9772
	va_end(ap);
Packit Service 5a9772
	if (rc < 0)
Packit Service 5a9772
	{
Packit Service 5a9772
		free(dst);
Packit Service 5a9772
		return NULL;
Packit Service 5a9772
	}
Packit Service 5a9772
	return dst;
Packit Service 5a9772
}
Packit 1fb8d4
Packit 1fb8d4
int TestClientRdpFile(int argc, char* argv[])
Packit 1fb8d4
{
Packit Service 5a9772
	int rc = -1;
Packit 1fb8d4
	int iValue;
Packit Service 5a9772
	const char* sValue;
Packit Service 5a9772
	char* utfname = NULL;
Packit Service 5a9772
	char* uniname = NULL;
Packit Service 5a9772
	char* base = NULL;
Packit Service 5a9772
	char* tmp = NULL;
Packit Service 5a9772
	UINT64 id;
Packit 1fb8d4
	rdpFile* file;
Packit Service 5a9772
	rdpSettings* settings;
Packit Service 5a9772
Packit Service 5a9772
	WINPR_UNUSED(argc);
Packit Service 5a9772
	WINPR_UNUSED(argv);
Packit Service 5a9772
	winpr_RAND((BYTE*)&id, sizeof(id));
Packit Service 5a9772
Packit 1fb8d4
	/* Unicode */
Packit 1fb8d4
	file = freerdp_client_rdp_file_new();
Packit Service 5a9772
	settings = freerdp_settings_new(0);
Packit 1fb8d4
Packit Service 5a9772
	if (!file || !settings)
Packit 1fb8d4
	{
Packit 1fb8d4
		printf("rdp_file_new failed\n");
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
	if (!freerdp_client_parse_rdp_file_buffer(file, testRdpFileUTF16, sizeof(testRdpFileUTF16)))
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit Service 5a9772
	if (!freerdp_client_populate_settings_from_rdp_file(file, settings))
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	if (settings->UseMultimon)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("UseMultiMon mismatch: Actual: %" PRIu32 ", Expected: 0\n", settings->UseMultimon);
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
	if (!settings->Fullscreen)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("ScreenModeId mismatch: Actual: %" PRIu32 ", Expected: TRUE\n",
Packit Service 5a9772
		       settings->Fullscreen);
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
#if 0 /* TODO: Currently unused */
Packit Service 5a9772
	if (settings->GatewayProfileUsageMethod != 1)
Packit 1fb8d4
	{
Packit 1fb8d4
		printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n",
Packit Service 5a9772
			   settings->GatewayProfileUsageMethod);
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit Service 5a9772
#endif
Packit 1fb8d4
Packit Service 5a9772
	if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", settings->GatewayHostname,
Packit Service 5a9772
		       "LAB1-W2K8R2-GW.lab1.awake.local");
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
	}
Packit Service 5a9772
Packit Service 5a9772
	if (strcmp(settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.local") != 0)
Packit Service 5a9772
	{
Packit Service 5a9772
		printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", settings->ServerHostname,
Packit Service 5a9772
		       "LAB1-W7-DM-01.lab1.awake.local");
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	freerdp_client_rdp_file_free(file);
Packit Service 5a9772
	freerdp_settings_free(settings);
Packit 1fb8d4
	/* Ascii */
Packit 1fb8d4
	file = freerdp_client_rdp_file_new();
Packit Service 5a9772
	settings = freerdp_settings_new(0);
Packit Service 5a9772
	if (!file || !settings)
Packit Service 5a9772
	{
Packit Service 5a9772
		printf("rdp_file_new failed\n");
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
	}
Packit Service 5a9772
Packit Service 5a9772
	if (!freerdp_client_parse_rdp_file_buffer(file, (BYTE*)testRdpFileUTF8,
Packit Service 5a9772
	                                          sizeof(testRdpFileUTF8)))
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	if (!freerdp_client_populate_settings_from_rdp_file(file, settings))
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit Service 5a9772
	if (settings->UseMultimon != 0)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("UseMultiMon mismatch: Actual: %" PRIu32 ", Expected: 0\n", settings->UseMultimon);
Packit 1fb8d4
		return -1;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
	if (!settings->Fullscreen)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("ScreenModeId mismatch: Actual: %" PRIu32 ", Expected: TRUE\n",
Packit Service 5a9772
		       settings->Fullscreen);
Packit 1fb8d4
		return -1;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
#if 0 /* TODO: Currently unused */
Packit Service 5a9772
	if (settings->GatewayProfileUsageMethod != 1)
Packit 1fb8d4
	{
Packit 1fb8d4
		printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n",
Packit Service 5a9772
			   settings->GatewayProfileUsageMethod);
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit Service 5a9772
#endif
Packit 1fb8d4
Packit Service 5a9772
	if (strcmp(settings->ServerHostname, "LAB1-W7-DM-01.lab1.awake.global") != 0)
Packit 1fb8d4
	{
Packit Service 5a9772
		printf("ServerHostname mismatch: Actual: %s, Expected: %s\n", settings->ServerHostname,
Packit Service 5a9772
		       "LAB1-W7-DM-01.lab1.awake.global");
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
	}
Packit Service 5a9772
Packit Service 5a9772
	if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0)
Packit Service 5a9772
	{
Packit Service 5a9772
		printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n", settings->GatewayHostname,
Packit Service 5a9772
		       "LAB1-W2K8R2-GW.lab1.awake.local");
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	iValue = freerdp_client_rdp_file_get_integer_option(file, "vendor integer");
Packit 1fb8d4
	if (iValue != 123)
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit 1fb8d4
	if (freerdp_client_rdp_file_set_integer_option(file, "vendor integer", 456) == -1)
Packit 1fb8d4
	{
Packit 1fb8d4
		printf("failed to set integer: vendor integer");
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	iValue = freerdp_client_rdp_file_get_integer_option(file, "vendor integer");
Packit 1fb8d4
	if (iValue != 456)
Packit 1fb8d4
		return -1;
Packit 1fb8d4
Packit Service 5a9772
	sValue = freerdp_client_rdp_file_get_string_option(file, "vendor string");
Packit 1fb8d4
	if (strncmp(sValue, "microsoft", 10) != 0)
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit 1fb8d4
	freerdp_client_rdp_file_set_string_option(file, "vendor string", "apple");
Packit Service 5a9772
	sValue = freerdp_client_rdp_file_get_string_option(file, "vendor string");
Packit 1fb8d4
	if (strncmp(sValue, "apple", 6) != 0)
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit 1fb8d4
	freerdp_client_rdp_file_set_string_option(file, "fruits", "banana,oranges");
Packit 1fb8d4
Packit 1fb8d4
	if (freerdp_client_rdp_file_set_integer_option(file, "numbers", 123456789) == -1)
Packit 1fb8d4
	{
Packit 1fb8d4
		printf("failed to set integer: numbers");
Packit 1fb8d4
		return -1;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
	freerdp_client_rdp_file_free(file);
Packit Service 5a9772
Packit Service 5a9772
	tmp = GetKnownPath(KNOWN_PATH_TEMP);
Packit Service 5a9772
	if (!tmp)
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	base = append("%s/rdp-file-test-%" PRIx64, tmp, id);
Packit Service 5a9772
	if (!base)
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
	if (!CreateDirectoryA(base, NULL))
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
	utfname = append("%s/utfname", base);
Packit Service 5a9772
	uniname = append("%s/uniname", base);
Packit Service 5a9772
	file = freerdp_client_rdp_file_new();
Packit Service 5a9772
	if (!file || !utfname || !uniname)
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	if (!freerdp_client_populate_rdp_file_from_settings(file, settings))
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	if (!freerdp_client_write_rdp_file(file, utfname, FALSE))
Packit Service 5a9772
		goto fail;
Packit Service 5a9772
Packit Service 5a9772
	if (!freerdp_client_write_rdp_file(file, uniname, TRUE))
Packit Service 5a9772
		goto fail;
Packit 1fb8d4
Packit Service 5a9772
	rc = 0;
Packit Service 5a9772
fail:
Packit Service 5a9772
	if (utfname)
Packit Service 5a9772
		DeleteFileA(utfname);
Packit Service 5a9772
	if (uniname)
Packit Service 5a9772
		DeleteFileA(uniname);
Packit Service 5a9772
	if (base)
Packit Service 5a9772
		RemoveDirectoryA(base);
Packit Service 5a9772
	free(utfname);
Packit Service 5a9772
	free(uniname);
Packit Service 5a9772
	free(base);
Packit Service 5a9772
	free(tmp);
Packit 1fb8d4
	freerdp_client_rdp_file_free(file);
Packit Service 5a9772
	freerdp_settings_free(settings);
Packit Service 5a9772
	return rc;
Packit 1fb8d4
}