summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_samr.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-09-18 19:18:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:52:00 -0500
commita812e2d7db1294950e05977d5000f3d9889aefb6 (patch)
treed2df8969f816e229fe1727236829c0e69394a7bf /source3/rpc_client/cli_samr.c
parent8dd826f50026f29cf1175ce56111c4832f2d4809 (diff)
downloadsamba-a812e2d7db1294950e05977d5000f3d9889aefb6.tar.gz
samba-a812e2d7db1294950e05977d5000f3d9889aefb6.tar.bz2
samba-a812e2d7db1294950e05977d5000f3d9889aefb6.zip
r18619: Add rpcclient helper for samr_querydispinfo2|3 for testing.
Guenther (This used to be commit 1a307954e5ddc1441524eb6d22258be387cca9d4)
Diffstat (limited to 'source3/rpc_client/cli_samr.c')
-rw-r--r--source3/rpc_client/cli_samr.c104
1 files changed, 104 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index a1e226dee6..7f3bd8f90a 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -1473,6 +1473,110 @@ NTSTATUS rpccli_samr_query_dispinfo(struct rpc_pipe_client *cli,
return result;
}
+
+/* Query display info2 */
+
+NTSTATUS rpccli_samr_query_dispinfo2(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ POLICY_HND *domain_pol, uint32 *start_idx,
+ uint16 switch_value, uint32 *num_entries,
+ uint32 max_entries, uint32 max_size,
+ SAM_DISPINFO_CTR *ctr)
+{
+ prs_struct qbuf, rbuf;
+ SAMR_Q_QUERY_DISPINFO q;
+ SAMR_R_QUERY_DISPINFO r;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ DEBUG(10,("cli_samr_query_dispinfo2 for start_idx = %u\n", *start_idx));
+
+ ZERO_STRUCT(q);
+ ZERO_STRUCT(r);
+
+ *num_entries = 0;
+
+ /* Marshall data and send request */
+
+ init_samr_q_query_dispinfo(&q, domain_pol, switch_value,
+ *start_idx, max_entries, max_size);
+
+ r.ctr = ctr;
+
+ CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_QUERY_DISPINFO2,
+ q, r,
+ qbuf, rbuf,
+ samr_io_q_query_dispinfo,
+ samr_io_r_query_dispinfo,
+ NT_STATUS_UNSUCCESSFUL);
+
+ /* Return output parameters */
+
+ result = r.status;
+
+ if (!NT_STATUS_IS_OK(result) &&
+ NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
+ goto done;
+ }
+
+ *num_entries = r.num_entries;
+ *start_idx += r.num_entries; /* No next_idx in this structure! */
+
+ done:
+ return result;
+}
+
+/* Query display info */
+
+NTSTATUS rpccli_samr_query_dispinfo3(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ POLICY_HND *domain_pol, uint32 *start_idx,
+ uint16 switch_value, uint32 *num_entries,
+ uint32 max_entries, uint32 max_size,
+ SAM_DISPINFO_CTR *ctr)
+{
+ prs_struct qbuf, rbuf;
+ SAMR_Q_QUERY_DISPINFO q;
+ SAMR_R_QUERY_DISPINFO r;
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+ DEBUG(10,("cli_samr_query_dispinfo3 for start_idx = %u\n", *start_idx));
+
+ ZERO_STRUCT(q);
+ ZERO_STRUCT(r);
+
+ *num_entries = 0;
+
+ /* Marshall data and send request */
+
+ init_samr_q_query_dispinfo(&q, domain_pol, switch_value,
+ *start_idx, max_entries, max_size);
+
+ r.ctr = ctr;
+
+ CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_QUERY_DISPINFO3,
+ q, r,
+ qbuf, rbuf,
+ samr_io_q_query_dispinfo,
+ samr_io_r_query_dispinfo,
+ NT_STATUS_UNSUCCESSFUL);
+
+ /* Return output parameters */
+
+ result = r.status;
+
+ if (!NT_STATUS_IS_OK(result) &&
+ NT_STATUS_V(result) != NT_STATUS_V(STATUS_MORE_ENTRIES)) {
+ goto done;
+ }
+
+ *num_entries = r.num_entries;
+ *start_idx += r.num_entries; /* No next_idx in this structure! */
+
+ done:
+ return result;
+}
+
+
/* Lookup rids. Note that NT4 seems to crash if more than ~1000 rids are
looked up in one packet. */