From 1079962e4c06f88a54e50d997c1b7e84303d30b4 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Sat, 15 Aug 2020 21:29:50 +0200 Subject: New upstream version 2.5~beta1 --- src/openvpn/win32.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/openvpn/win32.h') diff --git a/src/openvpn/win32.h b/src/openvpn/win32.h index 4b99a5e..da85ed4 100644 --- a/src/openvpn/win32.h +++ b/src/openvpn/win32.h @@ -25,7 +25,11 @@ #ifndef OPENVPN_WIN32_H #define OPENVPN_WIN32_H +#include + #include "mtu.h" +#include "openvpn-msg.h" +#include "argv.h" /* location of executables */ #define SYS_PATH_ENV_VAR_NAME "SystemRoot" /* environmental variable name that normally contains the system path */ @@ -35,7 +39,7 @@ #define WIN_NET_PATH_SUFFIX "\\system32\\net.exe" /* - * Win32-specific OpenVPN code, targetted at the mingw + * Win32-specific OpenVPN code, targeted at the mingw * development environment. */ @@ -65,7 +69,7 @@ struct security_attributes struct window_title { bool saved; - char old_window_title [256]; + char old_window_title[256]; }; struct rw_handle { @@ -294,10 +298,12 @@ bool win_wfp_block_dns(const NET_IFINDEX index, const HANDLE msg_channel); bool win_wfp_uninit(const NET_IFINDEX index, const HANDLE msg_channel); -#define WIN_XP 0 +#define WIN_XP 0 #define WIN_VISTA 1 -#define WIN_7 2 -#define WIN_8 3 +#define WIN_7 2 +#define WIN_8 3 +#define WIN_8_1 4 +#define WIN_10 5 int win32_version_info(void); @@ -307,5 +313,21 @@ int win32_version_info(void); */ const char *win32_version_string(struct gc_arena *gc, bool add_name); +/* + * Send the |size| bytes in buffer |data| to the interactive service |pipe| + * and read the result in |ack|. Returns false on communication error. + * The string in |context| is used to prefix error messages. + */ +bool send_msg_iservice(HANDLE pipe, const void *data, size_t size, + ack_message_t *ack, const char *context); + +/* + * Attempt to simulate fork/execve on Windows + */ +int +openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags); + +bool impersonate_as_system(); + #endif /* ifndef OPENVPN_WIN32_H */ #endif /* ifdef _WIN32 */ -- cgit v1.2.3