summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-05-17 18:57:25 +0000
committerGerald Carter <jerry@samba.org>2001-05-17 18:57:25 +0000
commit013b454d1a2858b6f3b48e7b73f549ec7540d189 (patch)
tree5f7c5a9393c994a06c50bf69ca9177a94f30c513 /source3/libsmb
parent8910320b85a01f0994ae6cb99d3e460f92f5f93b (diff)
downloadsamba-013b454d1a2858b6f3b48e7b73f549ec7540d189.tar.gz
samba-013b454d1a2858b6f3b48e7b73f549ec7540d189.tar.bz2
samba-013b454d1a2858b6f3b48e7b73f549ec7540d189.zip
merge from 2.2 DeletePrinterDriver() server side stud coming
in separate commit after I get it working in 2.2. (This used to be commit 09506ac0e64b84d73e3b8fdd4942fa52dba6060f)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cli_spoolss.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/source3/libsmb/cli_spoolss.c b/source3/libsmb/cli_spoolss.c
index f68483dabe..4f8d6c0c88 100644
--- a/source3/libsmb/cli_spoolss.c
+++ b/source3/libsmb/cli_spoolss.c
@@ -1053,4 +1053,61 @@ done:
return result;
}
+/**********************************************************************
+ * Delete a Printer Driver from the server (does not remove
+ * the driver files
+ */
+uint32 cli_spoolss_deleteprinterdriver (
+ struct cli_state *cli,
+ TALLOC_CTX *mem_ctx,
+ char *arch,
+ char *driver
+)
+{
+ prs_struct qbuf, rbuf;
+ SPOOL_Q_DELETEPRINTERDRIVER q;
+ SPOOL_R_DELETEPRINTERDRIVER r;
+ uint32 result;
+ 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 (server);
+
+ /* write the request */
+ make_spoolss_q_deleteprinterdriver (mem_ctx, &q, server, arch, driver);
+
+ /* Marshall data and send request */
+ result = NT_STATUS_UNSUCCESSFUL;
+ if (!spoolss_io_q_deleteprinterdriver ("", &q, &qbuf, 0) ||
+ !rpc_api_pipe_req (cli,SPOOLSS_DELETEPRINTERDRIVER , &qbuf, &rbuf))
+ {
+ goto done;
+ }
+
+
+ /* Unmarshall response */
+ result = NT_STATUS_UNSUCCESSFUL;
+ if (!spoolss_io_r_deleteprinterdriver ("", &r, &rbuf, 0))
+ {
+ goto done;
+ }
+
+ /* Return output parameters */
+ result = r.status;
+
+done:
+ prs_mem_free(&qbuf);
+ prs_mem_free(&rbuf);
+
+ return result;
+}
+