Data Structures | Macros | Enumerations | Functions | Variables
service.h File Reference
#include <windows.h>
#include <stdlib.h>
#include <tchar.h>
Include dependency graph for service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  openvpn_service_t
struct  settings_t


#define APPNAME   TEXT(PACKAGE "serv")
#define MSG_FLAGS_ERROR   (1<<0)
#define MSG_FLAGS_SYS_CODE   (1<<1)
#define M_INFO   (0) /* informational */
#define M_SYSERR   (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */
#define M_ERR   (MSG_FLAGS_ERROR) /* error */
#define MAX_NAME   256


enum  openvpn_service_type { automatic, interactive, _service_max }


VOID WINAPI ServiceStartAutomatic (DWORD argc, LPTSTR *argv)
VOID WINAPI ServiceStartInteractive (DWORD argc, LPTSTR *argv)
int openvpn_vsntprintf (LPTSTR str, size_t size, LPCTSTR format, va_list arglist)
int openvpn_sntprintf (LPTSTR str, size_t size, LPCTSTR format,...)
DWORD GetOpenvpnSettings (settings_t *s)
LPCTSTR GetLastErrorText ()
DWORD MsgToEventLog (DWORD flags, LPCTSTR lpszMsg,...)
wchar_t * utf8to16 (const char *utf8)


openvpn_service_t automatic_service
openvpn_service_t interactive_service

Macro Definition Documentation


#define APPNAME   TEXT(PACKAGE "serv")

Definition at line 37 of file service.h.

Referenced by _tmain(), and MsgToEventLog().


#define M_ERR   (MSG_FLAGS_ERROR) /* error */

Definition at line 47 of file service.h.


#define M_INFO   (0) /* informational */

Definition at line 45 of file service.h.


#define M_SYSERR   (MSG_FLAGS_ERROR|MSG_FLAGS_SYS_CODE) /* error + system code */


#define MAX_NAME   256

Definition at line 63 of file service.h.

Referenced by GetBuiltinAdminGroupName(), IsAuthorizedUser(), and LookupSID().


#define MSG_FLAGS_ERROR   (1<<0)

Definition at line 43 of file service.h.

Referenced by _tmain(), HandleMessage(), MsgToEventLog(), ReportStatusToSCMgr(), and ReturnError().


#define MSG_FLAGS_SYS_CODE   (1<<1)

Definition at line 44 of file service.h.

Referenced by MsgToEventLog().



Definition at line 38 of file service.h.

Enumeration Type Documentation

◆ openvpn_service_type


Definition at line 49 of file service.h.

Function Documentation

◆ GetLastErrorText()

LPCTSTR GetLastErrorText ( )

Definition at line 188 of file common.c.

References openvpn_sntprintf().

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

◆ GetOpenvpnSettings()

DWORD GetOpenvpnSettings ( settings_t s)

◆ MsgToEventLog()

DWORD MsgToEventLog ( DWORD  flags,
LPCTSTR  lpszMsg,

◆ openvpn_sntprintf()

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

◆ openvpn_vsntprintf()

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

Definition at line 32 of file common.c.

Referenced by MsgToEventLog(), and openvpn_sntprintf().

◆ ReportStatusToSCMgr()

BOOL ReportStatusToSCMgr ( SERVICE_STATUS_HANDLE  service,

◆ ServiceStartAutomatic()

VOID WINAPI ServiceStartAutomatic ( DWORD  argc,
LPTSTR *  argv 

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  argc,
LPTSTR *  argv 

◆ utf8to16()

wchar_t* utf8to16 ( const char *  utf8)

Definition at line 254 of file common.c.

Referenced by HandleDNSConfigMessage(), and InterfaceLuid().

Variable Documentation

◆ automatic_service

openvpn_service_t automatic_service

Definition at line 49 of file automatic.c.

Referenced by _tmain().

◆ interactive_service

openvpn_service_t interactive_service

Definition at line 63 of file interactive.c.

Referenced by _tmain().