FreeRDP
client/common/file.c File Reference
#include <errno.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <freerdp/log.h>

Macros

#define TAG   CLIENT_TAG("common")
 
#define INVALID_INTEGER_VALUE   0xFFFFFFFF
 
#define WRITE_ALL_SETTINGS   TRUE
 
#define SETTING_MODIFIED(_settings, _field)   (WRITE_ALL_SETTINGS || _settings->SettingsModified[FreeRDP_##_field])
 
#define SETTING_MODIFIED_SET(_target, _settings, _field)   if SETTING_MODIFIED(_settings, _field) _target = _settings->_field
 
#define SETTING_MODIFIED_SET_STRING(_target, _settings, _field)
 

Functions

static int freerdp_client_rdp_file_set_integer (rdpFile *file, const char *name, int value, int index)
 
static BOOL freerdp_client_parse_rdp_file_integer (rdpFile *file, const char *name, const char *value, int index)
 
static int freerdp_client_rdp_file_set_string (rdpFile *file, const char *name, const char *value, int index)
 
static BOOL freerdp_client_add_option (rdpFile *file, char *option)
 
static int freerdp_client_parse_rdp_file_add_line (rdpFile *file, char *line, int index)
 
static BOOL freerdp_client_parse_rdp_file_string (rdpFile *file, char *name, char *value, int index)
 
static BOOL freerdp_client_parse_rdp_file_option (rdpFile *file, char *option, int index)
 
BOOL freerdp_client_parse_rdp_file_buffer (rdpFile *file, const BYTE *buffer, size_t size)
 
BOOL freerdp_client_parse_rdp_file (rdpFile *file, const char *name)
 
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)
 
size_t freerdp_client_write_rdp_file_buffer (const rdpFile *file, char *buffer, size_t size)
 
BOOL freerdp_client_populate_settings_from_rdp_file (rdpFile *file, rdpSettings *settings)
 
static rdpFileLine * freerdp_client_rdp_file_find_line_index (rdpFile *file, int index)
 
static rdpFileLine * freerdp_client_rdp_file_find_line_by_name (rdpFile *file, const char *name)
 
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 (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 (rdpFile *file, const char *name)
 
static void freerdp_client_file_string_check_free (LPSTR str)
 
rdpFile * freerdp_client_rdp_file_new ()
 
void freerdp_client_rdp_file_free (rdpFile *file)
 

Variables

static BYTE BOM_UTF16_LE [2] = { 0xFF, 0xFE }
 

Macro Definition Documentation

#define INVALID_INTEGER_VALUE   0xFFFFFFFF
#define SETTING_MODIFIED (   _settings,
  _field 
)    (WRITE_ALL_SETTINGS || _settings->SettingsModified[FreeRDP_##_field])
#define SETTING_MODIFIED_SET (   _target,
  _settings,
  _field 
)    if SETTING_MODIFIED(_settings, _field) _target = _settings->_field
#define SETTING_MODIFIED_SET_STRING (   _target,
  _settings,
  _field 
)
Value:
do { if SETTING_MODIFIED(_settings, _field) _target = _strdup(_settings->_field); \
if (!_target) return FALSE; \
} while (0)
#define SETTING_MODIFIED(_settings, _field)
Definition: client/common/file.c:570
return(void *)((char *) buffer-> buffer+buffer->tail)
winpr freerdp if(WITH_DEBUG_SYMBOLS AND MSVC AND NOT BUILTIN_CHANNELS AND BUILD_SHARED_LIBS) install(FILES $
Definition: channels/drive/client/CMakeLists.txt:32
WINPR_API char * _strdup(const char *strSource)
Definition: string.c:38
#define FALSE
Definition: trio.c:209
#define TAG   CLIENT_TAG("common")

FreeRDP: A Remote Desktop Protocol Implementation .rdp file

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.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/

#define WRITE_ALL_SETTINGS   TRUE

Function Documentation

static BOOL freerdp_client_add_option ( rdpFile *  file,
char *  option 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void freerdp_client_file_string_check_free ( LPSTR  str)
static

Here is the caller graph for this function:

BOOL freerdp_client_parse_rdp_file ( rdpFile *  file,
const char *  name 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int freerdp_client_parse_rdp_file_add_line ( rdpFile *  file,
char *  line,
int  index 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL freerdp_client_parse_rdp_file_buffer ( rdpFile *  file,
const BYTE buffer,
size_t  size 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_client_parse_rdp_file_integer ( rdpFile *  file,
const char *  name,
const char *  value,
int  index 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_client_parse_rdp_file_option ( rdpFile *  file,
char *  option,
int  index 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL freerdp_client_parse_rdp_file_string ( rdpFile *  file,
char *  name,
char *  value,
int  index 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL freerdp_client_populate_rdp_file_from_settings ( rdpFile *  file,
const rdpSettings *  settings 
)

Here is the caller graph for this function:

BOOL freerdp_client_populate_settings_from_rdp_file ( 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.

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&PID_30C1\6&4BD985D&0&2;,DynamicDevices

Here is the call graph for this function:

Here is the caller graph for this function:

static rdpFileLine* freerdp_client_rdp_file_find_line_by_name ( rdpFile *  file,
const char *  name 
)
static

Here is the caller graph for this function:

static rdpFileLine* freerdp_client_rdp_file_find_line_index ( rdpFile *  file,
int  index 
)
static

Here is the caller graph for this function:

void freerdp_client_rdp_file_free ( rdpFile *  file)

Here is the call graph for this function:

Here is the caller graph for this function:

int freerdp_client_rdp_file_get_integer_option ( rdpFile *  file,
const char *  name 
)

Here is the call graph for this function:

Here is the caller graph for this function:

const char* freerdp_client_rdp_file_get_string_option ( rdpFile *  file,
const char *  name 
)

Here is the call graph for this function:

Here is the caller graph for this function:

rdpFile* freerdp_client_rdp_file_new ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

static int freerdp_client_rdp_file_set_integer ( rdpFile *  file,
const char *  name,
int  value,
int  index 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int freerdp_client_rdp_file_set_integer_option ( rdpFile *  file,
const char *  name,
int  value 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int freerdp_client_rdp_file_set_string ( rdpFile *  file,
const char *  name,
const char *  value,
int  index 
)
static
Parameters
filerdpFile
namename of the string
valuevalue of the string to set
indexline index of the rdpFile
Returns
0 on success, 1 if the key wasn't found (not a standard key), -1 on error

Here is the call graph for this function:

Here is the caller graph for this function:

int freerdp_client_rdp_file_set_string_option ( rdpFile *  file,
const char *  name,
const char *  value 
)

Set a string option to a rdpFile

Parameters
filerdpFile
namename of the option
valuevalue of the option
Returns
0 on success

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL freerdp_client_write_rdp_file ( const rdpFile *  file,
const char *  name,
BOOL  unicode 
)

Here is the call graph for this function:

Here is the caller graph for this function:

size_t freerdp_client_write_rdp_file_buffer ( const rdpFile *  file,
char *  buffer,
size_t  size 
)

Here is the caller graph for this function:

Variable Documentation

BYTE BOM_UTF16_LE[2] = { 0xFF, 0xFE }
static