summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-08-30 00:45:59 +0000
committerJeremy Allison <jra@samba.org>2000-08-30 00:45:59 +0000
commitd407579b94ee2647d1e51c536534024e5c4c51ad (patch)
treec4a3ae28143ea3bfc4fe11022455b3d85f94c321 /source3/rpc_server/srv_spoolss.c
parent3b33053b886b88bb7546f77dcdb038fcdc501c6c (diff)
downloadsamba-d407579b94ee2647d1e51c536534024e5c4c51ad.tar.gz
samba-d407579b94ee2647d1e51c536534024e5c4c51ad.tar.bz2
samba-d407579b94ee2647d1e51c536534024e5c4c51ad.zip
Implemented AbortPrinter() from Gerald's Win32 test code. Just purge all
possible printjobs from that printer (I think this is correct). Added error code returns for print_queue_XXX() functions. Jeremy. (This used to be commit 6d081a9017f87f59b7189ba507e211db01c40af5)
Diffstat (limited to 'source3/rpc_server/srv_spoolss.c')
-rwxr-xr-xsource3/rpc_server/srv_spoolss.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 5a1592e4fb..e6a0f3ae6d 100755
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -131,6 +131,36 @@ static BOOL api_spoolss_closeprinter(pipes_struct *p)
}
/********************************************************************
+ * api_spoolss_abortprinter
+ *
+ * called from the spoolss dispatcher
+ ********************************************************************/
+static BOOL api_spoolss_abortprinter(pipes_struct *p)
+{
+ SPOOL_Q_ABORTPRINTER q_u;
+ SPOOL_R_ABORTPRINTER r_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ ZERO_STRUCT(q_u);
+ ZERO_STRUCT(r_u);
+
+ if (!spoolss_io_q_abortprinter("", &q_u, data, 0)) {
+ DEBUG(0,("spoolss_io_q_abortprinter: unable to unmarshall SPOOL_Q_ABORTPRINTER.\n"));
+ return False;
+ }
+
+ r_u.status = _spoolss_abortprinter(&q_u.handle, p);
+
+ if (!spoolss_io_r_abortprinter("",&r_u,rdata,0)) {
+ DEBUG(0,("spoolss_io_r_abortprinter: unable to marshall SPOOL_R_ABORTPRINTER.\n"));
+ return False;
+ }
+
+ return True;
+}
+
+/********************************************************************
* api_spoolss_deleteprinter
*
* called from the spoolss dispatcher
@@ -1209,6 +1239,7 @@ struct api_struct api_spoolss_cmds[] =
{"SPOOLSS_GETPRINTERDATA", SPOOLSS_GETPRINTERDATA, api_spoolss_getprinterdata },
{"SPOOLSS_CLOSEPRINTER", SPOOLSS_CLOSEPRINTER, api_spoolss_closeprinter },
{"SPOOLSS_DELETEPRINTER", SPOOLSS_DELETEPRINTER, api_spoolss_deleteprinter },
+ {"SPOOLSS_ABORTPRINTER", SPOOLSS_ABORTPRINTER, api_spoolss_abortprinter },
{"SPOOLSS_RFFPCNEX", SPOOLSS_RFFPCNEX, api_spoolss_rffpcnex },
{"SPOOLSS_RFNPCNEX", SPOOLSS_RFNPCNEX, api_spoolss_rfnpcnex },
{"SPOOLSS_ENUMPRINTERS", SPOOLSS_ENUMPRINTERS, api_spoolss_enumprinters },