summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-10 23:35:19 +0100
committerGünther Deschner <gd@samba.org>2009-02-14 01:42:01 +0100
commitfbcccbc410ce23eb0f78f47fe5c7ee4a64e78a0c (patch)
tree2f4fb92dc0a0661a38abdaa3be863b4a88213f0e /source3
parent9992827838d2f02226d91eaf67d68d2aa5adf265 (diff)
downloadsamba-fbcccbc410ce23eb0f78f47fe5c7ee4a64e78a0c.tar.gz
samba-fbcccbc410ce23eb0f78f47fe5c7ee4a64e78a0c.tar.bz2
samba-fbcccbc410ce23eb0f78f47fe5c7ee4a64e78a0c.zip
s3-spoolss: use pidl for _spoolss_AddPrinterEx.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/rpc_server/srv_spoolss.c22
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c72
3 files changed, 31 insertions, 64 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ed2c50af2f..9f3c04e649 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6251,7 +6251,6 @@ WERROR _spoolss_enumprinterdrivers( pipes_struct *p, SPOOL_Q_ENUMPRINTERDRIVERS
WERROR _spoolss_enumforms(pipes_struct *p, SPOOL_Q_ENUMFORMS *q_u, SPOOL_R_ENUMFORMS *r_u);
WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines );
WERROR _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUMPORTS *r_u);
-WERROR _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u);
WERROR _spoolss_addprinterdriver(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVER *q_u, SPOOL_R_ADDPRINTERDRIVER *r_u);
WERROR _spoolss_addprinterdriverex(pipes_struct *p, SPOOL_Q_ADDPRINTERDRIVEREX *q_u, SPOOL_R_ADDPRINTERDRIVEREX *r_u);
WERROR _spoolss_getprinterdriverdirectory(pipes_struct *p, SPOOL_Q_GETPRINTERDRIVERDIR *q_u, SPOOL_R_GETPRINTERDRIVERDIR *r_u);
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 68b7c3c4b9..02b3220367 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -550,27 +550,7 @@ static bool api_spoolss_enumports(pipes_struct *p)
static bool api_spoolss_addprinterex(pipes_struct *p)
{
- SPOOL_Q_ADDPRINTEREX q_u;
- SPOOL_R_ADDPRINTEREX 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_addprinterex("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_addprinterex: unable to unmarshall SPOOL_Q_ADDPRINTEREX.\n"));
- return False;
- }
-
- r_u.status = _spoolss_addprinterex(p, &q_u, &r_u);
-
- if(!spoolss_io_r_addprinterex("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_addprinterex: unable to marshall SPOOL_R_ADDPRINTEREX.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_ADDPRINTEREX);
}
/****************************************************************************
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index aec5e66a15..aeedf099d6 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7781,11 +7781,13 @@ WERROR _spoolss_enumports( pipes_struct *p, SPOOL_Q_ENUMPORTS *q_u, SPOOL_R_ENUM
/****************************************************************************
****************************************************************************/
-static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_srv_name,
- const SPOOL_PRINTER_INFO_LEVEL *info,
- DEVICEMODE *devmode, SEC_DESC_BUF *sec_desc_buf,
- uint32 user_switch, const SPOOL_USER_CTR *user,
- POLICY_HND *handle)
+static WERROR spoolss_addprinterex_level_2(pipes_struct *p,
+ const char *server,
+ struct spoolss_SetPrinterInfoCtr *info_ctr,
+ struct spoolss_DeviceMode *devmode,
+ struct security_descriptor *sec_desc,
+ struct spoolss_UserLevelCtr *user_ctr,
+ POLICY_HND *handle)
{
NT_PRINTER_INFO_LEVEL *printer = NULL;
fstring name;
@@ -7798,7 +7800,7 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
}
/* convert from UNICODE to ASCII - this allocates the info_2 struct inside *printer.*/
- if (!convert_printer_info(info, printer, 2)) {
+ if (!convert_printer_info_new(info_ctr, printer)) {
free_a_printer(&printer, 2);
return WERR_NOMEM;
}
@@ -7871,8 +7873,9 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
*/
DEBUGADD(10, ("spoolss_addprinterex_level_2: devmode included, converting\n"));
- if (!convert_devicemode(printer->info_2->printername, devmode,
- &printer->info_2->devmode))
+ if (!convert_devicemode_new(printer->info_2->printername,
+ devmode,
+ &printer->info_2->devmode))
return WERR_NOMEM;
}
@@ -7896,31 +7899,27 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_
return WERR_OK;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_AddPrinterEx
+****************************************************************/
-WERROR _spoolss_addprinterex( pipes_struct *p, SPOOL_Q_ADDPRINTEREX *q_u, SPOOL_R_ADDPRINTEREX *r_u)
+WERROR _spoolss_AddPrinterEx(pipes_struct *p,
+ struct spoolss_AddPrinterEx *r)
{
- UNISTR2 *uni_srv_name = q_u->server_name;
- uint32 level = q_u->level;
- SPOOL_PRINTER_INFO_LEVEL *info = &q_u->info;
- DEVICEMODE *devmode = q_u->devmode_ctr.devmode;
- SEC_DESC_BUF *sdb = q_u->secdesc_ctr;
- uint32 user_switch = q_u->user_switch;
- SPOOL_USER_CTR *user = &q_u->user_ctr;
- POLICY_HND *handle = &r_u->handle;
-
- switch (level) {
- case 1:
- /* we don't handle yet */
- /* but I know what to do ... */
- return WERR_UNKNOWN_LEVEL;
- case 2:
- return spoolss_addprinterex_level_2(p, uni_srv_name, info,
- devmode, sdb,
- user_switch, user, handle);
- default:
- return WERR_UNKNOWN_LEVEL;
+ switch (r->in.info_ctr->level) {
+ case 1:
+ /* we don't handle yet */
+ /* but I know what to do ... */
+ return WERR_UNKNOWN_LEVEL;
+ case 2:
+ return spoolss_addprinterex_level_2(p, r->in.server,
+ r->in.info_ctr,
+ r->in.devmode_ctr->devmode,
+ r->in.secdesc_ctr->sd,
+ r->in.userlevel_ctr,
+ r->out.handle);
+ default:
+ return WERR_UNKNOWN_LEVEL;
}
}
@@ -10613,17 +10612,6 @@ WERROR _spoolss_44(pipes_struct *p,
}
/****************************************************************
- _spoolss_AddPrinterEx
-****************************************************************/
-
-WERROR _spoolss_AddPrinterEx(pipes_struct *p,
- struct spoolss_AddPrinterEx *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
_spoolss_47
****************************************************************/