Functions | Variables
common.c File Reference
#include "service.h"
#include "validate.h"
Include dependency graph for common.c:

Go to the source code of this file.


BOOL openvpn_vsntprintf (LPTSTR str, size_t size, LPCTSTR format, va_list arglist)
BOOL openvpn_sntprintf (LPTSTR str, size_t size, LPCTSTR format,...)
BOOL openvpn_swprintf (wchar_t *const str, const size_t size, const wchar_t *const format,...)
static DWORD GetRegString (HKEY key, LPCTSTR value, LPTSTR data, DWORD size, LPCTSTR default_value)
DWORD GetOpenvpnSettings (settings_t *s)
LPCTSTR GetLastErrorText ()
DWORD MsgToEventLog (DWORD flags, LPCTSTR format,...)
wchar_t * utf8to16 (const char *utf8)
const wchar_t * get_win_sys_path (void)


LPCTSTR service_instance = TEXT("")
static wchar_t win_sys_path [MAX_PATH]

Function Documentation

◆ get_win_sys_path()

const wchar_t* get_win_sys_path ( void  )

Definition at line 306 of file common.c.

References ASSERT, and win_sys_path.

◆ GetLastErrorText()

LPCTSTR GetLastErrorText ( )

Definition at line 227 of file common.c.

References openvpn_sntprintf().

Referenced by CmdInstallServices(), CmdRemoveServices(), CmdStartService(), and MsgToEventLog().

◆ GetOpenvpnSettings()

DWORD GetOpenvpnSettings ( settings_t s)

◆ GetRegString()

static DWORD GetRegString ( HKEY  key,
LPCTSTR  value,
LPTSTR  data,
DWORD  size,
LPCTSTR  default_value 

Definition at line 76 of file common.c.

References M_SYSERR, MsgToEventLog(), openvpn_sntprintf(), PACKAGE_NAME, service_instance, and status.

Referenced by GetOpenvpnSettings().

◆ MsgToEventLog()

DWORD MsgToEventLog ( DWORD  flags,
LPCTSTR  format,

◆ openvpn_sntprintf()

BOOL openvpn_sntprintf ( LPTSTR  str,
size_t  size,
LPCTSTR  format,

◆ openvpn_swprintf()

BOOL openvpn_swprintf ( wchar_t *const  str,
const size_t  size,
const wchar_t *const  format,

Definition at line 61 of file common.c.

References buffer::len.

Referenced by secure_memzero().

◆ openvpn_vsntprintf()

BOOL openvpn_vsntprintf ( LPTSTR  str,
size_t  size,
LPCTSTR  format,
va_list  arglist 

Definition at line 35 of file common.c.

Referenced by MsgToEventLog(), and openvpn_sntprintf().

◆ utf8to16()

wchar_t* utf8to16 ( const char *  utf8)

Definition at line 293 of file common.c.

References malloc.

Referenced by HandleDNSConfigMessage(), and InterfaceLuid().

Variable Documentation

◆ service_instance

LPCTSTR service_instance = TEXT("")

◆ win_sys_path

wchar_t win_sys_path[MAX_PATH]

Definition at line 28 of file common.c.

Referenced by get_win_sys_path().