summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-09-03 03:18:19 +0000
committerTim Potter <tpot@samba.org>2002-09-03 03:18:19 +0000
commit70a132c2d94cc0d5df25b542360ea62156d10c9f (patch)
tree1b31fa46189c0009324614da73c94a25224141a2
parent62d6c7f8f836d46e423e4150b7fab1cd7bd61d63 (diff)
downloadsamba-70a132c2d94cc0d5df25b542360ea62156d10c9f.tar.gz
samba-70a132c2d94cc0d5df25b542360ea62156d10c9f.tar.bz2
samba-70a132c2d94cc0d5df25b542360ea62156d10c9f.zip
Change JOB_INFO_CTR to return a pointer to an array rather than array of pointers.
Implemented client function for deleteprinterdataex. (This used to be commit f7641c8fd1079c2ef444d4bca5b97b1285733d10)
-rw-r--r--source3/rpc_client/cli_spoolss.c51
1 files changed, 47 insertions, 4 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index d2492dc53b..bdd7407026 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -1552,11 +1552,11 @@ WERROR cli_spoolss_enumjobs(struct cli_state *cli, TALLOC_CTX *mem_ctx,
switch(level) {
case 1:
decode_jobs_1(mem_ctx, r.buffer, r.returned,
- ctr->job.job_info_1);
+ &ctr->job.job_info_1);
break;
case 2:
decode_jobs_2(mem_ctx, r.buffer, r.returned,
- ctr->job.job_info_2);
+ &ctr->job.job_info_2);
break;
default:
DEBUG(3, ("unsupported info level %d", level));
@@ -1665,10 +1665,10 @@ WERROR cli_spoolss_getjob(struct cli_state *cli, TALLOC_CTX *mem_ctx,
switch(level) {
case 1:
- decode_jobs_1(mem_ctx, r.buffer, 1, ctr->job.job_info_1);
+ decode_jobs_1(mem_ctx, r.buffer, 1, &ctr->job.job_info_1);
break;
case 2:
- decode_jobs_2(mem_ctx, r.buffer, 1, ctr->job.job_info_2);
+ decode_jobs_2(mem_ctx, r.buffer, 1, &ctr->job.job_info_2);
break;
default:
DEBUG(3, ("unsupported info level %d", level));
@@ -2326,4 +2326,47 @@ WERROR cli_spoolss_deleteprinterdata(struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+WERROR cli_spoolss_deleteprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ POLICY_HND *hnd, char *key, char *value)
+{
+ prs_struct qbuf, rbuf;
+ SPOOL_Q_DELETEPRINTERDATAEX q;
+ SPOOL_R_DELETEPRINTERDATAEX r;
+ WERROR result = W_ERROR(ERRgeneral);
+
+ ZERO_STRUCT(q);
+ ZERO_STRUCT(r);
+
+ /* Initialise parse structures */
+
+ prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
+ prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
+
+ /* Initialise input parameters */
+
+ make_spoolss_q_deleteprinterdataex(&q, hnd, key, value);
+
+ /* Marshall data and send request */
+
+ if (!spoolss_io_q_deleteprinterdataex("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, SPOOLSS_DELETEPRINTERDATAEX, &qbuf, &rbuf))
+ goto done;
+
+ /* Unmarshall response */
+
+ if (!spoolss_io_r_deleteprinterdataex("", &r, &rbuf, 0))
+ goto done;
+
+ result = r.status;
+
+ if (!W_ERROR_IS_OK(r.status))
+ goto done;
+
+ done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
+
/** @} **/