s3-lib: Remove obsolete signal type cast.
[Samba/nascimento.git] / librpc / gen_ndr / ndr_misc.c
blob1f4d0c91e8b5abbcf4fffd5345c3baf56646d31e
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_misc.h"
6 _PUBLIC_ enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r)
8 if (ndr_flags & NDR_SCALARS) {
9 NDR_CHECK(ndr_push_align(ndr, 4));
10 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low));
11 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid));
12 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version));
13 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2));
14 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6));
15 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
17 if (ndr_flags & NDR_BUFFERS) {
19 return NDR_ERR_SUCCESS;
22 _PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r)
24 if (ndr_flags & NDR_SCALARS) {
25 NDR_CHECK(ndr_pull_align(ndr, 4));
26 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low));
27 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid));
28 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version));
29 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2));
30 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6));
31 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
33 if (ndr_flags & NDR_BUFFERS) {
35 return NDR_ERR_SUCCESS;
38 _PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, struct smb_iconv_convenience *ic, int flags)
40 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID, ic);
43 _PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r)
45 if (ndr_flags & NDR_SCALARS) {
46 NDR_CHECK(ndr_push_align(ndr, 4));
47 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
48 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version));
49 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
51 if (ndr_flags & NDR_BUFFERS) {
53 return NDR_ERR_SUCCESS;
56 _PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r)
58 if (ndr_flags & NDR_SCALARS) {
59 NDR_CHECK(ndr_pull_align(ndr, 4));
60 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
61 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version));
62 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
64 if (ndr_flags & NDR_BUFFERS) {
66 return NDR_ERR_SUCCESS;
69 _PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r)
71 ndr_print_struct(ndr, name, "ndr_syntax_id");
72 ndr->depth++;
73 ndr_print_GUID(ndr, "uuid", &r->uuid);
74 ndr_print_uint32(ndr, "if_version", r->if_version);
75 ndr->depth--;
78 _PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r)
80 if (ndr_flags & NDR_SCALARS) {
81 NDR_CHECK(ndr_push_align(ndr, 4));
82 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type));
83 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
84 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
86 if (ndr_flags & NDR_BUFFERS) {
88 return NDR_ERR_SUCCESS;
91 _PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r)
93 if (ndr_flags & NDR_SCALARS) {
94 NDR_CHECK(ndr_pull_align(ndr, 4));
95 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type));
96 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
97 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
99 if (ndr_flags & NDR_BUFFERS) {
101 return NDR_ERR_SUCCESS;
104 _PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r)
106 ndr_print_struct(ndr, name, "policy_handle");
107 ndr->depth++;
108 ndr_print_uint32(ndr, "handle_type", r->handle_type);
109 ndr_print_GUID(ndr, "uuid", &r->uuid);
110 ndr->depth--;
113 _PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r)
115 NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
116 return NDR_ERR_SUCCESS;
119 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r)
121 uint16_t v;
122 NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
123 *r = v;
124 return NDR_ERR_SUCCESS;
127 _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r)
129 const char *val = NULL;
131 switch (r) {
132 case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break;
133 case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break;
134 case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break;
135 case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break;
136 case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break;
138 ndr_print_enum(ndr, name, "ENUM", val, r);
141 _PUBLIC_ enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r)
143 if (ndr_flags & NDR_SCALARS) {
144 NDR_CHECK(ndr_push_align(ndr, 4));
145 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->ntstatus));
146 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
147 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
148 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
150 if (ndr_flags & NDR_BUFFERS) {
152 return NDR_ERR_SUCCESS;
155 _PUBLIC_ enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r)
157 if (ndr_flags & NDR_SCALARS) {
158 NDR_CHECK(ndr_pull_align(ndr, 4));
159 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->ntstatus));
160 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
161 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
162 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
164 if (ndr_flags & NDR_BUFFERS) {
166 return NDR_ERR_SUCCESS;
169 _PUBLIC_ void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r)
171 ndr_print_struct(ndr, name, "KRB5_EDATA_NTSTATUS");
172 ndr->depth++;
173 ndr_print_NTSTATUS(ndr, "ntstatus", r->ntstatus);
174 ndr_print_uint32(ndr, "unknown1", r->unknown1);
175 ndr_print_uint32(ndr, "unknown2", r->unknown2);
176 ndr->depth--;
179 _PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
181 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
182 return NDR_ERR_SUCCESS;
185 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
187 uint32_t v;
188 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
189 *r = v;
190 return NDR_ERR_SUCCESS;
193 _PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r)
195 const char *val = NULL;
197 switch (r) {
198 case REG_NONE: val = "REG_NONE"; break;
199 case REG_SZ: val = "REG_SZ"; break;
200 case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break;
201 case REG_BINARY: val = "REG_BINARY"; break;
202 case REG_DWORD: val = "REG_DWORD"; break;
203 case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break;
204 case REG_LINK: val = "REG_LINK"; break;
205 case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break;
206 case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break;
207 case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break;
208 case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break;
209 case REG_QWORD: val = "REG_QWORD"; break;
211 ndr_print_enum(ndr, name, "ENUM", val, r);
214 _PUBLIC_ enum ndr_err_code ndr_push_winreg_Data(struct ndr_push *ndr, int ndr_flags, const union winreg_Data *r)
217 uint32_t _flags_save_UNION = ndr->flags;
218 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
219 if (ndr_flags & NDR_SCALARS) {
220 int level = ndr_push_get_switch_value(ndr, r);
221 NDR_CHECK(ndr_push_union_align(ndr, 4));
222 switch (level) {
223 case REG_NONE: {
224 break; }
226 case REG_SZ: {
228 uint32_t _flags_save_string = ndr->flags;
229 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
230 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string));
231 ndr->flags = _flags_save_string;
233 break; }
235 case REG_EXPAND_SZ: {
237 uint32_t _flags_save_string = ndr->flags;
238 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
239 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string));
240 ndr->flags = _flags_save_string;
242 break; }
244 case REG_BINARY: {
246 uint32_t _flags_save_DATA_BLOB = ndr->flags;
247 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
248 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
249 ndr->flags = _flags_save_DATA_BLOB;
251 break; }
253 case REG_DWORD: {
254 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value));
255 break; }
257 case REG_DWORD_BIG_ENDIAN: {
259 uint32_t _flags_save_uint32 = ndr->flags;
260 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
261 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value));
262 ndr->flags = _flags_save_uint32;
264 break; }
266 case REG_MULTI_SZ: {
268 uint32_t _flags_save_string_array = ndr->flags;
269 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
270 NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->string_array));
271 ndr->flags = _flags_save_string_array;
273 break; }
275 default: {
277 uint32_t _flags_save_DATA_BLOB = ndr->flags;
278 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
279 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
280 ndr->flags = _flags_save_DATA_BLOB;
282 break; }
286 if (ndr_flags & NDR_BUFFERS) {
287 int level = ndr_push_get_switch_value(ndr, r);
288 switch (level) {
289 case REG_NONE:
290 break;
292 case REG_SZ:
293 break;
295 case REG_EXPAND_SZ:
296 break;
298 case REG_BINARY:
299 break;
301 case REG_DWORD:
302 break;
304 case REG_DWORD_BIG_ENDIAN:
305 break;
307 case REG_MULTI_SZ:
308 break;
310 default:
311 break;
315 ndr->flags = _flags_save_UNION;
317 return NDR_ERR_SUCCESS;
320 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_Data(struct ndr_pull *ndr, int ndr_flags, union winreg_Data *r)
322 int level;
324 uint32_t _flags_save_UNION = ndr->flags;
325 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
326 level = ndr_pull_get_switch_value(ndr, r);
327 if (ndr_flags & NDR_SCALARS) {
328 NDR_CHECK(ndr_pull_union_align(ndr, 4));
329 switch (level) {
330 case REG_NONE: {
331 break; }
333 case REG_SZ: {
335 uint32_t _flags_save_string = ndr->flags;
336 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
337 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string));
338 ndr->flags = _flags_save_string;
340 break; }
342 case REG_EXPAND_SZ: {
344 uint32_t _flags_save_string = ndr->flags;
345 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
346 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string));
347 ndr->flags = _flags_save_string;
349 break; }
351 case REG_BINARY: {
353 uint32_t _flags_save_DATA_BLOB = ndr->flags;
354 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
355 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
356 ndr->flags = _flags_save_DATA_BLOB;
358 break; }
360 case REG_DWORD: {
361 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value));
362 break; }
364 case REG_DWORD_BIG_ENDIAN: {
366 uint32_t _flags_save_uint32 = ndr->flags;
367 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
368 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value));
369 ndr->flags = _flags_save_uint32;
371 break; }
373 case REG_MULTI_SZ: {
375 uint32_t _flags_save_string_array = ndr->flags;
376 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
377 NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->string_array));
378 ndr->flags = _flags_save_string_array;
380 break; }
382 default: {
384 uint32_t _flags_save_DATA_BLOB = ndr->flags;
385 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
386 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
387 ndr->flags = _flags_save_DATA_BLOB;
389 break; }
393 if (ndr_flags & NDR_BUFFERS) {
394 switch (level) {
395 case REG_NONE:
396 break;
398 case REG_SZ:
399 break;
401 case REG_EXPAND_SZ:
402 break;
404 case REG_BINARY:
405 break;
407 case REG_DWORD:
408 break;
410 case REG_DWORD_BIG_ENDIAN:
411 break;
413 case REG_MULTI_SZ:
414 break;
416 default:
417 break;
421 ndr->flags = _flags_save_UNION;
423 return NDR_ERR_SUCCESS;
426 _PUBLIC_ void ndr_print_winreg_Data(struct ndr_print *ndr, const char *name, const union winreg_Data *r)
428 int level;
430 uint32_t _flags_save_UNION = ndr->flags;
431 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
432 level = ndr_print_get_switch_value(ndr, r);
433 ndr_print_union(ndr, name, level, "winreg_Data");
434 switch (level) {
435 case REG_NONE:
436 break;
438 case REG_SZ:
439 ndr_print_string(ndr, "string", r->string);
440 break;
442 case REG_EXPAND_SZ:
443 ndr_print_string(ndr, "string", r->string);
444 break;
446 case REG_BINARY:
447 ndr_print_DATA_BLOB(ndr, "binary", r->binary);
448 break;
450 case REG_DWORD:
451 ndr_print_uint32(ndr, "value", r->value);
452 break;
454 case REG_DWORD_BIG_ENDIAN:
455 ndr_print_uint32(ndr, "value", r->value);
456 break;
458 case REG_MULTI_SZ:
459 ndr_print_string_array(ndr, "string_array", r->string_array);
460 break;
462 default:
463 ndr_print_DATA_BLOB(ndr, "data", r->data);
464 break;
467 ndr->flags = _flags_save_UNION;