1/* 2 * Unix SMB/CIFS implementation. 3 * client auto-generated by pidl. DO NOT MODIFY! 4 */ 5 6#include "includes.h" 7#include "../librpc/gen_ndr/cli_srvsvc.h" 8 9struct rpccli_srvsvc_NetCharDevEnum_state { 10 struct srvsvc_NetCharDevEnum orig; 11 struct srvsvc_NetCharDevEnum tmp; 12 TALLOC_CTX *out_mem_ctx; 13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 14}; 15 16static void rpccli_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq); 17 18struct tevent_req *rpccli_srvsvc_NetCharDevEnum_send(TALLOC_CTX *mem_ctx, 19 struct tevent_context *ev, 20 struct rpc_pipe_client *cli, 21 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 22 struct srvsvc_NetCharDevInfoCtr *_info_ctr /* [in,out] [ref] */, 23 uint32_t _max_buffer /* [in] */, 24 uint32_t *_totalentries /* [out] [ref] */, 25 uint32_t *_resume_handle /* [in,out] [unique] */) 26{ 27 struct tevent_req *req; 28 struct rpccli_srvsvc_NetCharDevEnum_state *state; 29 struct tevent_req *subreq; 30 31 req = tevent_req_create(mem_ctx, &state, 32 struct rpccli_srvsvc_NetCharDevEnum_state); 33 if (req == NULL) { 34 return NULL; 35 } 36 state->out_mem_ctx = NULL; 37 state->dispatch_recv = cli->dispatch_recv; 38 39 /* In parameters */ 40 state->orig.in.server_unc = _server_unc; 41 state->orig.in.info_ctr = _info_ctr; 42 state->orig.in.max_buffer = _max_buffer; 43 state->orig.in.resume_handle = _resume_handle; 44 45 /* Out parameters */ 46 state->orig.out.info_ctr = _info_ctr; 47 state->orig.out.totalentries = _totalentries; 48 state->orig.out.resume_handle = _resume_handle; 49 50 /* Result */ 51 ZERO_STRUCT(state->orig.out.result); 52 53 state->out_mem_ctx = talloc_named_const(state, 0, 54 "rpccli_srvsvc_NetCharDevEnum_out_memory"); 55 if (tevent_req_nomem(state->out_mem_ctx, req)) { 56 return tevent_req_post(req, ev); 57 } 58 59 /* make a temporary copy, that we pass to the dispatch function */ 60 state->tmp = state->orig; 61 62 subreq = cli->dispatch_send(state, ev, cli, 63 &ndr_table_srvsvc, 64 NDR_SRVSVC_NETCHARDEVENUM, 65 &state->tmp); 66 if (tevent_req_nomem(subreq, req)) { 67 return tevent_req_post(req, ev); 68 } 69 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevEnum_done, req); 70 return req; 71} 72 73static void rpccli_srvsvc_NetCharDevEnum_done(struct tevent_req *subreq) 74{ 75 struct tevent_req *req = tevent_req_callback_data( 76 subreq, struct tevent_req); 77 struct rpccli_srvsvc_NetCharDevEnum_state *state = tevent_req_data( 78 req, struct rpccli_srvsvc_NetCharDevEnum_state); 79 NTSTATUS status; 80 TALLOC_CTX *mem_ctx; 81 82 if (state->out_mem_ctx) { 83 mem_ctx = state->out_mem_ctx; 84 } else { 85 mem_ctx = state; 86 } 87 88 status = state->dispatch_recv(subreq, mem_ctx); 89 TALLOC_FREE(subreq); 90 if (!NT_STATUS_IS_OK(status)) { 91 tevent_req_nterror(req, status); 92 return; 93 } 94 95 /* Copy out parameters */ 96 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 97 *state->orig.out.totalentries = *state->tmp.out.totalentries; 98 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 99 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 100 } 101 102 /* Copy result */ 103 state->orig.out.result = state->tmp.out.result; 104 105 /* Reset temporary structure */ 106 ZERO_STRUCT(state->tmp); 107 108 tevent_req_done(req); 109} 110 111NTSTATUS rpccli_srvsvc_NetCharDevEnum_recv(struct tevent_req *req, 112 TALLOC_CTX *mem_ctx, 113 WERROR *result) 114{ 115 struct rpccli_srvsvc_NetCharDevEnum_state *state = tevent_req_data( 116 req, struct rpccli_srvsvc_NetCharDevEnum_state); 117 NTSTATUS status; 118 119 if (tevent_req_is_nterror(req, &status)) { 120 tevent_req_received(req); 121 return status; 122 } 123 124 /* Steal possbile out parameters to the callers context */ 125 talloc_steal(mem_ctx, state->out_mem_ctx); 126 127 /* Return result */ 128 *result = state->orig.out.result; 129 130 tevent_req_received(req); 131 return NT_STATUS_OK; 132} 133 134NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, 135 TALLOC_CTX *mem_ctx, 136 const char *server_unc /* [in] [unique,charset(UTF16)] */, 137 struct srvsvc_NetCharDevInfoCtr *info_ctr /* [in,out] [ref] */, 138 uint32_t max_buffer /* [in] */, 139 uint32_t *totalentries /* [out] [ref] */, 140 uint32_t *resume_handle /* [in,out] [unique] */, 141 WERROR *werror) 142{ 143 struct srvsvc_NetCharDevEnum r; 144 NTSTATUS status; 145 146 /* In parameters */ 147 r.in.server_unc = server_unc; 148 r.in.info_ctr = info_ctr; 149 r.in.max_buffer = max_buffer; 150 r.in.resume_handle = resume_handle; 151 152 status = cli->dispatch(cli, 153 mem_ctx, 154 &ndr_table_srvsvc, 155 NDR_SRVSVC_NETCHARDEVENUM, 156 &r); 157 158 if (!NT_STATUS_IS_OK(status)) { 159 return status; 160 } 161 162 if (NT_STATUS_IS_ERR(status)) { 163 return status; 164 } 165 166 /* Return variables */ 167 *info_ctr = *r.out.info_ctr; 168 *totalentries = *r.out.totalentries; 169 if (resume_handle && r.out.resume_handle) { 170 *resume_handle = *r.out.resume_handle; 171 } 172 173 /* Return result */ 174 if (werror) { 175 *werror = r.out.result; 176 } 177 178 return werror_to_ntstatus(r.out.result); 179} 180 181struct rpccli_srvsvc_NetCharDevGetInfo_state { 182 struct srvsvc_NetCharDevGetInfo orig; 183 struct srvsvc_NetCharDevGetInfo tmp; 184 TALLOC_CTX *out_mem_ctx; 185 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 186}; 187 188static void rpccli_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq); 189 190struct tevent_req *rpccli_srvsvc_NetCharDevGetInfo_send(TALLOC_CTX *mem_ctx, 191 struct tevent_context *ev, 192 struct rpc_pipe_client *cli, 193 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 194 const char *_device_name /* [in] [charset(UTF16)] */, 195 uint32_t _level /* [in] */, 196 union srvsvc_NetCharDevInfo *_info /* [out] [ref,switch_is(level)] */) 197{ 198 struct tevent_req *req; 199 struct rpccli_srvsvc_NetCharDevGetInfo_state *state; 200 struct tevent_req *subreq; 201 202 req = tevent_req_create(mem_ctx, &state, 203 struct rpccli_srvsvc_NetCharDevGetInfo_state); 204 if (req == NULL) { 205 return NULL; 206 } 207 state->out_mem_ctx = NULL; 208 state->dispatch_recv = cli->dispatch_recv; 209 210 /* In parameters */ 211 state->orig.in.server_unc = _server_unc; 212 state->orig.in.device_name = _device_name; 213 state->orig.in.level = _level; 214 215 /* Out parameters */ 216 state->orig.out.info = _info; 217 218 /* Result */ 219 ZERO_STRUCT(state->orig.out.result); 220 221 state->out_mem_ctx = talloc_named_const(state, 0, 222 "rpccli_srvsvc_NetCharDevGetInfo_out_memory"); 223 if (tevent_req_nomem(state->out_mem_ctx, req)) { 224 return tevent_req_post(req, ev); 225 } 226 227 /* make a temporary copy, that we pass to the dispatch function */ 228 state->tmp = state->orig; 229 230 subreq = cli->dispatch_send(state, ev, cli, 231 &ndr_table_srvsvc, 232 NDR_SRVSVC_NETCHARDEVGETINFO, 233 &state->tmp); 234 if (tevent_req_nomem(subreq, req)) { 235 return tevent_req_post(req, ev); 236 } 237 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevGetInfo_done, req); 238 return req; 239} 240 241static void rpccli_srvsvc_NetCharDevGetInfo_done(struct tevent_req *subreq) 242{ 243 struct tevent_req *req = tevent_req_callback_data( 244 subreq, struct tevent_req); 245 struct rpccli_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data( 246 req, struct rpccli_srvsvc_NetCharDevGetInfo_state); 247 NTSTATUS status; 248 TALLOC_CTX *mem_ctx; 249 250 if (state->out_mem_ctx) { 251 mem_ctx = state->out_mem_ctx; 252 } else { 253 mem_ctx = state; 254 } 255 256 status = state->dispatch_recv(subreq, mem_ctx); 257 TALLOC_FREE(subreq); 258 if (!NT_STATUS_IS_OK(status)) { 259 tevent_req_nterror(req, status); 260 return; 261 } 262 263 /* Copy out parameters */ 264 *state->orig.out.info = *state->tmp.out.info; 265 266 /* Copy result */ 267 state->orig.out.result = state->tmp.out.result; 268 269 /* Reset temporary structure */ 270 ZERO_STRUCT(state->tmp); 271 272 tevent_req_done(req); 273} 274 275NTSTATUS rpccli_srvsvc_NetCharDevGetInfo_recv(struct tevent_req *req, 276 TALLOC_CTX *mem_ctx, 277 WERROR *result) 278{ 279 struct rpccli_srvsvc_NetCharDevGetInfo_state *state = tevent_req_data( 280 req, struct rpccli_srvsvc_NetCharDevGetInfo_state); 281 NTSTATUS status; 282 283 if (tevent_req_is_nterror(req, &status)) { 284 tevent_req_received(req); 285 return status; 286 } 287 288 /* Steal possbile out parameters to the callers context */ 289 talloc_steal(mem_ctx, state->out_mem_ctx); 290 291 /* Return result */ 292 *result = state->orig.out.result; 293 294 tevent_req_received(req); 295 return NT_STATUS_OK; 296} 297 298NTSTATUS rpccli_srvsvc_NetCharDevGetInfo(struct rpc_pipe_client *cli, 299 TALLOC_CTX *mem_ctx, 300 const char *server_unc /* [in] [unique,charset(UTF16)] */, 301 const char *device_name /* [in] [charset(UTF16)] */, 302 uint32_t level /* [in] */, 303 union srvsvc_NetCharDevInfo *info /* [out] [ref,switch_is(level)] */, 304 WERROR *werror) 305{ 306 struct srvsvc_NetCharDevGetInfo r; 307 NTSTATUS status; 308 309 /* In parameters */ 310 r.in.server_unc = server_unc; 311 r.in.device_name = device_name; 312 r.in.level = level; 313 314 status = cli->dispatch(cli, 315 mem_ctx, 316 &ndr_table_srvsvc, 317 NDR_SRVSVC_NETCHARDEVGETINFO, 318 &r); 319 320 if (!NT_STATUS_IS_OK(status)) { 321 return status; 322 } 323 324 if (NT_STATUS_IS_ERR(status)) { 325 return status; 326 } 327 328 /* Return variables */ 329 *info = *r.out.info; 330 331 /* Return result */ 332 if (werror) { 333 *werror = r.out.result; 334 } 335 336 return werror_to_ntstatus(r.out.result); 337} 338 339struct rpccli_srvsvc_NetCharDevControl_state { 340 struct srvsvc_NetCharDevControl orig; 341 struct srvsvc_NetCharDevControl tmp; 342 TALLOC_CTX *out_mem_ctx; 343 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 344}; 345 346static void rpccli_srvsvc_NetCharDevControl_done(struct tevent_req *subreq); 347 348struct tevent_req *rpccli_srvsvc_NetCharDevControl_send(TALLOC_CTX *mem_ctx, 349 struct tevent_context *ev, 350 struct rpc_pipe_client *cli, 351 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 352 const char *_device_name /* [in] [charset(UTF16)] */, 353 uint32_t _opcode /* [in] */) 354{ 355 struct tevent_req *req; 356 struct rpccli_srvsvc_NetCharDevControl_state *state; 357 struct tevent_req *subreq; 358 359 req = tevent_req_create(mem_ctx, &state, 360 struct rpccli_srvsvc_NetCharDevControl_state); 361 if (req == NULL) { 362 return NULL; 363 } 364 state->out_mem_ctx = NULL; 365 state->dispatch_recv = cli->dispatch_recv; 366 367 /* In parameters */ 368 state->orig.in.server_unc = _server_unc; 369 state->orig.in.device_name = _device_name; 370 state->orig.in.opcode = _opcode; 371 372 /* Out parameters */ 373 374 /* Result */ 375 ZERO_STRUCT(state->orig.out.result); 376 377 /* make a temporary copy, that we pass to the dispatch function */ 378 state->tmp = state->orig; 379 380 subreq = cli->dispatch_send(state, ev, cli, 381 &ndr_table_srvsvc, 382 NDR_SRVSVC_NETCHARDEVCONTROL, 383 &state->tmp); 384 if (tevent_req_nomem(subreq, req)) { 385 return tevent_req_post(req, ev); 386 } 387 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevControl_done, req); 388 return req; 389} 390 391static void rpccli_srvsvc_NetCharDevControl_done(struct tevent_req *subreq) 392{ 393 struct tevent_req *req = tevent_req_callback_data( 394 subreq, struct tevent_req); 395 struct rpccli_srvsvc_NetCharDevControl_state *state = tevent_req_data( 396 req, struct rpccli_srvsvc_NetCharDevControl_state); 397 NTSTATUS status; 398 TALLOC_CTX *mem_ctx; 399 400 if (state->out_mem_ctx) { 401 mem_ctx = state->out_mem_ctx; 402 } else { 403 mem_ctx = state; 404 } 405 406 status = state->dispatch_recv(subreq, mem_ctx); 407 TALLOC_FREE(subreq); 408 if (!NT_STATUS_IS_OK(status)) { 409 tevent_req_nterror(req, status); 410 return; 411 } 412 413 /* Copy out parameters */ 414 415 /* Copy result */ 416 state->orig.out.result = state->tmp.out.result; 417 418 /* Reset temporary structure */ 419 ZERO_STRUCT(state->tmp); 420 421 tevent_req_done(req); 422} 423 424NTSTATUS rpccli_srvsvc_NetCharDevControl_recv(struct tevent_req *req, 425 TALLOC_CTX *mem_ctx, 426 WERROR *result) 427{ 428 struct rpccli_srvsvc_NetCharDevControl_state *state = tevent_req_data( 429 req, struct rpccli_srvsvc_NetCharDevControl_state); 430 NTSTATUS status; 431 432 if (tevent_req_is_nterror(req, &status)) { 433 tevent_req_received(req); 434 return status; 435 } 436 437 /* Steal possbile out parameters to the callers context */ 438 talloc_steal(mem_ctx, state->out_mem_ctx); 439 440 /* Return result */ 441 *result = state->orig.out.result; 442 443 tevent_req_received(req); 444 return NT_STATUS_OK; 445} 446 447NTSTATUS rpccli_srvsvc_NetCharDevControl(struct rpc_pipe_client *cli, 448 TALLOC_CTX *mem_ctx, 449 const char *server_unc /* [in] [unique,charset(UTF16)] */, 450 const char *device_name /* [in] [charset(UTF16)] */, 451 uint32_t opcode /* [in] */, 452 WERROR *werror) 453{ 454 struct srvsvc_NetCharDevControl r; 455 NTSTATUS status; 456 457 /* In parameters */ 458 r.in.server_unc = server_unc; 459 r.in.device_name = device_name; 460 r.in.opcode = opcode; 461 462 status = cli->dispatch(cli, 463 mem_ctx, 464 &ndr_table_srvsvc, 465 NDR_SRVSVC_NETCHARDEVCONTROL, 466 &r); 467 468 if (!NT_STATUS_IS_OK(status)) { 469 return status; 470 } 471 472 if (NT_STATUS_IS_ERR(status)) { 473 return status; 474 } 475 476 /* Return variables */ 477 478 /* Return result */ 479 if (werror) { 480 *werror = r.out.result; 481 } 482 483 return werror_to_ntstatus(r.out.result); 484} 485 486struct rpccli_srvsvc_NetCharDevQEnum_state { 487 struct srvsvc_NetCharDevQEnum orig; 488 struct srvsvc_NetCharDevQEnum tmp; 489 TALLOC_CTX *out_mem_ctx; 490 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 491}; 492 493static void rpccli_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq); 494 495struct tevent_req *rpccli_srvsvc_NetCharDevQEnum_send(TALLOC_CTX *mem_ctx, 496 struct tevent_context *ev, 497 struct rpc_pipe_client *cli, 498 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 499 const char *_user /* [in] [unique,charset(UTF16)] */, 500 struct srvsvc_NetCharDevQInfoCtr *_info_ctr /* [in,out] [ref] */, 501 uint32_t _max_buffer /* [in] */, 502 uint32_t *_totalentries /* [out] [ref] */, 503 uint32_t *_resume_handle /* [in,out] [unique] */) 504{ 505 struct tevent_req *req; 506 struct rpccli_srvsvc_NetCharDevQEnum_state *state; 507 struct tevent_req *subreq; 508 509 req = tevent_req_create(mem_ctx, &state, 510 struct rpccli_srvsvc_NetCharDevQEnum_state); 511 if (req == NULL) { 512 return NULL; 513 } 514 state->out_mem_ctx = NULL; 515 state->dispatch_recv = cli->dispatch_recv; 516 517 /* In parameters */ 518 state->orig.in.server_unc = _server_unc; 519 state->orig.in.user = _user; 520 state->orig.in.info_ctr = _info_ctr; 521 state->orig.in.max_buffer = _max_buffer; 522 state->orig.in.resume_handle = _resume_handle; 523 524 /* Out parameters */ 525 state->orig.out.info_ctr = _info_ctr; 526 state->orig.out.totalentries = _totalentries; 527 state->orig.out.resume_handle = _resume_handle; 528 529 /* Result */ 530 ZERO_STRUCT(state->orig.out.result); 531 532 state->out_mem_ctx = talloc_named_const(state, 0, 533 "rpccli_srvsvc_NetCharDevQEnum_out_memory"); 534 if (tevent_req_nomem(state->out_mem_ctx, req)) { 535 return tevent_req_post(req, ev); 536 } 537 538 /* make a temporary copy, that we pass to the dispatch function */ 539 state->tmp = state->orig; 540 541 subreq = cli->dispatch_send(state, ev, cli, 542 &ndr_table_srvsvc, 543 NDR_SRVSVC_NETCHARDEVQENUM, 544 &state->tmp); 545 if (tevent_req_nomem(subreq, req)) { 546 return tevent_req_post(req, ev); 547 } 548 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQEnum_done, req); 549 return req; 550} 551 552static void rpccli_srvsvc_NetCharDevQEnum_done(struct tevent_req *subreq) 553{ 554 struct tevent_req *req = tevent_req_callback_data( 555 subreq, struct tevent_req); 556 struct rpccli_srvsvc_NetCharDevQEnum_state *state = tevent_req_data( 557 req, struct rpccli_srvsvc_NetCharDevQEnum_state); 558 NTSTATUS status; 559 TALLOC_CTX *mem_ctx; 560 561 if (state->out_mem_ctx) { 562 mem_ctx = state->out_mem_ctx; 563 } else { 564 mem_ctx = state; 565 } 566 567 status = state->dispatch_recv(subreq, mem_ctx); 568 TALLOC_FREE(subreq); 569 if (!NT_STATUS_IS_OK(status)) { 570 tevent_req_nterror(req, status); 571 return; 572 } 573 574 /* Copy out parameters */ 575 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 576 *state->orig.out.totalentries = *state->tmp.out.totalentries; 577 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 578 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 579 } 580 581 /* Copy result */ 582 state->orig.out.result = state->tmp.out.result; 583 584 /* Reset temporary structure */ 585 ZERO_STRUCT(state->tmp); 586 587 tevent_req_done(req); 588} 589 590NTSTATUS rpccli_srvsvc_NetCharDevQEnum_recv(struct tevent_req *req, 591 TALLOC_CTX *mem_ctx, 592 WERROR *result) 593{ 594 struct rpccli_srvsvc_NetCharDevQEnum_state *state = tevent_req_data( 595 req, struct rpccli_srvsvc_NetCharDevQEnum_state); 596 NTSTATUS status; 597 598 if (tevent_req_is_nterror(req, &status)) { 599 tevent_req_received(req); 600 return status; 601 } 602 603 /* Steal possbile out parameters to the callers context */ 604 talloc_steal(mem_ctx, state->out_mem_ctx); 605 606 /* Return result */ 607 *result = state->orig.out.result; 608 609 tevent_req_received(req); 610 return NT_STATUS_OK; 611} 612 613NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, 614 TALLOC_CTX *mem_ctx, 615 const char *server_unc /* [in] [unique,charset(UTF16)] */, 616 const char *user /* [in] [unique,charset(UTF16)] */, 617 struct srvsvc_NetCharDevQInfoCtr *info_ctr /* [in,out] [ref] */, 618 uint32_t max_buffer /* [in] */, 619 uint32_t *totalentries /* [out] [ref] */, 620 uint32_t *resume_handle /* [in,out] [unique] */, 621 WERROR *werror) 622{ 623 struct srvsvc_NetCharDevQEnum r; 624 NTSTATUS status; 625 626 /* In parameters */ 627 r.in.server_unc = server_unc; 628 r.in.user = user; 629 r.in.info_ctr = info_ctr; 630 r.in.max_buffer = max_buffer; 631 r.in.resume_handle = resume_handle; 632 633 status = cli->dispatch(cli, 634 mem_ctx, 635 &ndr_table_srvsvc, 636 NDR_SRVSVC_NETCHARDEVQENUM, 637 &r); 638 639 if (!NT_STATUS_IS_OK(status)) { 640 return status; 641 } 642 643 if (NT_STATUS_IS_ERR(status)) { 644 return status; 645 } 646 647 /* Return variables */ 648 *info_ctr = *r.out.info_ctr; 649 *totalentries = *r.out.totalentries; 650 if (resume_handle && r.out.resume_handle) { 651 *resume_handle = *r.out.resume_handle; 652 } 653 654 /* Return result */ 655 if (werror) { 656 *werror = r.out.result; 657 } 658 659 return werror_to_ntstatus(r.out.result); 660} 661 662struct rpccli_srvsvc_NetCharDevQGetInfo_state { 663 struct srvsvc_NetCharDevQGetInfo orig; 664 struct srvsvc_NetCharDevQGetInfo tmp; 665 TALLOC_CTX *out_mem_ctx; 666 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 667}; 668 669static void rpccli_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq); 670 671struct tevent_req *rpccli_srvsvc_NetCharDevQGetInfo_send(TALLOC_CTX *mem_ctx, 672 struct tevent_context *ev, 673 struct rpc_pipe_client *cli, 674 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 675 const char *_queue_name /* [in] [charset(UTF16)] */, 676 const char *_user /* [in] [charset(UTF16)] */, 677 uint32_t _level /* [in] */, 678 union srvsvc_NetCharDevQInfo *_info /* [out] [ref,switch_is(level)] */) 679{ 680 struct tevent_req *req; 681 struct rpccli_srvsvc_NetCharDevQGetInfo_state *state; 682 struct tevent_req *subreq; 683 684 req = tevent_req_create(mem_ctx, &state, 685 struct rpccli_srvsvc_NetCharDevQGetInfo_state); 686 if (req == NULL) { 687 return NULL; 688 } 689 state->out_mem_ctx = NULL; 690 state->dispatch_recv = cli->dispatch_recv; 691 692 /* In parameters */ 693 state->orig.in.server_unc = _server_unc; 694 state->orig.in.queue_name = _queue_name; 695 state->orig.in.user = _user; 696 state->orig.in.level = _level; 697 698 /* Out parameters */ 699 state->orig.out.info = _info; 700 701 /* Result */ 702 ZERO_STRUCT(state->orig.out.result); 703 704 state->out_mem_ctx = talloc_named_const(state, 0, 705 "rpccli_srvsvc_NetCharDevQGetInfo_out_memory"); 706 if (tevent_req_nomem(state->out_mem_ctx, req)) { 707 return tevent_req_post(req, ev); 708 } 709 710 /* make a temporary copy, that we pass to the dispatch function */ 711 state->tmp = state->orig; 712 713 subreq = cli->dispatch_send(state, ev, cli, 714 &ndr_table_srvsvc, 715 NDR_SRVSVC_NETCHARDEVQGETINFO, 716 &state->tmp); 717 if (tevent_req_nomem(subreq, req)) { 718 return tevent_req_post(req, ev); 719 } 720 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQGetInfo_done, req); 721 return req; 722} 723 724static void rpccli_srvsvc_NetCharDevQGetInfo_done(struct tevent_req *subreq) 725{ 726 struct tevent_req *req = tevent_req_callback_data( 727 subreq, struct tevent_req); 728 struct rpccli_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data( 729 req, struct rpccli_srvsvc_NetCharDevQGetInfo_state); 730 NTSTATUS status; 731 TALLOC_CTX *mem_ctx; 732 733 if (state->out_mem_ctx) { 734 mem_ctx = state->out_mem_ctx; 735 } else { 736 mem_ctx = state; 737 } 738 739 status = state->dispatch_recv(subreq, mem_ctx); 740 TALLOC_FREE(subreq); 741 if (!NT_STATUS_IS_OK(status)) { 742 tevent_req_nterror(req, status); 743 return; 744 } 745 746 /* Copy out parameters */ 747 *state->orig.out.info = *state->tmp.out.info; 748 749 /* Copy result */ 750 state->orig.out.result = state->tmp.out.result; 751 752 /* Reset temporary structure */ 753 ZERO_STRUCT(state->tmp); 754 755 tevent_req_done(req); 756} 757 758NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo_recv(struct tevent_req *req, 759 TALLOC_CTX *mem_ctx, 760 WERROR *result) 761{ 762 struct rpccli_srvsvc_NetCharDevQGetInfo_state *state = tevent_req_data( 763 req, struct rpccli_srvsvc_NetCharDevQGetInfo_state); 764 NTSTATUS status; 765 766 if (tevent_req_is_nterror(req, &status)) { 767 tevent_req_received(req); 768 return status; 769 } 770 771 /* Steal possbile out parameters to the callers context */ 772 talloc_steal(mem_ctx, state->out_mem_ctx); 773 774 /* Return result */ 775 *result = state->orig.out.result; 776 777 tevent_req_received(req); 778 return NT_STATUS_OK; 779} 780 781NTSTATUS rpccli_srvsvc_NetCharDevQGetInfo(struct rpc_pipe_client *cli, 782 TALLOC_CTX *mem_ctx, 783 const char *server_unc /* [in] [unique,charset(UTF16)] */, 784 const char *queue_name /* [in] [charset(UTF16)] */, 785 const char *user /* [in] [charset(UTF16)] */, 786 uint32_t level /* [in] */, 787 union srvsvc_NetCharDevQInfo *info /* [out] [ref,switch_is(level)] */, 788 WERROR *werror) 789{ 790 struct srvsvc_NetCharDevQGetInfo r; 791 NTSTATUS status; 792 793 /* In parameters */ 794 r.in.server_unc = server_unc; 795 r.in.queue_name = queue_name; 796 r.in.user = user; 797 r.in.level = level; 798 799 status = cli->dispatch(cli, 800 mem_ctx, 801 &ndr_table_srvsvc, 802 NDR_SRVSVC_NETCHARDEVQGETINFO, 803 &r); 804 805 if (!NT_STATUS_IS_OK(status)) { 806 return status; 807 } 808 809 if (NT_STATUS_IS_ERR(status)) { 810 return status; 811 } 812 813 /* Return variables */ 814 *info = *r.out.info; 815 816 /* Return result */ 817 if (werror) { 818 *werror = r.out.result; 819 } 820 821 return werror_to_ntstatus(r.out.result); 822} 823 824struct rpccli_srvsvc_NetCharDevQSetInfo_state { 825 struct srvsvc_NetCharDevQSetInfo orig; 826 struct srvsvc_NetCharDevQSetInfo tmp; 827 TALLOC_CTX *out_mem_ctx; 828 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 829}; 830 831static void rpccli_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq); 832 833struct tevent_req *rpccli_srvsvc_NetCharDevQSetInfo_send(TALLOC_CTX *mem_ctx, 834 struct tevent_context *ev, 835 struct rpc_pipe_client *cli, 836 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 837 const char *_queue_name /* [in] [charset(UTF16)] */, 838 uint32_t _level /* [in] */, 839 union srvsvc_NetCharDevQInfo _info /* [in] [switch_is(level)] */, 840 uint32_t *_parm_error /* [in,out] [unique] */) 841{ 842 struct tevent_req *req; 843 struct rpccli_srvsvc_NetCharDevQSetInfo_state *state; 844 struct tevent_req *subreq; 845 846 req = tevent_req_create(mem_ctx, &state, 847 struct rpccli_srvsvc_NetCharDevQSetInfo_state); 848 if (req == NULL) { 849 return NULL; 850 } 851 state->out_mem_ctx = NULL; 852 state->dispatch_recv = cli->dispatch_recv; 853 854 /* In parameters */ 855 state->orig.in.server_unc = _server_unc; 856 state->orig.in.queue_name = _queue_name; 857 state->orig.in.level = _level; 858 state->orig.in.info = _info; 859 state->orig.in.parm_error = _parm_error; 860 861 /* Out parameters */ 862 state->orig.out.parm_error = _parm_error; 863 864 /* Result */ 865 ZERO_STRUCT(state->orig.out.result); 866 867 state->out_mem_ctx = talloc_named_const(state, 0, 868 "rpccli_srvsvc_NetCharDevQSetInfo_out_memory"); 869 if (tevent_req_nomem(state->out_mem_ctx, req)) { 870 return tevent_req_post(req, ev); 871 } 872 873 /* make a temporary copy, that we pass to the dispatch function */ 874 state->tmp = state->orig; 875 876 subreq = cli->dispatch_send(state, ev, cli, 877 &ndr_table_srvsvc, 878 NDR_SRVSVC_NETCHARDEVQSETINFO, 879 &state->tmp); 880 if (tevent_req_nomem(subreq, req)) { 881 return tevent_req_post(req, ev); 882 } 883 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQSetInfo_done, req); 884 return req; 885} 886 887static void rpccli_srvsvc_NetCharDevQSetInfo_done(struct tevent_req *subreq) 888{ 889 struct tevent_req *req = tevent_req_callback_data( 890 subreq, struct tevent_req); 891 struct rpccli_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data( 892 req, struct rpccli_srvsvc_NetCharDevQSetInfo_state); 893 NTSTATUS status; 894 TALLOC_CTX *mem_ctx; 895 896 if (state->out_mem_ctx) { 897 mem_ctx = state->out_mem_ctx; 898 } else { 899 mem_ctx = state; 900 } 901 902 status = state->dispatch_recv(subreq, mem_ctx); 903 TALLOC_FREE(subreq); 904 if (!NT_STATUS_IS_OK(status)) { 905 tevent_req_nterror(req, status); 906 return; 907 } 908 909 /* Copy out parameters */ 910 if (state->orig.out.parm_error && state->tmp.out.parm_error) { 911 *state->orig.out.parm_error = *state->tmp.out.parm_error; 912 } 913 914 /* Copy result */ 915 state->orig.out.result = state->tmp.out.result; 916 917 /* Reset temporary structure */ 918 ZERO_STRUCT(state->tmp); 919 920 tevent_req_done(req); 921} 922 923NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo_recv(struct tevent_req *req, 924 TALLOC_CTX *mem_ctx, 925 WERROR *result) 926{ 927 struct rpccli_srvsvc_NetCharDevQSetInfo_state *state = tevent_req_data( 928 req, struct rpccli_srvsvc_NetCharDevQSetInfo_state); 929 NTSTATUS status; 930 931 if (tevent_req_is_nterror(req, &status)) { 932 tevent_req_received(req); 933 return status; 934 } 935 936 /* Steal possbile out parameters to the callers context */ 937 talloc_steal(mem_ctx, state->out_mem_ctx); 938 939 /* Return result */ 940 *result = state->orig.out.result; 941 942 tevent_req_received(req); 943 return NT_STATUS_OK; 944} 945 946NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, 947 TALLOC_CTX *mem_ctx, 948 const char *server_unc /* [in] [unique,charset(UTF16)] */, 949 const char *queue_name /* [in] [charset(UTF16)] */, 950 uint32_t level /* [in] */, 951 union srvsvc_NetCharDevQInfo info /* [in] [switch_is(level)] */, 952 uint32_t *parm_error /* [in,out] [unique] */, 953 WERROR *werror) 954{ 955 struct srvsvc_NetCharDevQSetInfo r; 956 NTSTATUS status; 957 958 /* In parameters */ 959 r.in.server_unc = server_unc; 960 r.in.queue_name = queue_name; 961 r.in.level = level; 962 r.in.info = info; 963 r.in.parm_error = parm_error; 964 965 status = cli->dispatch(cli, 966 mem_ctx, 967 &ndr_table_srvsvc, 968 NDR_SRVSVC_NETCHARDEVQSETINFO, 969 &r); 970 971 if (!NT_STATUS_IS_OK(status)) { 972 return status; 973 } 974 975 if (NT_STATUS_IS_ERR(status)) { 976 return status; 977 } 978 979 /* Return variables */ 980 if (parm_error && r.out.parm_error) { 981 *parm_error = *r.out.parm_error; 982 } 983 984 /* Return result */ 985 if (werror) { 986 *werror = r.out.result; 987 } 988 989 return werror_to_ntstatus(r.out.result); 990} 991 992struct rpccli_srvsvc_NetCharDevQPurge_state { 993 struct srvsvc_NetCharDevQPurge orig; 994 struct srvsvc_NetCharDevQPurge tmp; 995 TALLOC_CTX *out_mem_ctx; 996 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 997}; 998 999static void rpccli_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq); 1000 1001struct tevent_req *rpccli_srvsvc_NetCharDevQPurge_send(TALLOC_CTX *mem_ctx, 1002 struct tevent_context *ev, 1003 struct rpc_pipe_client *cli, 1004 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1005 const char *_queue_name /* [in] [charset(UTF16)] */) 1006{ 1007 struct tevent_req *req; 1008 struct rpccli_srvsvc_NetCharDevQPurge_state *state; 1009 struct tevent_req *subreq; 1010 1011 req = tevent_req_create(mem_ctx, &state, 1012 struct rpccli_srvsvc_NetCharDevQPurge_state); 1013 if (req == NULL) { 1014 return NULL; 1015 } 1016 state->out_mem_ctx = NULL; 1017 state->dispatch_recv = cli->dispatch_recv; 1018 1019 /* In parameters */ 1020 state->orig.in.server_unc = _server_unc; 1021 state->orig.in.queue_name = _queue_name; 1022 1023 /* Out parameters */ 1024 1025 /* Result */ 1026 ZERO_STRUCT(state->orig.out.result); 1027 1028 /* make a temporary copy, that we pass to the dispatch function */ 1029 state->tmp = state->orig; 1030 1031 subreq = cli->dispatch_send(state, ev, cli, 1032 &ndr_table_srvsvc, 1033 NDR_SRVSVC_NETCHARDEVQPURGE, 1034 &state->tmp); 1035 if (tevent_req_nomem(subreq, req)) { 1036 return tevent_req_post(req, ev); 1037 } 1038 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQPurge_done, req); 1039 return req; 1040} 1041 1042static void rpccli_srvsvc_NetCharDevQPurge_done(struct tevent_req *subreq) 1043{ 1044 struct tevent_req *req = tevent_req_callback_data( 1045 subreq, struct tevent_req); 1046 struct rpccli_srvsvc_NetCharDevQPurge_state *state = tevent_req_data( 1047 req, struct rpccli_srvsvc_NetCharDevQPurge_state); 1048 NTSTATUS status; 1049 TALLOC_CTX *mem_ctx; 1050 1051 if (state->out_mem_ctx) { 1052 mem_ctx = state->out_mem_ctx; 1053 } else { 1054 mem_ctx = state; 1055 } 1056 1057 status = state->dispatch_recv(subreq, mem_ctx); 1058 TALLOC_FREE(subreq); 1059 if (!NT_STATUS_IS_OK(status)) { 1060 tevent_req_nterror(req, status); 1061 return; 1062 } 1063 1064 /* Copy out parameters */ 1065 1066 /* Copy result */ 1067 state->orig.out.result = state->tmp.out.result; 1068 1069 /* Reset temporary structure */ 1070 ZERO_STRUCT(state->tmp); 1071 1072 tevent_req_done(req); 1073} 1074 1075NTSTATUS rpccli_srvsvc_NetCharDevQPurge_recv(struct tevent_req *req, 1076 TALLOC_CTX *mem_ctx, 1077 WERROR *result) 1078{ 1079 struct rpccli_srvsvc_NetCharDevQPurge_state *state = tevent_req_data( 1080 req, struct rpccli_srvsvc_NetCharDevQPurge_state); 1081 NTSTATUS status; 1082 1083 if (tevent_req_is_nterror(req, &status)) { 1084 tevent_req_received(req); 1085 return status; 1086 } 1087 1088 /* Steal possbile out parameters to the callers context */ 1089 talloc_steal(mem_ctx, state->out_mem_ctx); 1090 1091 /* Return result */ 1092 *result = state->orig.out.result; 1093 1094 tevent_req_received(req); 1095 return NT_STATUS_OK; 1096} 1097 1098NTSTATUS rpccli_srvsvc_NetCharDevQPurge(struct rpc_pipe_client *cli, 1099 TALLOC_CTX *mem_ctx, 1100 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1101 const char *queue_name /* [in] [charset(UTF16)] */, 1102 WERROR *werror) 1103{ 1104 struct srvsvc_NetCharDevQPurge r; 1105 NTSTATUS status; 1106 1107 /* In parameters */ 1108 r.in.server_unc = server_unc; 1109 r.in.queue_name = queue_name; 1110 1111 status = cli->dispatch(cli, 1112 mem_ctx, 1113 &ndr_table_srvsvc, 1114 NDR_SRVSVC_NETCHARDEVQPURGE, 1115 &r); 1116 1117 if (!NT_STATUS_IS_OK(status)) { 1118 return status; 1119 } 1120 1121 if (NT_STATUS_IS_ERR(status)) { 1122 return status; 1123 } 1124 1125 /* Return variables */ 1126 1127 /* Return result */ 1128 if (werror) { 1129 *werror = r.out.result; 1130 } 1131 1132 return werror_to_ntstatus(r.out.result); 1133} 1134 1135struct rpccli_srvsvc_NetCharDevQPurgeSelf_state { 1136 struct srvsvc_NetCharDevQPurgeSelf orig; 1137 struct srvsvc_NetCharDevQPurgeSelf tmp; 1138 TALLOC_CTX *out_mem_ctx; 1139 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1140}; 1141 1142static void rpccli_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq); 1143 1144struct tevent_req *rpccli_srvsvc_NetCharDevQPurgeSelf_send(TALLOC_CTX *mem_ctx, 1145 struct tevent_context *ev, 1146 struct rpc_pipe_client *cli, 1147 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1148 const char *_queue_name /* [in] [charset(UTF16)] */, 1149 const char *_computer_name /* [in] [charset(UTF16)] */) 1150{ 1151 struct tevent_req *req; 1152 struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state; 1153 struct tevent_req *subreq; 1154 1155 req = tevent_req_create(mem_ctx, &state, 1156 struct rpccli_srvsvc_NetCharDevQPurgeSelf_state); 1157 if (req == NULL) { 1158 return NULL; 1159 } 1160 state->out_mem_ctx = NULL; 1161 state->dispatch_recv = cli->dispatch_recv; 1162 1163 /* In parameters */ 1164 state->orig.in.server_unc = _server_unc; 1165 state->orig.in.queue_name = _queue_name; 1166 state->orig.in.computer_name = _computer_name; 1167 1168 /* Out parameters */ 1169 1170 /* Result */ 1171 ZERO_STRUCT(state->orig.out.result); 1172 1173 /* make a temporary copy, that we pass to the dispatch function */ 1174 state->tmp = state->orig; 1175 1176 subreq = cli->dispatch_send(state, ev, cli, 1177 &ndr_table_srvsvc, 1178 NDR_SRVSVC_NETCHARDEVQPURGESELF, 1179 &state->tmp); 1180 if (tevent_req_nomem(subreq, req)) { 1181 return tevent_req_post(req, ev); 1182 } 1183 tevent_req_set_callback(subreq, rpccli_srvsvc_NetCharDevQPurgeSelf_done, req); 1184 return req; 1185} 1186 1187static void rpccli_srvsvc_NetCharDevQPurgeSelf_done(struct tevent_req *subreq) 1188{ 1189 struct tevent_req *req = tevent_req_callback_data( 1190 subreq, struct tevent_req); 1191 struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data( 1192 req, struct rpccli_srvsvc_NetCharDevQPurgeSelf_state); 1193 NTSTATUS status; 1194 TALLOC_CTX *mem_ctx; 1195 1196 if (state->out_mem_ctx) { 1197 mem_ctx = state->out_mem_ctx; 1198 } else { 1199 mem_ctx = state; 1200 } 1201 1202 status = state->dispatch_recv(subreq, mem_ctx); 1203 TALLOC_FREE(subreq); 1204 if (!NT_STATUS_IS_OK(status)) { 1205 tevent_req_nterror(req, status); 1206 return; 1207 } 1208 1209 /* Copy out parameters */ 1210 1211 /* Copy result */ 1212 state->orig.out.result = state->tmp.out.result; 1213 1214 /* Reset temporary structure */ 1215 ZERO_STRUCT(state->tmp); 1216 1217 tevent_req_done(req); 1218} 1219 1220NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf_recv(struct tevent_req *req, 1221 TALLOC_CTX *mem_ctx, 1222 WERROR *result) 1223{ 1224 struct rpccli_srvsvc_NetCharDevQPurgeSelf_state *state = tevent_req_data( 1225 req, struct rpccli_srvsvc_NetCharDevQPurgeSelf_state); 1226 NTSTATUS status; 1227 1228 if (tevent_req_is_nterror(req, &status)) { 1229 tevent_req_received(req); 1230 return status; 1231 } 1232 1233 /* Steal possbile out parameters to the callers context */ 1234 talloc_steal(mem_ctx, state->out_mem_ctx); 1235 1236 /* Return result */ 1237 *result = state->orig.out.result; 1238 1239 tevent_req_received(req); 1240 return NT_STATUS_OK; 1241} 1242 1243NTSTATUS rpccli_srvsvc_NetCharDevQPurgeSelf(struct rpc_pipe_client *cli, 1244 TALLOC_CTX *mem_ctx, 1245 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1246 const char *queue_name /* [in] [charset(UTF16)] */, 1247 const char *computer_name /* [in] [charset(UTF16)] */, 1248 WERROR *werror) 1249{ 1250 struct srvsvc_NetCharDevQPurgeSelf r; 1251 NTSTATUS status; 1252 1253 /* In parameters */ 1254 r.in.server_unc = server_unc; 1255 r.in.queue_name = queue_name; 1256 r.in.computer_name = computer_name; 1257 1258 status = cli->dispatch(cli, 1259 mem_ctx, 1260 &ndr_table_srvsvc, 1261 NDR_SRVSVC_NETCHARDEVQPURGESELF, 1262 &r); 1263 1264 if (!NT_STATUS_IS_OK(status)) { 1265 return status; 1266 } 1267 1268 if (NT_STATUS_IS_ERR(status)) { 1269 return status; 1270 } 1271 1272 /* Return variables */ 1273 1274 /* Return result */ 1275 if (werror) { 1276 *werror = r.out.result; 1277 } 1278 1279 return werror_to_ntstatus(r.out.result); 1280} 1281 1282struct rpccli_srvsvc_NetConnEnum_state { 1283 struct srvsvc_NetConnEnum orig; 1284 struct srvsvc_NetConnEnum tmp; 1285 TALLOC_CTX *out_mem_ctx; 1286 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1287}; 1288 1289static void rpccli_srvsvc_NetConnEnum_done(struct tevent_req *subreq); 1290 1291struct tevent_req *rpccli_srvsvc_NetConnEnum_send(TALLOC_CTX *mem_ctx, 1292 struct tevent_context *ev, 1293 struct rpc_pipe_client *cli, 1294 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1295 const char *_path /* [in] [unique,charset(UTF16)] */, 1296 struct srvsvc_NetConnInfoCtr *_info_ctr /* [in,out] [ref] */, 1297 uint32_t _max_buffer /* [in] */, 1298 uint32_t *_totalentries /* [out] [ref] */, 1299 uint32_t *_resume_handle /* [in,out] [unique] */) 1300{ 1301 struct tevent_req *req; 1302 struct rpccli_srvsvc_NetConnEnum_state *state; 1303 struct tevent_req *subreq; 1304 1305 req = tevent_req_create(mem_ctx, &state, 1306 struct rpccli_srvsvc_NetConnEnum_state); 1307 if (req == NULL) { 1308 return NULL; 1309 } 1310 state->out_mem_ctx = NULL; 1311 state->dispatch_recv = cli->dispatch_recv; 1312 1313 /* In parameters */ 1314 state->orig.in.server_unc = _server_unc; 1315 state->orig.in.path = _path; 1316 state->orig.in.info_ctr = _info_ctr; 1317 state->orig.in.max_buffer = _max_buffer; 1318 state->orig.in.resume_handle = _resume_handle; 1319 1320 /* Out parameters */ 1321 state->orig.out.info_ctr = _info_ctr; 1322 state->orig.out.totalentries = _totalentries; 1323 state->orig.out.resume_handle = _resume_handle; 1324 1325 /* Result */ 1326 ZERO_STRUCT(state->orig.out.result); 1327 1328 state->out_mem_ctx = talloc_named_const(state, 0, 1329 "rpccli_srvsvc_NetConnEnum_out_memory"); 1330 if (tevent_req_nomem(state->out_mem_ctx, req)) { 1331 return tevent_req_post(req, ev); 1332 } 1333 1334 /* make a temporary copy, that we pass to the dispatch function */ 1335 state->tmp = state->orig; 1336 1337 subreq = cli->dispatch_send(state, ev, cli, 1338 &ndr_table_srvsvc, 1339 NDR_SRVSVC_NETCONNENUM, 1340 &state->tmp); 1341 if (tevent_req_nomem(subreq, req)) { 1342 return tevent_req_post(req, ev); 1343 } 1344 tevent_req_set_callback(subreq, rpccli_srvsvc_NetConnEnum_done, req); 1345 return req; 1346} 1347 1348static void rpccli_srvsvc_NetConnEnum_done(struct tevent_req *subreq) 1349{ 1350 struct tevent_req *req = tevent_req_callback_data( 1351 subreq, struct tevent_req); 1352 struct rpccli_srvsvc_NetConnEnum_state *state = tevent_req_data( 1353 req, struct rpccli_srvsvc_NetConnEnum_state); 1354 NTSTATUS status; 1355 TALLOC_CTX *mem_ctx; 1356 1357 if (state->out_mem_ctx) { 1358 mem_ctx = state->out_mem_ctx; 1359 } else { 1360 mem_ctx = state; 1361 } 1362 1363 status = state->dispatch_recv(subreq, mem_ctx); 1364 TALLOC_FREE(subreq); 1365 if (!NT_STATUS_IS_OK(status)) { 1366 tevent_req_nterror(req, status); 1367 return; 1368 } 1369 1370 /* Copy out parameters */ 1371 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 1372 *state->orig.out.totalentries = *state->tmp.out.totalentries; 1373 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 1374 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 1375 } 1376 1377 /* Copy result */ 1378 state->orig.out.result = state->tmp.out.result; 1379 1380 /* Reset temporary structure */ 1381 ZERO_STRUCT(state->tmp); 1382 1383 tevent_req_done(req); 1384} 1385 1386NTSTATUS rpccli_srvsvc_NetConnEnum_recv(struct tevent_req *req, 1387 TALLOC_CTX *mem_ctx, 1388 WERROR *result) 1389{ 1390 struct rpccli_srvsvc_NetConnEnum_state *state = tevent_req_data( 1391 req, struct rpccli_srvsvc_NetConnEnum_state); 1392 NTSTATUS status; 1393 1394 if (tevent_req_is_nterror(req, &status)) { 1395 tevent_req_received(req); 1396 return status; 1397 } 1398 1399 /* Steal possbile out parameters to the callers context */ 1400 talloc_steal(mem_ctx, state->out_mem_ctx); 1401 1402 /* Return result */ 1403 *result = state->orig.out.result; 1404 1405 tevent_req_received(req); 1406 return NT_STATUS_OK; 1407} 1408 1409NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, 1410 TALLOC_CTX *mem_ctx, 1411 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1412 const char *path /* [in] [unique,charset(UTF16)] */, 1413 struct srvsvc_NetConnInfoCtr *info_ctr /* [in,out] [ref] */, 1414 uint32_t max_buffer /* [in] */, 1415 uint32_t *totalentries /* [out] [ref] */, 1416 uint32_t *resume_handle /* [in,out] [unique] */, 1417 WERROR *werror) 1418{ 1419 struct srvsvc_NetConnEnum r; 1420 NTSTATUS status; 1421 1422 /* In parameters */ 1423 r.in.server_unc = server_unc; 1424 r.in.path = path; 1425 r.in.info_ctr = info_ctr; 1426 r.in.max_buffer = max_buffer; 1427 r.in.resume_handle = resume_handle; 1428 1429 status = cli->dispatch(cli, 1430 mem_ctx, 1431 &ndr_table_srvsvc, 1432 NDR_SRVSVC_NETCONNENUM, 1433 &r); 1434 1435 if (!NT_STATUS_IS_OK(status)) { 1436 return status; 1437 } 1438 1439 if (NT_STATUS_IS_ERR(status)) { 1440 return status; 1441 } 1442 1443 /* Return variables */ 1444 *info_ctr = *r.out.info_ctr; 1445 *totalentries = *r.out.totalentries; 1446 if (resume_handle && r.out.resume_handle) { 1447 *resume_handle = *r.out.resume_handle; 1448 } 1449 1450 /* Return result */ 1451 if (werror) { 1452 *werror = r.out.result; 1453 } 1454 1455 return werror_to_ntstatus(r.out.result); 1456} 1457 1458struct rpccli_srvsvc_NetFileEnum_state { 1459 struct srvsvc_NetFileEnum orig; 1460 struct srvsvc_NetFileEnum tmp; 1461 TALLOC_CTX *out_mem_ctx; 1462 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1463}; 1464 1465static void rpccli_srvsvc_NetFileEnum_done(struct tevent_req *subreq); 1466 1467struct tevent_req *rpccli_srvsvc_NetFileEnum_send(TALLOC_CTX *mem_ctx, 1468 struct tevent_context *ev, 1469 struct rpc_pipe_client *cli, 1470 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1471 const char *_path /* [in] [unique,charset(UTF16)] */, 1472 const char *_user /* [in] [unique,charset(UTF16)] */, 1473 struct srvsvc_NetFileInfoCtr *_info_ctr /* [in,out] [ref] */, 1474 uint32_t _max_buffer /* [in] */, 1475 uint32_t *_totalentries /* [out] [ref] */, 1476 uint32_t *_resume_handle /* [in,out] [unique] */) 1477{ 1478 struct tevent_req *req; 1479 struct rpccli_srvsvc_NetFileEnum_state *state; 1480 struct tevent_req *subreq; 1481 1482 req = tevent_req_create(mem_ctx, &state, 1483 struct rpccli_srvsvc_NetFileEnum_state); 1484 if (req == NULL) { 1485 return NULL; 1486 } 1487 state->out_mem_ctx = NULL; 1488 state->dispatch_recv = cli->dispatch_recv; 1489 1490 /* In parameters */ 1491 state->orig.in.server_unc = _server_unc; 1492 state->orig.in.path = _path; 1493 state->orig.in.user = _user; 1494 state->orig.in.info_ctr = _info_ctr; 1495 state->orig.in.max_buffer = _max_buffer; 1496 state->orig.in.resume_handle = _resume_handle; 1497 1498 /* Out parameters */ 1499 state->orig.out.info_ctr = _info_ctr; 1500 state->orig.out.totalentries = _totalentries; 1501 state->orig.out.resume_handle = _resume_handle; 1502 1503 /* Result */ 1504 ZERO_STRUCT(state->orig.out.result); 1505 1506 state->out_mem_ctx = talloc_named_const(state, 0, 1507 "rpccli_srvsvc_NetFileEnum_out_memory"); 1508 if (tevent_req_nomem(state->out_mem_ctx, req)) { 1509 return tevent_req_post(req, ev); 1510 } 1511 1512 /* make a temporary copy, that we pass to the dispatch function */ 1513 state->tmp = state->orig; 1514 1515 subreq = cli->dispatch_send(state, ev, cli, 1516 &ndr_table_srvsvc, 1517 NDR_SRVSVC_NETFILEENUM, 1518 &state->tmp); 1519 if (tevent_req_nomem(subreq, req)) { 1520 return tevent_req_post(req, ev); 1521 } 1522 tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileEnum_done, req); 1523 return req; 1524} 1525 1526static void rpccli_srvsvc_NetFileEnum_done(struct tevent_req *subreq) 1527{ 1528 struct tevent_req *req = tevent_req_callback_data( 1529 subreq, struct tevent_req); 1530 struct rpccli_srvsvc_NetFileEnum_state *state = tevent_req_data( 1531 req, struct rpccli_srvsvc_NetFileEnum_state); 1532 NTSTATUS status; 1533 TALLOC_CTX *mem_ctx; 1534 1535 if (state->out_mem_ctx) { 1536 mem_ctx = state->out_mem_ctx; 1537 } else { 1538 mem_ctx = state; 1539 } 1540 1541 status = state->dispatch_recv(subreq, mem_ctx); 1542 TALLOC_FREE(subreq); 1543 if (!NT_STATUS_IS_OK(status)) { 1544 tevent_req_nterror(req, status); 1545 return; 1546 } 1547 1548 /* Copy out parameters */ 1549 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 1550 *state->orig.out.totalentries = *state->tmp.out.totalentries; 1551 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 1552 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 1553 } 1554 1555 /* Copy result */ 1556 state->orig.out.result = state->tmp.out.result; 1557 1558 /* Reset temporary structure */ 1559 ZERO_STRUCT(state->tmp); 1560 1561 tevent_req_done(req); 1562} 1563 1564NTSTATUS rpccli_srvsvc_NetFileEnum_recv(struct tevent_req *req, 1565 TALLOC_CTX *mem_ctx, 1566 WERROR *result) 1567{ 1568 struct rpccli_srvsvc_NetFileEnum_state *state = tevent_req_data( 1569 req, struct rpccli_srvsvc_NetFileEnum_state); 1570 NTSTATUS status; 1571 1572 if (tevent_req_is_nterror(req, &status)) { 1573 tevent_req_received(req); 1574 return status; 1575 } 1576 1577 /* Steal possbile out parameters to the callers context */ 1578 talloc_steal(mem_ctx, state->out_mem_ctx); 1579 1580 /* Return result */ 1581 *result = state->orig.out.result; 1582 1583 tevent_req_received(req); 1584 return NT_STATUS_OK; 1585} 1586 1587NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, 1588 TALLOC_CTX *mem_ctx, 1589 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1590 const char *path /* [in] [unique,charset(UTF16)] */, 1591 const char *user /* [in] [unique,charset(UTF16)] */, 1592 struct srvsvc_NetFileInfoCtr *info_ctr /* [in,out] [ref] */, 1593 uint32_t max_buffer /* [in] */, 1594 uint32_t *totalentries /* [out] [ref] */, 1595 uint32_t *resume_handle /* [in,out] [unique] */, 1596 WERROR *werror) 1597{ 1598 struct srvsvc_NetFileEnum r; 1599 NTSTATUS status; 1600 1601 /* In parameters */ 1602 r.in.server_unc = server_unc; 1603 r.in.path = path; 1604 r.in.user = user; 1605 r.in.info_ctr = info_ctr; 1606 r.in.max_buffer = max_buffer; 1607 r.in.resume_handle = resume_handle; 1608 1609 status = cli->dispatch(cli, 1610 mem_ctx, 1611 &ndr_table_srvsvc, 1612 NDR_SRVSVC_NETFILEENUM, 1613 &r); 1614 1615 if (!NT_STATUS_IS_OK(status)) { 1616 return status; 1617 } 1618 1619 if (NT_STATUS_IS_ERR(status)) { 1620 return status; 1621 } 1622 1623 /* Return variables */ 1624 *info_ctr = *r.out.info_ctr; 1625 *totalentries = *r.out.totalentries; 1626 if (resume_handle && r.out.resume_handle) { 1627 *resume_handle = *r.out.resume_handle; 1628 } 1629 1630 /* Return result */ 1631 if (werror) { 1632 *werror = r.out.result; 1633 } 1634 1635 return werror_to_ntstatus(r.out.result); 1636} 1637 1638struct rpccli_srvsvc_NetFileGetInfo_state { 1639 struct srvsvc_NetFileGetInfo orig; 1640 struct srvsvc_NetFileGetInfo tmp; 1641 TALLOC_CTX *out_mem_ctx; 1642 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1643}; 1644 1645static void rpccli_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq); 1646 1647struct tevent_req *rpccli_srvsvc_NetFileGetInfo_send(TALLOC_CTX *mem_ctx, 1648 struct tevent_context *ev, 1649 struct rpc_pipe_client *cli, 1650 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1651 uint32_t _fid /* [in] */, 1652 uint32_t _level /* [in] */, 1653 union srvsvc_NetFileInfo *_info /* [out] [ref,switch_is(level)] */) 1654{ 1655 struct tevent_req *req; 1656 struct rpccli_srvsvc_NetFileGetInfo_state *state; 1657 struct tevent_req *subreq; 1658 1659 req = tevent_req_create(mem_ctx, &state, 1660 struct rpccli_srvsvc_NetFileGetInfo_state); 1661 if (req == NULL) { 1662 return NULL; 1663 } 1664 state->out_mem_ctx = NULL; 1665 state->dispatch_recv = cli->dispatch_recv; 1666 1667 /* In parameters */ 1668 state->orig.in.server_unc = _server_unc; 1669 state->orig.in.fid = _fid; 1670 state->orig.in.level = _level; 1671 1672 /* Out parameters */ 1673 state->orig.out.info = _info; 1674 1675 /* Result */ 1676 ZERO_STRUCT(state->orig.out.result); 1677 1678 state->out_mem_ctx = talloc_named_const(state, 0, 1679 "rpccli_srvsvc_NetFileGetInfo_out_memory"); 1680 if (tevent_req_nomem(state->out_mem_ctx, req)) { 1681 return tevent_req_post(req, ev); 1682 } 1683 1684 /* make a temporary copy, that we pass to the dispatch function */ 1685 state->tmp = state->orig; 1686 1687 subreq = cli->dispatch_send(state, ev, cli, 1688 &ndr_table_srvsvc, 1689 NDR_SRVSVC_NETFILEGETINFO, 1690 &state->tmp); 1691 if (tevent_req_nomem(subreq, req)) { 1692 return tevent_req_post(req, ev); 1693 } 1694 tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileGetInfo_done, req); 1695 return req; 1696} 1697 1698static void rpccli_srvsvc_NetFileGetInfo_done(struct tevent_req *subreq) 1699{ 1700 struct tevent_req *req = tevent_req_callback_data( 1701 subreq, struct tevent_req); 1702 struct rpccli_srvsvc_NetFileGetInfo_state *state = tevent_req_data( 1703 req, struct rpccli_srvsvc_NetFileGetInfo_state); 1704 NTSTATUS status; 1705 TALLOC_CTX *mem_ctx; 1706 1707 if (state->out_mem_ctx) { 1708 mem_ctx = state->out_mem_ctx; 1709 } else { 1710 mem_ctx = state; 1711 } 1712 1713 status = state->dispatch_recv(subreq, mem_ctx); 1714 TALLOC_FREE(subreq); 1715 if (!NT_STATUS_IS_OK(status)) { 1716 tevent_req_nterror(req, status); 1717 return; 1718 } 1719 1720 /* Copy out parameters */ 1721 *state->orig.out.info = *state->tmp.out.info; 1722 1723 /* Copy result */ 1724 state->orig.out.result = state->tmp.out.result; 1725 1726 /* Reset temporary structure */ 1727 ZERO_STRUCT(state->tmp); 1728 1729 tevent_req_done(req); 1730} 1731 1732NTSTATUS rpccli_srvsvc_NetFileGetInfo_recv(struct tevent_req *req, 1733 TALLOC_CTX *mem_ctx, 1734 WERROR *result) 1735{ 1736 struct rpccli_srvsvc_NetFileGetInfo_state *state = tevent_req_data( 1737 req, struct rpccli_srvsvc_NetFileGetInfo_state); 1738 NTSTATUS status; 1739 1740 if (tevent_req_is_nterror(req, &status)) { 1741 tevent_req_received(req); 1742 return status; 1743 } 1744 1745 /* Steal possbile out parameters to the callers context */ 1746 talloc_steal(mem_ctx, state->out_mem_ctx); 1747 1748 /* Return result */ 1749 *result = state->orig.out.result; 1750 1751 tevent_req_received(req); 1752 return NT_STATUS_OK; 1753} 1754 1755NTSTATUS rpccli_srvsvc_NetFileGetInfo(struct rpc_pipe_client *cli, 1756 TALLOC_CTX *mem_ctx, 1757 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1758 uint32_t fid /* [in] */, 1759 uint32_t level /* [in] */, 1760 union srvsvc_NetFileInfo *info /* [out] [ref,switch_is(level)] */, 1761 WERROR *werror) 1762{ 1763 struct srvsvc_NetFileGetInfo r; 1764 NTSTATUS status; 1765 1766 /* In parameters */ 1767 r.in.server_unc = server_unc; 1768 r.in.fid = fid; 1769 r.in.level = level; 1770 1771 status = cli->dispatch(cli, 1772 mem_ctx, 1773 &ndr_table_srvsvc, 1774 NDR_SRVSVC_NETFILEGETINFO, 1775 &r); 1776 1777 if (!NT_STATUS_IS_OK(status)) { 1778 return status; 1779 } 1780 1781 if (NT_STATUS_IS_ERR(status)) { 1782 return status; 1783 } 1784 1785 /* Return variables */ 1786 *info = *r.out.info; 1787 1788 /* Return result */ 1789 if (werror) { 1790 *werror = r.out.result; 1791 } 1792 1793 return werror_to_ntstatus(r.out.result); 1794} 1795 1796struct rpccli_srvsvc_NetFileClose_state { 1797 struct srvsvc_NetFileClose orig; 1798 struct srvsvc_NetFileClose tmp; 1799 TALLOC_CTX *out_mem_ctx; 1800 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1801}; 1802 1803static void rpccli_srvsvc_NetFileClose_done(struct tevent_req *subreq); 1804 1805struct tevent_req *rpccli_srvsvc_NetFileClose_send(TALLOC_CTX *mem_ctx, 1806 struct tevent_context *ev, 1807 struct rpc_pipe_client *cli, 1808 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1809 uint32_t _fid /* [in] */) 1810{ 1811 struct tevent_req *req; 1812 struct rpccli_srvsvc_NetFileClose_state *state; 1813 struct tevent_req *subreq; 1814 1815 req = tevent_req_create(mem_ctx, &state, 1816 struct rpccli_srvsvc_NetFileClose_state); 1817 if (req == NULL) { 1818 return NULL; 1819 } 1820 state->out_mem_ctx = NULL; 1821 state->dispatch_recv = cli->dispatch_recv; 1822 1823 /* In parameters */ 1824 state->orig.in.server_unc = _server_unc; 1825 state->orig.in.fid = _fid; 1826 1827 /* Out parameters */ 1828 1829 /* Result */ 1830 ZERO_STRUCT(state->orig.out.result); 1831 1832 /* make a temporary copy, that we pass to the dispatch function */ 1833 state->tmp = state->orig; 1834 1835 subreq = cli->dispatch_send(state, ev, cli, 1836 &ndr_table_srvsvc, 1837 NDR_SRVSVC_NETFILECLOSE, 1838 &state->tmp); 1839 if (tevent_req_nomem(subreq, req)) { 1840 return tevent_req_post(req, ev); 1841 } 1842 tevent_req_set_callback(subreq, rpccli_srvsvc_NetFileClose_done, req); 1843 return req; 1844} 1845 1846static void rpccli_srvsvc_NetFileClose_done(struct tevent_req *subreq) 1847{ 1848 struct tevent_req *req = tevent_req_callback_data( 1849 subreq, struct tevent_req); 1850 struct rpccli_srvsvc_NetFileClose_state *state = tevent_req_data( 1851 req, struct rpccli_srvsvc_NetFileClose_state); 1852 NTSTATUS status; 1853 TALLOC_CTX *mem_ctx; 1854 1855 if (state->out_mem_ctx) { 1856 mem_ctx = state->out_mem_ctx; 1857 } else { 1858 mem_ctx = state; 1859 } 1860 1861 status = state->dispatch_recv(subreq, mem_ctx); 1862 TALLOC_FREE(subreq); 1863 if (!NT_STATUS_IS_OK(status)) { 1864 tevent_req_nterror(req, status); 1865 return; 1866 } 1867 1868 /* Copy out parameters */ 1869 1870 /* Copy result */ 1871 state->orig.out.result = state->tmp.out.result; 1872 1873 /* Reset temporary structure */ 1874 ZERO_STRUCT(state->tmp); 1875 1876 tevent_req_done(req); 1877} 1878 1879NTSTATUS rpccli_srvsvc_NetFileClose_recv(struct tevent_req *req, 1880 TALLOC_CTX *mem_ctx, 1881 WERROR *result) 1882{ 1883 struct rpccli_srvsvc_NetFileClose_state *state = tevent_req_data( 1884 req, struct rpccli_srvsvc_NetFileClose_state); 1885 NTSTATUS status; 1886 1887 if (tevent_req_is_nterror(req, &status)) { 1888 tevent_req_received(req); 1889 return status; 1890 } 1891 1892 /* Steal possbile out parameters to the callers context */ 1893 talloc_steal(mem_ctx, state->out_mem_ctx); 1894 1895 /* Return result */ 1896 *result = state->orig.out.result; 1897 1898 tevent_req_received(req); 1899 return NT_STATUS_OK; 1900} 1901 1902NTSTATUS rpccli_srvsvc_NetFileClose(struct rpc_pipe_client *cli, 1903 TALLOC_CTX *mem_ctx, 1904 const char *server_unc /* [in] [unique,charset(UTF16)] */, 1905 uint32_t fid /* [in] */, 1906 WERROR *werror) 1907{ 1908 struct srvsvc_NetFileClose r; 1909 NTSTATUS status; 1910 1911 /* In parameters */ 1912 r.in.server_unc = server_unc; 1913 r.in.fid = fid; 1914 1915 status = cli->dispatch(cli, 1916 mem_ctx, 1917 &ndr_table_srvsvc, 1918 NDR_SRVSVC_NETFILECLOSE, 1919 &r); 1920 1921 if (!NT_STATUS_IS_OK(status)) { 1922 return status; 1923 } 1924 1925 if (NT_STATUS_IS_ERR(status)) { 1926 return status; 1927 } 1928 1929 /* Return variables */ 1930 1931 /* Return result */ 1932 if (werror) { 1933 *werror = r.out.result; 1934 } 1935 1936 return werror_to_ntstatus(r.out.result); 1937} 1938 1939struct rpccli_srvsvc_NetSessEnum_state { 1940 struct srvsvc_NetSessEnum orig; 1941 struct srvsvc_NetSessEnum tmp; 1942 TALLOC_CTX *out_mem_ctx; 1943 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 1944}; 1945 1946static void rpccli_srvsvc_NetSessEnum_done(struct tevent_req *subreq); 1947 1948struct tevent_req *rpccli_srvsvc_NetSessEnum_send(TALLOC_CTX *mem_ctx, 1949 struct tevent_context *ev, 1950 struct rpc_pipe_client *cli, 1951 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 1952 const char *_client /* [in] [unique,charset(UTF16)] */, 1953 const char *_user /* [in] [unique,charset(UTF16)] */, 1954 struct srvsvc_NetSessInfoCtr *_info_ctr /* [in,out] [ref] */, 1955 uint32_t _max_buffer /* [in] */, 1956 uint32_t *_totalentries /* [out] [ref] */, 1957 uint32_t *_resume_handle /* [in,out] [unique] */) 1958{ 1959 struct tevent_req *req; 1960 struct rpccli_srvsvc_NetSessEnum_state *state; 1961 struct tevent_req *subreq; 1962 1963 req = tevent_req_create(mem_ctx, &state, 1964 struct rpccli_srvsvc_NetSessEnum_state); 1965 if (req == NULL) { 1966 return NULL; 1967 } 1968 state->out_mem_ctx = NULL; 1969 state->dispatch_recv = cli->dispatch_recv; 1970 1971 /* In parameters */ 1972 state->orig.in.server_unc = _server_unc; 1973 state->orig.in.client = _client; 1974 state->orig.in.user = _user; 1975 state->orig.in.info_ctr = _info_ctr; 1976 state->orig.in.max_buffer = _max_buffer; 1977 state->orig.in.resume_handle = _resume_handle; 1978 1979 /* Out parameters */ 1980 state->orig.out.info_ctr = _info_ctr; 1981 state->orig.out.totalentries = _totalentries; 1982 state->orig.out.resume_handle = _resume_handle; 1983 1984 /* Result */ 1985 ZERO_STRUCT(state->orig.out.result); 1986 1987 state->out_mem_ctx = talloc_named_const(state, 0, 1988 "rpccli_srvsvc_NetSessEnum_out_memory"); 1989 if (tevent_req_nomem(state->out_mem_ctx, req)) { 1990 return tevent_req_post(req, ev); 1991 } 1992 1993 /* make a temporary copy, that we pass to the dispatch function */ 1994 state->tmp = state->orig; 1995 1996 subreq = cli->dispatch_send(state, ev, cli, 1997 &ndr_table_srvsvc, 1998 NDR_SRVSVC_NETSESSENUM, 1999 &state->tmp); 2000 if (tevent_req_nomem(subreq, req)) { 2001 return tevent_req_post(req, ev); 2002 } 2003 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSessEnum_done, req); 2004 return req; 2005} 2006 2007static void rpccli_srvsvc_NetSessEnum_done(struct tevent_req *subreq) 2008{ 2009 struct tevent_req *req = tevent_req_callback_data( 2010 subreq, struct tevent_req); 2011 struct rpccli_srvsvc_NetSessEnum_state *state = tevent_req_data( 2012 req, struct rpccli_srvsvc_NetSessEnum_state); 2013 NTSTATUS status; 2014 TALLOC_CTX *mem_ctx; 2015 2016 if (state->out_mem_ctx) { 2017 mem_ctx = state->out_mem_ctx; 2018 } else { 2019 mem_ctx = state; 2020 } 2021 2022 status = state->dispatch_recv(subreq, mem_ctx); 2023 TALLOC_FREE(subreq); 2024 if (!NT_STATUS_IS_OK(status)) { 2025 tevent_req_nterror(req, status); 2026 return; 2027 } 2028 2029 /* Copy out parameters */ 2030 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 2031 *state->orig.out.totalentries = *state->tmp.out.totalentries; 2032 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 2033 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 2034 } 2035 2036 /* Copy result */ 2037 state->orig.out.result = state->tmp.out.result; 2038 2039 /* Reset temporary structure */ 2040 ZERO_STRUCT(state->tmp); 2041 2042 tevent_req_done(req); 2043} 2044 2045NTSTATUS rpccli_srvsvc_NetSessEnum_recv(struct tevent_req *req, 2046 TALLOC_CTX *mem_ctx, 2047 WERROR *result) 2048{ 2049 struct rpccli_srvsvc_NetSessEnum_state *state = tevent_req_data( 2050 req, struct rpccli_srvsvc_NetSessEnum_state); 2051 NTSTATUS status; 2052 2053 if (tevent_req_is_nterror(req, &status)) { 2054 tevent_req_received(req); 2055 return status; 2056 } 2057 2058 /* Steal possbile out parameters to the callers context */ 2059 talloc_steal(mem_ctx, state->out_mem_ctx); 2060 2061 /* Return result */ 2062 *result = state->orig.out.result; 2063 2064 tevent_req_received(req); 2065 return NT_STATUS_OK; 2066} 2067 2068NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, 2069 TALLOC_CTX *mem_ctx, 2070 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2071 const char *client /* [in] [unique,charset(UTF16)] */, 2072 const char *user /* [in] [unique,charset(UTF16)] */, 2073 struct srvsvc_NetSessInfoCtr *info_ctr /* [in,out] [ref] */, 2074 uint32_t max_buffer /* [in] */, 2075 uint32_t *totalentries /* [out] [ref] */, 2076 uint32_t *resume_handle /* [in,out] [unique] */, 2077 WERROR *werror) 2078{ 2079 struct srvsvc_NetSessEnum r; 2080 NTSTATUS status; 2081 2082 /* In parameters */ 2083 r.in.server_unc = server_unc; 2084 r.in.client = client; 2085 r.in.user = user; 2086 r.in.info_ctr = info_ctr; 2087 r.in.max_buffer = max_buffer; 2088 r.in.resume_handle = resume_handle; 2089 2090 status = cli->dispatch(cli, 2091 mem_ctx, 2092 &ndr_table_srvsvc, 2093 NDR_SRVSVC_NETSESSENUM, 2094 &r); 2095 2096 if (!NT_STATUS_IS_OK(status)) { 2097 return status; 2098 } 2099 2100 if (NT_STATUS_IS_ERR(status)) { 2101 return status; 2102 } 2103 2104 /* Return variables */ 2105 *info_ctr = *r.out.info_ctr; 2106 *totalentries = *r.out.totalentries; 2107 if (resume_handle && r.out.resume_handle) { 2108 *resume_handle = *r.out.resume_handle; 2109 } 2110 2111 /* Return result */ 2112 if (werror) { 2113 *werror = r.out.result; 2114 } 2115 2116 return werror_to_ntstatus(r.out.result); 2117} 2118 2119struct rpccli_srvsvc_NetSessDel_state { 2120 struct srvsvc_NetSessDel orig; 2121 struct srvsvc_NetSessDel tmp; 2122 TALLOC_CTX *out_mem_ctx; 2123 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2124}; 2125 2126static void rpccli_srvsvc_NetSessDel_done(struct tevent_req *subreq); 2127 2128struct tevent_req *rpccli_srvsvc_NetSessDel_send(TALLOC_CTX *mem_ctx, 2129 struct tevent_context *ev, 2130 struct rpc_pipe_client *cli, 2131 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2132 const char *_client /* [in] [unique,charset(UTF16)] */, 2133 const char *_user /* [in] [unique,charset(UTF16)] */) 2134{ 2135 struct tevent_req *req; 2136 struct rpccli_srvsvc_NetSessDel_state *state; 2137 struct tevent_req *subreq; 2138 2139 req = tevent_req_create(mem_ctx, &state, 2140 struct rpccli_srvsvc_NetSessDel_state); 2141 if (req == NULL) { 2142 return NULL; 2143 } 2144 state->out_mem_ctx = NULL; 2145 state->dispatch_recv = cli->dispatch_recv; 2146 2147 /* In parameters */ 2148 state->orig.in.server_unc = _server_unc; 2149 state->orig.in.client = _client; 2150 state->orig.in.user = _user; 2151 2152 /* Out parameters */ 2153 2154 /* Result */ 2155 ZERO_STRUCT(state->orig.out.result); 2156 2157 /* make a temporary copy, that we pass to the dispatch function */ 2158 state->tmp = state->orig; 2159 2160 subreq = cli->dispatch_send(state, ev, cli, 2161 &ndr_table_srvsvc, 2162 NDR_SRVSVC_NETSESSDEL, 2163 &state->tmp); 2164 if (tevent_req_nomem(subreq, req)) { 2165 return tevent_req_post(req, ev); 2166 } 2167 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSessDel_done, req); 2168 return req; 2169} 2170 2171static void rpccli_srvsvc_NetSessDel_done(struct tevent_req *subreq) 2172{ 2173 struct tevent_req *req = tevent_req_callback_data( 2174 subreq, struct tevent_req); 2175 struct rpccli_srvsvc_NetSessDel_state *state = tevent_req_data( 2176 req, struct rpccli_srvsvc_NetSessDel_state); 2177 NTSTATUS status; 2178 TALLOC_CTX *mem_ctx; 2179 2180 if (state->out_mem_ctx) { 2181 mem_ctx = state->out_mem_ctx; 2182 } else { 2183 mem_ctx = state; 2184 } 2185 2186 status = state->dispatch_recv(subreq, mem_ctx); 2187 TALLOC_FREE(subreq); 2188 if (!NT_STATUS_IS_OK(status)) { 2189 tevent_req_nterror(req, status); 2190 return; 2191 } 2192 2193 /* Copy out parameters */ 2194 2195 /* Copy result */ 2196 state->orig.out.result = state->tmp.out.result; 2197 2198 /* Reset temporary structure */ 2199 ZERO_STRUCT(state->tmp); 2200 2201 tevent_req_done(req); 2202} 2203 2204NTSTATUS rpccli_srvsvc_NetSessDel_recv(struct tevent_req *req, 2205 TALLOC_CTX *mem_ctx, 2206 WERROR *result) 2207{ 2208 struct rpccli_srvsvc_NetSessDel_state *state = tevent_req_data( 2209 req, struct rpccli_srvsvc_NetSessDel_state); 2210 NTSTATUS status; 2211 2212 if (tevent_req_is_nterror(req, &status)) { 2213 tevent_req_received(req); 2214 return status; 2215 } 2216 2217 /* Steal possbile out parameters to the callers context */ 2218 talloc_steal(mem_ctx, state->out_mem_ctx); 2219 2220 /* Return result */ 2221 *result = state->orig.out.result; 2222 2223 tevent_req_received(req); 2224 return NT_STATUS_OK; 2225} 2226 2227NTSTATUS rpccli_srvsvc_NetSessDel(struct rpc_pipe_client *cli, 2228 TALLOC_CTX *mem_ctx, 2229 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2230 const char *client /* [in] [unique,charset(UTF16)] */, 2231 const char *user /* [in] [unique,charset(UTF16)] */, 2232 WERROR *werror) 2233{ 2234 struct srvsvc_NetSessDel r; 2235 NTSTATUS status; 2236 2237 /* In parameters */ 2238 r.in.server_unc = server_unc; 2239 r.in.client = client; 2240 r.in.user = user; 2241 2242 status = cli->dispatch(cli, 2243 mem_ctx, 2244 &ndr_table_srvsvc, 2245 NDR_SRVSVC_NETSESSDEL, 2246 &r); 2247 2248 if (!NT_STATUS_IS_OK(status)) { 2249 return status; 2250 } 2251 2252 if (NT_STATUS_IS_ERR(status)) { 2253 return status; 2254 } 2255 2256 /* Return variables */ 2257 2258 /* Return result */ 2259 if (werror) { 2260 *werror = r.out.result; 2261 } 2262 2263 return werror_to_ntstatus(r.out.result); 2264} 2265 2266struct rpccli_srvsvc_NetShareAdd_state { 2267 struct srvsvc_NetShareAdd orig; 2268 struct srvsvc_NetShareAdd tmp; 2269 TALLOC_CTX *out_mem_ctx; 2270 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2271}; 2272 2273static void rpccli_srvsvc_NetShareAdd_done(struct tevent_req *subreq); 2274 2275struct tevent_req *rpccli_srvsvc_NetShareAdd_send(TALLOC_CTX *mem_ctx, 2276 struct tevent_context *ev, 2277 struct rpc_pipe_client *cli, 2278 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2279 uint32_t _level /* [in] */, 2280 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */, 2281 uint32_t *_parm_error /* [in,out] [unique] */) 2282{ 2283 struct tevent_req *req; 2284 struct rpccli_srvsvc_NetShareAdd_state *state; 2285 struct tevent_req *subreq; 2286 2287 req = tevent_req_create(mem_ctx, &state, 2288 struct rpccli_srvsvc_NetShareAdd_state); 2289 if (req == NULL) { 2290 return NULL; 2291 } 2292 state->out_mem_ctx = NULL; 2293 state->dispatch_recv = cli->dispatch_recv; 2294 2295 /* In parameters */ 2296 state->orig.in.server_unc = _server_unc; 2297 state->orig.in.level = _level; 2298 state->orig.in.info = _info; 2299 state->orig.in.parm_error = _parm_error; 2300 2301 /* Out parameters */ 2302 state->orig.out.parm_error = _parm_error; 2303 2304 /* Result */ 2305 ZERO_STRUCT(state->orig.out.result); 2306 2307 state->out_mem_ctx = talloc_named_const(state, 0, 2308 "rpccli_srvsvc_NetShareAdd_out_memory"); 2309 if (tevent_req_nomem(state->out_mem_ctx, req)) { 2310 return tevent_req_post(req, ev); 2311 } 2312 2313 /* make a temporary copy, that we pass to the dispatch function */ 2314 state->tmp = state->orig; 2315 2316 subreq = cli->dispatch_send(state, ev, cli, 2317 &ndr_table_srvsvc, 2318 NDR_SRVSVC_NETSHAREADD, 2319 &state->tmp); 2320 if (tevent_req_nomem(subreq, req)) { 2321 return tevent_req_post(req, ev); 2322 } 2323 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareAdd_done, req); 2324 return req; 2325} 2326 2327static void rpccli_srvsvc_NetShareAdd_done(struct tevent_req *subreq) 2328{ 2329 struct tevent_req *req = tevent_req_callback_data( 2330 subreq, struct tevent_req); 2331 struct rpccli_srvsvc_NetShareAdd_state *state = tevent_req_data( 2332 req, struct rpccli_srvsvc_NetShareAdd_state); 2333 NTSTATUS status; 2334 TALLOC_CTX *mem_ctx; 2335 2336 if (state->out_mem_ctx) { 2337 mem_ctx = state->out_mem_ctx; 2338 } else { 2339 mem_ctx = state; 2340 } 2341 2342 status = state->dispatch_recv(subreq, mem_ctx); 2343 TALLOC_FREE(subreq); 2344 if (!NT_STATUS_IS_OK(status)) { 2345 tevent_req_nterror(req, status); 2346 return; 2347 } 2348 2349 /* Copy out parameters */ 2350 if (state->orig.out.parm_error && state->tmp.out.parm_error) { 2351 *state->orig.out.parm_error = *state->tmp.out.parm_error; 2352 } 2353 2354 /* Copy result */ 2355 state->orig.out.result = state->tmp.out.result; 2356 2357 /* Reset temporary structure */ 2358 ZERO_STRUCT(state->tmp); 2359 2360 tevent_req_done(req); 2361} 2362 2363NTSTATUS rpccli_srvsvc_NetShareAdd_recv(struct tevent_req *req, 2364 TALLOC_CTX *mem_ctx, 2365 WERROR *result) 2366{ 2367 struct rpccli_srvsvc_NetShareAdd_state *state = tevent_req_data( 2368 req, struct rpccli_srvsvc_NetShareAdd_state); 2369 NTSTATUS status; 2370 2371 if (tevent_req_is_nterror(req, &status)) { 2372 tevent_req_received(req); 2373 return status; 2374 } 2375 2376 /* Steal possbile out parameters to the callers context */ 2377 talloc_steal(mem_ctx, state->out_mem_ctx); 2378 2379 /* Return result */ 2380 *result = state->orig.out.result; 2381 2382 tevent_req_received(req); 2383 return NT_STATUS_OK; 2384} 2385 2386NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, 2387 TALLOC_CTX *mem_ctx, 2388 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2389 uint32_t level /* [in] */, 2390 union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, 2391 uint32_t *parm_error /* [in,out] [unique] */, 2392 WERROR *werror) 2393{ 2394 struct srvsvc_NetShareAdd r; 2395 NTSTATUS status; 2396 2397 /* In parameters */ 2398 r.in.server_unc = server_unc; 2399 r.in.level = level; 2400 r.in.info = info; 2401 r.in.parm_error = parm_error; 2402 2403 status = cli->dispatch(cli, 2404 mem_ctx, 2405 &ndr_table_srvsvc, 2406 NDR_SRVSVC_NETSHAREADD, 2407 &r); 2408 2409 if (!NT_STATUS_IS_OK(status)) { 2410 return status; 2411 } 2412 2413 if (NT_STATUS_IS_ERR(status)) { 2414 return status; 2415 } 2416 2417 /* Return variables */ 2418 if (parm_error && r.out.parm_error) { 2419 *parm_error = *r.out.parm_error; 2420 } 2421 2422 /* Return result */ 2423 if (werror) { 2424 *werror = r.out.result; 2425 } 2426 2427 return werror_to_ntstatus(r.out.result); 2428} 2429 2430struct rpccli_srvsvc_NetShareEnumAll_state { 2431 struct srvsvc_NetShareEnumAll orig; 2432 struct srvsvc_NetShareEnumAll tmp; 2433 TALLOC_CTX *out_mem_ctx; 2434 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2435}; 2436 2437static void rpccli_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq); 2438 2439struct tevent_req *rpccli_srvsvc_NetShareEnumAll_send(TALLOC_CTX *mem_ctx, 2440 struct tevent_context *ev, 2441 struct rpc_pipe_client *cli, 2442 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2443 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */, 2444 uint32_t _max_buffer /* [in] */, 2445 uint32_t *_totalentries /* [out] [ref] */, 2446 uint32_t *_resume_handle /* [in,out] [unique] */) 2447{ 2448 struct tevent_req *req; 2449 struct rpccli_srvsvc_NetShareEnumAll_state *state; 2450 struct tevent_req *subreq; 2451 2452 req = tevent_req_create(mem_ctx, &state, 2453 struct rpccli_srvsvc_NetShareEnumAll_state); 2454 if (req == NULL) { 2455 return NULL; 2456 } 2457 state->out_mem_ctx = NULL; 2458 state->dispatch_recv = cli->dispatch_recv; 2459 2460 /* In parameters */ 2461 state->orig.in.server_unc = _server_unc; 2462 state->orig.in.info_ctr = _info_ctr; 2463 state->orig.in.max_buffer = _max_buffer; 2464 state->orig.in.resume_handle = _resume_handle; 2465 2466 /* Out parameters */ 2467 state->orig.out.info_ctr = _info_ctr; 2468 state->orig.out.totalentries = _totalentries; 2469 state->orig.out.resume_handle = _resume_handle; 2470 2471 /* Result */ 2472 ZERO_STRUCT(state->orig.out.result); 2473 2474 state->out_mem_ctx = talloc_named_const(state, 0, 2475 "rpccli_srvsvc_NetShareEnumAll_out_memory"); 2476 if (tevent_req_nomem(state->out_mem_ctx, req)) { 2477 return tevent_req_post(req, ev); 2478 } 2479 2480 /* make a temporary copy, that we pass to the dispatch function */ 2481 state->tmp = state->orig; 2482 2483 subreq = cli->dispatch_send(state, ev, cli, 2484 &ndr_table_srvsvc, 2485 NDR_SRVSVC_NETSHAREENUMALL, 2486 &state->tmp); 2487 if (tevent_req_nomem(subreq, req)) { 2488 return tevent_req_post(req, ev); 2489 } 2490 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareEnumAll_done, req); 2491 return req; 2492} 2493 2494static void rpccli_srvsvc_NetShareEnumAll_done(struct tevent_req *subreq) 2495{ 2496 struct tevent_req *req = tevent_req_callback_data( 2497 subreq, struct tevent_req); 2498 struct rpccli_srvsvc_NetShareEnumAll_state *state = tevent_req_data( 2499 req, struct rpccli_srvsvc_NetShareEnumAll_state); 2500 NTSTATUS status; 2501 TALLOC_CTX *mem_ctx; 2502 2503 if (state->out_mem_ctx) { 2504 mem_ctx = state->out_mem_ctx; 2505 } else { 2506 mem_ctx = state; 2507 } 2508 2509 status = state->dispatch_recv(subreq, mem_ctx); 2510 TALLOC_FREE(subreq); 2511 if (!NT_STATUS_IS_OK(status)) { 2512 tevent_req_nterror(req, status); 2513 return; 2514 } 2515 2516 /* Copy out parameters */ 2517 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 2518 *state->orig.out.totalentries = *state->tmp.out.totalentries; 2519 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 2520 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 2521 } 2522 2523 /* Copy result */ 2524 state->orig.out.result = state->tmp.out.result; 2525 2526 /* Reset temporary structure */ 2527 ZERO_STRUCT(state->tmp); 2528 2529 tevent_req_done(req); 2530} 2531 2532NTSTATUS rpccli_srvsvc_NetShareEnumAll_recv(struct tevent_req *req, 2533 TALLOC_CTX *mem_ctx, 2534 WERROR *result) 2535{ 2536 struct rpccli_srvsvc_NetShareEnumAll_state *state = tevent_req_data( 2537 req, struct rpccli_srvsvc_NetShareEnumAll_state); 2538 NTSTATUS status; 2539 2540 if (tevent_req_is_nterror(req, &status)) { 2541 tevent_req_received(req); 2542 return status; 2543 } 2544 2545 /* Steal possbile out parameters to the callers context */ 2546 talloc_steal(mem_ctx, state->out_mem_ctx); 2547 2548 /* Return result */ 2549 *result = state->orig.out.result; 2550 2551 tevent_req_received(req); 2552 return NT_STATUS_OK; 2553} 2554 2555NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, 2556 TALLOC_CTX *mem_ctx, 2557 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2558 struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, 2559 uint32_t max_buffer /* [in] */, 2560 uint32_t *totalentries /* [out] [ref] */, 2561 uint32_t *resume_handle /* [in,out] [unique] */, 2562 WERROR *werror) 2563{ 2564 struct srvsvc_NetShareEnumAll r; 2565 NTSTATUS status; 2566 2567 /* In parameters */ 2568 r.in.server_unc = server_unc; 2569 r.in.info_ctr = info_ctr; 2570 r.in.max_buffer = max_buffer; 2571 r.in.resume_handle = resume_handle; 2572 2573 status = cli->dispatch(cli, 2574 mem_ctx, 2575 &ndr_table_srvsvc, 2576 NDR_SRVSVC_NETSHAREENUMALL, 2577 &r); 2578 2579 if (!NT_STATUS_IS_OK(status)) { 2580 return status; 2581 } 2582 2583 if (NT_STATUS_IS_ERR(status)) { 2584 return status; 2585 } 2586 2587 /* Return variables */ 2588 *info_ctr = *r.out.info_ctr; 2589 *totalentries = *r.out.totalentries; 2590 if (resume_handle && r.out.resume_handle) { 2591 *resume_handle = *r.out.resume_handle; 2592 } 2593 2594 /* Return result */ 2595 if (werror) { 2596 *werror = r.out.result; 2597 } 2598 2599 return werror_to_ntstatus(r.out.result); 2600} 2601 2602struct rpccli_srvsvc_NetShareGetInfo_state { 2603 struct srvsvc_NetShareGetInfo orig; 2604 struct srvsvc_NetShareGetInfo tmp; 2605 TALLOC_CTX *out_mem_ctx; 2606 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2607}; 2608 2609static void rpccli_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq); 2610 2611struct tevent_req *rpccli_srvsvc_NetShareGetInfo_send(TALLOC_CTX *mem_ctx, 2612 struct tevent_context *ev, 2613 struct rpc_pipe_client *cli, 2614 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2615 const char *_share_name /* [in] [charset(UTF16)] */, 2616 uint32_t _level /* [in] */, 2617 union srvsvc_NetShareInfo *_info /* [out] [ref,switch_is(level)] */) 2618{ 2619 struct tevent_req *req; 2620 struct rpccli_srvsvc_NetShareGetInfo_state *state; 2621 struct tevent_req *subreq; 2622 2623 req = tevent_req_create(mem_ctx, &state, 2624 struct rpccli_srvsvc_NetShareGetInfo_state); 2625 if (req == NULL) { 2626 return NULL; 2627 } 2628 state->out_mem_ctx = NULL; 2629 state->dispatch_recv = cli->dispatch_recv; 2630 2631 /* In parameters */ 2632 state->orig.in.server_unc = _server_unc; 2633 state->orig.in.share_name = _share_name; 2634 state->orig.in.level = _level; 2635 2636 /* Out parameters */ 2637 state->orig.out.info = _info; 2638 2639 /* Result */ 2640 ZERO_STRUCT(state->orig.out.result); 2641 2642 state->out_mem_ctx = talloc_named_const(state, 0, 2643 "rpccli_srvsvc_NetShareGetInfo_out_memory"); 2644 if (tevent_req_nomem(state->out_mem_ctx, req)) { 2645 return tevent_req_post(req, ev); 2646 } 2647 2648 /* make a temporary copy, that we pass to the dispatch function */ 2649 state->tmp = state->orig; 2650 2651 subreq = cli->dispatch_send(state, ev, cli, 2652 &ndr_table_srvsvc, 2653 NDR_SRVSVC_NETSHAREGETINFO, 2654 &state->tmp); 2655 if (tevent_req_nomem(subreq, req)) { 2656 return tevent_req_post(req, ev); 2657 } 2658 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareGetInfo_done, req); 2659 return req; 2660} 2661 2662static void rpccli_srvsvc_NetShareGetInfo_done(struct tevent_req *subreq) 2663{ 2664 struct tevent_req *req = tevent_req_callback_data( 2665 subreq, struct tevent_req); 2666 struct rpccli_srvsvc_NetShareGetInfo_state *state = tevent_req_data( 2667 req, struct rpccli_srvsvc_NetShareGetInfo_state); 2668 NTSTATUS status; 2669 TALLOC_CTX *mem_ctx; 2670 2671 if (state->out_mem_ctx) { 2672 mem_ctx = state->out_mem_ctx; 2673 } else { 2674 mem_ctx = state; 2675 } 2676 2677 status = state->dispatch_recv(subreq, mem_ctx); 2678 TALLOC_FREE(subreq); 2679 if (!NT_STATUS_IS_OK(status)) { 2680 tevent_req_nterror(req, status); 2681 return; 2682 } 2683 2684 /* Copy out parameters */ 2685 *state->orig.out.info = *state->tmp.out.info; 2686 2687 /* Copy result */ 2688 state->orig.out.result = state->tmp.out.result; 2689 2690 /* Reset temporary structure */ 2691 ZERO_STRUCT(state->tmp); 2692 2693 tevent_req_done(req); 2694} 2695 2696NTSTATUS rpccli_srvsvc_NetShareGetInfo_recv(struct tevent_req *req, 2697 TALLOC_CTX *mem_ctx, 2698 WERROR *result) 2699{ 2700 struct rpccli_srvsvc_NetShareGetInfo_state *state = tevent_req_data( 2701 req, struct rpccli_srvsvc_NetShareGetInfo_state); 2702 NTSTATUS status; 2703 2704 if (tevent_req_is_nterror(req, &status)) { 2705 tevent_req_received(req); 2706 return status; 2707 } 2708 2709 /* Steal possbile out parameters to the callers context */ 2710 talloc_steal(mem_ctx, state->out_mem_ctx); 2711 2712 /* Return result */ 2713 *result = state->orig.out.result; 2714 2715 tevent_req_received(req); 2716 return NT_STATUS_OK; 2717} 2718 2719NTSTATUS rpccli_srvsvc_NetShareGetInfo(struct rpc_pipe_client *cli, 2720 TALLOC_CTX *mem_ctx, 2721 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2722 const char *share_name /* [in] [charset(UTF16)] */, 2723 uint32_t level /* [in] */, 2724 union srvsvc_NetShareInfo *info /* [out] [ref,switch_is(level)] */, 2725 WERROR *werror) 2726{ 2727 struct srvsvc_NetShareGetInfo r; 2728 NTSTATUS status; 2729 2730 /* In parameters */ 2731 r.in.server_unc = server_unc; 2732 r.in.share_name = share_name; 2733 r.in.level = level; 2734 2735 status = cli->dispatch(cli, 2736 mem_ctx, 2737 &ndr_table_srvsvc, 2738 NDR_SRVSVC_NETSHAREGETINFO, 2739 &r); 2740 2741 if (!NT_STATUS_IS_OK(status)) { 2742 return status; 2743 } 2744 2745 if (NT_STATUS_IS_ERR(status)) { 2746 return status; 2747 } 2748 2749 /* Return variables */ 2750 *info = *r.out.info; 2751 2752 /* Return result */ 2753 if (werror) { 2754 *werror = r.out.result; 2755 } 2756 2757 return werror_to_ntstatus(r.out.result); 2758} 2759 2760struct rpccli_srvsvc_NetShareSetInfo_state { 2761 struct srvsvc_NetShareSetInfo orig; 2762 struct srvsvc_NetShareSetInfo tmp; 2763 TALLOC_CTX *out_mem_ctx; 2764 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2765}; 2766 2767static void rpccli_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq); 2768 2769struct tevent_req *rpccli_srvsvc_NetShareSetInfo_send(TALLOC_CTX *mem_ctx, 2770 struct tevent_context *ev, 2771 struct rpc_pipe_client *cli, 2772 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2773 const char *_share_name /* [in] [charset(UTF16)] */, 2774 uint32_t _level /* [in] */, 2775 union srvsvc_NetShareInfo *_info /* [in] [ref,switch_is(level)] */, 2776 uint32_t *_parm_error /* [in,out] [unique] */) 2777{ 2778 struct tevent_req *req; 2779 struct rpccli_srvsvc_NetShareSetInfo_state *state; 2780 struct tevent_req *subreq; 2781 2782 req = tevent_req_create(mem_ctx, &state, 2783 struct rpccli_srvsvc_NetShareSetInfo_state); 2784 if (req == NULL) { 2785 return NULL; 2786 } 2787 state->out_mem_ctx = NULL; 2788 state->dispatch_recv = cli->dispatch_recv; 2789 2790 /* In parameters */ 2791 state->orig.in.server_unc = _server_unc; 2792 state->orig.in.share_name = _share_name; 2793 state->orig.in.level = _level; 2794 state->orig.in.info = _info; 2795 state->orig.in.parm_error = _parm_error; 2796 2797 /* Out parameters */ 2798 state->orig.out.parm_error = _parm_error; 2799 2800 /* Result */ 2801 ZERO_STRUCT(state->orig.out.result); 2802 2803 state->out_mem_ctx = talloc_named_const(state, 0, 2804 "rpccli_srvsvc_NetShareSetInfo_out_memory"); 2805 if (tevent_req_nomem(state->out_mem_ctx, req)) { 2806 return tevent_req_post(req, ev); 2807 } 2808 2809 /* make a temporary copy, that we pass to the dispatch function */ 2810 state->tmp = state->orig; 2811 2812 subreq = cli->dispatch_send(state, ev, cli, 2813 &ndr_table_srvsvc, 2814 NDR_SRVSVC_NETSHARESETINFO, 2815 &state->tmp); 2816 if (tevent_req_nomem(subreq, req)) { 2817 return tevent_req_post(req, ev); 2818 } 2819 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareSetInfo_done, req); 2820 return req; 2821} 2822 2823static void rpccli_srvsvc_NetShareSetInfo_done(struct tevent_req *subreq) 2824{ 2825 struct tevent_req *req = tevent_req_callback_data( 2826 subreq, struct tevent_req); 2827 struct rpccli_srvsvc_NetShareSetInfo_state *state = tevent_req_data( 2828 req, struct rpccli_srvsvc_NetShareSetInfo_state); 2829 NTSTATUS status; 2830 TALLOC_CTX *mem_ctx; 2831 2832 if (state->out_mem_ctx) { 2833 mem_ctx = state->out_mem_ctx; 2834 } else { 2835 mem_ctx = state; 2836 } 2837 2838 status = state->dispatch_recv(subreq, mem_ctx); 2839 TALLOC_FREE(subreq); 2840 if (!NT_STATUS_IS_OK(status)) { 2841 tevent_req_nterror(req, status); 2842 return; 2843 } 2844 2845 /* Copy out parameters */ 2846 if (state->orig.out.parm_error && state->tmp.out.parm_error) { 2847 *state->orig.out.parm_error = *state->tmp.out.parm_error; 2848 } 2849 2850 /* Copy result */ 2851 state->orig.out.result = state->tmp.out.result; 2852 2853 /* Reset temporary structure */ 2854 ZERO_STRUCT(state->tmp); 2855 2856 tevent_req_done(req); 2857} 2858 2859NTSTATUS rpccli_srvsvc_NetShareSetInfo_recv(struct tevent_req *req, 2860 TALLOC_CTX *mem_ctx, 2861 WERROR *result) 2862{ 2863 struct rpccli_srvsvc_NetShareSetInfo_state *state = tevent_req_data( 2864 req, struct rpccli_srvsvc_NetShareSetInfo_state); 2865 NTSTATUS status; 2866 2867 if (tevent_req_is_nterror(req, &status)) { 2868 tevent_req_received(req); 2869 return status; 2870 } 2871 2872 /* Steal possbile out parameters to the callers context */ 2873 talloc_steal(mem_ctx, state->out_mem_ctx); 2874 2875 /* Return result */ 2876 *result = state->orig.out.result; 2877 2878 tevent_req_received(req); 2879 return NT_STATUS_OK; 2880} 2881 2882NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, 2883 TALLOC_CTX *mem_ctx, 2884 const char *server_unc /* [in] [unique,charset(UTF16)] */, 2885 const char *share_name /* [in] [charset(UTF16)] */, 2886 uint32_t level /* [in] */, 2887 union srvsvc_NetShareInfo *info /* [in] [ref,switch_is(level)] */, 2888 uint32_t *parm_error /* [in,out] [unique] */, 2889 WERROR *werror) 2890{ 2891 struct srvsvc_NetShareSetInfo r; 2892 NTSTATUS status; 2893 2894 /* In parameters */ 2895 r.in.server_unc = server_unc; 2896 r.in.share_name = share_name; 2897 r.in.level = level; 2898 r.in.info = info; 2899 r.in.parm_error = parm_error; 2900 2901 status = cli->dispatch(cli, 2902 mem_ctx, 2903 &ndr_table_srvsvc, 2904 NDR_SRVSVC_NETSHARESETINFO, 2905 &r); 2906 2907 if (!NT_STATUS_IS_OK(status)) { 2908 return status; 2909 } 2910 2911 if (NT_STATUS_IS_ERR(status)) { 2912 return status; 2913 } 2914 2915 /* Return variables */ 2916 if (parm_error && r.out.parm_error) { 2917 *parm_error = *r.out.parm_error; 2918 } 2919 2920 /* Return result */ 2921 if (werror) { 2922 *werror = r.out.result; 2923 } 2924 2925 return werror_to_ntstatus(r.out.result); 2926} 2927 2928struct rpccli_srvsvc_NetShareDel_state { 2929 struct srvsvc_NetShareDel orig; 2930 struct srvsvc_NetShareDel tmp; 2931 TALLOC_CTX *out_mem_ctx; 2932 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 2933}; 2934 2935static void rpccli_srvsvc_NetShareDel_done(struct tevent_req *subreq); 2936 2937struct tevent_req *rpccli_srvsvc_NetShareDel_send(TALLOC_CTX *mem_ctx, 2938 struct tevent_context *ev, 2939 struct rpc_pipe_client *cli, 2940 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 2941 const char *_share_name /* [in] [charset(UTF16)] */, 2942 uint32_t _reserved /* [in] */) 2943{ 2944 struct tevent_req *req; 2945 struct rpccli_srvsvc_NetShareDel_state *state; 2946 struct tevent_req *subreq; 2947 2948 req = tevent_req_create(mem_ctx, &state, 2949 struct rpccli_srvsvc_NetShareDel_state); 2950 if (req == NULL) { 2951 return NULL; 2952 } 2953 state->out_mem_ctx = NULL; 2954 state->dispatch_recv = cli->dispatch_recv; 2955 2956 /* In parameters */ 2957 state->orig.in.server_unc = _server_unc; 2958 state->orig.in.share_name = _share_name; 2959 state->orig.in.reserved = _reserved; 2960 2961 /* Out parameters */ 2962 2963 /* Result */ 2964 ZERO_STRUCT(state->orig.out.result); 2965 2966 /* make a temporary copy, that we pass to the dispatch function */ 2967 state->tmp = state->orig; 2968 2969 subreq = cli->dispatch_send(state, ev, cli, 2970 &ndr_table_srvsvc, 2971 NDR_SRVSVC_NETSHAREDEL, 2972 &state->tmp); 2973 if (tevent_req_nomem(subreq, req)) { 2974 return tevent_req_post(req, ev); 2975 } 2976 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDel_done, req); 2977 return req; 2978} 2979 2980static void rpccli_srvsvc_NetShareDel_done(struct tevent_req *subreq) 2981{ 2982 struct tevent_req *req = tevent_req_callback_data( 2983 subreq, struct tevent_req); 2984 struct rpccli_srvsvc_NetShareDel_state *state = tevent_req_data( 2985 req, struct rpccli_srvsvc_NetShareDel_state); 2986 NTSTATUS status; 2987 TALLOC_CTX *mem_ctx; 2988 2989 if (state->out_mem_ctx) { 2990 mem_ctx = state->out_mem_ctx; 2991 } else { 2992 mem_ctx = state; 2993 } 2994 2995 status = state->dispatch_recv(subreq, mem_ctx); 2996 TALLOC_FREE(subreq); 2997 if (!NT_STATUS_IS_OK(status)) { 2998 tevent_req_nterror(req, status); 2999 return; 3000 } 3001 3002 /* Copy out parameters */ 3003 3004 /* Copy result */ 3005 state->orig.out.result = state->tmp.out.result; 3006 3007 /* Reset temporary structure */ 3008 ZERO_STRUCT(state->tmp); 3009 3010 tevent_req_done(req); 3011} 3012 3013NTSTATUS rpccli_srvsvc_NetShareDel_recv(struct tevent_req *req, 3014 TALLOC_CTX *mem_ctx, 3015 WERROR *result) 3016{ 3017 struct rpccli_srvsvc_NetShareDel_state *state = tevent_req_data( 3018 req, struct rpccli_srvsvc_NetShareDel_state); 3019 NTSTATUS status; 3020 3021 if (tevent_req_is_nterror(req, &status)) { 3022 tevent_req_received(req); 3023 return status; 3024 } 3025 3026 /* Steal possbile out parameters to the callers context */ 3027 talloc_steal(mem_ctx, state->out_mem_ctx); 3028 3029 /* Return result */ 3030 *result = state->orig.out.result; 3031 3032 tevent_req_received(req); 3033 return NT_STATUS_OK; 3034} 3035 3036NTSTATUS rpccli_srvsvc_NetShareDel(struct rpc_pipe_client *cli, 3037 TALLOC_CTX *mem_ctx, 3038 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3039 const char *share_name /* [in] [charset(UTF16)] */, 3040 uint32_t reserved /* [in] */, 3041 WERROR *werror) 3042{ 3043 struct srvsvc_NetShareDel r; 3044 NTSTATUS status; 3045 3046 /* In parameters */ 3047 r.in.server_unc = server_unc; 3048 r.in.share_name = share_name; 3049 r.in.reserved = reserved; 3050 3051 status = cli->dispatch(cli, 3052 mem_ctx, 3053 &ndr_table_srvsvc, 3054 NDR_SRVSVC_NETSHAREDEL, 3055 &r); 3056 3057 if (!NT_STATUS_IS_OK(status)) { 3058 return status; 3059 } 3060 3061 if (NT_STATUS_IS_ERR(status)) { 3062 return status; 3063 } 3064 3065 /* Return variables */ 3066 3067 /* Return result */ 3068 if (werror) { 3069 *werror = r.out.result; 3070 } 3071 3072 return werror_to_ntstatus(r.out.result); 3073} 3074 3075struct rpccli_srvsvc_NetShareDelSticky_state { 3076 struct srvsvc_NetShareDelSticky orig; 3077 struct srvsvc_NetShareDelSticky tmp; 3078 TALLOC_CTX *out_mem_ctx; 3079 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3080}; 3081 3082static void rpccli_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq); 3083 3084struct tevent_req *rpccli_srvsvc_NetShareDelSticky_send(TALLOC_CTX *mem_ctx, 3085 struct tevent_context *ev, 3086 struct rpc_pipe_client *cli, 3087 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3088 const char *_share_name /* [in] [charset(UTF16)] */, 3089 uint32_t _reserved /* [in] */) 3090{ 3091 struct tevent_req *req; 3092 struct rpccli_srvsvc_NetShareDelSticky_state *state; 3093 struct tevent_req *subreq; 3094 3095 req = tevent_req_create(mem_ctx, &state, 3096 struct rpccli_srvsvc_NetShareDelSticky_state); 3097 if (req == NULL) { 3098 return NULL; 3099 } 3100 state->out_mem_ctx = NULL; 3101 state->dispatch_recv = cli->dispatch_recv; 3102 3103 /* In parameters */ 3104 state->orig.in.server_unc = _server_unc; 3105 state->orig.in.share_name = _share_name; 3106 state->orig.in.reserved = _reserved; 3107 3108 /* Out parameters */ 3109 3110 /* Result */ 3111 ZERO_STRUCT(state->orig.out.result); 3112 3113 /* make a temporary copy, that we pass to the dispatch function */ 3114 state->tmp = state->orig; 3115 3116 subreq = cli->dispatch_send(state, ev, cli, 3117 &ndr_table_srvsvc, 3118 NDR_SRVSVC_NETSHAREDELSTICKY, 3119 &state->tmp); 3120 if (tevent_req_nomem(subreq, req)) { 3121 return tevent_req_post(req, ev); 3122 } 3123 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelSticky_done, req); 3124 return req; 3125} 3126 3127static void rpccli_srvsvc_NetShareDelSticky_done(struct tevent_req *subreq) 3128{ 3129 struct tevent_req *req = tevent_req_callback_data( 3130 subreq, struct tevent_req); 3131 struct rpccli_srvsvc_NetShareDelSticky_state *state = tevent_req_data( 3132 req, struct rpccli_srvsvc_NetShareDelSticky_state); 3133 NTSTATUS status; 3134 TALLOC_CTX *mem_ctx; 3135 3136 if (state->out_mem_ctx) { 3137 mem_ctx = state->out_mem_ctx; 3138 } else { 3139 mem_ctx = state; 3140 } 3141 3142 status = state->dispatch_recv(subreq, mem_ctx); 3143 TALLOC_FREE(subreq); 3144 if (!NT_STATUS_IS_OK(status)) { 3145 tevent_req_nterror(req, status); 3146 return; 3147 } 3148 3149 /* Copy out parameters */ 3150 3151 /* Copy result */ 3152 state->orig.out.result = state->tmp.out.result; 3153 3154 /* Reset temporary structure */ 3155 ZERO_STRUCT(state->tmp); 3156 3157 tevent_req_done(req); 3158} 3159 3160NTSTATUS rpccli_srvsvc_NetShareDelSticky_recv(struct tevent_req *req, 3161 TALLOC_CTX *mem_ctx, 3162 WERROR *result) 3163{ 3164 struct rpccli_srvsvc_NetShareDelSticky_state *state = tevent_req_data( 3165 req, struct rpccli_srvsvc_NetShareDelSticky_state); 3166 NTSTATUS status; 3167 3168 if (tevent_req_is_nterror(req, &status)) { 3169 tevent_req_received(req); 3170 return status; 3171 } 3172 3173 /* Steal possbile out parameters to the callers context */ 3174 talloc_steal(mem_ctx, state->out_mem_ctx); 3175 3176 /* Return result */ 3177 *result = state->orig.out.result; 3178 3179 tevent_req_received(req); 3180 return NT_STATUS_OK; 3181} 3182 3183NTSTATUS rpccli_srvsvc_NetShareDelSticky(struct rpc_pipe_client *cli, 3184 TALLOC_CTX *mem_ctx, 3185 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3186 const char *share_name /* [in] [charset(UTF16)] */, 3187 uint32_t reserved /* [in] */, 3188 WERROR *werror) 3189{ 3190 struct srvsvc_NetShareDelSticky r; 3191 NTSTATUS status; 3192 3193 /* In parameters */ 3194 r.in.server_unc = server_unc; 3195 r.in.share_name = share_name; 3196 r.in.reserved = reserved; 3197 3198 status = cli->dispatch(cli, 3199 mem_ctx, 3200 &ndr_table_srvsvc, 3201 NDR_SRVSVC_NETSHAREDELSTICKY, 3202 &r); 3203 3204 if (!NT_STATUS_IS_OK(status)) { 3205 return status; 3206 } 3207 3208 if (NT_STATUS_IS_ERR(status)) { 3209 return status; 3210 } 3211 3212 /* Return variables */ 3213 3214 /* Return result */ 3215 if (werror) { 3216 *werror = r.out.result; 3217 } 3218 3219 return werror_to_ntstatus(r.out.result); 3220} 3221 3222struct rpccli_srvsvc_NetShareCheck_state { 3223 struct srvsvc_NetShareCheck orig; 3224 struct srvsvc_NetShareCheck tmp; 3225 TALLOC_CTX *out_mem_ctx; 3226 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3227}; 3228 3229static void rpccli_srvsvc_NetShareCheck_done(struct tevent_req *subreq); 3230 3231struct tevent_req *rpccli_srvsvc_NetShareCheck_send(TALLOC_CTX *mem_ctx, 3232 struct tevent_context *ev, 3233 struct rpc_pipe_client *cli, 3234 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3235 const char *_device_name /* [in] [charset(UTF16)] */, 3236 enum srvsvc_ShareType *_type /* [out] [ref] */) 3237{ 3238 struct tevent_req *req; 3239 struct rpccli_srvsvc_NetShareCheck_state *state; 3240 struct tevent_req *subreq; 3241 3242 req = tevent_req_create(mem_ctx, &state, 3243 struct rpccli_srvsvc_NetShareCheck_state); 3244 if (req == NULL) { 3245 return NULL; 3246 } 3247 state->out_mem_ctx = NULL; 3248 state->dispatch_recv = cli->dispatch_recv; 3249 3250 /* In parameters */ 3251 state->orig.in.server_unc = _server_unc; 3252 state->orig.in.device_name = _device_name; 3253 3254 /* Out parameters */ 3255 state->orig.out.type = _type; 3256 3257 /* Result */ 3258 ZERO_STRUCT(state->orig.out.result); 3259 3260 state->out_mem_ctx = talloc_named_const(state, 0, 3261 "rpccli_srvsvc_NetShareCheck_out_memory"); 3262 if (tevent_req_nomem(state->out_mem_ctx, req)) { 3263 return tevent_req_post(req, ev); 3264 } 3265 3266 /* make a temporary copy, that we pass to the dispatch function */ 3267 state->tmp = state->orig; 3268 3269 subreq = cli->dispatch_send(state, ev, cli, 3270 &ndr_table_srvsvc, 3271 NDR_SRVSVC_NETSHARECHECK, 3272 &state->tmp); 3273 if (tevent_req_nomem(subreq, req)) { 3274 return tevent_req_post(req, ev); 3275 } 3276 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareCheck_done, req); 3277 return req; 3278} 3279 3280static void rpccli_srvsvc_NetShareCheck_done(struct tevent_req *subreq) 3281{ 3282 struct tevent_req *req = tevent_req_callback_data( 3283 subreq, struct tevent_req); 3284 struct rpccli_srvsvc_NetShareCheck_state *state = tevent_req_data( 3285 req, struct rpccli_srvsvc_NetShareCheck_state); 3286 NTSTATUS status; 3287 TALLOC_CTX *mem_ctx; 3288 3289 if (state->out_mem_ctx) { 3290 mem_ctx = state->out_mem_ctx; 3291 } else { 3292 mem_ctx = state; 3293 } 3294 3295 status = state->dispatch_recv(subreq, mem_ctx); 3296 TALLOC_FREE(subreq); 3297 if (!NT_STATUS_IS_OK(status)) { 3298 tevent_req_nterror(req, status); 3299 return; 3300 } 3301 3302 /* Copy out parameters */ 3303 *state->orig.out.type = *state->tmp.out.type; 3304 3305 /* Copy result */ 3306 state->orig.out.result = state->tmp.out.result; 3307 3308 /* Reset temporary structure */ 3309 ZERO_STRUCT(state->tmp); 3310 3311 tevent_req_done(req); 3312} 3313 3314NTSTATUS rpccli_srvsvc_NetShareCheck_recv(struct tevent_req *req, 3315 TALLOC_CTX *mem_ctx, 3316 WERROR *result) 3317{ 3318 struct rpccli_srvsvc_NetShareCheck_state *state = tevent_req_data( 3319 req, struct rpccli_srvsvc_NetShareCheck_state); 3320 NTSTATUS status; 3321 3322 if (tevent_req_is_nterror(req, &status)) { 3323 tevent_req_received(req); 3324 return status; 3325 } 3326 3327 /* Steal possbile out parameters to the callers context */ 3328 talloc_steal(mem_ctx, state->out_mem_ctx); 3329 3330 /* Return result */ 3331 *result = state->orig.out.result; 3332 3333 tevent_req_received(req); 3334 return NT_STATUS_OK; 3335} 3336 3337NTSTATUS rpccli_srvsvc_NetShareCheck(struct rpc_pipe_client *cli, 3338 TALLOC_CTX *mem_ctx, 3339 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3340 const char *device_name /* [in] [charset(UTF16)] */, 3341 enum srvsvc_ShareType *type /* [out] [ref] */, 3342 WERROR *werror) 3343{ 3344 struct srvsvc_NetShareCheck r; 3345 NTSTATUS status; 3346 3347 /* In parameters */ 3348 r.in.server_unc = server_unc; 3349 r.in.device_name = device_name; 3350 3351 status = cli->dispatch(cli, 3352 mem_ctx, 3353 &ndr_table_srvsvc, 3354 NDR_SRVSVC_NETSHARECHECK, 3355 &r); 3356 3357 if (!NT_STATUS_IS_OK(status)) { 3358 return status; 3359 } 3360 3361 if (NT_STATUS_IS_ERR(status)) { 3362 return status; 3363 } 3364 3365 /* Return variables */ 3366 *type = *r.out.type; 3367 3368 /* Return result */ 3369 if (werror) { 3370 *werror = r.out.result; 3371 } 3372 3373 return werror_to_ntstatus(r.out.result); 3374} 3375 3376struct rpccli_srvsvc_NetSrvGetInfo_state { 3377 struct srvsvc_NetSrvGetInfo orig; 3378 struct srvsvc_NetSrvGetInfo tmp; 3379 TALLOC_CTX *out_mem_ctx; 3380 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3381}; 3382 3383static void rpccli_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq); 3384 3385struct tevent_req *rpccli_srvsvc_NetSrvGetInfo_send(TALLOC_CTX *mem_ctx, 3386 struct tevent_context *ev, 3387 struct rpc_pipe_client *cli, 3388 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3389 uint32_t _level /* [in] */, 3390 union srvsvc_NetSrvInfo *_info /* [out] [ref,switch_is(level)] */) 3391{ 3392 struct tevent_req *req; 3393 struct rpccli_srvsvc_NetSrvGetInfo_state *state; 3394 struct tevent_req *subreq; 3395 3396 req = tevent_req_create(mem_ctx, &state, 3397 struct rpccli_srvsvc_NetSrvGetInfo_state); 3398 if (req == NULL) { 3399 return NULL; 3400 } 3401 state->out_mem_ctx = NULL; 3402 state->dispatch_recv = cli->dispatch_recv; 3403 3404 /* In parameters */ 3405 state->orig.in.server_unc = _server_unc; 3406 state->orig.in.level = _level; 3407 3408 /* Out parameters */ 3409 state->orig.out.info = _info; 3410 3411 /* Result */ 3412 ZERO_STRUCT(state->orig.out.result); 3413 3414 state->out_mem_ctx = talloc_named_const(state, 0, 3415 "rpccli_srvsvc_NetSrvGetInfo_out_memory"); 3416 if (tevent_req_nomem(state->out_mem_ctx, req)) { 3417 return tevent_req_post(req, ev); 3418 } 3419 3420 /* make a temporary copy, that we pass to the dispatch function */ 3421 state->tmp = state->orig; 3422 3423 subreq = cli->dispatch_send(state, ev, cli, 3424 &ndr_table_srvsvc, 3425 NDR_SRVSVC_NETSRVGETINFO, 3426 &state->tmp); 3427 if (tevent_req_nomem(subreq, req)) { 3428 return tevent_req_post(req, ev); 3429 } 3430 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSrvGetInfo_done, req); 3431 return req; 3432} 3433 3434static void rpccli_srvsvc_NetSrvGetInfo_done(struct tevent_req *subreq) 3435{ 3436 struct tevent_req *req = tevent_req_callback_data( 3437 subreq, struct tevent_req); 3438 struct rpccli_srvsvc_NetSrvGetInfo_state *state = tevent_req_data( 3439 req, struct rpccli_srvsvc_NetSrvGetInfo_state); 3440 NTSTATUS status; 3441 TALLOC_CTX *mem_ctx; 3442 3443 if (state->out_mem_ctx) { 3444 mem_ctx = state->out_mem_ctx; 3445 } else { 3446 mem_ctx = state; 3447 } 3448 3449 status = state->dispatch_recv(subreq, mem_ctx); 3450 TALLOC_FREE(subreq); 3451 if (!NT_STATUS_IS_OK(status)) { 3452 tevent_req_nterror(req, status); 3453 return; 3454 } 3455 3456 /* Copy out parameters */ 3457 *state->orig.out.info = *state->tmp.out.info; 3458 3459 /* Copy result */ 3460 state->orig.out.result = state->tmp.out.result; 3461 3462 /* Reset temporary structure */ 3463 ZERO_STRUCT(state->tmp); 3464 3465 tevent_req_done(req); 3466} 3467 3468NTSTATUS rpccli_srvsvc_NetSrvGetInfo_recv(struct tevent_req *req, 3469 TALLOC_CTX *mem_ctx, 3470 WERROR *result) 3471{ 3472 struct rpccli_srvsvc_NetSrvGetInfo_state *state = tevent_req_data( 3473 req, struct rpccli_srvsvc_NetSrvGetInfo_state); 3474 NTSTATUS status; 3475 3476 if (tevent_req_is_nterror(req, &status)) { 3477 tevent_req_received(req); 3478 return status; 3479 } 3480 3481 /* Steal possbile out parameters to the callers context */ 3482 talloc_steal(mem_ctx, state->out_mem_ctx); 3483 3484 /* Return result */ 3485 *result = state->orig.out.result; 3486 3487 tevent_req_received(req); 3488 return NT_STATUS_OK; 3489} 3490 3491NTSTATUS rpccli_srvsvc_NetSrvGetInfo(struct rpc_pipe_client *cli, 3492 TALLOC_CTX *mem_ctx, 3493 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3494 uint32_t level /* [in] */, 3495 union srvsvc_NetSrvInfo *info /* [out] [ref,switch_is(level)] */, 3496 WERROR *werror) 3497{ 3498 struct srvsvc_NetSrvGetInfo r; 3499 NTSTATUS status; 3500 3501 /* In parameters */ 3502 r.in.server_unc = server_unc; 3503 r.in.level = level; 3504 3505 status = cli->dispatch(cli, 3506 mem_ctx, 3507 &ndr_table_srvsvc, 3508 NDR_SRVSVC_NETSRVGETINFO, 3509 &r); 3510 3511 if (!NT_STATUS_IS_OK(status)) { 3512 return status; 3513 } 3514 3515 if (NT_STATUS_IS_ERR(status)) { 3516 return status; 3517 } 3518 3519 /* Return variables */ 3520 *info = *r.out.info; 3521 3522 /* Return result */ 3523 if (werror) { 3524 *werror = r.out.result; 3525 } 3526 3527 return werror_to_ntstatus(r.out.result); 3528} 3529 3530struct rpccli_srvsvc_NetSrvSetInfo_state { 3531 struct srvsvc_NetSrvSetInfo orig; 3532 struct srvsvc_NetSrvSetInfo tmp; 3533 TALLOC_CTX *out_mem_ctx; 3534 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3535}; 3536 3537static void rpccli_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq); 3538 3539struct tevent_req *rpccli_srvsvc_NetSrvSetInfo_send(TALLOC_CTX *mem_ctx, 3540 struct tevent_context *ev, 3541 struct rpc_pipe_client *cli, 3542 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3543 uint32_t _level /* [in] */, 3544 union srvsvc_NetSrvInfo *_info /* [in] [ref,switch_is(level)] */, 3545 uint32_t *_parm_error /* [in,out] [unique] */) 3546{ 3547 struct tevent_req *req; 3548 struct rpccli_srvsvc_NetSrvSetInfo_state *state; 3549 struct tevent_req *subreq; 3550 3551 req = tevent_req_create(mem_ctx, &state, 3552 struct rpccli_srvsvc_NetSrvSetInfo_state); 3553 if (req == NULL) { 3554 return NULL; 3555 } 3556 state->out_mem_ctx = NULL; 3557 state->dispatch_recv = cli->dispatch_recv; 3558 3559 /* In parameters */ 3560 state->orig.in.server_unc = _server_unc; 3561 state->orig.in.level = _level; 3562 state->orig.in.info = _info; 3563 state->orig.in.parm_error = _parm_error; 3564 3565 /* Out parameters */ 3566 state->orig.out.parm_error = _parm_error; 3567 3568 /* Result */ 3569 ZERO_STRUCT(state->orig.out.result); 3570 3571 state->out_mem_ctx = talloc_named_const(state, 0, 3572 "rpccli_srvsvc_NetSrvSetInfo_out_memory"); 3573 if (tevent_req_nomem(state->out_mem_ctx, req)) { 3574 return tevent_req_post(req, ev); 3575 } 3576 3577 /* make a temporary copy, that we pass to the dispatch function */ 3578 state->tmp = state->orig; 3579 3580 subreq = cli->dispatch_send(state, ev, cli, 3581 &ndr_table_srvsvc, 3582 NDR_SRVSVC_NETSRVSETINFO, 3583 &state->tmp); 3584 if (tevent_req_nomem(subreq, req)) { 3585 return tevent_req_post(req, ev); 3586 } 3587 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSrvSetInfo_done, req); 3588 return req; 3589} 3590 3591static void rpccli_srvsvc_NetSrvSetInfo_done(struct tevent_req *subreq) 3592{ 3593 struct tevent_req *req = tevent_req_callback_data( 3594 subreq, struct tevent_req); 3595 struct rpccli_srvsvc_NetSrvSetInfo_state *state = tevent_req_data( 3596 req, struct rpccli_srvsvc_NetSrvSetInfo_state); 3597 NTSTATUS status; 3598 TALLOC_CTX *mem_ctx; 3599 3600 if (state->out_mem_ctx) { 3601 mem_ctx = state->out_mem_ctx; 3602 } else { 3603 mem_ctx = state; 3604 } 3605 3606 status = state->dispatch_recv(subreq, mem_ctx); 3607 TALLOC_FREE(subreq); 3608 if (!NT_STATUS_IS_OK(status)) { 3609 tevent_req_nterror(req, status); 3610 return; 3611 } 3612 3613 /* Copy out parameters */ 3614 if (state->orig.out.parm_error && state->tmp.out.parm_error) { 3615 *state->orig.out.parm_error = *state->tmp.out.parm_error; 3616 } 3617 3618 /* Copy result */ 3619 state->orig.out.result = state->tmp.out.result; 3620 3621 /* Reset temporary structure */ 3622 ZERO_STRUCT(state->tmp); 3623 3624 tevent_req_done(req); 3625} 3626 3627NTSTATUS rpccli_srvsvc_NetSrvSetInfo_recv(struct tevent_req *req, 3628 TALLOC_CTX *mem_ctx, 3629 WERROR *result) 3630{ 3631 struct rpccli_srvsvc_NetSrvSetInfo_state *state = tevent_req_data( 3632 req, struct rpccli_srvsvc_NetSrvSetInfo_state); 3633 NTSTATUS status; 3634 3635 if (tevent_req_is_nterror(req, &status)) { 3636 tevent_req_received(req); 3637 return status; 3638 } 3639 3640 /* Steal possbile out parameters to the callers context */ 3641 talloc_steal(mem_ctx, state->out_mem_ctx); 3642 3643 /* Return result */ 3644 *result = state->orig.out.result; 3645 3646 tevent_req_received(req); 3647 return NT_STATUS_OK; 3648} 3649 3650NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, 3651 TALLOC_CTX *mem_ctx, 3652 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3653 uint32_t level /* [in] */, 3654 union srvsvc_NetSrvInfo *info /* [in] [ref,switch_is(level)] */, 3655 uint32_t *parm_error /* [in,out] [unique] */, 3656 WERROR *werror) 3657{ 3658 struct srvsvc_NetSrvSetInfo r; 3659 NTSTATUS status; 3660 3661 /* In parameters */ 3662 r.in.server_unc = server_unc; 3663 r.in.level = level; 3664 r.in.info = info; 3665 r.in.parm_error = parm_error; 3666 3667 status = cli->dispatch(cli, 3668 mem_ctx, 3669 &ndr_table_srvsvc, 3670 NDR_SRVSVC_NETSRVSETINFO, 3671 &r); 3672 3673 if (!NT_STATUS_IS_OK(status)) { 3674 return status; 3675 } 3676 3677 if (NT_STATUS_IS_ERR(status)) { 3678 return status; 3679 } 3680 3681 /* Return variables */ 3682 if (parm_error && r.out.parm_error) { 3683 *parm_error = *r.out.parm_error; 3684 } 3685 3686 /* Return result */ 3687 if (werror) { 3688 *werror = r.out.result; 3689 } 3690 3691 return werror_to_ntstatus(r.out.result); 3692} 3693 3694struct rpccli_srvsvc_NetDiskEnum_state { 3695 struct srvsvc_NetDiskEnum orig; 3696 struct srvsvc_NetDiskEnum tmp; 3697 TALLOC_CTX *out_mem_ctx; 3698 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3699}; 3700 3701static void rpccli_srvsvc_NetDiskEnum_done(struct tevent_req *subreq); 3702 3703struct tevent_req *rpccli_srvsvc_NetDiskEnum_send(TALLOC_CTX *mem_ctx, 3704 struct tevent_context *ev, 3705 struct rpc_pipe_client *cli, 3706 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3707 uint32_t _level /* [in] */, 3708 struct srvsvc_NetDiskInfo *_info /* [in,out] [ref] */, 3709 uint32_t _maxlen /* [in] */, 3710 uint32_t *_totalentries /* [out] [ref] */, 3711 uint32_t *_resume_handle /* [in,out] [unique] */) 3712{ 3713 struct tevent_req *req; 3714 struct rpccli_srvsvc_NetDiskEnum_state *state; 3715 struct tevent_req *subreq; 3716 3717 req = tevent_req_create(mem_ctx, &state, 3718 struct rpccli_srvsvc_NetDiskEnum_state); 3719 if (req == NULL) { 3720 return NULL; 3721 } 3722 state->out_mem_ctx = NULL; 3723 state->dispatch_recv = cli->dispatch_recv; 3724 3725 /* In parameters */ 3726 state->orig.in.server_unc = _server_unc; 3727 state->orig.in.level = _level; 3728 state->orig.in.info = _info; 3729 state->orig.in.maxlen = _maxlen; 3730 state->orig.in.resume_handle = _resume_handle; 3731 3732 /* Out parameters */ 3733 state->orig.out.info = _info; 3734 state->orig.out.totalentries = _totalentries; 3735 state->orig.out.resume_handle = _resume_handle; 3736 3737 /* Result */ 3738 ZERO_STRUCT(state->orig.out.result); 3739 3740 state->out_mem_ctx = talloc_named_const(state, 0, 3741 "rpccli_srvsvc_NetDiskEnum_out_memory"); 3742 if (tevent_req_nomem(state->out_mem_ctx, req)) { 3743 return tevent_req_post(req, ev); 3744 } 3745 3746 /* make a temporary copy, that we pass to the dispatch function */ 3747 state->tmp = state->orig; 3748 3749 subreq = cli->dispatch_send(state, ev, cli, 3750 &ndr_table_srvsvc, 3751 NDR_SRVSVC_NETDISKENUM, 3752 &state->tmp); 3753 if (tevent_req_nomem(subreq, req)) { 3754 return tevent_req_post(req, ev); 3755 } 3756 tevent_req_set_callback(subreq, rpccli_srvsvc_NetDiskEnum_done, req); 3757 return req; 3758} 3759 3760static void rpccli_srvsvc_NetDiskEnum_done(struct tevent_req *subreq) 3761{ 3762 struct tevent_req *req = tevent_req_callback_data( 3763 subreq, struct tevent_req); 3764 struct rpccli_srvsvc_NetDiskEnum_state *state = tevent_req_data( 3765 req, struct rpccli_srvsvc_NetDiskEnum_state); 3766 NTSTATUS status; 3767 TALLOC_CTX *mem_ctx; 3768 3769 if (state->out_mem_ctx) { 3770 mem_ctx = state->out_mem_ctx; 3771 } else { 3772 mem_ctx = state; 3773 } 3774 3775 status = state->dispatch_recv(subreq, mem_ctx); 3776 TALLOC_FREE(subreq); 3777 if (!NT_STATUS_IS_OK(status)) { 3778 tevent_req_nterror(req, status); 3779 return; 3780 } 3781 3782 /* Copy out parameters */ 3783 *state->orig.out.info = *state->tmp.out.info; 3784 *state->orig.out.totalentries = *state->tmp.out.totalentries; 3785 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 3786 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 3787 } 3788 3789 /* Copy result */ 3790 state->orig.out.result = state->tmp.out.result; 3791 3792 /* Reset temporary structure */ 3793 ZERO_STRUCT(state->tmp); 3794 3795 tevent_req_done(req); 3796} 3797 3798NTSTATUS rpccli_srvsvc_NetDiskEnum_recv(struct tevent_req *req, 3799 TALLOC_CTX *mem_ctx, 3800 WERROR *result) 3801{ 3802 struct rpccli_srvsvc_NetDiskEnum_state *state = tevent_req_data( 3803 req, struct rpccli_srvsvc_NetDiskEnum_state); 3804 NTSTATUS status; 3805 3806 if (tevent_req_is_nterror(req, &status)) { 3807 tevent_req_received(req); 3808 return status; 3809 } 3810 3811 /* Steal possbile out parameters to the callers context */ 3812 talloc_steal(mem_ctx, state->out_mem_ctx); 3813 3814 /* Return result */ 3815 *result = state->orig.out.result; 3816 3817 tevent_req_received(req); 3818 return NT_STATUS_OK; 3819} 3820 3821NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, 3822 TALLOC_CTX *mem_ctx, 3823 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3824 uint32_t level /* [in] */, 3825 struct srvsvc_NetDiskInfo *info /* [in,out] [ref] */, 3826 uint32_t maxlen /* [in] */, 3827 uint32_t *totalentries /* [out] [ref] */, 3828 uint32_t *resume_handle /* [in,out] [unique] */, 3829 WERROR *werror) 3830{ 3831 struct srvsvc_NetDiskEnum r; 3832 NTSTATUS status; 3833 3834 /* In parameters */ 3835 r.in.server_unc = server_unc; 3836 r.in.level = level; 3837 r.in.info = info; 3838 r.in.maxlen = maxlen; 3839 r.in.resume_handle = resume_handle; 3840 3841 status = cli->dispatch(cli, 3842 mem_ctx, 3843 &ndr_table_srvsvc, 3844 NDR_SRVSVC_NETDISKENUM, 3845 &r); 3846 3847 if (!NT_STATUS_IS_OK(status)) { 3848 return status; 3849 } 3850 3851 if (NT_STATUS_IS_ERR(status)) { 3852 return status; 3853 } 3854 3855 /* Return variables */ 3856 *info = *r.out.info; 3857 *totalentries = *r.out.totalentries; 3858 if (resume_handle && r.out.resume_handle) { 3859 *resume_handle = *r.out.resume_handle; 3860 } 3861 3862 /* Return result */ 3863 if (werror) { 3864 *werror = r.out.result; 3865 } 3866 3867 return werror_to_ntstatus(r.out.result); 3868} 3869 3870struct rpccli_srvsvc_NetServerStatisticsGet_state { 3871 struct srvsvc_NetServerStatisticsGet orig; 3872 struct srvsvc_NetServerStatisticsGet tmp; 3873 TALLOC_CTX *out_mem_ctx; 3874 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 3875}; 3876 3877static void rpccli_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq); 3878 3879struct tevent_req *rpccli_srvsvc_NetServerStatisticsGet_send(TALLOC_CTX *mem_ctx, 3880 struct tevent_context *ev, 3881 struct rpc_pipe_client *cli, 3882 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 3883 const char *_service /* [in] [unique,charset(UTF16)] */, 3884 uint32_t _level /* [in] */, 3885 uint32_t _options /* [in] */, 3886 struct srvsvc_Statistics **_stats /* [out] [ref] */) 3887{ 3888 struct tevent_req *req; 3889 struct rpccli_srvsvc_NetServerStatisticsGet_state *state; 3890 struct tevent_req *subreq; 3891 3892 req = tevent_req_create(mem_ctx, &state, 3893 struct rpccli_srvsvc_NetServerStatisticsGet_state); 3894 if (req == NULL) { 3895 return NULL; 3896 } 3897 state->out_mem_ctx = NULL; 3898 state->dispatch_recv = cli->dispatch_recv; 3899 3900 /* In parameters */ 3901 state->orig.in.server_unc = _server_unc; 3902 state->orig.in.service = _service; 3903 state->orig.in.level = _level; 3904 state->orig.in.options = _options; 3905 3906 /* Out parameters */ 3907 state->orig.out.stats = _stats; 3908 3909 /* Result */ 3910 ZERO_STRUCT(state->orig.out.result); 3911 3912 state->out_mem_ctx = talloc_named_const(state, 0, 3913 "rpccli_srvsvc_NetServerStatisticsGet_out_memory"); 3914 if (tevent_req_nomem(state->out_mem_ctx, req)) { 3915 return tevent_req_post(req, ev); 3916 } 3917 3918 /* make a temporary copy, that we pass to the dispatch function */ 3919 state->tmp = state->orig; 3920 3921 subreq = cli->dispatch_send(state, ev, cli, 3922 &ndr_table_srvsvc, 3923 NDR_SRVSVC_NETSERVERSTATISTICSGET, 3924 &state->tmp); 3925 if (tevent_req_nomem(subreq, req)) { 3926 return tevent_req_post(req, ev); 3927 } 3928 tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerStatisticsGet_done, req); 3929 return req; 3930} 3931 3932static void rpccli_srvsvc_NetServerStatisticsGet_done(struct tevent_req *subreq) 3933{ 3934 struct tevent_req *req = tevent_req_callback_data( 3935 subreq, struct tevent_req); 3936 struct rpccli_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data( 3937 req, struct rpccli_srvsvc_NetServerStatisticsGet_state); 3938 NTSTATUS status; 3939 TALLOC_CTX *mem_ctx; 3940 3941 if (state->out_mem_ctx) { 3942 mem_ctx = state->out_mem_ctx; 3943 } else { 3944 mem_ctx = state; 3945 } 3946 3947 status = state->dispatch_recv(subreq, mem_ctx); 3948 TALLOC_FREE(subreq); 3949 if (!NT_STATUS_IS_OK(status)) { 3950 tevent_req_nterror(req, status); 3951 return; 3952 } 3953 3954 /* Copy out parameters */ 3955 *state->orig.out.stats = *state->tmp.out.stats; 3956 3957 /* Copy result */ 3958 state->orig.out.result = state->tmp.out.result; 3959 3960 /* Reset temporary structure */ 3961 ZERO_STRUCT(state->tmp); 3962 3963 tevent_req_done(req); 3964} 3965 3966NTSTATUS rpccli_srvsvc_NetServerStatisticsGet_recv(struct tevent_req *req, 3967 TALLOC_CTX *mem_ctx, 3968 WERROR *result) 3969{ 3970 struct rpccli_srvsvc_NetServerStatisticsGet_state *state = tevent_req_data( 3971 req, struct rpccli_srvsvc_NetServerStatisticsGet_state); 3972 NTSTATUS status; 3973 3974 if (tevent_req_is_nterror(req, &status)) { 3975 tevent_req_received(req); 3976 return status; 3977 } 3978 3979 /* Steal possbile out parameters to the callers context */ 3980 talloc_steal(mem_ctx, state->out_mem_ctx); 3981 3982 /* Return result */ 3983 *result = state->orig.out.result; 3984 3985 tevent_req_received(req); 3986 return NT_STATUS_OK; 3987} 3988 3989NTSTATUS rpccli_srvsvc_NetServerStatisticsGet(struct rpc_pipe_client *cli, 3990 TALLOC_CTX *mem_ctx, 3991 const char *server_unc /* [in] [unique,charset(UTF16)] */, 3992 const char *service /* [in] [unique,charset(UTF16)] */, 3993 uint32_t level /* [in] */, 3994 uint32_t options /* [in] */, 3995 struct srvsvc_Statistics **stats /* [out] [ref] */, 3996 WERROR *werror) 3997{ 3998 struct srvsvc_NetServerStatisticsGet r; 3999 NTSTATUS status; 4000 4001 /* In parameters */ 4002 r.in.server_unc = server_unc; 4003 r.in.service = service; 4004 r.in.level = level; 4005 r.in.options = options; 4006 4007 status = cli->dispatch(cli, 4008 mem_ctx, 4009 &ndr_table_srvsvc, 4010 NDR_SRVSVC_NETSERVERSTATISTICSGET, 4011 &r); 4012 4013 if (!NT_STATUS_IS_OK(status)) { 4014 return status; 4015 } 4016 4017 if (NT_STATUS_IS_ERR(status)) { 4018 return status; 4019 } 4020 4021 /* Return variables */ 4022 *stats = *r.out.stats; 4023 4024 /* Return result */ 4025 if (werror) { 4026 *werror = r.out.result; 4027 } 4028 4029 return werror_to_ntstatus(r.out.result); 4030} 4031 4032struct rpccli_srvsvc_NetTransportAdd_state { 4033 struct srvsvc_NetTransportAdd orig; 4034 struct srvsvc_NetTransportAdd tmp; 4035 TALLOC_CTX *out_mem_ctx; 4036 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4037}; 4038 4039static void rpccli_srvsvc_NetTransportAdd_done(struct tevent_req *subreq); 4040 4041struct tevent_req *rpccli_srvsvc_NetTransportAdd_send(TALLOC_CTX *mem_ctx, 4042 struct tevent_context *ev, 4043 struct rpc_pipe_client *cli, 4044 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4045 uint32_t _level /* [in] */, 4046 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */) 4047{ 4048 struct tevent_req *req; 4049 struct rpccli_srvsvc_NetTransportAdd_state *state; 4050 struct tevent_req *subreq; 4051 4052 req = tevent_req_create(mem_ctx, &state, 4053 struct rpccli_srvsvc_NetTransportAdd_state); 4054 if (req == NULL) { 4055 return NULL; 4056 } 4057 state->out_mem_ctx = NULL; 4058 state->dispatch_recv = cli->dispatch_recv; 4059 4060 /* In parameters */ 4061 state->orig.in.server_unc = _server_unc; 4062 state->orig.in.level = _level; 4063 state->orig.in.info = _info; 4064 4065 /* Out parameters */ 4066 4067 /* Result */ 4068 ZERO_STRUCT(state->orig.out.result); 4069 4070 /* make a temporary copy, that we pass to the dispatch function */ 4071 state->tmp = state->orig; 4072 4073 subreq = cli->dispatch_send(state, ev, cli, 4074 &ndr_table_srvsvc, 4075 NDR_SRVSVC_NETTRANSPORTADD, 4076 &state->tmp); 4077 if (tevent_req_nomem(subreq, req)) { 4078 return tevent_req_post(req, ev); 4079 } 4080 tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportAdd_done, req); 4081 return req; 4082} 4083 4084static void rpccli_srvsvc_NetTransportAdd_done(struct tevent_req *subreq) 4085{ 4086 struct tevent_req *req = tevent_req_callback_data( 4087 subreq, struct tevent_req); 4088 struct rpccli_srvsvc_NetTransportAdd_state *state = tevent_req_data( 4089 req, struct rpccli_srvsvc_NetTransportAdd_state); 4090 NTSTATUS status; 4091 TALLOC_CTX *mem_ctx; 4092 4093 if (state->out_mem_ctx) { 4094 mem_ctx = state->out_mem_ctx; 4095 } else { 4096 mem_ctx = state; 4097 } 4098 4099 status = state->dispatch_recv(subreq, mem_ctx); 4100 TALLOC_FREE(subreq); 4101 if (!NT_STATUS_IS_OK(status)) { 4102 tevent_req_nterror(req, status); 4103 return; 4104 } 4105 4106 /* Copy out parameters */ 4107 4108 /* Copy result */ 4109 state->orig.out.result = state->tmp.out.result; 4110 4111 /* Reset temporary structure */ 4112 ZERO_STRUCT(state->tmp); 4113 4114 tevent_req_done(req); 4115} 4116 4117NTSTATUS rpccli_srvsvc_NetTransportAdd_recv(struct tevent_req *req, 4118 TALLOC_CTX *mem_ctx, 4119 WERROR *result) 4120{ 4121 struct rpccli_srvsvc_NetTransportAdd_state *state = tevent_req_data( 4122 req, struct rpccli_srvsvc_NetTransportAdd_state); 4123 NTSTATUS status; 4124 4125 if (tevent_req_is_nterror(req, &status)) { 4126 tevent_req_received(req); 4127 return status; 4128 } 4129 4130 /* Steal possbile out parameters to the callers context */ 4131 talloc_steal(mem_ctx, state->out_mem_ctx); 4132 4133 /* Return result */ 4134 *result = state->orig.out.result; 4135 4136 tevent_req_received(req); 4137 return NT_STATUS_OK; 4138} 4139 4140NTSTATUS rpccli_srvsvc_NetTransportAdd(struct rpc_pipe_client *cli, 4141 TALLOC_CTX *mem_ctx, 4142 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4143 uint32_t level /* [in] */, 4144 union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, 4145 WERROR *werror) 4146{ 4147 struct srvsvc_NetTransportAdd r; 4148 NTSTATUS status; 4149 4150 /* In parameters */ 4151 r.in.server_unc = server_unc; 4152 r.in.level = level; 4153 r.in.info = info; 4154 4155 status = cli->dispatch(cli, 4156 mem_ctx, 4157 &ndr_table_srvsvc, 4158 NDR_SRVSVC_NETTRANSPORTADD, 4159 &r); 4160 4161 if (!NT_STATUS_IS_OK(status)) { 4162 return status; 4163 } 4164 4165 if (NT_STATUS_IS_ERR(status)) { 4166 return status; 4167 } 4168 4169 /* Return variables */ 4170 4171 /* Return result */ 4172 if (werror) { 4173 *werror = r.out.result; 4174 } 4175 4176 return werror_to_ntstatus(r.out.result); 4177} 4178 4179struct rpccli_srvsvc_NetTransportEnum_state { 4180 struct srvsvc_NetTransportEnum orig; 4181 struct srvsvc_NetTransportEnum tmp; 4182 TALLOC_CTX *out_mem_ctx; 4183 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4184}; 4185 4186static void rpccli_srvsvc_NetTransportEnum_done(struct tevent_req *subreq); 4187 4188struct tevent_req *rpccli_srvsvc_NetTransportEnum_send(TALLOC_CTX *mem_ctx, 4189 struct tevent_context *ev, 4190 struct rpc_pipe_client *cli, 4191 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4192 struct srvsvc_NetTransportInfoCtr *_transports /* [in,out] [ref] */, 4193 uint32_t _max_buffer /* [in] */, 4194 uint32_t *_totalentries /* [out] [ref] */, 4195 uint32_t *_resume_handle /* [in,out] [unique] */) 4196{ 4197 struct tevent_req *req; 4198 struct rpccli_srvsvc_NetTransportEnum_state *state; 4199 struct tevent_req *subreq; 4200 4201 req = tevent_req_create(mem_ctx, &state, 4202 struct rpccli_srvsvc_NetTransportEnum_state); 4203 if (req == NULL) { 4204 return NULL; 4205 } 4206 state->out_mem_ctx = NULL; 4207 state->dispatch_recv = cli->dispatch_recv; 4208 4209 /* In parameters */ 4210 state->orig.in.server_unc = _server_unc; 4211 state->orig.in.transports = _transports; 4212 state->orig.in.max_buffer = _max_buffer; 4213 state->orig.in.resume_handle = _resume_handle; 4214 4215 /* Out parameters */ 4216 state->orig.out.transports = _transports; 4217 state->orig.out.totalentries = _totalentries; 4218 state->orig.out.resume_handle = _resume_handle; 4219 4220 /* Result */ 4221 ZERO_STRUCT(state->orig.out.result); 4222 4223 state->out_mem_ctx = talloc_named_const(state, 0, 4224 "rpccli_srvsvc_NetTransportEnum_out_memory"); 4225 if (tevent_req_nomem(state->out_mem_ctx, req)) { 4226 return tevent_req_post(req, ev); 4227 } 4228 4229 /* make a temporary copy, that we pass to the dispatch function */ 4230 state->tmp = state->orig; 4231 4232 subreq = cli->dispatch_send(state, ev, cli, 4233 &ndr_table_srvsvc, 4234 NDR_SRVSVC_NETTRANSPORTENUM, 4235 &state->tmp); 4236 if (tevent_req_nomem(subreq, req)) { 4237 return tevent_req_post(req, ev); 4238 } 4239 tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportEnum_done, req); 4240 return req; 4241} 4242 4243static void rpccli_srvsvc_NetTransportEnum_done(struct tevent_req *subreq) 4244{ 4245 struct tevent_req *req = tevent_req_callback_data( 4246 subreq, struct tevent_req); 4247 struct rpccli_srvsvc_NetTransportEnum_state *state = tevent_req_data( 4248 req, struct rpccli_srvsvc_NetTransportEnum_state); 4249 NTSTATUS status; 4250 TALLOC_CTX *mem_ctx; 4251 4252 if (state->out_mem_ctx) { 4253 mem_ctx = state->out_mem_ctx; 4254 } else { 4255 mem_ctx = state; 4256 } 4257 4258 status = state->dispatch_recv(subreq, mem_ctx); 4259 TALLOC_FREE(subreq); 4260 if (!NT_STATUS_IS_OK(status)) { 4261 tevent_req_nterror(req, status); 4262 return; 4263 } 4264 4265 /* Copy out parameters */ 4266 *state->orig.out.transports = *state->tmp.out.transports; 4267 *state->orig.out.totalentries = *state->tmp.out.totalentries; 4268 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 4269 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 4270 } 4271 4272 /* Copy result */ 4273 state->orig.out.result = state->tmp.out.result; 4274 4275 /* Reset temporary structure */ 4276 ZERO_STRUCT(state->tmp); 4277 4278 tevent_req_done(req); 4279} 4280 4281NTSTATUS rpccli_srvsvc_NetTransportEnum_recv(struct tevent_req *req, 4282 TALLOC_CTX *mem_ctx, 4283 WERROR *result) 4284{ 4285 struct rpccli_srvsvc_NetTransportEnum_state *state = tevent_req_data( 4286 req, struct rpccli_srvsvc_NetTransportEnum_state); 4287 NTSTATUS status; 4288 4289 if (tevent_req_is_nterror(req, &status)) { 4290 tevent_req_received(req); 4291 return status; 4292 } 4293 4294 /* Steal possbile out parameters to the callers context */ 4295 talloc_steal(mem_ctx, state->out_mem_ctx); 4296 4297 /* Return result */ 4298 *result = state->orig.out.result; 4299 4300 tevent_req_received(req); 4301 return NT_STATUS_OK; 4302} 4303 4304NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, 4305 TALLOC_CTX *mem_ctx, 4306 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4307 struct srvsvc_NetTransportInfoCtr *transports /* [in,out] [ref] */, 4308 uint32_t max_buffer /* [in] */, 4309 uint32_t *totalentries /* [out] [ref] */, 4310 uint32_t *resume_handle /* [in,out] [unique] */, 4311 WERROR *werror) 4312{ 4313 struct srvsvc_NetTransportEnum r; 4314 NTSTATUS status; 4315 4316 /* In parameters */ 4317 r.in.server_unc = server_unc; 4318 r.in.transports = transports; 4319 r.in.max_buffer = max_buffer; 4320 r.in.resume_handle = resume_handle; 4321 4322 status = cli->dispatch(cli, 4323 mem_ctx, 4324 &ndr_table_srvsvc, 4325 NDR_SRVSVC_NETTRANSPORTENUM, 4326 &r); 4327 4328 if (!NT_STATUS_IS_OK(status)) { 4329 return status; 4330 } 4331 4332 if (NT_STATUS_IS_ERR(status)) { 4333 return status; 4334 } 4335 4336 /* Return variables */ 4337 *transports = *r.out.transports; 4338 *totalentries = *r.out.totalentries; 4339 if (resume_handle && r.out.resume_handle) { 4340 *resume_handle = *r.out.resume_handle; 4341 } 4342 4343 /* Return result */ 4344 if (werror) { 4345 *werror = r.out.result; 4346 } 4347 4348 return werror_to_ntstatus(r.out.result); 4349} 4350 4351struct rpccli_srvsvc_NetTransportDel_state { 4352 struct srvsvc_NetTransportDel orig; 4353 struct srvsvc_NetTransportDel tmp; 4354 TALLOC_CTX *out_mem_ctx; 4355 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4356}; 4357 4358static void rpccli_srvsvc_NetTransportDel_done(struct tevent_req *subreq); 4359 4360struct tevent_req *rpccli_srvsvc_NetTransportDel_send(TALLOC_CTX *mem_ctx, 4361 struct tevent_context *ev, 4362 struct rpc_pipe_client *cli, 4363 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4364 uint32_t _level /* [in] */, 4365 struct srvsvc_NetTransportInfo0 *_info0 /* [in] [ref] */) 4366{ 4367 struct tevent_req *req; 4368 struct rpccli_srvsvc_NetTransportDel_state *state; 4369 struct tevent_req *subreq; 4370 4371 req = tevent_req_create(mem_ctx, &state, 4372 struct rpccli_srvsvc_NetTransportDel_state); 4373 if (req == NULL) { 4374 return NULL; 4375 } 4376 state->out_mem_ctx = NULL; 4377 state->dispatch_recv = cli->dispatch_recv; 4378 4379 /* In parameters */ 4380 state->orig.in.server_unc = _server_unc; 4381 state->orig.in.level = _level; 4382 state->orig.in.info0 = _info0; 4383 4384 /* Out parameters */ 4385 4386 /* Result */ 4387 ZERO_STRUCT(state->orig.out.result); 4388 4389 /* make a temporary copy, that we pass to the dispatch function */ 4390 state->tmp = state->orig; 4391 4392 subreq = cli->dispatch_send(state, ev, cli, 4393 &ndr_table_srvsvc, 4394 NDR_SRVSVC_NETTRANSPORTDEL, 4395 &state->tmp); 4396 if (tevent_req_nomem(subreq, req)) { 4397 return tevent_req_post(req, ev); 4398 } 4399 tevent_req_set_callback(subreq, rpccli_srvsvc_NetTransportDel_done, req); 4400 return req; 4401} 4402 4403static void rpccli_srvsvc_NetTransportDel_done(struct tevent_req *subreq) 4404{ 4405 struct tevent_req *req = tevent_req_callback_data( 4406 subreq, struct tevent_req); 4407 struct rpccli_srvsvc_NetTransportDel_state *state = tevent_req_data( 4408 req, struct rpccli_srvsvc_NetTransportDel_state); 4409 NTSTATUS status; 4410 TALLOC_CTX *mem_ctx; 4411 4412 if (state->out_mem_ctx) { 4413 mem_ctx = state->out_mem_ctx; 4414 } else { 4415 mem_ctx = state; 4416 } 4417 4418 status = state->dispatch_recv(subreq, mem_ctx); 4419 TALLOC_FREE(subreq); 4420 if (!NT_STATUS_IS_OK(status)) { 4421 tevent_req_nterror(req, status); 4422 return; 4423 } 4424 4425 /* Copy out parameters */ 4426 4427 /* Copy result */ 4428 state->orig.out.result = state->tmp.out.result; 4429 4430 /* Reset temporary structure */ 4431 ZERO_STRUCT(state->tmp); 4432 4433 tevent_req_done(req); 4434} 4435 4436NTSTATUS rpccli_srvsvc_NetTransportDel_recv(struct tevent_req *req, 4437 TALLOC_CTX *mem_ctx, 4438 WERROR *result) 4439{ 4440 struct rpccli_srvsvc_NetTransportDel_state *state = tevent_req_data( 4441 req, struct rpccli_srvsvc_NetTransportDel_state); 4442 NTSTATUS status; 4443 4444 if (tevent_req_is_nterror(req, &status)) { 4445 tevent_req_received(req); 4446 return status; 4447 } 4448 4449 /* Steal possbile out parameters to the callers context */ 4450 talloc_steal(mem_ctx, state->out_mem_ctx); 4451 4452 /* Return result */ 4453 *result = state->orig.out.result; 4454 4455 tevent_req_received(req); 4456 return NT_STATUS_OK; 4457} 4458 4459NTSTATUS rpccli_srvsvc_NetTransportDel(struct rpc_pipe_client *cli, 4460 TALLOC_CTX *mem_ctx, 4461 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4462 uint32_t level /* [in] */, 4463 struct srvsvc_NetTransportInfo0 *info0 /* [in] [ref] */, 4464 WERROR *werror) 4465{ 4466 struct srvsvc_NetTransportDel r; 4467 NTSTATUS status; 4468 4469 /* In parameters */ 4470 r.in.server_unc = server_unc; 4471 r.in.level = level; 4472 r.in.info0 = info0; 4473 4474 status = cli->dispatch(cli, 4475 mem_ctx, 4476 &ndr_table_srvsvc, 4477 NDR_SRVSVC_NETTRANSPORTDEL, 4478 &r); 4479 4480 if (!NT_STATUS_IS_OK(status)) { 4481 return status; 4482 } 4483 4484 if (NT_STATUS_IS_ERR(status)) { 4485 return status; 4486 } 4487 4488 /* Return variables */ 4489 4490 /* Return result */ 4491 if (werror) { 4492 *werror = r.out.result; 4493 } 4494 4495 return werror_to_ntstatus(r.out.result); 4496} 4497 4498struct rpccli_srvsvc_NetRemoteTOD_state { 4499 struct srvsvc_NetRemoteTOD orig; 4500 struct srvsvc_NetRemoteTOD tmp; 4501 TALLOC_CTX *out_mem_ctx; 4502 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4503}; 4504 4505static void rpccli_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq); 4506 4507struct tevent_req *rpccli_srvsvc_NetRemoteTOD_send(TALLOC_CTX *mem_ctx, 4508 struct tevent_context *ev, 4509 struct rpc_pipe_client *cli, 4510 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4511 struct srvsvc_NetRemoteTODInfo **_info /* [out] [ref] */) 4512{ 4513 struct tevent_req *req; 4514 struct rpccli_srvsvc_NetRemoteTOD_state *state; 4515 struct tevent_req *subreq; 4516 4517 req = tevent_req_create(mem_ctx, &state, 4518 struct rpccli_srvsvc_NetRemoteTOD_state); 4519 if (req == NULL) { 4520 return NULL; 4521 } 4522 state->out_mem_ctx = NULL; 4523 state->dispatch_recv = cli->dispatch_recv; 4524 4525 /* In parameters */ 4526 state->orig.in.server_unc = _server_unc; 4527 4528 /* Out parameters */ 4529 state->orig.out.info = _info; 4530 4531 /* Result */ 4532 ZERO_STRUCT(state->orig.out.result); 4533 4534 state->out_mem_ctx = talloc_named_const(state, 0, 4535 "rpccli_srvsvc_NetRemoteTOD_out_memory"); 4536 if (tevent_req_nomem(state->out_mem_ctx, req)) { 4537 return tevent_req_post(req, ev); 4538 } 4539 4540 /* make a temporary copy, that we pass to the dispatch function */ 4541 state->tmp = state->orig; 4542 4543 subreq = cli->dispatch_send(state, ev, cli, 4544 &ndr_table_srvsvc, 4545 NDR_SRVSVC_NETREMOTETOD, 4546 &state->tmp); 4547 if (tevent_req_nomem(subreq, req)) { 4548 return tevent_req_post(req, ev); 4549 } 4550 tevent_req_set_callback(subreq, rpccli_srvsvc_NetRemoteTOD_done, req); 4551 return req; 4552} 4553 4554static void rpccli_srvsvc_NetRemoteTOD_done(struct tevent_req *subreq) 4555{ 4556 struct tevent_req *req = tevent_req_callback_data( 4557 subreq, struct tevent_req); 4558 struct rpccli_srvsvc_NetRemoteTOD_state *state = tevent_req_data( 4559 req, struct rpccli_srvsvc_NetRemoteTOD_state); 4560 NTSTATUS status; 4561 TALLOC_CTX *mem_ctx; 4562 4563 if (state->out_mem_ctx) { 4564 mem_ctx = state->out_mem_ctx; 4565 } else { 4566 mem_ctx = state; 4567 } 4568 4569 status = state->dispatch_recv(subreq, mem_ctx); 4570 TALLOC_FREE(subreq); 4571 if (!NT_STATUS_IS_OK(status)) { 4572 tevent_req_nterror(req, status); 4573 return; 4574 } 4575 4576 /* Copy out parameters */ 4577 *state->orig.out.info = *state->tmp.out.info; 4578 4579 /* Copy result */ 4580 state->orig.out.result = state->tmp.out.result; 4581 4582 /* Reset temporary structure */ 4583 ZERO_STRUCT(state->tmp); 4584 4585 tevent_req_done(req); 4586} 4587 4588NTSTATUS rpccli_srvsvc_NetRemoteTOD_recv(struct tevent_req *req, 4589 TALLOC_CTX *mem_ctx, 4590 WERROR *result) 4591{ 4592 struct rpccli_srvsvc_NetRemoteTOD_state *state = tevent_req_data( 4593 req, struct rpccli_srvsvc_NetRemoteTOD_state); 4594 NTSTATUS status; 4595 4596 if (tevent_req_is_nterror(req, &status)) { 4597 tevent_req_received(req); 4598 return status; 4599 } 4600 4601 /* Steal possbile out parameters to the callers context */ 4602 talloc_steal(mem_ctx, state->out_mem_ctx); 4603 4604 /* Return result */ 4605 *result = state->orig.out.result; 4606 4607 tevent_req_received(req); 4608 return NT_STATUS_OK; 4609} 4610 4611NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, 4612 TALLOC_CTX *mem_ctx, 4613 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4614 struct srvsvc_NetRemoteTODInfo **info /* [out] [ref] */, 4615 WERROR *werror) 4616{ 4617 struct srvsvc_NetRemoteTOD r; 4618 NTSTATUS status; 4619 4620 /* In parameters */ 4621 r.in.server_unc = server_unc; 4622 4623 status = cli->dispatch(cli, 4624 mem_ctx, 4625 &ndr_table_srvsvc, 4626 NDR_SRVSVC_NETREMOTETOD, 4627 &r); 4628 4629 if (!NT_STATUS_IS_OK(status)) { 4630 return status; 4631 } 4632 4633 if (NT_STATUS_IS_ERR(status)) { 4634 return status; 4635 } 4636 4637 /* Return variables */ 4638 *info = *r.out.info; 4639 4640 /* Return result */ 4641 if (werror) { 4642 *werror = r.out.result; 4643 } 4644 4645 return werror_to_ntstatus(r.out.result); 4646} 4647 4648struct rpccli_srvsvc_NetSetServiceBits_state { 4649 struct srvsvc_NetSetServiceBits orig; 4650 struct srvsvc_NetSetServiceBits tmp; 4651 TALLOC_CTX *out_mem_ctx; 4652 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4653}; 4654 4655static void rpccli_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq); 4656 4657struct tevent_req *rpccli_srvsvc_NetSetServiceBits_send(TALLOC_CTX *mem_ctx, 4658 struct tevent_context *ev, 4659 struct rpc_pipe_client *cli, 4660 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4661 const char *_transport /* [in] [unique,charset(UTF16)] */, 4662 uint32_t _servicebits /* [in] */, 4663 uint32_t _updateimmediately /* [in] */) 4664{ 4665 struct tevent_req *req; 4666 struct rpccli_srvsvc_NetSetServiceBits_state *state; 4667 struct tevent_req *subreq; 4668 4669 req = tevent_req_create(mem_ctx, &state, 4670 struct rpccli_srvsvc_NetSetServiceBits_state); 4671 if (req == NULL) { 4672 return NULL; 4673 } 4674 state->out_mem_ctx = NULL; 4675 state->dispatch_recv = cli->dispatch_recv; 4676 4677 /* In parameters */ 4678 state->orig.in.server_unc = _server_unc; 4679 state->orig.in.transport = _transport; 4680 state->orig.in.servicebits = _servicebits; 4681 state->orig.in.updateimmediately = _updateimmediately; 4682 4683 /* Out parameters */ 4684 4685 /* Result */ 4686 ZERO_STRUCT(state->orig.out.result); 4687 4688 /* make a temporary copy, that we pass to the dispatch function */ 4689 state->tmp = state->orig; 4690 4691 subreq = cli->dispatch_send(state, ev, cli, 4692 &ndr_table_srvsvc, 4693 NDR_SRVSVC_NETSETSERVICEBITS, 4694 &state->tmp); 4695 if (tevent_req_nomem(subreq, req)) { 4696 return tevent_req_post(req, ev); 4697 } 4698 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSetServiceBits_done, req); 4699 return req; 4700} 4701 4702static void rpccli_srvsvc_NetSetServiceBits_done(struct tevent_req *subreq) 4703{ 4704 struct tevent_req *req = tevent_req_callback_data( 4705 subreq, struct tevent_req); 4706 struct rpccli_srvsvc_NetSetServiceBits_state *state = tevent_req_data( 4707 req, struct rpccli_srvsvc_NetSetServiceBits_state); 4708 NTSTATUS status; 4709 TALLOC_CTX *mem_ctx; 4710 4711 if (state->out_mem_ctx) { 4712 mem_ctx = state->out_mem_ctx; 4713 } else { 4714 mem_ctx = state; 4715 } 4716 4717 status = state->dispatch_recv(subreq, mem_ctx); 4718 TALLOC_FREE(subreq); 4719 if (!NT_STATUS_IS_OK(status)) { 4720 tevent_req_nterror(req, status); 4721 return; 4722 } 4723 4724 /* Copy out parameters */ 4725 4726 /* Copy result */ 4727 state->orig.out.result = state->tmp.out.result; 4728 4729 /* Reset temporary structure */ 4730 ZERO_STRUCT(state->tmp); 4731 4732 tevent_req_done(req); 4733} 4734 4735NTSTATUS rpccli_srvsvc_NetSetServiceBits_recv(struct tevent_req *req, 4736 TALLOC_CTX *mem_ctx, 4737 WERROR *result) 4738{ 4739 struct rpccli_srvsvc_NetSetServiceBits_state *state = tevent_req_data( 4740 req, struct rpccli_srvsvc_NetSetServiceBits_state); 4741 NTSTATUS status; 4742 4743 if (tevent_req_is_nterror(req, &status)) { 4744 tevent_req_received(req); 4745 return status; 4746 } 4747 4748 /* Steal possbile out parameters to the callers context */ 4749 talloc_steal(mem_ctx, state->out_mem_ctx); 4750 4751 /* Return result */ 4752 *result = state->orig.out.result; 4753 4754 tevent_req_received(req); 4755 return NT_STATUS_OK; 4756} 4757 4758NTSTATUS rpccli_srvsvc_NetSetServiceBits(struct rpc_pipe_client *cli, 4759 TALLOC_CTX *mem_ctx, 4760 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4761 const char *transport /* [in] [unique,charset(UTF16)] */, 4762 uint32_t servicebits /* [in] */, 4763 uint32_t updateimmediately /* [in] */, 4764 WERROR *werror) 4765{ 4766 struct srvsvc_NetSetServiceBits r; 4767 NTSTATUS status; 4768 4769 /* In parameters */ 4770 r.in.server_unc = server_unc; 4771 r.in.transport = transport; 4772 r.in.servicebits = servicebits; 4773 r.in.updateimmediately = updateimmediately; 4774 4775 status = cli->dispatch(cli, 4776 mem_ctx, 4777 &ndr_table_srvsvc, 4778 NDR_SRVSVC_NETSETSERVICEBITS, 4779 &r); 4780 4781 if (!NT_STATUS_IS_OK(status)) { 4782 return status; 4783 } 4784 4785 if (NT_STATUS_IS_ERR(status)) { 4786 return status; 4787 } 4788 4789 /* Return variables */ 4790 4791 /* Return result */ 4792 if (werror) { 4793 *werror = r.out.result; 4794 } 4795 4796 return werror_to_ntstatus(r.out.result); 4797} 4798 4799struct rpccli_srvsvc_NetPathType_state { 4800 struct srvsvc_NetPathType orig; 4801 struct srvsvc_NetPathType tmp; 4802 TALLOC_CTX *out_mem_ctx; 4803 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4804}; 4805 4806static void rpccli_srvsvc_NetPathType_done(struct tevent_req *subreq); 4807 4808struct tevent_req *rpccli_srvsvc_NetPathType_send(TALLOC_CTX *mem_ctx, 4809 struct tevent_context *ev, 4810 struct rpc_pipe_client *cli, 4811 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4812 const char *_path /* [in] [charset(UTF16)] */, 4813 uint32_t _pathflags /* [in] */, 4814 uint32_t *_pathtype /* [out] [ref] */) 4815{ 4816 struct tevent_req *req; 4817 struct rpccli_srvsvc_NetPathType_state *state; 4818 struct tevent_req *subreq; 4819 4820 req = tevent_req_create(mem_ctx, &state, 4821 struct rpccli_srvsvc_NetPathType_state); 4822 if (req == NULL) { 4823 return NULL; 4824 } 4825 state->out_mem_ctx = NULL; 4826 state->dispatch_recv = cli->dispatch_recv; 4827 4828 /* In parameters */ 4829 state->orig.in.server_unc = _server_unc; 4830 state->orig.in.path = _path; 4831 state->orig.in.pathflags = _pathflags; 4832 4833 /* Out parameters */ 4834 state->orig.out.pathtype = _pathtype; 4835 4836 /* Result */ 4837 ZERO_STRUCT(state->orig.out.result); 4838 4839 state->out_mem_ctx = talloc_named_const(state, 0, 4840 "rpccli_srvsvc_NetPathType_out_memory"); 4841 if (tevent_req_nomem(state->out_mem_ctx, req)) { 4842 return tevent_req_post(req, ev); 4843 } 4844 4845 /* make a temporary copy, that we pass to the dispatch function */ 4846 state->tmp = state->orig; 4847 4848 subreq = cli->dispatch_send(state, ev, cli, 4849 &ndr_table_srvsvc, 4850 NDR_SRVSVC_NETPATHTYPE, 4851 &state->tmp); 4852 if (tevent_req_nomem(subreq, req)) { 4853 return tevent_req_post(req, ev); 4854 } 4855 tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathType_done, req); 4856 return req; 4857} 4858 4859static void rpccli_srvsvc_NetPathType_done(struct tevent_req *subreq) 4860{ 4861 struct tevent_req *req = tevent_req_callback_data( 4862 subreq, struct tevent_req); 4863 struct rpccli_srvsvc_NetPathType_state *state = tevent_req_data( 4864 req, struct rpccli_srvsvc_NetPathType_state); 4865 NTSTATUS status; 4866 TALLOC_CTX *mem_ctx; 4867 4868 if (state->out_mem_ctx) { 4869 mem_ctx = state->out_mem_ctx; 4870 } else { 4871 mem_ctx = state; 4872 } 4873 4874 status = state->dispatch_recv(subreq, mem_ctx); 4875 TALLOC_FREE(subreq); 4876 if (!NT_STATUS_IS_OK(status)) { 4877 tevent_req_nterror(req, status); 4878 return; 4879 } 4880 4881 /* Copy out parameters */ 4882 *state->orig.out.pathtype = *state->tmp.out.pathtype; 4883 4884 /* Copy result */ 4885 state->orig.out.result = state->tmp.out.result; 4886 4887 /* Reset temporary structure */ 4888 ZERO_STRUCT(state->tmp); 4889 4890 tevent_req_done(req); 4891} 4892 4893NTSTATUS rpccli_srvsvc_NetPathType_recv(struct tevent_req *req, 4894 TALLOC_CTX *mem_ctx, 4895 WERROR *result) 4896{ 4897 struct rpccli_srvsvc_NetPathType_state *state = tevent_req_data( 4898 req, struct rpccli_srvsvc_NetPathType_state); 4899 NTSTATUS status; 4900 4901 if (tevent_req_is_nterror(req, &status)) { 4902 tevent_req_received(req); 4903 return status; 4904 } 4905 4906 /* Steal possbile out parameters to the callers context */ 4907 talloc_steal(mem_ctx, state->out_mem_ctx); 4908 4909 /* Return result */ 4910 *result = state->orig.out.result; 4911 4912 tevent_req_received(req); 4913 return NT_STATUS_OK; 4914} 4915 4916NTSTATUS rpccli_srvsvc_NetPathType(struct rpc_pipe_client *cli, 4917 TALLOC_CTX *mem_ctx, 4918 const char *server_unc /* [in] [unique,charset(UTF16)] */, 4919 const char *path /* [in] [charset(UTF16)] */, 4920 uint32_t pathflags /* [in] */, 4921 uint32_t *pathtype /* [out] [ref] */, 4922 WERROR *werror) 4923{ 4924 struct srvsvc_NetPathType r; 4925 NTSTATUS status; 4926 4927 /* In parameters */ 4928 r.in.server_unc = server_unc; 4929 r.in.path = path; 4930 r.in.pathflags = pathflags; 4931 4932 status = cli->dispatch(cli, 4933 mem_ctx, 4934 &ndr_table_srvsvc, 4935 NDR_SRVSVC_NETPATHTYPE, 4936 &r); 4937 4938 if (!NT_STATUS_IS_OK(status)) { 4939 return status; 4940 } 4941 4942 if (NT_STATUS_IS_ERR(status)) { 4943 return status; 4944 } 4945 4946 /* Return variables */ 4947 *pathtype = *r.out.pathtype; 4948 4949 /* Return result */ 4950 if (werror) { 4951 *werror = r.out.result; 4952 } 4953 4954 return werror_to_ntstatus(r.out.result); 4955} 4956 4957struct rpccli_srvsvc_NetPathCanonicalize_state { 4958 struct srvsvc_NetPathCanonicalize orig; 4959 struct srvsvc_NetPathCanonicalize tmp; 4960 TALLOC_CTX *out_mem_ctx; 4961 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 4962}; 4963 4964static void rpccli_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq); 4965 4966struct tevent_req *rpccli_srvsvc_NetPathCanonicalize_send(TALLOC_CTX *mem_ctx, 4967 struct tevent_context *ev, 4968 struct rpc_pipe_client *cli, 4969 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 4970 const char *_path /* [in] [charset(UTF16)] */, 4971 uint8_t *_can_path /* [out] [size_is(maxbuf)] */, 4972 uint32_t _maxbuf /* [in] */, 4973 const char *_prefix /* [in] [charset(UTF16)] */, 4974 uint32_t *_pathtype /* [in,out] [ref] */, 4975 uint32_t _pathflags /* [in] */) 4976{ 4977 struct tevent_req *req; 4978 struct rpccli_srvsvc_NetPathCanonicalize_state *state; 4979 struct tevent_req *subreq; 4980 4981 req = tevent_req_create(mem_ctx, &state, 4982 struct rpccli_srvsvc_NetPathCanonicalize_state); 4983 if (req == NULL) { 4984 return NULL; 4985 } 4986 state->out_mem_ctx = NULL; 4987 state->dispatch_recv = cli->dispatch_recv; 4988 4989 /* In parameters */ 4990 state->orig.in.server_unc = _server_unc; 4991 state->orig.in.path = _path; 4992 state->orig.in.maxbuf = _maxbuf; 4993 state->orig.in.prefix = _prefix; 4994 state->orig.in.pathtype = _pathtype; 4995 state->orig.in.pathflags = _pathflags; 4996 4997 /* Out parameters */ 4998 state->orig.out.can_path = _can_path; 4999 state->orig.out.pathtype = _pathtype; 5000 5001 /* Result */ 5002 ZERO_STRUCT(state->orig.out.result); 5003 5004 state->out_mem_ctx = talloc_named_const(state, 0, 5005 "rpccli_srvsvc_NetPathCanonicalize_out_memory"); 5006 if (tevent_req_nomem(state->out_mem_ctx, req)) { 5007 return tevent_req_post(req, ev); 5008 } 5009 5010 /* make a temporary copy, that we pass to the dispatch function */ 5011 state->tmp = state->orig; 5012 5013 subreq = cli->dispatch_send(state, ev, cli, 5014 &ndr_table_srvsvc, 5015 NDR_SRVSVC_NETPATHCANONICALIZE, 5016 &state->tmp); 5017 if (tevent_req_nomem(subreq, req)) { 5018 return tevent_req_post(req, ev); 5019 } 5020 tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathCanonicalize_done, req); 5021 return req; 5022} 5023 5024static void rpccli_srvsvc_NetPathCanonicalize_done(struct tevent_req *subreq) 5025{ 5026 struct tevent_req *req = tevent_req_callback_data( 5027 subreq, struct tevent_req); 5028 struct rpccli_srvsvc_NetPathCanonicalize_state *state = tevent_req_data( 5029 req, struct rpccli_srvsvc_NetPathCanonicalize_state); 5030 NTSTATUS status; 5031 TALLOC_CTX *mem_ctx; 5032 5033 if (state->out_mem_ctx) { 5034 mem_ctx = state->out_mem_ctx; 5035 } else { 5036 mem_ctx = state; 5037 } 5038 5039 status = state->dispatch_recv(subreq, mem_ctx); 5040 TALLOC_FREE(subreq); 5041 if (!NT_STATUS_IS_OK(status)) { 5042 tevent_req_nterror(req, status); 5043 return; 5044 } 5045 5046 /* Copy out parameters */ 5047 memcpy(state->orig.out.can_path, state->tmp.out.can_path, (state->tmp.in.maxbuf) * sizeof(*state->orig.out.can_path)); 5048 *state->orig.out.pathtype = *state->tmp.out.pathtype; 5049 5050 /* Copy result */ 5051 state->orig.out.result = state->tmp.out.result; 5052 5053 /* Reset temporary structure */ 5054 ZERO_STRUCT(state->tmp); 5055 5056 tevent_req_done(req); 5057} 5058 5059NTSTATUS rpccli_srvsvc_NetPathCanonicalize_recv(struct tevent_req *req, 5060 TALLOC_CTX *mem_ctx, 5061 WERROR *result) 5062{ 5063 struct rpccli_srvsvc_NetPathCanonicalize_state *state = tevent_req_data( 5064 req, struct rpccli_srvsvc_NetPathCanonicalize_state); 5065 NTSTATUS status; 5066 5067 if (tevent_req_is_nterror(req, &status)) { 5068 tevent_req_received(req); 5069 return status; 5070 } 5071 5072 /* Steal possbile out parameters to the callers context */ 5073 talloc_steal(mem_ctx, state->out_mem_ctx); 5074 5075 /* Return result */ 5076 *result = state->orig.out.result; 5077 5078 tevent_req_received(req); 5079 return NT_STATUS_OK; 5080} 5081 5082NTSTATUS rpccli_srvsvc_NetPathCanonicalize(struct rpc_pipe_client *cli, 5083 TALLOC_CTX *mem_ctx, 5084 const char *server_unc /* [in] [unique,charset(UTF16)] */, 5085 const char *path /* [in] [charset(UTF16)] */, 5086 uint8_t *can_path /* [out] [size_is(maxbuf)] */, 5087 uint32_t maxbuf /* [in] */, 5088 const char *prefix /* [in] [charset(UTF16)] */, 5089 uint32_t *pathtype /* [in,out] [ref] */, 5090 uint32_t pathflags /* [in] */, 5091 WERROR *werror) 5092{ 5093 struct srvsvc_NetPathCanonicalize r; 5094 NTSTATUS status; 5095 5096 /* In parameters */ 5097 r.in.server_unc = server_unc; 5098 r.in.path = path; 5099 r.in.maxbuf = maxbuf; 5100 r.in.prefix = prefix; 5101 r.in.pathtype = pathtype; 5102 r.in.pathflags = pathflags; 5103 5104 status = cli->dispatch(cli, 5105 mem_ctx, 5106 &ndr_table_srvsvc, 5107 NDR_SRVSVC_NETPATHCANONICALIZE, 5108 &r); 5109 5110 if (!NT_STATUS_IS_OK(status)) { 5111 return status; 5112 } 5113 5114 if (NT_STATUS_IS_ERR(status)) { 5115 return status; 5116 } 5117 5118 /* Return variables */ 5119 memcpy(can_path, r.out.can_path, (r.in.maxbuf) * sizeof(*can_path)); 5120 *pathtype = *r.out.pathtype; 5121 5122 /* Return result */ 5123 if (werror) { 5124 *werror = r.out.result; 5125 } 5126 5127 return werror_to_ntstatus(r.out.result); 5128} 5129 5130struct rpccli_srvsvc_NetPathCompare_state { 5131 struct srvsvc_NetPathCompare orig; 5132 struct srvsvc_NetPathCompare tmp; 5133 TALLOC_CTX *out_mem_ctx; 5134 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5135}; 5136 5137static void rpccli_srvsvc_NetPathCompare_done(struct tevent_req *subreq); 5138 5139struct tevent_req *rpccli_srvsvc_NetPathCompare_send(TALLOC_CTX *mem_ctx, 5140 struct tevent_context *ev, 5141 struct rpc_pipe_client *cli, 5142 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 5143 const char *_path1 /* [in] [charset(UTF16)] */, 5144 const char *_path2 /* [in] [charset(UTF16)] */, 5145 uint32_t _pathtype /* [in] */, 5146 uint32_t _pathflags /* [in] */) 5147{ 5148 struct tevent_req *req; 5149 struct rpccli_srvsvc_NetPathCompare_state *state; 5150 struct tevent_req *subreq; 5151 5152 req = tevent_req_create(mem_ctx, &state, 5153 struct rpccli_srvsvc_NetPathCompare_state); 5154 if (req == NULL) { 5155 return NULL; 5156 } 5157 state->out_mem_ctx = NULL; 5158 state->dispatch_recv = cli->dispatch_recv; 5159 5160 /* In parameters */ 5161 state->orig.in.server_unc = _server_unc; 5162 state->orig.in.path1 = _path1; 5163 state->orig.in.path2 = _path2; 5164 state->orig.in.pathtype = _pathtype; 5165 state->orig.in.pathflags = _pathflags; 5166 5167 /* Out parameters */ 5168 5169 /* Result */ 5170 ZERO_STRUCT(state->orig.out.result); 5171 5172 /* make a temporary copy, that we pass to the dispatch function */ 5173 state->tmp = state->orig; 5174 5175 subreq = cli->dispatch_send(state, ev, cli, 5176 &ndr_table_srvsvc, 5177 NDR_SRVSVC_NETPATHCOMPARE, 5178 &state->tmp); 5179 if (tevent_req_nomem(subreq, req)) { 5180 return tevent_req_post(req, ev); 5181 } 5182 tevent_req_set_callback(subreq, rpccli_srvsvc_NetPathCompare_done, req); 5183 return req; 5184} 5185 5186static void rpccli_srvsvc_NetPathCompare_done(struct tevent_req *subreq) 5187{ 5188 struct tevent_req *req = tevent_req_callback_data( 5189 subreq, struct tevent_req); 5190 struct rpccli_srvsvc_NetPathCompare_state *state = tevent_req_data( 5191 req, struct rpccli_srvsvc_NetPathCompare_state); 5192 NTSTATUS status; 5193 TALLOC_CTX *mem_ctx; 5194 5195 if (state->out_mem_ctx) { 5196 mem_ctx = state->out_mem_ctx; 5197 } else { 5198 mem_ctx = state; 5199 } 5200 5201 status = state->dispatch_recv(subreq, mem_ctx); 5202 TALLOC_FREE(subreq); 5203 if (!NT_STATUS_IS_OK(status)) { 5204 tevent_req_nterror(req, status); 5205 return; 5206 } 5207 5208 /* Copy out parameters */ 5209 5210 /* Copy result */ 5211 state->orig.out.result = state->tmp.out.result; 5212 5213 /* Reset temporary structure */ 5214 ZERO_STRUCT(state->tmp); 5215 5216 tevent_req_done(req); 5217} 5218 5219NTSTATUS rpccli_srvsvc_NetPathCompare_recv(struct tevent_req *req, 5220 TALLOC_CTX *mem_ctx, 5221 WERROR *result) 5222{ 5223 struct rpccli_srvsvc_NetPathCompare_state *state = tevent_req_data( 5224 req, struct rpccli_srvsvc_NetPathCompare_state); 5225 NTSTATUS status; 5226 5227 if (tevent_req_is_nterror(req, &status)) { 5228 tevent_req_received(req); 5229 return status; 5230 } 5231 5232 /* Steal possbile out parameters to the callers context */ 5233 talloc_steal(mem_ctx, state->out_mem_ctx); 5234 5235 /* Return result */ 5236 *result = state->orig.out.result; 5237 5238 tevent_req_received(req); 5239 return NT_STATUS_OK; 5240} 5241 5242NTSTATUS rpccli_srvsvc_NetPathCompare(struct rpc_pipe_client *cli, 5243 TALLOC_CTX *mem_ctx, 5244 const char *server_unc /* [in] [unique,charset(UTF16)] */, 5245 const char *path1 /* [in] [charset(UTF16)] */, 5246 const char *path2 /* [in] [charset(UTF16)] */, 5247 uint32_t pathtype /* [in] */, 5248 uint32_t pathflags /* [in] */, 5249 WERROR *werror) 5250{ 5251 struct srvsvc_NetPathCompare r; 5252 NTSTATUS status; 5253 5254 /* In parameters */ 5255 r.in.server_unc = server_unc; 5256 r.in.path1 = path1; 5257 r.in.path2 = path2; 5258 r.in.pathtype = pathtype; 5259 r.in.pathflags = pathflags; 5260 5261 status = cli->dispatch(cli, 5262 mem_ctx, 5263 &ndr_table_srvsvc, 5264 NDR_SRVSVC_NETPATHCOMPARE, 5265 &r); 5266 5267 if (!NT_STATUS_IS_OK(status)) { 5268 return status; 5269 } 5270 5271 if (NT_STATUS_IS_ERR(status)) { 5272 return status; 5273 } 5274 5275 /* Return variables */ 5276 5277 /* Return result */ 5278 if (werror) { 5279 *werror = r.out.result; 5280 } 5281 5282 return werror_to_ntstatus(r.out.result); 5283} 5284 5285struct rpccli_srvsvc_NetNameValidate_state { 5286 struct srvsvc_NetNameValidate orig; 5287 struct srvsvc_NetNameValidate tmp; 5288 TALLOC_CTX *out_mem_ctx; 5289 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5290}; 5291 5292static void rpccli_srvsvc_NetNameValidate_done(struct tevent_req *subreq); 5293 5294struct tevent_req *rpccli_srvsvc_NetNameValidate_send(TALLOC_CTX *mem_ctx, 5295 struct tevent_context *ev, 5296 struct rpc_pipe_client *cli, 5297 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 5298 const char *_name /* [in] [charset(UTF16)] */, 5299 uint32_t _name_type /* [in] */, 5300 uint32_t _flags /* [in] */) 5301{ 5302 struct tevent_req *req; 5303 struct rpccli_srvsvc_NetNameValidate_state *state; 5304 struct tevent_req *subreq; 5305 5306 req = tevent_req_create(mem_ctx, &state, 5307 struct rpccli_srvsvc_NetNameValidate_state); 5308 if (req == NULL) { 5309 return NULL; 5310 } 5311 state->out_mem_ctx = NULL; 5312 state->dispatch_recv = cli->dispatch_recv; 5313 5314 /* In parameters */ 5315 state->orig.in.server_unc = _server_unc; 5316 state->orig.in.name = _name; 5317 state->orig.in.name_type = _name_type; 5318 state->orig.in.flags = _flags; 5319 5320 /* Out parameters */ 5321 5322 /* Result */ 5323 ZERO_STRUCT(state->orig.out.result); 5324 5325 /* make a temporary copy, that we pass to the dispatch function */ 5326 state->tmp = state->orig; 5327 5328 subreq = cli->dispatch_send(state, ev, cli, 5329 &ndr_table_srvsvc, 5330 NDR_SRVSVC_NETNAMEVALIDATE, 5331 &state->tmp); 5332 if (tevent_req_nomem(subreq, req)) { 5333 return tevent_req_post(req, ev); 5334 } 5335 tevent_req_set_callback(subreq, rpccli_srvsvc_NetNameValidate_done, req); 5336 return req; 5337} 5338 5339static void rpccli_srvsvc_NetNameValidate_done(struct tevent_req *subreq) 5340{ 5341 struct tevent_req *req = tevent_req_callback_data( 5342 subreq, struct tevent_req); 5343 struct rpccli_srvsvc_NetNameValidate_state *state = tevent_req_data( 5344 req, struct rpccli_srvsvc_NetNameValidate_state); 5345 NTSTATUS status; 5346 TALLOC_CTX *mem_ctx; 5347 5348 if (state->out_mem_ctx) { 5349 mem_ctx = state->out_mem_ctx; 5350 } else { 5351 mem_ctx = state; 5352 } 5353 5354 status = state->dispatch_recv(subreq, mem_ctx); 5355 TALLOC_FREE(subreq); 5356 if (!NT_STATUS_IS_OK(status)) { 5357 tevent_req_nterror(req, status); 5358 return; 5359 } 5360 5361 /* Copy out parameters */ 5362 5363 /* Copy result */ 5364 state->orig.out.result = state->tmp.out.result; 5365 5366 /* Reset temporary structure */ 5367 ZERO_STRUCT(state->tmp); 5368 5369 tevent_req_done(req); 5370} 5371 5372NTSTATUS rpccli_srvsvc_NetNameValidate_recv(struct tevent_req *req, 5373 TALLOC_CTX *mem_ctx, 5374 WERROR *result) 5375{ 5376 struct rpccli_srvsvc_NetNameValidate_state *state = tevent_req_data( 5377 req, struct rpccli_srvsvc_NetNameValidate_state); 5378 NTSTATUS status; 5379 5380 if (tevent_req_is_nterror(req, &status)) { 5381 tevent_req_received(req); 5382 return status; 5383 } 5384 5385 /* Steal possbile out parameters to the callers context */ 5386 talloc_steal(mem_ctx, state->out_mem_ctx); 5387 5388 /* Return result */ 5389 *result = state->orig.out.result; 5390 5391 tevent_req_received(req); 5392 return NT_STATUS_OK; 5393} 5394 5395NTSTATUS rpccli_srvsvc_NetNameValidate(struct rpc_pipe_client *cli, 5396 TALLOC_CTX *mem_ctx, 5397 const char *server_unc /* [in] [unique,charset(UTF16)] */, 5398 const char *name /* [in] [charset(UTF16)] */, 5399 uint32_t name_type /* [in] */, 5400 uint32_t flags /* [in] */, 5401 WERROR *werror) 5402{ 5403 struct srvsvc_NetNameValidate r; 5404 NTSTATUS status; 5405 5406 /* In parameters */ 5407 r.in.server_unc = server_unc; 5408 r.in.name = name; 5409 r.in.name_type = name_type; 5410 r.in.flags = flags; 5411 5412 status = cli->dispatch(cli, 5413 mem_ctx, 5414 &ndr_table_srvsvc, 5415 NDR_SRVSVC_NETNAMEVALIDATE, 5416 &r); 5417 5418 if (!NT_STATUS_IS_OK(status)) { 5419 return status; 5420 } 5421 5422 if (NT_STATUS_IS_ERR(status)) { 5423 return status; 5424 } 5425 5426 /* Return variables */ 5427 5428 /* Return result */ 5429 if (werror) { 5430 *werror = r.out.result; 5431 } 5432 5433 return werror_to_ntstatus(r.out.result); 5434} 5435 5436struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state { 5437 struct srvsvc_NETRPRNAMECANONICALIZE orig; 5438 struct srvsvc_NETRPRNAMECANONICALIZE tmp; 5439 TALLOC_CTX *out_mem_ctx; 5440 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5441}; 5442 5443static void rpccli_srvsvc_NETRPRNAMECANONICALIZE_done(struct tevent_req *subreq); 5444 5445struct tevent_req *rpccli_srvsvc_NETRPRNAMECANONICALIZE_send(TALLOC_CTX *mem_ctx, 5446 struct tevent_context *ev, 5447 struct rpc_pipe_client *cli) 5448{ 5449 struct tevent_req *req; 5450 struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state; 5451 struct tevent_req *subreq; 5452 5453 req = tevent_req_create(mem_ctx, &state, 5454 struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state); 5455 if (req == NULL) { 5456 return NULL; 5457 } 5458 state->out_mem_ctx = NULL; 5459 state->dispatch_recv = cli->dispatch_recv; 5460 5461 /* In parameters */ 5462 5463 /* Out parameters */ 5464 5465 /* Result */ 5466 ZERO_STRUCT(state->orig.out.result); 5467 5468 /* make a temporary copy, that we pass to the dispatch function */ 5469 state->tmp = state->orig; 5470 5471 subreq = cli->dispatch_send(state, ev, cli, 5472 &ndr_table_srvsvc, 5473 NDR_SRVSVC_NETRPRNAMECANONICALIZE, 5474 &state->tmp); 5475 if (tevent_req_nomem(subreq, req)) { 5476 return tevent_req_post(req, ev); 5477 } 5478 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRPRNAMECANONICALIZE_done, req); 5479 return req; 5480} 5481 5482static void rpccli_srvsvc_NETRPRNAMECANONICALIZE_done(struct tevent_req *subreq) 5483{ 5484 struct tevent_req *req = tevent_req_callback_data( 5485 subreq, struct tevent_req); 5486 struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state = tevent_req_data( 5487 req, struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state); 5488 NTSTATUS status; 5489 TALLOC_CTX *mem_ctx; 5490 5491 if (state->out_mem_ctx) { 5492 mem_ctx = state->out_mem_ctx; 5493 } else { 5494 mem_ctx = state; 5495 } 5496 5497 status = state->dispatch_recv(subreq, mem_ctx); 5498 TALLOC_FREE(subreq); 5499 if (!NT_STATUS_IS_OK(status)) { 5500 tevent_req_nterror(req, status); 5501 return; 5502 } 5503 5504 /* Copy out parameters */ 5505 5506 /* Copy result */ 5507 state->orig.out.result = state->tmp.out.result; 5508 5509 /* Reset temporary structure */ 5510 ZERO_STRUCT(state->tmp); 5511 5512 tevent_req_done(req); 5513} 5514 5515NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE_recv(struct tevent_req *req, 5516 TALLOC_CTX *mem_ctx, 5517 WERROR *result) 5518{ 5519 struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state *state = tevent_req_data( 5520 req, struct rpccli_srvsvc_NETRPRNAMECANONICALIZE_state); 5521 NTSTATUS status; 5522 5523 if (tevent_req_is_nterror(req, &status)) { 5524 tevent_req_received(req); 5525 return status; 5526 } 5527 5528 /* Steal possbile out parameters to the callers context */ 5529 talloc_steal(mem_ctx, state->out_mem_ctx); 5530 5531 /* Return result */ 5532 *result = state->orig.out.result; 5533 5534 tevent_req_received(req); 5535 return NT_STATUS_OK; 5536} 5537 5538NTSTATUS rpccli_srvsvc_NETRPRNAMECANONICALIZE(struct rpc_pipe_client *cli, 5539 TALLOC_CTX *mem_ctx, 5540 WERROR *werror) 5541{ 5542 struct srvsvc_NETRPRNAMECANONICALIZE r; 5543 NTSTATUS status; 5544 5545 /* In parameters */ 5546 5547 status = cli->dispatch(cli, 5548 mem_ctx, 5549 &ndr_table_srvsvc, 5550 NDR_SRVSVC_NETRPRNAMECANONICALIZE, 5551 &r); 5552 5553 if (!NT_STATUS_IS_OK(status)) { 5554 return status; 5555 } 5556 5557 if (NT_STATUS_IS_ERR(status)) { 5558 return status; 5559 } 5560 5561 /* Return variables */ 5562 5563 /* Return result */ 5564 if (werror) { 5565 *werror = r.out.result; 5566 } 5567 5568 return werror_to_ntstatus(r.out.result); 5569} 5570 5571struct rpccli_srvsvc_NetPRNameCompare_state { 5572 struct srvsvc_NetPRNameCompare orig; 5573 struct srvsvc_NetPRNameCompare tmp; 5574 TALLOC_CTX *out_mem_ctx; 5575 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5576}; 5577 5578static void rpccli_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq); 5579 5580struct tevent_req *rpccli_srvsvc_NetPRNameCompare_send(TALLOC_CTX *mem_ctx, 5581 struct tevent_context *ev, 5582 struct rpc_pipe_client *cli, 5583 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 5584 const char *_name1 /* [in] [charset(UTF16)] */, 5585 const char *_name2 /* [in] [charset(UTF16)] */, 5586 uint32_t _name_type /* [in] */, 5587 uint32_t _flags /* [in] */) 5588{ 5589 struct tevent_req *req; 5590 struct rpccli_srvsvc_NetPRNameCompare_state *state; 5591 struct tevent_req *subreq; 5592 5593 req = tevent_req_create(mem_ctx, &state, 5594 struct rpccli_srvsvc_NetPRNameCompare_state); 5595 if (req == NULL) { 5596 return NULL; 5597 } 5598 state->out_mem_ctx = NULL; 5599 state->dispatch_recv = cli->dispatch_recv; 5600 5601 /* In parameters */ 5602 state->orig.in.server_unc = _server_unc; 5603 state->orig.in.name1 = _name1; 5604 state->orig.in.name2 = _name2; 5605 state->orig.in.name_type = _name_type; 5606 state->orig.in.flags = _flags; 5607 5608 /* Out parameters */ 5609 5610 /* Result */ 5611 ZERO_STRUCT(state->orig.out.result); 5612 5613 /* make a temporary copy, that we pass to the dispatch function */ 5614 state->tmp = state->orig; 5615 5616 subreq = cli->dispatch_send(state, ev, cli, 5617 &ndr_table_srvsvc, 5618 NDR_SRVSVC_NETPRNAMECOMPARE, 5619 &state->tmp); 5620 if (tevent_req_nomem(subreq, req)) { 5621 return tevent_req_post(req, ev); 5622 } 5623 tevent_req_set_callback(subreq, rpccli_srvsvc_NetPRNameCompare_done, req); 5624 return req; 5625} 5626 5627static void rpccli_srvsvc_NetPRNameCompare_done(struct tevent_req *subreq) 5628{ 5629 struct tevent_req *req = tevent_req_callback_data( 5630 subreq, struct tevent_req); 5631 struct rpccli_srvsvc_NetPRNameCompare_state *state = tevent_req_data( 5632 req, struct rpccli_srvsvc_NetPRNameCompare_state); 5633 NTSTATUS status; 5634 TALLOC_CTX *mem_ctx; 5635 5636 if (state->out_mem_ctx) { 5637 mem_ctx = state->out_mem_ctx; 5638 } else { 5639 mem_ctx = state; 5640 } 5641 5642 status = state->dispatch_recv(subreq, mem_ctx); 5643 TALLOC_FREE(subreq); 5644 if (!NT_STATUS_IS_OK(status)) { 5645 tevent_req_nterror(req, status); 5646 return; 5647 } 5648 5649 /* Copy out parameters */ 5650 5651 /* Copy result */ 5652 state->orig.out.result = state->tmp.out.result; 5653 5654 /* Reset temporary structure */ 5655 ZERO_STRUCT(state->tmp); 5656 5657 tevent_req_done(req); 5658} 5659 5660NTSTATUS rpccli_srvsvc_NetPRNameCompare_recv(struct tevent_req *req, 5661 TALLOC_CTX *mem_ctx, 5662 WERROR *result) 5663{ 5664 struct rpccli_srvsvc_NetPRNameCompare_state *state = tevent_req_data( 5665 req, struct rpccli_srvsvc_NetPRNameCompare_state); 5666 NTSTATUS status; 5667 5668 if (tevent_req_is_nterror(req, &status)) { 5669 tevent_req_received(req); 5670 return status; 5671 } 5672 5673 /* Steal possbile out parameters to the callers context */ 5674 talloc_steal(mem_ctx, state->out_mem_ctx); 5675 5676 /* Return result */ 5677 *result = state->orig.out.result; 5678 5679 tevent_req_received(req); 5680 return NT_STATUS_OK; 5681} 5682 5683NTSTATUS rpccli_srvsvc_NetPRNameCompare(struct rpc_pipe_client *cli, 5684 TALLOC_CTX *mem_ctx, 5685 const char *server_unc /* [in] [unique,charset(UTF16)] */, 5686 const char *name1 /* [in] [charset(UTF16)] */, 5687 const char *name2 /* [in] [charset(UTF16)] */, 5688 uint32_t name_type /* [in] */, 5689 uint32_t flags /* [in] */, 5690 WERROR *werror) 5691{ 5692 struct srvsvc_NetPRNameCompare r; 5693 NTSTATUS status; 5694 5695 /* In parameters */ 5696 r.in.server_unc = server_unc; 5697 r.in.name1 = name1; 5698 r.in.name2 = name2; 5699 r.in.name_type = name_type; 5700 r.in.flags = flags; 5701 5702 status = cli->dispatch(cli, 5703 mem_ctx, 5704 &ndr_table_srvsvc, 5705 NDR_SRVSVC_NETPRNAMECOMPARE, 5706 &r); 5707 5708 if (!NT_STATUS_IS_OK(status)) { 5709 return status; 5710 } 5711 5712 if (NT_STATUS_IS_ERR(status)) { 5713 return status; 5714 } 5715 5716 /* Return variables */ 5717 5718 /* Return result */ 5719 if (werror) { 5720 *werror = r.out.result; 5721 } 5722 5723 return werror_to_ntstatus(r.out.result); 5724} 5725 5726struct rpccli_srvsvc_NetShareEnum_state { 5727 struct srvsvc_NetShareEnum orig; 5728 struct srvsvc_NetShareEnum tmp; 5729 TALLOC_CTX *out_mem_ctx; 5730 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5731}; 5732 5733static void rpccli_srvsvc_NetShareEnum_done(struct tevent_req *subreq); 5734 5735struct tevent_req *rpccli_srvsvc_NetShareEnum_send(TALLOC_CTX *mem_ctx, 5736 struct tevent_context *ev, 5737 struct rpc_pipe_client *cli, 5738 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 5739 struct srvsvc_NetShareInfoCtr *_info_ctr /* [in,out] [ref] */, 5740 uint32_t _max_buffer /* [in] */, 5741 uint32_t *_totalentries /* [out] [ref] */, 5742 uint32_t *_resume_handle /* [in,out] [unique] */) 5743{ 5744 struct tevent_req *req; 5745 struct rpccli_srvsvc_NetShareEnum_state *state; 5746 struct tevent_req *subreq; 5747 5748 req = tevent_req_create(mem_ctx, &state, 5749 struct rpccli_srvsvc_NetShareEnum_state); 5750 if (req == NULL) { 5751 return NULL; 5752 } 5753 state->out_mem_ctx = NULL; 5754 state->dispatch_recv = cli->dispatch_recv; 5755 5756 /* In parameters */ 5757 state->orig.in.server_unc = _server_unc; 5758 state->orig.in.info_ctr = _info_ctr; 5759 state->orig.in.max_buffer = _max_buffer; 5760 state->orig.in.resume_handle = _resume_handle; 5761 5762 /* Out parameters */ 5763 state->orig.out.info_ctr = _info_ctr; 5764 state->orig.out.totalentries = _totalentries; 5765 state->orig.out.resume_handle = _resume_handle; 5766 5767 /* Result */ 5768 ZERO_STRUCT(state->orig.out.result); 5769 5770 state->out_mem_ctx = talloc_named_const(state, 0, 5771 "rpccli_srvsvc_NetShareEnum_out_memory"); 5772 if (tevent_req_nomem(state->out_mem_ctx, req)) { 5773 return tevent_req_post(req, ev); 5774 } 5775 5776 /* make a temporary copy, that we pass to the dispatch function */ 5777 state->tmp = state->orig; 5778 5779 subreq = cli->dispatch_send(state, ev, cli, 5780 &ndr_table_srvsvc, 5781 NDR_SRVSVC_NETSHAREENUM, 5782 &state->tmp); 5783 if (tevent_req_nomem(subreq, req)) { 5784 return tevent_req_post(req, ev); 5785 } 5786 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareEnum_done, req); 5787 return req; 5788} 5789 5790static void rpccli_srvsvc_NetShareEnum_done(struct tevent_req *subreq) 5791{ 5792 struct tevent_req *req = tevent_req_callback_data( 5793 subreq, struct tevent_req); 5794 struct rpccli_srvsvc_NetShareEnum_state *state = tevent_req_data( 5795 req, struct rpccli_srvsvc_NetShareEnum_state); 5796 NTSTATUS status; 5797 TALLOC_CTX *mem_ctx; 5798 5799 if (state->out_mem_ctx) { 5800 mem_ctx = state->out_mem_ctx; 5801 } else { 5802 mem_ctx = state; 5803 } 5804 5805 status = state->dispatch_recv(subreq, mem_ctx); 5806 TALLOC_FREE(subreq); 5807 if (!NT_STATUS_IS_OK(status)) { 5808 tevent_req_nterror(req, status); 5809 return; 5810 } 5811 5812 /* Copy out parameters */ 5813 *state->orig.out.info_ctr = *state->tmp.out.info_ctr; 5814 *state->orig.out.totalentries = *state->tmp.out.totalentries; 5815 if (state->orig.out.resume_handle && state->tmp.out.resume_handle) { 5816 *state->orig.out.resume_handle = *state->tmp.out.resume_handle; 5817 } 5818 5819 /* Copy result */ 5820 state->orig.out.result = state->tmp.out.result; 5821 5822 /* Reset temporary structure */ 5823 ZERO_STRUCT(state->tmp); 5824 5825 tevent_req_done(req); 5826} 5827 5828NTSTATUS rpccli_srvsvc_NetShareEnum_recv(struct tevent_req *req, 5829 TALLOC_CTX *mem_ctx, 5830 WERROR *result) 5831{ 5832 struct rpccli_srvsvc_NetShareEnum_state *state = tevent_req_data( 5833 req, struct rpccli_srvsvc_NetShareEnum_state); 5834 NTSTATUS status; 5835 5836 if (tevent_req_is_nterror(req, &status)) { 5837 tevent_req_received(req); 5838 return status; 5839 } 5840 5841 /* Steal possbile out parameters to the callers context */ 5842 talloc_steal(mem_ctx, state->out_mem_ctx); 5843 5844 /* Return result */ 5845 *result = state->orig.out.result; 5846 5847 tevent_req_received(req); 5848 return NT_STATUS_OK; 5849} 5850 5851NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, 5852 TALLOC_CTX *mem_ctx, 5853 const char *server_unc /* [in] [unique,charset(UTF16)] */, 5854 struct srvsvc_NetShareInfoCtr *info_ctr /* [in,out] [ref] */, 5855 uint32_t max_buffer /* [in] */, 5856 uint32_t *totalentries /* [out] [ref] */, 5857 uint32_t *resume_handle /* [in,out] [unique] */, 5858 WERROR *werror) 5859{ 5860 struct srvsvc_NetShareEnum r; 5861 NTSTATUS status; 5862 5863 /* In parameters */ 5864 r.in.server_unc = server_unc; 5865 r.in.info_ctr = info_ctr; 5866 r.in.max_buffer = max_buffer; 5867 r.in.resume_handle = resume_handle; 5868 5869 status = cli->dispatch(cli, 5870 mem_ctx, 5871 &ndr_table_srvsvc, 5872 NDR_SRVSVC_NETSHAREENUM, 5873 &r); 5874 5875 if (!NT_STATUS_IS_OK(status)) { 5876 return status; 5877 } 5878 5879 if (NT_STATUS_IS_ERR(status)) { 5880 return status; 5881 } 5882 5883 /* Return variables */ 5884 *info_ctr = *r.out.info_ctr; 5885 *totalentries = *r.out.totalentries; 5886 if (resume_handle && r.out.resume_handle) { 5887 *resume_handle = *r.out.resume_handle; 5888 } 5889 5890 /* Return result */ 5891 if (werror) { 5892 *werror = r.out.result; 5893 } 5894 5895 return werror_to_ntstatus(r.out.result); 5896} 5897 5898struct rpccli_srvsvc_NetShareDelStart_state { 5899 struct srvsvc_NetShareDelStart orig; 5900 struct srvsvc_NetShareDelStart tmp; 5901 TALLOC_CTX *out_mem_ctx; 5902 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 5903}; 5904 5905static void rpccli_srvsvc_NetShareDelStart_done(struct tevent_req *subreq); 5906 5907struct tevent_req *rpccli_srvsvc_NetShareDelStart_send(TALLOC_CTX *mem_ctx, 5908 struct tevent_context *ev, 5909 struct rpc_pipe_client *cli, 5910 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 5911 const char *_share /* [in] [charset(UTF16)] */, 5912 uint32_t _reserved /* [in] */, 5913 struct policy_handle *_hnd /* [out] [unique] */) 5914{ 5915 struct tevent_req *req; 5916 struct rpccli_srvsvc_NetShareDelStart_state *state; 5917 struct tevent_req *subreq; 5918 5919 req = tevent_req_create(mem_ctx, &state, 5920 struct rpccli_srvsvc_NetShareDelStart_state); 5921 if (req == NULL) { 5922 return NULL; 5923 } 5924 state->out_mem_ctx = NULL; 5925 state->dispatch_recv = cli->dispatch_recv; 5926 5927 /* In parameters */ 5928 state->orig.in.server_unc = _server_unc; 5929 state->orig.in.share = _share; 5930 state->orig.in.reserved = _reserved; 5931 5932 /* Out parameters */ 5933 state->orig.out.hnd = _hnd; 5934 5935 /* Result */ 5936 ZERO_STRUCT(state->orig.out.result); 5937 5938 state->out_mem_ctx = talloc_named_const(state, 0, 5939 "rpccli_srvsvc_NetShareDelStart_out_memory"); 5940 if (tevent_req_nomem(state->out_mem_ctx, req)) { 5941 return tevent_req_post(req, ev); 5942 } 5943 5944 /* make a temporary copy, that we pass to the dispatch function */ 5945 state->tmp = state->orig; 5946 5947 subreq = cli->dispatch_send(state, ev, cli, 5948 &ndr_table_srvsvc, 5949 NDR_SRVSVC_NETSHAREDELSTART, 5950 &state->tmp); 5951 if (tevent_req_nomem(subreq, req)) { 5952 return tevent_req_post(req, ev); 5953 } 5954 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelStart_done, req); 5955 return req; 5956} 5957 5958static void rpccli_srvsvc_NetShareDelStart_done(struct tevent_req *subreq) 5959{ 5960 struct tevent_req *req = tevent_req_callback_data( 5961 subreq, struct tevent_req); 5962 struct rpccli_srvsvc_NetShareDelStart_state *state = tevent_req_data( 5963 req, struct rpccli_srvsvc_NetShareDelStart_state); 5964 NTSTATUS status; 5965 TALLOC_CTX *mem_ctx; 5966 5967 if (state->out_mem_ctx) { 5968 mem_ctx = state->out_mem_ctx; 5969 } else { 5970 mem_ctx = state; 5971 } 5972 5973 status = state->dispatch_recv(subreq, mem_ctx); 5974 TALLOC_FREE(subreq); 5975 if (!NT_STATUS_IS_OK(status)) { 5976 tevent_req_nterror(req, status); 5977 return; 5978 } 5979 5980 /* Copy out parameters */ 5981 if (state->orig.out.hnd && state->tmp.out.hnd) { 5982 *state->orig.out.hnd = *state->tmp.out.hnd; 5983 } 5984 5985 /* Copy result */ 5986 state->orig.out.result = state->tmp.out.result; 5987 5988 /* Reset temporary structure */ 5989 ZERO_STRUCT(state->tmp); 5990 5991 tevent_req_done(req); 5992} 5993 5994NTSTATUS rpccli_srvsvc_NetShareDelStart_recv(struct tevent_req *req, 5995 TALLOC_CTX *mem_ctx, 5996 WERROR *result) 5997{ 5998 struct rpccli_srvsvc_NetShareDelStart_state *state = tevent_req_data( 5999 req, struct rpccli_srvsvc_NetShareDelStart_state); 6000 NTSTATUS status; 6001 6002 if (tevent_req_is_nterror(req, &status)) { 6003 tevent_req_received(req); 6004 return status; 6005 } 6006 6007 /* Steal possbile out parameters to the callers context */ 6008 talloc_steal(mem_ctx, state->out_mem_ctx); 6009 6010 /* Return result */ 6011 *result = state->orig.out.result; 6012 6013 tevent_req_received(req); 6014 return NT_STATUS_OK; 6015} 6016 6017NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, 6018 TALLOC_CTX *mem_ctx, 6019 const char *server_unc /* [in] [unique,charset(UTF16)] */, 6020 const char *share /* [in] [charset(UTF16)] */, 6021 uint32_t reserved /* [in] */, 6022 struct policy_handle *hnd /* [out] [unique] */, 6023 WERROR *werror) 6024{ 6025 struct srvsvc_NetShareDelStart r; 6026 NTSTATUS status; 6027 6028 /* In parameters */ 6029 r.in.server_unc = server_unc; 6030 r.in.share = share; 6031 r.in.reserved = reserved; 6032 6033 status = cli->dispatch(cli, 6034 mem_ctx, 6035 &ndr_table_srvsvc, 6036 NDR_SRVSVC_NETSHAREDELSTART, 6037 &r); 6038 6039 if (!NT_STATUS_IS_OK(status)) { 6040 return status; 6041 } 6042 6043 if (NT_STATUS_IS_ERR(status)) { 6044 return status; 6045 } 6046 6047 /* Return variables */ 6048 if (hnd && r.out.hnd) { 6049 *hnd = *r.out.hnd; 6050 } 6051 6052 /* Return result */ 6053 if (werror) { 6054 *werror = r.out.result; 6055 } 6056 6057 return werror_to_ntstatus(r.out.result); 6058} 6059 6060struct rpccli_srvsvc_NetShareDelCommit_state { 6061 struct srvsvc_NetShareDelCommit orig; 6062 struct srvsvc_NetShareDelCommit tmp; 6063 TALLOC_CTX *out_mem_ctx; 6064 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6065}; 6066 6067static void rpccli_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq); 6068 6069struct tevent_req *rpccli_srvsvc_NetShareDelCommit_send(TALLOC_CTX *mem_ctx, 6070 struct tevent_context *ev, 6071 struct rpc_pipe_client *cli, 6072 struct policy_handle *_hnd /* [in,out] [unique] */) 6073{ 6074 struct tevent_req *req; 6075 struct rpccli_srvsvc_NetShareDelCommit_state *state; 6076 struct tevent_req *subreq; 6077 6078 req = tevent_req_create(mem_ctx, &state, 6079 struct rpccli_srvsvc_NetShareDelCommit_state); 6080 if (req == NULL) { 6081 return NULL; 6082 } 6083 state->out_mem_ctx = NULL; 6084 state->dispatch_recv = cli->dispatch_recv; 6085 6086 /* In parameters */ 6087 state->orig.in.hnd = _hnd; 6088 6089 /* Out parameters */ 6090 state->orig.out.hnd = _hnd; 6091 6092 /* Result */ 6093 ZERO_STRUCT(state->orig.out.result); 6094 6095 state->out_mem_ctx = talloc_named_const(state, 0, 6096 "rpccli_srvsvc_NetShareDelCommit_out_memory"); 6097 if (tevent_req_nomem(state->out_mem_ctx, req)) { 6098 return tevent_req_post(req, ev); 6099 } 6100 6101 /* make a temporary copy, that we pass to the dispatch function */ 6102 state->tmp = state->orig; 6103 6104 subreq = cli->dispatch_send(state, ev, cli, 6105 &ndr_table_srvsvc, 6106 NDR_SRVSVC_NETSHAREDELCOMMIT, 6107 &state->tmp); 6108 if (tevent_req_nomem(subreq, req)) { 6109 return tevent_req_post(req, ev); 6110 } 6111 tevent_req_set_callback(subreq, rpccli_srvsvc_NetShareDelCommit_done, req); 6112 return req; 6113} 6114 6115static void rpccli_srvsvc_NetShareDelCommit_done(struct tevent_req *subreq) 6116{ 6117 struct tevent_req *req = tevent_req_callback_data( 6118 subreq, struct tevent_req); 6119 struct rpccli_srvsvc_NetShareDelCommit_state *state = tevent_req_data( 6120 req, struct rpccli_srvsvc_NetShareDelCommit_state); 6121 NTSTATUS status; 6122 TALLOC_CTX *mem_ctx; 6123 6124 if (state->out_mem_ctx) { 6125 mem_ctx = state->out_mem_ctx; 6126 } else { 6127 mem_ctx = state; 6128 } 6129 6130 status = state->dispatch_recv(subreq, mem_ctx); 6131 TALLOC_FREE(subreq); 6132 if (!NT_STATUS_IS_OK(status)) { 6133 tevent_req_nterror(req, status); 6134 return; 6135 } 6136 6137 /* Copy out parameters */ 6138 if (state->orig.out.hnd && state->tmp.out.hnd) { 6139 *state->orig.out.hnd = *state->tmp.out.hnd; 6140 } 6141 6142 /* Copy result */ 6143 state->orig.out.result = state->tmp.out.result; 6144 6145 /* Reset temporary structure */ 6146 ZERO_STRUCT(state->tmp); 6147 6148 tevent_req_done(req); 6149} 6150 6151NTSTATUS rpccli_srvsvc_NetShareDelCommit_recv(struct tevent_req *req, 6152 TALLOC_CTX *mem_ctx, 6153 WERROR *result) 6154{ 6155 struct rpccli_srvsvc_NetShareDelCommit_state *state = tevent_req_data( 6156 req, struct rpccli_srvsvc_NetShareDelCommit_state); 6157 NTSTATUS status; 6158 6159 if (tevent_req_is_nterror(req, &status)) { 6160 tevent_req_received(req); 6161 return status; 6162 } 6163 6164 /* Steal possbile out parameters to the callers context */ 6165 talloc_steal(mem_ctx, state->out_mem_ctx); 6166 6167 /* Return result */ 6168 *result = state->orig.out.result; 6169 6170 tevent_req_received(req); 6171 return NT_STATUS_OK; 6172} 6173 6174NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, 6175 TALLOC_CTX *mem_ctx, 6176 struct policy_handle *hnd /* [in,out] [unique] */, 6177 WERROR *werror) 6178{ 6179 struct srvsvc_NetShareDelCommit r; 6180 NTSTATUS status; 6181 6182 /* In parameters */ 6183 r.in.hnd = hnd; 6184 6185 status = cli->dispatch(cli, 6186 mem_ctx, 6187 &ndr_table_srvsvc, 6188 NDR_SRVSVC_NETSHAREDELCOMMIT, 6189 &r); 6190 6191 if (!NT_STATUS_IS_OK(status)) { 6192 return status; 6193 } 6194 6195 if (NT_STATUS_IS_ERR(status)) { 6196 return status; 6197 } 6198 6199 /* Return variables */ 6200 if (hnd && r.out.hnd) { 6201 *hnd = *r.out.hnd; 6202 } 6203 6204 /* Return result */ 6205 if (werror) { 6206 *werror = r.out.result; 6207 } 6208 6209 return werror_to_ntstatus(r.out.result); 6210} 6211 6212struct rpccli_srvsvc_NetGetFileSecurity_state { 6213 struct srvsvc_NetGetFileSecurity orig; 6214 struct srvsvc_NetGetFileSecurity tmp; 6215 TALLOC_CTX *out_mem_ctx; 6216 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6217}; 6218 6219static void rpccli_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq); 6220 6221struct tevent_req *rpccli_srvsvc_NetGetFileSecurity_send(TALLOC_CTX *mem_ctx, 6222 struct tevent_context *ev, 6223 struct rpc_pipe_client *cli, 6224 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 6225 const char *_share /* [in] [unique,charset(UTF16)] */, 6226 const char *_file /* [in] [charset(UTF16)] */, 6227 uint32_t _securityinformation /* [in] */, 6228 struct sec_desc_buf **_sd_buf /* [out] [ref] */) 6229{ 6230 struct tevent_req *req; 6231 struct rpccli_srvsvc_NetGetFileSecurity_state *state; 6232 struct tevent_req *subreq; 6233 6234 req = tevent_req_create(mem_ctx, &state, 6235 struct rpccli_srvsvc_NetGetFileSecurity_state); 6236 if (req == NULL) { 6237 return NULL; 6238 } 6239 state->out_mem_ctx = NULL; 6240 state->dispatch_recv = cli->dispatch_recv; 6241 6242 /* In parameters */ 6243 state->orig.in.server_unc = _server_unc; 6244 state->orig.in.share = _share; 6245 state->orig.in.file = _file; 6246 state->orig.in.securityinformation = _securityinformation; 6247 6248 /* Out parameters */ 6249 state->orig.out.sd_buf = _sd_buf; 6250 6251 /* Result */ 6252 ZERO_STRUCT(state->orig.out.result); 6253 6254 state->out_mem_ctx = talloc_named_const(state, 0, 6255 "rpccli_srvsvc_NetGetFileSecurity_out_memory"); 6256 if (tevent_req_nomem(state->out_mem_ctx, req)) { 6257 return tevent_req_post(req, ev); 6258 } 6259 6260 /* make a temporary copy, that we pass to the dispatch function */ 6261 state->tmp = state->orig; 6262 6263 subreq = cli->dispatch_send(state, ev, cli, 6264 &ndr_table_srvsvc, 6265 NDR_SRVSVC_NETGETFILESECURITY, 6266 &state->tmp); 6267 if (tevent_req_nomem(subreq, req)) { 6268 return tevent_req_post(req, ev); 6269 } 6270 tevent_req_set_callback(subreq, rpccli_srvsvc_NetGetFileSecurity_done, req); 6271 return req; 6272} 6273 6274static void rpccli_srvsvc_NetGetFileSecurity_done(struct tevent_req *subreq) 6275{ 6276 struct tevent_req *req = tevent_req_callback_data( 6277 subreq, struct tevent_req); 6278 struct rpccli_srvsvc_NetGetFileSecurity_state *state = tevent_req_data( 6279 req, struct rpccli_srvsvc_NetGetFileSecurity_state); 6280 NTSTATUS status; 6281 TALLOC_CTX *mem_ctx; 6282 6283 if (state->out_mem_ctx) { 6284 mem_ctx = state->out_mem_ctx; 6285 } else { 6286 mem_ctx = state; 6287 } 6288 6289 status = state->dispatch_recv(subreq, mem_ctx); 6290 TALLOC_FREE(subreq); 6291 if (!NT_STATUS_IS_OK(status)) { 6292 tevent_req_nterror(req, status); 6293 return; 6294 } 6295 6296 /* Copy out parameters */ 6297 *state->orig.out.sd_buf = *state->tmp.out.sd_buf; 6298 6299 /* Copy result */ 6300 state->orig.out.result = state->tmp.out.result; 6301 6302 /* Reset temporary structure */ 6303 ZERO_STRUCT(state->tmp); 6304 6305 tevent_req_done(req); 6306} 6307 6308NTSTATUS rpccli_srvsvc_NetGetFileSecurity_recv(struct tevent_req *req, 6309 TALLOC_CTX *mem_ctx, 6310 WERROR *result) 6311{ 6312 struct rpccli_srvsvc_NetGetFileSecurity_state *state = tevent_req_data( 6313 req, struct rpccli_srvsvc_NetGetFileSecurity_state); 6314 NTSTATUS status; 6315 6316 if (tevent_req_is_nterror(req, &status)) { 6317 tevent_req_received(req); 6318 return status; 6319 } 6320 6321 /* Steal possbile out parameters to the callers context */ 6322 talloc_steal(mem_ctx, state->out_mem_ctx); 6323 6324 /* Return result */ 6325 *result = state->orig.out.result; 6326 6327 tevent_req_received(req); 6328 return NT_STATUS_OK; 6329} 6330 6331NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, 6332 TALLOC_CTX *mem_ctx, 6333 const char *server_unc /* [in] [unique,charset(UTF16)] */, 6334 const char *share /* [in] [unique,charset(UTF16)] */, 6335 const char *file /* [in] [charset(UTF16)] */, 6336 uint32_t securityinformation /* [in] */, 6337 struct sec_desc_buf **sd_buf /* [out] [ref] */, 6338 WERROR *werror) 6339{ 6340 struct srvsvc_NetGetFileSecurity r; 6341 NTSTATUS status; 6342 6343 /* In parameters */ 6344 r.in.server_unc = server_unc; 6345 r.in.share = share; 6346 r.in.file = file; 6347 r.in.securityinformation = securityinformation; 6348 6349 status = cli->dispatch(cli, 6350 mem_ctx, 6351 &ndr_table_srvsvc, 6352 NDR_SRVSVC_NETGETFILESECURITY, 6353 &r); 6354 6355 if (!NT_STATUS_IS_OK(status)) { 6356 return status; 6357 } 6358 6359 if (NT_STATUS_IS_ERR(status)) { 6360 return status; 6361 } 6362 6363 /* Return variables */ 6364 *sd_buf = *r.out.sd_buf; 6365 6366 /* Return result */ 6367 if (werror) { 6368 *werror = r.out.result; 6369 } 6370 6371 return werror_to_ntstatus(r.out.result); 6372} 6373 6374struct rpccli_srvsvc_NetSetFileSecurity_state { 6375 struct srvsvc_NetSetFileSecurity orig; 6376 struct srvsvc_NetSetFileSecurity tmp; 6377 TALLOC_CTX *out_mem_ctx; 6378 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6379}; 6380 6381static void rpccli_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq); 6382 6383struct tevent_req *rpccli_srvsvc_NetSetFileSecurity_send(TALLOC_CTX *mem_ctx, 6384 struct tevent_context *ev, 6385 struct rpc_pipe_client *cli, 6386 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 6387 const char *_share /* [in] [unique,charset(UTF16)] */, 6388 const char *_file /* [in] [charset(UTF16)] */, 6389 uint32_t _securityinformation /* [in] */, 6390 struct sec_desc_buf *_sd_buf /* [in] [ref] */) 6391{ 6392 struct tevent_req *req; 6393 struct rpccli_srvsvc_NetSetFileSecurity_state *state; 6394 struct tevent_req *subreq; 6395 6396 req = tevent_req_create(mem_ctx, &state, 6397 struct rpccli_srvsvc_NetSetFileSecurity_state); 6398 if (req == NULL) { 6399 return NULL; 6400 } 6401 state->out_mem_ctx = NULL; 6402 state->dispatch_recv = cli->dispatch_recv; 6403 6404 /* In parameters */ 6405 state->orig.in.server_unc = _server_unc; 6406 state->orig.in.share = _share; 6407 state->orig.in.file = _file; 6408 state->orig.in.securityinformation = _securityinformation; 6409 state->orig.in.sd_buf = _sd_buf; 6410 6411 /* Out parameters */ 6412 6413 /* Result */ 6414 ZERO_STRUCT(state->orig.out.result); 6415 6416 /* make a temporary copy, that we pass to the dispatch function */ 6417 state->tmp = state->orig; 6418 6419 subreq = cli->dispatch_send(state, ev, cli, 6420 &ndr_table_srvsvc, 6421 NDR_SRVSVC_NETSETFILESECURITY, 6422 &state->tmp); 6423 if (tevent_req_nomem(subreq, req)) { 6424 return tevent_req_post(req, ev); 6425 } 6426 tevent_req_set_callback(subreq, rpccli_srvsvc_NetSetFileSecurity_done, req); 6427 return req; 6428} 6429 6430static void rpccli_srvsvc_NetSetFileSecurity_done(struct tevent_req *subreq) 6431{ 6432 struct tevent_req *req = tevent_req_callback_data( 6433 subreq, struct tevent_req); 6434 struct rpccli_srvsvc_NetSetFileSecurity_state *state = tevent_req_data( 6435 req, struct rpccli_srvsvc_NetSetFileSecurity_state); 6436 NTSTATUS status; 6437 TALLOC_CTX *mem_ctx; 6438 6439 if (state->out_mem_ctx) { 6440 mem_ctx = state->out_mem_ctx; 6441 } else { 6442 mem_ctx = state; 6443 } 6444 6445 status = state->dispatch_recv(subreq, mem_ctx); 6446 TALLOC_FREE(subreq); 6447 if (!NT_STATUS_IS_OK(status)) { 6448 tevent_req_nterror(req, status); 6449 return; 6450 } 6451 6452 /* Copy out parameters */ 6453 6454 /* Copy result */ 6455 state->orig.out.result = state->tmp.out.result; 6456 6457 /* Reset temporary structure */ 6458 ZERO_STRUCT(state->tmp); 6459 6460 tevent_req_done(req); 6461} 6462 6463NTSTATUS rpccli_srvsvc_NetSetFileSecurity_recv(struct tevent_req *req, 6464 TALLOC_CTX *mem_ctx, 6465 WERROR *result) 6466{ 6467 struct rpccli_srvsvc_NetSetFileSecurity_state *state = tevent_req_data( 6468 req, struct rpccli_srvsvc_NetSetFileSecurity_state); 6469 NTSTATUS status; 6470 6471 if (tevent_req_is_nterror(req, &status)) { 6472 tevent_req_received(req); 6473 return status; 6474 } 6475 6476 /* Steal possbile out parameters to the callers context */ 6477 talloc_steal(mem_ctx, state->out_mem_ctx); 6478 6479 /* Return result */ 6480 *result = state->orig.out.result; 6481 6482 tevent_req_received(req); 6483 return NT_STATUS_OK; 6484} 6485 6486NTSTATUS rpccli_srvsvc_NetSetFileSecurity(struct rpc_pipe_client *cli, 6487 TALLOC_CTX *mem_ctx, 6488 const char *server_unc /* [in] [unique,charset(UTF16)] */, 6489 const char *share /* [in] [unique,charset(UTF16)] */, 6490 const char *file /* [in] [charset(UTF16)] */, 6491 uint32_t securityinformation /* [in] */, 6492 struct sec_desc_buf *sd_buf /* [in] [ref] */, 6493 WERROR *werror) 6494{ 6495 struct srvsvc_NetSetFileSecurity r; 6496 NTSTATUS status; 6497 6498 /* In parameters */ 6499 r.in.server_unc = server_unc; 6500 r.in.share = share; 6501 r.in.file = file; 6502 r.in.securityinformation = securityinformation; 6503 r.in.sd_buf = sd_buf; 6504 6505 status = cli->dispatch(cli, 6506 mem_ctx, 6507 &ndr_table_srvsvc, 6508 NDR_SRVSVC_NETSETFILESECURITY, 6509 &r); 6510 6511 if (!NT_STATUS_IS_OK(status)) { 6512 return status; 6513 } 6514 6515 if (NT_STATUS_IS_ERR(status)) { 6516 return status; 6517 } 6518 6519 /* Return variables */ 6520 6521 /* Return result */ 6522 if (werror) { 6523 *werror = r.out.result; 6524 } 6525 6526 return werror_to_ntstatus(r.out.result); 6527} 6528 6529struct rpccli_srvsvc_NetServerTransportAddEx_state { 6530 struct srvsvc_NetServerTransportAddEx orig; 6531 struct srvsvc_NetServerTransportAddEx tmp; 6532 TALLOC_CTX *out_mem_ctx; 6533 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6534}; 6535 6536static void rpccli_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq); 6537 6538struct tevent_req *rpccli_srvsvc_NetServerTransportAddEx_send(TALLOC_CTX *mem_ctx, 6539 struct tevent_context *ev, 6540 struct rpc_pipe_client *cli, 6541 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 6542 uint32_t _level /* [in] */, 6543 union srvsvc_NetTransportInfo _info /* [in] [switch_is(level)] */) 6544{ 6545 struct tevent_req *req; 6546 struct rpccli_srvsvc_NetServerTransportAddEx_state *state; 6547 struct tevent_req *subreq; 6548 6549 req = tevent_req_create(mem_ctx, &state, 6550 struct rpccli_srvsvc_NetServerTransportAddEx_state); 6551 if (req == NULL) { 6552 return NULL; 6553 } 6554 state->out_mem_ctx = NULL; 6555 state->dispatch_recv = cli->dispatch_recv; 6556 6557 /* In parameters */ 6558 state->orig.in.server_unc = _server_unc; 6559 state->orig.in.level = _level; 6560 state->orig.in.info = _info; 6561 6562 /* Out parameters */ 6563 6564 /* Result */ 6565 ZERO_STRUCT(state->orig.out.result); 6566 6567 /* make a temporary copy, that we pass to the dispatch function */ 6568 state->tmp = state->orig; 6569 6570 subreq = cli->dispatch_send(state, ev, cli, 6571 &ndr_table_srvsvc, 6572 NDR_SRVSVC_NETSERVERTRANSPORTADDEX, 6573 &state->tmp); 6574 if (tevent_req_nomem(subreq, req)) { 6575 return tevent_req_post(req, ev); 6576 } 6577 tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerTransportAddEx_done, req); 6578 return req; 6579} 6580 6581static void rpccli_srvsvc_NetServerTransportAddEx_done(struct tevent_req *subreq) 6582{ 6583 struct tevent_req *req = tevent_req_callback_data( 6584 subreq, struct tevent_req); 6585 struct rpccli_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data( 6586 req, struct rpccli_srvsvc_NetServerTransportAddEx_state); 6587 NTSTATUS status; 6588 TALLOC_CTX *mem_ctx; 6589 6590 if (state->out_mem_ctx) { 6591 mem_ctx = state->out_mem_ctx; 6592 } else { 6593 mem_ctx = state; 6594 } 6595 6596 status = state->dispatch_recv(subreq, mem_ctx); 6597 TALLOC_FREE(subreq); 6598 if (!NT_STATUS_IS_OK(status)) { 6599 tevent_req_nterror(req, status); 6600 return; 6601 } 6602 6603 /* Copy out parameters */ 6604 6605 /* Copy result */ 6606 state->orig.out.result = state->tmp.out.result; 6607 6608 /* Reset temporary structure */ 6609 ZERO_STRUCT(state->tmp); 6610 6611 tevent_req_done(req); 6612} 6613 6614NTSTATUS rpccli_srvsvc_NetServerTransportAddEx_recv(struct tevent_req *req, 6615 TALLOC_CTX *mem_ctx, 6616 WERROR *result) 6617{ 6618 struct rpccli_srvsvc_NetServerTransportAddEx_state *state = tevent_req_data( 6619 req, struct rpccli_srvsvc_NetServerTransportAddEx_state); 6620 NTSTATUS status; 6621 6622 if (tevent_req_is_nterror(req, &status)) { 6623 tevent_req_received(req); 6624 return status; 6625 } 6626 6627 /* Steal possbile out parameters to the callers context */ 6628 talloc_steal(mem_ctx, state->out_mem_ctx); 6629 6630 /* Return result */ 6631 *result = state->orig.out.result; 6632 6633 tevent_req_received(req); 6634 return NT_STATUS_OK; 6635} 6636 6637NTSTATUS rpccli_srvsvc_NetServerTransportAddEx(struct rpc_pipe_client *cli, 6638 TALLOC_CTX *mem_ctx, 6639 const char *server_unc /* [in] [unique,charset(UTF16)] */, 6640 uint32_t level /* [in] */, 6641 union srvsvc_NetTransportInfo info /* [in] [switch_is(level)] */, 6642 WERROR *werror) 6643{ 6644 struct srvsvc_NetServerTransportAddEx r; 6645 NTSTATUS status; 6646 6647 /* In parameters */ 6648 r.in.server_unc = server_unc; 6649 r.in.level = level; 6650 r.in.info = info; 6651 6652 status = cli->dispatch(cli, 6653 mem_ctx, 6654 &ndr_table_srvsvc, 6655 NDR_SRVSVC_NETSERVERTRANSPORTADDEX, 6656 &r); 6657 6658 if (!NT_STATUS_IS_OK(status)) { 6659 return status; 6660 } 6661 6662 if (NT_STATUS_IS_ERR(status)) { 6663 return status; 6664 } 6665 6666 /* Return variables */ 6667 6668 /* Return result */ 6669 if (werror) { 6670 *werror = r.out.result; 6671 } 6672 6673 return werror_to_ntstatus(r.out.result); 6674} 6675 6676struct rpccli_srvsvc_NetServerSetServiceBitsEx_state { 6677 struct srvsvc_NetServerSetServiceBitsEx orig; 6678 struct srvsvc_NetServerSetServiceBitsEx tmp; 6679 TALLOC_CTX *out_mem_ctx; 6680 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6681}; 6682 6683static void rpccli_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq); 6684 6685struct tevent_req *rpccli_srvsvc_NetServerSetServiceBitsEx_send(TALLOC_CTX *mem_ctx, 6686 struct tevent_context *ev, 6687 struct rpc_pipe_client *cli, 6688 const char *_server_unc /* [in] [unique,charset(UTF16)] */, 6689 const char *_emulated_server_unc /* [in] [unique,charset(UTF16)] */, 6690 const char *_transport /* [in] [unique,charset(UTF16)] */, 6691 uint32_t _servicebitsofinterest /* [in] */, 6692 uint32_t _servicebits /* [in] */, 6693 uint32_t _updateimmediately /* [in] */) 6694{ 6695 struct tevent_req *req; 6696 struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state; 6697 struct tevent_req *subreq; 6698 6699 req = tevent_req_create(mem_ctx, &state, 6700 struct rpccli_srvsvc_NetServerSetServiceBitsEx_state); 6701 if (req == NULL) { 6702 return NULL; 6703 } 6704 state->out_mem_ctx = NULL; 6705 state->dispatch_recv = cli->dispatch_recv; 6706 6707 /* In parameters */ 6708 state->orig.in.server_unc = _server_unc; 6709 state->orig.in.emulated_server_unc = _emulated_server_unc; 6710 state->orig.in.transport = _transport; 6711 state->orig.in.servicebitsofinterest = _servicebitsofinterest; 6712 state->orig.in.servicebits = _servicebits; 6713 state->orig.in.updateimmediately = _updateimmediately; 6714 6715 /* Out parameters */ 6716 6717 /* Result */ 6718 ZERO_STRUCT(state->orig.out.result); 6719 6720 /* make a temporary copy, that we pass to the dispatch function */ 6721 state->tmp = state->orig; 6722 6723 subreq = cli->dispatch_send(state, ev, cli, 6724 &ndr_table_srvsvc, 6725 NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, 6726 &state->tmp); 6727 if (tevent_req_nomem(subreq, req)) { 6728 return tevent_req_post(req, ev); 6729 } 6730 tevent_req_set_callback(subreq, rpccli_srvsvc_NetServerSetServiceBitsEx_done, req); 6731 return req; 6732} 6733 6734static void rpccli_srvsvc_NetServerSetServiceBitsEx_done(struct tevent_req *subreq) 6735{ 6736 struct tevent_req *req = tevent_req_callback_data( 6737 subreq, struct tevent_req); 6738 struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data( 6739 req, struct rpccli_srvsvc_NetServerSetServiceBitsEx_state); 6740 NTSTATUS status; 6741 TALLOC_CTX *mem_ctx; 6742 6743 if (state->out_mem_ctx) { 6744 mem_ctx = state->out_mem_ctx; 6745 } else { 6746 mem_ctx = state; 6747 } 6748 6749 status = state->dispatch_recv(subreq, mem_ctx); 6750 TALLOC_FREE(subreq); 6751 if (!NT_STATUS_IS_OK(status)) { 6752 tevent_req_nterror(req, status); 6753 return; 6754 } 6755 6756 /* Copy out parameters */ 6757 6758 /* Copy result */ 6759 state->orig.out.result = state->tmp.out.result; 6760 6761 /* Reset temporary structure */ 6762 ZERO_STRUCT(state->tmp); 6763 6764 tevent_req_done(req); 6765} 6766 6767NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx_recv(struct tevent_req *req, 6768 TALLOC_CTX *mem_ctx, 6769 WERROR *result) 6770{ 6771 struct rpccli_srvsvc_NetServerSetServiceBitsEx_state *state = tevent_req_data( 6772 req, struct rpccli_srvsvc_NetServerSetServiceBitsEx_state); 6773 NTSTATUS status; 6774 6775 if (tevent_req_is_nterror(req, &status)) { 6776 tevent_req_received(req); 6777 return status; 6778 } 6779 6780 /* Steal possbile out parameters to the callers context */ 6781 talloc_steal(mem_ctx, state->out_mem_ctx); 6782 6783 /* Return result */ 6784 *result = state->orig.out.result; 6785 6786 tevent_req_received(req); 6787 return NT_STATUS_OK; 6788} 6789 6790NTSTATUS rpccli_srvsvc_NetServerSetServiceBitsEx(struct rpc_pipe_client *cli, 6791 TALLOC_CTX *mem_ctx, 6792 const char *server_unc /* [in] [unique,charset(UTF16)] */, 6793 const char *emulated_server_unc /* [in] [unique,charset(UTF16)] */, 6794 const char *transport /* [in] [unique,charset(UTF16)] */, 6795 uint32_t servicebitsofinterest /* [in] */, 6796 uint32_t servicebits /* [in] */, 6797 uint32_t updateimmediately /* [in] */, 6798 WERROR *werror) 6799{ 6800 struct srvsvc_NetServerSetServiceBitsEx r; 6801 NTSTATUS status; 6802 6803 /* In parameters */ 6804 r.in.server_unc = server_unc; 6805 r.in.emulated_server_unc = emulated_server_unc; 6806 r.in.transport = transport; 6807 r.in.servicebitsofinterest = servicebitsofinterest; 6808 r.in.servicebits = servicebits; 6809 r.in.updateimmediately = updateimmediately; 6810 6811 status = cli->dispatch(cli, 6812 mem_ctx, 6813 &ndr_table_srvsvc, 6814 NDR_SRVSVC_NETSERVERSETSERVICEBITSEX, 6815 &r); 6816 6817 if (!NT_STATUS_IS_OK(status)) { 6818 return status; 6819 } 6820 6821 if (NT_STATUS_IS_ERR(status)) { 6822 return status; 6823 } 6824 6825 /* Return variables */ 6826 6827 /* Return result */ 6828 if (werror) { 6829 *werror = r.out.result; 6830 } 6831 6832 return werror_to_ntstatus(r.out.result); 6833} 6834 6835struct rpccli_srvsvc_NETRDFSGETVERSION_state { 6836 struct srvsvc_NETRDFSGETVERSION orig; 6837 struct srvsvc_NETRDFSGETVERSION tmp; 6838 TALLOC_CTX *out_mem_ctx; 6839 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6840}; 6841 6842static void rpccli_srvsvc_NETRDFSGETVERSION_done(struct tevent_req *subreq); 6843 6844struct tevent_req *rpccli_srvsvc_NETRDFSGETVERSION_send(TALLOC_CTX *mem_ctx, 6845 struct tevent_context *ev, 6846 struct rpc_pipe_client *cli) 6847{ 6848 struct tevent_req *req; 6849 struct rpccli_srvsvc_NETRDFSGETVERSION_state *state; 6850 struct tevent_req *subreq; 6851 6852 req = tevent_req_create(mem_ctx, &state, 6853 struct rpccli_srvsvc_NETRDFSGETVERSION_state); 6854 if (req == NULL) { 6855 return NULL; 6856 } 6857 state->out_mem_ctx = NULL; 6858 state->dispatch_recv = cli->dispatch_recv; 6859 6860 /* In parameters */ 6861 6862 /* Out parameters */ 6863 6864 /* Result */ 6865 ZERO_STRUCT(state->orig.out.result); 6866 6867 /* make a temporary copy, that we pass to the dispatch function */ 6868 state->tmp = state->orig; 6869 6870 subreq = cli->dispatch_send(state, ev, cli, 6871 &ndr_table_srvsvc, 6872 NDR_SRVSVC_NETRDFSGETVERSION, 6873 &state->tmp); 6874 if (tevent_req_nomem(subreq, req)) { 6875 return tevent_req_post(req, ev); 6876 } 6877 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSGETVERSION_done, req); 6878 return req; 6879} 6880 6881static void rpccli_srvsvc_NETRDFSGETVERSION_done(struct tevent_req *subreq) 6882{ 6883 struct tevent_req *req = tevent_req_callback_data( 6884 subreq, struct tevent_req); 6885 struct rpccli_srvsvc_NETRDFSGETVERSION_state *state = tevent_req_data( 6886 req, struct rpccli_srvsvc_NETRDFSGETVERSION_state); 6887 NTSTATUS status; 6888 TALLOC_CTX *mem_ctx; 6889 6890 if (state->out_mem_ctx) { 6891 mem_ctx = state->out_mem_ctx; 6892 } else { 6893 mem_ctx = state; 6894 } 6895 6896 status = state->dispatch_recv(subreq, mem_ctx); 6897 TALLOC_FREE(subreq); 6898 if (!NT_STATUS_IS_OK(status)) { 6899 tevent_req_nterror(req, status); 6900 return; 6901 } 6902 6903 /* Copy out parameters */ 6904 6905 /* Copy result */ 6906 state->orig.out.result = state->tmp.out.result; 6907 6908 /* Reset temporary structure */ 6909 ZERO_STRUCT(state->tmp); 6910 6911 tevent_req_done(req); 6912} 6913 6914NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION_recv(struct tevent_req *req, 6915 TALLOC_CTX *mem_ctx, 6916 WERROR *result) 6917{ 6918 struct rpccli_srvsvc_NETRDFSGETVERSION_state *state = tevent_req_data( 6919 req, struct rpccli_srvsvc_NETRDFSGETVERSION_state); 6920 NTSTATUS status; 6921 6922 if (tevent_req_is_nterror(req, &status)) { 6923 tevent_req_received(req); 6924 return status; 6925 } 6926 6927 /* Steal possbile out parameters to the callers context */ 6928 talloc_steal(mem_ctx, state->out_mem_ctx); 6929 6930 /* Return result */ 6931 *result = state->orig.out.result; 6932 6933 tevent_req_received(req); 6934 return NT_STATUS_OK; 6935} 6936 6937NTSTATUS rpccli_srvsvc_NETRDFSGETVERSION(struct rpc_pipe_client *cli, 6938 TALLOC_CTX *mem_ctx, 6939 WERROR *werror) 6940{ 6941 struct srvsvc_NETRDFSGETVERSION r; 6942 NTSTATUS status; 6943 6944 /* In parameters */ 6945 6946 status = cli->dispatch(cli, 6947 mem_ctx, 6948 &ndr_table_srvsvc, 6949 NDR_SRVSVC_NETRDFSGETVERSION, 6950 &r); 6951 6952 if (!NT_STATUS_IS_OK(status)) { 6953 return status; 6954 } 6955 6956 if (NT_STATUS_IS_ERR(status)) { 6957 return status; 6958 } 6959 6960 /* Return variables */ 6961 6962 /* Return result */ 6963 if (werror) { 6964 *werror = r.out.result; 6965 } 6966 6967 return werror_to_ntstatus(r.out.result); 6968} 6969 6970struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state { 6971 struct srvsvc_NETRDFSCREATELOCALPARTITION orig; 6972 struct srvsvc_NETRDFSCREATELOCALPARTITION tmp; 6973 TALLOC_CTX *out_mem_ctx; 6974 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 6975}; 6976 6977static void rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done(struct tevent_req *subreq); 6978 6979struct tevent_req *rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_send(TALLOC_CTX *mem_ctx, 6980 struct tevent_context *ev, 6981 struct rpc_pipe_client *cli) 6982{ 6983 struct tevent_req *req; 6984 struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state; 6985 struct tevent_req *subreq; 6986 6987 req = tevent_req_create(mem_ctx, &state, 6988 struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state); 6989 if (req == NULL) { 6990 return NULL; 6991 } 6992 state->out_mem_ctx = NULL; 6993 state->dispatch_recv = cli->dispatch_recv; 6994 6995 /* In parameters */ 6996 6997 /* Out parameters */ 6998 6999 /* Result */ 7000 ZERO_STRUCT(state->orig.out.result); 7001 7002 /* make a temporary copy, that we pass to the dispatch function */ 7003 state->tmp = state->orig; 7004 7005 subreq = cli->dispatch_send(state, ev, cli, 7006 &ndr_table_srvsvc, 7007 NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, 7008 &state->tmp); 7009 if (tevent_req_nomem(subreq, req)) { 7010 return tevent_req_post(req, ev); 7011 } 7012 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done, req); 7013 return req; 7014} 7015 7016static void rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_done(struct tevent_req *subreq) 7017{ 7018 struct tevent_req *req = tevent_req_callback_data( 7019 subreq, struct tevent_req); 7020 struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state = tevent_req_data( 7021 req, struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state); 7022 NTSTATUS status; 7023 TALLOC_CTX *mem_ctx; 7024 7025 if (state->out_mem_ctx) { 7026 mem_ctx = state->out_mem_ctx; 7027 } else { 7028 mem_ctx = state; 7029 } 7030 7031 status = state->dispatch_recv(subreq, mem_ctx); 7032 TALLOC_FREE(subreq); 7033 if (!NT_STATUS_IS_OK(status)) { 7034 tevent_req_nterror(req, status); 7035 return; 7036 } 7037 7038 /* Copy out parameters */ 7039 7040 /* Copy result */ 7041 state->orig.out.result = state->tmp.out.result; 7042 7043 /* Reset temporary structure */ 7044 ZERO_STRUCT(state->tmp); 7045 7046 tevent_req_done(req); 7047} 7048 7049NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_recv(struct tevent_req *req, 7050 TALLOC_CTX *mem_ctx, 7051 WERROR *result) 7052{ 7053 struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state *state = tevent_req_data( 7054 req, struct rpccli_srvsvc_NETRDFSCREATELOCALPARTITION_state); 7055 NTSTATUS status; 7056 7057 if (tevent_req_is_nterror(req, &status)) { 7058 tevent_req_received(req); 7059 return status; 7060 } 7061 7062 /* Steal possbile out parameters to the callers context */ 7063 talloc_steal(mem_ctx, state->out_mem_ctx); 7064 7065 /* Return result */ 7066 *result = state->orig.out.result; 7067 7068 tevent_req_received(req); 7069 return NT_STATUS_OK; 7070} 7071 7072NTSTATUS rpccli_srvsvc_NETRDFSCREATELOCALPARTITION(struct rpc_pipe_client *cli, 7073 TALLOC_CTX *mem_ctx, 7074 WERROR *werror) 7075{ 7076 struct srvsvc_NETRDFSCREATELOCALPARTITION r; 7077 NTSTATUS status; 7078 7079 /* In parameters */ 7080 7081 status = cli->dispatch(cli, 7082 mem_ctx, 7083 &ndr_table_srvsvc, 7084 NDR_SRVSVC_NETRDFSCREATELOCALPARTITION, 7085 &r); 7086 7087 if (!NT_STATUS_IS_OK(status)) { 7088 return status; 7089 } 7090 7091 if (NT_STATUS_IS_ERR(status)) { 7092 return status; 7093 } 7094 7095 /* Return variables */ 7096 7097 /* Return result */ 7098 if (werror) { 7099 *werror = r.out.result; 7100 } 7101 7102 return werror_to_ntstatus(r.out.result); 7103} 7104 7105struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state { 7106 struct srvsvc_NETRDFSDELETELOCALPARTITION orig; 7107 struct srvsvc_NETRDFSDELETELOCALPARTITION tmp; 7108 TALLOC_CTX *out_mem_ctx; 7109 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7110}; 7111 7112static void rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done(struct tevent_req *subreq); 7113 7114struct tevent_req *rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_send(TALLOC_CTX *mem_ctx, 7115 struct tevent_context *ev, 7116 struct rpc_pipe_client *cli) 7117{ 7118 struct tevent_req *req; 7119 struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state; 7120 struct tevent_req *subreq; 7121 7122 req = tevent_req_create(mem_ctx, &state, 7123 struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state); 7124 if (req == NULL) { 7125 return NULL; 7126 } 7127 state->out_mem_ctx = NULL; 7128 state->dispatch_recv = cli->dispatch_recv; 7129 7130 /* In parameters */ 7131 7132 /* Out parameters */ 7133 7134 /* Result */ 7135 ZERO_STRUCT(state->orig.out.result); 7136 7137 /* make a temporary copy, that we pass to the dispatch function */ 7138 state->tmp = state->orig; 7139 7140 subreq = cli->dispatch_send(state, ev, cli, 7141 &ndr_table_srvsvc, 7142 NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, 7143 &state->tmp); 7144 if (tevent_req_nomem(subreq, req)) { 7145 return tevent_req_post(req, ev); 7146 } 7147 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done, req); 7148 return req; 7149} 7150 7151static void rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_done(struct tevent_req *subreq) 7152{ 7153 struct tevent_req *req = tevent_req_callback_data( 7154 subreq, struct tevent_req); 7155 struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state = tevent_req_data( 7156 req, struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state); 7157 NTSTATUS status; 7158 TALLOC_CTX *mem_ctx; 7159 7160 if (state->out_mem_ctx) { 7161 mem_ctx = state->out_mem_ctx; 7162 } else { 7163 mem_ctx = state; 7164 } 7165 7166 status = state->dispatch_recv(subreq, mem_ctx); 7167 TALLOC_FREE(subreq); 7168 if (!NT_STATUS_IS_OK(status)) { 7169 tevent_req_nterror(req, status); 7170 return; 7171 } 7172 7173 /* Copy out parameters */ 7174 7175 /* Copy result */ 7176 state->orig.out.result = state->tmp.out.result; 7177 7178 /* Reset temporary structure */ 7179 ZERO_STRUCT(state->tmp); 7180 7181 tevent_req_done(req); 7182} 7183 7184NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_recv(struct tevent_req *req, 7185 TALLOC_CTX *mem_ctx, 7186 WERROR *result) 7187{ 7188 struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state *state = tevent_req_data( 7189 req, struct rpccli_srvsvc_NETRDFSDELETELOCALPARTITION_state); 7190 NTSTATUS status; 7191 7192 if (tevent_req_is_nterror(req, &status)) { 7193 tevent_req_received(req); 7194 return status; 7195 } 7196 7197 /* Steal possbile out parameters to the callers context */ 7198 talloc_steal(mem_ctx, state->out_mem_ctx); 7199 7200 /* Return result */ 7201 *result = state->orig.out.result; 7202 7203 tevent_req_received(req); 7204 return NT_STATUS_OK; 7205} 7206 7207NTSTATUS rpccli_srvsvc_NETRDFSDELETELOCALPARTITION(struct rpc_pipe_client *cli, 7208 TALLOC_CTX *mem_ctx, 7209 WERROR *werror) 7210{ 7211 struct srvsvc_NETRDFSDELETELOCALPARTITION r; 7212 NTSTATUS status; 7213 7214 /* In parameters */ 7215 7216 status = cli->dispatch(cli, 7217 mem_ctx, 7218 &ndr_table_srvsvc, 7219 NDR_SRVSVC_NETRDFSDELETELOCALPARTITION, 7220 &r); 7221 7222 if (!NT_STATUS_IS_OK(status)) { 7223 return status; 7224 } 7225 7226 if (NT_STATUS_IS_ERR(status)) { 7227 return status; 7228 } 7229 7230 /* Return variables */ 7231 7232 /* Return result */ 7233 if (werror) { 7234 *werror = r.out.result; 7235 } 7236 7237 return werror_to_ntstatus(r.out.result); 7238} 7239 7240struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state { 7241 struct srvsvc_NETRDFSSETLOCALVOLUMESTATE orig; 7242 struct srvsvc_NETRDFSSETLOCALVOLUMESTATE tmp; 7243 TALLOC_CTX *out_mem_ctx; 7244 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7245}; 7246 7247static void rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done(struct tevent_req *subreq); 7248 7249struct tevent_req *rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_send(TALLOC_CTX *mem_ctx, 7250 struct tevent_context *ev, 7251 struct rpc_pipe_client *cli) 7252{ 7253 struct tevent_req *req; 7254 struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state; 7255 struct tevent_req *subreq; 7256 7257 req = tevent_req_create(mem_ctx, &state, 7258 struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state); 7259 if (req == NULL) { 7260 return NULL; 7261 } 7262 state->out_mem_ctx = NULL; 7263 state->dispatch_recv = cli->dispatch_recv; 7264 7265 /* In parameters */ 7266 7267 /* Out parameters */ 7268 7269 /* Result */ 7270 ZERO_STRUCT(state->orig.out.result); 7271 7272 /* make a temporary copy, that we pass to the dispatch function */ 7273 state->tmp = state->orig; 7274 7275 subreq = cli->dispatch_send(state, ev, cli, 7276 &ndr_table_srvsvc, 7277 NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, 7278 &state->tmp); 7279 if (tevent_req_nomem(subreq, req)) { 7280 return tevent_req_post(req, ev); 7281 } 7282 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done, req); 7283 return req; 7284} 7285 7286static void rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_done(struct tevent_req *subreq) 7287{ 7288 struct tevent_req *req = tevent_req_callback_data( 7289 subreq, struct tevent_req); 7290 struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state = tevent_req_data( 7291 req, struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state); 7292 NTSTATUS status; 7293 TALLOC_CTX *mem_ctx; 7294 7295 if (state->out_mem_ctx) { 7296 mem_ctx = state->out_mem_ctx; 7297 } else { 7298 mem_ctx = state; 7299 } 7300 7301 status = state->dispatch_recv(subreq, mem_ctx); 7302 TALLOC_FREE(subreq); 7303 if (!NT_STATUS_IS_OK(status)) { 7304 tevent_req_nterror(req, status); 7305 return; 7306 } 7307 7308 /* Copy out parameters */ 7309 7310 /* Copy result */ 7311 state->orig.out.result = state->tmp.out.result; 7312 7313 /* Reset temporary structure */ 7314 ZERO_STRUCT(state->tmp); 7315 7316 tevent_req_done(req); 7317} 7318 7319NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_recv(struct tevent_req *req, 7320 TALLOC_CTX *mem_ctx, 7321 WERROR *result) 7322{ 7323 struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state *state = tevent_req_data( 7324 req, struct rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE_state); 7325 NTSTATUS status; 7326 7327 if (tevent_req_is_nterror(req, &status)) { 7328 tevent_req_received(req); 7329 return status; 7330 } 7331 7332 /* Steal possbile out parameters to the callers context */ 7333 talloc_steal(mem_ctx, state->out_mem_ctx); 7334 7335 /* Return result */ 7336 *result = state->orig.out.result; 7337 7338 tevent_req_received(req); 7339 return NT_STATUS_OK; 7340} 7341 7342NTSTATUS rpccli_srvsvc_NETRDFSSETLOCALVOLUMESTATE(struct rpc_pipe_client *cli, 7343 TALLOC_CTX *mem_ctx, 7344 WERROR *werror) 7345{ 7346 struct srvsvc_NETRDFSSETLOCALVOLUMESTATE r; 7347 NTSTATUS status; 7348 7349 /* In parameters */ 7350 7351 status = cli->dispatch(cli, 7352 mem_ctx, 7353 &ndr_table_srvsvc, 7354 NDR_SRVSVC_NETRDFSSETLOCALVOLUMESTATE, 7355 &r); 7356 7357 if (!NT_STATUS_IS_OK(status)) { 7358 return status; 7359 } 7360 7361 if (NT_STATUS_IS_ERR(status)) { 7362 return status; 7363 } 7364 7365 /* Return variables */ 7366 7367 /* Return result */ 7368 if (werror) { 7369 *werror = r.out.result; 7370 } 7371 7372 return werror_to_ntstatus(r.out.result); 7373} 7374 7375struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state { 7376 struct srvsvc_NETRDFSSETSERVERINFO orig; 7377 struct srvsvc_NETRDFSSETSERVERINFO tmp; 7378 TALLOC_CTX *out_mem_ctx; 7379 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7380}; 7381 7382static void rpccli_srvsvc_NETRDFSSETSERVERINFO_done(struct tevent_req *subreq); 7383 7384struct tevent_req *rpccli_srvsvc_NETRDFSSETSERVERINFO_send(TALLOC_CTX *mem_ctx, 7385 struct tevent_context *ev, 7386 struct rpc_pipe_client *cli) 7387{ 7388 struct tevent_req *req; 7389 struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state; 7390 struct tevent_req *subreq; 7391 7392 req = tevent_req_create(mem_ctx, &state, 7393 struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state); 7394 if (req == NULL) { 7395 return NULL; 7396 } 7397 state->out_mem_ctx = NULL; 7398 state->dispatch_recv = cli->dispatch_recv; 7399 7400 /* In parameters */ 7401 7402 /* Out parameters */ 7403 7404 /* Result */ 7405 ZERO_STRUCT(state->orig.out.result); 7406 7407 /* make a temporary copy, that we pass to the dispatch function */ 7408 state->tmp = state->orig; 7409 7410 subreq = cli->dispatch_send(state, ev, cli, 7411 &ndr_table_srvsvc, 7412 NDR_SRVSVC_NETRDFSSETSERVERINFO, 7413 &state->tmp); 7414 if (tevent_req_nomem(subreq, req)) { 7415 return tevent_req_post(req, ev); 7416 } 7417 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSSETSERVERINFO_done, req); 7418 return req; 7419} 7420 7421static void rpccli_srvsvc_NETRDFSSETSERVERINFO_done(struct tevent_req *subreq) 7422{ 7423 struct tevent_req *req = tevent_req_callback_data( 7424 subreq, struct tevent_req); 7425 struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state = tevent_req_data( 7426 req, struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state); 7427 NTSTATUS status; 7428 TALLOC_CTX *mem_ctx; 7429 7430 if (state->out_mem_ctx) { 7431 mem_ctx = state->out_mem_ctx; 7432 } else { 7433 mem_ctx = state; 7434 } 7435 7436 status = state->dispatch_recv(subreq, mem_ctx); 7437 TALLOC_FREE(subreq); 7438 if (!NT_STATUS_IS_OK(status)) { 7439 tevent_req_nterror(req, status); 7440 return; 7441 } 7442 7443 /* Copy out parameters */ 7444 7445 /* Copy result */ 7446 state->orig.out.result = state->tmp.out.result; 7447 7448 /* Reset temporary structure */ 7449 ZERO_STRUCT(state->tmp); 7450 7451 tevent_req_done(req); 7452} 7453 7454NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO_recv(struct tevent_req *req, 7455 TALLOC_CTX *mem_ctx, 7456 WERROR *result) 7457{ 7458 struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state *state = tevent_req_data( 7459 req, struct rpccli_srvsvc_NETRDFSSETSERVERINFO_state); 7460 NTSTATUS status; 7461 7462 if (tevent_req_is_nterror(req, &status)) { 7463 tevent_req_received(req); 7464 return status; 7465 } 7466 7467 /* Steal possbile out parameters to the callers context */ 7468 talloc_steal(mem_ctx, state->out_mem_ctx); 7469 7470 /* Return result */ 7471 *result = state->orig.out.result; 7472 7473 tevent_req_received(req); 7474 return NT_STATUS_OK; 7475} 7476 7477NTSTATUS rpccli_srvsvc_NETRDFSSETSERVERINFO(struct rpc_pipe_client *cli, 7478 TALLOC_CTX *mem_ctx, 7479 WERROR *werror) 7480{ 7481 struct srvsvc_NETRDFSSETSERVERINFO r; 7482 NTSTATUS status; 7483 7484 /* In parameters */ 7485 7486 status = cli->dispatch(cli, 7487 mem_ctx, 7488 &ndr_table_srvsvc, 7489 NDR_SRVSVC_NETRDFSSETSERVERINFO, 7490 &r); 7491 7492 if (!NT_STATUS_IS_OK(status)) { 7493 return status; 7494 } 7495 7496 if (NT_STATUS_IS_ERR(status)) { 7497 return status; 7498 } 7499 7500 /* Return variables */ 7501 7502 /* Return result */ 7503 if (werror) { 7504 *werror = r.out.result; 7505 } 7506 7507 return werror_to_ntstatus(r.out.result); 7508} 7509 7510struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state { 7511 struct srvsvc_NETRDFSCREATEEXITPOINT orig; 7512 struct srvsvc_NETRDFSCREATEEXITPOINT tmp; 7513 TALLOC_CTX *out_mem_ctx; 7514 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7515}; 7516 7517static void rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done(struct tevent_req *subreq); 7518 7519struct tevent_req *rpccli_srvsvc_NETRDFSCREATEEXITPOINT_send(TALLOC_CTX *mem_ctx, 7520 struct tevent_context *ev, 7521 struct rpc_pipe_client *cli) 7522{ 7523 struct tevent_req *req; 7524 struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state; 7525 struct tevent_req *subreq; 7526 7527 req = tevent_req_create(mem_ctx, &state, 7528 struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state); 7529 if (req == NULL) { 7530 return NULL; 7531 } 7532 state->out_mem_ctx = NULL; 7533 state->dispatch_recv = cli->dispatch_recv; 7534 7535 /* In parameters */ 7536 7537 /* Out parameters */ 7538 7539 /* Result */ 7540 ZERO_STRUCT(state->orig.out.result); 7541 7542 /* make a temporary copy, that we pass to the dispatch function */ 7543 state->tmp = state->orig; 7544 7545 subreq = cli->dispatch_send(state, ev, cli, 7546 &ndr_table_srvsvc, 7547 NDR_SRVSVC_NETRDFSCREATEEXITPOINT, 7548 &state->tmp); 7549 if (tevent_req_nomem(subreq, req)) { 7550 return tevent_req_post(req, ev); 7551 } 7552 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done, req); 7553 return req; 7554} 7555 7556static void rpccli_srvsvc_NETRDFSCREATEEXITPOINT_done(struct tevent_req *subreq) 7557{ 7558 struct tevent_req *req = tevent_req_callback_data( 7559 subreq, struct tevent_req); 7560 struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state = tevent_req_data( 7561 req, struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state); 7562 NTSTATUS status; 7563 TALLOC_CTX *mem_ctx; 7564 7565 if (state->out_mem_ctx) { 7566 mem_ctx = state->out_mem_ctx; 7567 } else { 7568 mem_ctx = state; 7569 } 7570 7571 status = state->dispatch_recv(subreq, mem_ctx); 7572 TALLOC_FREE(subreq); 7573 if (!NT_STATUS_IS_OK(status)) { 7574 tevent_req_nterror(req, status); 7575 return; 7576 } 7577 7578 /* Copy out parameters */ 7579 7580 /* Copy result */ 7581 state->orig.out.result = state->tmp.out.result; 7582 7583 /* Reset temporary structure */ 7584 ZERO_STRUCT(state->tmp); 7585 7586 tevent_req_done(req); 7587} 7588 7589NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT_recv(struct tevent_req *req, 7590 TALLOC_CTX *mem_ctx, 7591 WERROR *result) 7592{ 7593 struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state *state = tevent_req_data( 7594 req, struct rpccli_srvsvc_NETRDFSCREATEEXITPOINT_state); 7595 NTSTATUS status; 7596 7597 if (tevent_req_is_nterror(req, &status)) { 7598 tevent_req_received(req); 7599 return status; 7600 } 7601 7602 /* Steal possbile out parameters to the callers context */ 7603 talloc_steal(mem_ctx, state->out_mem_ctx); 7604 7605 /* Return result */ 7606 *result = state->orig.out.result; 7607 7608 tevent_req_received(req); 7609 return NT_STATUS_OK; 7610} 7611 7612NTSTATUS rpccli_srvsvc_NETRDFSCREATEEXITPOINT(struct rpc_pipe_client *cli, 7613 TALLOC_CTX *mem_ctx, 7614 WERROR *werror) 7615{ 7616 struct srvsvc_NETRDFSCREATEEXITPOINT r; 7617 NTSTATUS status; 7618 7619 /* In parameters */ 7620 7621 status = cli->dispatch(cli, 7622 mem_ctx, 7623 &ndr_table_srvsvc, 7624 NDR_SRVSVC_NETRDFSCREATEEXITPOINT, 7625 &r); 7626 7627 if (!NT_STATUS_IS_OK(status)) { 7628 return status; 7629 } 7630 7631 if (NT_STATUS_IS_ERR(status)) { 7632 return status; 7633 } 7634 7635 /* Return variables */ 7636 7637 /* Return result */ 7638 if (werror) { 7639 *werror = r.out.result; 7640 } 7641 7642 return werror_to_ntstatus(r.out.result); 7643} 7644 7645struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state { 7646 struct srvsvc_NETRDFSDELETEEXITPOINT orig; 7647 struct srvsvc_NETRDFSDELETEEXITPOINT tmp; 7648 TALLOC_CTX *out_mem_ctx; 7649 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7650}; 7651 7652static void rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done(struct tevent_req *subreq); 7653 7654struct tevent_req *rpccli_srvsvc_NETRDFSDELETEEXITPOINT_send(TALLOC_CTX *mem_ctx, 7655 struct tevent_context *ev, 7656 struct rpc_pipe_client *cli) 7657{ 7658 struct tevent_req *req; 7659 struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state; 7660 struct tevent_req *subreq; 7661 7662 req = tevent_req_create(mem_ctx, &state, 7663 struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state); 7664 if (req == NULL) { 7665 return NULL; 7666 } 7667 state->out_mem_ctx = NULL; 7668 state->dispatch_recv = cli->dispatch_recv; 7669 7670 /* In parameters */ 7671 7672 /* Out parameters */ 7673 7674 /* Result */ 7675 ZERO_STRUCT(state->orig.out.result); 7676 7677 /* make a temporary copy, that we pass to the dispatch function */ 7678 state->tmp = state->orig; 7679 7680 subreq = cli->dispatch_send(state, ev, cli, 7681 &ndr_table_srvsvc, 7682 NDR_SRVSVC_NETRDFSDELETEEXITPOINT, 7683 &state->tmp); 7684 if (tevent_req_nomem(subreq, req)) { 7685 return tevent_req_post(req, ev); 7686 } 7687 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done, req); 7688 return req; 7689} 7690 7691static void rpccli_srvsvc_NETRDFSDELETEEXITPOINT_done(struct tevent_req *subreq) 7692{ 7693 struct tevent_req *req = tevent_req_callback_data( 7694 subreq, struct tevent_req); 7695 struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state = tevent_req_data( 7696 req, struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state); 7697 NTSTATUS status; 7698 TALLOC_CTX *mem_ctx; 7699 7700 if (state->out_mem_ctx) { 7701 mem_ctx = state->out_mem_ctx; 7702 } else { 7703 mem_ctx = state; 7704 } 7705 7706 status = state->dispatch_recv(subreq, mem_ctx); 7707 TALLOC_FREE(subreq); 7708 if (!NT_STATUS_IS_OK(status)) { 7709 tevent_req_nterror(req, status); 7710 return; 7711 } 7712 7713 /* Copy out parameters */ 7714 7715 /* Copy result */ 7716 state->orig.out.result = state->tmp.out.result; 7717 7718 /* Reset temporary structure */ 7719 ZERO_STRUCT(state->tmp); 7720 7721 tevent_req_done(req); 7722} 7723 7724NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT_recv(struct tevent_req *req, 7725 TALLOC_CTX *mem_ctx, 7726 WERROR *result) 7727{ 7728 struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state *state = tevent_req_data( 7729 req, struct rpccli_srvsvc_NETRDFSDELETEEXITPOINT_state); 7730 NTSTATUS status; 7731 7732 if (tevent_req_is_nterror(req, &status)) { 7733 tevent_req_received(req); 7734 return status; 7735 } 7736 7737 /* Steal possbile out parameters to the callers context */ 7738 talloc_steal(mem_ctx, state->out_mem_ctx); 7739 7740 /* Return result */ 7741 *result = state->orig.out.result; 7742 7743 tevent_req_received(req); 7744 return NT_STATUS_OK; 7745} 7746 7747NTSTATUS rpccli_srvsvc_NETRDFSDELETEEXITPOINT(struct rpc_pipe_client *cli, 7748 TALLOC_CTX *mem_ctx, 7749 WERROR *werror) 7750{ 7751 struct srvsvc_NETRDFSDELETEEXITPOINT r; 7752 NTSTATUS status; 7753 7754 /* In parameters */ 7755 7756 status = cli->dispatch(cli, 7757 mem_ctx, 7758 &ndr_table_srvsvc, 7759 NDR_SRVSVC_NETRDFSDELETEEXITPOINT, 7760 &r); 7761 7762 if (!NT_STATUS_IS_OK(status)) { 7763 return status; 7764 } 7765 7766 if (NT_STATUS_IS_ERR(status)) { 7767 return status; 7768 } 7769 7770 /* Return variables */ 7771 7772 /* Return result */ 7773 if (werror) { 7774 *werror = r.out.result; 7775 } 7776 7777 return werror_to_ntstatus(r.out.result); 7778} 7779 7780struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state { 7781 struct srvsvc_NETRDFSMODIFYPREFIX orig; 7782 struct srvsvc_NETRDFSMODIFYPREFIX tmp; 7783 TALLOC_CTX *out_mem_ctx; 7784 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7785}; 7786 7787static void rpccli_srvsvc_NETRDFSMODIFYPREFIX_done(struct tevent_req *subreq); 7788 7789struct tevent_req *rpccli_srvsvc_NETRDFSMODIFYPREFIX_send(TALLOC_CTX *mem_ctx, 7790 struct tevent_context *ev, 7791 struct rpc_pipe_client *cli) 7792{ 7793 struct tevent_req *req; 7794 struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state; 7795 struct tevent_req *subreq; 7796 7797 req = tevent_req_create(mem_ctx, &state, 7798 struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state); 7799 if (req == NULL) { 7800 return NULL; 7801 } 7802 state->out_mem_ctx = NULL; 7803 state->dispatch_recv = cli->dispatch_recv; 7804 7805 /* In parameters */ 7806 7807 /* Out parameters */ 7808 7809 /* Result */ 7810 ZERO_STRUCT(state->orig.out.result); 7811 7812 /* make a temporary copy, that we pass to the dispatch function */ 7813 state->tmp = state->orig; 7814 7815 subreq = cli->dispatch_send(state, ev, cli, 7816 &ndr_table_srvsvc, 7817 NDR_SRVSVC_NETRDFSMODIFYPREFIX, 7818 &state->tmp); 7819 if (tevent_req_nomem(subreq, req)) { 7820 return tevent_req_post(req, ev); 7821 } 7822 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSMODIFYPREFIX_done, req); 7823 return req; 7824} 7825 7826static void rpccli_srvsvc_NETRDFSMODIFYPREFIX_done(struct tevent_req *subreq) 7827{ 7828 struct tevent_req *req = tevent_req_callback_data( 7829 subreq, struct tevent_req); 7830 struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state = tevent_req_data( 7831 req, struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state); 7832 NTSTATUS status; 7833 TALLOC_CTX *mem_ctx; 7834 7835 if (state->out_mem_ctx) { 7836 mem_ctx = state->out_mem_ctx; 7837 } else { 7838 mem_ctx = state; 7839 } 7840 7841 status = state->dispatch_recv(subreq, mem_ctx); 7842 TALLOC_FREE(subreq); 7843 if (!NT_STATUS_IS_OK(status)) { 7844 tevent_req_nterror(req, status); 7845 return; 7846 } 7847 7848 /* Copy out parameters */ 7849 7850 /* Copy result */ 7851 state->orig.out.result = state->tmp.out.result; 7852 7853 /* Reset temporary structure */ 7854 ZERO_STRUCT(state->tmp); 7855 7856 tevent_req_done(req); 7857} 7858 7859NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX_recv(struct tevent_req *req, 7860 TALLOC_CTX *mem_ctx, 7861 WERROR *result) 7862{ 7863 struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state *state = tevent_req_data( 7864 req, struct rpccli_srvsvc_NETRDFSMODIFYPREFIX_state); 7865 NTSTATUS status; 7866 7867 if (tevent_req_is_nterror(req, &status)) { 7868 tevent_req_received(req); 7869 return status; 7870 } 7871 7872 /* Steal possbile out parameters to the callers context */ 7873 talloc_steal(mem_ctx, state->out_mem_ctx); 7874 7875 /* Return result */ 7876 *result = state->orig.out.result; 7877 7878 tevent_req_received(req); 7879 return NT_STATUS_OK; 7880} 7881 7882NTSTATUS rpccli_srvsvc_NETRDFSMODIFYPREFIX(struct rpc_pipe_client *cli, 7883 TALLOC_CTX *mem_ctx, 7884 WERROR *werror) 7885{ 7886 struct srvsvc_NETRDFSMODIFYPREFIX r; 7887 NTSTATUS status; 7888 7889 /* In parameters */ 7890 7891 status = cli->dispatch(cli, 7892 mem_ctx, 7893 &ndr_table_srvsvc, 7894 NDR_SRVSVC_NETRDFSMODIFYPREFIX, 7895 &r); 7896 7897 if (!NT_STATUS_IS_OK(status)) { 7898 return status; 7899 } 7900 7901 if (NT_STATUS_IS_ERR(status)) { 7902 return status; 7903 } 7904 7905 /* Return variables */ 7906 7907 /* Return result */ 7908 if (werror) { 7909 *werror = r.out.result; 7910 } 7911 7912 return werror_to_ntstatus(r.out.result); 7913} 7914 7915struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state { 7916 struct srvsvc_NETRDFSFIXLOCALVOLUME orig; 7917 struct srvsvc_NETRDFSFIXLOCALVOLUME tmp; 7918 TALLOC_CTX *out_mem_ctx; 7919 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 7920}; 7921 7922static void rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done(struct tevent_req *subreq); 7923 7924struct tevent_req *rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_send(TALLOC_CTX *mem_ctx, 7925 struct tevent_context *ev, 7926 struct rpc_pipe_client *cli) 7927{ 7928 struct tevent_req *req; 7929 struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state; 7930 struct tevent_req *subreq; 7931 7932 req = tevent_req_create(mem_ctx, &state, 7933 struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state); 7934 if (req == NULL) { 7935 return NULL; 7936 } 7937 state->out_mem_ctx = NULL; 7938 state->dispatch_recv = cli->dispatch_recv; 7939 7940 /* In parameters */ 7941 7942 /* Out parameters */ 7943 7944 /* Result */ 7945 ZERO_STRUCT(state->orig.out.result); 7946 7947 /* make a temporary copy, that we pass to the dispatch function */ 7948 state->tmp = state->orig; 7949 7950 subreq = cli->dispatch_send(state, ev, cli, 7951 &ndr_table_srvsvc, 7952 NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, 7953 &state->tmp); 7954 if (tevent_req_nomem(subreq, req)) { 7955 return tevent_req_post(req, ev); 7956 } 7957 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done, req); 7958 return req; 7959} 7960 7961static void rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_done(struct tevent_req *subreq) 7962{ 7963 struct tevent_req *req = tevent_req_callback_data( 7964 subreq, struct tevent_req); 7965 struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state = tevent_req_data( 7966 req, struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state); 7967 NTSTATUS status; 7968 TALLOC_CTX *mem_ctx; 7969 7970 if (state->out_mem_ctx) { 7971 mem_ctx = state->out_mem_ctx; 7972 } else { 7973 mem_ctx = state; 7974 } 7975 7976 status = state->dispatch_recv(subreq, mem_ctx); 7977 TALLOC_FREE(subreq); 7978 if (!NT_STATUS_IS_OK(status)) { 7979 tevent_req_nterror(req, status); 7980 return; 7981 } 7982 7983 /* Copy out parameters */ 7984 7985 /* Copy result */ 7986 state->orig.out.result = state->tmp.out.result; 7987 7988 /* Reset temporary structure */ 7989 ZERO_STRUCT(state->tmp); 7990 7991 tevent_req_done(req); 7992} 7993 7994NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_recv(struct tevent_req *req, 7995 TALLOC_CTX *mem_ctx, 7996 WERROR *result) 7997{ 7998 struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state *state = tevent_req_data( 7999 req, struct rpccli_srvsvc_NETRDFSFIXLOCALVOLUME_state); 8000 NTSTATUS status; 8001 8002 if (tevent_req_is_nterror(req, &status)) { 8003 tevent_req_received(req); 8004 return status; 8005 } 8006 8007 /* Steal possbile out parameters to the callers context */ 8008 talloc_steal(mem_ctx, state->out_mem_ctx); 8009 8010 /* Return result */ 8011 *result = state->orig.out.result; 8012 8013 tevent_req_received(req); 8014 return NT_STATUS_OK; 8015} 8016 8017NTSTATUS rpccli_srvsvc_NETRDFSFIXLOCALVOLUME(struct rpc_pipe_client *cli, 8018 TALLOC_CTX *mem_ctx, 8019 WERROR *werror) 8020{ 8021 struct srvsvc_NETRDFSFIXLOCALVOLUME r; 8022 NTSTATUS status; 8023 8024 /* In parameters */ 8025 8026 status = cli->dispatch(cli, 8027 mem_ctx, 8028 &ndr_table_srvsvc, 8029 NDR_SRVSVC_NETRDFSFIXLOCALVOLUME, 8030 &r); 8031 8032 if (!NT_STATUS_IS_OK(status)) { 8033 return status; 8034 } 8035 8036 if (NT_STATUS_IS_ERR(status)) { 8037 return status; 8038 } 8039 8040 /* Return variables */ 8041 8042 /* Return result */ 8043 if (werror) { 8044 *werror = r.out.result; 8045 } 8046 8047 return werror_to_ntstatus(r.out.result); 8048} 8049 8050struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state { 8051 struct srvsvc_NETRDFSMANAGERREPORTSITEINFO orig; 8052 struct srvsvc_NETRDFSMANAGERREPORTSITEINFO tmp; 8053 TALLOC_CTX *out_mem_ctx; 8054 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 8055}; 8056 8057static void rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done(struct tevent_req *subreq); 8058 8059struct tevent_req *rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_send(TALLOC_CTX *mem_ctx, 8060 struct tevent_context *ev, 8061 struct rpc_pipe_client *cli) 8062{ 8063 struct tevent_req *req; 8064 struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state; 8065 struct tevent_req *subreq; 8066 8067 req = tevent_req_create(mem_ctx, &state, 8068 struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state); 8069 if (req == NULL) { 8070 return NULL; 8071 } 8072 state->out_mem_ctx = NULL; 8073 state->dispatch_recv = cli->dispatch_recv; 8074 8075 /* In parameters */ 8076 8077 /* Out parameters */ 8078 8079 /* Result */ 8080 ZERO_STRUCT(state->orig.out.result); 8081 8082 /* make a temporary copy, that we pass to the dispatch function */ 8083 state->tmp = state->orig; 8084 8085 subreq = cli->dispatch_send(state, ev, cli, 8086 &ndr_table_srvsvc, 8087 NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, 8088 &state->tmp); 8089 if (tevent_req_nomem(subreq, req)) { 8090 return tevent_req_post(req, ev); 8091 } 8092 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done, req); 8093 return req; 8094} 8095 8096static void rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_done(struct tevent_req *subreq) 8097{ 8098 struct tevent_req *req = tevent_req_callback_data( 8099 subreq, struct tevent_req); 8100 struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state = tevent_req_data( 8101 req, struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state); 8102 NTSTATUS status; 8103 TALLOC_CTX *mem_ctx; 8104 8105 if (state->out_mem_ctx) { 8106 mem_ctx = state->out_mem_ctx; 8107 } else { 8108 mem_ctx = state; 8109 } 8110 8111 status = state->dispatch_recv(subreq, mem_ctx); 8112 TALLOC_FREE(subreq); 8113 if (!NT_STATUS_IS_OK(status)) { 8114 tevent_req_nterror(req, status); 8115 return; 8116 } 8117 8118 /* Copy out parameters */ 8119 8120 /* Copy result */ 8121 state->orig.out.result = state->tmp.out.result; 8122 8123 /* Reset temporary structure */ 8124 ZERO_STRUCT(state->tmp); 8125 8126 tevent_req_done(req); 8127} 8128 8129NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_recv(struct tevent_req *req, 8130 TALLOC_CTX *mem_ctx, 8131 WERROR *result) 8132{ 8133 struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state *state = tevent_req_data( 8134 req, struct rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO_state); 8135 NTSTATUS status; 8136 8137 if (tevent_req_is_nterror(req, &status)) { 8138 tevent_req_received(req); 8139 return status; 8140 } 8141 8142 /* Steal possbile out parameters to the callers context */ 8143 talloc_steal(mem_ctx, state->out_mem_ctx); 8144 8145 /* Return result */ 8146 *result = state->orig.out.result; 8147 8148 tevent_req_received(req); 8149 return NT_STATUS_OK; 8150} 8151 8152NTSTATUS rpccli_srvsvc_NETRDFSMANAGERREPORTSITEINFO(struct rpc_pipe_client *cli, 8153 TALLOC_CTX *mem_ctx, 8154 WERROR *werror) 8155{ 8156 struct srvsvc_NETRDFSMANAGERREPORTSITEINFO r; 8157 NTSTATUS status; 8158 8159 /* In parameters */ 8160 8161 status = cli->dispatch(cli, 8162 mem_ctx, 8163 &ndr_table_srvsvc, 8164 NDR_SRVSVC_NETRDFSMANAGERREPORTSITEINFO, 8165 &r); 8166 8167 if (!NT_STATUS_IS_OK(status)) { 8168 return status; 8169 } 8170 8171 if (NT_STATUS_IS_ERR(status)) { 8172 return status; 8173 } 8174 8175 /* Return variables */ 8176 8177 /* Return result */ 8178 if (werror) { 8179 *werror = r.out.result; 8180 } 8181 8182 return werror_to_ntstatus(r.out.result); 8183} 8184 8185struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state { 8186 struct srvsvc_NETRSERVERTRANSPORTDELEX orig; 8187 struct srvsvc_NETRSERVERTRANSPORTDELEX tmp; 8188 TALLOC_CTX *out_mem_ctx; 8189 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx); 8190}; 8191 8192static void rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done(struct tevent_req *subreq); 8193 8194struct tevent_req *rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_send(TALLOC_CTX *mem_ctx, 8195 struct tevent_context *ev, 8196 struct rpc_pipe_client *cli) 8197{ 8198 struct tevent_req *req; 8199 struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state; 8200 struct tevent_req *subreq; 8201 8202 req = tevent_req_create(mem_ctx, &state, 8203 struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state); 8204 if (req == NULL) { 8205 return NULL; 8206 } 8207 state->out_mem_ctx = NULL; 8208 state->dispatch_recv = cli->dispatch_recv; 8209 8210 /* In parameters */ 8211 8212 /* Out parameters */ 8213 8214 /* Result */ 8215 ZERO_STRUCT(state->orig.out.result); 8216 8217 /* make a temporary copy, that we pass to the dispatch function */ 8218 state->tmp = state->orig; 8219 8220 subreq = cli->dispatch_send(state, ev, cli, 8221 &ndr_table_srvsvc, 8222 NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, 8223 &state->tmp); 8224 if (tevent_req_nomem(subreq, req)) { 8225 return tevent_req_post(req, ev); 8226 } 8227 tevent_req_set_callback(subreq, rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done, req); 8228 return req; 8229} 8230 8231static void rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_done(struct tevent_req *subreq) 8232{ 8233 struct tevent_req *req = tevent_req_callback_data( 8234 subreq, struct tevent_req); 8235 struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state = tevent_req_data( 8236 req, struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state); 8237 NTSTATUS status; 8238 TALLOC_CTX *mem_ctx; 8239 8240 if (state->out_mem_ctx) { 8241 mem_ctx = state->out_mem_ctx; 8242 } else { 8243 mem_ctx = state; 8244 } 8245 8246 status = state->dispatch_recv(subreq, mem_ctx); 8247 TALLOC_FREE(subreq); 8248 if (!NT_STATUS_IS_OK(status)) { 8249 tevent_req_nterror(req, status); 8250 return; 8251 } 8252 8253 /* Copy out parameters */ 8254 8255 /* Copy result */ 8256 state->orig.out.result = state->tmp.out.result; 8257 8258 /* Reset temporary structure */ 8259 ZERO_STRUCT(state->tmp); 8260 8261 tevent_req_done(req); 8262} 8263 8264NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_recv(struct tevent_req *req, 8265 TALLOC_CTX *mem_ctx, 8266 WERROR *result) 8267{ 8268 struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state *state = tevent_req_data( 8269 req, struct rpccli_srvsvc_NETRSERVERTRANSPORTDELEX_state); 8270 NTSTATUS status; 8271 8272 if (tevent_req_is_nterror(req, &status)) { 8273 tevent_req_received(req); 8274 return status; 8275 } 8276 8277 /* Steal possbile out parameters to the callers context */ 8278 talloc_steal(mem_ctx, state->out_mem_ctx); 8279 8280 /* Return result */ 8281 *result = state->orig.out.result; 8282 8283 tevent_req_received(req); 8284 return NT_STATUS_OK; 8285} 8286 8287NTSTATUS rpccli_srvsvc_NETRSERVERTRANSPORTDELEX(struct rpc_pipe_client *cli, 8288 TALLOC_CTX *mem_ctx, 8289 WERROR *werror) 8290{ 8291 struct srvsvc_NETRSERVERTRANSPORTDELEX r; 8292 NTSTATUS status; 8293 8294 /* In parameters */ 8295 8296 status = cli->dispatch(cli, 8297 mem_ctx, 8298 &ndr_table_srvsvc, 8299 NDR_SRVSVC_NETRSERVERTRANSPORTDELEX, 8300 &r); 8301 8302 if (!NT_STATUS_IS_OK(status)) { 8303 return status; 8304 } 8305 8306 if (NT_STATUS_IS_ERR(status)) { 8307 return status; 8308 } 8309 8310 /* Return variables */ 8311 8312 /* Return result */ 8313 if (werror) { 8314 *werror = r.out.result; 8315 } 8316 8317 return werror_to_ntstatus(r.out.result); 8318} 8319 8320