|
OpenVPN
|

Go to the source code of this file.
Functions | |
| static DWORD | GetRegString (HKEY key, LPCWSTR value, LPWSTR data, DWORD size, LPCWSTR default_value) |
| static BOOL | ensure_trailing_backslash (PWSTR dir, size_t size) |
| Make sure that a dir path ends with a backslash. | |
| DWORD | GetOpenvpnSettings (settings_t *s) |
| LPCWSTR | GetLastErrorText (void) |
| DWORD | MsgToEventLog (DWORD flags, LPCWSTR format,...) |
| wchar_t * | utf8to16_size (const char *utf8, int size) |
| Convert a UTF-8 string to UTF-16. | |
| const wchar_t * | get_win_sys_path (void) |
Variables | |
| LPCWSTR | service_instance = L"" |
| static wchar_t | win_sys_path [MAX_PATH] |
|
static |
Make sure that a dir path ends with a backslash.
If it doesn't, a \ is added to the end of the path, if there's room in the buffer.
| dir | pointer to the wide dir path string buffer |
| size | maximum number of wide chars the dir path buffer |
Definition at line 68 of file common.c.
Referenced by GetOpenvpnSettings().
| const wchar_t * get_win_sys_path | ( | void | ) |
Definition at line 311 of file common.c.
References win_sys_path.
| LPCWSTR GetLastErrorText | ( | void | ) |
Definition at line 217 of file common.c.
Referenced by CmdInstallServices(), CmdRemoveServices(), CmdStartService(), and MsgToEventLog().
| DWORD GetOpenvpnSettings | ( | settings_t * | s | ) |
Definition at line 76 of file common.c.
References _L, settings_t::append, settings_t::bin_dir, settings_t::config_dir, ensure_trailing_backslash(), settings_t::exe_path, settings_t::ext_string, GetRegString(), settings_t::log_dir, M_ERR, M_SYSERR, MsgToEventLog(), settings_t::ovpn_admin_group, OVPN_ADMIN_GROUP, settings_t::ovpn_service_user, OVPN_SERVICE_USER, settings_t::priority, service_instance, and status.
Referenced by ServiceStartInteractive().
|
static |
Definition at line 33 of file common.c.
References _L, M_SYSERR, MsgToEventLog(), service_instance, and status.
Referenced by GetOpenvpnSettings().
| DWORD MsgToEventLog | ( | DWORD | flags, |
| LPCWSTR | format, | ||
| ... | |||
| ) |
Definition at line 253 of file common.c.
References APPNAME, GetLastErrorText(), msg, MSG_FLAGS_ERROR, MSG_FLAGS_SYS_CODE, and service_instance.
Referenced by AddDnsSearchDomains(), ApplyDnsSettings(), BlockDNSErrHandler(), CreateClientPipeInstance(), DeleteNrptRules(), DeleteWfpBlock(), ExecCommand(), GetInterfacesKey(), GetNrptExcludeData(), GetOpenvpnSettings(), GetRegString(), GetStartupData(), GetTokenGroups(), HandleDNSConfigNrptMessage(), HandleMessage(), InitialSearchListExists(), InterfaceIdString(), IsAuthorizedUser(), IsDhcpEnabled(), IsInterfaceConnected(), IsUserInGroup(), RegisterDNS(), RemoveDnsSearchDomains(), ReportStatusToSCMgr(), ResetDnsSearchDomains(), ReturnError(), RunOpenvpn(), ServiceStartInteractive(), SetDnsSearchDomains(), SetNameServersValue(), SetNrptExcludeRules(), SetNrptRules(), StoreInitialDnsSearchList(), and wmain().
| wchar_t * utf8to16_size | ( | const char * | utf8, |
| int | size | ||
| ) |
Convert a UTF-8 string to UTF-16.
The size parameter can be used to convert strings which contain inline NUL characters, like MULTI_SZ strings used as values in the registry do, or (sub)strings that are not zero terminated. If size is -1 the length of the string is determined automatically by the WIN32 API. Make sure you pass a terminated string or else bad things will happen. Note that the size you pass should always include the terminating zero as well.
If the returned string is not NULL it must be freed by the caller.
| utf8 | const string to be converted |
| size | the size of the string |
Definition at line 294 of file common.c.
Referenced by SetNrptRules(), and utf8to16().
| LPCWSTR service_instance = L"" |
Definition at line 29 of file common.c.
Referenced by CreateClientPipeInstance(), GetOpenvpnSettings(), GetRegString(), MsgToEventLog(), RunOpenvpn(), and wmain().
|
static |
Definition at line 30 of file common.c.
Referenced by get_win_sys_path().