06218b6239999eba30216e214b68b9c69f27396b
[metze/samba/wip.git] / source3 / include / rpc_svcctl.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell              1992-1997,
5    Copyright (C) Gerald (Jerry) Carter        2005
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _RPC_SVCCTL_H /* _RPC_SVCCTL_H */
22 #define _RPC_SVCCTL_H 
23
24 /* svcctl pipe */
25
26 #define SVCCTL_CLOSE_SERVICE                    0x00
27 #define SVCCTL_CONTROL_SERVICE                  0x01
28 #define SVCCTL_LOCK_SERVICE_DB                  0x03
29 #define SVCCTL_QUERY_SERVICE_SEC                0x04
30 #define SVCCTL_SET_SERVICE_SEC                  0x05
31 #define SVCCTL_QUERY_STATUS                     0x06
32 #define SVCCTL_UNLOCK_SERVICE_DB                0x08
33 #define SVCCTL_ENUM_DEPENDENT_SERVICES_W        0x0d
34 #define SVCCTL_ENUM_SERVICES_STATUS_W           0x0e
35 #define SVCCTL_OPEN_SCMANAGER_W                 0x0f
36 #define SVCCTL_OPEN_SERVICE_W                   0x10
37 #define SVCCTL_QUERY_SERVICE_CONFIG_W           0x11
38 #define SVCCTL_START_SERVICE_W                  0x13
39 #define SVCCTL_GET_DISPLAY_NAME                 0x14
40 #define SVCCTL_QUERY_SERVICE_CONFIG2_W          0x27
41 #define SVCCTL_QUERY_SERVICE_STATUSEX_W         0x28
42
43 /* ANSI versions not implemented currently 
44 #define SVCCTL_ENUM_SERVICES_STATUS_A           0x0e
45 #define SVCCTL_OPEN_SCMANAGER_A                 0x1b
46 */
47
48 /* SERVER_STATUS - type */
49
50 #define SVCCTL_TYPE_WIN32               0x00000030
51 #define SVCCTL_TYPE_DRIVER              0x0000000f
52
53 /* Service Config - values for ServiceType field*/
54
55 #define SVCCTL_KERNEL_DRVR                         0x00000001  /* doubtful we'll have these */
56 #define SVCCTL_FILE_SYSTEM_DRVR                    0x00000002  
57 #define SVCCTL_WIN32_OWN_PROC                      0x00000010
58 #define SVCCTL_WIN32_SHARED_PROC                   0x00000020
59 #define SVCCTL_WIN32_INTERACTIVE                   0x00000100 
60
61 /* utility structures for RPCs */
62
63 /*
64  * "struct SERVICE_STATUS" comes from librpc/gen_ndr/svcctl.h
65  */
66
67 typedef struct SERVICE_STATUS SERVICE_STATUS;
68
69 typedef struct {
70         UNISTR servicename;
71         UNISTR displayname;
72         SERVICE_STATUS status;
73 } ENUM_SERVICES_STATUS;
74
75 /* rpc structures */
76
77 /**************************/
78
79 typedef struct {
80         POLICY_HND handle;
81         uint32 type;
82         uint32 state;
83         uint32 buffer_size;
84         uint32 *resume;
85 } SVCCTL_Q_ENUM_SERVICES_STATUS;
86
87 typedef struct {
88         RPC_BUFFER buffer;
89         uint32 needed;
90         uint32 returned;
91         uint32 *resume;
92         WERROR status;
93 } SVCCTL_R_ENUM_SERVICES_STATUS;
94
95 #endif /* _RPC_SVCCTL_H */
96