summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 0063502cfc..cc2a35a5bb 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1694,6 +1694,7 @@ WERROR _spoolss_DeletePrinter(pipes_struct *p,
{
Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle);
WERROR result;
+ int snum;
if (Printer && Printer->document_started) {
struct spoolss_EndDocPrinter e;
@@ -1703,6 +1704,13 @@ WERROR _spoolss_DeletePrinter(pipes_struct *p,
_spoolss_EndDocPrinter(p, &e);
}
+ if (get_printer_snum(p, r->in.handle, &snum, NULL)) {
+ winreg_delete_printer_key(p->mem_ctx,
+ p->server_info,
+ lp_const_servicename(snum),
+ "");
+ }
+
result = delete_printer_handle(p, r->in.handle);
update_c_setprinter(false);