summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-11-15 01:27:44 +0100
committerGünther Deschner <gd@samba.org>2009-02-07 10:20:56 +0100
commit7f35c3be69bc86b9efd8cc91713a8747b7bad95f (patch)
treeb3eb00564d475129a893f3641dbe21214d4e0db8 /source3/rpc_server
parent2038da6897dcbdefbf3b596f049757b6c5e0761c (diff)
downloadsamba-7f35c3be69bc86b9efd8cc91713a8747b7bad95f.tar.gz
samba-7f35c3be69bc86b9efd8cc91713a8747b7bad95f.tar.bz2
samba-7f35c3be69bc86b9efd8cc91713a8747b7bad95f.zip
s3-spoolss: use pidl for _spoolss_WritePrinter.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss.c22
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c36
2 files changed, 15 insertions, 43 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 4e86e19687..dd8bf0d4dd 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -463,27 +463,7 @@ static bool api_spoolss_enddocprinter(pipes_struct *p)
static bool api_spoolss_writeprinter(pipes_struct *p)
{
- SPOOL_Q_WRITEPRINTER q_u;
- SPOOL_R_WRITEPRINTER 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_writeprinter("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_writeprinter: unable to unmarshall SPOOL_Q_WRITEPRINTER.\n"));
- return False;
- }
-
- r_u.status = _spoolss_writeprinter(p, &q_u, &r_u);
-
- if(!spoolss_io_r_writeprinter("",&r_u,rdata,0)) {
- DEBUG(0,("spoolss_io_r_writeprinter: unable to marshall SPOOL_R_WRITEPRINTER.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_WRITEPRINTER);
}
/****************************************************************************
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 97280c2827..fd1babe9f2 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5902,21 +5902,24 @@ WERROR _spoolss_EndDocPrinter(pipes_struct *p,
return _spoolss_enddocprinter_internal(p, handle);
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_WritePrinter
+****************************************************************/
-WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R_WRITEPRINTER *r_u)
+WERROR _spoolss_WritePrinter(pipes_struct *p,
+ struct spoolss_WritePrinter *r)
{
- POLICY_HND *handle = &q_u->handle;
- uint32 buffer_size = q_u->buffer_size;
- uint8 *buffer = q_u->buffer;
- uint32 *buffer_written = &q_u->buffer_size2;
+ POLICY_HND *handle = r->in.handle;
+ uint32 buffer_size = r->in._data_size;
+ uint8 *buffer = r->in.data.data;
+ uint32 *buffer_written = &r->in._data_size;
int snum;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
if (!Printer) {
- DEBUG(2,("_spoolss_writeprinter: Invalid handle (%s:%u:%u)\n",OUR_HANDLE(handle)));
- r_u->buffer_written = q_u->buffer_size2;
+ DEBUG(2,("_spoolss_WritePrinter: Invalid handle (%s:%u:%u)\n",
+ OUR_HANDLE(handle)));
+ *r->out.num_written = r->in._data_size;
return WERR_BADFID;
}
@@ -5926,14 +5929,14 @@ WERROR _spoolss_writeprinter(pipes_struct *p, SPOOL_Q_WRITEPRINTER *q_u, SPOOL_R
(*buffer_written) = (uint32)print_job_write(snum, Printer->jobid, (const char *)buffer,
(SMB_OFF_T)-1, (size_t)buffer_size);
if (*buffer_written == (uint32)-1) {
- r_u->buffer_written = 0;
+ *r->out.num_written = 0;
if (errno == ENOSPC)
return WERR_NO_SPOOL_SPACE;
else
return WERR_ACCESS_DENIED;
}
- r_u->buffer_written = q_u->buffer_size2;
+ *r->out.num_written = r->in._data_size;
return WERR_OK;
}
@@ -10140,17 +10143,6 @@ WERROR _spoolss_StartDocPrinter(pipes_struct *p,
}
/****************************************************************
- _spoolss_WritePrinter
-****************************************************************/
-
-WERROR _spoolss_WritePrinter(pipes_struct *p,
- struct spoolss_WritePrinter *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
_spoolss_ReadPrinter
****************************************************************/