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