diff options
author | Bernhard Schmidt <berni@debian.org> | 2019-02-20 14:11:51 +0100 |
---|---|---|
committer | Bernhard Schmidt <berni@debian.org> | 2019-02-20 14:11:51 +0100 |
commit | 39ddb9cc8281bd239b94a3023da6329edb6718c1 (patch) | |
tree | dc6a8e7f1018f59f088c5b06b48eb24efe17f22d /src/openvpnserv/common.c | |
parent | d5078cc44b8919a25cb7507e9e6da1d66f25bb5b (diff) | |
parent | 87356242baf10c8b2a94d9013e436ed2a0dada53 (diff) |
Update upstream source from tag 'upstream/2.4.7'
Update to upstream version '2.4.7'
with Debian dir d01da6ef78dc8ce91265e8f319468f6c34d23af8
Diffstat (limited to 'src/openvpnserv/common.c')
-rw-r--r-- | src/openvpnserv/common.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index dc47666..73c418f 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -25,7 +25,7 @@ #include "validate.h" LPCTSTR service_instance = TEXT(""); - +static wchar_t win_sys_path[MAX_PATH]; /* * These are necessary due to certain buggy implementations of (v)snprintf, @@ -285,3 +285,17 @@ utf8to16(const char *utf8) MultiByteToWideChar(CP_UTF8, 0, utf8, -1, utf16, n); return utf16; } + +const wchar_t * +get_win_sys_path(void) +{ + const wchar_t *default_sys_path = L"C:\\Windows\\system32"; + + if (!GetSystemDirectoryW(win_sys_path, _countof(win_sys_path))) + { + wcsncpy(win_sys_path, default_sys_path, _countof(win_sys_path)); + win_sys_path[_countof(win_sys_path) - 1] = L'\0'; + } + + return win_sys_path; +} |