s4:librpc/ndr: if uninitialized variable in string_array code
[Samba/gbeck.git] / librpc / gen_ndr / ndr_misc.c
blob28c856081927b64c4bc1d46975b3754f03d272a6
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));
16 if (ndr_flags & NDR_BUFFERS) {
18 return NDR_ERR_SUCCESS;
21 _PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r)
23 if (ndr_flags & NDR_SCALARS) {
24 NDR_CHECK(ndr_pull_align(ndr, 4));
25 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low));
26 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid));
27 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version));
28 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2));
29 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6));
31 if (ndr_flags & NDR_BUFFERS) {
33 return NDR_ERR_SUCCESS;
36 _PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, struct smb_iconv_convenience *ic, int flags)
38 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID, ic);
41 _PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r)
43 if (ndr_flags & NDR_SCALARS) {
44 NDR_CHECK(ndr_push_align(ndr, 4));
45 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
46 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version));
48 if (ndr_flags & NDR_BUFFERS) {
50 return NDR_ERR_SUCCESS;
53 _PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r)
55 if (ndr_flags & NDR_SCALARS) {
56 NDR_CHECK(ndr_pull_align(ndr, 4));
57 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
58 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version));
60 if (ndr_flags & NDR_BUFFERS) {
62 return NDR_ERR_SUCCESS;
65 _PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r)
67 ndr_print_struct(ndr, name, "ndr_syntax_id");
68 ndr->depth++;
69 ndr_print_GUID(ndr, "uuid", &r->uuid);
70 ndr_print_uint32(ndr, "if_version", r->if_version);
71 ndr->depth--;
74 _PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r)
76 if (ndr_flags & NDR_SCALARS) {
77 NDR_CHECK(ndr_push_align(ndr, 4));
78 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type));
79 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
81 if (ndr_flags & NDR_BUFFERS) {
83 return NDR_ERR_SUCCESS;
86 _PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r)
88 if (ndr_flags & NDR_SCALARS) {
89 NDR_CHECK(ndr_pull_align(ndr, 4));
90 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type));
91 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
93 if (ndr_flags & NDR_BUFFERS) {
95 return NDR_ERR_SUCCESS;
98 _PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r)
100 ndr_print_struct(ndr, name, "policy_handle");
101 ndr->depth++;
102 ndr_print_uint32(ndr, "handle_type", r->handle_type);
103 ndr_print_GUID(ndr, "uuid", &r->uuid);
104 ndr->depth--;
107 _PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r)
109 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
110 return NDR_ERR_SUCCESS;
113 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r)
115 uint16_t v;
116 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
117 *r = v;
118 return NDR_ERR_SUCCESS;
121 _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r)
123 const char *val = NULL;
125 switch (r) {
126 case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break;
127 case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break;
128 case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break;
129 case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break;
130 case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break;
132 ndr_print_enum(ndr, name, "ENUM", val, r);
135 _PUBLIC_ enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r)
137 if (ndr_flags & NDR_SCALARS) {
138 NDR_CHECK(ndr_push_align(ndr, 4));
139 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->ntstatus));
140 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
141 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
143 if (ndr_flags & NDR_BUFFERS) {
145 return NDR_ERR_SUCCESS;
148 _PUBLIC_ enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r)
150 if (ndr_flags & NDR_SCALARS) {
151 NDR_CHECK(ndr_pull_align(ndr, 4));
152 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->ntstatus));
153 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
154 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
156 if (ndr_flags & NDR_BUFFERS) {
158 return NDR_ERR_SUCCESS;
161 _PUBLIC_ void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r)
163 ndr_print_struct(ndr, name, "KRB5_EDATA_NTSTATUS");
164 ndr->depth++;
165 ndr_print_NTSTATUS(ndr, "ntstatus", r->ntstatus);
166 ndr_print_uint32(ndr, "unknown1", r->unknown1);
167 ndr_print_uint32(ndr, "unknown2", r->unknown2);
168 ndr->depth--;