OpenVPN
win32-util.h File Reference
#include "argv.h"
#include "buffer.h"
Include dependency graph for win32-util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

WCHAR * wide_string (const char *utf8, struct gc_arena *gc)
WCHAR * wide_cmd_line (const struct argv *a, struct gc_arena *gc)
char * utf16to8 (const wchar_t *utf16, struct gc_arena *gc)
bool win_safe_filename (const char *fn)
const char * win_get_tempdir (void)
bool win_path_in_dir (const WCHAR *path, const WCHAR *dir)
 Check whether path resides within directory dir.

Function Documentation

◆ utf16to8()

char * utf16to8 ( const wchar_t * utf16,
struct gc_arena * gc )

Definition at line 119 of file win32-util.c.

References gc, and gc_malloc().

Referenced by strerror_win32().

◆ wide_cmd_line()

◆ wide_string()

◆ win_get_tempdir()

const char * win_get_tempdir ( void )

Definition at line 220 of file win32-util.c.

References M_ERRNO, M_WARN, and msg.

Referenced by platform_get_tmp_dir().

◆ win_path_in_dir()

bool win_path_in_dir ( const WCHAR * path,
const WCHAR * dir )

Check whether path resides within directory dir.

Unlike a plain string prefix match, this requires the match to end on a path-component boundary, so that "C:\\foo_evil\\bar" is not considered to be inside "C:\\foo". Both arguments are expected to be normalized absolute paths. The comparison is case-insensitive.

Returns
true if path is inside dir, false otherwise.

Definition at line 249 of file win32-util.c.

Referenced by plugin_in_trusted_dir(), and test_win_path_in_dir().

◆ win_safe_filename()

bool win_safe_filename ( const char * fn)

Definition at line 186 of file win32-util.c.

References cmp_prefix().

Referenced by platform_gen_path().