Fix macros for next and opaque quota ops. Spotted by metze
[Samba/vl.git] / source3 / rpc_client / cli_ds.c
blobf0edeca00032cde87f78c9c886f17907263de42c
1 /*
2 Unix SMB/CIFS implementation.
3 RPC pipe client
4 Copyright (C) Gerald Carter 2002,
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "includes.h"
23 /* implementations of client side DsXXX() functions */
25 NTSTATUS cli_ds_getprimarydominfo(struct cli_state *cli, TALLOC_CTX *mem_ctx,
26 uint16 level, DS_DOMINFO_CTR *ctr)
28 prs_struct qbuf, rbuf;
29 DS_Q_GETPRIMDOMINFO q;
30 DS_R_GETPRIMDOMINFO r;
31 NTSTATUS result;
33 ZERO_STRUCT(q);
34 ZERO_STRUCT(r);
36 /* Initialise parse structures */
38 prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
39 prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
41 q.level = level;
43 if (!ds_io_q_getprimdominfo("", &q, &qbuf, 0)
44 || !rpc_api_pipe_req(cli, DS_GETPRIMDOMINFO, &qbuf, &rbuf)) {
45 result = NT_STATUS_UNSUCCESSFUL;
46 goto done;
49 /* Unmarshall response */
51 if (!ds_io_r_getprimdominfo("", &r, &rbuf, 0)) {
52 result = NT_STATUS_UNSUCCESSFUL;
53 goto done;
56 /* Return basic info - if we are requesting at info != 1 then
57 there could be trouble. */
59 result = r.status;
61 if (ctr) {
62 ctr->basic = talloc(mem_ctx, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC));
63 if (!ctr->basic)
64 goto done;
65 memcpy(ctr->basic, r.info.basic, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC));
68 done:
69 prs_mem_free(&qbuf);
70 prs_mem_free(&rbuf);
72 return result;