1 /* parser auto-generated by pidl */
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");
73 ndr_print_GUID(ndr
, "uuid", &r
->uuid
);
74 ndr_print_uint32(ndr
, "if_version", r
->if_version
);
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");
108 ndr_print_uint32(ndr
, "handle_type", r
->handle_type
);
109 ndr_print_GUID(ndr
, "uuid", &r
->uuid
);
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
)
122 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &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
;
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");
173 ndr_print_NTSTATUS(ndr
, "ntstatus", r
->ntstatus
);
174 ndr_print_uint32(ndr
, "unknown1", r
->unknown1
);
175 ndr_print_uint32(ndr
, "unknown2", r
->unknown2
);
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
)
188 NDR_CHECK(ndr_pull_enum_uint32(ndr
, NDR_SCALARS
, &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
;
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));
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
;
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
;
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
;
254 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->value
));
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
;
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
;
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
;
286 if (ndr_flags
& NDR_BUFFERS
) {
287 int level
= ndr_push_get_switch_value(ndr
, r
);
304 case REG_DWORD_BIG_ENDIAN
:
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
)
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));
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
;
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
;
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
;
361 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->value
));
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
;
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
;
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
;
393 if (ndr_flags
& NDR_BUFFERS
) {
410 case REG_DWORD_BIG_ENDIAN
:
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
)
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");
439 ndr_print_string(ndr
, "string", r
->string
);
443 ndr_print_string(ndr
, "string", r
->string
);
447 ndr_print_DATA_BLOB(ndr
, "binary", r
->binary
);
451 ndr_print_uint32(ndr
, "value", r
->value
);
454 case REG_DWORD_BIG_ENDIAN
:
455 ndr_print_uint32(ndr
, "value", r
->value
);
459 ndr_print_string_array(ndr
, "string_array", r
->string_array
);
463 ndr_print_DATA_BLOB(ndr
, "data", r
->data
);
467 ndr
->flags
= _flags_save_UNION
;