Pol  Revision:3cfda13
Pol::Clib::CNTService Class Reference

#include <NTService.h>

+ Inheritance diagram for Pol::Clib::CNTService:

Public Member Functions

 CNTService (const char *szServiceName)
 
virtual ~CNTService ()
 
void DebugMsg (const char *pszFormat,...)
 
BOOL Initialize ()
 
BOOL Install ()
 
BOOL IsInstalled ()
 
void LogEvent (WORD wType, DWORD dwID, const char *pszS1=NULL, const char *pszS2=NULL, const char *pszS3=NULL)
 
virtual void OnContinue ()
 
virtual BOOL OnInit ()
 
virtual void OnInterrogate ()
 
virtual void OnPause ()
 
virtual void OnShutdown ()
 
virtual void OnStop ()
 
virtual BOOL OnUserControl (DWORD dwOpcode)
 
BOOL ParseStandardArgs (int argc, char *argv[])
 
virtual void Run ()
 
void SetStatus (DWORD dwState)
 
BOOL StartService ()
 
BOOL Uninstall ()
 

Static Public Member Functions

static void WINAPI Handler (DWORD dwOpcode)
 
static void WINAPI ServiceMain (DWORD dwArgc, LPTSTR *lpszArgv)
 

Public Attributes

BOOL m_bIsRunning
 
SERVICE_STATUS_HANDLE m_hServiceStatus
 
int m_iMajorVersion
 
int m_iMinorVersion
 
SERVICE_STATUS m_Status
 
char m_szServiceName [64]
 

Static Public Attributes

static CNTServicem_pThis = NULL
 

Private Attributes

HANDLE m_hEventSource
 

Detailed Description

Definition at line 19 of file NTService.h.

Constructor & Destructor Documentation

Pol::Clib::CNTService::CNTService ( const char *  szServiceName)
Pol::Clib::CNTService::~CNTService ( )
virtual

Definition at line 48 of file NTService.cpp.

References DebugMsg(), and m_hEventSource.

Member Function Documentation

void Pol::Clib::CNTService::DebugMsg ( const char *  pszFormat,
  ... 
)
void Pol::Clib::CNTService::Handler ( DWORD  dwOpcode)
static
BOOL Pol::Clib::CNTService::Initialize ( )

Definition at line 353 of file NTService.cpp.

References BOOL(), DebugMsg(), EVMSG_FAILEDINIT, EVMSG_STARTED, LogEvent(), m_Status, OnInit(), and SetStatus().

Referenced by ServiceMain().

BOOL Pol::Clib::CNTService::Install ( )

Definition at line 167 of file NTService.cpp.

References DWORD(), EVMSG_INSTALLED, LogEvent(), and m_szServiceName.

Referenced by ParseStandardArgs().

BOOL Pol::Clib::CNTService::IsInstalled ( )

Definition at line 143 of file NTService.cpp.

References BOOL(), and m_szServiceName.

Referenced by ParseStandardArgs().

void Pol::Clib::CNTService::LogEvent ( WORD  wType,
DWORD  dwID,
const char *  pszS1 = NULL,
const char *  pszS2 = NULL,
const char *  pszS3 = NULL 
)
void Pol::Clib::CNTService::OnContinue ( )
virtual

Definition at line 483 of file NTService.cpp.

References DebugMsg().

Referenced by Handler().

BOOL Pol::Clib::CNTService::OnInit ( )
virtual

Definition at line 458 of file NTService.cpp.

References DebugMsg().

Referenced by Initialize().

void Pol::Clib::CNTService::OnInterrogate ( )
virtual

Definition at line 471 of file NTService.cpp.

References DebugMsg().

Referenced by Handler().

void Pol::Clib::CNTService::OnPause ( )
virtual

Definition at line 477 of file NTService.cpp.

References DebugMsg().

Referenced by Handler().

void Pol::Clib::CNTService::OnShutdown ( )
virtual

Definition at line 489 of file NTService.cpp.

References DebugMsg().

Referenced by Handler().

void Pol::Clib::CNTService::OnStop ( )
virtual

Reimplemented in Pol::Core::PolService.

Definition at line 465 of file NTService.cpp.

References DebugMsg().

Referenced by Handler(), and OnUserControl().

BOOL Pol::Clib::CNTService::OnUserControl ( DWORD  dwOpcode)
virtual
BOOL Pol::Clib::CNTService::ParseStandardArgs ( int  argc,
char *  argv[] 
)
void Pol::Clib::CNTService::Run ( )
virtual

Reimplemented in Pol::Core::PolService.

Definition at line 386 of file NTService.cpp.

References DebugMsg(), and m_bIsRunning.

Referenced by ServiceMain().

void Pol::Clib::CNTService::ServiceMain ( DWORD  dwArgc,
LPTSTR *  lpszArgv 
)
static
void Pol::Clib::CNTService::SetStatus ( DWORD  dwState)

Definition at line 343 of file NTService.cpp.

References DebugMsg(), m_hServiceStatus, and m_Status.

Referenced by Handler(), Initialize(), OnUserControl(), and ServiceMain().

BOOL Pol::Clib::CNTService::StartService ( )

Definition at line 291 of file NTService.cpp.

References BOOL(), DebugMsg(), DWORD(), m_szServiceName, and ServiceMain().

Referenced by ParseStandardArgs().

BOOL Pol::Clib::CNTService::Uninstall ( )

Definition at line 224 of file NTService.cpp.

References BOOL(), EVMSG_NOTREMOVED, EVMSG_REMOVED, LogEvent(), and m_szServiceName.

Referenced by ParseStandardArgs().

Member Data Documentation

BOOL Pol::Clib::CNTService::m_bIsRunning

Definition at line 53 of file NTService.h.

Referenced by CNTService(), Handler(), OnUserControl(), Run(), and ServiceMain().

HANDLE Pol::Clib::CNTService::m_hEventSource
private

Definition at line 59 of file NTService.h.

Referenced by CNTService(), LogEvent(), and ~CNTService().

SERVICE_STATUS_HANDLE Pol::Clib::CNTService::m_hServiceStatus

Definition at line 51 of file NTService.h.

Referenced by CNTService(), Handler(), ServiceMain(), and SetStatus().

int Pol::Clib::CNTService::m_iMajorVersion

Definition at line 49 of file NTService.h.

Referenced by CNTService(), and ParseStandardArgs().

int Pol::Clib::CNTService::m_iMinorVersion

Definition at line 50 of file NTService.h.

Referenced by CNTService(), and ParseStandardArgs().

CNTService * Pol::Clib::CNTService::m_pThis = NULL
static

Definition at line 56 of file NTService.h.

Referenced by CNTService(), Handler(), OnUserControl(), and ServiceMain().

SERVICE_STATUS Pol::Clib::CNTService::m_Status

Definition at line 52 of file NTService.h.

Referenced by CNTService(), Handler(), Initialize(), ServiceMain(), and SetStatus().

char Pol::Clib::CNTService::m_szServiceName[64]

The documentation for this class was generated from the following files: