]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-spoolss: use pidl for _spoolss_DeletePrinterKey.
authorGünther Deschner <gd@samba.org>
Mon, 9 Feb 2009 00:33:00 +0000 (01:33 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 9 Feb 2009 11:34:02 +0000 (12:34 +0100)
Guenther

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

index 31ddba273767f2afa08ac497f69fa8b11e326e94..96823cd923011942064cbc5e820bf87a4851d4c6 100644 (file)
@@ -1207,27 +1207,7 @@ static bool api_spoolss_deleteprinterdataex(pipes_struct *p)
 
 static bool api_spoolss_deleteprinterkey(pipes_struct *p)
 {
-       SPOOL_Q_DELETEPRINTERKEY q_u;
-       SPOOL_R_DELETEPRINTERKEY 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_deleteprinterkey("", &q_u, data, 0)) {
-               DEBUG(0,("spoolss_io_q_deleteprinterkey: unable to unmarshall SPOOL_Q_DELETEPRINTERKEY.\n"));
-               return False;
-       }
-       
-       r_u.status = _spoolss_deleteprinterkey(p, &q_u, &r_u);
-                               
-       if(!spoolss_io_r_deleteprinterkey("", &r_u, rdata, 0)) {
-               DEBUG(0,("spoolss_io_r_deleteprinterkey: unable to marshall SPOOL_R_DELETEPRINTERKEY.\n"));
-               return False;
-       }
-       
-       return True;
+       return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERKEY);
 }
 
 /****************************************************************************
index fbc9143ab811df5cd111a46fd874b85bd92a5035..118c2e0a922ac10bf4cca002f898535433c2b30c 100644 (file)
@@ -9483,36 +9483,38 @@ done:
         return status;
 }
 
-/********************************************************************
* spoolss_deleteprinterkey
- ********************************************************************/
+/****************************************************************
_spoolss_DeletePrinterKey
+****************************************************************/
 
-WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u, SPOOL_R_DELETEPRINTERKEY *r_u)
+WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
+                                struct spoolss_DeletePrinterKey *r)
 {
-       POLICY_HND              *handle = &q_u->handle;
-       Printer_entry           *Printer = find_printer_index_by_hnd(p, &q_u->handle);
-       fstring                 key;
+       POLICY_HND              *handle = r->in.handle;
+       Printer_entry           *Printer = find_printer_index_by_hnd(p, handle);
        NT_PRINTER_INFO_LEVEL   *printer = NULL;
        int                     snum=0;
        WERROR                  status;
 
-       DEBUG(5,("spoolss_deleteprinterkey\n"));
+       DEBUG(5,("_spoolss_DeletePrinterKey\n"));
 
        if (!Printer) {
-               DEBUG(2,("_spoolss_deleteprinterkey: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+               DEBUG(2,("_spoolss_DeletePrinterKey: Invalid handle (%s:%u:%u).\n",
+                       OUR_HANDLE(handle)));
                return WERR_BADFID;
        }
 
        /* if keyname == NULL, return error */
 
-       if ( !q_u->keyname.buffer )
+       if ( !r->in.key_name )
                return WERR_INVALID_PARAM;
 
        if (!get_printer_snum(p, handle, &snum, NULL))
                return WERR_BADFID;
 
        if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
-               DEBUG(3, ("_spoolss_deleteprinterkey: printer properties change denied by handle\n"));
+               DEBUG(3, ("_spoolss_DeletePrinterKey: "
+                       "printer properties change denied by handle\n"));
                return WERR_ACCESS_DENIED;
        }
 
@@ -9522,9 +9524,7 @@ WERROR _spoolss_deleteprinterkey(pipes_struct *p, SPOOL_Q_DELETEPRINTERKEY *q_u,
 
        /* delete the key and all subneys */
 
-        unistr2_to_ascii(key, &q_u->keyname, sizeof(key));
-
-       status = delete_all_printer_data( printer->info_2, key );
+       status = delete_all_printer_data( printer->info_2, r->in.key_name );
 
        if ( W_ERROR_IS_OK(status) )
                status = mod_a_printer(printer, 2);
@@ -10732,17 +10732,6 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
        return WERR_NOT_SUPPORTED;
 }
 
-/****************************************************************
- _spoolss_DeletePrinterKey
-****************************************************************/
-
-WERROR _spoolss_DeletePrinterKey(pipes_struct *p,
-                                struct spoolss_DeletePrinterKey *r)
-{
-       p->rng_fault_state = true;
-       return WERR_NOT_SUPPORTED;
-}
-
 /****************************************************************
  _spoolss_53
 ****************************************************************/