summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-20 23:58:56 +0000
committerJeremy Allison <jra@samba.org>2000-06-20 23:58:56 +0000
commit69c75c8a165f05c01d13ba4eddbb970540e44b96 (patch)
treef509c0ff30d6f7550419302f199f5f65023d3cab /source3/printing/nt_printing.c
parenta69d47640cb150fbffa12dee68ead34a5b1931bb (diff)
downloadsamba-69c75c8a165f05c01d13ba4eddbb970540e44b96.tar.gz
samba-69c75c8a165f05c01d13ba4eddbb970540e44b96.tar.bz2
samba-69c75c8a165f05c01d13ba4eddbb970540e44b96.zip
Fixes for Win2k "add printer driver" INFO_LEVEL_6 was wrong, also some
memory fixes. Jeremy. (This used to be commit 2a9e645cbddef1cddc5c978310b7efed492758d2)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 417c0afcca..3d6d6f573a 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -349,6 +349,7 @@ static uint32 add_a_printer_driver_6(NT_PRINTER_DRIVER_INFO_LEVEL_6 *driver)
{
NT_PRINTER_DRIVER_INFO_LEVEL_3 info3;
+ ZERO_STRUCT(info3);
info3.cversion = driver->version;
fstrcpy(info3.environment,driver->environment);
fstrcpy(info3.driverpath,driver->driverpath);
@@ -377,10 +378,16 @@ static uint32 get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **in
fstrcpy(info.name, lp_printerdriver(snum));
fstrcpy(info.defaultdatatype, "RAW");
- if ((info.dependentfiles=(fstring *)malloc(sizeof(fstring))) == NULL)
+ fstrcpy(info.driverpath, "DUMMY.DLL");
+ fstrcpy(info.datafile, "DUMMY.PPD");
+ fstrcpy(info.configfile, "DUMMY.DLL");
+ fstrcpy(info.helpfile, "DUMMY.HLP");
+
+ if ((info.dependentfiles=(fstring *)malloc(2*sizeof(fstring))) == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
- fstrcpy(info.dependentfiles[0], "");
+ memset(info.dependentfiles, '\0', 2*sizeof(fstring));
+ fstrcpy(info.dependentfiles[0], "DUMMY.PPD");
*info_ptr = memdup(&info, sizeof(info));
@@ -1367,6 +1374,7 @@ uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level)
{
info6=driver.info_6;
safe_free(info6->dependentfiles);
+ safe_free(info6->previousnames);
ZERO_STRUCTP(info6);
safe_free(info6);
success=0;