diff options
author | Günther Deschner <gd@samba.org> | 2009-02-09 01:11:18 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-02-09 12:34:01 +0100 |
commit | ce5b25aaa4b40c771352d997bf73b311b50bf058 (patch) | |
tree | 0f3cbd840145d591db06e588f88c0e44e9ed55ad /source3 | |
parent | 8f130d54799097f731fe39211dae2d2eb0f6df98 (diff) | |
download | samba-ce5b25aaa4b40c771352d997bf73b311b50bf058.tar.gz samba-ce5b25aaa4b40c771352d997bf73b311b50bf058.tar.bz2 samba-ce5b25aaa4b40c771352d997bf73b311b50bf058.zip |
s3-spoolss: use pidl for _spoolss_DeletePrinterDataEx.
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 | 43 |
2 files changed, 14 insertions, 51 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c index 8bfe645f1c..67ef90cfb5 100644 --- a/source3/rpc_server/srv_spoolss.c +++ b/source3/rpc_server/srv_spoolss.c @@ -1220,27 +1220,7 @@ static bool api_spoolss_getprintprocessordirectory(pipes_struct *p) static bool api_spoolss_deleteprinterdataex(pipes_struct *p) { - SPOOL_Q_DELETEPRINTERDATAEX q_u; - SPOOL_R_DELETEPRINTERDATAEX 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_deleteprinterdataex("", &q_u, data, 0)) { - DEBUG(0,("spoolss_io_q_deleteprinterdataex: unable to unmarshall SPOOL_Q_DELETEPRINTERDATAEX.\n")); - return False; - } - - r_u.status = _spoolss_deleteprinterdataex(p, &q_u, &r_u); - - if(!spoolss_io_r_deleteprinterdataex("", &r_u, rdata, 0)) { - DEBUG(0,("spoolss_io_r_deleteprinterdataex: unable to marshall SPOOL_R_DELETEPRINTERDATAEX.\n")); - return False; - } - - return True; + return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATAEX); } /**************************************************************************** diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 5a76b5d8f3..374a7f67d5 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -9365,29 +9365,24 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u, return status; } +/**************************************************************** + _spoolss_DeletePrinterDataEx +****************************************************************/ -/******************************************************************** - * spoolss_deleteprinterdataex - ********************************************************************/ - -WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX *q_u, SPOOL_R_DELETEPRINTERDATAEX *r_u) +WERROR _spoolss_DeletePrinterDataEx(pipes_struct *p, + struct spoolss_DeletePrinterDataEx *r) { - POLICY_HND *handle = &q_u->handle; - UNISTR2 *value = &q_u->valuename; - UNISTR2 *key = &q_u->keyname; - + POLICY_HND *handle = r->in.handle; NT_PRINTER_INFO_LEVEL *printer = NULL; int snum=0; WERROR status = WERR_OK; Printer_entry *Printer=find_printer_index_by_hnd(p, handle); - char *valuename = NULL; - char *keyname = NULL; - TALLOC_CTX *ctx = p->mem_ctx; - DEBUG(5,("spoolss_deleteprinterdataex\n")); + DEBUG(5,("_spoolss_DeletePrinterDataEx\n")); if (!Printer) { - DEBUG(2,("_spoolss_deleteprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); + DEBUG(2,("_spoolss_DeletePrinterDataEx: " + "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); return WERR_BADFID; } @@ -9395,13 +9390,12 @@ WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX return WERR_BADFID; if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) { - DEBUG(3, ("_spoolss_deleteprinterdataex: printer properties change denied by handle\n")); + DEBUG(3, ("_spoolss_DeletePrinterDataEx: " + "printer properties change denied by handle\n")); return WERR_ACCESS_DENIED; } - valuename = unistr2_to_ascii_talloc(ctx, value); - keyname = unistr2_to_ascii_talloc(ctx, key); - if (!valuename || !keyname) { + if (!r->in.value_name || !r->in.key_name) { return WERR_NOMEM; } @@ -9409,7 +9403,7 @@ WERROR _spoolss_deleteprinterdataex(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATAEX if (!W_ERROR_IS_OK(status)) return status; - status = delete_printer_dataex( printer, keyname, valuename ); + status = delete_printer_dataex( printer, r->in.key_name, r->in.value_name ); if ( W_ERROR_IS_OK(status) ) mod_a_printer( printer, 2 ); @@ -10752,17 +10746,6 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p, } /**************************************************************** - _spoolss_DeletePrinterDataEx -****************************************************************/ - -WERROR _spoolss_DeletePrinterDataEx(pipes_struct *p, - struct spoolss_DeletePrinterDataEx *r) -{ - p->rng_fault_state = true; - return WERR_NOT_SUPPORTED; -} - -/**************************************************************** _spoolss_DeletePrinterKey ****************************************************************/ |