1 /* parser auto-generated by pidl */
4 #include "librpc/gen_ndr/ndr_unixinfo.h"
6 #include "librpc/gen_ndr/ndr_security.h"
7 NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
9 if (ndr_flags & NDR_SCALARS) {
10 NDR_CHECK(ndr_push_align(ndr, 4));
11 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
13 uint32_t _flags_save_string = ndr->flags;
14 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
15 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->homedir));
16 ndr->flags = _flags_save_string;
19 uint32_t _flags_save_string = ndr->flags;
20 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
21 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->shell));
22 ndr->flags = _flags_save_string;
25 if (ndr_flags & NDR_BUFFERS) {
30 NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
32 if (ndr_flags & NDR_SCALARS) {
33 NDR_CHECK(ndr_pull_align(ndr, 4));
34 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
36 uint32_t _flags_save_string = ndr->flags;
37 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
38 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->homedir));
39 ndr->flags = _flags_save_string;
42 uint32_t _flags_save_string = ndr->flags;
43 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_UTF8|LIBNDR_FLAG_STR_NULLTERM);
44 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->shell));
45 ndr->flags = _flags_save_string;
48 if (ndr_flags & NDR_BUFFERS) {
53 _PUBLIC_ void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r)
55 ndr_print_struct(ndr, name, "unixinfo_GetPWUidInfo");
57 ndr_print_NTSTATUS(ndr, "status", r->status);
58 ndr_print_string(ndr, "homedir", r->homedir);
59 ndr_print_string(ndr, "shell", r->shell);
63 NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r)
66 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
68 if (flags & NDR_OUT) {
69 if (r->out.uid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
70 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.uid));
71 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
76 NTSTATUS ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r)
78 TALLOC_CTX *_mem_save_uid_0;
82 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
83 NDR_PULL_ALLOC(ndr, r->out.uid);
84 ZERO_STRUCTP(r->out.uid);
86 if (flags & NDR_OUT) {
87 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
88 NDR_PULL_ALLOC(ndr, r->out.uid);
90 _mem_save_uid_0 = NDR_PULL_GET_MEM_CTX(ndr);
91 NDR_PULL_SET_MEM_CTX(ndr, r->out.uid, LIBNDR_FLAG_REF_ALLOC);
92 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.uid));
93 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uid_0, LIBNDR_FLAG_REF_ALLOC);
94 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
99 _PUBLIC_ void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r)
101 ndr_print_struct(ndr, name, "unixinfo_SidToUid");
103 if (flags & NDR_SET_VALUES) {
104 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
106 if (flags & NDR_IN) {
107 ndr_print_struct(ndr, "in", "unixinfo_SidToUid");
109 ndr_print_dom_sid(ndr, "sid", &r->in.sid);
112 if (flags & NDR_OUT) {
113 ndr_print_struct(ndr, "out", "unixinfo_SidToUid");
115 ndr_print_ptr(ndr, "uid", r->out.uid);
117 ndr_print_hyper(ndr, "uid", *r->out.uid);
119 ndr_print_NTSTATUS(ndr, "result", r->out.result);
125 NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r)
127 if (flags & NDR_IN) {
128 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uid));
130 if (flags & NDR_OUT) {
131 if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
132 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
133 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
138 NTSTATUS ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r)
140 TALLOC_CTX *_mem_save_sid_0;
141 if (flags & NDR_IN) {
144 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uid));
145 NDR_PULL_ALLOC(ndr, r->out.sid);
146 ZERO_STRUCTP(r->out.sid);
148 if (flags & NDR_OUT) {
149 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
150 NDR_PULL_ALLOC(ndr, r->out.sid);
152 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
153 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
154 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
155 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
156 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
161 _PUBLIC_ void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r)
163 ndr_print_struct(ndr, name, "unixinfo_UidToSid");
165 if (flags & NDR_SET_VALUES) {
166 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
168 if (flags & NDR_IN) {
169 ndr_print_struct(ndr, "in", "unixinfo_UidToSid");
171 ndr_print_hyper(ndr, "uid", r->in.uid);
174 if (flags & NDR_OUT) {
175 ndr_print_struct(ndr, "out", "unixinfo_UidToSid");
177 ndr_print_ptr(ndr, "sid", r->out.sid);
179 ndr_print_dom_sid(ndr, "sid", r->out.sid);
181 ndr_print_NTSTATUS(ndr, "result", r->out.result);
187 NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r)
189 if (flags & NDR_IN) {
190 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
192 if (flags & NDR_OUT) {
193 if (r->out.gid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
194 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->out.gid));
195 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
200 NTSTATUS ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r)
202 TALLOC_CTX *_mem_save_gid_0;
203 if (flags & NDR_IN) {
206 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.sid));
207 NDR_PULL_ALLOC(ndr, r->out.gid);
208 ZERO_STRUCTP(r->out.gid);
210 if (flags & NDR_OUT) {
211 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
212 NDR_PULL_ALLOC(ndr, r->out.gid);
214 _mem_save_gid_0 = NDR_PULL_GET_MEM_CTX(ndr);
215 NDR_PULL_SET_MEM_CTX(ndr, r->out.gid, LIBNDR_FLAG_REF_ALLOC);
216 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->out.gid));
217 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gid_0, LIBNDR_FLAG_REF_ALLOC);
218 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
223 _PUBLIC_ void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r)
225 ndr_print_struct(ndr, name, "unixinfo_SidToGid");
227 if (flags & NDR_SET_VALUES) {
228 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
230 if (flags & NDR_IN) {
231 ndr_print_struct(ndr, "in", "unixinfo_SidToGid");
233 ndr_print_dom_sid(ndr, "sid", &r->in.sid);
236 if (flags & NDR_OUT) {
237 ndr_print_struct(ndr, "out", "unixinfo_SidToGid");
239 ndr_print_ptr(ndr, "gid", r->out.gid);
241 ndr_print_hyper(ndr, "gid", *r->out.gid);
243 ndr_print_NTSTATUS(ndr, "result", r->out.result);
249 NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r)
251 if (flags & NDR_IN) {
252 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.gid));
254 if (flags & NDR_OUT) {
255 if (r->out.sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
256 NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
257 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
262 NTSTATUS ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r)
264 TALLOC_CTX *_mem_save_sid_0;
265 if (flags & NDR_IN) {
268 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.gid));
269 NDR_PULL_ALLOC(ndr, r->out.sid);
270 ZERO_STRUCTP(r->out.sid);
272 if (flags & NDR_OUT) {
273 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
274 NDR_PULL_ALLOC(ndr, r->out.sid);
276 _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
277 NDR_PULL_SET_MEM_CTX(ndr, r->out.sid, LIBNDR_FLAG_REF_ALLOC);
278 NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sid));
279 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
280 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
285 _PUBLIC_ void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r)
287 ndr_print_struct(ndr, name, "unixinfo_GidToSid");
289 if (flags & NDR_SET_VALUES) {
290 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
292 if (flags & NDR_IN) {
293 ndr_print_struct(ndr, "in", "unixinfo_GidToSid");
295 ndr_print_hyper(ndr, "gid", r->in.gid);
298 if (flags & NDR_OUT) {
299 ndr_print_struct(ndr, "out", "unixinfo_GidToSid");
301 ndr_print_ptr(ndr, "sid", r->out.sid);
303 ndr_print_dom_sid(ndr, "sid", r->out.sid);
305 ndr_print_NTSTATUS(ndr, "result", r->out.result);
311 NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r)
313 uint32_t cntr_uids_0;
314 uint32_t cntr_infos_0;
315 if (flags & NDR_IN) {
316 if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
317 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
318 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.count));
319 for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
320 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->in.uids[cntr_uids_0]));
323 if (flags & NDR_OUT) {
324 if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
325 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
326 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count));
327 for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) {
328 NDR_CHECK(ndr_push_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
330 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
335 NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r)
337 uint32_t cntr_uids_0;
338 uint32_t cntr_infos_0;
339 TALLOC_CTX *_mem_save_count_0;
340 TALLOC_CTX *_mem_save_uids_0;
341 TALLOC_CTX *_mem_save_infos_0;
342 if (flags & NDR_IN) {
345 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
346 NDR_PULL_ALLOC(ndr, r->in.count);
348 _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
349 NDR_PULL_SET_MEM_CTX(ndr, r->in.count, LIBNDR_FLAG_REF_ALLOC);
350 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.count));
351 if (*r->in.count < 0 || *r->in.count > 1023) {
352 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
354 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
355 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.uids));
356 NDR_PULL_ALLOC_N(ndr, r->in.uids, ndr_get_array_size(ndr, &r->in.uids));
357 _mem_save_uids_0 = NDR_PULL_GET_MEM_CTX(ndr);
358 NDR_PULL_SET_MEM_CTX(ndr, r->in.uids, 0);
359 for (cntr_uids_0 = 0; cntr_uids_0 < *r->in.count; cntr_uids_0++) {
360 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->in.uids[cntr_uids_0]));
362 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_uids_0, 0);
363 NDR_PULL_ALLOC(ndr, r->out.count);
364 *r->out.count = *r->in.count;
366 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
369 if (flags & NDR_OUT) {
370 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
371 NDR_PULL_ALLOC(ndr, r->out.count);
373 _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr);
374 NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC);
375 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count));
376 if (*r->out.count < 0 || *r->out.count > 1023) {
377 return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
379 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC);
380 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.infos));
381 NDR_PULL_ALLOC_N(ndr, r->out.infos, ndr_get_array_size(ndr, &r->out.infos));
382 _mem_save_infos_0 = NDR_PULL_GET_MEM_CTX(ndr);
383 NDR_PULL_SET_MEM_CTX(ndr, r->out.infos, 0);
384 for (cntr_infos_0 = 0; cntr_infos_0 < *r->out.count; cntr_infos_0++) {
385 NDR_CHECK(ndr_pull_unixinfo_GetPWUidInfo(ndr, NDR_SCALARS, &r->out.infos[cntr_infos_0]));
387 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_0, 0);
388 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
390 NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
396 _PUBLIC_ void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r)
398 uint32_t cntr_uids_0;
399 uint32_t cntr_infos_0;
400 ndr_print_struct(ndr, name, "unixinfo_GetPWUid");
402 if (flags & NDR_SET_VALUES) {
403 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
405 if (flags & NDR_IN) {
406 ndr_print_struct(ndr, "in", "unixinfo_GetPWUid");
408 ndr_print_ptr(ndr, "count", r->in.count);
410 ndr_print_uint32(ndr, "count", *r->in.count);
412 ndr->print(ndr, "%s: ARRAY(%d)", "uids", *r->in.count);
414 for (cntr_uids_0=0;cntr_uids_0<*r->in.count;cntr_uids_0++) {
416 asprintf(&idx_0, "[%d]", cntr_uids_0);
418 ndr_print_hyper(ndr, "uids", r->in.uids[cntr_uids_0]);
425 if (flags & NDR_OUT) {
426 ndr_print_struct(ndr, "out", "unixinfo_GetPWUid");
428 ndr_print_ptr(ndr, "count", r->out.count);
430 ndr_print_uint32(ndr, "count", *r->out.count);
432 ndr->print(ndr, "%s: ARRAY(%d)", "infos", *r->out.count);
434 for (cntr_infos_0=0;cntr_infos_0<*r->out.count;cntr_infos_0++) {
436 asprintf(&idx_0, "[%d]", cntr_infos_0);
438 ndr_print_unixinfo_GetPWUidInfo(ndr, "infos", &r->out.infos[cntr_infos_0]);
443 ndr_print_NTSTATUS(ndr, "result", r->out.result);
449 const struct ndr_interface_call unixinfo_calls[] = {
452 sizeof(struct unixinfo_SidToUid),
453 (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToUid,
454 (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToUid,
455 (ndr_print_function_t) ndr_print_unixinfo_SidToUid,
460 sizeof(struct unixinfo_UidToSid),
461 (ndr_push_flags_fn_t) ndr_push_unixinfo_UidToSid,
462 (ndr_pull_flags_fn_t) ndr_pull_unixinfo_UidToSid,
463 (ndr_print_function_t) ndr_print_unixinfo_UidToSid,
468 sizeof(struct unixinfo_SidToGid),
469 (ndr_push_flags_fn_t) ndr_push_unixinfo_SidToGid,
470 (ndr_pull_flags_fn_t) ndr_pull_unixinfo_SidToGid,
471 (ndr_print_function_t) ndr_print_unixinfo_SidToGid,
476 sizeof(struct unixinfo_GidToSid),
477 (ndr_push_flags_fn_t) ndr_push_unixinfo_GidToSid,
478 (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GidToSid,
479 (ndr_print_function_t) ndr_print_unixinfo_GidToSid,
484 sizeof(struct unixinfo_GetPWUid),
485 (ndr_push_flags_fn_t) ndr_push_unixinfo_GetPWUid,
486 (ndr_pull_flags_fn_t) ndr_pull_unixinfo_GetPWUid,
487 (ndr_print_function_t) ndr_print_unixinfo_GetPWUid,
490 { NULL, 0, NULL, NULL, NULL, False }
493 const char * const unixinfo_endpoint_strings[] = {
494 "ncacn_np:[\\pipe\\unixinfo]",
499 const struct ndr_interface_string_array unixinfo_endpoints = {
501 .names = unixinfo_endpoint_strings
504 const char * const unixinfo_authservice_strings[] = {
508 const struct ndr_interface_string_array unixinfo_authservices = {
510 .names = unixinfo_authservice_strings
514 const struct ndr_interface_table dcerpc_table_unixinfo = {
517 {0x9c54e310,0xa955,0x4885,{0xbd,0x31},{0x78,0x78,0x71,0x47,0xdf,0xa6}},
518 DCERPC_UNIXINFO_VERSION
520 .helpstring = DCERPC_UNIXINFO_HELPSTRING,
522 .calls = unixinfo_calls,
523 .endpoints = &unixinfo_endpoints,
524 .authservices = &unixinfo_authservices