summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-11-09 21:15:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:11 -0500
commit2d0f5486f085e0db4528fb3f72ca311c73c36b92 (patch)
treea6eb4c8a837b3398e052262aec765dc9bb59f794 /source3/rpc_client
parenta27837dac8240ef9d4f704540fe51ebbcb5b189f (diff)
downloadsamba-2d0f5486f085e0db4528fb3f72ca311c73c36b92.tar.gz
samba-2d0f5486f085e0db4528fb3f72ca311c73c36b92.tar.bz2
samba-2d0f5486f085e0db4528fb3f72ca311c73c36b92.zip
r3639: patch from Martin Zielinski <mz@seh.de> to add DeleteDriverEx() function to rpcclient
(This used to be commit cfd51c02447f7b42cffcaf4cc6179237d58c8229)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_spoolss.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 5303f83bf9..9a078e4720 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -1083,6 +1083,58 @@ WERROR cli_spoolss_addprinterex (struct cli_state *cli, TALLOC_CTX *mem_ctx,
return result;
}
+/**********************************************************************
+ * Delete a Printer Driver from the server (DOES remove
+ * the driver files)
+ */
+WERROR cli_spoolss_deleteprinterdriverex(struct cli_state *cli,
+ TALLOC_CTX *mem_ctx, const char *arch,
+ const char *driver)
+{
+ prs_struct qbuf, rbuf;
+ SPOOL_Q_DELETEPRINTERDRIVEREX q;
+ SPOOL_R_DELETEPRINTERDRIVEREX r;
+ WERROR result = W_ERROR(ERRgeneral);
+ fstring server;
+
+ ZERO_STRUCT(q);
+ ZERO_STRUCT(r);
+
+
+ /* Initialise input parameters */
+ prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
+ prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
+
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
+ strupper_m(server);
+
+ /* Write the request */
+ make_spoolss_q_deleteprinterdriverex(mem_ctx, &q, server, arch, driver);
+
+ /* Marshall data and send request */
+
+ if (!spoolss_io_q_deleteprinterdriverex ("", &q, &qbuf, 0)
+ || !rpc_api_pipe_req (cli,SPOOLSS_DELETEPRINTERDRIVEREX , &qbuf, &rbuf))
+ {
+ goto done;
+ }
+
+ /* Unmarshall response */
+
+ if (!spoolss_io_r_deleteprinterdriverex ("", &r, &rbuf, 0))
+ goto done;
+
+ /* Return output parameters */
+
+ result = r.status;
+
+done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
+
/*********************************************************************************
Win32 API - DeltePrinterDriver()
********************************************************************************/