summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h5
-rw-r--r--source3/registry/reg_backend_printing.c2
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c55
3 files changed, 10 insertions, 52 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index fea9588775..aa7fea8cb8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6030,9 +6030,8 @@ void construct_info_data(struct spoolss_Notify *info_data,
enum spoolss_NotifyType type,
enum spoolss_Field field,
int id);
-DEVICEMODE *construct_dev_mode(const char *servicename);
-struct spoolss_DeviceMode *construct_dev_mode_new(TALLOC_CTX *mem_ctx,
- const char *servicename);
+struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
+ const char *servicename);
WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname, const char *uri );
bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines );
diff --git a/source3/registry/reg_backend_printing.c b/source3/registry/reg_backend_printing.c
index 065730bc76..a02293e528 100644
--- a/source3/registry/reg_backend_printing.c
+++ b/source3/registry/reg_backend_printing.c
@@ -438,7 +438,7 @@ static void fill_in_printer_values( NT_PRINTER_INFO_LEVEL_2 *info2, REGVAL_CTR *
/* stream the device mode */
- devmode = construct_dev_mode_new(values,info2->sharename);
+ devmode = construct_dev_mode(values,info2->sharename);
if (devmode) {
DATA_BLOB blob;
enum ndr_err_code ndr_err;
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 88b8385c57..4a1131457f 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3978,14 +3978,14 @@ static bool convert_nt_devicemode( DEVICEMODE *devmode, NT_DEVICEMODE *ntdevmode
Create a spoolss_DeviceMode struct. Returns talloced memory.
****************************************************************************/
-struct spoolss_DeviceMode *construct_dev_mode_new(TALLOC_CTX *mem_ctx,
- const char *servicename)
+struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
+ const char *servicename)
{
WERROR result;
NT_PRINTER_INFO_LEVEL *printer = NULL;
struct spoolss_DeviceMode *devmode = NULL;
- DEBUG(7,("construct_dev_mode_new\n"));
+ DEBUG(7,("construct_dev_mode\n"));
DEBUGADD(8,("getting printer characteristics\n"));
@@ -3999,7 +3999,7 @@ struct spoolss_DeviceMode *construct_dev_mode_new(TALLOC_CTX *mem_ctx,
devmode = TALLOC_ZERO_P(mem_ctx, struct spoolss_DeviceMode);
if (!devmode) {
- DEBUG(2,("construct_dev_mode_new: talloc fail.\n"));
+ DEBUG(2,("construct_dev_mode: talloc fail.\n"));
goto done;
}
@@ -4016,47 +4016,6 @@ done:
return devmode;
}
-/****************************************************************************
- Create a DEVMODE struct. Returns malloced memory.
-****************************************************************************/
-
-DEVICEMODE *construct_dev_mode(const char *servicename)
-{
- NT_PRINTER_INFO_LEVEL *printer = NULL;
- DEVICEMODE *devmode = NULL;
-
- DEBUG(7,("construct_dev_mode\n"));
-
- DEBUGADD(8,("getting printer characteristics\n"));
-
- if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, servicename)))
- return NULL;
-
- if ( !printer->info_2->devmode ) {
- DEBUG(5, ("BONG! There was no device mode!\n"));
- goto done;
- }
-
- if ((devmode = SMB_MALLOC_P(DEVICEMODE)) == NULL) {
- DEBUG(2,("construct_dev_mode: malloc fail.\n"));
- goto done;
- }
-
- ZERO_STRUCTP(devmode);
-
- DEBUGADD(8,("loading DEVICEMODE\n"));
-
- if ( !convert_nt_devicemode( devmode, printer->info_2->devmode ) ) {
- free_dev_mode( devmode );
- devmode = NULL;
- }
-
-done:
- free_a_printer(&printer,2);
-
- return devmode;
-}
-
/********************************************************************
* construct_printer_info3
* fill a spoolss_PrinterInfo3 struct
@@ -4261,7 +4220,7 @@ static WERROR construct_printer_info2(TALLOC_CTX *mem_ctx,
r->cjobs = count;
r->averageppm = ntprinter->info_2->averageppm;
- r->devmode = construct_dev_mode_new(mem_ctx, lp_const_servicename(snum));
+ r->devmode = construct_dev_mode(mem_ctx, lp_const_servicename(snum));
if (!r->devmode) {
DEBUG(8,("Returning NULL Devicemode!\n"));
}
@@ -6316,7 +6275,7 @@ static WERROR enumjobs_level2(TALLOC_CTX *mem_ctx,
struct spoolss_DeviceMode *devmode;
- devmode = construct_dev_mode_new(info, lp_const_servicename(snum));
+ devmode = construct_dev_mode(info, lp_const_servicename(snum));
if (!devmode) {
result = WERR_NOMEM;
goto out;
@@ -8694,7 +8653,7 @@ static WERROR getjob_level_2(TALLOC_CTX *mem_ctx,
return result;
}
} else {
- devmode = construct_dev_mode_new(mem_ctx, lp_const_servicename(snum));
+ devmode = construct_dev_mode(mem_ctx, lp_const_servicename(snum));
W_ERROR_HAVE_NO_MEMORY(devmode);
}