rpcclient "Service Control Manager" svcenum [-i] command.
[samba.git] / source / include / rpc_svcctl.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_SVCCTL_H /* _RPC_SVCCTL_H */
25 #define _RPC_SVCCTL_H 
26
27
28 /* svcctl pipe */
29 #define SVC_OPEN_SC_MAN      0x0f
30 #define SVC_ENUM_SVCS_STATUS 0x0e
31 #define SVC_QUERY_SVC_CONFIG 0x11
32 #define SVC_OPEN_SERVICE     0x10
33 #define SVC_CLOSE            0x00
34
35
36 /* SVC_Q_OPEN_SC_MAN */
37 typedef struct q_svc_open_sc_man_info
38 {
39         uint32 ptr_srv_name;         /* pointer (to server name?) */
40         UNISTR2 uni_srv_name;        /* unicode server name starting with '\\' */
41
42         uint32 ptr_db_name;         /* pointer (to database name?) */
43         UNISTR2 uni_db_name;        /* unicode database name */
44
45         uint32 des_access;            /* 0x80000004 - SC_MANAGER_xxxx */
46
47 } SVC_Q_OPEN_SC_MAN;
48
49 /* SVC_R_OPEN_SC_MAN */
50 typedef struct r_svc_open_sc_man_info
51 {
52         POLICY_HND pol;
53         uint32 status;             /* return status */
54
55 } SVC_R_OPEN_SC_MAN;
56
57 /* SVC_Q_OPEN_SERVICE */
58 typedef struct q_svc_open_service_info
59 {
60         POLICY_HND scman_pol;
61         UNISTR2 uni_svc_name;        /* unicode service name */
62         uint32 des_access;            /* 0x8000 0001 */
63
64 } SVC_Q_OPEN_SERVICE;
65
66 /* SVC_R_OPEN_SERVICE */
67 typedef struct r_svc_open_service_info
68 {
69         POLICY_HND pol;
70         uint32 status;             /* return status */
71
72 } SVC_R_OPEN_SERVICE;
73
74
75 /* QUERY_SERVICE_CONFIG */
76 typedef struct query_service_config_info
77 {
78         uint32 service_type;
79         uint32 start_type;
80         uint32 error_control;
81         uint32 ptr_bin_path_name; 
82         uint32 ptr_load_order_grp; 
83         uint32 tag_id;
84         uint32 ptr_dependencies;
85         uint32 ptr_service_start_name;
86         uint32 ptr_display_name;
87
88         UNISTR2 uni_bin_path_name;
89         UNISTR2 uni_load_order_grp;
90         UNISTR2 uni_dependencies;
91         UNISTR2 uni_service_start_name;
92         UNISTR2 uni_display_name;
93
94 } QUERY_SERVICE_CONFIG;
95
96 /* SVC_STATUS */
97 typedef struct svc_status_info
98 {
99         uint32 svc_type;
100         uint32 current_state;
101         uint32 controls_accepted;
102         uint32 win32_exit_code;
103         uint32 svc_specific_exit_code;
104         uint32 check_point;
105         uint32 wait_hint;
106
107 } SVC_STATUS;
108
109 /* ENUM_SRVC_STATUS */
110 typedef struct enum_svc_status_info
111 {
112         UNISTR uni_srvc_name;
113         UNISTR uni_disp_name;
114         SVC_STATUS status;
115
116 } ENUM_SRVC_STATUS;
117
118 /* SVC_Q_ENUM_SVCS_STATUS */
119 typedef struct q_svc_enum_svcs_status_info
120 {
121         POLICY_HND pol;
122         uint32 service_type; /* 0x00000030 - win32 | 0x0000000b - driver */
123         uint32 service_state; /* 0x00000003 - state_all */
124         uint32 buf_size; /* max service buffer size */
125         ENUM_HND resume_hnd; /* resume handle */
126
127 } SVC_Q_ENUM_SVCS_STATUS;
128
129 /* SVC_R_ENUM_SVCS_STATUS */
130 typedef struct r_svc_enum_svcs_status_info
131 {
132         uint32 buf_size; /* service buffer size */
133         ENUM_SRVC_STATUS *svcs;
134         uint32 more_buf_size;
135         uint32 num_svcs;
136         ENUM_HND resume_hnd; /* resume handle */
137         uint32 dos_status; /* return status, DOS error code (wow!) */
138
139 } SVC_R_ENUM_SVCS_STATUS;
140
141
142 /* SVC_Q_QUERY_SVC_CONFIG */
143 typedef struct q_svc_query_svc_cfg_info
144 {
145         POLICY_HND pol;
146         uint32 buf_size;
147
148 } SVC_Q_QUERY_SVC_CONFIG;
149
150
151 /* SVC_R_QUERY_SVC_CONFIG */
152 typedef struct r_svc_query_svc_cfg_info
153 {
154         QUERY_SERVICE_CONFIG *cfg;
155         uint32 buf_size;
156         uint32 status;             /* return status */
157
158 } SVC_R_QUERY_SVC_CONFIG;
159
160
161 /* SVC_Q_CLOSE */
162 typedef struct q_svc_close_info
163 {
164         POLICY_HND pol;
165
166 } SVC_Q_CLOSE;
167
168
169
170 /* SVC_R_CLOSE */
171 typedef struct r_svc_close_info
172 {
173         POLICY_HND pol;
174         uint32 status;             /* return status */
175
176 } SVC_R_CLOSE;
177
178
179 #endif /* _RPC_SVCCTL_H */
180