/[LeafOK_CVS]/innwebd/NTService.h
ViewVC logotype

Annotation of /innwebd/NTService.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Fri Jun 25 07:01:51 2004 UTC (21 years, 8 months ago) by sysadm
Branch point for: GNU, MAIN
Content type: text/x-chdr
Initial revision

1 sysadm 1.1 // ntservice.h
2     //
3     // Definitions for CNTService
4     //
5     #pragma once
6    
7     #ifndef _NTSERVICE_H_
8     #define _NTSERVICE_H_
9    
10     #include "Winsvc.h"
11     #include ".\ntservmsg.h" // Event message ids
12    
13     #define SERVICE_CONTROL_USER 128
14    
15     class CNTService
16     {
17     public:
18     CNTService(const char* szServiceName);
19     virtual ~CNTService();
20     BOOL ParseStandardArgs(int argc, char* argv[]);
21     BOOL IsInstalled();
22     BOOL Install();
23     BOOL Uninstall();
24     void LogEvent(WORD wType, DWORD dwID,
25     const char* pszS1 = NULL,
26     const char* pszS2 = NULL,
27     const char* pszS3 = NULL);
28     BOOL StartService();
29     void SetStatus(DWORD dwState);
30     BOOL Initialize();
31     virtual void Run();
32     virtual BOOL OnInit();
33     virtual void OnStop();
34     virtual void OnInterrogate();
35     virtual void OnPause();
36     virtual void OnContinue();
37     virtual void OnShutdown();
38     virtual BOOL OnUserControl(DWORD dwOpcode);
39     void DebugMsg(const char* pszFormat, ...);
40    
41     // static member functions
42     static void WINAPI ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
43     static void WINAPI Handler(DWORD dwOpcode);
44    
45     // data members
46     char m_szServiceName[64];
47     int m_iMajorVersion;
48     int m_iMinorVersion;
49     SERVICE_STATUS_HANDLE m_hServiceStatus;
50     SERVICE_STATUS m_Status;
51     BOOL m_bIsRunning;
52    
53     // static data
54     static CNTService* m_pThis; // nasty hack to get object ptr
55    
56     private:
57     HANDLE m_hEventSource;
58    
59     };
60    
61     #endif // _NTSERVICE_H_

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1