s3-spoolss: use pidl for _spoolss_ClosePrinter.
authorGünther Deschner <gd@samba.org>
Fri, 14 Nov 2008 22:36:11 +0000 (23:36 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 6 Feb 2009 17:55:46 +0000 (18:55 +0100)
Guenther

source3/rpc_server/srv_spoolss.c
source3/rpc_server/srv_spoolss_nt.c

index c34fd8f2a1f85757c8420d82e0f62f6440860142..1f2534293a5527f89531707c41755aabf3738052 100644 (file)
@@ -179,27 +179,7 @@ static bool api_spoolss_deleteprinterdata(pipes_struct *p)
 
 static bool api_spoolss_closeprinter(pipes_struct *p)
 {
-       SPOOL_Q_CLOSEPRINTER q_u;
-       SPOOL_R_CLOSEPRINTER 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_closeprinter("", &q_u, data, 0)) {
-               DEBUG(0,("spoolss_io_q_closeprinter: unable to unmarshall SPOOL_Q_CLOSEPRINTER.\n"));
-               return False;
-       }
-
-       r_u.status = _spoolss_closeprinter(p, &q_u, &r_u);
-
-       if (!spoolss_io_r_closeprinter("",&r_u,rdata,0)) {
-               DEBUG(0,("spoolss_io_r_closeprinter: unable to marshall SPOOL_R_CLOSEPRINTER.\n"));
-               return False;
-       }
-
-       return True;
+       return proxy_spoolss_call(p, NDR_SPOOLSS_CLOSEPRINTER);
 }
 
 /********************************************************************
index 9836e4ea72a45778d6ac9bfb60e88aecb5883c72..e5e41065c29c56445498460871e06010da85f299 100644 (file)
@@ -1913,13 +1913,14 @@ static WERROR _spoolss_enddocprinter_internal(pipes_struct *p, POLICY_HND *handl
        return WERR_OK;
 }
 
-/********************************************************************
* api_spoolss_closeprinter
- ********************************************************************/
+/****************************************************************
_spoolss_ClosePrinter
+****************************************************************/
 
-WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R_CLOSEPRINTER *r_u)
+WERROR _spoolss_ClosePrinter(pipes_struct *p,
+                            struct spoolss_ClosePrinter *r)
 {
-       POLICY_HND *handle = &q_u->handle;
+       POLICY_HND *handle = r->in.handle;
 
        Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
 
@@ -1934,7 +1935,7 @@ WERROR _spoolss_closeprinter(pipes_struct *p, SPOOL_Q_CLOSEPRINTER *q_u, SPOOL_R
           Previous code just copied the value of the closed
           handle.    --jerry */
 
-       memset(&r_u->handle, '\0', sizeof(r_u->handle));
+       ZERO_STRUCTP(r->out.handle);
 
        return WERR_OK;
 }
@@ -10260,17 +10261,6 @@ WERROR _spoolss_WaitForPrinterChange(pipes_struct *p,
        return WERR_NOT_SUPPORTED;
 }
 
-/****************************************************************
- _spoolss_ClosePrinter
-****************************************************************/
-
-WERROR _spoolss_ClosePrinter(pipes_struct *p,
-                            struct spoolss_ClosePrinter *r)
-{
-       p->rng_fault_state = true;
-       return WERR_NOT_SUPPORTED;
-}
-
 /****************************************************************
  _spoolss_AddForm
 ****************************************************************/