summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-02 15:31:55 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-02 15:31:55 +0000
commit59fa2dbe2cb18762e14a86045c7ad403205a3841 (patch)
treea168c9c05ca68174f68f749f3a66e42a375026e4 /source3/rpc_server/srv_spoolss_nt.c
parent32d5416b6a777a7874fec8518ec44e750560d882 (diff)
downloadsamba-59fa2dbe2cb18762e14a86045c7ad403205a3841.tar.gz
samba-59fa2dbe2cb18762e14a86045c7ad403205a3841.tar.bz2
samba-59fa2dbe2cb18762e14a86045c7ad403205a3841.zip
added support for deleting printers into the spoolss system
(This used to be commit e72a5718537b84409fc20ff21951b1d1ab24d97f)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 6a0323f850..43f0c94987 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -201,6 +201,27 @@ static BOOL close_printer_handle(POLICY_HND *hnd)
}
/****************************************************************************
+ delete a printer given a handle
+****************************************************************************/
+static BOOL delete_printer_handle(POLICY_HND *hnd)
+{
+ Printer_entry *Printer = find_printer_index_by_hnd(hnd);
+
+ if (!OPEN_HANDLE(Printer))
+ {
+ DEBUG(3,("Error closing printer handle\n"));
+ return False;
+ }
+
+ if (del_a_printer(Printer->dev.printername) != 0) {
+ DEBUG(3,("Error deleting printer %s\n", Printer->dev.printername));
+ return False;
+ }
+
+ return True;
+}
+
+/****************************************************************************
return the snum of a printer corresponding to an handle
****************************************************************************/
static BOOL get_printer_snum(const POLICY_HND *hnd, int *number)
@@ -623,6 +644,17 @@ uint32 _spoolss_closeprinter(POLICY_HND *handle)
}
/********************************************************************
+ * api_spoolss_deleteprinter
+ ********************************************************************/
+uint32 _spoolss_deleteprinter(POLICY_HND *handle)
+{
+ if (!delete_printer_handle(handle))
+ return ERROR_INVALID_HANDLE;
+
+ return NT_STATUS_NO_PROBLEMO;
+}
+
+/********************************************************************
GetPrinterData on a printer server Handle.
********************************************************************/
static BOOL getprinterdata_printer_server(fstring value, uint32 *type, uint8 **data, uint32 *needed, uint32 in_size)