s3:spoolss: construct the devmode the same way for level 2 and 8
[ira/wip.git] / source3 / rpc_server / srv_spoolss_nt.c
index c555a3146554190c0be1943e8f0510a8247827f2..a5484f8974cf7c9d7f2664c46cffc054344e833a 100644 (file)
@@ -3949,25 +3949,11 @@ static WERROR construct_printer_info8(TALLOC_CTX *mem_ctx,
                                      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 = construct_dev_mode(mem_ctx, lp_const_servicename(snum));
+       if (!r->devmode) {
+               DEBUG(8,("Returning NULL Devicemode!\n"));
        }
 
-       r->devmode      = devmode;
-
        return WERR_OK;
 }