summaryrefslogtreecommitdiff
path: root/source3/include/rpc_svcctl.h
blob: 5f83b19f68c2e8c692f7cbef90ffd42322f3e731 (plain)
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
/* 
   Unix SMB/CIFS implementation.
   SMB parameters and setup
   Copyright (C) Andrew Tridgell              1992-1997,
   Copyright (C) Gerald (Jerry) Carter        2005
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _RPC_SVCCTL_H /* _RPC_SVCCTL_H */
#define _RPC_SVCCTL_H 

/* svcctl pipe */

#define SVCCTL_CLOSE_SERVICE			0x00
#define SVCCTL_CONTROL_SERVICE			0x01
#define SVCCTL_LOCK_SERVICE_DB			0x03
#define SVCCTL_QUERY_SERVICE_SEC		0x04
#define SVCCTL_SET_SERVICE_SEC			0x05
#define SVCCTL_QUERY_STATUS			0x06
#define SVCCTL_UNLOCK_SERVICE_DB		0x08
#define SVCCTL_ENUM_DEPENDENT_SERVICES_W	0x0d
#define SVCCTL_ENUM_SERVICES_STATUS_W		0x0e
#define SVCCTL_OPEN_SCMANAGER_W			0x0f
#define SVCCTL_OPEN_SERVICE_W			0x10
#define SVCCTL_QUERY_SERVICE_CONFIG_W		0x11
#define SVCCTL_START_SERVICE_W			0x13
#define SVCCTL_GET_DISPLAY_NAME			0x14
#define SVCCTL_QUERY_SERVICE_CONFIG2_W		0x27
#define SVCCTL_QUERY_SERVICE_STATUSEX_W         0x28

/* ANSI versions not implemented currently 
#define SVCCTL_ENUM_SERVICES_STATUS_A		0x0e
#define SVCCTL_OPEN_SCMANAGER_A			0x1b
*/

/* SERVER_STATUS - type */

#define SVCCTL_TYPE_WIN32		0x00000030
#define SVCCTL_TYPE_DRIVER		0x0000000f

/* SERVER_STATUS - state */
#define SVCCTL_STATE_ACTIVE		0x00000001
#define SVCCTL_STATE_INACTIVE		0x00000002
#define SVCCTL_STATE_ALL		( SVCCTL_STATE_ACTIVE | SVCCTL_STATE_INACTIVE )

/* SERVER_STATUS - CurrentState */

#define SVCCTL_STATE_UNKNOWN		0x00000000	/* only used internally to smbd */
#define SVCCTL_STOPPED			0x00000001
#define SVCCTL_START_PENDING		0x00000002
#define SVCCTL_STOP_PENDING		0x00000003
#define SVCCTL_RUNNING			0x00000004
#define SVCCTL_CONTINUE_PENDING		0x00000005
#define SVCCTL_PAUSE_PENDING		0x00000006
#define SVCCTL_PAUSED			0x00000007

/* SERVER_STATUS - ControlAccepted */

#define SVCCTL_ACCEPT_NONE			0x00000000
#define SVCCTL_ACCEPT_STOP			0x00000001
#define SVCCTL_ACCEPT_PAUSE_CONTINUE		0x00000002
#define SVCCTL_ACCEPT_SHUTDOWN			0x00000004
#define SVCCTL_ACCEPT_PARAMCHANGE		0x00000008
#define SVCCTL_ACCEPT_NETBINDCHANGE		0x00000010
#define SVCCTL_ACCEPT_HARDWAREPROFILECHANGE	0x00000020
#define SVCCTL_ACCEPT_POWEREVENT		0x00000040

/* Service Config - values for ServiceType field*/

#define SVCCTL_KERNEL_DRVR                         0x00000001  /* doubtful we'll have these */
#define SVCCTL_FILE_SYSTEM_DRVR                    0x00000002  
#define SVCCTL_WIN32_OWN_PROC                      0x00000010
#define SVCCTL_WIN32_SHARED_PROC                   0x00000020
#define SVCCTL_WIN32_INTERACTIVE                   0x00000100 

#define SVC_HANDLE_IS_SCM			0x0000001
#define SVC_HANDLE_IS_SERVICE			0x0000002
#define SVC_HANDLE_IS_DBLOCK			0x0000003

/* utility structures for RPCs */

/*
 * "struct SERVICE_STATUS" comes from librpc/gen_ndr/svcctl.h
 */

typedef struct SERVICE_STATUS SERVICE_STATUS;

typedef struct {
	UNISTR servicename;
	UNISTR displayname;
	SERVICE_STATUS status;
} ENUM_SERVICES_STATUS;

/* rpc structures */

/**************************/

typedef struct {
	POLICY_HND handle;
	uint32 type;
	uint32 state;
	uint32 buffer_size;
	uint32 *resume;
} SVCCTL_Q_ENUM_SERVICES_STATUS;

typedef struct {
	RPC_BUFFER buffer;
	uint32 needed;
	uint32 returned;
	uint32 *resume;
	WERROR status;
} SVCCTL_R_ENUM_SERVICES_STATUS;

#endif /* _RPC_SVCCTL_H */