1 /* parser auto-generated by pidl */
4 #include "librpc/gen_ndr/ndr_initshutdown.h"
6 static enum ndr_err_code
ndr_push_initshutdown_String_sub(struct ndr_push
*ndr
, int ndr_flags
, const struct initshutdown_String_sub
*r
)
8 if (ndr_flags
& NDR_SCALARS
) {
9 NDR_CHECK(ndr_push_align(ndr
, 4));
10 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, strlen_m_term(r
->name
)));
12 uint32_t _flags_save_string
= ndr
->flags
;
13 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_LEN4
|LIBNDR_FLAG_STR_NOTERM
);
14 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->name
));
15 ndr
->flags
= _flags_save_string
;
18 if (ndr_flags
& NDR_BUFFERS
) {
20 return NDR_ERR_SUCCESS
;
23 static enum ndr_err_code
ndr_pull_initshutdown_String_sub(struct ndr_pull
*ndr
, int ndr_flags
, struct initshutdown_String_sub
*r
)
25 if (ndr_flags
& NDR_SCALARS
) {
26 NDR_CHECK(ndr_pull_align(ndr
, 4));
27 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->name_size
));
29 uint32_t _flags_save_string
= ndr
->flags
;
30 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_LEN4
|LIBNDR_FLAG_STR_NOTERM
);
31 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->name
));
32 ndr
->flags
= _flags_save_string
;
35 if (ndr_flags
& NDR_BUFFERS
) {
37 return NDR_ERR_SUCCESS
;
40 _PUBLIC_
void ndr_print_initshutdown_String_sub(struct ndr_print
*ndr
, const char *name
, const struct initshutdown_String_sub
*r
)
42 ndr_print_struct(ndr
, name
, "initshutdown_String_sub");
44 ndr_print_uint32(ndr
, "name_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen_m_term(r
->name
):r
->name_size
);
45 ndr_print_string(ndr
, "name", r
->name
);
49 _PUBLIC_
enum ndr_err_code
ndr_push_initshutdown_String(struct ndr_push
*ndr
, int ndr_flags
, const struct initshutdown_String
*r
)
51 if (ndr_flags
& NDR_SCALARS
) {
52 NDR_CHECK(ndr_push_align(ndr
, 4));
53 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen_m(r
->name
->name
) * 2));
54 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen_m_term(r
->name
->name
) * 2));
55 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->name
));
57 if (ndr_flags
& NDR_BUFFERS
) {
59 NDR_CHECK(ndr_push_initshutdown_String_sub(ndr
, NDR_SCALARS
, r
->name
));
62 return NDR_ERR_SUCCESS
;
65 _PUBLIC_
enum ndr_err_code
ndr_pull_initshutdown_String(struct ndr_pull
*ndr
, int ndr_flags
, struct initshutdown_String
*r
)
68 TALLOC_CTX
*_mem_save_name_0
;
69 if (ndr_flags
& NDR_SCALARS
) {
70 NDR_CHECK(ndr_pull_align(ndr
, 4));
71 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->name_len
));
72 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->name_size
));
73 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_name
));
75 NDR_PULL_ALLOC(ndr
, r
->name
);
80 if (ndr_flags
& NDR_BUFFERS
) {
82 _mem_save_name_0
= NDR_PULL_GET_MEM_CTX(ndr
);
83 NDR_PULL_SET_MEM_CTX(ndr
, r
->name
, 0);
84 NDR_CHECK(ndr_pull_initshutdown_String_sub(ndr
, NDR_SCALARS
, r
->name
));
85 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_name_0
, 0);
88 return NDR_ERR_SUCCESS
;
91 _PUBLIC_
void ndr_print_initshutdown_String(struct ndr_print
*ndr
, const char *name
, const struct initshutdown_String
*r
)
93 ndr_print_struct(ndr
, name
, "initshutdown_String");
95 ndr_print_uint16(ndr
, "name_len", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen_m(r
->name
->name
) * 2:r
->name_len
);
96 ndr_print_uint16(ndr
, "name_size", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen_m_term(r
->name
->name
) * 2:r
->name_size
);
97 ndr_print_ptr(ndr
, "name", r
->name
);
100 ndr_print_initshutdown_String_sub(ndr
, "name", r
->name
);
106 static enum ndr_err_code
ndr_push_initshutdown_Init(struct ndr_push
*ndr
, int flags
, const struct initshutdown_Init
*r
)
108 if (flags
& NDR_IN
) {
109 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.hostname
));
110 if (r
->in
.hostname
) {
111 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, *r
->in
.hostname
));
113 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.message
));
115 NDR_CHECK(ndr_push_initshutdown_String(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.message
));
117 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.timeout
));
118 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->in
.force_apps
));
119 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->in
.reboot
));
121 if (flags
& NDR_OUT
) {
122 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
124 return NDR_ERR_SUCCESS
;
127 static enum ndr_err_code
ndr_pull_initshutdown_Init(struct ndr_pull
*ndr
, int flags
, struct initshutdown_Init
*r
)
129 uint32_t _ptr_hostname
;
130 uint32_t _ptr_message
;
131 TALLOC_CTX
*_mem_save_hostname_0
;
132 TALLOC_CTX
*_mem_save_message_0
;
133 if (flags
& NDR_IN
) {
134 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_hostname
));
136 NDR_PULL_ALLOC(ndr
, r
->in
.hostname
);
138 r
->in
.hostname
= NULL
;
140 if (r
->in
.hostname
) {
141 _mem_save_hostname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
142 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.hostname
, 0);
143 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, r
->in
.hostname
));
144 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_hostname_0
, 0);
146 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_message
));
148 NDR_PULL_ALLOC(ndr
, r
->in
.message
);
150 r
->in
.message
= NULL
;
153 _mem_save_message_0
= NDR_PULL_GET_MEM_CTX(ndr
);
154 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.message
, 0);
155 NDR_CHECK(ndr_pull_initshutdown_String(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.message
));
156 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_message_0
, 0);
158 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.timeout
));
159 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->in
.force_apps
));
160 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->in
.reboot
));
162 if (flags
& NDR_OUT
) {
163 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
165 return NDR_ERR_SUCCESS
;
168 _PUBLIC_
void ndr_print_initshutdown_Init(struct ndr_print
*ndr
, const char *name
, int flags
, const struct initshutdown_Init
*r
)
170 ndr_print_struct(ndr
, name
, "initshutdown_Init");
172 if (flags
& NDR_SET_VALUES
) {
173 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
175 if (flags
& NDR_IN
) {
176 ndr_print_struct(ndr
, "in", "initshutdown_Init");
178 ndr_print_ptr(ndr
, "hostname", r
->in
.hostname
);
180 if (r
->in
.hostname
) {
181 ndr_print_uint16(ndr
, "hostname", *r
->in
.hostname
);
184 ndr_print_ptr(ndr
, "message", r
->in
.message
);
187 ndr_print_initshutdown_String(ndr
, "message", r
->in
.message
);
190 ndr_print_uint32(ndr
, "timeout", r
->in
.timeout
);
191 ndr_print_uint8(ndr
, "force_apps", r
->in
.force_apps
);
192 ndr_print_uint8(ndr
, "reboot", r
->in
.reboot
);
195 if (flags
& NDR_OUT
) {
196 ndr_print_struct(ndr
, "out", "initshutdown_Init");
198 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
204 static enum ndr_err_code
ndr_push_initshutdown_Abort(struct ndr_push
*ndr
, int flags
, const struct initshutdown_Abort
*r
)
206 if (flags
& NDR_IN
) {
207 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.server
));
209 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, *r
->in
.server
));
212 if (flags
& NDR_OUT
) {
213 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
215 return NDR_ERR_SUCCESS
;
218 static enum ndr_err_code
ndr_pull_initshutdown_Abort(struct ndr_pull
*ndr
, int flags
, struct initshutdown_Abort
*r
)
220 uint32_t _ptr_server
;
221 TALLOC_CTX
*_mem_save_server_0
;
222 if (flags
& NDR_IN
) {
223 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_server
));
225 NDR_PULL_ALLOC(ndr
, r
->in
.server
);
230 _mem_save_server_0
= NDR_PULL_GET_MEM_CTX(ndr
);
231 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.server
, 0);
232 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, r
->in
.server
));
233 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_server_0
, 0);
236 if (flags
& NDR_OUT
) {
237 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
239 return NDR_ERR_SUCCESS
;
242 _PUBLIC_
void ndr_print_initshutdown_Abort(struct ndr_print
*ndr
, const char *name
, int flags
, const struct initshutdown_Abort
*r
)
244 ndr_print_struct(ndr
, name
, "initshutdown_Abort");
246 if (flags
& NDR_SET_VALUES
) {
247 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
249 if (flags
& NDR_IN
) {
250 ndr_print_struct(ndr
, "in", "initshutdown_Abort");
252 ndr_print_ptr(ndr
, "server", r
->in
.server
);
255 ndr_print_uint16(ndr
, "server", *r
->in
.server
);
260 if (flags
& NDR_OUT
) {
261 ndr_print_struct(ndr
, "out", "initshutdown_Abort");
263 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
269 static enum ndr_err_code
ndr_push_initshutdown_InitEx(struct ndr_push
*ndr
, int flags
, const struct initshutdown_InitEx
*r
)
271 if (flags
& NDR_IN
) {
272 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.hostname
));
273 if (r
->in
.hostname
) {
274 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, *r
->in
.hostname
));
276 NDR_CHECK(ndr_push_unique_ptr(ndr
, r
->in
.message
));
278 NDR_CHECK(ndr_push_initshutdown_String(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.message
));
280 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.timeout
));
281 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->in
.force_apps
));
282 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, r
->in
.reboot
));
283 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->in
.reason
));
285 if (flags
& NDR_OUT
) {
286 NDR_CHECK(ndr_push_WERROR(ndr
, NDR_SCALARS
, r
->out
.result
));
288 return NDR_ERR_SUCCESS
;
291 static enum ndr_err_code
ndr_pull_initshutdown_InitEx(struct ndr_pull
*ndr
, int flags
, struct initshutdown_InitEx
*r
)
293 uint32_t _ptr_hostname
;
294 uint32_t _ptr_message
;
295 TALLOC_CTX
*_mem_save_hostname_0
;
296 TALLOC_CTX
*_mem_save_message_0
;
297 if (flags
& NDR_IN
) {
298 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_hostname
));
300 NDR_PULL_ALLOC(ndr
, r
->in
.hostname
);
302 r
->in
.hostname
= NULL
;
304 if (r
->in
.hostname
) {
305 _mem_save_hostname_0
= NDR_PULL_GET_MEM_CTX(ndr
);
306 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.hostname
, 0);
307 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, r
->in
.hostname
));
308 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_hostname_0
, 0);
310 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_message
));
312 NDR_PULL_ALLOC(ndr
, r
->in
.message
);
314 r
->in
.message
= NULL
;
317 _mem_save_message_0
= NDR_PULL_GET_MEM_CTX(ndr
);
318 NDR_PULL_SET_MEM_CTX(ndr
, r
->in
.message
, 0);
319 NDR_CHECK(ndr_pull_initshutdown_String(ndr
, NDR_SCALARS
|NDR_BUFFERS
, r
->in
.message
));
320 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_message_0
, 0);
322 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.timeout
));
323 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->in
.force_apps
));
324 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->in
.reboot
));
325 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->in
.reason
));
327 if (flags
& NDR_OUT
) {
328 NDR_CHECK(ndr_pull_WERROR(ndr
, NDR_SCALARS
, &r
->out
.result
));
330 return NDR_ERR_SUCCESS
;
333 _PUBLIC_
void ndr_print_initshutdown_InitEx(struct ndr_print
*ndr
, const char *name
, int flags
, const struct initshutdown_InitEx
*r
)
335 ndr_print_struct(ndr
, name
, "initshutdown_InitEx");
337 if (flags
& NDR_SET_VALUES
) {
338 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
340 if (flags
& NDR_IN
) {
341 ndr_print_struct(ndr
, "in", "initshutdown_InitEx");
343 ndr_print_ptr(ndr
, "hostname", r
->in
.hostname
);
345 if (r
->in
.hostname
) {
346 ndr_print_uint16(ndr
, "hostname", *r
->in
.hostname
);
349 ndr_print_ptr(ndr
, "message", r
->in
.message
);
352 ndr_print_initshutdown_String(ndr
, "message", r
->in
.message
);
355 ndr_print_uint32(ndr
, "timeout", r
->in
.timeout
);
356 ndr_print_uint8(ndr
, "force_apps", r
->in
.force_apps
);
357 ndr_print_uint8(ndr
, "reboot", r
->in
.reboot
);
358 ndr_print_uint32(ndr
, "reason", r
->in
.reason
);
361 if (flags
& NDR_OUT
) {
362 ndr_print_struct(ndr
, "out", "initshutdown_InitEx");
364 ndr_print_WERROR(ndr
, "result", r
->out
.result
);
370 static const struct ndr_interface_call initshutdown_calls
[] = {
373 sizeof(struct initshutdown_Init
),
374 (ndr_push_flags_fn_t
) ndr_push_initshutdown_Init
,
375 (ndr_pull_flags_fn_t
) ndr_pull_initshutdown_Init
,
376 (ndr_print_function_t
) ndr_print_initshutdown_Init
,
380 "initshutdown_Abort",
381 sizeof(struct initshutdown_Abort
),
382 (ndr_push_flags_fn_t
) ndr_push_initshutdown_Abort
,
383 (ndr_pull_flags_fn_t
) ndr_pull_initshutdown_Abort
,
384 (ndr_print_function_t
) ndr_print_initshutdown_Abort
,
388 "initshutdown_InitEx",
389 sizeof(struct initshutdown_InitEx
),
390 (ndr_push_flags_fn_t
) ndr_push_initshutdown_InitEx
,
391 (ndr_pull_flags_fn_t
) ndr_pull_initshutdown_InitEx
,
392 (ndr_print_function_t
) ndr_print_initshutdown_InitEx
,
395 { NULL
, 0, NULL
, NULL
, NULL
, false }
398 static const char * const initshutdown_endpoint_strings
[] = {
399 "ncacn_np:[\\pipe\\InitShutdown]",
402 static const struct ndr_interface_string_array initshutdown_endpoints
= {
404 .names
= initshutdown_endpoint_strings
407 static const char * const initshutdown_authservice_strings
[] = {
411 static const struct ndr_interface_string_array initshutdown_authservices
= {
413 .names
= initshutdown_authservice_strings
417 const struct ndr_interface_table ndr_table_initshutdown
= {
418 .name
= "initshutdown",
420 {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}},
421 NDR_INITSHUTDOWN_VERSION
423 .helpstring
= NDR_INITSHUTDOWN_HELPSTRING
,
425 .calls
= initshutdown_calls
,
426 .endpoints
= &initshutdown_endpoints
,
427 .authservices
= &initshutdown_authservices