1/* 2 * Unix SMB/CIFS implementation. 3 * server auto-generated by pidl. DO NOT MODIFY! 4 */ 5 6#include "includes.h" 7#include "../librpc/gen_ndr/srv_initshutdown.h" 8 9static bool api_initshutdown_Init(pipes_struct *p) 10{ 11 const struct ndr_interface_call *call; 12 struct ndr_pull *pull; 13 struct ndr_push *push; 14 enum ndr_err_code ndr_err; 15 DATA_BLOB blob; 16 struct initshutdown_Init *r; 17 18 call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INIT]; 19 20 r = talloc(talloc_tos(), struct initshutdown_Init); 21 if (r == NULL) { 22 return false; 23 } 24 25 if (!prs_data_blob(&p->in_data.data, &blob, r)) { 26 talloc_free(r); 27 return false; 28 } 29 30 pull = ndr_pull_init_blob(&blob, r, NULL); 31 if (pull == NULL) { 32 talloc_free(r); 33 return false; 34 } 35 36 pull->flags |= LIBNDR_FLAG_REF_ALLOC; 37 ndr_err = call->ndr_pull(pull, NDR_IN, r); 38 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 39 talloc_free(r); 40 return false; 41 } 42 43 if (DEBUGLEVEL >= 10) { 44 NDR_PRINT_IN_DEBUG(initshutdown_Init, r); 45 } 46 47 r->out.result = _initshutdown_Init(p, r); 48 49 if (p->rng_fault_state) { 50 talloc_free(r); 51 /* Return true here, srv_pipe_hnd.c will take care */ 52 return true; 53 } 54 55 if (DEBUGLEVEL >= 10) { 56 NDR_PRINT_OUT_DEBUG(initshutdown_Init, r); 57 } 58 59 push = ndr_push_init_ctx(r, NULL); 60 if (push == NULL) { 61 talloc_free(r); 62 return false; 63 } 64 65 ndr_err = call->ndr_push(push, NDR_OUT, r); 66 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 67 talloc_free(r); 68 return false; 69 } 70 71 blob = ndr_push_blob(push); 72 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { 73 talloc_free(r); 74 return false; 75 } 76 77 talloc_free(r); 78 79 return true; 80} 81 82static bool api_initshutdown_Abort(pipes_struct *p) 83{ 84 const struct ndr_interface_call *call; 85 struct ndr_pull *pull; 86 struct ndr_push *push; 87 enum ndr_err_code ndr_err; 88 DATA_BLOB blob; 89 struct initshutdown_Abort *r; 90 91 call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_ABORT]; 92 93 r = talloc(talloc_tos(), struct initshutdown_Abort); 94 if (r == NULL) { 95 return false; 96 } 97 98 if (!prs_data_blob(&p->in_data.data, &blob, r)) { 99 talloc_free(r); 100 return false; 101 } 102 103 pull = ndr_pull_init_blob(&blob, r, NULL); 104 if (pull == NULL) { 105 talloc_free(r); 106 return false; 107 } 108 109 pull->flags |= LIBNDR_FLAG_REF_ALLOC; 110 ndr_err = call->ndr_pull(pull, NDR_IN, r); 111 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 112 talloc_free(r); 113 return false; 114 } 115 116 if (DEBUGLEVEL >= 10) { 117 NDR_PRINT_IN_DEBUG(initshutdown_Abort, r); 118 } 119 120 r->out.result = _initshutdown_Abort(p, r); 121 122 if (p->rng_fault_state) { 123 talloc_free(r); 124 /* Return true here, srv_pipe_hnd.c will take care */ 125 return true; 126 } 127 128 if (DEBUGLEVEL >= 10) { 129 NDR_PRINT_OUT_DEBUG(initshutdown_Abort, r); 130 } 131 132 push = ndr_push_init_ctx(r, NULL); 133 if (push == NULL) { 134 talloc_free(r); 135 return false; 136 } 137 138 ndr_err = call->ndr_push(push, NDR_OUT, r); 139 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 140 talloc_free(r); 141 return false; 142 } 143 144 blob = ndr_push_blob(push); 145 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { 146 talloc_free(r); 147 return false; 148 } 149 150 talloc_free(r); 151 152 return true; 153} 154 155static bool api_initshutdown_InitEx(pipes_struct *p) 156{ 157 const struct ndr_interface_call *call; 158 struct ndr_pull *pull; 159 struct ndr_push *push; 160 enum ndr_err_code ndr_err; 161 DATA_BLOB blob; 162 struct initshutdown_InitEx *r; 163 164 call = &ndr_table_initshutdown.calls[NDR_INITSHUTDOWN_INITEX]; 165 166 r = talloc(talloc_tos(), struct initshutdown_InitEx); 167 if (r == NULL) { 168 return false; 169 } 170 171 if (!prs_data_blob(&p->in_data.data, &blob, r)) { 172 talloc_free(r); 173 return false; 174 } 175 176 pull = ndr_pull_init_blob(&blob, r, NULL); 177 if (pull == NULL) { 178 talloc_free(r); 179 return false; 180 } 181 182 pull->flags |= LIBNDR_FLAG_REF_ALLOC; 183 ndr_err = call->ndr_pull(pull, NDR_IN, r); 184 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 185 talloc_free(r); 186 return false; 187 } 188 189 if (DEBUGLEVEL >= 10) { 190 NDR_PRINT_IN_DEBUG(initshutdown_InitEx, r); 191 } 192 193 r->out.result = _initshutdown_InitEx(p, r); 194 195 if (p->rng_fault_state) { 196 talloc_free(r); 197 /* Return true here, srv_pipe_hnd.c will take care */ 198 return true; 199 } 200 201 if (DEBUGLEVEL >= 10) { 202 NDR_PRINT_OUT_DEBUG(initshutdown_InitEx, r); 203 } 204 205 push = ndr_push_init_ctx(r, NULL); 206 if (push == NULL) { 207 talloc_free(r); 208 return false; 209 } 210 211 ndr_err = call->ndr_push(push, NDR_OUT, r); 212 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 213 talloc_free(r); 214 return false; 215 } 216 217 blob = ndr_push_blob(push); 218 if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) { 219 talloc_free(r); 220 return false; 221 } 222 223 talloc_free(r); 224 225 return true; 226} 227 228 229/* Tables */ 230static struct api_struct api_initshutdown_cmds[] = 231{ 232 {"INITSHUTDOWN_INIT", NDR_INITSHUTDOWN_INIT, api_initshutdown_Init}, 233 {"INITSHUTDOWN_ABORT", NDR_INITSHUTDOWN_ABORT, api_initshutdown_Abort}, 234 {"INITSHUTDOWN_INITEX", NDR_INITSHUTDOWN_INITEX, api_initshutdown_InitEx}, 235}; 236 237void initshutdown_get_pipe_fns(struct api_struct **fns, int *n_fns) 238{ 239 *fns = api_initshutdown_cmds; 240 *n_fns = sizeof(api_initshutdown_cmds) / sizeof(struct api_struct); 241} 242 243NTSTATUS rpc_initshutdown_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r) 244{ 245 if (cli->pipes_struct == NULL) { 246 return NT_STATUS_INVALID_PARAMETER; 247 } 248 249 switch (opnum) 250 { 251 case NDR_INITSHUTDOWN_INIT: { 252 struct initshutdown_Init *r = (struct initshutdown_Init *)_r; 253 r->out.result = _initshutdown_Init(cli->pipes_struct, r); 254 return NT_STATUS_OK; 255 } 256 257 case NDR_INITSHUTDOWN_ABORT: { 258 struct initshutdown_Abort *r = (struct initshutdown_Abort *)_r; 259 r->out.result = _initshutdown_Abort(cli->pipes_struct, r); 260 return NT_STATUS_OK; 261 } 262 263 case NDR_INITSHUTDOWN_INITEX: { 264 struct initshutdown_InitEx *r = (struct initshutdown_InitEx *)_r; 265 r->out.result = _initshutdown_InitEx(cli->pipes_struct, r); 266 return NT_STATUS_OK; 267 } 268 269 default: 270 return NT_STATUS_NOT_IMPLEMENTED; 271 } 272} 273 274NTSTATUS rpc_initshutdown_init(void) 275{ 276 return rpc_srv_register(SMB_RPC_INTERFACE_VERSION, "initshutdown", "initshutdown", &ndr_table_initshutdown, api_initshutdown_cmds, sizeof(api_initshutdown_cmds) / sizeof(struct api_struct)); 277} 278