From fad361aa8a050e99ac64c3aae6ee292d2a538c80 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 31 Mar 2010 14:48:27 +0200 Subject: [PATCH] s3-spoolss: Migrated spoolss_AddForm to the winreg function. Signed-off-by: Jim McDonough --- source3/rpc_server/srv_spoolss_nt.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index fa712cd12e7..8d02cf91357 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; } -- 2.11.4.GIT