2012-10-28 04:25:11 +04:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <winpr/crt.h>
|
|
|
|
#include <winpr/windows.h>
|
|
|
|
|
|
|
|
#include <freerdp/client/file.h>
|
|
|
|
|
2017-02-14 14:53:14 +03:00
|
|
|
static const BYTE testRdpFileUTF16[] =
|
2012-10-28 04:25:11 +04:00
|
|
|
{
|
|
|
|
0xff, 0xfe, 0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00, 0x65, 0x00,
|
|
|
|
0x6e, 0x00, 0x20, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00,
|
|
|
|
0x20, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00, 0x73, 0x00, 0x65, 0x00,
|
|
|
|
0x20, 0x00, 0x6d, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x74, 0x00, 0x69, 0x00,
|
|
|
|
0x6d, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x65, 0x00, 0x73, 0x00,
|
|
|
|
0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x77, 0x00, 0x69, 0x00,
|
|
|
|
0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x31, 0x00, 0x39, 0x00, 0x32, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00,
|
|
|
|
0x64, 0x00, 0x65, 0x00, 0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00,
|
|
|
|
0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, 0x00,
|
|
|
|
0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x30, 0x00,
|
|
|
|
0x38, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x73, 0x00, 0x65, 0x00,
|
|
|
|
0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00,
|
|
|
|
0x62, 0x00, 0x70, 0x00, 0x70, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x33, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x77, 0x00, 0x69, 0x00,
|
|
|
|
0x6e, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x73, 0x00, 0x74, 0x00,
|
|
|
|
0x72, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x2c, 0x00,
|
|
|
|
0x31, 0x00, 0x2c, 0x00, 0x35, 0x00, 0x35, 0x00, 0x33, 0x00, 0x2c, 0x00,
|
|
|
|
0x32, 0x00, 0x31, 0x00, 0x31, 0x00, 0x2c, 0x00, 0x31, 0x00, 0x33, 0x00,
|
|
|
|
0x35, 0x00, 0x33, 0x00, 0x2c, 0x00, 0x38, 0x00, 0x31, 0x00, 0x31, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00,
|
|
|
|
0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00,
|
|
|
|
0x6e, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x6b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x62, 0x00, 0x6f, 0x00,
|
|
|
|
0x61, 0x00, 0x72, 0x00, 0x64, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x6f, 0x00,
|
|
|
|
0x6b, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6f, 0x00,
|
|
|
|
0x63, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00,
|
|
|
|
0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x76, 0x00,
|
|
|
|
0x69, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x6c, 0x00,
|
|
|
|
0x61, 0x00, 0x79, 0x00, 0x62, 0x00, 0x61, 0x00, 0x63, 0x00, 0x6b, 0x00,
|
|
|
|
0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00,
|
|
|
|
0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x63, 0x00, 0x6f, 0x00,
|
|
|
|
0x6e, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
|
|
|
|
0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x74, 0x00, 0x79, 0x00, 0x70, 0x00,
|
|
|
|
0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x37, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x74, 0x00, 0x77, 0x00, 0x6f, 0x00,
|
|
|
|
0x72, 0x00, 0x6b, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00,
|
|
|
|
0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00,
|
|
|
|
0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00,
|
|
|
|
0x62, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x77, 0x00, 0x69, 0x00,
|
|
|
|
0x64, 0x00, 0x74, 0x00, 0x68, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00,
|
|
|
|
0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x74, 0x00, 0x65, 0x00, 0x63, 0x00,
|
|
|
|
0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x70, 0x00, 0x6c, 0x00,
|
|
|
|
0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
|
|
|
|
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
|
|
|
|
0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00,
|
|
|
|
0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00,
|
|
|
|
0x6b, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00,
|
|
|
|
0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
|
|
|
|
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00,
|
|
|
|
0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x77, 0x00,
|
|
|
|
0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x70, 0x00, 0x61, 0x00, 0x70, 0x00,
|
|
|
|
0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f, 0x00,
|
|
|
|
0x77, 0x00, 0x20, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00,
|
|
|
|
0x20, 0x00, 0x73, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00,
|
|
|
|
0x68, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00, 0x69, 0x00,
|
|
|
|
0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x6c, 0x00,
|
|
|
|
0x6c, 0x00, 0x6f, 0x00, 0x77, 0x00, 0x20, 0x00, 0x64, 0x00, 0x65, 0x00,
|
|
|
|
0x73, 0x00, 0x6b, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00,
|
|
|
|
0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x73, 0x00,
|
|
|
|
0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
|
|
|
|
0x20, 0x00, 0x66, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00,
|
|
|
|
0x77, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x77, 0x00,
|
|
|
|
0x20, 0x00, 0x64, 0x00, 0x72, 0x00, 0x61, 0x00, 0x67, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
|
|
|
|
0x20, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x75, 0x00, 0x20, 0x00,
|
|
|
|
0x61, 0x00, 0x6e, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x73, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00,
|
|
|
|
0x20, 0x00, 0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00,
|
|
|
|
0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x62, 0x00,
|
|
|
|
0x6c, 0x00, 0x65, 0x00, 0x20, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00,
|
|
|
|
0x73, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00,
|
|
|
|
0x74, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x62, 0x00,
|
|
|
|
0x69, 0x00, 0x74, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x63, 0x00,
|
|
|
|
0x61, 0x00, 0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x70, 0x00, 0x65, 0x00,
|
|
|
|
0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00,
|
|
|
|
0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x66, 0x00,
|
|
|
|
0x75, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x64, 0x00,
|
|
|
|
0x64, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x73, 0x00, 0x3a, 0x00,
|
|
|
|
0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00, 0x41, 0x00, 0x42, 0x00, 0x31, 0x00,
|
|
|
|
0x2d, 0x00, 0x57, 0x00, 0x37, 0x00, 0x2d, 0x00, 0x44, 0x00, 0x4d, 0x00,
|
|
|
|
0x2d, 0x00, 0x30, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00,
|
|
|
|
0x62, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00,
|
|
|
|
0x6b, 0x00, 0x65, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00,
|
|
|
|
0x61, 0x00, 0x6c, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00,
|
|
|
|
0x64, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00,
|
|
|
|
0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
|
|
|
|
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x72, 0x00, 0x69, 0x00,
|
|
|
|
0x6e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00,
|
|
|
|
0x65, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00,
|
|
|
|
0x74, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x6f, 0x00,
|
|
|
|
0x72, 0x00, 0x74, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x73, 0x00,
|
|
|
|
0x6d, 0x00, 0x61, 0x00, 0x72, 0x00, 0x74, 0x00, 0x63, 0x00, 0x61, 0x00,
|
|
|
|
0x72, 0x00, 0x64, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x63, 0x00,
|
|
|
|
0x6c, 0x00, 0x69, 0x00, 0x70, 0x00, 0x62, 0x00, 0x6f, 0x00, 0x61, 0x00,
|
|
|
|
0x72, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00, 0x69, 0x00,
|
|
|
|
0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x70, 0x00, 0x6f, 0x00,
|
|
|
|
0x73, 0x00, 0x64, 0x00, 0x65, 0x00, 0x76, 0x00, 0x69, 0x00, 0x63, 0x00,
|
|
|
|
0x65, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x6f, 0x00,
|
|
|
|
0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x6e, 0x00,
|
|
|
|
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
|
|
|
|
0x20, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x62, 0x00, 0x6c, 0x00,
|
|
|
|
0x65, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00, 0x75, 0x00, 0x74, 0x00, 0x68, 0x00,
|
|
|
|
0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x63, 0x00, 0x61, 0x00,
|
|
|
|
0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6c, 0x00,
|
|
|
|
0x65, 0x00, 0x76, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x69, 0x00,
|
|
|
|
0x3a, 0x00, 0x32, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00,
|
|
|
|
0x6f, 0x00, 0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x20, 0x00, 0x66, 0x00,
|
|
|
|
0x6f, 0x00, 0x72, 0x00, 0x20, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
|
|
|
|
0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
|
|
|
|
0x6c, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x67, 0x00, 0x6f, 0x00,
|
|
|
|
0x74, 0x00, 0x69, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x20, 0x00,
|
|
|
|
0x73, 0x00, 0x65, 0x00, 0x63, 0x00, 0x75, 0x00, 0x72, 0x00, 0x69, 0x00,
|
|
|
|
0x74, 0x00, 0x79, 0x00, 0x20, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x79, 0x00,
|
|
|
|
0x65, 0x00, 0x72, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x6f, 0x00,
|
|
|
|
0x74, 0x00, 0x65, 0x00, 0x61, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6c, 0x00,
|
|
|
|
0x69, 0x00, 0x63, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00,
|
|
|
|
0x6e, 0x00, 0x6d, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x65, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x61, 0x00,
|
|
|
|
0x6c, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00,
|
|
|
|
0x74, 0x00, 0x65, 0x00, 0x20, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00,
|
|
|
|
0x6c, 0x00, 0x6c, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00, 0x73, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00,
|
|
|
|
0x20, 0x00, 0x77, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x6b, 0x00, 0x69, 0x00,
|
|
|
|
0x6e, 0x00, 0x67, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x72, 0x00,
|
|
|
|
0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x79, 0x00,
|
|
|
|
0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00,
|
|
|
|
0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x77, 0x00, 0x61, 0x00, 0x79, 0x00,
|
|
|
|
0x68, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6e, 0x00, 0x61, 0x00,
|
|
|
|
0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00,
|
|
|
|
0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x2d, 0x00, 0x57, 0x00, 0x32, 0x00,
|
|
|
|
0x4b, 0x00, 0x38, 0x00, 0x52, 0x00, 0x32, 0x00, 0x2d, 0x00, 0x47, 0x00,
|
|
|
|
0x57, 0x00, 0x2e, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x62, 0x00, 0x31, 0x00,
|
|
|
|
0x2e, 0x00, 0x61, 0x00, 0x77, 0x00, 0x61, 0x00, 0x6b, 0x00, 0x65, 0x00,
|
|
|
|
0x2e, 0x00, 0x6c, 0x00, 0x6f, 0x00, 0x63, 0x00, 0x61, 0x00, 0x6c, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
|
|
|
|
0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x75, 0x00, 0x73, 0x00, 0x61, 0x00,
|
|
|
|
0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00, 0x68, 0x00,
|
|
|
|
0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x31, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
|
|
|
|
0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
|
|
|
|
0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
|
|
|
|
0x6c, 0x00, 0x73, 0x00, 0x73, 0x00, 0x6f, 0x00, 0x75, 0x00, 0x72, 0x00,
|
|
|
|
0x63, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00,
|
|
|
|
0x77, 0x00, 0x61, 0x00, 0x79, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
|
|
|
|
0x66, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x75, 0x00, 0x73, 0x00,
|
|
|
|
0x61, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x74, 0x00,
|
|
|
|
0x68, 0x00, 0x6f, 0x00, 0x64, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x70, 0x00, 0x72, 0x00, 0x6f, 0x00,
|
|
|
|
0x6d, 0x00, 0x70, 0x00, 0x74, 0x00, 0x63, 0x00, 0x72, 0x00, 0x65, 0x00,
|
|
|
|
0x64, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x69, 0x00, 0x61, 0x00,
|
|
|
|
0x6c, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x63, 0x00, 0x65, 0x00, 0x3a, 0x00,
|
|
|
|
0x69, 0x00, 0x3a, 0x00, 0x31, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x75, 0x00,
|
|
|
|
0x73, 0x00, 0x65, 0x00, 0x20, 0x00, 0x72, 0x00, 0x65, 0x00, 0x64, 0x00,
|
|
|
|
0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00,
|
|
|
|
0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00,
|
|
|
|
0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x20, 0x00, 0x6e, 0x00, 0x61, 0x00,
|
|
|
|
0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00, 0x30, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x72, 0x00, 0x64, 0x00, 0x67, 0x00, 0x69, 0x00,
|
|
|
|
0x73, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00, 0x70, 0x00, 0x72, 0x00,
|
|
|
|
0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x3a, 0x00, 0x69, 0x00, 0x3a, 0x00,
|
|
|
|
0x30, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0x6b, 0x00, 0x64, 0x00, 0x63, 0x00,
|
|
|
|
0x70, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x78, 0x00, 0x79, 0x00, 0x6e, 0x00,
|
|
|
|
0x61, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00,
|
|
|
|
0x0d, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x72, 0x00, 0x69, 0x00, 0x76, 0x00,
|
|
|
|
0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x65, 0x00,
|
|
|
|
0x64, 0x00, 0x69, 0x00, 0x72, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00,
|
|
|
|
0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x2a, 0x00, 0x0d, 0x00, 0x0a, 0x00,
|
|
|
|
0x75, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x6e, 0x00, 0x61, 0x00,
|
|
|
|
0x6d, 0x00, 0x65, 0x00, 0x3a, 0x00, 0x73, 0x00, 0x3a, 0x00, 0x4c, 0x00,
|
|
|
|
0x41, 0x00, 0x42, 0x00, 0x31, 0x00, 0x5c, 0x00, 0x4a, 0x00, 0x6f, 0x00,
|
|
|
|
0x68, 0x00, 0x6e, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x65, 0x00, 0x0d, 0x00,
|
|
|
|
0x0a, 0x00
|
|
|
|
};
|
|
|
|
|
2012-10-28 06:46:37 +04:00
|
|
|
static char testRdpFileUTF8[] =
|
2017-02-14 14:53:14 +03:00
|
|
|
"screen mode id:i:2\n"
|
|
|
|
"use multimon:i:0\n"
|
|
|
|
"desktopwidth:i:1920\n"
|
|
|
|
"desktopheight:i:1080\n"
|
|
|
|
"session bpp:i:32\n"
|
|
|
|
"winposstr:s:0,1,553,211,1353,811\n"
|
|
|
|
"compression:i:1\n"
|
|
|
|
"keyboardhook:i:2\n"
|
|
|
|
"audiocapturemode:i:0\n"
|
|
|
|
"videoplaybackmode:i:1\n"
|
|
|
|
"connection type:i:7\n"
|
|
|
|
"networkautodetect:i:1\n"
|
|
|
|
"bandwidthautodetect:i:1\n"
|
|
|
|
"displayconnectionbar:i:1\n"
|
|
|
|
"enableworkspacereconnect:i:0\n"
|
|
|
|
"disable wallpaper:i:0\n"
|
|
|
|
"allow font smoothing:i:0\n"
|
|
|
|
"allow desktop composition:i:0\n"
|
|
|
|
"disable full window drag:i:1\n"
|
|
|
|
"disable menu anims:i:1\n"
|
|
|
|
"disable themes:i:0\n"
|
|
|
|
"disable cursor setting:i:0\n"
|
|
|
|
"bitmapcachepersistenable:i:1\n"
|
|
|
|
"full address:s:LAB1-W7-DM-01.lab1.awake.local\n"
|
|
|
|
"audiomode:i:0\n"
|
|
|
|
"redirectprinters:i:1\n"
|
|
|
|
"redirectcomports:i:0\n"
|
|
|
|
"redirectsmartcards:i:1\n"
|
|
|
|
"redirectclipboard:i:1\n"
|
|
|
|
"redirectposdevices:i:0\n"
|
|
|
|
"autoreconnection enabled:i:1\n"
|
|
|
|
"authentication level:i:2\n"
|
|
|
|
"prompt for credentials:i:0\n"
|
|
|
|
"negotiate security layer:i:1\n"
|
|
|
|
"remoteapplicationmode:i:0\n"
|
|
|
|
"alternate shell:s:\n"
|
|
|
|
"shell working directory:s:\n"
|
|
|
|
"gatewayhostname:s:LAB1-W2K8R2-GW.lab1.awake.local\n"
|
|
|
|
"gatewayusagemethod:i:1\n"
|
|
|
|
"gatewaycredentialssource:i:0\n"
|
|
|
|
"gatewayprofileusagemethod:i:1\n"
|
|
|
|
"promptcredentialonce:i:1\n"
|
|
|
|
"use redirection server name:i:0\n"
|
|
|
|
"rdgiskdcproxy:i:0\n"
|
|
|
|
"kdcproxyname:s:\n"
|
|
|
|
"drivestoredirect:s:*\n"
|
|
|
|
"username:s:LAB1\\JohnDoe\n"
|
|
|
|
"vendor integer:i:123\n"
|
|
|
|
"vendor string:s:microsoft\n";
|
2012-10-28 04:25:11 +04:00
|
|
|
|
|
|
|
int TestClientRdpFile(int argc, char* argv[])
|
|
|
|
{
|
2019-07-15 11:46:52 +03:00
|
|
|
int rc = -1;
|
2013-12-05 01:29:45 +04:00
|
|
|
int iValue;
|
2019-07-15 11:46:52 +03:00
|
|
|
const char* sValue;
|
2012-10-28 04:25:11 +04:00
|
|
|
rdpFile* file;
|
2019-07-15 11:46:52 +03:00
|
|
|
rdpSettings* settings;
|
|
|
|
|
2019-02-07 19:53:21 +03:00
|
|
|
WINPR_UNUSED(argc);
|
|
|
|
WINPR_UNUSED(argv);
|
2012-10-28 06:46:37 +04:00
|
|
|
/* Unicode */
|
|
|
|
file = freerdp_client_rdp_file_new();
|
2019-07-15 11:46:52 +03:00
|
|
|
settings = freerdp_settings_new(0);
|
2017-02-14 14:53:14 +03:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!file || !settings)
|
2015-06-17 23:08:02 +03:00
|
|
|
{
|
|
|
|
printf("rdp_file_new failed\n");
|
2019-07-15 11:46:52 +03:00
|
|
|
goto fail;
|
2015-06-17 23:08:02 +03:00
|
|
|
}
|
2017-02-14 14:53:14 +03:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!freerdp_client_parse_rdp_file_buffer(file, testRdpFileUTF16, sizeof(testRdpFileUTF16)))
|
|
|
|
goto fail;
|
2012-10-28 04:25:11 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!freerdp_client_populate_settings_from_rdp_file(file, settings))
|
|
|
|
goto fail;
|
|
|
|
|
|
|
|
if (settings->UseMultimon)
|
2012-10-28 04:25:11 +04:00
|
|
|
{
|
2019-07-15 11:46:52 +03:00
|
|
|
printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", settings->UseMultimon);
|
|
|
|
goto fail;
|
2012-10-28 04:25:11 +04:00
|
|
|
}
|
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!settings->Fullscreen)
|
2012-10-28 04:25:11 +04:00
|
|
|
{
|
2019-07-15 11:46:52 +03:00
|
|
|
printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: TRUE\n", settings->Fullscreen);
|
|
|
|
goto fail;
|
2012-10-28 04:25:11 +04:00
|
|
|
}
|
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
#if 0 /* TODO: Currently unused */
|
|
|
|
if (settings->GatewayProfileUsageMethod != 1)
|
2012-10-28 04:25:11 +04:00
|
|
|
{
|
2017-02-14 14:53:14 +03:00
|
|
|
printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n",
|
2019-07-15 11:46:52 +03:00
|
|
|
settings->GatewayProfileUsageMethod);
|
|
|
|
goto fail;
|
2012-10-28 04:25:11 +04:00
|
|
|
}
|
2019-07-15 11:46:52 +03:00
|
|
|
#endif
|
2012-10-28 04:25:11 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0)
|
2012-10-28 04:25:11 +04:00
|
|
|
{
|
|
|
|
printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n",
|
2019-07-15 11:46:52 +03:00
|
|
|
settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local");
|
|
|
|
goto fail;
|
2012-10-28 06:46:37 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
freerdp_client_rdp_file_free(file);
|
2019-07-15 11:46:52 +03:00
|
|
|
freerdp_settings_free(settings);
|
2012-10-28 06:46:37 +04:00
|
|
|
/* Ascii */
|
|
|
|
file = freerdp_client_rdp_file_new();
|
2019-07-15 11:46:52 +03:00
|
|
|
settings = freerdp_settings_new(0);
|
|
|
|
if (!file || !settings)
|
|
|
|
{
|
|
|
|
printf("rdp_file_new failed\n");
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!freerdp_client_parse_rdp_file_buffer(file, (BYTE*) testRdpFileUTF8, sizeof(testRdpFileUTF8)))
|
|
|
|
goto fail;
|
2012-10-28 06:46:37 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!freerdp_client_populate_settings_from_rdp_file(file, settings))
|
|
|
|
goto fail;
|
|
|
|
|
|
|
|
if (settings->UseMultimon != 0)
|
2012-10-28 06:46:37 +04:00
|
|
|
{
|
2019-07-15 11:46:52 +03:00
|
|
|
printf("UseMultiMon mismatch: Actual: %"PRIu32", Expected: 0\n", settings->UseMultimon);
|
2012-10-28 06:46:37 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!settings->Fullscreen)
|
2012-10-28 06:46:37 +04:00
|
|
|
{
|
2019-07-15 11:46:52 +03:00
|
|
|
printf("ScreenModeId mismatch: Actual: %"PRIu32", Expected: TRUE\n", settings->Fullscreen);
|
2012-10-28 06:46:37 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
#if 0 /* TODO: Currently unused */
|
|
|
|
if (settings->GatewayProfileUsageMethod != 1)
|
2012-10-28 06:46:37 +04:00
|
|
|
{
|
2017-02-14 14:53:14 +03:00
|
|
|
printf("GatewayProfileUsageMethod mismatch: Actual: %"PRIu32", Expected: 1\n",
|
2019-07-15 11:46:52 +03:00
|
|
|
settings->GatewayProfileUsageMethod);
|
|
|
|
goto fail;
|
2012-10-28 04:25:11 +04:00
|
|
|
}
|
2019-07-15 11:46:52 +03:00
|
|
|
#endif
|
2012-10-28 04:25:11 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (strcmp(settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local") != 0)
|
2012-10-28 06:46:37 +04:00
|
|
|
{
|
|
|
|
printf("GatewayHostname mismatch: Actual: %s, Expected: %s\n",
|
2019-07-15 11:46:52 +03:00
|
|
|
settings->GatewayHostname, "LAB1-W2K8R2-GW.lab1.awake.local");
|
|
|
|
goto fail;
|
2012-10-28 06:46:37 +04:00
|
|
|
}
|
|
|
|
|
2013-12-05 01:29:45 +04:00
|
|
|
iValue = freerdp_client_rdp_file_get_integer_option(file, "vendor integer");
|
2017-03-28 17:18:00 +03:00
|
|
|
if (iValue != 123)
|
2019-07-15 11:46:52 +03:00
|
|
|
goto fail;
|
2017-02-14 14:53:14 +03:00
|
|
|
|
2015-06-17 23:08:02 +03:00
|
|
|
if (freerdp_client_rdp_file_set_integer_option(file, "vendor integer", 456) == -1)
|
|
|
|
{
|
|
|
|
printf("failed to set integer: vendor integer");
|
2019-07-15 11:46:52 +03:00
|
|
|
goto fail;
|
2015-06-17 23:08:02 +03:00
|
|
|
}
|
|
|
|
|
2013-12-05 01:29:45 +04:00
|
|
|
iValue = freerdp_client_rdp_file_get_integer_option(file, "vendor integer");
|
2017-03-28 17:18:00 +03:00
|
|
|
if (iValue != 456)
|
|
|
|
return -1;
|
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
sValue = freerdp_client_rdp_file_get_string_option(file, "vendor string");
|
2017-03-28 17:18:00 +03:00
|
|
|
if (strncmp(sValue, "microsoft", 10) != 0)
|
2019-07-15 11:46:52 +03:00
|
|
|
goto fail;
|
2017-03-28 17:18:00 +03:00
|
|
|
|
2013-12-05 01:29:45 +04:00
|
|
|
freerdp_client_rdp_file_set_string_option(file, "vendor string", "apple");
|
2019-07-15 11:46:52 +03:00
|
|
|
sValue = freerdp_client_rdp_file_get_string_option(file, "vendor string");
|
2017-03-28 17:18:00 +03:00
|
|
|
if (strncmp(sValue, "apple", 6) != 0)
|
2019-07-15 11:46:52 +03:00
|
|
|
goto fail;
|
2017-03-28 17:18:00 +03:00
|
|
|
|
2013-12-05 01:29:45 +04:00
|
|
|
freerdp_client_rdp_file_set_string_option(file, "fruits", "banana,oranges");
|
2017-02-14 14:53:14 +03:00
|
|
|
|
2015-06-17 23:08:02 +03:00
|
|
|
if (freerdp_client_rdp_file_set_integer_option(file, "numbers", 123456789) == -1)
|
|
|
|
{
|
|
|
|
printf("failed to set integer: numbers");
|
|
|
|
return -1;
|
|
|
|
}
|
2013-12-05 01:29:45 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
freerdp_client_rdp_file_free(file);
|
|
|
|
file = freerdp_client_rdp_file_new();
|
|
|
|
if (!file)
|
|
|
|
goto fail;
|
2013-12-05 00:37:42 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
if (!freerdp_client_populate_rdp_file_from_settings(file, settings))
|
|
|
|
goto fail;
|
2013-12-05 00:37:42 +04:00
|
|
|
|
2019-07-15 11:46:52 +03:00
|
|
|
rc = 0;
|
|
|
|
fail:
|
2012-10-28 06:46:37 +04:00
|
|
|
freerdp_client_rdp_file_free(file);
|
2019-07-15 11:46:52 +03:00
|
|
|
freerdp_settings_free(settings);
|
|
|
|
return rc;
|
2012-10-28 04:25:11 +04:00
|
|
|
}
|