diff options
author | Gerald Carter <jerry@samba.org> | 2005-08-29 14:55:40 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:03:25 -0500 |
commit | 44707ad2e00a91f459e80efbe8f362b5853b0a62 (patch) | |
tree | 438124f4550315df722d959891b66e669222f8e8 /source3/registry/reg_printing.c | |
parent | 77670a2ec33275ae08a37606ee15bf0170b7fcb3 (diff) | |
download | samba-44707ad2e00a91f459e80efbe8f362b5853b0a62.tar.gz samba-44707ad2e00a91f459e80efbe8f362b5853b0a62.tar.bz2 samba-44707ad2e00a91f459e80efbe8f362b5853b0a62.zip |
r9739: conver the reg_objects (REGSUBKEY_CTR & REGVAL_CTR) to use
the new talloc() features:
Note that the REGSUB_CTR and REGVAL_CTR objects *must* be talloc()'d
since the methods use the object pointer as the talloc context for
internal private data.
There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
pair of functions. Simply TALLOC_ZERO_P() and TALLOC_FREE() the
object.
Also had to convert the printer_info_2->NT_PRINTER_DATA field
to be talloc()'d as well. This is just a stop on the road to
cleaning up the printer memory management.
(This used to be commit ef721333ab9639cb5346067497e99fbd0d4425dd)
Diffstat (limited to 'source3/registry/reg_printing.c')
-rw-r--r-- | source3/registry/reg_printing.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/registry/reg_printing.c b/source3/registry/reg_printing.c index c1f7d3925f..d0f7daa926 100644 --- a/source3/registry/reg_printing.c +++ b/source3/registry/reg_printing.c @@ -261,7 +261,7 @@ static int key_printers_fetch_keys( const char *key, REGSUBKEY_CTR *subkeys ) return -1; } - num_subkeys = get_printer_subkeys( &printer->info_2->data, printerdatakey?printerdatakey:"", &subkey_names ); + num_subkeys = get_printer_subkeys( printer->info_2->data, printerdatakey?printerdatakey:"", &subkey_names ); for ( i=0; i<num_subkeys; i++ ) regsubkey_ctr_addkey( subkeys, subkey_names[i] ); @@ -345,7 +345,7 @@ static BOOL key_printers_store_keys( const char *key, REGSUBKEY_CTR *subkeys ) /* get the top level printer keys */ - num_existing_keys = get_printer_subkeys( &printer->info_2->data, "", &existing_subkeys ); + num_existing_keys = get_printer_subkeys( printer->info_2->data, "", &existing_subkeys ); for ( i=0; i<num_existing_keys; i++ ) { @@ -354,7 +354,7 @@ static BOOL key_printers_store_keys( const char *key, REGSUBKEY_CTR *subkeys ) if ( !regsubkey_ctr_key_exists( subkeys, existing_subkeys[i] ) ) { DEBUG(5,("key_printers_store_keys: deleting key %s\n", existing_subkeys[i])); - delete_printer_key( &printer->info_2->data, existing_subkeys[i] ); + delete_printer_key( printer->info_2->data, existing_subkeys[i] ); } } @@ -362,10 +362,10 @@ static BOOL key_printers_store_keys( const char *key, REGSUBKEY_CTR *subkeys ) for ( i=0; i<num_subkeys; i++ ) { subkeyname = regsubkey_ctr_specific_key(subkeys, i); /* add any missing printer keys */ - if ( lookup_printerkey(&printer->info_2->data, subkeyname) == -1 ) { + if ( lookup_printerkey(printer->info_2->data, subkeyname) == -1 ) { DEBUG(5,("key_printers_store_keys: adding key %s\n", existing_subkeys[i])); - if ( add_new_printer_key( &printer->info_2->data, subkeyname ) == -1 ) + if ( add_new_printer_key( printer->info_2->data, subkeyname ) == -1 ) return False; } } @@ -445,7 +445,7 @@ static void fill_in_printer_values( NT_PRINTER_INFO_LEVEL_2 *info2, REGVAL_CTR * /* use a prs_struct for converting the devmode and security descriptor to REG_BINARY */ - prs_init( &prs, MAX_PDU_FRAG_LEN, regval_ctr_getctx(values), MARSHALL); + prs_init( &prs, MAX_PDU_FRAG_LEN, values, MARSHALL); /* stream the device mode */ @@ -508,7 +508,7 @@ static int key_printers_fetch_values( const char *key, REGVAL_CTR *values ) /* iterate over all printer data keys and fill the regval container */ - p_data = &printer->info_2->data; + p_data = printer->info_2->data; if ( (key_index = lookup_printerkey( p_data, printerdatakey )) == -1 ) { /* failure....should never happen if the client has a valid open handle first */ DEBUG(10,("key_printers_fetch_values: Unknown keyname [%s]\n", printerdatakey)); @@ -517,9 +517,9 @@ static int key_printers_fetch_values( const char *key, REGVAL_CTR *values ) return -1; } - num_values = regval_ctr_numvals( &p_data->keys[key_index].values ); + num_values = regval_ctr_numvals( p_data->keys[key_index].values ); for ( i=0; i<num_values; i++ ) - regval_ctr_copyvalue( values, regval_ctr_specific_value(&p_data->keys[key_index].values, i) ); + regval_ctr_copyvalue( values, regval_ctr_specific_value(p_data->keys[key_index].values, i) ); done: @@ -702,7 +702,7 @@ static BOOL key_printers_store_values( const char *key, REGVAL_CTR *values ) int i; REGISTRY_VALUE *val; - delete_printer_key( &printer->info_2->data, keyname ); + delete_printer_key( printer->info_2->data, keyname ); /* deal with any subkeys */ for ( i=0; i<num_values; i++ ) { |