summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-17 15:23:30 +0100
committerGünther Deschner <gd@samba.org>2009-03-17 18:39:43 +0100
commit6549408a4ddb97d109eccb3f8b8bac456b4c4bc8 (patch)
treea0a5e86b4819674937b921867aaaca6a93b3c23c /source3/rpc_server
parent827ba0a64b33ca9caf7673f195cf17c1d5b84b66 (diff)
downloadsamba-6549408a4ddb97d109eccb3f8b8bac456b4c4bc8.tar.gz
samba-6549408a4ddb97d109eccb3f8b8bac456b4c4bc8.tar.bz2
samba-6549408a4ddb97d109eccb3f8b8bac456b4c4bc8.zip
s3-spoolss: rename construct_dev_mode_new to construct_dev_mode.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c55
1 files changed, 7 insertions, 48 deletions
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);
}