r18193: Not quite to autogenerated NDR but closer thanks to Jelmer's
[sfrench/samba-autobuild/.git] / source / librpc / gen_ndr / ndr_unixinfo.c
1 /* parser auto-generated by pidl */
2
3 #ifndef _GNU_SOURCE
4 #define _GNU_SOURCE
5 #endif
6
7 #include <stdint.h>
8 #include <stdlib.h>
9 #include <stdio.h>
10 #include <stdbool.h>
11 #include <stdarg.h>
12 #include <string.h>
13 #include <core/nterr.h>
14 #include <ndr/ndr_misc.h>
15 #include <ndr/ndr_dcerpc.h>
16 #include "gen_ndr/ndr_unixinfo.h"
17 #include <dcerpc.h>
18
19 #include <ndr/ndr_security.h>
20 NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
21 {
22         if (ndr_flags & NDR_SCALARS) {
23                 NDR_CHECK(ndr_push_align(ndr, 4));
24                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
25                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->homedir));
26                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->shell));
27         }
28         if (ndr_flags & NDR_BUFFERS) {
29                 if (r->homedir) {
30                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
31                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
32                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->homedir, CH_UTF8)));
33                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->homedir, ndr_charset_length(r->homedir, CH_UTF8), sizeof(uint8_t), CH_UTF8));
34                 }
35                 if (r->shell) {
36                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
37                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
38                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->shell, CH_UTF8)));
39                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->shell, ndr_charset_length(r->shell, CH_UTF8), sizeof(uint8_t), CH_UTF8));
40                 }
41         }
42         return NT_STATUS_OK;
43 }
44
45 NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
46 {
47         uint32_t _ptr_homedir;
48         TALLOC_CTX *_mem_save_homedir_0;
49         uint32_t _ptr_shell;
50         TALLOC_CTX *_mem_save_shell_0;
51         if (ndr_flags & NDR_SCALARS) {
52                 NDR_CHECK(ndr_pull_align(ndr, 4));
53                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
54                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
55                 if (_ptr_homedir) {
56                         NDR_PULL_ALLOC(ndr, r->homedir);
57                 } else {
58                         r->homedir = NULL;
59                 }
60                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
61                 if (_ptr_shell) {
62                         NDR_PULL_ALLOC(ndr, r->shell);
63                 } else {
64                         r->shell = NULL;
65                 }
66         }
67         if (ndr_flags & NDR_BUFFERS) {
68                 if (r->homedir) {
69                         _mem_save_homedir_0 = NDR_PULL_GET_MEM_CTX(ndr);
70                         NDR_PULL_SET_MEM_CTX(ndr, r->homedir, 0);
71                         NDR_CHECK(ndr_pull_array_size(ndr, &r->homedir));
72                         NDR_CHECK(ndr_pull_array_length(ndr, &r->homedir));
73                         if (ndr_get_array_length(ndr, &r->homedir) > ndr_get_array_size(ndr, &r->homedir)) {
74                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->homedir), ndr_get_array_length(ndr, &r->homedir));
75                         }
76                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t)));
77                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->homedir, ndr_get_array_length(ndr, &r->homedir), sizeof(uint8_t), CH_UTF8));
78                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_homedir_0, 0);
79                 }
80                 if (r->shell) {
81                         _mem_save_shell_0 = NDR_PULL_GET_MEM_CTX(ndr);
82                         NDR_PULL_SET_MEM_CTX(ndr, r->shell, 0);
83                         NDR_CHECK(ndr_pull_array_size(ndr, &r->shell));
84                         NDR_CHECK(ndr_pull_array_length(ndr, &r->shell));
85                         if (ndr_get_array_length(ndr, &r->shell) > ndr_get_array_size(ndr, &r->shell)) {
86                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->shell), ndr_get_array_length(ndr, &r->shell));
87                         }
88                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t)));
89                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->shell, ndr_get_array_length(ndr, &r->shell), sizeof(uint8_t), CH_UTF8));
90                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_shell_0, 0);
91                 }
92         }
93         return NT_STATUS_OK;
94 }
95
96 void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r)
97 {
98         ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo");
99         ndr->depth++;
100         ndr_print_NTSTATUS(ndr, "status", r->status);
101         ndr_print_ptr(ndr, "homedir", r->homedir);
102         ndr->depth++;
103         if (r->homedir) {
104                 ndr_print_string(ndr, "homedir", r->homedir);
105         }
106         ndr->depth--;
107         ndr_print_ptr(ndr, "shell", r->shell);
108         ndr->depth++;
109         if (r->shell) {
110                 ndr_print_string(ndr, "shell", r->shell);
111         }
112         ndr->depth--;
113         ndr->depth--;
114 }
115
116 NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r)
117 {
118         if (flags & NDR_IN) {
119                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
120         }
121         if (flags & NDR_OUT) {
122                 if (r->out.uid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
123                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
124                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
125         }
126         return NT_STATUS_OK;
127 }
128
129 NTSTATUS ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r)
130 {
131         TALLOC_CTX *_mem_save_uid_0;
132         if (flags & NDR_IN) {
133                 ZERO_STRUCT(r->out);
134
135                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
136                 NDR_PULL_ALLOC(ndr, r->out.uid);
137                 ZERO_STRUCTP(r->out.uid);
138         }
139         if (flags & NDR_OUT) {
140                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
141                         NDR_PULL_ALLOC(ndr, r->out.uid);
142                 }
143                 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
144                 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
145                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
146                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
147                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
148         }
149         return NT_STATUS_OK;
150 }
151
152 void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r)
153 {
154         ndr_print_struct(ndr, name, "unixinfo_SidToUid");
155         ndr->depth++;
156         if (flags & NDR_SET_VALUES) {
157                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
158         }
159         if (flags & NDR_IN) {
160                 ndr_print_struct(ndr, "in", "unixinfo_SidToUid");
161                 ndr->depth++;
162                 ndr_print_dom_sid(ndr, "sid", &r->in.sid);
163                 ndr->depth--;
164         }
165         if (flags & NDR_OUT) {
166                 ndr_print_struct(ndr, "out", "unixinfo_SidToUid");
167                 ndr->depth++;
168                 ndr_print_ptr(ndr, "uid", r->out.uid);
169                 ndr->depth++;
170                 ndr_print_hyper(ndr, "uid", *r->out.uid);
171                 ndr->depth--;
172                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
173                 ndr->depth--;
174         }
175         ndr->depth--;
176 }
177
178 NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r)
179 {
180         if (flags & NDR_IN) {
181                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
182         }
183         if (flags & NDR_OUT) {
184                 if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
185                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
186                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
187         }
188         return NT_STATUS_OK;
189 }
190
191 NTSTATUS ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r)
192 {
193         TALLOC_CTX *_mem_save_sid_0;
194         if (flags & NDR_IN) {
195                 ZERO_STRUCT(r->out);
196
197                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
198                 NDR_PULL_ALLOC(ndr, r->out.sid);
199                 ZERO_STRUCTP(r->out.sid);
200         }
201         if (flags & NDR_OUT) {
202                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
203                         NDR_PULL_ALLOC(ndr, r->out.sid);
204                 }
205                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
206                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
207                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
208                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
209                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
210         }
211         return NT_STATUS_OK;
212 }
213
214 void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r)
215 {
216         ndr_print_struct(ndr, name, "unixinfo_UidToSid");
217         ndr->depth++;
218         if (flags & NDR_SET_VALUES) {
219                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
220         }
221         if (flags & NDR_IN) {
222                 ndr_print_struct(ndr, "in", "unixinfo_UidToSid");
223                 ndr->depth++;
224                 ndr_print_hyper(ndr, "uid", r->in.uid);
225                 ndr->depth--;
226         }
227         if (flags & NDR_OUT) {
228                 ndr_print_struct(ndr, "out", "unixinfo_UidToSid");
229                 ndr->depth++;
230                 ndr_print_ptr(ndr, "sid", r->out.sid);
231                 ndr->depth++;
232                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
233                 ndr->depth--;
234                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
235                 ndr->depth--;
236         }
237         ndr->depth--;
238 }
239
240 NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r)
241 {
242         if (flags & NDR_IN) {
243                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
244         }
245         if (flags & NDR_OUT) {
246                 if (r->out.gid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
247                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
248                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
249         }
250         return NT_STATUS_OK;
251 }
252
253 NTSTATUS ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r)
254 {
255         TALLOC_CTX *_mem_save_gid_0;
256         if (flags & NDR_IN) {
257                 ZERO_STRUCT(r->out);
258
259                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
260                 NDR_PULL_ALLOC(ndr, r->out.gid);
261                 ZERO_STRUCTP(r->out.gid);
262         }
263         if (flags & NDR_OUT) {
264                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
265                         NDR_PULL_ALLOC(ndr, r->out.gid);
266                 }
267                 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
268                 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
269                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
270                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
271                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
272         }
273         return NT_STATUS_OK;
274 }
275
276 void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r)
277 {
278         ndr_print_struct(ndr, name, "unixinfo_SidToGid");
279         ndr->depth++;
280         if (flags & NDR_SET_VALUES) {
281                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
282         }
283         if (flags & NDR_IN) {
284                 ndr_print_struct(ndr, "in", "unixinfo_SidToGid");
285                 ndr->depth++;
286                 ndr_print_dom_sid(ndr, "sid", &r->in.sid);
287                 ndr->depth--;
288         }
289         if (flags & NDR_OUT) {
290                 ndr_print_struct(ndr, "out", "unixinfo_SidToGid");
291                 ndr->depth++;
292                 ndr_print_ptr(ndr, "gid", r->out.gid);
293                 ndr->depth++;
294                 ndr_print_hyper(ndr, "gid", *r->out.gid);
295                 ndr->depth--;
296                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
297                 ndr->depth--;
298         }
299         ndr->depth--;
300 }
301
302 NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r)
303 {
304         if (flags & NDR_IN) {
305                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
306         }
307         if (flags & NDR_OUT) {
308                 if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
309                 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
310                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
311         }
312         return NT_STATUS_OK;
313 }
314
315 NTSTATUS ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r)
316 {
317         TALLOC_CTX *_mem_save_sid_0;
318         if (flags & NDR_IN) {
319                 ZERO_STRUCT(r->out);
320
321                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
322                 NDR_PULL_ALLOC(ndr, r->out.sid);
323                 ZERO_STRUCTP(r->out.sid);
324         }
325         if (flags & NDR_OUT) {
326                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
327                         NDR_PULL_ALLOC(ndr, r->out.sid);
328                 }
329                 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
330                 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
331                 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
332                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
333                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
334         }
335         return NT_STATUS_OK;
336 }
337
338 void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r)
339 {
340         ndr_print_struct(ndr, name, "unixinfo_GidToSid");
341         ndr->depth++;
342         if (flags & NDR_SET_VALUES) {
343                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
344         }
345         if (flags & NDR_IN) {
346                 ndr_print_struct(ndr, "in", "unixinfo_GidToSid");
347                 ndr->depth++;
348                 ndr_print_hyper(ndr, "gid", r->in.gid);
349                 ndr->depth--;
350         }
351         if (flags & NDR_OUT) {
352                 ndr_print_struct(ndr, "out", "unixinfo_GidToSid");
353                 ndr->depth++;
354                 ndr_print_ptr(ndr, "sid", r->out.sid);
355                 ndr->depth++;
356                 ndr_print_dom_sid(ndr, "sid", r->out.sid);
357                 ndr->depth--;
358                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
359                 ndr->depth--;
360         }
361         ndr->depth--;
362 }
363
364 NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r)
365 {
366         uint32_t cntr_uids_0;
367         uint32_t cntr_infos_1;
368         if (flags & NDR_IN) {
369                 if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
370                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
371                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
372                 for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
373                         NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0]));
374                 }
375         }
376         if (flags & NDR_OUT) {
377                 if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
378                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
379                 if (r->out.infos == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
380                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
381                 for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
382                         NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_1]));
383                 }
384                 for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
385                         NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_BUFFERS, &r->out.infos[cntr_infos_1]));
386                 }
387                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
388         }
389         return NT_STATUS_OK;
390 }
391
392 NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r)
393 {
394         uint32_t cntr_uids_0;
395         uint32_t cntr_infos_1;
396         TALLOC_CTX *_mem_save_count_0;
397         TALLOC_CTX *_mem_save_uids_0;
398         TALLOC_CTX *_mem_save_infos_1;
399         if (flags & NDR_IN) {
400                 ZERO_STRUCT(r->out);
401
402                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
403                         NDR_PULL_ALLOC(ndr, r->in.count);
404                 }
405                 _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
406                 NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
407                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
408                 if (*r->in.count < 0 || *r->in.count > 1023) {
409                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
410                 }
411                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
412                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids));
413                 NDR_PULL_ALLOC_N(ndr, r->in.uids, ndr_get_array_size(ndr, &r->in.uids));
414                 _mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr);
415                 NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0);
416                 for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
417                         NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0]));
418                 }
419                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0);
420                 NDR_PULL_ALLOC(ndr, r->out.count);
421                 *r->out.count = *r->in.count;
422                 if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
423                 NDR_PULL_ALLOC_N(ndr, r->out.infos, *r->in.count);
424                 memset(r->out.infos, 0, *r->in.count * sizeof(*r->out.infos));
425                 if (r->in.uids) {
426                         if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
427                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
428                 }
429         }
430         if (flags & NDR_OUT) {
431                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
432                         NDR_PULL_ALLOC(ndr, r->out.count);
433                 }
434                 _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
435                 NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
436                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
437                 if (*r->out.count < 0 || *r->out.count > 1023) {
438                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
439                 }
440                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
441                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos));
442                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
443                         NDR_PULL_ALLOC_N(ndr, r->out.infos, ndr_get_array_size(ndr, &r->out.infos));
444                 }
445                 _mem_save_infos_1 = NDR_PULL_GET_MEM_CTX(ndr);
446                 NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0);
447                 for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
448                         NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_1]));
449                 }
450                 for (cntr_infos_1 = 0; cntr_infos_1 < *r->out.count; cntr_infos_1++) {
451                         NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_BUFFERS, &r->out.infos[cntr_infos_1]));
452                 }
453                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_1, 0);
454                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
455                 if (r->out.infos) {
456                         if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
457                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
458                 }
459         }
460         return NT_STATUS_OK;
461 }
462
463 void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r)
464 {
465         uint32_t cntr_uids_0;
466         uint32_t cntr_infos_1;
467         ndr_print_struct(ndr, name, "unixinfo_GetPWUid");
468         ndr->depth++;
469         if (flags & NDR_SET_VALUES) {
470                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
471         }
472         if (flags & NDR_IN) {
473                 ndr_print_struct(ndr, "in", "unixinfo_GetPWUid");
474                 ndr->depth++;
475                 ndr_print_ptr(ndr, "count", r->in.count);
476                 ndr->depth++;
477                 ndr_print_uint32(ndr, "count", *r->in.count);
478                 ndr->depth--;
479                 ndr->print(ndr, "%s: ARRAY(%d)", "uids", *r->in.count);
480                 ndr->depth++;
481                 for (cntr_uids_0=0;cntr_uids_0<*r->in.count;cntr_uids_0++) {
482                         char *idx_0=NULL;
483                         asprintf(&idx_0, "[%d]", cntr_uids_0);
484                         if (idx_0) {
485                                 ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]);
486                                 free(idx_0);
487                         }
488                 }
489                 ndr->depth--;
490                 ndr->depth--;
491         }
492         if (flags & NDR_OUT) {
493                 ndr_print_struct(ndr, "out", "unixinfo_GetPWUid");
494                 ndr->depth++;
495                 ndr_print_ptr(ndr, "count", r->out.count);
496                 ndr->depth++;
497                 ndr_print_uint32(ndr, "count", *r->out.count);
498                 ndr->depth--;
499                 ndr_print_ptr(ndr, "infos", r->out.infos);
500                 ndr->depth++;
501                 ndr->print(ndr, "%s: ARRAY(%d)", "infos", *r->out.count);
502                 ndr->depth++;
503                 for (cntr_infos_1=0;cntr_infos_1<*r->out.count;cntr_infos_1++) {
504                         char *idx_1=NULL;
505                         asprintf(&idx_1, "[%d]", cntr_infos_1);
506                         if (idx_1) {
507                                 ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_1]);
508                                 free(idx_1);
509                         }
510                 }
511                 ndr->depth--;
512                 ndr->depth--;
513                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
514                 ndr->depth--;
515         }
516         ndr->depth--;
517 }
518
519