]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-spoolss: add support for level 8 in _spoolss_GetPrinter().
authorGünther Deschner <gd@samba.org>
Fri, 10 Apr 2009 01:28:17 +0000 (03:28 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 10 Apr 2009 11:25:01 +0000 (13:25 +0200)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index 098e59216b8317c5c07918c1d7515d762108691b..08c6d4083fc76beca67da3ceffdf9eb376c63181 100644 (file)
@@ -4084,6 +4084,39 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx,
        return WERR_OK;
 }
 
+/********************************************************************
+ * construct_printer_info8
+ * fill a spoolss_PrinterInfo8 struct
+ ********************************************************************/
+
+static WERROR construct_printer_info8(TALLOC_CTX *mem_ctx,
+                                     const NT_PRINTER_INFO_LEVEL *ntprinter,
+                                     struct spoolss_DeviceModeInfo *r,
+                                     int snum)
+{
+       struct spoolss_DeviceMode *devmode;
+       WERROR result;
+
+       if (!ntprinter->info_2->devmode) {
+               r->devmode = NULL;
+               return WERR_OK;
+       }
+
+       devmode = TALLOC_ZERO_P(mem_ctx, struct spoolss_DeviceMode);
+       W_ERROR_HAVE_NO_MEMORY(devmode);
+
+       result = convert_nt_devicemode(mem_ctx, devmode, ntprinter->info_2->devmode);
+       if (!W_ERROR_IS_OK(result)) {
+               TALLOC_FREE(devmode);
+               return result;
+       }
+
+       r->devmode      = devmode;
+
+       return WERR_OK;
+}
+
+
 /********************************************************************
  * construct_printer_info1
  * fill a spoolss_PrinterInfo1 struct
@@ -4636,6 +4669,10 @@ WERROR _spoolss_GetPrinter(pipes_struct *p,
                result = construct_printer_info7(p->mem_ctx, Printer,
                                                 &r->out.info->info7, snum);
                break;
+       case 8:
+               result = construct_printer_info8(p->mem_ctx, ntprinter,
+                                                &r->out.info->info8, snum);
+               break;
        default:
                result = WERR_UNKNOWN_LEVEL;
                break;