s3-spoolss: use pidl for _spoolss_DeleteForm.
authorGünther Deschner <gd@samba.org>
Mon, 17 Nov 2008 09:56:32 +0000 (10:56 +0100)
committerGünther Deschner <gd@samba.org>
Sat, 7 Feb 2009 00:52:29 +0000 (01:52 +0100)
Guenther

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

index 0e4e73b27d3ccc3d7092358bd1715456636ac6c3..4e86e196876266a2b2a99d7b67a0b237c0f85a67 100644 (file)
@@ -975,27 +975,7 @@ static bool api_spoolss_addform(pipes_struct *p)
 
 static bool api_spoolss_deleteform(pipes_struct *p)
 {
-       SPOOL_Q_DELETEFORM q_u;
-       SPOOL_R_DELETEFORM 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_deleteform("", &q_u, data, 0)) {
-               DEBUG(0,("spoolss_io_q_deleteform: unable to unmarshall SPOOL_Q_DELETEFORM.\n"));
-               return False;
-       }
-       
-       r_u.status = _spoolss_deleteform(p, &q_u, &r_u);
-       
-       if(!spoolss_io_r_deleteform("", &r_u, rdata, 0)) {
-               DEBUG(0,("spoolss_io_r_deleteform: unable to marshall SPOOL_R_DELETEFORM.\n"));
-               return False;
-       }
-
-       return True;
+       return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEFORM);
 }
 
 /****************************************************************************
index 48775a8df54dfb8992961fbfff6e6566728f6084..2643fe61edf9f6bbcfdd9c7a9612ad0d131a67b8 100644 (file)
@@ -8519,13 +8519,15 @@ done:
        return status;
 }
 
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_DeleteForm
+****************************************************************/
 
-WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DELETEFORM *r_u)
+WERROR _spoolss_DeleteForm(pipes_struct *p,
+                          struct spoolss_DeleteForm *r)
 {
-       POLICY_HND *handle = &q_u->handle;
-       UNISTR2 *form_name = &q_u->name;
+       POLICY_HND *handle = r->in.handle;
+       const char *form_name = r->in.form_name;
        nt_forms_struct tmpForm;
        int count=0;
        nt_forms_struct *list=NULL;
@@ -8534,10 +8536,11 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
        WERROR status = WERR_OK;
        NT_PRINTER_INFO_LEVEL *printer = NULL;
 
-       DEBUG(5,("spoolss_deleteform\n"));
+       DEBUG(5,("_spoolss_DeleteForm\n"));
 
        if (!Printer) {
-               DEBUG(2,("_spoolss_deleteform: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+               DEBUG(2,("_spoolss_DeleteForm: Invalid handle (%s:%u:%u).\n",
+                       OUR_HANDLE(handle)));
                return WERR_BADFID;
        }
 
@@ -8554,21 +8557,21 @@ WERROR _spoolss_deleteform( pipes_struct *p, SPOOL_Q_DELETEFORM *q_u, SPOOL_R_DE
        }
 
        if ( !(Printer->access_granted & (PRINTER_ACCESS_ADMINISTER|SERVER_ACCESS_ADMINISTER)) ) {
-               DEBUG(2,("_spoolss_deleteform: denied by handle permissions.\n"));
+               DEBUG(2,("_spoolss_DeleteForm: denied by handle permissions.\n"));
                status = WERR_ACCESS_DENIED;
                goto done;
        }
 
        /* can't delete if builtin */
 
-       if (get_a_builtin_ntform(form_name,&tmpForm)) {
+       if (get_a_builtin_ntform_by_string(form_name,&tmpForm)) {
                status = WERR_INVALID_PARAM;
                goto done;
        }
 
        count = get_ntforms(&list);
 
-       if ( !delete_a_form(&list, form_name, &count, &status ))
+       if ( !delete_a_form_by_string(&list, form_name, &count, &status ))
                goto done;
 
        /*
@@ -10221,17 +10224,6 @@ WERROR _spoolss_AddForm(pipes_struct *p,
        return WERR_NOT_SUPPORTED;
 }
 
-/****************************************************************
- _spoolss_DeleteForm
-****************************************************************/
-
-WERROR _spoolss_DeleteForm(pipes_struct *p,
-                          struct spoolss_DeleteForm *r)
-{
-       p->rng_fault_state = true;
-       return WERR_NOT_SUPPORTED;
-}
-
 /****************************************************************
  _spoolss_GetForm
 ****************************************************************/