FreeRDP
core/settings.c File Reference
#include <freerdp/config.h>
#include "settings.h"
#include <freerdp/crypto/certificate.h>
#include <ctype.h>
#include <winpr/crt.h>
#include <winpr/file.h>
#include <winpr/path.h>
#include <winpr/sysinfo.h>
#include <winpr/registry.h>
#include <winpr/wtsapi.h>
#include <freerdp/settings.h>
#include <freerdp/build-config.h>
#include "../crypto/certificate.h"
#include "../crypto/privatekey.h"
#include "capabilities.h"

Macros

#define TAG   FREERDP_TAG("settings")
 
#define SERVER_KEY   "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server"
 
#define CLIENT_KEY   "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Client"
 
#define BITMAP_CACHE_KEY   CLIENT_KEY "\\BitmapCacheV2"
 
#define GLYPH_CACHE_KEY   CLIENT_KEY "\\GlyphCache"
 
#define POINTER_CACHE_KEY   CLIENT_KEY "\\PointerCache"
 

Functions

static BOOL settings_reg_query_dword_val (HKEY hKey, const TCHAR *sub, DWORD *value)
 
static BOOL settings_reg_query_word_val (HKEY hKey, const TCHAR *sub, UINT16 *value)
 
static BOOL settings_reg_query_bool_val (HKEY hKey, const TCHAR *sub, BOOL *value)
 
static BOOL settings_reg_query_dword (rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id, HKEY hKey, const TCHAR *sub)
 
static BOOL settings_reg_query_bool (rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, HKEY hKey, const TCHAR *sub)
 
static void settings_client_load_hkey_local_machine (rdpSettings *settings)
 
static void settings_server_load_hkey_local_machine (rdpSettings *settings)
 
static void settings_load_hkey_local_machine (rdpSettings *settings)
 
static BOOL settings_get_computer_name (rdpSettings *settings)
 
void freerdp_settings_print_warnings (const rdpSettings *settings)
 
BOOL freerdp_settings_set_default_order_support (rdpSettings *settings)
 
BOOL freerdp_capability_buffer_allocate (rdpSettings *settings, UINT32 count)
 
rdpSettings * freerdp_settings_new (DWORD flags)
 creates a new setting struct More...
 
static void freerdp_settings_free_internal (rdpSettings *settings)
 
void freerdp_settings_free (rdpSettings *settings)
 Free a settings struct with all data in it. More...
 
static BOOL freerdp_settings_int_buffer_copy (rdpSettings *_settings, const rdpSettings *settings)
 
BOOL freerdp_settings_copy (rdpSettings *_settings, const rdpSettings *settings)
 Deep copies settings from src to dst. More...
 
rdpSettings * freerdp_settings_clone (const rdpSettings *settings)
 Creates a deep copy of settings. More...
 
static void zfree (WCHAR *str, size_t len)
 
BOOL identity_set_from_settings_with_pwd (SEC_WINNT_AUTH_IDENTITY *identity, const rdpSettings *settings, FreeRDP_Settings_Keys_String UserId, FreeRDP_Settings_Keys_String DomainId, const WCHAR *Password, size_t pwdLen)
 
BOOL identity_set_from_settings (SEC_WINNT_AUTH_IDENTITY_W *identity, const rdpSettings *settings, FreeRDP_Settings_Keys_String UserId, FreeRDP_Settings_Keys_String DomainId, FreeRDP_Settings_Keys_String PwdId)
 
BOOL identity_set_from_smartcard_hash (SEC_WINNT_AUTH_IDENTITY_W *identity, const rdpSettings *settings, FreeRDP_Settings_Keys_String userId, FreeRDP_Settings_Keys_String domainId, FreeRDP_Settings_Keys_String pwdId, const BYTE *certSha1, size_t sha1len)
 
const char * freerdp_settings_glyph_level_string (UINT32 level, char *buffer, size_t size)
 
BOOL freerdp_target_net_adresses_reset (rdpSettings *settings, size_t size)
 

Variables

static const char client_dll [] = "C:\\Windows\\System32\\mstscax.dll"
 

Macro Definition Documentation

◆ BITMAP_CACHE_KEY

#define BITMAP_CACHE_KEY   CLIENT_KEY "\\BitmapCacheV2"

◆ CLIENT_KEY

#define CLIENT_KEY   "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Client"

◆ GLYPH_CACHE_KEY

#define GLYPH_CACHE_KEY   CLIENT_KEY "\\GlyphCache"

◆ POINTER_CACHE_KEY

#define POINTER_CACHE_KEY   CLIENT_KEY "\\PointerCache"

◆ SERVER_KEY

#define SERVER_KEY   "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\Server"

◆ TAG

#define TAG   FREERDP_TAG("settings")

FreeRDP: A Remote Desktop Protocol Implementation RDP Settings

Copyright 2009-2011 Jay Sorg Copyright 2023 Armin Novak anova.nosp@m.k@th.nosp@m.incas.nosp@m.t.co.nosp@m.m Copyright 2023 Thincast Technologies GmbH

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.

Function Documentation

◆ freerdp_capability_buffer_allocate()

BOOL freerdp_capability_buffer_allocate ( rdpSettings *  settings,
UINT32  count 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_clone()

rdpSettings* freerdp_settings_clone ( const rdpSettings *  settings)

Creates a deep copy of settings.

Parameters
settingsA pointer to a settings struct to copy. May be NULL (returns NULL)
Returns
A newly allocated copy of settings or NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_copy()

BOOL freerdp_settings_copy ( rdpSettings *  dst,
const rdpSettings *  src 
)

Deep copies settings from src to dst.

The function frees up all allocated data in dst before copying the data from src

Parameters
dstA pointer for the settings to copy data to. May be NULL (fails copy)
srcA pointer to the settings to copy. May be NULL (fails copy)
Returns
TRUE for success, FALSE for failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_free()

void freerdp_settings_free ( rdpSettings *  settings)

Free a settings struct with all data in it.

Parameters
settingsA pointer to the settings to free, May be NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_free_internal()

static void freerdp_settings_free_internal ( rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_glyph_level_string()

const char* freerdp_settings_glyph_level_string ( UINT32  level,
char *  buffer,
size_t  size 
)
Here is the caller graph for this function:

◆ freerdp_settings_int_buffer_copy()

static BOOL freerdp_settings_int_buffer_copy ( rdpSettings *  _settings,
const rdpSettings *  settings 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_new()

rdpSettings* freerdp_settings_new ( DWORD  flags)

creates a new setting struct

Parameters
flagsFlags for creation, use FREERDP_SETTINGS_SERVER_MODE for server settings, 0 for client.
Returns
A newly allocated settings struct or NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_print_warnings()

void freerdp_settings_print_warnings ( const rdpSettings *  settings)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_settings_set_default_order_support()

BOOL freerdp_settings_set_default_order_support ( rdpSettings *  settings)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_target_net_adresses_reset()

BOOL freerdp_target_net_adresses_reset ( rdpSettings *  settings,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity_set_from_settings()

BOOL identity_set_from_settings ( SEC_WINNT_AUTH_IDENTITY_W identity,
const rdpSettings *  settings,
FreeRDP_Settings_Keys_String  UserId,
FreeRDP_Settings_Keys_String  DomainId,
FreeRDP_Settings_Keys_String  PwdId 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity_set_from_settings_with_pwd()

BOOL identity_set_from_settings_with_pwd ( SEC_WINNT_AUTH_IDENTITY identity,
const rdpSettings *  settings,
FreeRDP_Settings_Keys_String  UserId,
FreeRDP_Settings_Keys_String  DomainId,
const WCHAR *  Password,
size_t  pwdLen 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity_set_from_smartcard_hash()

BOOL identity_set_from_smartcard_hash ( SEC_WINNT_AUTH_IDENTITY_W identity,
const rdpSettings *  settings,
FreeRDP_Settings_Keys_String  userId,
FreeRDP_Settings_Keys_String  domainId,
FreeRDP_Settings_Keys_String  pwdId,
const BYTE certSha1,
size_t  sha1len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_client_load_hkey_local_machine()

static void settings_client_load_hkey_local_machine ( rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_get_computer_name()

static BOOL settings_get_computer_name ( rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_load_hkey_local_machine()

static void settings_load_hkey_local_machine ( rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_reg_query_bool()

static BOOL settings_reg_query_bool ( rdpSettings *  settings,
FreeRDP_Settings_Keys_Bool  id,
HKEY  hKey,
const TCHAR sub 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_reg_query_bool_val()

static BOOL settings_reg_query_bool_val ( HKEY  hKey,
const TCHAR sub,
BOOL *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_reg_query_dword()

static BOOL settings_reg_query_dword ( rdpSettings *  settings,
FreeRDP_Settings_Keys_UInt32  id,
HKEY  hKey,
const TCHAR sub 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_reg_query_dword_val()

static BOOL settings_reg_query_dword_val ( HKEY  hKey,
const TCHAR sub,
DWORD *  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_reg_query_word_val()

static BOOL settings_reg_query_word_val ( HKEY  hKey,
const TCHAR sub,
UINT16 value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settings_server_load_hkey_local_machine()

static void settings_server_load_hkey_local_machine ( rdpSettings *  settings)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zfree()

static void zfree ( WCHAR *  str,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ client_dll

const char client_dll[] = "C:\\Windows\\System32\\mstscax.dll"
static