summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-23 20:46:08 +0200
committerGünther Deschner <gd@samba.org>2009-09-30 00:29:49 +0200
commit2c11b73391551723e4ada8664b1ba77873420217 (patch)
tree9cd85bb729c6aa7e2801ebbcd9acbed39f7e8054 /source3/rpc_server
parentfcee9d2c97a673347baf58f749f35785a896e468 (diff)
downloadsamba-2c11b73391551723e4ada8664b1ba77873420217.tar.gz
samba-2c11b73391551723e4ada8664b1ba77873420217.tar.bz2
samba-2c11b73391551723e4ada8664b1ba77873420217.zip
s3-registry: use push_reg_sz().
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index a81b5772c0..682a59b5a8 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6074,7 +6074,7 @@ static WERROR update_printer(pipes_struct *p, struct policy_handle *handle,
NT_PRINTER_INFO_LEVEL *printer = NULL, *old_printer = NULL;
Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
WERROR result;
- UNISTR2 buffer;
+ DATA_BLOB buffer;
fstring asc_buffer;
DEBUG(8,("update_printer\n"));
@@ -6184,17 +6184,17 @@ static WERROR update_printer(pipes_struct *p, struct policy_handle *handle,
*/
if (!strequal(printer->info_2->comment, old_printer->info_2->comment)) {
- init_unistr2( &buffer, printer->info_2->comment, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, printer->info_2->comment);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "description",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
notify_printer_comment(snum, printer->info_2->comment);
}
if (!strequal(printer->info_2->sharename, old_printer->info_2->sharename)) {
- init_unistr2( &buffer, printer->info_2->sharename, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, printer->info_2->sharename);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "shareName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
notify_printer_sharename(snum, printer->info_2->sharename);
}
@@ -6208,25 +6208,25 @@ static WERROR update_printer(pipes_struct *p, struct policy_handle *handle,
pname = printer->info_2->printername;
- init_unistr2( &buffer, pname, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, pname);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "printerName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
notify_printer_printername( snum, pname );
}
if (!strequal(printer->info_2->portname, old_printer->info_2->portname)) {
- init_unistr2( &buffer, printer->info_2->portname, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, printer->info_2->portname);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "portName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
notify_printer_port(snum, printer->info_2->portname);
}
if (!strequal(printer->info_2->location, old_printer->info_2->location)) {
- init_unistr2( &buffer, printer->info_2->location, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, printer->info_2->location);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "location",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
notify_printer_location(snum, printer->info_2->location);
}
@@ -6234,17 +6234,17 @@ static WERROR update_printer(pipes_struct *p, struct policy_handle *handle,
/* here we need to update some more DsSpooler keys */
/* uNCName, serverName, shortServerName */
- init_unistr2( &buffer, global_myname(), UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, global_myname());
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "serverName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "shortServerName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
slprintf( asc_buffer, sizeof(asc_buffer)-1, "\\\\%s\\%s",
global_myname(), printer->info_2->sharename );
- init_unistr2( &buffer, asc_buffer, UNI_STR_TERMINATE);
+ push_reg_sz(talloc_tos(), &buffer, asc_buffer);
set_printer_dataex( printer, SPOOL_DSSPOOLER_KEY, "uNCName",
- REG_SZ, (uint8_t *)buffer.buffer, buffer.uni_str_len*2 );
+ REG_SZ, buffer.data, buffer.length);
/* Update printer info */
result = mod_a_printer(printer, 2);