summaryrefslogtreecommitdiff
path: root/source3/printing
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/printing
parentfcee9d2c97a673347baf58f749f35785a896e468 (diff)
downloadsamba-2c11b73391551723e4ada8664b1ba77873420217.tar.gz
samba-2c11b73391551723e4ada8664b1ba77873420217.tar.bz2
samba-2c11b73391551723e4ada8664b1ba77873420217.zip
s3-registry: use push_reg_sz().
Guenther
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b75e30bb3e..f7591c19f5 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3167,7 +3167,7 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
{
int i;
struct regval_ctr *ctr=NULL;
- UNISTR2 unistr_guid;
+ DATA_BLOB unistr_guid;
/* find the DsSpooler key */
if ((i = lookup_printerkey(info2->data, SPOOL_DSSPOOLER_KEY)) < 0)
@@ -3179,14 +3179,11 @@ static void store_printer_guid(NT_PRINTER_INFO_LEVEL_2 *info2,
/* We used to store this as a REG_BINARY but that causes
Vista to whine */
- ZERO_STRUCT( unistr_guid );
-
- init_unistr2( &unistr_guid, GUID_string(talloc_tos(), &guid),
- UNI_STR_TERMINATE );
+ push_reg_sz(talloc_tos(), &unistr_guid, GUID_string(talloc_tos(), &guid));
regval_ctr_addvalue(ctr, "objectGUID", REG_SZ,
- (char *)unistr_guid.buffer,
- unistr_guid.uni_max_len*2);
+ (char *)unistr_guid.data,
+ unistr_guid.length);
}
@@ -3784,22 +3781,19 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
strequal( valuename, "objectGUID" ) )
{
struct GUID guid;
- UNISTR2 unistr_guid;
-
- ZERO_STRUCT( unistr_guid );
+ DATA_BLOB unistr_guid;
/* convert the GUID to a UNICODE string */
memcpy( &guid, data_p, sizeof(struct GUID) );
- init_unistr2( &unistr_guid,
- GUID_string(talloc_tos(), &guid),
- UNI_STR_TERMINATE );
+ push_reg_sz(&talloc_tos, &unistr_guid,
+ GUID_string(talloc_tos(), &guid));
regval_ctr_addvalue( printer_data->keys[key_index].values,
valuename, REG_SZ,
- (const char *)unistr_guid.buffer,
- unistr_guid.uni_str_len*2 );
+ (const char *)unistr_guid.data,
+ unistr_guid.length);
} else {
/* add the value */