r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / librpc / gen_ndr / srv_initshutdown.c
blob41c10129d5c0504cfbc683020ff043b0cc7b4b1b
1 /*
2 * Unix SMB/CIFS implementation.
3 * server auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_initshutdown.h"
9 static BOOL api_initshutdown_Init(pipes_struct *p)
11 struct ndr_pull *pull;
12 struct ndr_push *push;
13 NTSTATUS status;
14 DATA_BLOB blob;
15 struct initshutdown_Init r;
16 TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Init");
18 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
19 talloc_free(mem_ctx);
20 return False;
23 pull = ndr_pull_init_blob(&blob, mem_ctx);
24 if (pull == NULL) {
25 talloc_free(mem_ctx);
26 return False;
29 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
30 status = ndr_pull_initshutdown_Init(pull, NDR_IN, &r);
31 if (NT_STATUS_IS_ERR(status)) {
32 talloc_free(mem_ctx);
33 return False;
36 if (DEBUGLEVEL >= 10)
37 NDR_PRINT_IN_DEBUG(initshutdown_Init, &r);
39 r.out.result = _initshutdown_Init(p, &r);
41 if (p->rng_fault_state) {
42 talloc_free(mem_ctx);
43 /* Return True here, srv_pipe_hnd.c will take care */
44 return True;
47 if (DEBUGLEVEL >= 10)
48 NDR_PRINT_OUT_DEBUG(initshutdown_Init, &r);
50 push = ndr_push_init_ctx(mem_ctx);
51 if (push == NULL) {
52 talloc_free(mem_ctx);
53 return False;
56 status = ndr_push_initshutdown_Init(push, NDR_OUT, &r);
57 if (NT_STATUS_IS_ERR(status)) {
58 talloc_free(mem_ctx);
59 return False;
62 blob = ndr_push_blob(push);
63 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
64 talloc_free(mem_ctx);
65 return False;
68 talloc_free(mem_ctx);
70 return True;
73 static BOOL api_initshutdown_Abort(pipes_struct *p)
75 struct ndr_pull *pull;
76 struct ndr_push *push;
77 NTSTATUS status;
78 DATA_BLOB blob;
79 struct initshutdown_Abort r;
80 TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_Abort");
82 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
83 talloc_free(mem_ctx);
84 return False;
87 pull = ndr_pull_init_blob(&blob, mem_ctx);
88 if (pull == NULL) {
89 talloc_free(mem_ctx);
90 return False;
93 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
94 status = ndr_pull_initshutdown_Abort(pull, NDR_IN, &r);
95 if (NT_STATUS_IS_ERR(status)) {
96 talloc_free(mem_ctx);
97 return False;
100 if (DEBUGLEVEL >= 10)
101 NDR_PRINT_IN_DEBUG(initshutdown_Abort, &r);
103 r.out.result = _initshutdown_Abort(p, &r);
105 if (p->rng_fault_state) {
106 talloc_free(mem_ctx);
107 /* Return True here, srv_pipe_hnd.c will take care */
108 return True;
111 if (DEBUGLEVEL >= 10)
112 NDR_PRINT_OUT_DEBUG(initshutdown_Abort, &r);
114 push = ndr_push_init_ctx(mem_ctx);
115 if (push == NULL) {
116 talloc_free(mem_ctx);
117 return False;
120 status = ndr_push_initshutdown_Abort(push, NDR_OUT, &r);
121 if (NT_STATUS_IS_ERR(status)) {
122 talloc_free(mem_ctx);
123 return False;
126 blob = ndr_push_blob(push);
127 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
128 talloc_free(mem_ctx);
129 return False;
132 talloc_free(mem_ctx);
134 return True;
137 static BOOL api_initshutdown_InitEx(pipes_struct *p)
139 struct ndr_pull *pull;
140 struct ndr_push *push;
141 NTSTATUS status;
142 DATA_BLOB blob;
143 struct initshutdown_InitEx r;
144 TALLOC_CTX *mem_ctx = talloc_init("api_initshutdown_InitEx");
146 if (!prs_data_blob(&p->in_data.data, &blob, mem_ctx)) {
147 talloc_free(mem_ctx);
148 return False;
151 pull = ndr_pull_init_blob(&blob, mem_ctx);
152 if (pull == NULL) {
153 talloc_free(mem_ctx);
154 return False;
157 pull->flags |= LIBNDR_FLAG_REF_ALLOC;
158 status = ndr_pull_initshutdown_InitEx(pull, NDR_IN, &r);
159 if (NT_STATUS_IS_ERR(status)) {
160 talloc_free(mem_ctx);
161 return False;
164 if (DEBUGLEVEL >= 10)
165 NDR_PRINT_IN_DEBUG(initshutdown_InitEx, &r);
167 r.out.result = _initshutdown_InitEx(p, &r);
169 if (p->rng_fault_state) {
170 talloc_free(mem_ctx);
171 /* Return True here, srv_pipe_hnd.c will take care */
172 return True;
175 if (DEBUGLEVEL >= 10)
176 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, &r);
178 push = ndr_push_init_ctx(mem_ctx);
179 if (push == NULL) {
180 talloc_free(mem_ctx);
181 return False;
184 status = ndr_push_initshutdown_InitEx(push, NDR_OUT, &r);
185 if (NT_STATUS_IS_ERR(status)) {
186 talloc_free(mem_ctx);
187 return False;
190 blob = ndr_push_blob(push);
191 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32)blob.length)) {
192 talloc_free(mem_ctx);
193 return False;
196 talloc_free(mem_ctx);
198 return True;
202 /* Tables */
203 static struct api_struct api_initshutdown_cmds[] =
205 {"INITSHUTDOWN_INIT", DCERPC_INITSHUTDOWN_INIT, api_initshutdown_Init},
206 {"INITSHUTDOWN_ABORT", DCERPC_INITSHUTDOWN_ABORT, api_initshutdown_Abort},
207 {"INITSHUTDOWN_INITEX", DCERPC_INITSHUTDOWN_INITEX, api_initshutdown_InitEx},
210 void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns)
212 *fns = api_initshutdown_cmds;
213 *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct);
216 NTSTATUS rpc_initshutdown_init(void)
218 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct));