From 96c795cea7518b50a40caba34e656f056a832589 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jan 2003 06:15:18 +0000 Subject: reverted this patch till I sort out the craziness with UNIHDR (This used to be commit e3d00fa47d38cd214f5e350e1d6b30d90ed8a52c) --- source3/registry/reg_printing.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source3/registry/reg_printing.c') diff --git a/source3/registry/reg_printing.c b/source3/registry/reg_printing.c index 6840dd9623..4b8eaa658e 100644 --- a/source3/registry/reg_printing.c +++ b/source3/registry/reg_printing.c @@ -288,22 +288,22 @@ static int print_subpath_values_environments( char *key, REGVAL_CTR *val ) info3 = driver_ctr.info_3; filename = dos_basename( info3->driverpath ); - init_unistr2( &data, filename); + init_unistr2( &data, filename, strlen(filename)+1 ); regval_ctr_addvalue( val, "Driver", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); filename = dos_basename( info3->configfile ); - init_unistr2( &data, filename); + init_unistr2( &data, filename, strlen(filename)+1 ); regval_ctr_addvalue( val, "Configuration File", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); filename = dos_basename( info3->datafile ); - init_unistr2( &data, filename); + init_unistr2( &data, filename, strlen(filename)+1 ); regval_ctr_addvalue( val, "Data File", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); filename = dos_basename( info3->helpfile ); - init_unistr2( &data, filename); + init_unistr2( &data, filename, strlen(filename)+1 ); regval_ctr_addvalue( val, "Help File", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info3->defaultdatatype); + init_unistr2( &data, info3->defaultdatatype, strlen(info3->defaultdatatype)+1 ); regval_ctr_addvalue( val, "Data Type", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); regval_ctr_addvalue( val, "Version", REG_DWORD, (char*)&info3->cversion, sizeof(info3->cversion) ); @@ -327,7 +327,7 @@ static int print_subpath_values_environments( char *key, REGVAL_CTR *val ) break; buffer = buffer2; - init_unistr2( &data, filename); + init_unistr2( &data, filename, length+1 ); memcpy( buffer+buffer_size, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); buffer_size += (length + 1)*sizeof(uint16); @@ -573,25 +573,25 @@ static int print_subpath_values_printers( char *key, REGVAL_CTR *val ) regval_ctr_addvalue( val, "cjobs", REG_DWORD, (char*)&info2->cjobs, sizeof(info2->cjobs) ); regval_ctr_addvalue( val, "AveragePPM", REG_DWORD, (char*)&info2->averageppm, sizeof(info2->averageppm) ); - init_unistr2( &data, info2->printername); + init_unistr2( &data, info2->printername, strlen(info2->printername)+1 ); regval_ctr_addvalue( val, "Name", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->location); + init_unistr2( &data, info2->location, strlen(info2->location)+1 ); regval_ctr_addvalue( val, "Location", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->comment); + init_unistr2( &data, info2->comment, strlen(info2->comment)+1 ); regval_ctr_addvalue( val, "Comment", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->parameters); + init_unistr2( &data, info2->parameters, strlen(info2->parameters)+1 ); regval_ctr_addvalue( val, "Parameters", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->portname); + init_unistr2( &data, info2->portname, strlen(info2->portname)+1 ); regval_ctr_addvalue( val, "Port", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->servername); + init_unistr2( &data, info2->servername, strlen(info2->servername)+1 ); regval_ctr_addvalue( val, "Server", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->sharename); + init_unistr2( &data, info2->sharename, strlen(info2->sharename)+1 ); regval_ctr_addvalue( val, "Share", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->drivername); + init_unistr2( &data, info2->drivername, strlen(info2->drivername)+1 ); regval_ctr_addvalue( val, "Driver", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, info2->sepfile); + init_unistr2( &data, info2->sepfile, strlen(info2->sepfile)+1 ); regval_ctr_addvalue( val, "Separator File", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); - init_unistr2( &data, "winprint"); + init_unistr2( &data, "winprint", strlen("winprint")+1 ); regval_ctr_addvalue( val, "Print Processor", REG_SZ, (char*)data.buffer, data.uni_str_len*sizeof(uint16) ); -- cgit