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