summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-08 19:19:57 +0100
committerGünther Deschner <gd@samba.org>2009-02-09 10:42:33 +0100
commit9ef58a91962728c48df85c09ddabacfe9ebe2f21 (patch)
treec0a180dfc9d2cc9a6dca43f6067611fd7acc4ef0
parentc7d572a76f6269b9f6edea553bcb17d270a69500 (diff)
downloadsamba-9ef58a91962728c48df85c09ddabacfe9ebe2f21.tar.gz
samba-9ef58a91962728c48df85c09ddabacfe9ebe2f21.tar.bz2
samba-9ef58a91962728c48df85c09ddabacfe9ebe2f21.zip
s3-spoolss: use pidl for _spoolss_SetForm.
Guenther
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/printing/nt_printing.c22
-rw-r--r--source3/rpc_server/srv_spoolss.c22
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c32
4 files changed, 24 insertions, 54 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 574dd49f59..d33eaf9a96 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4794,7 +4794,7 @@ int write_ntforms(nt_forms_struct **list, int number);
bool add_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int *count);
bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR *ret);
bool delete_a_form_by_string(nt_forms_struct **list, const char *del_name, int *count, WERROR *ret);
-void update_a_form(nt_forms_struct **list, const FORM *form, int count);
+void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int count);
int get_ntdrivers(fstring **list, const char *architecture, uint32 version);
const char *get_short_archi(const char *long_archi);
WERROR clean_up_driver_struct(struct pipes_struct *rpc_pipe,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 70c5864535..97e7180cd9 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -986,28 +986,26 @@ bool delete_a_form(nt_forms_struct **list, UNISTR2 *del_name, int *count, WERROR
Update a form struct.
****************************************************************************/
-void update_a_form(nt_forms_struct **list, const FORM *form, int count)
+void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, int count)
{
int n=0;
- fstring form_name;
- unistr2_to_ascii(form_name, &(form->name), sizeof(form_name));
- DEBUG(106, ("[%s]\n", form_name));
+ DEBUG(106, ("[%s]\n", form->form_name));
for (n=0; n<count; n++) {
DEBUGADD(106, ("n [%d]:[%s]\n", n, (*list)[n].name));
- if (!strncmp((*list)[n].name, form_name, strlen(form_name)))
+ if (!strncmp((*list)[n].name, form->form_name, strlen(form->form_name)))
break;
}
if (n==count) return;
- (*list)[n].flag=form->flags;
- (*list)[n].width=form->size_x;
- (*list)[n].length=form->size_y;
- (*list)[n].left=form->left;
- (*list)[n].top=form->top;
- (*list)[n].right=form->right;
- (*list)[n].bottom=form->bottom;
+ (*list)[n].flag = form->flags;
+ (*list)[n].width = form->size.width;
+ (*list)[n].length = form->size.height;
+ (*list)[n].left = form->area.left;
+ (*list)[n].top = form->area.top;
+ (*list)[n].right = form->area.right;
+ (*list)[n].bottom = form->area.bottom;
}
/****************************************************************************
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index fa2bea5a66..d2a7a5149e 100644
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -943,27 +943,7 @@ static bool api_spoolss_deleteform(pipes_struct *p)
static bool api_spoolss_setform(pipes_struct *p)
{
- SPOOL_Q_SETFORM q_u;
- SPOOL_R_SETFORM 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_setform("", &q_u, data, 0)) {
- DEBUG(0,("spoolss_io_q_setform: unable to unmarshall SPOOL_Q_SETFORM.\n"));
- return False;
- }
-
- r_u.status = _spoolss_setform(p, &q_u, &r_u);
-
- if(!spoolss_io_r_setform("", &r_u, rdata, 0)) {
- DEBUG(0,("spoolss_io_r_setform: unable to marshall SPOOL_R_SETFORM.\n"));
- return False;
- }
-
- return True;
+ return proxy_spoolss_call(p, NDR_SPOOLSS_SETFORM);
}
/****************************************************************************
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 575c4c84f4..3d9d00be2d 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8598,13 +8598,15 @@ done:
return status;
}
-/****************************************************************************
-****************************************************************************/
+/****************************************************************
+ _spoolss_SetForm
+****************************************************************/
-WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *r_u)
+WERROR _spoolss_SetForm(pipes_struct *p,
+ struct spoolss_SetForm *r)
{
- POLICY_HND *handle = &q_u->handle;
- FORM *form = &q_u->form;
+ POLICY_HND *handle = r->in.handle;
+ struct spoolss_AddFormInfo1 *form = r->in.info.info1;
nt_forms_struct tmpForm;
int snum;
WERROR status = WERR_OK;
@@ -8614,10 +8616,11 @@ WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *
nt_forms_struct *list=NULL;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
- DEBUG(5,("spoolss_setform\n"));
+ DEBUG(5,("_spoolss_SetForm\n"));
if (!Printer) {
- DEBUG(2,("_spoolss_setform: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
+ DEBUG(2,("_spoolss_SetForm: Invalid handle (%s:%u:%u).\n",
+ OUR_HANDLE(handle)));
return WERR_BADFID;
}
@@ -8634,13 +8637,13 @@ WERROR _spoolss_setform(pipes_struct *p, SPOOL_Q_SETFORM *q_u, SPOOL_R_SETFORM *
}
if ( !(Printer->access_granted & (PRINTER_ACCESS_ADMINISTER|SERVER_ACCESS_ADMINISTER)) ) {
- DEBUG(2,("_spoolss_setform: denied by handle permissions\n"));
+ DEBUG(2,("_spoolss_SetForm: denied by handle permissions\n"));
status = WERR_ACCESS_DENIED;
goto done;
}
/* can't set if builtin */
- if (get_a_builtin_ntform(&form->name,&tmpForm)) {
+ if (get_a_builtin_ntform_by_string(form->form_name, &tmpForm)) {
status = WERR_INVALID_PARAM;
goto done;
}
@@ -10223,17 +10226,6 @@ WERROR _spoolss_GetForm(pipes_struct *p,
}
/****************************************************************
- _spoolss_SetForm
-****************************************************************/
-
-WERROR _spoolss_SetForm(pipes_struct *p,
- struct spoolss_SetForm *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
_spoolss_EnumForms
****************************************************************/