diff options
author | Andreas Schneider <asn@samba.org> | 2010-03-31 14:48:27 +0200 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-27 10:27:07 -0400 |
commit | fad361aa8a050e99ac64c3aae6ee292d2a538c80 (patch) | |
tree | 252c95ed454330f5021efde6df05319769e063ad /source3 | |
parent | 2ae1796b090b793397f4082a996b8e430172d365 (diff) | |
download | samba-fad361aa8a050e99ac64c3aae6ee292d2a538c80.tar.gz samba-fad361aa8a050e99ac64c3aae6ee292d2a538c80.tar.bz2 samba-fad361aa8a050e99ac64c3aae6ee292d2a538c80.zip |
s3-spoolss: Migrated spoolss_AddForm to the winreg function.
Signed-off-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index fa712cd12e..8d02cf9135 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -7650,16 +7650,12 @@ WERROR _spoolss_AddForm(pipes_struct *p, struct spoolss_AddForm *r) { struct spoolss_AddFormInfo1 *form = r->in.info.info1; - nt_forms_struct tmpForm; int snum = -1; WERROR status = WERR_OK; NT_PRINTER_INFO_LEVEL *printer = NULL; SE_PRIV se_printop = SE_PRINT_OPERATOR; - int count=0; - nt_forms_struct *list=NULL; Printer_entry *Printer = find_printer_index_by_hnd(p, r->in.handle); - int i; DEBUG(5,("_spoolss_AddForm\n")); @@ -7707,31 +7703,11 @@ WERROR _spoolss_AddForm(pipes_struct *p, goto done; } - /* can't add if builtin */ - - if (get_a_builtin_ntform_by_string(form->form_name, &tmpForm)) { - status = WERR_FILE_EXISTS; - goto done; - } - - count = get_ntforms(&list); - - for (i=0; i < count; i++) { - if (strequal(form->form_name, list[i].name)) { - status = WERR_FILE_EXISTS; - goto done; - } - } - - if(!add_a_form(&list, form, &count)) { - status = WERR_NOMEM; + status = winreg_printer_addform1(p->mem_ctx, p->server_info, form); + if (!W_ERROR_IS_OK(status)) { goto done; } - become_root(); - write_ntforms(&list, count); - unbecome_root(); - /* * ChangeID must always be set if this is a printer */ @@ -7742,7 +7718,6 @@ WERROR _spoolss_AddForm(pipes_struct *p, done: if ( printer ) free_a_printer(&printer, 2); - SAFE_FREE(list); return status; } |