s3-spoolss: rename construct_dev_mode_new to construct_dev_mode.
authorGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 14:23:30 +0000 (15:23 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 17:39:43 +0000 (18:39 +0100)
Guenther

source3/include/proto.h
source3/registry/reg_backend_printing.c
source3/rpc_server/srv_spoolss_nt.c

index fea9588775b9260c5b4627c98ae8658573328125..aa7fea8cb8e0affbdd43de33e5e656ed5e674ecf 100644 (file)
@@ -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 );
index 065730bc7653f96c09017757a314397177ecc0c7..a02293e528c798b25ae68a1ace344d3648119f67 100644 (file)
@@ -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;
index 88b8385c57c16090bfebba0bdea7aa3419638aa2..4a1131457f3fb29c58da4d329948538ad176f72f 100644 (file)
@@ -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);
        }