summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-05-14 07:21:57 +0000
committerTim Potter <tpot@samba.org>2002-05-14 07:21:57 +0000
commitaf451af22f745d56bb92f0dbdd270f7fd024ef0d (patch)
tree895863623219babc8ba74f41d8cd6827ee94ebb5 /source3/libsmb
parent8ca814e5299afccd1e2c5aea222c23d84905fc02 (diff)
downloadsamba-af451af22f745d56bb92f0dbdd270f7fd024ef0d.tar.gz
samba-af451af22f745d56bb92f0dbdd270f7fd024ef0d.tar.bz2
samba-af451af22f745d56bb92f0dbdd270f7fd024ef0d.zip
Added deleteprinterdata client rpc.
(This used to be commit 217ae50acd8cf088e268e7d2a6a7c192aca9e2f1)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cli_spoolss.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/libsmb/cli_spoolss.c b/source3/libsmb/cli_spoolss.c
index 575817fb37..754b7b20a5 100644
--- a/source3/libsmb/cli_spoolss.c
+++ b/source3/libsmb/cli_spoolss.c
@@ -2122,4 +2122,49 @@ WERROR cli_spoolss_writeprinter(struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+/* Delete printer data */
+
+WERROR cli_spoolss_deleteprinterdata(struct cli_state *cli, TALLOC_CTX *mem_ctx,
+ POLICY_HND *hnd, char *valuename)
+{
+ prs_struct qbuf, rbuf;
+ SPOOL_Q_DELETEPRINTERDATA q;
+ SPOOL_R_DELETEPRINTERDATA 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_deleteprinterdata(&q, hnd, valuename);
+
+ /* Marshall data and send request */
+
+ if (!spoolss_io_q_deleteprinterdata("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req(cli, SPOOLSS_DELETEPRINTERDATA, &qbuf, &rbuf))
+ goto done;
+
+ /* Unmarshall response */
+
+ if (!spoolss_io_r_deleteprinterdata("", &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;
+}
+
/** @} **/