summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-09-14 21:04:02 +0000
committerLuke Leighton <lkcl@samba.org>1999-09-14 21:04:02 +0000
commit6bf6b0ad44c72643699b282c9891113a933a3812 (patch)
treee07ce724832aae2af054e68a24fd7aaf0c556f80 /source3/rpc_client
parent827599cbb2a7cf76c4f148ff800a62b172c47d97 (diff)
downloadsamba-6bf6b0ad44c72643699b282c9891113a933a3812.tar.gz
samba-6bf6b0ad44c72643699b282c9891113a933a3812.tar.bz2
samba-6bf6b0ad44c72643699b282c9891113a933a3812.zip
added rpcclient SamrQueryDisplayInfo command "dispinfo"
(This used to be commit 6c98d6c9aae64016bfe7727cfe12762967eb5a84)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index e49ea268b9..389895fb58 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -2448,3 +2448,73 @@ BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
return valid_close;
}
+/****************************************************************************
+do a SAMR query display info
+****************************************************************************/
+BOOL samr_query_dispinfo(struct cli_state *cli, uint16 fnum,
+ POLICY_HND *pol_open_domain, uint16 level,
+ uint32 *num_entries,
+ SAM_DISPINFO_CTR *ctr)
+{
+ prs_struct data;
+ prs_struct rdata;
+
+ SAMR_Q_QUERY_DISPINFO q_o;
+ BOOL valid_query = False;
+
+ DEBUG(4,("SAMR Query Display Info. level: %d\n", level));
+
+ if (pol_open_domain == NULL || num_entries == NULL || ctr == NULL ||
+ level == 0)
+ {
+ return False;
+ }
+
+ /* create and send a MSRPC command with api SAMR_QUERY_DISPINFO */
+
+ prs_init(&data , 1024, 4, SAFETY_MARGIN, False);
+ prs_init(&rdata, 0 , 4, SAFETY_MARGIN, True );
+
+ /* store the parameters */
+ make_samr_q_query_dispinfo(&q_o, pol_open_domain, level, 0, 0xffffffff);
+
+ /* turn parameters into data stream */
+ samr_io_q_query_dispinfo("", &q_o, &data, 0);
+
+ /* send the data on \PIPE\ */
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_DISPINFO, &data, &rdata))
+ {
+ SAMR_R_QUERY_DISPINFO r_o;
+ BOOL p;
+
+ /* get user info */
+ r_o.ctr = ctr;
+
+ samr_io_r_query_dispinfo("", &r_o, &rdata, 0);
+ p = rdata.offset != 0;
+
+ if (p && r_o.status != 0)
+ {
+ /* report error code */
+ DEBUG(0,("SAMR_R_QUERY_DISPINFO: %s\n", get_nt_error_msg(r_o.status)));
+ p = False;
+ }
+
+ if (p && r_o.switch_level != level)
+ {
+ DEBUG(0,("SAMR_R_QUERY_DISPINFO: received incorrect level %d\n",
+ r_o.switch_level));
+ }
+
+ if (p && r_o.ptr_entries != 0)
+ {
+ valid_query = True;
+ }
+ }
+
+ prs_mem_free(&data );
+ prs_mem_free(&rdata );
+
+ return valid_query;
+}
+