2 Unix SMB/CIFS implementation.
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.
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
;
36 /* Initialise parse structures */
38 prs_init(&qbuf
, MAX_PDU_FRAG_LEN
, mem_ctx
, MARSHALL
);
39 prs_init(&rbuf
, 0, mem_ctx
, UNMARSHALL
);
43 if (!ds_io_q_getprimdominfo("", &q
, &qbuf
, 0)
44 || !rpc_api_pipe_req(cli
, DS_GETPRIMDOMINFO
, &qbuf
, &rbuf
)) {
45 result
= NT_STATUS_UNSUCCESSFUL
;
49 /* Unmarshall response */
51 if (!ds_io_r_getprimdominfo("", &r
, &rbuf
, 0)) {
52 result
= NT_STATUS_UNSUCCESSFUL
;
56 /* Return basic info - if we are requesting at info != 1 then
57 there could be trouble. */
62 ctr
->basic
= talloc(mem_ctx
, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC
));
65 memcpy(ctr
->basic
, r
.info
.basic
, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC
));