diff options
author | Günther Deschner <gd@samba.org> | 2006-10-16 23:42:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:31 -0500 |
commit | dbcb4b12669fee8726b1b9a194ac508afd5f237a (patch) | |
tree | 9f21e8204e519723213f87c0bcf71d170872f896 /source3/rpc_client | |
parent | 8b31fccafe3bdae9407d69c0fa5061cfa6ffda3f (diff) | |
download | samba-dbcb4b12669fee8726b1b9a194ac508afd5f237a.tar.gz samba-dbcb4b12669fee8726b1b9a194ac508afd5f237a.tar.bz2 samba-dbcb4b12669fee8726b1b9a194ac508afd5f237a.zip |
r19355: Add getdispenumindex2 wrapper for rpcclient.
Guenther
(This used to be commit 27c35848ebc6d72fd4fccbb6597b63787230f80c)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_samr.c | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index fceafeca85..7a4d9fd58a 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -1459,7 +1459,7 @@ NTSTATUS rpccli_samr_query_dispinfo(struct rpc_pipe_client *cli, /* Return output parameters */ - result = r.status; + result = r.status; if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) { @@ -1511,7 +1511,7 @@ NTSTATUS rpccli_samr_query_dispinfo2(struct rpc_pipe_client *cli, /* Return output parameters */ - result = r.status; + result = r.status; if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) { @@ -1562,7 +1562,7 @@ NTSTATUS rpccli_samr_query_dispinfo3(struct rpc_pipe_client *cli, /* Return output parameters */ - result = r.status; + result = r.status; if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) { @@ -1610,9 +1610,50 @@ NTSTATUS rpccli_samr_get_dispenum_index(struct rpc_pipe_client *cli, *idx = 0; - result = r.status; + result = r.status; - if (NT_STATUS_IS_OK(result)) { + if (!NT_STATUS_IS_ERR(result)) { + *idx = r.idx; + } + + return result; +} + +NTSTATUS rpccli_samr_get_dispenum_index2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + POLICY_HND *domain_pol, + uint16 switch_value, + const char *name, + uint32 *idx) +{ + prs_struct qbuf, rbuf; + SAMR_Q_GET_DISPENUM_INDEX q; + SAMR_R_GET_DISPENUM_INDEX r; + NTSTATUS result = NT_STATUS_UNSUCCESSFUL; + + DEBUG(10,("cli_samr_get_dispenum_index2 for name = %s\n", name)); + + ZERO_STRUCT(q); + ZERO_STRUCT(r); + + /* Marshall data and send request */ + + init_samr_q_get_dispenum_index(&q, domain_pol, switch_value, name); + + CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_GET_DISPENUM_INDEX2, + q, r, + qbuf, rbuf, + samr_io_q_get_dispenum_index, + samr_io_r_get_dispenum_index, + NT_STATUS_UNSUCCESSFUL); + + /* Return output parameters */ + + *idx = 0; + + result = r.status; + + if (!NT_STATUS_IS_ERR(result)) { *idx = r.idx; } |