summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index d0fc839154..340d776493 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3581,30 +3581,28 @@ uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level,
/* convert from UNICODE to ASCII */
convert_printer_info(info, &printer, level);
- unistr2_to_ascii(share_name, &((info->info_2)->portname), sizeof(share_name)-1);
+ unistr2_to_ascii(share_name, &((info->info_2)->printername), sizeof(share_name)-1);
slprintf(name, sizeof(name)-1, "\\\\%s\\%s", global_myname, share_name);
+ /* write the ASCII on disk */
+ if (add_a_printer(printer, level) != 0x0)
+ return ERROR_ACCESS_DENIED;
+
create_printer_hnd(handle);
open_printer_hnd(handle);
if (!set_printer_hnd_printertype(handle, name)) {
close_printer_handle(handle);
- return NT_STATUS_ACCESS_DENIED;
+ return ERROR_ACCESS_DENIED;
}
-
+
if (!set_printer_hnd_printername(handle, name)) {
close_printer_handle(handle);
- return NT_STATUS_ACCESS_DENIED;
+ return ERROR_ACCESS_DENIED;
}
- /* write the ASCII on disk */
- if (add_a_printer(printer, level) != 0x0) {
- close_printer_handle(handle);
- return NT_STATUS_ACCESS_DENIED;
- }
-
return NT_STATUS_NO_PROBLEMO;
}