diff options
author | Günther Deschner <gd@samba.org> | 2009-02-09 01:33:00 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-02-09 12:34:02 +0100 |
commit | 1c0b19fef68e865238aef80ca0ef55f40417d5a6 (patch) | |
tree | 3c63889613bbd3fc25fd9c54d6402874ca92e9c6 /source3 | |
parent | bed65d86ac4df7af233b940a70df2b70d7c216fa (diff) | |
download | samba-1c0b19fef68e865238aef80ca0ef55f40417d5a6.tar.gz samba-1c0b19fef68e865238aef80ca0ef55f40417d5a6.tar.bz2 samba-1c0b19fef68e865238aef80ca0ef55f40417d5a6.zip |
s3-spoolss: use pidl for _spoolss_DeletePrinterKey.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_spoolss.c | 22 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 39 |
2 files changed, 15 insertions, 46 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c index 31ddba2737..96823cd923 100644 --- a/source3/rpc_server/srv_spoolss.c +++ b/source3/rpc_server/srv_spoolss.c @@ -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); } /**************************************************************************** diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index fbc9143ab8..118c2e0a92 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -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); @@ -10733,17 +10733,6 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p, } /**************************************************************** - _spoolss_DeletePrinterKey -****************************************************************/ - -WERROR _spoolss_DeletePrinterKey(pipes_struct *p, - struct spoolss_DeletePrinterKey *r) -{ - p->rng_fault_state = true; - return WERR_NOT_SUPPORTED; -} - -/**************************************************************** _spoolss_53 ****************************************************************/ |