OpenVPN
Data Structures | Macros | Functions | Variables
openvpnmsica.h File Reference
#include <windows.h>
#include <msi.h>
#include "../tapctl/basic.h"
Include dependency graph for openvpnmsica.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  openvpnmsica_thread_data
 Thread local storage data. More...
 

Macros

#define ERROR_MSICA   2550L
 
#define ERROR_MSICA_ERRNO   2551L
 
#define OPENVPNMSICA_SAVE_MSI_SESSION(hInstall)
 Set MSI session handle in thread local storage. More...
 
#define DLLEXP_DECL
 
#define DLLEXP_EXPORT   "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__
 

Functions

DLLEXP_DECL UINT __stdcall FindSystemInfo (_In_ MSIHANDLE hInstall)
 Determines Windows information: More...
 
DLLEXP_DECL UINT __stdcall FindTAPInterfaces (_In_ MSIHANDLE hInstall)
 Find existing TAP interfaces and set TAPINTERFACES property with semicolon delimited list of installed TAP interface GUIDs. More...
 
DLLEXP_DECL UINT __stdcall CloseOpenVPNGUI (_In_ MSIHANDLE hInstall)
 Find OpenVPN GUI window and send it a WM_CLOSE message. More...
 
DLLEXP_DECL UINT __stdcall StartOpenVPNGUI (_In_ MSIHANDLE hInstall)
 Launches OpenVPN GUI. More...
 
DLLEXP_DECL UINT __stdcall EvaluateTAPInterfaces (_In_ MSIHANDLE hInstall)
 Evaluate the TAPInterface table of the MSI package database and prepare a list of TAP interfaces to install/remove. More...
 
DLLEXP_DECL UINT __stdcall ProcessDeferredAction (_In_ MSIHANDLE hInstall)
 Perform scheduled deferred action. More...
 

Variables

DWORD openvpnmsica_thread_data_idx
 MSI session handle thread local storage index. More...
 

Macro Definition Documentation

◆ DLLEXP_DECL

#define DLLEXP_DECL

Definition at line 72 of file openvpnmsica.h.

◆ DLLEXP_EXPORT

#define DLLEXP_EXPORT   "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__

Definition at line 73 of file openvpnmsica.h.

◆ ERROR_MSICA

#define ERROR_MSICA   2550L

Definition at line 32 of file openvpnmsica.h.

Referenced by x_msg_va().

◆ ERROR_MSICA_ERRNO

#define ERROR_MSICA_ERRNO   2551L

Definition at line 33 of file openvpnmsica.h.

Referenced by x_msg_va().

◆ OPENVPNMSICA_SAVE_MSI_SESSION

#define OPENVPNMSICA_SAVE_MSI_SESSION (   hInstall)
Value:
{ \
s->hInstall = (hInstall); \
}
Thread local storage data.
Definition: openvpnmsica.h:39
DWORD openvpnmsica_thread_data_idx
MSI session handle thread local storage index.
Definition: dllmain.c:40

Set MSI session handle in thread local storage.

Definition at line 54 of file openvpnmsica.h.

Referenced by EvaluateTAPInterfaces(), FindSystemInfo(), FindTAPInterfaces(), ProcessDeferredAction(), and StartOpenVPNGUI().

Function Documentation

◆ CloseOpenVPNGUI()

DLLEXP_DECL UINT __stdcall CloseOpenVPNGUI ( _In_ MSIHANDLE  hInstall)

Find OpenVPN GUI window and send it a WM_CLOSE message.

Parameters
hInstallHandle to the installation provided to the DLL custom action
Returns
ERROR_SUCCESS on success; An error code otherwise See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx

Definition at line 631 of file openvpnmsica.c.

References openvpnmsica_debug_popup.

◆ EvaluateTAPInterfaces()

DLLEXP_DECL UINT __stdcall EvaluateTAPInterfaces ( _In_ MSIHANDLE  hInstall)

Evaluate the TAPInterface table of the MSI package database and prepare a list of TAP interfaces to install/remove.

Parameters
hInstallHandle to the installation provided to the DLL custom action
Returns
ERROR_SUCCESS on success; An error code otherwise See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx

Definition at line 740 of file openvpnmsica.c.

References false, free, M_ERRNO, M_NONFATAL, msg, msi_format_field(), msi_get_record_string(), MSICA_INTERFACE_TICK_SIZE, msica_op_create_bool(), msica_op_create_string(), msica_op_rollback_enable, msica_op_seq_add_tail(), msica_op_seq_free(), msica_op_seq_init(), msica_op_seq_save(), msica_op_tap_interface_create, msica_op_tap_interface_delete_by_name, openvpnmsica_debug_popup, OPENVPNMSICA_SAVE_MSI_SESSION, openvpnmsica_setup_sequence_filename(), PRIsLPTSTR, and true.

◆ FindSystemInfo()

DLLEXP_DECL UINT __stdcall FindSystemInfo ( _In_ MSIHANDLE  hInstall)

Determines Windows information:

  • Sets DriverCertification MSI property to "", "attsgn" or "whql" according to the driver certification required by the running version of Windows.
Parameters
hInstallHandle to the installation provided to the DLL custom action
Returns
ERROR_SUCCESS on success; An error code otherwise See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx

Definition at line 442 of file openvpnmsica.c.

References openvpnmsica_debug_popup, OPENVPNMSICA_SAVE_MSI_SESSION, openvpnmsica_set_driver_certification(), and openvpnmsica_set_openvpnserv_state().

◆ FindTAPInterfaces()

DLLEXP_DECL UINT __stdcall FindTAPInterfaces ( _In_ MSIHANDLE  hInstall)

Find existing TAP interfaces and set TAPINTERFACES property with semicolon delimited list of installed TAP interface GUIDs.

Parameters
hInstallHandle to the installation provided to the DLL custom action
Returns
ERROR_SUCCESS on success; An error code otherwise See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx

Definition at line 466 of file openvpnmsica.c.

References free, tap_interface_node::guid, M_ERRNO, M_FATAL, M_NONFATAL, malloc, msg, openvpnmsica_debug_popup, OPENVPNMSICA_SAVE_MSI_SESSION, tap_interface_node::pNext, tap_free_interface_list(), and tap_list_interfaces().

◆ ProcessDeferredAction()

DLLEXP_DECL UINT __stdcall ProcessDeferredAction ( _In_ MSIHANDLE  hInstall)

◆ StartOpenVPNGUI()

DLLEXP_DECL UINT __stdcall StartOpenVPNGUI ( _In_ MSIHANDLE  hInstall)

Launches OpenVPN GUI.

It's path is obtained by expanding the [#bin.openvpn_gui.exe] therefore, its Id field in File table must be "bin.openvpn_gui.exe".

Parameters
hInstallHandle to the installation provided to the DLL custom action
Returns
ERROR_SUCCESS on success; An error code otherwise See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa368072.aspx

Definition at line 654 of file openvpnmsica.c.

References free, M_ERRNO, M_FATAL, M_NONFATAL, malloc, msg, openvpnmsica_debug_popup, and OPENVPNMSICA_SAVE_MSI_SESSION.

Variable Documentation

◆ openvpnmsica_thread_data_idx

DWORD openvpnmsica_thread_data_idx

MSI session handle thread local storage index.

Definition at line 40 of file dllmain.c.

Referenced by DllMain(), and x_msg_va().