summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-09 01:17:57 +0100
committerGünther Deschner <gd@samba.org>2009-02-09 12:34:02 +0100
commit27acd8744554ad7b1e43f31136b7949c23bb27a4 (patch)
tree3d17781e354378c48a9b229602732ffd6aff16cb /source3
parentfe6d62fb9fcfb7ee47dc3a2d09f73dfcefdb0bc4 (diff)
downloadsamba-27acd8744554ad7b1e43f31136b7949c23bb27a4.tar.gz
samba-27acd8744554ad7b1e43f31136b7949c23bb27a4.tar.bz2
samba-27acd8744554ad7b1e43f31136b7949c23bb27a4.zip
s3-spoolss: use pidl for _spoolss_DeletePrinterData.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss.c23
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c41
2 files changed, 15 insertions, 49 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 67ef90cfb5..31ddba2737 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -147,28 +147,7 @@ static bool api_spoolss_getprinterdata(pipes_struct *p)
static bool api_spoolss_deleteprinterdata(pipes_struct *p)
{
- SPOOL_Q_DELETEPRINTERDATA q_u;
- SPOOL_R_DELETEPRINTERDATA r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* read the stream and fill the struct */
- if (!spoolss_io_q_deleteprinterdata("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_deleteprinterdata: unable to unmarshall SPOOL_Q_DELETEPRINTERDATA.\n"));
- return False;
- }
-
- r_u.status = _spoolss_deleteprinterdata( p, &q_u, &r_u );
-
- if (!spoolss_io_r_deleteprinterdata("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_deleteprinterdata: unable to marshall SPOOL_R_DELETEPRINTERDATA.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_DELETEPRINTERDATA);
}
/********************************************************************
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 374a7f67d5..fbc9143ab8 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8420,26 +8420,24 @@ WERROR _spoolss_resetprinter(pipes_struct *p, SPOOL_Q_RESETPRINTER *q_u, SPOOL_R
return WERR_OK;
}
+/****************************************************************
+ _spoolss_DeletePrinterData
+****************************************************************/
-/****************************************************************************
-****************************************************************************/
-
-WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_u, SPOOL_R_DELETEPRINTERDATA *r_u)
+WERROR _spoolss_DeletePrinterData(pipes_struct *p,
+ struct spoolss_DeletePrinterData *r)
{
- POLICY_HND *handle = &q_u->handle;
- UNISTR2 *value = &q_u->valuename;
-
+ 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;
- TALLOC_CTX *ctx = p->mem_ctx;
- DEBUG(5,("spoolss_deleteprinterdata\n"));
+ DEBUG(5,("_spoolss_DeletePrinterData\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_deleteprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_DeletePrinterData: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8447,7 +8445,8 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_
return WERR_BADFID;
if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) {
- DEBUG(3, ("_spoolss_deleteprinterdata: printer properties change denied by handle\n"));
+ DEBUG(3, ("_spoolss_DeletePrinterData: "
+ "printer properties change denied by handle\n"));
return WERR_ACCESS_DENIED;
}
@@ -8455,19 +8454,18 @@ WERROR _spoolss_deleteprinterdata(pipes_struct *p, SPOOL_Q_DELETEPRINTERDATA *q_
if (!W_ERROR_IS_OK(status))
return status;
- valuename = unistr2_to_ascii_talloc(ctx, value);
- if (!valuename) {
+ if (!r->in.value_name) {
free_a_printer(&printer, 2);
return WERR_NOMEM;
}
- status = delete_printer_dataex( printer, SPOOL_PRINTERDATA_KEY, valuename );
+ status = delete_printer_dataex( printer, SPOOL_PRINTERDATA_KEY,
+ r->in.value_name );
if ( W_ERROR_IS_OK(status) )
mod_a_printer( printer, 2 );
free_a_printer(&printer, 2);
- TALLOC_FREE(valuename);
return status;
}
@@ -10658,17 +10656,6 @@ WERROR _spoolss_EnumPrinterData(pipes_struct *p,
}
/****************************************************************
- _spoolss_DeletePrinterData
-****************************************************************/
-
-WERROR _spoolss_DeletePrinterData(pipes_struct *p,
- struct spoolss_DeletePrinterData *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
_spoolss_4a
****************************************************************/