1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3-spoolss: use pidl for _spoolss_SetForm.

Guenther
This commit is contained in:
Günther Deschner 2009-02-08 19:19:57 +01:00
parent c7d572a76f
commit 9ef58a9196
4 changed files with 24 additions and 54 deletions

View File

@ -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,

View File

@ -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;
}
/****************************************************************************

View File

@ -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);
}
/****************************************************************************

View File

@ -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;
}
@ -10222,17 +10225,6 @@ WERROR _spoolss_GetForm(pipes_struct *p,
return WERR_NOT_SUPPORTED;
}
/****************************************************************
_spoolss_SetForm
****************************************************************/
WERROR _spoolss_SetForm(pipes_struct *p,
struct spoolss_SetForm *r)
{
p->rng_fault_state = true;
return WERR_NOT_SUPPORTED;
}
/****************************************************************
_spoolss_EnumForms
****************************************************************/