FreeRDP
|
#include <freerdp/config.h>
#include <errno.h>
#include <ctype.h>
#include <stdlib.h>
#include <winpr/string.h>
#include <winpr/file.h>
#include <freerdp/client.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <freerdp/channels/urbdrc.h>
#include <freerdp/channels/rdpecam.h>
#include <freerdp/channels/location.h>
#include <stdio.h>
#include <string.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/path.h>
#include <freerdp/log.h>
Macros | |
#define | TAG CLIENT_TAG("common") |
#define | INVALID_INTEGER_VALUE 0xFFFFFFFF |
#define | RDP_FILE_LINE_FLAG_FORMATTED 0x00000001 |
#define | RDP_FILE_LINE_FLAG_STANDARD 0x00000002 |
#define | RDP_FILE_LINE_FLAG_TYPE_STRING 0x00000010 |
#define | RDP_FILE_LINE_FLAG_TYPE_INTEGER 0x00000020 |
#define | RDP_FILE_LINE_FLAG_TYPE_BINARY 0x00000040 |
#define | WRITE_SETTING_(fmt_, ...) |
#define | WRITE_SETTING_INT(key_, param_) |
#define | WRITE_SETTING_STR(key_, param_) |
Functions | |
static BOOL | utils_str_is_empty (const char *str) |
static SSIZE_T | freerdp_client_rdp_file_add_line (rdpFile *file) |
static rdpFileLine * | freerdp_client_rdp_file_find_line_by_name (const rdpFile *file, const char *name) |
static void | freerdp_client_file_string_check_free (LPSTR str) |
static BOOL | freerdp_client_rdp_file_find_integer_entry (rdpFile *file, const char *name, DWORD **outValue, rdpFileLine **outLine) |
static BOOL | freerdp_client_rdp_file_find_string_entry (rdpFile *file, const char *name, LPSTR **outValue, rdpFileLine **outLine) |
static BOOL | freerdp_client_rdp_file_set_integer (rdpFile *file, const char *name, long value) |
static BOOL | freerdp_client_parse_rdp_file_integer (rdpFile *file, const char *name, const char *value) |
static BOOL | freerdp_client_rdp_file_set_string (rdpFile *file, const char *name, const char *value) |
static BOOL | freerdp_client_add_option (rdpFile *file, const char *option) |
static BOOL | freerdp_client_parse_rdp_file_string (rdpFile *file, char *name, char *value) |
static BOOL | freerdp_client_parse_rdp_file_option (rdpFile *file, const char *option) |
BOOL | freerdp_client_parse_rdp_file_buffer (rdpFile *file, const BYTE *buffer, size_t size) |
static BOOL | trim (char **strptr) |
static BOOL | trim_strings (rdpFile *file) |
BOOL | freerdp_client_parse_rdp_file_buffer_ex (rdpFile *file, const BYTE *buffer, size_t size, rdp_file_fkt_parse parse) |
BOOL | freerdp_client_parse_rdp_file (rdpFile *file, const char *name) |
BOOL | freerdp_client_parse_rdp_file_ex (rdpFile *file, const char *name, rdp_file_fkt_parse parse) |
static INLINE BOOL | FILE_POPULATE_STRING (char **_target, const rdpSettings *_settings, FreeRDP_Settings_Keys_String _option) |
static char * | freerdp_client_channel_args_to_string (const rdpSettings *settings, const char *channel, const char *option) |
static BOOL | rdp_opt_duplicate (const rdpSettings *_settings, FreeRDP_Settings_Keys_String _id, char **_key) |
BOOL | freerdp_client_populate_rdp_file_from_settings (rdpFile *file, const rdpSettings *settings) |
BOOL | freerdp_client_write_rdp_file (const rdpFile *file, const char *name, BOOL unicode) |
static SSIZE_T | freerdp_client_write_setting_to_buffer (char **buffer, size_t *bufferSize, WINPR_FORMAT_ARG const char *fmt,...) |
size_t | freerdp_client_write_rdp_file_buffer (const rdpFile *file, char *buffer, size_t size) |
static ADDIN_ARGV * | rdp_file_to_args (const char *channel, const char *values) |
BOOL | freerdp_client_populate_settings_from_rdp_file (const rdpFile *file, rdpSettings *settings) |
int | freerdp_client_rdp_file_set_string_option (rdpFile *file, const char *name, const char *value) |
const char * | freerdp_client_rdp_file_get_string_option (const rdpFile *file, const char *name) |
int | freerdp_client_rdp_file_set_integer_option (rdpFile *file, const char *name, int value) |
int | freerdp_client_rdp_file_get_integer_option (const rdpFile *file, const char *name) |
rdpFile * | freerdp_client_rdp_file_new (void) |
rdpFile * | freerdp_client_rdp_file_new_ex (DWORD flags) |
void | freerdp_client_rdp_file_free (rdpFile *file) |
void | freerdp_client_rdp_file_set_callback_context (rdpFile *file, void *context) |
Variables | |
static const BYTE | BOM_UTF16_LE [2] = { 0xFF, 0xFE } |
static const char | key_str_username [] = "username" |
static const char | key_str_domain [] = "domain" |
static const char | key_str_password [] = "password" |
static const char | key_str_full_address [] = "full address" |
static const char | key_str_alternate_full_address [] = "alternate full address" |
static const char | key_str_usbdevicestoredirect [] = "usbdevicestoredirect" |
static const char | key_str_camerastoredirect [] = "camerastoredirect" |
static const char | key_str_loadbalanceinfo [] = "loadbalanceinfo" |
static const char | key_str_remoteapplicationname [] = "remoteapplicationname" |
static const char | key_str_remoteapplicationicon [] = "remoteapplicationicon" |
static const char | key_str_remoteapplicationprogram [] = "remoteapplicationprogram" |
static const char | key_str_remoteapplicationfile [] = "remoteapplicationfile" |
static const char | key_str_remoteapplicationguid [] = "remoteapplicationguid" |
static const char | key_str_remoteapplicationcmdline [] = "remoteapplicationcmdline" |
static const char | key_str_alternate_shell [] = "alternate shell" |
static const char | key_str_shell_working_directory [] = "shell working directory" |
static const char | key_str_gatewayhostname [] = "gatewayhostname" |
static const char | key_str_gatewayaccesstoken [] = "gatewayaccesstoken" |
static const char | key_str_resourceprovider [] = "resourceprovider" |
static const char | str_resourceprovider_arm [] = "arm" |
static const char | key_str_kdcproxyname [] = "kdcproxyname" |
static const char | key_str_drivestoredirect [] = "drivestoredirect" |
static const char | key_str_devicestoredirect [] = "devicestoredirect" |
static const char | key_str_winposstr [] = "winposstr" |
static const char | key_str_pcb [] = "pcb" |
static const char | key_str_selectedmonitors [] = "selectedmonitors" |
static const char | key_str_wvd [] = "wvd endpoint pool" |
static const char | key_str_geo [] = "geo" |
static const char | key_str_armpath [] = "armpath" |
static const char | key_str_aadtenantid [] = "aadtenantid" |
static const char | key_str_diagnosticserviceurl [] = "diagnosticserviceurl" |
static const char | key_str_hubdiscoverygeourl [] = "hubdiscoverygeourl" |
static const char | key_str_activityhint [] = "activityhint" |
static const char | key_int_rdgiskdcproxy [] = "rdgiskdcproxy" |
static const char | key_int_use_redirection_server_name [] = "use redirection server name" |
static const char | key_int_gatewaycredentialssource [] = "gatewaycredentialssource" |
static const char | key_int_gatewayprofileusagemethod [] = "gatewayprofileusagemethod" |
static const char | key_int_gatewayusagemethod [] = "gatewayusagemethod" |
static const char | key_int_disableremoteappcapscheck [] = "disableremoteappcapscheck" |
static const char | key_int_disableconnectionsharing [] = "disableconnectionsharing" |
static const char | key_int_remoteapplicationexpandworkingdir [] = "remoteapplicationexpandworkingdir" |
static const char | key_int_remoteapplicationexpandcmdline [] = "remoteapplicationexpandcmdline" |
static const char | key_int_remoteapplicationmode [] = "remoteapplicationmode" |
static const char | key_int_enablecredsspsupport [] = "enablecredsspsupport" |
static const char | key_int_enablerdsaadauth [] = "enablerdsaadauth" |
static const char | key_int_negotiate_security_layer [] = "negotiate security layer" |
static const char | key_int_prompt_for_credentials [] = "prompt for credentials" |
static const char | key_int_promptcredentialonce [] = "promptcredentialonce" |
static const char | key_int_authentication_level [] = "authentication level" |
static const char | key_int_public_mode [] = "public mode" |
static const char | key_int_autoreconnect_max_retries [] = "autoreconnect max retries" |
static const char | key_int_autoreconnection_enabled [] = "autoreconnection enabled" |
static const char | key_int_administrative_session [] = "administrative session" |
static const char | key_int_connect_to_console [] = "connect to console" |
static const char | key_int_disableclipboardredirection [] = "disableclipboardredirection" |
static const char | key_int_disableprinterredirection [] = "disableprinterredirection" |
static const char | key_int_redirectdirectx [] = "redirectdirectx" |
static const char | key_int_redirectposdevices [] = "redirectposdevices" |
static const char | key_int_redirectclipboard [] = "redirectclipboard" |
static const char | key_int_redirectsmartcards [] = "redirectsmartcards" |
static const char | key_int_redirectcomports [] = "redirectcomports" |
static const char | key_int_redirectlocation [] = "redirectlocation" |
static const char | key_int_redirectprinters [] = "redirectprinters" |
static const char | key_int_redirectdrives [] = "redirectdrives" |
static const char | key_int_server_port [] = "server port" |
static const char | key_int_bitmapcachepersistenable [] = "bitmapcachepersistenable" |
static const char | key_int_bitmapcachesize [] = "bitmapcachesize" |
static const char | key_int_disable_cursor_setting [] = "disable cursor setting" |
static const char | key_int_disable_themes [] = "disable themes" |
static const char | key_int_disable_menu_anims [] = "disable menu anims" |
static const char | key_int_disable_full_window_drag [] = "disable full window drag" |
static const char | key_int_allow_desktop_composition [] = "allow desktop composition" |
static const char | key_int_allow_font_smoothing [] = "allow font smoothing" |
static const char | key_int_disable_wallpaper [] = "disable wallpaper" |
static const char | key_int_enableworkspacereconnect [] = "enableworkspacereconnect" |
static const char | key_int_workspaceid [] = "workspaceid" |
static const char | key_int_displayconnectionbar [] = "displayconnectionbar" |
static const char | key_int_pinconnectionbar [] = "pinconnectionbar" |
static const char | key_int_bandwidthautodetect [] = "bandwidthautodetect" |
static const char | key_int_networkautodetect [] = "networkautodetect" |
static const char | key_int_connection_type [] = "connection type" |
static const char | key_int_videoplaybackmode [] = "videoplaybackmode" |
static const char | key_int_redirected_video_capture_encoding_quality [] |
static const char | key_int_encode_redirected_video_capture [] = "encode redirected video capture" |
static const char | key_int_audiocapturemode [] = "audiocapturemode" |
static const char | key_int_audioqualitymode [] = "audioqualitymode" |
static const char | key_int_audiomode [] = "audiomode" |
static const char | key_int_disable_ctrl_alt_del [] = "disable ctrl+alt+del" |
static const char | key_int_keyboardhook [] = "keyboardhook" |
static const char | key_int_compression [] = "compression" |
static const char | key_int_desktopscalefactor [] = "desktopscalefactor" |
static const char | key_int_session_bpp [] = "session bpp" |
static const char | key_int_desktop_size_id [] = "desktop size id" |
static const char | key_int_desktopheight [] = "desktopheight" |
static const char | key_int_desktopwidth [] = "desktopwidth" |
static const char | key_int_superpanaccelerationfactor [] = "superpanaccelerationfactor" |
static const char | key_int_enablesuperpan [] = "enablesuperpan" |
static const char | key_int_dynamic_resolution [] = "dynamic resolution" |
static const char | key_int_smart_sizing [] = "smart sizing" |
static const char | key_int_span_monitors [] = "span monitors" |
static const char | key_int_screen_mode_id [] = "screen mode id" |
static const char | key_int_singlemoninwindowedmode [] = "singlemoninwindowedmode" |
static const char | key_int_maximizetocurrentdisplays [] = "maximizetocurrentdisplays" |
static const char | key_int_use_multimon [] = "use multimon" |
static const char | key_int_redirectwebauthn [] = "redirectwebauthn" |
#define INVALID_INTEGER_VALUE 0xFFFFFFFF |
#define RDP_FILE_LINE_FLAG_FORMATTED 0x00000001 |
#define RDP_FILE_LINE_FLAG_STANDARD 0x00000002 |
#define RDP_FILE_LINE_FLAG_TYPE_BINARY 0x00000040 |
#define RDP_FILE_LINE_FLAG_TYPE_INTEGER 0x00000020 |
#define RDP_FILE_LINE_FLAG_TYPE_STRING 0x00000010 |
#define TAG CLIENT_TAG("common") |
FreeRDP: A Remote Desktop Protocol Implementation .rdp file
Copyright 2012 Marc-Andre Moreau marca ndre .more au@g mail. com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Remote Desktop Plus - Overview of .rdp file settings: http://www.donkz.nl/files/rdpsettings.html
RDP Settings for Remote Desktop Services in Windows Server 2008 R2: http://technet.microsoft.com/en-us/library/ff393699/
https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/rdp-files
#define WRITE_SETTING_ | ( | fmt_, | |
... | |||
) |
#define WRITE_SETTING_INT | ( | key_, | |
param_ | |||
) |
#define WRITE_SETTING_STR | ( | key_, | |
param_ | |||
) |
|
static |
|
static |
|
static |
|
static |
BOOL freerdp_client_parse_rdp_file | ( | rdpFile * | file, |
const char * | name | ||
) |
BOOL freerdp_client_parse_rdp_file_buffer | ( | rdpFile * | file, |
const BYTE * | buffer, | ||
size_t | size | ||
) |
BOOL freerdp_client_parse_rdp_file_buffer_ex | ( | rdpFile * | file, |
const BYTE * | buffer, | ||
size_t | size, | ||
rdp_file_fkt_parse | parse | ||
) |
BOOL freerdp_client_parse_rdp_file_ex | ( | rdpFile * | file, |
const char * | name, | ||
rdp_file_fkt_parse | parse | ||
) |
|
static |
|
static |
|
static |
BOOL freerdp_client_populate_rdp_file_from_settings | ( | rdpFile * | file, |
const rdpSettings * | settings | ||
) |
BOOL freerdp_client_populate_settings_from_rdp_file | ( | const rdpFile * | file, |
rdpSettings * | settings | ||
) |
Screen Mode Id: http://technet.microsoft.com/en-us/library/ff393692/
This setting corresponds to the selection in the Display configuration slider on the Display tab under Options in RDC.
Values:
1: The remote session will appear in a window. 2: The remote session will appear full screen.
SmartSizingWidth and SmartSizingHeight:
Adding this option to use the DesktopHeight and DesktopWidth as parameters for the SmartSizingWidth and SmartSizingHeight, as there are no options for that in standard RDP files.
Equivalent of doing /smart-sizing:WxH
Authentication Level: http://technet.microsoft.com/en-us/library/ff393709/
This setting corresponds to the selection in the If server authentication fails drop-down list on the Advanced tab under Options in RDC.
Values:
0: If server authentication fails, connect to the computer without warning (Connect and don’t warn me). 1: If server authentication fails, do not establish a connection (Do not connect). 2: If server authentication fails, show a warning and allow me to connect or refuse the connection (Warn me). 3: No authentication requirement is specified.
Devices to redirect: http://technet.microsoft.com/en-us/library/ff393728/
This setting corresponds to the selections for Other supported Plug and Play (PnP) devices under More on the Local Resources tab under Options in RDC.
Values:
'*': Redirect all supported Plug and Play devices.
'DynamicDevices': Redirect any supported Plug and Play devices that are connected later.
The hardware ID for the supported Plug and Play device: Redirect the specified supported Plug and Play device.
Examples: devicestoredirect:s:* devicestoredirect:s:DynamicDevices devicestoredirect:s:USB\VID_04A9&PID_30C1\6&4BD985D&0&2;,DynamicDevices
|
static |
|
static |
|
static |
|
static |
void freerdp_client_rdp_file_free | ( | rdpFile * | file | ) |
int freerdp_client_rdp_file_get_integer_option | ( | const rdpFile * | file, |
const char * | name | ||
) |
const char* freerdp_client_rdp_file_get_string_option | ( | const rdpFile * | file, |
const char * | name | ||
) |
rdpFile* freerdp_client_rdp_file_new | ( | void | ) |
rdpFile* freerdp_client_rdp_file_new_ex | ( | DWORD | flags | ) |
void freerdp_client_rdp_file_set_callback_context | ( | rdpFile * | file, |
void * | context | ||
) |
|
static |
int freerdp_client_rdp_file_set_integer_option | ( | rdpFile * | file, |
const char * | name, | ||
int | value | ||
) |
|
static |
set a string value in the provided rdp file context
file | rdpFile |
name | name of the string |
value | value of the string to set |
int freerdp_client_rdp_file_set_string_option | ( | rdpFile * | file, |
const char * | name, | ||
const char * | value | ||
) |
Set a string option to a rdpFile
file | rdpFile |
name | name of the option |
value | value of the option |
BOOL freerdp_client_write_rdp_file | ( | const rdpFile * | file, |
const char * | name, | ||
BOOL | unicode | ||
) |
size_t freerdp_client_write_rdp_file_buffer | ( | const rdpFile * | file, |
char * | buffer, | ||
size_t | size | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |