-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil_ntservice.h
148 lines (121 loc) · 2.99 KB
/
util_ntservice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//
// Copyright (C) 2003-2004 Trevor Hogan
//
/***********************************************************************
* NT Service code written by ConfusedFish and modified by Trevor Hogan *
***********************************************************************/
#ifndef UTIL_NTSERVICE_H
#define UTIL_NTSERVICE_H
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Define the facility codes
//
// Define the severity codes
//
//
// MessageId: EVMSG_INSTALLED
//
// MessageText:
//
// The %1 service was installed.
//
#define EVMSG_INSTALLED 0x00000064L
//
// MessageId: EVMSG_REMOVED
//
// MessageText:
//
// The %1 service was removed.
//
#define EVMSG_REMOVED 0x00000065L
//
// MessageId: EVMSG_NOTREMOVED
//
// MessageText:
//
// The %1 service could not be removed.
//
#define EVMSG_NOTREMOVED 0x00000066L
//
// MessageId: EVMSG_CTRLHANDLERNOTINSTALLED
//
// MessageText:
//
// The control handler could not be installed.
//
#define EVMSG_CTRLHANDLERNOTINSTALLED 0x00000067L
//
// MessageId: EVMSG_FAILEDINIT
//
// MessageText:
//
// The initialization process failed.
//
#define EVMSG_FAILEDINIT 0x00000068L
//
// MessageId: EVMSG_STARTED
//
// MessageText:
//
// The service was started.
//
#define EVMSG_STARTED 0x00000069L
//
// MessageId: EVMSG_BADREQUEST
//
// MessageText:
//
// The service received an unsupported request.
//
#define EVMSG_BADREQUEST 0x0000006AL
//
// MessageId: EVMSG_DEBUG
//
// MessageText:
//
// Debug: %1
//
#define EVMSG_DEBUG 0x0000006BL
//
// MessageId: EVMSG_STOPPED
//
// MessageText:
//
// The service was stopped.
//
#define EVMSG_STOPPED 0x0000006CL
BOOL UTIL_NTServiceTest( );
BOOL UTIL_NTServiceInstall( );
BOOL UTIL_NTServiceUninstall( );
BOOL UTIL_NTServiceStart( );
BOOL UTIL_NTServiceStop( );
void UTIL_NTLogEvent( WORD wType, DWORD dwID, const char *pszS1 = NULL, const char *pszS2 = NULL, const char *pszS3 = NULL );
void WINAPI NTServiceHandler( DWORD dwOpcode );
void WINAPI NTServiceMain( DWORD dwArgc, LPTSTR *lpszArgv );
extern SERVICE_STATUS_HANDLE ghServiceStatus;
extern SERVICE_STATUS gssStatus;
#endif