Temporary fix to convert from level6 (Win2k) to level 3 (NT4)
authorJeremy Allison <jra@samba.org>
Wed, 6 Sep 2000 23:20:35 +0000 (23:20 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 6 Sep 2000 23:20:35 +0000 (23:20 +0000)
for driver download files.
Jeremy.
(This used to be commit 1c9ac94c941aac5f6d309a094e4f741d523dbfb0)

source3/printing/nt_printing.c

index 0ad50a227763db0ccc9c763232c9f7d9ef44f9e6..f6c85ab3f9ef959ff0a460207af7e9b1017fd869 100644 (file)
@@ -428,11 +428,31 @@ void clean_up_driver_struct(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32
        }
 }
 
+/****************************************************************************
+ This function sucks and should be replaced. JRA.
+****************************************************************************/
+
+static void convert_level_6_to_level3(NT_PRINTER_DRIVER_INFO_LEVEL_3 *dst, NT_PRINTER_DRIVER_INFO_LEVEL_6 *src)
+{
+    dst->cversion  = src->version;
+
+    fstrcpy( dst->name, src->name);
+    fstrcpy( dst->environment, src->environment);
+    fstrcpy( dst->driverpath, src->driverpath);
+    fstrcpy( dst->datafile, src->datafile);
+    fstrcpy( dst->configfile, src->configfile);
+    fstrcpy( dst->helpfile, src->helpfile);
+    fstrcpy( dst->monitorname, src->monitorname);
+    fstrcpy( dst->defaultdatatype, src->defaultdatatype);
+    dst->dependentfiles = src->dependentfiles;
+}
+
 /****************************************************************************
 ****************************************************************************/
 BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract, uint32 level, struct current_user *user, uint32 *perr)
 {
        NT_PRINTER_DRIVER_INFO_LEVEL_3 *driver;
+       NT_PRINTER_DRIVER_INFO_LEVEL_3 converted_driver;
        fstring architecture;
        pstring new_dir;
        pstring old_name;
@@ -453,7 +473,14 @@ BOOL move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
 
        if (level==3)
                driver=driver_abstract.info_3;
-       
+       else if (level==6) {
+               convert_level_6_to_level3(&converted_driver, driver_abstract.info_6);
+               driver = &converted_driver;
+       } else {
+               DEBUG(0,("move_driver_to_download_area: Unknown info level (%u)\n", (unsigned int)level ));
+               return False;
+       }
+
        get_short_archi(architecture, driver->environment);
 
        become_root();