svcctl: use offered/needed for buffer sizes as in spoolss.
[ira/wip.git] / librpc / gen_ndr / ndr_svcctl.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_svcctl.h"
5
6 #include "librpc/gen_ndr/ndr_misc.h"
7 #include "librpc/gen_ndr/ndr_security.h"
8 static enum ndr_err_code ndr_push_SERVICE_LOCK_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_LOCK_STATUS *r)
9 {
10         if (ndr_flags & NDR_SCALARS) {
11                 NDR_CHECK(ndr_push_align(ndr, 4));
12                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_locked));
13                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->lock_owner));
14                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lock_duration));
15         }
16         if (ndr_flags & NDR_BUFFERS) {
17                 if (r->lock_owner) {
18                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16)));
19                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
20                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->lock_owner, CH_UTF16)));
21                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->lock_owner, ndr_charset_length(r->lock_owner, CH_UTF16), sizeof(uint16_t), CH_UTF16));
22                 }
23         }
24         return NDR_ERR_SUCCESS;
25 }
26
27 static enum ndr_err_code ndr_pull_SERVICE_LOCK_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_LOCK_STATUS *r)
28 {
29         uint32_t _ptr_lock_owner;
30         TALLOC_CTX *_mem_save_lock_owner_0;
31         if (ndr_flags & NDR_SCALARS) {
32                 NDR_CHECK(ndr_pull_align(ndr, 4));
33                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_locked));
34                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_lock_owner));
35                 if (_ptr_lock_owner) {
36                         NDR_PULL_ALLOC(ndr, r->lock_owner);
37                 } else {
38                         r->lock_owner = NULL;
39                 }
40                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lock_duration));
41         }
42         if (ndr_flags & NDR_BUFFERS) {
43                 if (r->lock_owner) {
44                         _mem_save_lock_owner_0 = NDR_PULL_GET_MEM_CTX(ndr);
45                         NDR_PULL_SET_MEM_CTX(ndr, r->lock_owner, 0);
46                         NDR_CHECK(ndr_pull_array_size(ndr, &r->lock_owner));
47                         NDR_CHECK(ndr_pull_array_length(ndr, &r->lock_owner));
48                         if (ndr_get_array_length(ndr, &r->lock_owner) > ndr_get_array_size(ndr, &r->lock_owner)) {
49                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->lock_owner), ndr_get_array_length(ndr, &r->lock_owner));
50                         }
51                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t)));
52                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->lock_owner, ndr_get_array_length(ndr, &r->lock_owner), sizeof(uint16_t), CH_UTF16));
53                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_owner_0, 0);
54                 }
55         }
56         return NDR_ERR_SUCCESS;
57 }
58
59 _PUBLIC_ void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r)
60 {
61         ndr_print_struct(ndr, name, "SERVICE_LOCK_STATUS");
62         ndr->depth++;
63         ndr_print_uint32(ndr, "is_locked", r->is_locked);
64         ndr_print_ptr(ndr, "lock_owner", r->lock_owner);
65         ndr->depth++;
66         if (r->lock_owner) {
67                 ndr_print_string(ndr, "lock_owner", r->lock_owner);
68         }
69         ndr->depth--;
70         ndr_print_uint32(ndr, "lock_duration", r->lock_duration);
71         ndr->depth--;
72 }
73
74 static enum ndr_err_code ndr_push_svcctl_ServiceStatus(struct ndr_push *ndr, int ndr_flags, enum svcctl_ServiceStatus r)
75 {
76         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
77         return NDR_ERR_SUCCESS;
78 }
79
80 static enum ndr_err_code ndr_pull_svcctl_ServiceStatus(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ServiceStatus *r)
81 {
82         uint32_t v;
83         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
84         *r = v;
85         return NDR_ERR_SUCCESS;
86 }
87
88 _PUBLIC_ void ndr_print_svcctl_ServiceStatus(struct ndr_print *ndr, const char *name, enum svcctl_ServiceStatus r)
89 {
90         const char *val = NULL;
91
92         switch (r) {
93                 case SVCCTL_STATE_UNKNOWN: val = "SVCCTL_STATE_UNKNOWN"; break;
94                 case SVCCTL_STOPPED: val = "SVCCTL_STOPPED"; break;
95                 case SVCCTL_START_PENDING: val = "SVCCTL_START_PENDING"; break;
96                 case SVCCTL_STOP_PENDING: val = "SVCCTL_STOP_PENDING"; break;
97                 case SVCCTL_RUNNING: val = "SVCCTL_RUNNING"; break;
98                 case SVCCTL_CONTINUE_PENDING: val = "SVCCTL_CONTINUE_PENDING"; break;
99                 case SVCCTL_PAUSE_PENDING: val = "SVCCTL_PAUSE_PENDING"; break;
100                 case SVCCTL_PAUSED: val = "SVCCTL_PAUSED"; break;
101         }
102         ndr_print_enum(ndr, name, "ENUM", val, r);
103 }
104
105 static enum ndr_err_code ndr_push_svcctl_ControlsAccepted(struct ndr_push *ndr, int ndr_flags, uint32_t r)
106 {
107         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
108         return NDR_ERR_SUCCESS;
109 }
110
111 static enum ndr_err_code ndr_pull_svcctl_ControlsAccepted(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
112 {
113         uint32_t v;
114         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
115         *r = v;
116         return NDR_ERR_SUCCESS;
117 }
118
119 _PUBLIC_ void ndr_print_svcctl_ControlsAccepted(struct ndr_print *ndr, const char *name, uint32_t r)
120 {
121         ndr_print_uint32(ndr, name, r);
122         ndr->depth++;
123         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_STOP", SVCCTL_ACCEPT_STOP, r);
124         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_PAUSE_CONTINUE", SVCCTL_ACCEPT_PAUSE_CONTINUE, r);
125         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_SHUTDOWN", SVCCTL_ACCEPT_SHUTDOWN, r);
126         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_PARAMCHANGE", SVCCTL_ACCEPT_PARAMCHANGE, r);
127         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_NETBINDCHANGE", SVCCTL_ACCEPT_NETBINDCHANGE, r);
128         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_HARDWAREPROFILECHANGE", SVCCTL_ACCEPT_HARDWAREPROFILECHANGE, r);
129         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SVCCTL_ACCEPT_POWEREVENT", SVCCTL_ACCEPT_POWEREVENT, r);
130         ndr->depth--;
131 }
132
133 static enum ndr_err_code ndr_push_SERVICE_STATUS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS *r)
134 {
135         if (ndr_flags & NDR_SCALARS) {
136                 NDR_CHECK(ndr_push_align(ndr, 4));
137                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->type));
138                 NDR_CHECK(ndr_push_svcctl_ServiceStatus(ndr, NDR_SCALARS, r->state));
139                 NDR_CHECK(ndr_push_svcctl_ControlsAccepted(ndr, NDR_SCALARS, r->controls_accepted));
140                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->win32_exit_code));
141                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_exit_code));
142                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->check_point));
143                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->wait_hint));
144         }
145         if (ndr_flags & NDR_BUFFERS) {
146         }
147         return NDR_ERR_SUCCESS;
148 }
149
150 static enum ndr_err_code ndr_pull_SERVICE_STATUS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS *r)
151 {
152         if (ndr_flags & NDR_SCALARS) {
153                 NDR_CHECK(ndr_pull_align(ndr, 4));
154                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->type));
155                 NDR_CHECK(ndr_pull_svcctl_ServiceStatus(ndr, NDR_SCALARS, &r->state));
156                 NDR_CHECK(ndr_pull_svcctl_ControlsAccepted(ndr, NDR_SCALARS, &r->controls_accepted));
157                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->win32_exit_code));
158                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_exit_code));
159                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->check_point));
160                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->wait_hint));
161         }
162         if (ndr_flags & NDR_BUFFERS) {
163         }
164         return NDR_ERR_SUCCESS;
165 }
166
167 _PUBLIC_ void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r)
168 {
169         ndr_print_struct(ndr, name, "SERVICE_STATUS");
170         ndr->depth++;
171         ndr_print_uint32(ndr, "type", r->type);
172         ndr_print_svcctl_ServiceStatus(ndr, "state", r->state);
173         ndr_print_svcctl_ControlsAccepted(ndr, "controls_accepted", r->controls_accepted);
174         ndr_print_WERROR(ndr, "win32_exit_code", r->win32_exit_code);
175         ndr_print_uint32(ndr, "service_exit_code", r->service_exit_code);
176         ndr_print_uint32(ndr, "check_point", r->check_point);
177         ndr_print_uint32(ndr, "wait_hint", r->wait_hint);
178         ndr->depth--;
179 }
180
181 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_STATUS_PROCESS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_STATUS_PROCESS *r)
182 {
183         if (ndr_flags & NDR_SCALARS) {
184                 NDR_CHECK(ndr_push_align(ndr, 4));
185                 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
186                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->process_id));
187                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_flags));
188         }
189         if (ndr_flags & NDR_BUFFERS) {
190         }
191         return NDR_ERR_SUCCESS;
192 }
193
194 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_STATUS_PROCESS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_STATUS_PROCESS *r)
195 {
196         if (ndr_flags & NDR_SCALARS) {
197                 NDR_CHECK(ndr_pull_align(ndr, 4));
198                 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
199                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->process_id));
200                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_flags));
201         }
202         if (ndr_flags & NDR_BUFFERS) {
203         }
204         return NDR_ERR_SUCCESS;
205 }
206
207 _PUBLIC_ void ndr_print_SERVICE_STATUS_PROCESS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS_PROCESS *r)
208 {
209         ndr_print_struct(ndr, name, "SERVICE_STATUS_PROCESS");
210         ndr->depth++;
211         ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
212         ndr_print_uint32(ndr, "process_id", r->process_id);
213         ndr_print_uint32(ndr, "service_flags", r->service_flags);
214         ndr->depth--;
215 }
216
217 _PUBLIC_ enum ndr_err_code ndr_push_ENUM_SERVICE_STATUSW(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUSW *r)
218 {
219         if (ndr_flags & NDR_SCALARS) {
220                 NDR_CHECK(ndr_push_align(ndr, 4));
221                 {
222                         uint32_t _flags_save_string = ndr->flags;
223                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
224                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name));
225                         ndr->flags = _flags_save_string;
226                 }
227                 {
228                         uint32_t _flags_save_string = ndr->flags;
229                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
230                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name));
231                         ndr->flags = _flags_save_string;
232                 }
233                 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
234         }
235         if (ndr_flags & NDR_BUFFERS) {
236                 {
237                         uint32_t _flags_save_string = ndr->flags;
238                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
239                         if (r->service_name) {
240                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name));
241                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name));
242                         }
243                         ndr->flags = _flags_save_string;
244                 }
245                 {
246                         uint32_t _flags_save_string = ndr->flags;
247                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
248                         if (r->display_name) {
249                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name));
250                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name));
251                         }
252                         ndr->flags = _flags_save_string;
253                 }
254         }
255         return NDR_ERR_SUCCESS;
256 }
257
258 _PUBLIC_ enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUSW(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUSW *r)
259 {
260         uint32_t _ptr_service_name;
261         TALLOC_CTX *_mem_save_service_name_0;
262         uint32_t _ptr_display_name;
263         TALLOC_CTX *_mem_save_display_name_0;
264         if (ndr_flags & NDR_SCALARS) {
265                 NDR_CHECK(ndr_pull_align(ndr, 4));
266                 {
267                         uint32_t _flags_save_string = ndr->flags;
268                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
269                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
270                         if (_ptr_service_name) {
271                                 NDR_PULL_ALLOC(ndr, r->service_name);
272                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name));
273                         } else {
274                                 r->service_name = NULL;
275                         }
276                         ndr->flags = _flags_save_string;
277                 }
278                 {
279                         uint32_t _flags_save_string = ndr->flags;
280                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
281                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
282                         if (_ptr_display_name) {
283                                 NDR_PULL_ALLOC(ndr, r->display_name);
284                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name));
285                         } else {
286                                 r->display_name = NULL;
287                         }
288                         ndr->flags = _flags_save_string;
289                 }
290                 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
291         }
292         if (ndr_flags & NDR_BUFFERS) {
293                 {
294                         uint32_t _flags_save_string = ndr->flags;
295                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
296                         if (r->service_name) {
297                                 uint32_t _relative_save_offset;
298                                 _relative_save_offset = ndr->offset;
299                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name));
300                                 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
301                                 NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0);
302                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name));
303                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
304                                 ndr->offset = _relative_save_offset;
305                         }
306                         ndr->flags = _flags_save_string;
307                 }
308                 {
309                         uint32_t _flags_save_string = ndr->flags;
310                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
311                         if (r->display_name) {
312                                 uint32_t _relative_save_offset;
313                                 _relative_save_offset = ndr->offset;
314                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name));
315                                 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
316                                 NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
317                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name));
318                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
319                                 ndr->offset = _relative_save_offset;
320                         }
321                         ndr->flags = _flags_save_string;
322                 }
323         }
324         return NDR_ERR_SUCCESS;
325 }
326
327 _PUBLIC_ void ndr_print_ENUM_SERVICE_STATUSW(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUSW *r)
328 {
329         ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUSW");
330         ndr->depth++;
331         ndr_print_ptr(ndr, "service_name", r->service_name);
332         ndr->depth++;
333         if (r->service_name) {
334                 ndr_print_string(ndr, "service_name", r->service_name);
335         }
336         ndr->depth--;
337         ndr_print_ptr(ndr, "display_name", r->display_name);
338         ndr->depth++;
339         if (r->display_name) {
340                 ndr_print_string(ndr, "display_name", r->display_name);
341         }
342         ndr->depth--;
343         ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
344         ndr->depth--;
345 }
346
347 _PUBLIC_ size_t ndr_size_ENUM_SERVICE_STATUSW(const struct ENUM_SERVICE_STATUSW *r, struct smb_iconv_convenience *ic, int flags)
348 {
349         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSW, ic);
350 }
351
352 _PUBLIC_ enum ndr_err_code ndr_push_ENUM_SERVICE_STATUSA(struct ndr_push *ndr, int ndr_flags, const struct ENUM_SERVICE_STATUSA *r)
353 {
354         if (ndr_flags & NDR_SCALARS) {
355                 NDR_CHECK(ndr_push_align(ndr, 4));
356                 {
357                         uint32_t _flags_save_string = ndr->flags;
358                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
359                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->service_name));
360                         ndr->flags = _flags_save_string;
361                 }
362                 {
363                         uint32_t _flags_save_string = ndr->flags;
364                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
365                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name));
366                         ndr->flags = _flags_save_string;
367                 }
368                 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
369         }
370         if (ndr_flags & NDR_BUFFERS) {
371                 {
372                         uint32_t _flags_save_string = ndr->flags;
373                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
374                         if (r->service_name) {
375                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->service_name));
376                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->service_name));
377                         }
378                         ndr->flags = _flags_save_string;
379                 }
380                 {
381                         uint32_t _flags_save_string = ndr->flags;
382                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
383                         if (r->display_name) {
384                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name));
385                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name));
386                         }
387                         ndr->flags = _flags_save_string;
388                 }
389         }
390         return NDR_ERR_SUCCESS;
391 }
392
393 _PUBLIC_ enum ndr_err_code ndr_pull_ENUM_SERVICE_STATUSA(struct ndr_pull *ndr, int ndr_flags, struct ENUM_SERVICE_STATUSA *r)
394 {
395         uint32_t _ptr_service_name;
396         TALLOC_CTX *_mem_save_service_name_0;
397         uint32_t _ptr_display_name;
398         TALLOC_CTX *_mem_save_display_name_0;
399         if (ndr_flags & NDR_SCALARS) {
400                 NDR_CHECK(ndr_pull_align(ndr, 4));
401                 {
402                         uint32_t _flags_save_string = ndr->flags;
403                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
404                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_name));
405                         if (_ptr_service_name) {
406                                 NDR_PULL_ALLOC(ndr, r->service_name);
407                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->service_name, _ptr_service_name));
408                         } else {
409                                 r->service_name = NULL;
410                         }
411                         ndr->flags = _flags_save_string;
412                 }
413                 {
414                         uint32_t _flags_save_string = ndr->flags;
415                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
416                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
417                         if (_ptr_display_name) {
418                                 NDR_PULL_ALLOC(ndr, r->display_name);
419                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name));
420                         } else {
421                                 r->display_name = NULL;
422                         }
423                         ndr->flags = _flags_save_string;
424                 }
425                 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, &r->status));
426         }
427         if (ndr_flags & NDR_BUFFERS) {
428                 {
429                         uint32_t _flags_save_string = ndr->flags;
430                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
431                         if (r->service_name) {
432                                 uint32_t _relative_save_offset;
433                                 _relative_save_offset = ndr->offset;
434                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->service_name));
435                                 _mem_save_service_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
436                                 NDR_PULL_SET_MEM_CTX(ndr, r->service_name, 0);
437                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->service_name));
438                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_name_0, 0);
439                                 ndr->offset = _relative_save_offset;
440                         }
441                         ndr->flags = _flags_save_string;
442                 }
443                 {
444                         uint32_t _flags_save_string = ndr->flags;
445                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
446                         if (r->display_name) {
447                                 uint32_t _relative_save_offset;
448                                 _relative_save_offset = ndr->offset;
449                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name));
450                                 _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
451                                 NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
452                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name));
453                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
454                                 ndr->offset = _relative_save_offset;
455                         }
456                         ndr->flags = _flags_save_string;
457                 }
458         }
459         return NDR_ERR_SUCCESS;
460 }
461
462 _PUBLIC_ void ndr_print_ENUM_SERVICE_STATUSA(struct ndr_print *ndr, const char *name, const struct ENUM_SERVICE_STATUSA *r)
463 {
464         ndr_print_struct(ndr, name, "ENUM_SERVICE_STATUSA");
465         ndr->depth++;
466         ndr_print_ptr(ndr, "service_name", r->service_name);
467         ndr->depth++;
468         if (r->service_name) {
469                 ndr_print_string(ndr, "service_name", r->service_name);
470         }
471         ndr->depth--;
472         ndr_print_ptr(ndr, "display_name", r->display_name);
473         ndr->depth++;
474         if (r->display_name) {
475                 ndr_print_string(ndr, "display_name", r->display_name);
476         }
477         ndr->depth--;
478         ndr_print_SERVICE_STATUS(ndr, "status", &r->status);
479         ndr->depth--;
480 }
481
482 _PUBLIC_ size_t ndr_size_ENUM_SERVICE_STATUSA(const struct ENUM_SERVICE_STATUSA *r, struct smb_iconv_convenience *ic, int flags)
483 {
484         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_ENUM_SERVICE_STATUSA, ic);
485 }
486
487 _PUBLIC_ enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r)
488 {
489         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
490         return NDR_ERR_SUCCESS;
491 }
492
493 _PUBLIC_ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
494 {
495         uint32_t v;
496         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
497         *r = v;
498         return NDR_ERR_SUCCESS;
499 }
500
501 _PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r)
502 {
503         ndr_print_uint32(ndr, name, r);
504         ndr->depth++;
505         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WORKSTATION", SV_TYPE_WORKSTATION, r);
506         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER", SV_TYPE_SERVER, r);
507         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SQLSERVER", SV_TYPE_SQLSERVER, r);
508         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_CTRL", SV_TYPE_DOMAIN_CTRL, r);
509         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_BAKCTRL", SV_TYPE_DOMAIN_BAKCTRL, r);
510         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_TIME_SOURCE", SV_TYPE_TIME_SOURCE, r);
511         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_AFP", SV_TYPE_AFP, r);
512         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NOVELL", SV_TYPE_NOVELL, r);
513         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MEMBER", SV_TYPE_DOMAIN_MEMBER, r);
514         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_PRINTQ_SERVER", SV_TYPE_PRINTQ_SERVER, r);
515         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DIALIN_SERVER", SV_TYPE_DIALIN_SERVER, r);
516         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_UNIX", SV_TYPE_SERVER_UNIX, r);
517         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_NT", SV_TYPE_NT, r);
518         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WFW", SV_TYPE_WFW, r);
519         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_MFPN", SV_TYPE_SERVER_MFPN, r);
520         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_NT", SV_TYPE_SERVER_NT, r);
521         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_POTENTIAL_BROWSER", SV_TYPE_POTENTIAL_BROWSER, r);
522         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_BACKUP_BROWSER", SV_TYPE_BACKUP_BROWSER, r);
523         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_MASTER_BROWSER", SV_TYPE_MASTER_BROWSER, r);
524         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_MASTER", SV_TYPE_DOMAIN_MASTER, r);
525         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_OSF", SV_TYPE_SERVER_OSF, r);
526         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_SERVER_VMS", SV_TYPE_SERVER_VMS, r);
527         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_WIN95_PLUS", SV_TYPE_WIN95_PLUS, r);
528         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DFS_SERVER", SV_TYPE_DFS_SERVER, r);
529         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_ALTERNATE_XPORT", SV_TYPE_ALTERNATE_XPORT, r);
530         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_LOCAL_LIST_ONLY", SV_TYPE_LOCAL_LIST_ONLY, r);
531         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SV_TYPE_DOMAIN_ENUM", SV_TYPE_DOMAIN_ENUM, r);
532         ndr->depth--;
533 }
534
535 static enum ndr_err_code ndr_push_SERVICE_CONTROL(struct ndr_push *ndr, int ndr_flags, enum SERVICE_CONTROL r)
536 {
537         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
538         return NDR_ERR_SUCCESS;
539 }
540
541 static enum ndr_err_code ndr_pull_SERVICE_CONTROL(struct ndr_pull *ndr, int ndr_flags, enum SERVICE_CONTROL *r)
542 {
543         uint32_t v;
544         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
545         *r = v;
546         return NDR_ERR_SUCCESS;
547 }
548
549 _PUBLIC_ void ndr_print_SERVICE_CONTROL(struct ndr_print *ndr, const char *name, enum SERVICE_CONTROL r)
550 {
551         const char *val = NULL;
552
553         switch (r) {
554                 case SVCCTL_CONTROL_STOP: val = "SVCCTL_CONTROL_STOP"; break;
555                 case SVCCTL_CONTROL_PAUSE: val = "SVCCTL_CONTROL_PAUSE"; break;
556                 case SVCCTL_CONTROL_CONTINUE: val = "SVCCTL_CONTROL_CONTINUE"; break;
557                 case SVCCTL_CONTROL_INTERROGATE: val = "SVCCTL_CONTROL_INTERROGATE"; break;
558                 case SVCCTL_CONTROL_SHUTDOWN: val = "SVCCTL_CONTROL_SHUTDOWN"; break;
559         }
560         ndr_print_enum(ndr, name, "ENUM", val, r);
561 }
562
563 static enum ndr_err_code ndr_push_svcctl_ErrorControl(struct ndr_push *ndr, int ndr_flags, enum svcctl_ErrorControl r)
564 {
565         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
566         return NDR_ERR_SUCCESS;
567 }
568
569 static enum ndr_err_code ndr_pull_svcctl_ErrorControl(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ErrorControl *r)
570 {
571         uint32_t v;
572         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
573         *r = v;
574         return NDR_ERR_SUCCESS;
575 }
576
577 _PUBLIC_ void ndr_print_svcctl_ErrorControl(struct ndr_print *ndr, const char *name, enum svcctl_ErrorControl r)
578 {
579         const char *val = NULL;
580
581         switch (r) {
582                 case SVCCTL_SVC_ERROR_IGNORE: val = "SVCCTL_SVC_ERROR_IGNORE"; break;
583                 case SVCCTL_SVC_ERROR_NORMAL: val = "SVCCTL_SVC_ERROR_NORMAL"; break;
584                 case SVCCTL_SVC_ERROR_CRITICAL: val = "SVCCTL_SVC_ERROR_CRITICAL"; break;
585                 case SVCCTL_SVC_ERROR_SEVERE: val = "SVCCTL_SVC_ERROR_SEVERE"; break;
586         }
587         ndr_print_enum(ndr, name, "ENUM", val, r);
588 }
589
590 static enum ndr_err_code ndr_push_svcctl_StartType(struct ndr_push *ndr, int ndr_flags, enum svcctl_StartType r)
591 {
592         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
593         return NDR_ERR_SUCCESS;
594 }
595
596 static enum ndr_err_code ndr_pull_svcctl_StartType(struct ndr_pull *ndr, int ndr_flags, enum svcctl_StartType *r)
597 {
598         uint32_t v;
599         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
600         *r = v;
601         return NDR_ERR_SUCCESS;
602 }
603
604 _PUBLIC_ void ndr_print_svcctl_StartType(struct ndr_print *ndr, const char *name, enum svcctl_StartType r)
605 {
606         const char *val = NULL;
607
608         switch (r) {
609                 case SVCCTL_BOOT_START: val = "SVCCTL_BOOT_START"; break;
610                 case SVCCTL_SYSTEM_START: val = "SVCCTL_SYSTEM_START"; break;
611                 case SVCCTL_AUTO_START: val = "SVCCTL_AUTO_START"; break;
612                 case SVCCTL_DEMAND_START: val = "SVCCTL_DEMAND_START"; break;
613                 case SVCCTL_DISABLED: val = "SVCCTL_DISABLED"; break;
614         }
615         ndr_print_enum(ndr, name, "ENUM", val, r);
616 }
617
618 static enum ndr_err_code ndr_push_svcctl_ServiceState(struct ndr_push *ndr, int ndr_flags, enum svcctl_ServiceState r)
619 {
620         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
621         return NDR_ERR_SUCCESS;
622 }
623
624 static enum ndr_err_code ndr_pull_svcctl_ServiceState(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ServiceState *r)
625 {
626         uint32_t v;
627         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
628         *r = v;
629         return NDR_ERR_SUCCESS;
630 }
631
632 _PUBLIC_ void ndr_print_svcctl_ServiceState(struct ndr_print *ndr, const char *name, enum svcctl_ServiceState r)
633 {
634         const char *val = NULL;
635
636         switch (r) {
637                 case SERVICE_STATE_ACTIVE: val = "SERVICE_STATE_ACTIVE"; break;
638                 case SERVICE_STATE_INACTIVE: val = "SERVICE_STATE_INACTIVE"; break;
639                 case SERVICE_STATE_ALL: val = "SERVICE_STATE_ALL"; break;
640         }
641         ndr_print_enum(ndr, name, "ENUM", val, r);
642 }
643
644 static enum ndr_err_code ndr_push_svcctl_MgrAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
645 {
646         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
647         return NDR_ERR_SUCCESS;
648 }
649
650 static enum ndr_err_code ndr_pull_svcctl_MgrAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
651 {
652         uint32_t v;
653         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
654         *r = v;
655         return NDR_ERR_SUCCESS;
656 }
657
658 _PUBLIC_ void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
659 {
660         ndr_print_uint32(ndr, name, r);
661         ndr->depth++;
662         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CONNECT", SC_RIGHT_MGR_CONNECT, r);
663         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_CREATE_SERVICE", SC_RIGHT_MGR_CREATE_SERVICE, r);
664         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_ENUMERATE_SERVICE", SC_RIGHT_MGR_ENUMERATE_SERVICE, r);
665         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_LOCK", SC_RIGHT_MGR_LOCK, r);
666         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_QUERY_LOCK_STATUS", SC_RIGHT_MGR_QUERY_LOCK_STATUS, r);
667         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_MGR_MODIFY_BOOT_CONFIG", SC_RIGHT_MGR_MODIFY_BOOT_CONFIG, r);
668         ndr->depth--;
669 }
670
671 static enum ndr_err_code ndr_push_svcctl_ServiceAccessMask(struct ndr_push *ndr, int ndr_flags, uint32_t r)
672 {
673         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
674         return NDR_ERR_SUCCESS;
675 }
676
677 static enum ndr_err_code ndr_pull_svcctl_ServiceAccessMask(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
678 {
679         uint32_t v;
680         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
681         *r = v;
682         return NDR_ERR_SUCCESS;
683 }
684
685 _PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r)
686 {
687         ndr_print_uint32(ndr, name, r);
688         ndr->depth++;
689         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_CONFIG", SC_RIGHT_SVC_QUERY_CONFIG, r);
690         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_CHANGE_CONFIG", SC_RIGHT_SVC_CHANGE_CONFIG, r);
691         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_QUERY_STATUS", SC_RIGHT_SVC_QUERY_STATUS, r);
692         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_ENUMERATE_DEPENDENTS", SC_RIGHT_SVC_ENUMERATE_DEPENDENTS, r);
693         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_START", SC_RIGHT_SVC_START, r);
694         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_STOP", SC_RIGHT_SVC_STOP, r);
695         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_PAUSE_CONTINUE", SC_RIGHT_SVC_PAUSE_CONTINUE, r);
696         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_INTERROGATE", SC_RIGHT_SVC_INTERROGATE, r);
697         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SC_RIGHT_SVC_USER_DEFINED_CONTROL", SC_RIGHT_SVC_USER_DEFINED_CONTROL, r);
698         ndr->depth--;
699 }
700
701 _PUBLIC_ enum ndr_err_code ndr_push_QUERY_SERVICE_CONFIG(struct ndr_push *ndr, int ndr_flags, const struct QUERY_SERVICE_CONFIG *r)
702 {
703         if (ndr_flags & NDR_SCALARS) {
704                 NDR_CHECK(ndr_push_align(ndr, 4));
705                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->service_type));
706                 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->start_type));
707                 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->error_control));
708                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->executablepath));
709                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->loadordergroup));
710                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->tag_id));
711                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependencies));
712                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->startname));
713                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->displayname));
714         }
715         if (ndr_flags & NDR_BUFFERS) {
716                 if (r->executablepath) {
717                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
718                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
719                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->executablepath, CH_UTF16)));
720                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->executablepath, ndr_charset_length(r->executablepath, CH_UTF16), sizeof(uint16_t), CH_UTF16));
721                 }
722                 if (r->loadordergroup) {
723                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
724                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
725                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->loadordergroup, CH_UTF16)));
726                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->loadordergroup, ndr_charset_length(r->loadordergroup, CH_UTF16), sizeof(uint16_t), CH_UTF16));
727                 }
728                 if (r->dependencies) {
729                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
730                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
731                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dependencies, CH_UTF16)));
732                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dependencies, ndr_charset_length(r->dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
733                 }
734                 if (r->startname) {
735                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
736                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
737                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->startname, CH_UTF16)));
738                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->startname, ndr_charset_length(r->startname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
739                 }
740                 if (r->displayname) {
741                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
742                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
743                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->displayname, CH_UTF16)));
744                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->displayname, ndr_charset_length(r->displayname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
745                 }
746         }
747         return NDR_ERR_SUCCESS;
748 }
749
750 _PUBLIC_ enum ndr_err_code ndr_pull_QUERY_SERVICE_CONFIG(struct ndr_pull *ndr, int ndr_flags, struct QUERY_SERVICE_CONFIG *r)
751 {
752         uint32_t _ptr_executablepath;
753         TALLOC_CTX *_mem_save_executablepath_0;
754         uint32_t _ptr_loadordergroup;
755         TALLOC_CTX *_mem_save_loadordergroup_0;
756         uint32_t _ptr_dependencies;
757         TALLOC_CTX *_mem_save_dependencies_0;
758         uint32_t _ptr_startname;
759         TALLOC_CTX *_mem_save_startname_0;
760         uint32_t _ptr_displayname;
761         TALLOC_CTX *_mem_save_displayname_0;
762         if (ndr_flags & NDR_SCALARS) {
763                 NDR_CHECK(ndr_pull_align(ndr, 4));
764                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->service_type));
765                 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->start_type));
766                 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->error_control));
767                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_executablepath));
768                 if (_ptr_executablepath) {
769                         NDR_PULL_ALLOC(ndr, r->executablepath);
770                 } else {
771                         r->executablepath = NULL;
772                 }
773                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_loadordergroup));
774                 if (_ptr_loadordergroup) {
775                         NDR_PULL_ALLOC(ndr, r->loadordergroup);
776                 } else {
777                         r->loadordergroup = NULL;
778                 }
779                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->tag_id));
780                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
781                 if (_ptr_dependencies) {
782                         NDR_PULL_ALLOC(ndr, r->dependencies);
783                 } else {
784                         r->dependencies = NULL;
785                 }
786                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_startname));
787                 if (_ptr_startname) {
788                         NDR_PULL_ALLOC(ndr, r->startname);
789                 } else {
790                         r->startname = NULL;
791                 }
792                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_displayname));
793                 if (_ptr_displayname) {
794                         NDR_PULL_ALLOC(ndr, r->displayname);
795                 } else {
796                         r->displayname = NULL;
797                 }
798         }
799         if (ndr_flags & NDR_BUFFERS) {
800                 if (r->executablepath) {
801                         _mem_save_executablepath_0 = NDR_PULL_GET_MEM_CTX(ndr);
802                         NDR_PULL_SET_MEM_CTX(ndr, r->executablepath, 0);
803                         NDR_CHECK(ndr_pull_array_size(ndr, &r->executablepath));
804                         NDR_CHECK(ndr_pull_array_length(ndr, &r->executablepath));
805                         if (ndr_get_array_length(ndr, &r->executablepath) > ndr_get_array_size(ndr, &r->executablepath)) {
806                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->executablepath), ndr_get_array_length(ndr, &r->executablepath));
807                         }
808                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t)));
809                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->executablepath, ndr_get_array_length(ndr, &r->executablepath), sizeof(uint16_t), CH_UTF16));
810                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_executablepath_0, 0);
811                 }
812                 if (r->loadordergroup) {
813                         _mem_save_loadordergroup_0 = NDR_PULL_GET_MEM_CTX(ndr);
814                         NDR_PULL_SET_MEM_CTX(ndr, r->loadordergroup, 0);
815                         NDR_CHECK(ndr_pull_array_size(ndr, &r->loadordergroup));
816                         NDR_CHECK(ndr_pull_array_length(ndr, &r->loadordergroup));
817                         if (ndr_get_array_length(ndr, &r->loadordergroup) > ndr_get_array_size(ndr, &r->loadordergroup)) {
818                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->loadordergroup), ndr_get_array_length(ndr, &r->loadordergroup));
819                         }
820                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t)));
821                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->loadordergroup, ndr_get_array_length(ndr, &r->loadordergroup), sizeof(uint16_t), CH_UTF16));
822                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_loadordergroup_0, 0);
823                 }
824                 if (r->dependencies) {
825                         _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
826                         NDR_PULL_SET_MEM_CTX(ndr, r->dependencies, 0);
827                         NDR_CHECK(ndr_pull_array_size(ndr, &r->dependencies));
828                         NDR_CHECK(ndr_pull_array_length(ndr, &r->dependencies));
829                         if (ndr_get_array_length(ndr, &r->dependencies) > ndr_get_array_size(ndr, &r->dependencies)) {
830                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dependencies), ndr_get_array_length(ndr, &r->dependencies));
831                         }
832                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t)));
833                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dependencies, ndr_get_array_length(ndr, &r->dependencies), sizeof(uint16_t), CH_UTF16));
834                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
835                 }
836                 if (r->startname) {
837                         _mem_save_startname_0 = NDR_PULL_GET_MEM_CTX(ndr);
838                         NDR_PULL_SET_MEM_CTX(ndr, r->startname, 0);
839                         NDR_CHECK(ndr_pull_array_size(ndr, &r->startname));
840                         NDR_CHECK(ndr_pull_array_length(ndr, &r->startname));
841                         if (ndr_get_array_length(ndr, &r->startname) > ndr_get_array_size(ndr, &r->startname)) {
842                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->startname), ndr_get_array_length(ndr, &r->startname));
843                         }
844                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t)));
845                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->startname, ndr_get_array_length(ndr, &r->startname), sizeof(uint16_t), CH_UTF16));
846                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_startname_0, 0);
847                 }
848                 if (r->displayname) {
849                         _mem_save_displayname_0 = NDR_PULL_GET_MEM_CTX(ndr);
850                         NDR_PULL_SET_MEM_CTX(ndr, r->displayname, 0);
851                         NDR_CHECK(ndr_pull_array_size(ndr, &r->displayname));
852                         NDR_CHECK(ndr_pull_array_length(ndr, &r->displayname));
853                         if (ndr_get_array_length(ndr, &r->displayname) > ndr_get_array_size(ndr, &r->displayname)) {
854                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->displayname), ndr_get_array_length(ndr, &r->displayname));
855                         }
856                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t)));
857                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->displayname, ndr_get_array_length(ndr, &r->displayname), sizeof(uint16_t), CH_UTF16));
858                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_displayname_0, 0);
859                 }
860         }
861         return NDR_ERR_SUCCESS;
862 }
863
864 _PUBLIC_ void ndr_print_QUERY_SERVICE_CONFIG(struct ndr_print *ndr, const char *name, const struct QUERY_SERVICE_CONFIG *r)
865 {
866         ndr_print_struct(ndr, name, "QUERY_SERVICE_CONFIG");
867         ndr->depth++;
868         ndr_print_uint32(ndr, "service_type", r->service_type);
869         ndr_print_svcctl_StartType(ndr, "start_type", r->start_type);
870         ndr_print_svcctl_ErrorControl(ndr, "error_control", r->error_control);
871         ndr_print_ptr(ndr, "executablepath", r->executablepath);
872         ndr->depth++;
873         if (r->executablepath) {
874                 ndr_print_string(ndr, "executablepath", r->executablepath);
875         }
876         ndr->depth--;
877         ndr_print_ptr(ndr, "loadordergroup", r->loadordergroup);
878         ndr->depth++;
879         if (r->loadordergroup) {
880                 ndr_print_string(ndr, "loadordergroup", r->loadordergroup);
881         }
882         ndr->depth--;
883         ndr_print_uint32(ndr, "tag_id", r->tag_id);
884         ndr_print_ptr(ndr, "dependencies", r->dependencies);
885         ndr->depth++;
886         if (r->dependencies) {
887                 ndr_print_string(ndr, "dependencies", r->dependencies);
888         }
889         ndr->depth--;
890         ndr_print_ptr(ndr, "startname", r->startname);
891         ndr->depth++;
892         if (r->startname) {
893                 ndr_print_string(ndr, "startname", r->startname);
894         }
895         ndr->depth--;
896         ndr_print_ptr(ndr, "displayname", r->displayname);
897         ndr->depth++;
898         if (r->displayname) {
899                 ndr_print_string(ndr, "displayname", r->displayname);
900         }
901         ndr->depth--;
902         ndr->depth--;
903 }
904
905 _PUBLIC_ size_t ndr_size_QUERY_SERVICE_CONFIG(const struct QUERY_SERVICE_CONFIG *r, struct smb_iconv_convenience *ic, int flags)
906 {
907         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_QUERY_SERVICE_CONFIG, ic);
908 }
909
910 static enum ndr_err_code ndr_push_svcctl_ConfigLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_ConfigLevel r)
911 {
912         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
913         return NDR_ERR_SUCCESS;
914 }
915
916 static enum ndr_err_code ndr_pull_svcctl_ConfigLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_ConfigLevel *r)
917 {
918         uint32_t v;
919         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
920         *r = v;
921         return NDR_ERR_SUCCESS;
922 }
923
924 _PUBLIC_ void ndr_print_svcctl_ConfigLevel(struct ndr_print *ndr, const char *name, enum svcctl_ConfigLevel r)
925 {
926         const char *val = NULL;
927
928         switch (r) {
929                 case SERVICE_CONFIG_DESCRIPTION: val = "SERVICE_CONFIG_DESCRIPTION"; break;
930                 case SERVICE_CONFIG_FAILURE_ACTIONS: val = "SERVICE_CONFIG_FAILURE_ACTIONS"; break;
931         }
932         ndr_print_enum(ndr, name, "ENUM", val, r);
933 }
934
935 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_DESCRIPTION(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_DESCRIPTION *r)
936 {
937         if (ndr_flags & NDR_SCALARS) {
938                 NDR_CHECK(ndr_push_align(ndr, 4));
939                 {
940                         uint32_t _flags_save_string = ndr->flags;
941                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
942                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->description));
943                         ndr->flags = _flags_save_string;
944                 }
945         }
946         if (ndr_flags & NDR_BUFFERS) {
947                 {
948                         uint32_t _flags_save_string = ndr->flags;
949                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
950                         if (r->description) {
951                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->description));
952                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->description));
953                         }
954                         ndr->flags = _flags_save_string;
955                 }
956         }
957         return NDR_ERR_SUCCESS;
958 }
959
960 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_DESCRIPTION(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_DESCRIPTION *r)
961 {
962         uint32_t _ptr_description;
963         TALLOC_CTX *_mem_save_description_0;
964         if (ndr_flags & NDR_SCALARS) {
965                 NDR_CHECK(ndr_pull_align(ndr, 4));
966                 {
967                         uint32_t _flags_save_string = ndr->flags;
968                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
969                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_description));
970                         if (_ptr_description) {
971                                 NDR_PULL_ALLOC(ndr, r->description);
972                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->description, _ptr_description));
973                         } else {
974                                 r->description = NULL;
975                         }
976                         ndr->flags = _flags_save_string;
977                 }
978         }
979         if (ndr_flags & NDR_BUFFERS) {
980                 {
981                         uint32_t _flags_save_string = ndr->flags;
982                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
983                         if (r->description) {
984                                 uint32_t _relative_save_offset;
985                                 _relative_save_offset = ndr->offset;
986                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->description));
987                                 _mem_save_description_0 = NDR_PULL_GET_MEM_CTX(ndr);
988                                 NDR_PULL_SET_MEM_CTX(ndr, r->description, 0);
989                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->description));
990                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_description_0, 0);
991                                 ndr->offset = _relative_save_offset;
992                         }
993                         ndr->flags = _flags_save_string;
994                 }
995         }
996         return NDR_ERR_SUCCESS;
997 }
998
999 _PUBLIC_ void ndr_print_SERVICE_DESCRIPTION(struct ndr_print *ndr, const char *name, const struct SERVICE_DESCRIPTION *r)
1000 {
1001         ndr_print_struct(ndr, name, "SERVICE_DESCRIPTION");
1002         ndr->depth++;
1003         ndr_print_ptr(ndr, "description", r->description);
1004         ndr->depth++;
1005         if (r->description) {
1006                 ndr_print_string(ndr, "description", r->description);
1007         }
1008         ndr->depth--;
1009         ndr->depth--;
1010 }
1011
1012 _PUBLIC_ size_t ndr_size_SERVICE_DESCRIPTION(const struct SERVICE_DESCRIPTION *r, struct smb_iconv_convenience *ic, int flags)
1013 {
1014         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_SERVICE_DESCRIPTION, ic);
1015 }
1016
1017 static enum ndr_err_code ndr_push_SC_ACTION_TYPE(struct ndr_push *ndr, int ndr_flags, enum SC_ACTION_TYPE r)
1018 {
1019         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1020         return NDR_ERR_SUCCESS;
1021 }
1022
1023 static enum ndr_err_code ndr_pull_SC_ACTION_TYPE(struct ndr_pull *ndr, int ndr_flags, enum SC_ACTION_TYPE *r)
1024 {
1025         uint32_t v;
1026         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1027         *r = v;
1028         return NDR_ERR_SUCCESS;
1029 }
1030
1031 _PUBLIC_ void ndr_print_SC_ACTION_TYPE(struct ndr_print *ndr, const char *name, enum SC_ACTION_TYPE r)
1032 {
1033         const char *val = NULL;
1034
1035         switch (r) {
1036                 case SC_ACTION_NONE: val = "SC_ACTION_NONE"; break;
1037                 case SC_ACTION_RESTART: val = "SC_ACTION_RESTART"; break;
1038                 case SC_ACTION_REBOOT: val = "SC_ACTION_REBOOT"; break;
1039                 case SC_ACTION_RUN_COMMAND: val = "SC_ACTION_RUN_COMMAND"; break;
1040         }
1041         ndr_print_enum(ndr, name, "ENUM", val, r);
1042 }
1043
1044 static enum ndr_err_code ndr_push_SC_ACTION(struct ndr_push *ndr, int ndr_flags, const struct SC_ACTION *r)
1045 {
1046         if (ndr_flags & NDR_SCALARS) {
1047                 NDR_CHECK(ndr_push_align(ndr, 4));
1048                 NDR_CHECK(ndr_push_SC_ACTION_TYPE(ndr, NDR_SCALARS, r->type));
1049                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->delay));
1050         }
1051         if (ndr_flags & NDR_BUFFERS) {
1052         }
1053         return NDR_ERR_SUCCESS;
1054 }
1055
1056 static enum ndr_err_code ndr_pull_SC_ACTION(struct ndr_pull *ndr, int ndr_flags, struct SC_ACTION *r)
1057 {
1058         if (ndr_flags & NDR_SCALARS) {
1059                 NDR_CHECK(ndr_pull_align(ndr, 4));
1060                 NDR_CHECK(ndr_pull_SC_ACTION_TYPE(ndr, NDR_SCALARS, &r->type));
1061                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->delay));
1062         }
1063         if (ndr_flags & NDR_BUFFERS) {
1064         }
1065         return NDR_ERR_SUCCESS;
1066 }
1067
1068 _PUBLIC_ void ndr_print_SC_ACTION(struct ndr_print *ndr, const char *name, const struct SC_ACTION *r)
1069 {
1070         ndr_print_struct(ndr, name, "SC_ACTION");
1071         ndr->depth++;
1072         ndr_print_SC_ACTION_TYPE(ndr, "type", r->type);
1073         ndr_print_uint32(ndr, "delay", r->delay);
1074         ndr->depth--;
1075 }
1076
1077 _PUBLIC_ enum ndr_err_code ndr_push_SERVICE_FAILURE_ACTIONS(struct ndr_push *ndr, int ndr_flags, const struct SERVICE_FAILURE_ACTIONS *r)
1078 {
1079         uint32_t cntr_actions_1;
1080         if (ndr_flags & NDR_SCALARS) {
1081                 NDR_CHECK(ndr_push_align(ndr, 4));
1082                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reset_period));
1083                 {
1084                         uint32_t _flags_save_string = ndr->flags;
1085                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1086                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->rebootmsg));
1087                         ndr->flags = _flags_save_string;
1088                 }
1089                 {
1090                         uint32_t _flags_save_string = ndr->flags;
1091                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1092                         NDR_CHECK(ndr_push_relative_ptr1(ndr, r->command));
1093                         ndr->flags = _flags_save_string;
1094                 }
1095                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_actions));
1096                 NDR_CHECK(ndr_push_relative_ptr1(ndr, r->actions));
1097         }
1098         if (ndr_flags & NDR_BUFFERS) {
1099                 {
1100                         uint32_t _flags_save_string = ndr->flags;
1101                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1102                         if (r->rebootmsg) {
1103                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->rebootmsg));
1104                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->rebootmsg));
1105                         }
1106                         ndr->flags = _flags_save_string;
1107                 }
1108                 {
1109                         uint32_t _flags_save_string = ndr->flags;
1110                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1111                         if (r->command) {
1112                                 NDR_CHECK(ndr_push_relative_ptr2(ndr, r->command));
1113                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->command));
1114                         }
1115                         ndr->flags = _flags_save_string;
1116                 }
1117                 if (r->actions) {
1118                         NDR_CHECK(ndr_push_relative_ptr2(ndr, r->actions));
1119                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_actions));
1120                         for (cntr_actions_1 = 0; cntr_actions_1 < r->num_actions; cntr_actions_1++) {
1121                                 NDR_CHECK(ndr_push_SC_ACTION(ndr, NDR_SCALARS, &r->actions[cntr_actions_1]));
1122                         }
1123                 }
1124         }
1125         return NDR_ERR_SUCCESS;
1126 }
1127
1128 _PUBLIC_ enum ndr_err_code ndr_pull_SERVICE_FAILURE_ACTIONS(struct ndr_pull *ndr, int ndr_flags, struct SERVICE_FAILURE_ACTIONS *r)
1129 {
1130         uint32_t _ptr_rebootmsg;
1131         TALLOC_CTX *_mem_save_rebootmsg_0;
1132         uint32_t _ptr_command;
1133         TALLOC_CTX *_mem_save_command_0;
1134         uint32_t _ptr_actions;
1135         uint32_t cntr_actions_1;
1136         TALLOC_CTX *_mem_save_actions_0;
1137         TALLOC_CTX *_mem_save_actions_1;
1138         if (ndr_flags & NDR_SCALARS) {
1139                 NDR_CHECK(ndr_pull_align(ndr, 4));
1140                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reset_period));
1141                 {
1142                         uint32_t _flags_save_string = ndr->flags;
1143                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1144                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_rebootmsg));
1145                         if (_ptr_rebootmsg) {
1146                                 NDR_PULL_ALLOC(ndr, r->rebootmsg);
1147                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->rebootmsg, _ptr_rebootmsg));
1148                         } else {
1149                                 r->rebootmsg = NULL;
1150                         }
1151                         ndr->flags = _flags_save_string;
1152                 }
1153                 {
1154                         uint32_t _flags_save_string = ndr->flags;
1155                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1156                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_command));
1157                         if (_ptr_command) {
1158                                 NDR_PULL_ALLOC(ndr, r->command);
1159                                 NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->command, _ptr_command));
1160                         } else {
1161                                 r->command = NULL;
1162                         }
1163                         ndr->flags = _flags_save_string;
1164                 }
1165                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_actions));
1166                 if (r->num_actions > 1024) {
1167                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1168                 }
1169                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_actions));
1170                 if (_ptr_actions) {
1171                         NDR_PULL_ALLOC(ndr, r->actions);
1172                         NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->actions, _ptr_actions));
1173                 } else {
1174                         r->actions = NULL;
1175                 }
1176         }
1177         if (ndr_flags & NDR_BUFFERS) {
1178                 {
1179                         uint32_t _flags_save_string = ndr->flags;
1180                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1181                         if (r->rebootmsg) {
1182                                 uint32_t _relative_save_offset;
1183                                 _relative_save_offset = ndr->offset;
1184                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->rebootmsg));
1185                                 _mem_save_rebootmsg_0 = NDR_PULL_GET_MEM_CTX(ndr);
1186                                 NDR_PULL_SET_MEM_CTX(ndr, r->rebootmsg, 0);
1187                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->rebootmsg));
1188                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rebootmsg_0, 0);
1189                                 ndr->offset = _relative_save_offset;
1190                         }
1191                         ndr->flags = _flags_save_string;
1192                 }
1193                 {
1194                         uint32_t _flags_save_string = ndr->flags;
1195                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
1196                         if (r->command) {
1197                                 uint32_t _relative_save_offset;
1198                                 _relative_save_offset = ndr->offset;
1199                                 NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->command));
1200                                 _mem_save_command_0 = NDR_PULL_GET_MEM_CTX(ndr);
1201                                 NDR_PULL_SET_MEM_CTX(ndr, r->command, 0);
1202                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->command));
1203                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_command_0, 0);
1204                                 ndr->offset = _relative_save_offset;
1205                         }
1206                         ndr->flags = _flags_save_string;
1207                 }
1208                 if (r->actions) {
1209                         uint32_t _relative_save_offset;
1210                         _relative_save_offset = ndr->offset;
1211                         NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->actions));
1212                         _mem_save_actions_0 = NDR_PULL_GET_MEM_CTX(ndr);
1213                         NDR_PULL_SET_MEM_CTX(ndr, r->actions, 0);
1214                         NDR_CHECK(ndr_pull_array_size(ndr, &r->actions));
1215                         NDR_PULL_ALLOC_N(ndr, r->actions, ndr_get_array_size(ndr, &r->actions));
1216                         _mem_save_actions_1 = NDR_PULL_GET_MEM_CTX(ndr);
1217                         NDR_PULL_SET_MEM_CTX(ndr, r->actions, 0);
1218                         for (cntr_actions_1 = 0; cntr_actions_1 < r->num_actions; cntr_actions_1++) {
1219                                 NDR_CHECK(ndr_pull_SC_ACTION(ndr, NDR_SCALARS, &r->actions[cntr_actions_1]));
1220                         }
1221                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_actions_1, 0);
1222                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_actions_0, 0);
1223                         ndr->offset = _relative_save_offset;
1224                 }
1225                 if (r->actions) {
1226                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->actions, r->num_actions));
1227                 }
1228         }
1229         return NDR_ERR_SUCCESS;
1230 }
1231
1232 _PUBLIC_ void ndr_print_SERVICE_FAILURE_ACTIONS(struct ndr_print *ndr, const char *name, const struct SERVICE_FAILURE_ACTIONS *r)
1233 {
1234         uint32_t cntr_actions_1;
1235         ndr_print_struct(ndr, name, "SERVICE_FAILURE_ACTIONS");
1236         ndr->depth++;
1237         ndr_print_uint32(ndr, "reset_period", r->reset_period);
1238         ndr_print_ptr(ndr, "rebootmsg", r->rebootmsg);
1239         ndr->depth++;
1240         if (r->rebootmsg) {
1241                 ndr_print_string(ndr, "rebootmsg", r->rebootmsg);
1242         }
1243         ndr->depth--;
1244         ndr_print_ptr(ndr, "command", r->command);
1245         ndr->depth++;
1246         if (r->command) {
1247                 ndr_print_string(ndr, "command", r->command);
1248         }
1249         ndr->depth--;
1250         ndr_print_uint32(ndr, "num_actions", r->num_actions);
1251         ndr_print_ptr(ndr, "actions", r->actions);
1252         ndr->depth++;
1253         if (r->actions) {
1254                 ndr->print(ndr, "%s: ARRAY(%d)", "actions", (int)r->num_actions);
1255                 ndr->depth++;
1256                 for (cntr_actions_1=0;cntr_actions_1<r->num_actions;cntr_actions_1++) {
1257                         char *idx_1=NULL;
1258                         if (asprintf(&idx_1, "[%d]", cntr_actions_1) != -1) {
1259                                 ndr_print_SC_ACTION(ndr, "actions", &r->actions[cntr_actions_1]);
1260                                 free(idx_1);
1261                         }
1262                 }
1263                 ndr->depth--;
1264         }
1265         ndr->depth--;
1266         ndr->depth--;
1267 }
1268
1269 _PUBLIC_ size_t ndr_size_SERVICE_FAILURE_ACTIONS(const struct SERVICE_FAILURE_ACTIONS *r, struct smb_iconv_convenience *ic, int flags)
1270 {
1271         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_SERVICE_FAILURE_ACTIONS, ic);
1272 }
1273
1274 static enum ndr_err_code ndr_push_svcctl_StatusLevel(struct ndr_push *ndr, int ndr_flags, enum svcctl_StatusLevel r)
1275 {
1276         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
1277         return NDR_ERR_SUCCESS;
1278 }
1279
1280 static enum ndr_err_code ndr_pull_svcctl_StatusLevel(struct ndr_pull *ndr, int ndr_flags, enum svcctl_StatusLevel *r)
1281 {
1282         uint32_t v;
1283         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
1284         *r = v;
1285         return NDR_ERR_SUCCESS;
1286 }
1287
1288 _PUBLIC_ void ndr_print_svcctl_StatusLevel(struct ndr_print *ndr, const char *name, enum svcctl_StatusLevel r)
1289 {
1290         const char *val = NULL;
1291
1292         switch (r) {
1293                 case SVC_STATUS_PROCESS_INFO: val = "SVC_STATUS_PROCESS_INFO"; break;
1294         }
1295         ndr_print_enum(ndr, name, "ENUM", val, r);
1296 }
1297
1298 static enum ndr_err_code ndr_push_svcctl_CloseServiceHandle(struct ndr_push *ndr, int flags, const struct svcctl_CloseServiceHandle *r)
1299 {
1300         if (flags & NDR_IN) {
1301                 if (r->in.handle == NULL) {
1302                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1303                 }
1304                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1305         }
1306         if (flags & NDR_OUT) {
1307                 if (r->out.handle == NULL) {
1308                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1309                 }
1310                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
1311                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1312         }
1313         return NDR_ERR_SUCCESS;
1314 }
1315
1316 static enum ndr_err_code ndr_pull_svcctl_CloseServiceHandle(struct ndr_pull *ndr, int flags, struct svcctl_CloseServiceHandle *r)
1317 {
1318         TALLOC_CTX *_mem_save_handle_0;
1319         if (flags & NDR_IN) {
1320                 ZERO_STRUCT(r->out);
1321
1322                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1323                         NDR_PULL_ALLOC(ndr, r->in.handle);
1324                 }
1325                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1326                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1327                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1328                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1329                 NDR_PULL_ALLOC(ndr, r->out.handle);
1330                 *r->out.handle = *r->in.handle;
1331         }
1332         if (flags & NDR_OUT) {
1333                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1334                         NDR_PULL_ALLOC(ndr, r->out.handle);
1335                 }
1336                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1337                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
1338                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
1339                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1340                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1341         }
1342         return NDR_ERR_SUCCESS;
1343 }
1344
1345 _PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r)
1346 {
1347         ndr_print_struct(ndr, name, "svcctl_CloseServiceHandle");
1348         ndr->depth++;
1349         if (flags & NDR_SET_VALUES) {
1350                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1351         }
1352         if (flags & NDR_IN) {
1353                 ndr_print_struct(ndr, "in", "svcctl_CloseServiceHandle");
1354                 ndr->depth++;
1355                 ndr_print_ptr(ndr, "handle", r->in.handle);
1356                 ndr->depth++;
1357                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1358                 ndr->depth--;
1359                 ndr->depth--;
1360         }
1361         if (flags & NDR_OUT) {
1362                 ndr_print_struct(ndr, "out", "svcctl_CloseServiceHandle");
1363                 ndr->depth++;
1364                 ndr_print_ptr(ndr, "handle", r->out.handle);
1365                 ndr->depth++;
1366                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
1367                 ndr->depth--;
1368                 ndr_print_WERROR(ndr, "result", r->out.result);
1369                 ndr->depth--;
1370         }
1371         ndr->depth--;
1372 }
1373
1374 static enum ndr_err_code ndr_push_svcctl_ControlService(struct ndr_push *ndr, int flags, const struct svcctl_ControlService *r)
1375 {
1376         if (flags & NDR_IN) {
1377                 if (r->in.handle == NULL) {
1378                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1379                 }
1380                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1381                 NDR_CHECK(ndr_push_SERVICE_CONTROL(ndr, NDR_SCALARS, r->in.control));
1382         }
1383         if (flags & NDR_OUT) {
1384                 if (r->out.service_status == NULL) {
1385                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1386                 }
1387                 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1388                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1389         }
1390         return NDR_ERR_SUCCESS;
1391 }
1392
1393 static enum ndr_err_code ndr_pull_svcctl_ControlService(struct ndr_pull *ndr, int flags, struct svcctl_ControlService *r)
1394 {
1395         TALLOC_CTX *_mem_save_handle_0;
1396         TALLOC_CTX *_mem_save_service_status_0;
1397         if (flags & NDR_IN) {
1398                 ZERO_STRUCT(r->out);
1399
1400                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1401                         NDR_PULL_ALLOC(ndr, r->in.handle);
1402                 }
1403                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1404                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1405                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1406                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1407                 NDR_CHECK(ndr_pull_SERVICE_CONTROL(ndr, NDR_SCALARS, &r->in.control));
1408                 NDR_PULL_ALLOC(ndr, r->out.service_status);
1409                 ZERO_STRUCTP(r->out.service_status);
1410         }
1411         if (flags & NDR_OUT) {
1412                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1413                         NDR_PULL_ALLOC(ndr, r->out.service_status);
1414                 }
1415                 _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
1416                 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC);
1417                 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1418                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC);
1419                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1420         }
1421         return NDR_ERR_SUCCESS;
1422 }
1423
1424 _PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r)
1425 {
1426         ndr_print_struct(ndr, name, "svcctl_ControlService");
1427         ndr->depth++;
1428         if (flags & NDR_SET_VALUES) {
1429                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1430         }
1431         if (flags & NDR_IN) {
1432                 ndr_print_struct(ndr, "in", "svcctl_ControlService");
1433                 ndr->depth++;
1434                 ndr_print_ptr(ndr, "handle", r->in.handle);
1435                 ndr->depth++;
1436                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1437                 ndr->depth--;
1438                 ndr_print_SERVICE_CONTROL(ndr, "control", r->in.control);
1439                 ndr->depth--;
1440         }
1441         if (flags & NDR_OUT) {
1442                 ndr_print_struct(ndr, "out", "svcctl_ControlService");
1443                 ndr->depth++;
1444                 ndr_print_ptr(ndr, "service_status", r->out.service_status);
1445                 ndr->depth++;
1446                 ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status);
1447                 ndr->depth--;
1448                 ndr_print_WERROR(ndr, "result", r->out.result);
1449                 ndr->depth--;
1450         }
1451         ndr->depth--;
1452 }
1453
1454 static enum ndr_err_code ndr_push_svcctl_DeleteService(struct ndr_push *ndr, int flags, const struct svcctl_DeleteService *r)
1455 {
1456         if (flags & NDR_IN) {
1457                 if (r->in.handle == NULL) {
1458                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1459                 }
1460                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1461         }
1462         if (flags & NDR_OUT) {
1463                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1464         }
1465         return NDR_ERR_SUCCESS;
1466 }
1467
1468 static enum ndr_err_code ndr_pull_svcctl_DeleteService(struct ndr_pull *ndr, int flags, struct svcctl_DeleteService *r)
1469 {
1470         TALLOC_CTX *_mem_save_handle_0;
1471         if (flags & NDR_IN) {
1472                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1473                         NDR_PULL_ALLOC(ndr, r->in.handle);
1474                 }
1475                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1476                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1477                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1478                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1479         }
1480         if (flags & NDR_OUT) {
1481                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1482         }
1483         return NDR_ERR_SUCCESS;
1484 }
1485
1486 _PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r)
1487 {
1488         ndr_print_struct(ndr, name, "svcctl_DeleteService");
1489         ndr->depth++;
1490         if (flags & NDR_SET_VALUES) {
1491                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1492         }
1493         if (flags & NDR_IN) {
1494                 ndr_print_struct(ndr, "in", "svcctl_DeleteService");
1495                 ndr->depth++;
1496                 ndr_print_ptr(ndr, "handle", r->in.handle);
1497                 ndr->depth++;
1498                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1499                 ndr->depth--;
1500                 ndr->depth--;
1501         }
1502         if (flags & NDR_OUT) {
1503                 ndr_print_struct(ndr, "out", "svcctl_DeleteService");
1504                 ndr->depth++;
1505                 ndr_print_WERROR(ndr, "result", r->out.result);
1506                 ndr->depth--;
1507         }
1508         ndr->depth--;
1509 }
1510
1511 static enum ndr_err_code ndr_push_svcctl_LockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_LockServiceDatabase *r)
1512 {
1513         if (flags & NDR_IN) {
1514                 if (r->in.handle == NULL) {
1515                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1516                 }
1517                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1518         }
1519         if (flags & NDR_OUT) {
1520                 if (r->out.lock == NULL) {
1521                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1522                 }
1523                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1524                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1525         }
1526         return NDR_ERR_SUCCESS;
1527 }
1528
1529 static enum ndr_err_code ndr_pull_svcctl_LockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_LockServiceDatabase *r)
1530 {
1531         TALLOC_CTX *_mem_save_handle_0;
1532         TALLOC_CTX *_mem_save_lock_0;
1533         if (flags & NDR_IN) {
1534                 ZERO_STRUCT(r->out);
1535
1536                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1537                         NDR_PULL_ALLOC(ndr, r->in.handle);
1538                 }
1539                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1540                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1541                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1542                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1543                 NDR_PULL_ALLOC(ndr, r->out.lock);
1544                 ZERO_STRUCTP(r->out.lock);
1545         }
1546         if (flags & NDR_OUT) {
1547                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1548                         NDR_PULL_ALLOC(ndr, r->out.lock);
1549                 }
1550                 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
1551                 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC);
1552                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1553                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
1554                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1555         }
1556         return NDR_ERR_SUCCESS;
1557 }
1558
1559 _PUBLIC_ void ndr_print_svcctl_LockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_LockServiceDatabase *r)
1560 {
1561         ndr_print_struct(ndr, name, "svcctl_LockServiceDatabase");
1562         ndr->depth++;
1563         if (flags & NDR_SET_VALUES) {
1564                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1565         }
1566         if (flags & NDR_IN) {
1567                 ndr_print_struct(ndr, "in", "svcctl_LockServiceDatabase");
1568                 ndr->depth++;
1569                 ndr_print_ptr(ndr, "handle", r->in.handle);
1570                 ndr->depth++;
1571                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1572                 ndr->depth--;
1573                 ndr->depth--;
1574         }
1575         if (flags & NDR_OUT) {
1576                 ndr_print_struct(ndr, "out", "svcctl_LockServiceDatabase");
1577                 ndr->depth++;
1578                 ndr_print_ptr(ndr, "lock", r->out.lock);
1579                 ndr->depth++;
1580                 ndr_print_policy_handle(ndr, "lock", r->out.lock);
1581                 ndr->depth--;
1582                 ndr_print_WERROR(ndr, "result", r->out.result);
1583                 ndr->depth--;
1584         }
1585         ndr->depth--;
1586 }
1587
1588 static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceObjectSecurity *r)
1589 {
1590         if (flags & NDR_IN) {
1591                 if (r->in.handle == NULL) {
1592                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1593                 }
1594                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1595                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags));
1596                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
1597         }
1598         if (flags & NDR_OUT) {
1599                 if (r->out.buffer == NULL) {
1600                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1601                 }
1602                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
1603                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buffer_size));
1604                 if (r->out.needed == NULL) {
1605                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1606                 }
1607                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
1608                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1609         }
1610         return NDR_ERR_SUCCESS;
1611 }
1612
1613 static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceObjectSecurity *r)
1614 {
1615         TALLOC_CTX *_mem_save_handle_0;
1616         TALLOC_CTX *_mem_save_needed_0;
1617         if (flags & NDR_IN) {
1618                 ZERO_STRUCT(r->out);
1619
1620                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1621                         NDR_PULL_ALLOC(ndr, r->in.handle);
1622                 }
1623                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1624                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1625                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1626                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1627                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags));
1628                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size));
1629                 if (r->in.buffer_size > 0x40000) {
1630                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1631                 }
1632                 NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buffer_size);
1633                 memset(r->out.buffer, 0, (r->in.buffer_size) * sizeof(*r->out.buffer));
1634                 NDR_PULL_ALLOC(ndr, r->out.needed);
1635                 ZERO_STRUCTP(r->out.needed);
1636         }
1637         if (flags & NDR_OUT) {
1638                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer));
1639                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1640                         NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer));
1641                 }
1642                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)));
1643                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1644                         NDR_PULL_ALLOC(ndr, r->out.needed);
1645                 }
1646                 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
1647                 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
1648                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
1649                 if (*r->out.needed > 0x40000) {
1650                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
1651                 }
1652                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
1653                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1654                 if (r->out.buffer) {
1655                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buffer_size));
1656                 }
1657         }
1658         return NDR_ERR_SUCCESS;
1659 }
1660
1661 _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceObjectSecurity *r)
1662 {
1663         ndr_print_struct(ndr, name, "svcctl_QueryServiceObjectSecurity");
1664         ndr->depth++;
1665         if (flags & NDR_SET_VALUES) {
1666                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1667         }
1668         if (flags & NDR_IN) {
1669                 ndr_print_struct(ndr, "in", "svcctl_QueryServiceObjectSecurity");
1670                 ndr->depth++;
1671                 ndr_print_ptr(ndr, "handle", r->in.handle);
1672                 ndr->depth++;
1673                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1674                 ndr->depth--;
1675                 ndr_print_uint32(ndr, "security_flags", r->in.security_flags);
1676                 ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size);
1677                 ndr->depth--;
1678         }
1679         if (flags & NDR_OUT) {
1680                 ndr_print_struct(ndr, "out", "svcctl_QueryServiceObjectSecurity");
1681                 ndr->depth++;
1682                 ndr_print_ptr(ndr, "buffer", r->out.buffer);
1683                 ndr->depth++;
1684                 ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buffer_size);
1685                 ndr->depth--;
1686                 ndr_print_ptr(ndr, "needed", r->out.needed);
1687                 ndr->depth++;
1688                 ndr_print_uint32(ndr, "needed", *r->out.needed);
1689                 ndr->depth--;
1690                 ndr_print_WERROR(ndr, "result", r->out.result);
1691                 ndr->depth--;
1692         }
1693         ndr->depth--;
1694 }
1695
1696 static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceObjectSecurity *r)
1697 {
1698         if (flags & NDR_IN) {
1699                 if (r->in.handle == NULL) {
1700                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1701                 }
1702                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1703                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags));
1704                 if (r->in.buffer == NULL) {
1705                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1706                 }
1707                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
1708                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.buffer_size));
1709                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
1710         }
1711         if (flags & NDR_OUT) {
1712                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1713         }
1714         return NDR_ERR_SUCCESS;
1715 }
1716
1717 static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceObjectSecurity *r)
1718 {
1719         TALLOC_CTX *_mem_save_handle_0;
1720         if (flags & NDR_IN) {
1721                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1722                         NDR_PULL_ALLOC(ndr, r->in.handle);
1723                 }
1724                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1725                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1726                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1727                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1728                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags));
1729                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer));
1730                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1731                         NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer));
1732                 }
1733                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)));
1734                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size));
1735                 if (r->in.buffer) {
1736                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.buffer_size));
1737                 }
1738         }
1739         if (flags & NDR_OUT) {
1740                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1741         }
1742         return NDR_ERR_SUCCESS;
1743 }
1744
1745 _PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceObjectSecurity *r)
1746 {
1747         ndr_print_struct(ndr, name, "svcctl_SetServiceObjectSecurity");
1748         ndr->depth++;
1749         if (flags & NDR_SET_VALUES) {
1750                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1751         }
1752         if (flags & NDR_IN) {
1753                 ndr_print_struct(ndr, "in", "svcctl_SetServiceObjectSecurity");
1754                 ndr->depth++;
1755                 ndr_print_ptr(ndr, "handle", r->in.handle);
1756                 ndr->depth++;
1757                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1758                 ndr->depth--;
1759                 ndr_print_uint32(ndr, "security_flags", r->in.security_flags);
1760                 ndr_print_ptr(ndr, "buffer", r->in.buffer);
1761                 ndr->depth++;
1762                 ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.buffer_size);
1763                 ndr->depth--;
1764                 ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size);
1765                 ndr->depth--;
1766         }
1767         if (flags & NDR_OUT) {
1768                 ndr_print_struct(ndr, "out", "svcctl_SetServiceObjectSecurity");
1769                 ndr->depth++;
1770                 ndr_print_WERROR(ndr, "result", r->out.result);
1771                 ndr->depth--;
1772         }
1773         ndr->depth--;
1774 }
1775
1776 static enum ndr_err_code ndr_push_svcctl_QueryServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_QueryServiceStatus *r)
1777 {
1778         if (flags & NDR_IN) {
1779                 if (r->in.handle == NULL) {
1780                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1781                 }
1782                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1783         }
1784         if (flags & NDR_OUT) {
1785                 if (r->out.service_status == NULL) {
1786                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1787                 }
1788                 NDR_CHECK(ndr_push_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1789                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1790         }
1791         return NDR_ERR_SUCCESS;
1792 }
1793
1794 static enum ndr_err_code ndr_pull_svcctl_QueryServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_QueryServiceStatus *r)
1795 {
1796         TALLOC_CTX *_mem_save_handle_0;
1797         TALLOC_CTX *_mem_save_service_status_0;
1798         if (flags & NDR_IN) {
1799                 ZERO_STRUCT(r->out);
1800
1801                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1802                         NDR_PULL_ALLOC(ndr, r->in.handle);
1803                 }
1804                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
1805                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
1806                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
1807                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
1808                 NDR_PULL_ALLOC(ndr, r->out.service_status);
1809                 ZERO_STRUCTP(r->out.service_status);
1810         }
1811         if (flags & NDR_OUT) {
1812                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1813                         NDR_PULL_ALLOC(ndr, r->out.service_status);
1814                 }
1815                 _mem_save_service_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
1816                 NDR_PULL_SET_MEM_CTX(ndr, r->out.service_status, LIBNDR_FLAG_REF_ALLOC);
1817                 NDR_CHECK(ndr_pull_SERVICE_STATUS(ndr, NDR_SCALARS, r->out.service_status));
1818                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_status_0, LIBNDR_FLAG_REF_ALLOC);
1819                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1820         }
1821         return NDR_ERR_SUCCESS;
1822 }
1823
1824 _PUBLIC_ void ndr_print_svcctl_QueryServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_QueryServiceStatus *r)
1825 {
1826         ndr_print_struct(ndr, name, "svcctl_QueryServiceStatus");
1827         ndr->depth++;
1828         if (flags & NDR_SET_VALUES) {
1829                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1830         }
1831         if (flags & NDR_IN) {
1832                 ndr_print_struct(ndr, "in", "svcctl_QueryServiceStatus");
1833                 ndr->depth++;
1834                 ndr_print_ptr(ndr, "handle", r->in.handle);
1835                 ndr->depth++;
1836                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
1837                 ndr->depth--;
1838                 ndr->depth--;
1839         }
1840         if (flags & NDR_OUT) {
1841                 ndr_print_struct(ndr, "out", "svcctl_QueryServiceStatus");
1842                 ndr->depth++;
1843                 ndr_print_ptr(ndr, "service_status", r->out.service_status);
1844                 ndr->depth++;
1845                 ndr_print_SERVICE_STATUS(ndr, "service_status", r->out.service_status);
1846                 ndr->depth--;
1847                 ndr_print_WERROR(ndr, "result", r->out.result);
1848                 ndr->depth--;
1849         }
1850         ndr->depth--;
1851 }
1852
1853 static enum ndr_err_code ndr_push_svcctl_SetServiceStatus(struct ndr_push *ndr, int flags, const struct svcctl_SetServiceStatus *r)
1854 {
1855         if (flags & NDR_IN) {
1856         }
1857         if (flags & NDR_OUT) {
1858                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1859         }
1860         return NDR_ERR_SUCCESS;
1861 }
1862
1863 static enum ndr_err_code ndr_pull_svcctl_SetServiceStatus(struct ndr_pull *ndr, int flags, struct svcctl_SetServiceStatus *r)
1864 {
1865         if (flags & NDR_IN) {
1866         }
1867         if (flags & NDR_OUT) {
1868                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1869         }
1870         return NDR_ERR_SUCCESS;
1871 }
1872
1873 _PUBLIC_ void ndr_print_svcctl_SetServiceStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SetServiceStatus *r)
1874 {
1875         ndr_print_struct(ndr, name, "svcctl_SetServiceStatus");
1876         ndr->depth++;
1877         if (flags & NDR_SET_VALUES) {
1878                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1879         }
1880         if (flags & NDR_IN) {
1881                 ndr_print_struct(ndr, "in", "svcctl_SetServiceStatus");
1882                 ndr->depth++;
1883                 ndr->depth--;
1884         }
1885         if (flags & NDR_OUT) {
1886                 ndr_print_struct(ndr, "out", "svcctl_SetServiceStatus");
1887                 ndr->depth++;
1888                 ndr_print_WERROR(ndr, "result", r->out.result);
1889                 ndr->depth--;
1890         }
1891         ndr->depth--;
1892 }
1893
1894 static enum ndr_err_code ndr_push_svcctl_UnlockServiceDatabase(struct ndr_push *ndr, int flags, const struct svcctl_UnlockServiceDatabase *r)
1895 {
1896         if (flags & NDR_IN) {
1897                 if (r->in.lock == NULL) {
1898                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1899                 }
1900                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.lock));
1901         }
1902         if (flags & NDR_OUT) {
1903                 if (r->out.lock == NULL) {
1904                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1905                 }
1906                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1907                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1908         }
1909         return NDR_ERR_SUCCESS;
1910 }
1911
1912 static enum ndr_err_code ndr_pull_svcctl_UnlockServiceDatabase(struct ndr_pull *ndr, int flags, struct svcctl_UnlockServiceDatabase *r)
1913 {
1914         TALLOC_CTX *_mem_save_lock_0;
1915         if (flags & NDR_IN) {
1916                 ZERO_STRUCT(r->out);
1917
1918                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1919                         NDR_PULL_ALLOC(ndr, r->in.lock);
1920                 }
1921                 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
1922                 NDR_PULL_SET_MEM_CTX(ndr, r->in.lock, LIBNDR_FLAG_REF_ALLOC);
1923                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.lock));
1924                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
1925                 NDR_PULL_ALLOC(ndr, r->out.lock);
1926                 *r->out.lock = *r->in.lock;
1927         }
1928         if (flags & NDR_OUT) {
1929                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1930                         NDR_PULL_ALLOC(ndr, r->out.lock);
1931                 }
1932                 _mem_save_lock_0 = NDR_PULL_GET_MEM_CTX(ndr);
1933                 NDR_PULL_SET_MEM_CTX(ndr, r->out.lock, LIBNDR_FLAG_REF_ALLOC);
1934                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.lock));
1935                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_lock_0, LIBNDR_FLAG_REF_ALLOC);
1936                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1937         }
1938         return NDR_ERR_SUCCESS;
1939 }
1940
1941 _PUBLIC_ void ndr_print_svcctl_UnlockServiceDatabase(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_UnlockServiceDatabase *r)
1942 {
1943         ndr_print_struct(ndr, name, "svcctl_UnlockServiceDatabase");
1944         ndr->depth++;
1945         if (flags & NDR_SET_VALUES) {
1946                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1947         }
1948         if (flags & NDR_IN) {
1949                 ndr_print_struct(ndr, "in", "svcctl_UnlockServiceDatabase");
1950                 ndr->depth++;
1951                 ndr_print_ptr(ndr, "lock", r->in.lock);
1952                 ndr->depth++;
1953                 ndr_print_policy_handle(ndr, "lock", r->in.lock);
1954                 ndr->depth--;
1955                 ndr->depth--;
1956         }
1957         if (flags & NDR_OUT) {
1958                 ndr_print_struct(ndr, "out", "svcctl_UnlockServiceDatabase");
1959                 ndr->depth++;
1960                 ndr_print_ptr(ndr, "lock", r->out.lock);
1961                 ndr->depth++;
1962                 ndr_print_policy_handle(ndr, "lock", r->out.lock);
1963                 ndr->depth--;
1964                 ndr_print_WERROR(ndr, "result", r->out.result);
1965                 ndr->depth--;
1966         }
1967         ndr->depth--;
1968 }
1969
1970 static enum ndr_err_code ndr_push_svcctl_NotifyBootConfigStatus(struct ndr_push *ndr, int flags, const struct svcctl_NotifyBootConfigStatus *r)
1971 {
1972         if (flags & NDR_IN) {
1973         }
1974         if (flags & NDR_OUT) {
1975                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
1976         }
1977         return NDR_ERR_SUCCESS;
1978 }
1979
1980 static enum ndr_err_code ndr_pull_svcctl_NotifyBootConfigStatus(struct ndr_pull *ndr, int flags, struct svcctl_NotifyBootConfigStatus *r)
1981 {
1982         if (flags & NDR_IN) {
1983         }
1984         if (flags & NDR_OUT) {
1985                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
1986         }
1987         return NDR_ERR_SUCCESS;
1988 }
1989
1990 _PUBLIC_ void ndr_print_svcctl_NotifyBootConfigStatus(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_NotifyBootConfigStatus *r)
1991 {
1992         ndr_print_struct(ndr, name, "svcctl_NotifyBootConfigStatus");
1993         ndr->depth++;
1994         if (flags & NDR_SET_VALUES) {
1995                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1996         }
1997         if (flags & NDR_IN) {
1998                 ndr_print_struct(ndr, "in", "svcctl_NotifyBootConfigStatus");
1999                 ndr->depth++;
2000                 ndr->depth--;
2001         }
2002         if (flags & NDR_OUT) {
2003                 ndr_print_struct(ndr, "out", "svcctl_NotifyBootConfigStatus");
2004                 ndr->depth++;
2005                 ndr_print_WERROR(ndr, "result", r->out.result);
2006                 ndr->depth--;
2007         }
2008         ndr->depth--;
2009 }
2010
2011 static enum ndr_err_code ndr_push_svcctl_SCSetServiceBitsW(struct ndr_push *ndr, int flags, const struct svcctl_SCSetServiceBitsW *r)
2012 {
2013         if (flags & NDR_IN) {
2014                 if (r->in.handle == NULL) {
2015                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2016                 }
2017                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2018                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bits));
2019                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bitson));
2020                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.immediate));
2021         }
2022         if (flags & NDR_OUT) {
2023                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2024         }
2025         return NDR_ERR_SUCCESS;
2026 }
2027
2028 static enum ndr_err_code ndr_pull_svcctl_SCSetServiceBitsW(struct ndr_pull *ndr, int flags, struct svcctl_SCSetServiceBitsW *r)
2029 {
2030         TALLOC_CTX *_mem_save_handle_0;
2031         if (flags & NDR_IN) {
2032                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2033                         NDR_PULL_ALLOC(ndr, r->in.handle);
2034                 }
2035                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2036                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2037                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2038                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2039                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bits));
2040                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bitson));
2041                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.immediate));
2042         }
2043         if (flags & NDR_OUT) {
2044                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2045         }
2046         return NDR_ERR_SUCCESS;
2047 }
2048
2049 _PUBLIC_ void ndr_print_svcctl_SCSetServiceBitsW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_SCSetServiceBitsW *r)
2050 {
2051         ndr_print_struct(ndr, name, "svcctl_SCSetServiceBitsW");
2052         ndr->depth++;
2053         if (flags & NDR_SET_VALUES) {
2054                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2055         }
2056         if (flags & NDR_IN) {
2057                 ndr_print_struct(ndr, "in", "svcctl_SCSetServiceBitsW");
2058                 ndr->depth++;
2059                 ndr_print_ptr(ndr, "handle", r->in.handle);
2060                 ndr->depth++;
2061                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2062                 ndr->depth--;
2063                 ndr_print_uint32(ndr, "bits", r->in.bits);
2064                 ndr_print_uint32(ndr, "bitson", r->in.bitson);
2065                 ndr_print_uint32(ndr, "immediate", r->in.immediate);
2066                 ndr->depth--;
2067         }
2068         if (flags & NDR_OUT) {
2069                 ndr_print_struct(ndr, "out", "svcctl_SCSetServiceBitsW");
2070                 ndr->depth++;
2071                 ndr_print_WERROR(ndr, "result", r->out.result);
2072                 ndr->depth--;
2073         }
2074         ndr->depth--;
2075 }
2076
2077 static enum ndr_err_code ndr_push_svcctl_ChangeServiceConfigW(struct ndr_push *ndr, int flags, const struct svcctl_ChangeServiceConfigW *r)
2078 {
2079         if (flags & NDR_IN) {
2080                 if (r->in.handle == NULL) {
2081                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2082                 }
2083                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2084                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2085                 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
2086                 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
2087                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.binary_path));
2088                 if (r->in.binary_path) {
2089                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2090                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2091                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2092                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2093                 }
2094                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.load_order_group));
2095                 if (r->in.load_order_group) {
2096                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
2097                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2098                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.load_order_group, CH_UTF16)));
2099                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.load_order_group, ndr_charset_length(r->in.load_order_group, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2100                 }
2101                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
2102                 if (r->in.dependencies) {
2103                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
2104                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2105                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dependencies, CH_UTF16)));
2106                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dependencies, ndr_charset_length(r->in.dependencies, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2107                 }
2108                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
2109                 if (r->in.service_start_name) {
2110                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2111                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2112                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2113                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2114                 }
2115                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
2116                 if (r->in.password) {
2117                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
2118                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2119                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.password, CH_UTF16)));
2120                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.password, ndr_charset_length(r->in.password, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2121                 }
2122                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.display_name));
2123                 if (r->in.display_name) {
2124                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
2125                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2126                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.display_name, CH_UTF16)));
2127                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.display_name, ndr_charset_length(r->in.display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2128                 }
2129         }
2130         if (flags & NDR_OUT) {
2131                 if (r->out.tag_id == NULL) {
2132                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2133                 }
2134                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.tag_id));
2135                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2136         }
2137         return NDR_ERR_SUCCESS;
2138 }
2139
2140 static enum ndr_err_code ndr_pull_svcctl_ChangeServiceConfigW(struct ndr_pull *ndr, int flags, struct svcctl_ChangeServiceConfigW *r)
2141 {
2142         uint32_t _ptr_binary_path;
2143         uint32_t _ptr_load_order_group;
2144         uint32_t _ptr_dependencies;
2145         uint32_t _ptr_service_start_name;
2146         uint32_t _ptr_password;
2147         uint32_t _ptr_display_name;
2148         TALLOC_CTX *_mem_save_handle_0;
2149         TALLOC_CTX *_mem_save_binary_path_0;
2150         TALLOC_CTX *_mem_save_load_order_group_0;
2151         TALLOC_CTX *_mem_save_tag_id_0;
2152         TALLOC_CTX *_mem_save_dependencies_0;
2153         TALLOC_CTX *_mem_save_service_start_name_0;
2154         TALLOC_CTX *_mem_save_password_0;
2155         TALLOC_CTX *_mem_save_display_name_0;
2156         if (flags & NDR_IN) {
2157                 ZERO_STRUCT(r->out);
2158
2159                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2160                         NDR_PULL_ALLOC(ndr, r->in.handle);
2161                 }
2162                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2163                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2164                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2165                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2166                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2167                 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
2168                 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
2169                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_binary_path));
2170                 if (_ptr_binary_path) {
2171                         NDR_PULL_ALLOC(ndr, r->in.binary_path);
2172                 } else {
2173                         r->in.binary_path = NULL;
2174                 }
2175                 if (r->in.binary_path) {
2176                         _mem_save_binary_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
2177                         NDR_PULL_SET_MEM_CTX(ndr, r->in.binary_path, 0);
2178                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
2179                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
2180                         if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
2181                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
2182                         }
2183                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
2184                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
2185                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_binary_path_0, 0);
2186                 }
2187                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_load_order_group));
2188                 if (_ptr_load_order_group) {
2189                         NDR_PULL_ALLOC(ndr, r->in.load_order_group);
2190                 } else {
2191                         r->in.load_order_group = NULL;
2192                 }
2193                 if (r->in.load_order_group) {
2194                         _mem_save_load_order_group_0 = NDR_PULL_GET_MEM_CTX(ndr);
2195                         NDR_PULL_SET_MEM_CTX(ndr, r->in.load_order_group, 0);
2196                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.load_order_group));
2197                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.load_order_group));
2198                         if (ndr_get_array_length(ndr, &r->in.load_order_group) > ndr_get_array_size(ndr, &r->in.load_order_group)) {
2199                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.load_order_group), ndr_get_array_length(ndr, &r->in.load_order_group));
2200                         }
2201                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t)));
2202                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.load_order_group, ndr_get_array_length(ndr, &r->in.load_order_group), sizeof(uint16_t), CH_UTF16));
2203                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_load_order_group_0, 0);
2204                 }
2205                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
2206                 if (_ptr_dependencies) {
2207                         NDR_PULL_ALLOC(ndr, r->in.dependencies);
2208                 } else {
2209                         r->in.dependencies = NULL;
2210                 }
2211                 if (r->in.dependencies) {
2212                         _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
2213                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
2214                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
2215                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dependencies));
2216                         if (ndr_get_array_length(ndr, &r->in.dependencies) > ndr_get_array_size(ndr, &r->in.dependencies)) {
2217                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dependencies), ndr_get_array_length(ndr, &r->in.dependencies));
2218                         }
2219                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t)));
2220                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dependencies, ndr_get_array_length(ndr, &r->in.dependencies), sizeof(uint16_t), CH_UTF16));
2221                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
2222                 }
2223                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
2224                 if (_ptr_service_start_name) {
2225                         NDR_PULL_ALLOC(ndr, r->in.service_start_name);
2226                 } else {
2227                         r->in.service_start_name = NULL;
2228                 }
2229                 if (r->in.service_start_name) {
2230                         _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2231                         NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
2232                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
2233                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
2234                         if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
2235                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
2236                         }
2237                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
2238                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
2239                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
2240                 }
2241                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
2242                 if (_ptr_password) {
2243                         NDR_PULL_ALLOC(ndr, r->in.password);
2244                 } else {
2245                         r->in.password = NULL;
2246                 }
2247                 if (r->in.password) {
2248                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
2249                         NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
2250                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
2251                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.password));
2252                         if (ndr_get_array_length(ndr, &r->in.password) > ndr_get_array_size(ndr, &r->in.password)) {
2253                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.password), ndr_get_array_length(ndr, &r->in.password));
2254                         }
2255                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t)));
2256                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.password, ndr_get_array_length(ndr, &r->in.password), sizeof(uint16_t), CH_UTF16));
2257                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
2258                 }
2259                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
2260                 if (_ptr_display_name) {
2261                         NDR_PULL_ALLOC(ndr, r->in.display_name);
2262                 } else {
2263                         r->in.display_name = NULL;
2264                 }
2265                 if (r->in.display_name) {
2266                         _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2267                         NDR_PULL_SET_MEM_CTX(ndr, r->in.display_name, 0);
2268                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.display_name));
2269                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.display_name));
2270                         if (ndr_get_array_length(ndr, &r->in.display_name) > ndr_get_array_size(ndr, &r->in.display_name)) {
2271                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.display_name), ndr_get_array_length(ndr, &r->in.display_name));
2272                         }
2273                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t)));
2274                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.display_name, ndr_get_array_length(ndr, &r->in.display_name), sizeof(uint16_t), CH_UTF16));
2275                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
2276                 }
2277                 NDR_PULL_ALLOC(ndr, r->out.tag_id);
2278                 ZERO_STRUCTP(r->out.tag_id);
2279         }
2280         if (flags & NDR_OUT) {
2281                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2282                         NDR_PULL_ALLOC(ndr, r->out.tag_id);
2283                 }
2284                 _mem_save_tag_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
2285                 NDR_PULL_SET_MEM_CTX(ndr, r->out.tag_id, LIBNDR_FLAG_REF_ALLOC);
2286                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.tag_id));
2287                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_tag_id_0, LIBNDR_FLAG_REF_ALLOC);
2288                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2289         }
2290         return NDR_ERR_SUCCESS;
2291 }
2292
2293 _PUBLIC_ void ndr_print_svcctl_ChangeServiceConfigW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ChangeServiceConfigW *r)
2294 {
2295         ndr_print_struct(ndr, name, "svcctl_ChangeServiceConfigW");
2296         ndr->depth++;
2297         if (flags & NDR_SET_VALUES) {
2298                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2299         }
2300         if (flags & NDR_IN) {
2301                 ndr_print_struct(ndr, "in", "svcctl_ChangeServiceConfigW");
2302                 ndr->depth++;
2303                 ndr_print_ptr(ndr, "handle", r->in.handle);
2304                 ndr->depth++;
2305                 ndr_print_policy_handle(ndr, "handle", r->in.handle);
2306                 ndr->depth--;
2307                 ndr_print_uint32(ndr, "type", r->in.type);
2308                 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
2309                 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
2310                 ndr_print_ptr(ndr, "binary_path", r->in.binary_path);
2311                 ndr->depth++;
2312                 if (r->in.binary_path) {
2313                         ndr_print_string(ndr, "binary_path", r->in.binary_path);
2314                 }
2315                 ndr->depth--;
2316                 ndr_print_ptr(ndr, "load_order_group", r->in.load_order_group);
2317                 ndr->depth++;
2318                 if (r->in.load_order_group) {
2319                         ndr_print_string(ndr, "load_order_group", r->in.load_order_group);
2320                 }
2321                 ndr->depth--;
2322                 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
2323                 ndr->depth++;
2324                 if (r->in.dependencies) {
2325                         ndr_print_string(ndr, "dependencies", r->in.dependencies);
2326                 }
2327                 ndr->depth--;
2328                 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
2329                 ndr->depth++;
2330                 if (r->in.service_start_name) {
2331                         ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
2332                 }
2333                 ndr->depth--;
2334                 ndr_print_ptr(ndr, "password", r->in.password);
2335                 ndr->depth++;
2336                 if (r->in.password) {
2337                         ndr_print_string(ndr, "password", r->in.password);
2338                 }
2339                 ndr->depth--;
2340                 ndr_print_ptr(ndr, "display_name", r->in.display_name);
2341                 ndr->depth++;
2342                 if (r->in.display_name) {
2343                         ndr_print_string(ndr, "display_name", r->in.display_name);
2344                 }
2345                 ndr->depth--;
2346                 ndr->depth--;
2347         }
2348         if (flags & NDR_OUT) {
2349                 ndr_print_struct(ndr, "out", "svcctl_ChangeServiceConfigW");
2350                 ndr->depth++;
2351                 ndr_print_ptr(ndr, "tag_id", r->out.tag_id);
2352                 ndr->depth++;
2353                 ndr_print_uint32(ndr, "tag_id", *r->out.tag_id);
2354                 ndr->depth--;
2355                 ndr_print_WERROR(ndr, "result", r->out.result);
2356                 ndr->depth--;
2357         }
2358         ndr->depth--;
2359 }
2360
2361 static enum ndr_err_code ndr_push_svcctl_CreateServiceW(struct ndr_push *ndr, int flags, const struct svcctl_CreateServiceW *r)
2362 {
2363         if (flags & NDR_IN) {
2364                 if (r->in.scmanager_handle == NULL) {
2365                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2366                 }
2367                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
2368                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
2369                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2370                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.ServiceName, CH_UTF16)));
2371                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ServiceName, ndr_charset_length(r->in.ServiceName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2372                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.DisplayName));
2373                 if (r->in.DisplayName) {
2374                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
2375                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2376                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.DisplayName, CH_UTF16)));
2377                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.DisplayName, ndr_charset_length(r->in.DisplayName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2378                 }
2379                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.desired_access));
2380                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2381                 NDR_CHECK(ndr_push_svcctl_StartType(ndr, NDR_SCALARS, r->in.start_type));
2382                 NDR_CHECK(ndr_push_svcctl_ErrorControl(ndr, NDR_SCALARS, r->in.error_control));
2383                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2384                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2385                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.binary_path, CH_UTF16)));
2386                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.binary_path, ndr_charset_length(r->in.binary_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2387                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.LoadOrderGroupKey));
2388                 if (r->in.LoadOrderGroupKey) {
2389                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
2390                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2391                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16)));
2392                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.LoadOrderGroupKey, ndr_charset_length(r->in.LoadOrderGroupKey, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2393                 }
2394                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.TagId));
2395                 if (r->in.TagId) {
2396                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.TagId));
2397                 }
2398                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dependencies));
2399                 if (r->in.dependencies) {
2400                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size));
2401                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, r->in.dependencies_size));
2402                 }
2403                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dependencies_size));
2404                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.service_start_name));
2405                 if (r->in.service_start_name) {
2406                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2407                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
2408                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.service_start_name, CH_UTF16)));
2409                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.service_start_name, ndr_charset_length(r->in.service_start_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
2410                 }
2411                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.password));
2412                 if (r->in.password) {
2413                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size));
2414                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.password, r->in.password_size));
2415                 }
2416                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.password_size));
2417         }
2418         if (flags & NDR_OUT) {
2419                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.TagId));
2420                 if (r->out.TagId) {
2421                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.TagId));
2422                 }
2423                 if (r->out.handle == NULL) {
2424                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2425                 }
2426                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2427                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2428         }
2429         return NDR_ERR_SUCCESS;
2430 }
2431
2432 static enum ndr_err_code ndr_pull_svcctl_CreateServiceW(struct ndr_pull *ndr, int flags, struct svcctl_CreateServiceW *r)
2433 {
2434         uint32_t _ptr_DisplayName;
2435         uint32_t _ptr_LoadOrderGroupKey;
2436         uint32_t _ptr_TagId;
2437         uint32_t _ptr_dependencies;
2438         uint32_t _ptr_service_start_name;
2439         uint32_t _ptr_password;
2440         TALLOC_CTX *_mem_save_scmanager_handle_0;
2441         TALLOC_CTX *_mem_save_DisplayName_0;
2442         TALLOC_CTX *_mem_save_LoadOrderGroupKey_0;
2443         TALLOC_CTX *_mem_save_TagId_0;
2444         TALLOC_CTX *_mem_save_dependencies_0;
2445         TALLOC_CTX *_mem_save_service_start_name_0;
2446         TALLOC_CTX *_mem_save_password_0;
2447         TALLOC_CTX *_mem_save_handle_0;
2448         if (flags & NDR_IN) {
2449                 ZERO_STRUCT(r->out);
2450
2451                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2452                         NDR_PULL_ALLOC(ndr, r->in.scmanager_handle);
2453                 }
2454                 _mem_save_scmanager_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2455                 NDR_PULL_SET_MEM_CTX(ndr, r->in.scmanager_handle, LIBNDR_FLAG_REF_ALLOC);
2456                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.scmanager_handle));
2457                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_scmanager_handle_0, LIBNDR_FLAG_REF_ALLOC);
2458                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ServiceName));
2459                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ServiceName));
2460                 if (ndr_get_array_length(ndr, &r->in.ServiceName) > ndr_get_array_size(ndr, &r->in.ServiceName)) {
2461                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.ServiceName), ndr_get_array_length(ndr, &r->in.ServiceName));
2462                 }
2463                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t)));
2464                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ServiceName, ndr_get_array_length(ndr, &r->in.ServiceName), sizeof(uint16_t), CH_UTF16));
2465                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DisplayName));
2466                 if (_ptr_DisplayName) {
2467                         NDR_PULL_ALLOC(ndr, r->in.DisplayName);
2468                 } else {
2469                         r->in.DisplayName = NULL;
2470                 }
2471                 if (r->in.DisplayName) {
2472                         _mem_save_DisplayName_0 = NDR_PULL_GET_MEM_CTX(ndr);
2473                         NDR_PULL_SET_MEM_CTX(ndr, r->in.DisplayName, 0);
2474                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.DisplayName));
2475                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.DisplayName));
2476                         if (ndr_get_array_length(ndr, &r->in.DisplayName) > ndr_get_array_size(ndr, &r->in.DisplayName)) {
2477                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.DisplayName), ndr_get_array_length(ndr, &r->in.DisplayName));
2478                         }
2479                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t)));
2480                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.DisplayName, ndr_get_array_length(ndr, &r->in.DisplayName), sizeof(uint16_t), CH_UTF16));
2481                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DisplayName_0, 0);
2482                 }
2483                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.desired_access));
2484                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2485                 NDR_CHECK(ndr_pull_svcctl_StartType(ndr, NDR_SCALARS, &r->in.start_type));
2486                 NDR_CHECK(ndr_pull_svcctl_ErrorControl(ndr, NDR_SCALARS, &r->in.error_control));
2487                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.binary_path));
2488                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.binary_path));
2489                 if (ndr_get_array_length(ndr, &r->in.binary_path) > ndr_get_array_size(ndr, &r->in.binary_path)) {
2490                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.binary_path), ndr_get_array_length(ndr, &r->in.binary_path));
2491                 }
2492                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t)));
2493                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.binary_path, ndr_get_array_length(ndr, &r->in.binary_path), sizeof(uint16_t), CH_UTF16));
2494                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LoadOrderGroupKey));
2495                 if (_ptr_LoadOrderGroupKey) {
2496                         NDR_PULL_ALLOC(ndr, r->in.LoadOrderGroupKey);
2497                 } else {
2498                         r->in.LoadOrderGroupKey = NULL;
2499                 }
2500                 if (r->in.LoadOrderGroupKey) {
2501                         _mem_save_LoadOrderGroupKey_0 = NDR_PULL_GET_MEM_CTX(ndr);
2502                         NDR_PULL_SET_MEM_CTX(ndr, r->in.LoadOrderGroupKey, 0);
2503                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.LoadOrderGroupKey));
2504                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.LoadOrderGroupKey));
2505                         if (ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey) > ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey)) {
2506                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.LoadOrderGroupKey), ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey));
2507                         }
2508                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t)));
2509                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.LoadOrderGroupKey, ndr_get_array_length(ndr, &r->in.LoadOrderGroupKey), sizeof(uint16_t), CH_UTF16));
2510                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LoadOrderGroupKey_0, 0);
2511                 }
2512                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId));
2513                 if (_ptr_TagId) {
2514                         NDR_PULL_ALLOC(ndr, r->in.TagId);
2515                 } else {
2516                         r->in.TagId = NULL;
2517                 }
2518                 if (r->in.TagId) {
2519                         _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr);
2520                         NDR_PULL_SET_MEM_CTX(ndr, r->in.TagId, 0);
2521                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.TagId));
2522                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0);
2523                 }
2524                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependencies));
2525                 if (_ptr_dependencies) {
2526                         NDR_PULL_ALLOC(ndr, r->in.dependencies);
2527                 } else {
2528                         r->in.dependencies = NULL;
2529                 }
2530                 if (r->in.dependencies) {
2531                         _mem_save_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
2532                         NDR_PULL_SET_MEM_CTX(ndr, r->in.dependencies, 0);
2533                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dependencies));
2534                         NDR_PULL_ALLOC_N(ndr, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies));
2535                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.dependencies, ndr_get_array_size(ndr, &r->in.dependencies)));
2536                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependencies_0, 0);
2537                 }
2538                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dependencies_size));
2539                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_service_start_name));
2540                 if (_ptr_service_start_name) {
2541                         NDR_PULL_ALLOC(ndr, r->in.service_start_name);
2542                 } else {
2543                         r->in.service_start_name = NULL;
2544                 }
2545                 if (r->in.service_start_name) {
2546                         _mem_save_service_start_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
2547                         NDR_PULL_SET_MEM_CTX(ndr, r->in.service_start_name, 0);
2548                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.service_start_name));
2549                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.service_start_name));
2550                         if (ndr_get_array_length(ndr, &r->in.service_start_name) > ndr_get_array_size(ndr, &r->in.service_start_name)) {
2551                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.service_start_name), ndr_get_array_length(ndr, &r->in.service_start_name));
2552                         }
2553                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t)));
2554                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.service_start_name, ndr_get_array_length(ndr, &r->in.service_start_name), sizeof(uint16_t), CH_UTF16));
2555                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_start_name_0, 0);
2556                 }
2557                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_password));
2558                 if (_ptr_password) {
2559                         NDR_PULL_ALLOC(ndr, r->in.password);
2560                 } else {
2561                         r->in.password = NULL;
2562                 }
2563                 if (r->in.password) {
2564                         _mem_save_password_0 = NDR_PULL_GET_MEM_CTX(ndr);
2565                         NDR_PULL_SET_MEM_CTX(ndr, r->in.password, 0);
2566                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.password));
2567                         NDR_PULL_ALLOC_N(ndr, r->in.password, ndr_get_array_size(ndr, &r->in.password));
2568                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.password, ndr_get_array_size(ndr, &r->in.password)));
2569                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_password_0, 0);
2570                 }
2571                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.password_size));
2572                 NDR_PULL_ALLOC(ndr, r->out.handle);
2573                 ZERO_STRUCTP(r->out.handle);
2574                 if (r->in.dependencies) {
2575                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.dependencies, r->in.dependencies_size));
2576                 }
2577                 if (r->in.password) {
2578                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.password, r->in.password_size));
2579                 }
2580         }
2581         if (flags & NDR_OUT) {
2582                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TagId));
2583                 if (_ptr_TagId) {
2584                         NDR_PULL_ALLOC(ndr, r->out.TagId);
2585                 } else {
2586                         r->out.TagId = NULL;
2587                 }
2588                 if (r->out.TagId) {
2589                         _mem_save_TagId_0 = NDR_PULL_GET_MEM_CTX(ndr);
2590                         NDR_PULL_SET_MEM_CTX(ndr, r->out.TagId, 0);
2591                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.TagId));
2592                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TagId_0, 0);
2593                 }
2594                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2595                         NDR_PULL_ALLOC(ndr, r->out.handle);
2596                 }
2597                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2598                 NDR_PULL_SET_MEM_CTX(ndr, r->out.handle, LIBNDR_FLAG_REF_ALLOC);
2599                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.handle));
2600                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2601                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2602         }
2603         return NDR_ERR_SUCCESS;
2604 }
2605
2606 _PUBLIC_ void ndr_print_svcctl_CreateServiceW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CreateServiceW *r)
2607 {
2608         ndr_print_struct(ndr, name, "svcctl_CreateServiceW");
2609         ndr->depth++;
2610         if (flags & NDR_SET_VALUES) {
2611                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2612         }
2613         if (flags & NDR_IN) {
2614                 ndr_print_struct(ndr, "in", "svcctl_CreateServiceW");
2615                 ndr->depth++;
2616                 ndr_print_ptr(ndr, "scmanager_handle", r->in.scmanager_handle);
2617                 ndr->depth++;
2618                 ndr_print_policy_handle(ndr, "scmanager_handle", r->in.scmanager_handle);
2619                 ndr->depth--;
2620                 ndr_print_string(ndr, "ServiceName", r->in.ServiceName);
2621                 ndr_print_ptr(ndr, "DisplayName", r->in.DisplayName);
2622                 ndr->depth++;
2623                 if (r->in.DisplayName) {
2624                         ndr_print_string(ndr, "DisplayName", r->in.DisplayName);
2625                 }
2626                 ndr->depth--;
2627                 ndr_print_uint32(ndr, "desired_access", r->in.desired_access);
2628                 ndr_print_uint32(ndr, "type", r->in.type);
2629                 ndr_print_svcctl_StartType(ndr, "start_type", r->in.start_type);
2630                 ndr_print_svcctl_ErrorControl(ndr, "error_control", r->in.error_control);
2631                 ndr_print_string(ndr, "binary_path", r->in.binary_path);
2632                 ndr_print_ptr(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
2633                 ndr->depth++;
2634                 if (r->in.LoadOrderGroupKey) {
2635                         ndr_print_string(ndr, "LoadOrderGroupKey", r->in.LoadOrderGroupKey);
2636                 }
2637                 ndr->depth--;
2638                 ndr_print_ptr(ndr, "TagId", r->in.TagId);
2639                 ndr->depth++;
2640                 if (r->in.TagId) {
2641                         ndr_print_uint32(ndr, "TagId", *r->in.TagId);
2642                 }
2643                 ndr->depth--;
2644                 ndr_print_ptr(ndr, "dependencies", r->in.dependencies);
2645                 ndr->depth++;
2646                 if (r->in.dependencies) {
2647                         ndr_print_array_uint8(ndr, "dependencies", r->in.dependencies, r->in.dependencies_size);
2648                 }
2649                 ndr->depth--;
2650                 ndr_print_uint32(ndr, "dependencies_size", r->in.dependencies_size);
2651                 ndr_print_ptr(ndr, "service_start_name", r->in.service_start_name);
2652                 ndr->depth++;
2653                 if (r->in.service_start_name) {
2654                         ndr_print_string(ndr, "service_start_name", r->in.service_start_name);
2655                 }
2656                 ndr->depth--;
2657                 ndr_print_ptr(ndr, "password", r->in.password);
2658                 ndr->depth++;
2659                 if (r->in.password) {
2660                         ndr_print_array_uint8(ndr, "password", r->in.password, r->in.password_size);
2661                 }
2662                 ndr->depth--;
2663                 ndr_print_uint32(ndr, "password_size", r->in.password_size);
2664                 ndr->depth--;
2665         }
2666         if (flags & NDR_OUT) {
2667                 ndr_print_struct(ndr, "out", "svcctl_CreateServiceW");
2668                 ndr->depth++;
2669                 ndr_print_ptr(ndr, "TagId", r->out.TagId);
2670                 ndr->depth++;
2671                 if (r->out.TagId) {
2672                         ndr_print_uint32(ndr, "TagId", *r->out.TagId);
2673                 }
2674                 ndr->depth--;
2675                 ndr_print_ptr(ndr, "handle", r->out.handle);
2676                 ndr->depth++;
2677                 ndr_print_policy_handle(ndr, "handle", r->out.handle);
2678                 ndr->depth--;
2679                 ndr_print_WERROR(ndr, "result", r->out.result);
2680                 ndr->depth--;
2681         }
2682         ndr->depth--;
2683 }
2684
2685 static enum ndr_err_code ndr_push_svcctl_EnumDependentServicesW(struct ndr_push *ndr, int flags, const struct svcctl_EnumDependentServicesW *r)
2686 {
2687         if (flags & NDR_IN) {
2688                 if (r->in.service == NULL) {
2689                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2690                 }
2691                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.service));
2692                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.state));
2693                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2694         }
2695         if (flags & NDR_OUT) {
2696                 if (r->out.service_status == NULL) {
2697                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2698                 }
2699                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2700                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service_status, r->in.offered));
2701                 if (r->out.needed == NULL) {
2702                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2703                 }
2704                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
2705                 if (r->out.services_returned == NULL) {
2706                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2707                 }
2708                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
2709                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2710         }
2711         return NDR_ERR_SUCCESS;
2712 }
2713
2714 static enum ndr_err_code ndr_pull_svcctl_EnumDependentServicesW(struct ndr_pull *ndr, int flags, struct svcctl_EnumDependentServicesW *r)
2715 {
2716         TALLOC_CTX *_mem_save_service_0;
2717         TALLOC_CTX *_mem_save_needed_0;
2718         TALLOC_CTX *_mem_save_services_returned_0;
2719         if (flags & NDR_IN) {
2720                 ZERO_STRUCT(r->out);
2721
2722                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2723                         NDR_PULL_ALLOC(ndr, r->in.service);
2724                 }
2725                 _mem_save_service_0 = NDR_PULL_GET_MEM_CTX(ndr);
2726                 NDR_PULL_SET_MEM_CTX(ndr, r->in.service, LIBNDR_FLAG_REF_ALLOC);
2727                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.service));
2728                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_service_0, LIBNDR_FLAG_REF_ALLOC);
2729                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.state));
2730                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
2731                 if (r->in.offered > 0x40000) {
2732                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2733                 }
2734                 NDR_PULL_ALLOC_N(ndr, r->out.service_status, r->in.offered);
2735                 memset(r->out.service_status, 0, (r->in.offered) * sizeof(*r->out.service_status));
2736                 NDR_PULL_ALLOC(ndr, r->out.needed);
2737                 ZERO_STRUCTP(r->out.needed);
2738                 NDR_PULL_ALLOC(ndr, r->out.services_returned);
2739                 ZERO_STRUCTP(r->out.services_returned);
2740         }
2741         if (flags & NDR_OUT) {
2742                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service_status));
2743                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2744                         NDR_PULL_ALLOC_N(ndr, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status));
2745                 }
2746                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service_status, ndr_get_array_size(ndr, &r->out.service_status)));
2747                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2748                         NDR_PULL_ALLOC(ndr, r->out.needed);
2749                 }
2750                 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
2751                 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
2752                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
2753                 if (*r->out.needed > 0x40000) {
2754                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2755                 }
2756                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
2757                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2758                         NDR_PULL_ALLOC(ndr, r->out.services_returned);
2759                 }
2760                 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
2761                 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
2762                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
2763                 if (*r->out.services_returned > 0x40000) {
2764                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2765                 }
2766                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
2767                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
2768                 if (r->out.service_status) {
2769                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.service_status, r->in.offered));
2770                 }
2771         }
2772         return NDR_ERR_SUCCESS;
2773 }
2774
2775 _PUBLIC_ void ndr_print_svcctl_EnumDependentServicesW(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_EnumDependentServicesW *r)
2776 {
2777         ndr_print_struct(ndr, name, "svcctl_EnumDependentServicesW");
2778         ndr->depth++;
2779         if (flags & NDR_SET_VALUES) {
2780                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
2781         }
2782         if (flags & NDR_IN) {
2783                 ndr_print_struct(ndr, "in", "svcctl_EnumDependentServicesW");
2784                 ndr->depth++;
2785                 ndr_print_ptr(ndr, "service", r->in.service);
2786                 ndr->depth++;
2787                 ndr_print_policy_handle(ndr, "service", r->in.service);
2788                 ndr->depth--;
2789                 ndr_print_uint32(ndr, "state", r->in.state);
2790                 ndr_print_uint32(ndr, "offered", r->in.offered);
2791                 ndr->depth--;
2792         }
2793         if (flags & NDR_OUT) {
2794                 ndr_print_struct(ndr, "out", "svcctl_EnumDependentServicesW");
2795                 ndr->depth++;
2796                 ndr_print_ptr(ndr, "service_status", r->out.service_status);
2797                 ndr->depth++;
2798                 ndr_print_array_uint8(ndr, "service_status", r->out.service_status, r->in.offered);
2799                 ndr->depth--;
2800                 ndr_print_ptr(ndr, "needed", r->out.needed);
2801                 ndr->depth++;
2802                 ndr_print_uint32(ndr, "needed", *r->out.needed);
2803                 ndr->depth--;
2804                 ndr_print_ptr(ndr, "services_returned", r->out.services_returned);
2805                 ndr->depth++;
2806                 ndr_print_uint32(ndr, "services_returned", *r->out.services_returned);
2807                 ndr->depth--;
2808                 ndr_print_WERROR(ndr, "result", r->out.result);
2809                 ndr->depth--;
2810         }
2811         ndr->depth--;
2812 }
2813
2814 static enum ndr_err_code ndr_push_svcctl_EnumServicesStatusW(struct ndr_push *ndr, int flags, const struct svcctl_EnumServicesStatusW *r)
2815 {
2816         if (flags & NDR_IN) {
2817                 if (r->in.handle == NULL) {
2818                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2819                 }
2820                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2821                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type));
2822                 NDR_CHECK(ndr_push_svcctl_ServiceState(ndr, NDR_SCALARS, r->in.state));
2823                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2824                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.resume_handle));
2825                 if (r->in.resume_handle) {
2826                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.resume_handle));
2827                 }
2828         }
2829         if (flags & NDR_OUT) {
2830                 if (r->out.service == NULL) {
2831                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2832                 }
2833                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
2834                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.service, r->in.offered));
2835                 if (r->out.needed == NULL) {
2836                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2837                 }
2838                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed));
2839                 if (r->out.services_returned == NULL) {
2840                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
2841                 }
2842                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.services_returned));
2843                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.resume_handle));
2844                 if (r->out.resume_handle) {
2845                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.resume_handle));
2846                 }
2847                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
2848         }
2849         return NDR_ERR_SUCCESS;
2850 }
2851
2852 static enum ndr_err_code ndr_pull_svcctl_EnumServicesStatusW(struct ndr_pull *ndr, int flags, struct svcctl_EnumServicesStatusW *r)
2853 {
2854         uint32_t _ptr_resume_handle;
2855         TALLOC_CTX *_mem_save_handle_0;
2856         TALLOC_CTX *_mem_save_needed_0;
2857         TALLOC_CTX *_mem_save_services_returned_0;
2858         TALLOC_CTX *_mem_save_resume_handle_0;
2859         if (flags & NDR_IN) {
2860                 ZERO_STRUCT(r->out);
2861
2862                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2863                         NDR_PULL_ALLOC(ndr, r->in.handle);
2864                 }
2865                 _mem_save_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2866                 NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
2867                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
2868                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
2869                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type));
2870                 NDR_CHECK(ndr_pull_svcctl_ServiceState(ndr, NDR_SCALARS, &r->in.state));
2871                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
2872                 if (r->in.offered > 0x40000) {
2873                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2874                 }
2875                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
2876                 if (_ptr_resume_handle) {
2877                         NDR_PULL_ALLOC(ndr, r->in.resume_handle);
2878                 } else {
2879                         r->in.resume_handle = NULL;
2880                 }
2881                 if (r->in.resume_handle) {
2882                         _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2883                         NDR_PULL_SET_MEM_CTX(ndr, r->in.resume_handle, 0);
2884                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.resume_handle));
2885                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);
2886                 }
2887                 NDR_PULL_ALLOC_N(ndr, r->out.service, r->in.offered);
2888                 memset(r->out.service, 0, (r->in.offered) * sizeof(*r->out.service));
2889                 NDR_PULL_ALLOC(ndr, r->out.needed);
2890                 ZERO_STRUCTP(r->out.needed);
2891                 NDR_PULL_ALLOC(ndr, r->out.services_returned);
2892                 ZERO_STRUCTP(r->out.services_returned);
2893         }
2894         if (flags & NDR_OUT) {
2895                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.service));
2896                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2897                         NDR_PULL_ALLOC_N(ndr, r->out.service, ndr_get_array_size(ndr, &r->out.service));
2898                 }
2899                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.service, ndr_get_array_size(ndr, &r->out.service)));
2900                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2901                         NDR_PULL_ALLOC(ndr, r->out.needed);
2902                 }
2903                 _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr);
2904                 NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC);
2905                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
2906                 if (*r->out.needed > 0x40000) {
2907                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2908                 }
2909                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
2910                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
2911                         NDR_PULL_ALLOC(ndr, r->out.services_returned);
2912                 }
2913                 _mem_save_services_returned_0 = NDR_PULL_GET_MEM_CTX(ndr);
2914                 NDR_PULL_SET_MEM_CTX(ndr, r->out.services_returned, LIBNDR_FLAG_REF_ALLOC);
2915                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.services_returned));
2916                 if (*r->out.services_returned > 0x40000) {
2917                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
2918                 }
2919                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_services_returned_0, LIBNDR_FLAG_REF_ALLOC);
2920                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_resume_handle));
2921                 if (_ptr_resume_handle) {
2922                         NDR_PULL_ALLOC(ndr, r->out.resume_handle);
2923                 } else {
2924                         r->out.resume_handle = NULL;
2925                 }
2926                 if (r->out.resume_handle) {
2927                         _mem_save_resume_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
2928                         NDR_PULL_SET_MEM_CTX(ndr, r->out.resume_handle, 0);
2929                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.resume_handle));
2930                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_resume_handle_0, 0);</