Data Structures | Macros | Enumerations | Functions | Variables
service.h File Reference
#include <winsock2.h>
#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 UNICODE
#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 { interactive, _service_max }


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


openvpn_service_t interactive_service
LPCTSTR service_instance

Macro Definition Documentation


#define APPNAME   TEXT(PACKAGE "serv")

Definition at line 41 of file service.h.


#define M_ERR   (MSG_FLAGS_ERROR) /* error */

Definition at line 51 of file service.h.


#define M_INFO   (0) /* informational */

Definition at line 49 of file service.h.


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

Definition at line 50 of file service.h.


#define MAX_NAME   256

Definition at line 66 of file service.h.


#define MSG_FLAGS_ERROR   (1<<0)

Definition at line 47 of file service.h.


#define MSG_FLAGS_SYS_CODE   (1<<1)

Definition at line 48 of file service.h.



Definition at line 42 of file service.h.


#define UNICODE

Definition at line 29 of file service.h.

Enumeration Type Documentation

◆ openvpn_service_type


Definition at line 53 of file service.h.

Function Documentation

◆ get_win_sys_path()

const wchar_t* get_win_sys_path ( void  )

◆ GetLastErrorText()

LPCTSTR GetLastErrorText ( )

Definition at line 214 of file common.c.

References openvpn_swprintf().

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

◆ GetOpenvpnSettings()

DWORD GetOpenvpnSettings ( settings_t s)

◆ MsgToEventLog()

DWORD MsgToEventLog ( DWORD  flags,
LPCTSTR  lpszMsg,

◆ openvpn_sntprintf()

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

◆ openvpn_swprintf()

BOOL openvpn_swprintf ( wchar_t *const  str,
const size_t  size,
const wchar_t *const  format,

◆ openvpn_vsntprintf()

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

◆ ReportStatusToSCMgr()

BOOL ReportStatusToSCMgr ( SERVICE_STATUS_HANDLE  service,

Definition at line 22 of file service.c.

References MSG_FLAGS_ERROR, MsgToEventLog(), service, and status.

Referenced by ServiceCtrlInteractive(), and ServiceStartInteractive().

◆ ServiceStartInteractive()

VOID WINAPI ServiceStartInteractive ( DWORD  argc,
LPTSTR *  argv 

◆ ServiceStartInteractiveOwn()

VOID WINAPI ServiceStartInteractiveOwn ( DWORD  argc,
LPTSTR *  argv 

Definition at line 2267 of file interactive.c.

References ServiceStartInteractive(), and status.

Referenced by _tmain().

◆ utf8to16()

wchar_t* utf8to16 ( const char *  utf8)

Variable Documentation

◆ interactive_service

openvpn_service_t interactive_service

Definition at line 60 of file interactive.c.

Referenced by _tmain(), and ServiceStartInteractive().

◆ service_instance

LPCTSTR service_instance