*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
#define NAMES_DB "names.tdb"
#define DATA_DB "data.tdb"
+PERF_OBJECT_TYPE *_reg_perfcount_find_obj(PERF_DATA_BLOCK *block, int objind);
+
/*********************************************************************
*********************************************************************/
even_num+1 perf_counter<even_num>_help
and so on.
So last_counter becomes num_counters*2, and last_help will be last_counter+1 */
- kbuf.dptr = key;
- kbuf.dsize = strlen(key);
+ kbuf = string_tdb_data(key);
dbuf = tdb_fetch(names, kbuf);
if(dbuf.dptr == NULL)
{
memset(temp, 0, sizeof(temp));
snprintf(temp, sizeof(temp), "%d", keyval);
- kbuf.dptr = temp;
- kbuf.dsize = strlen(temp);
+ kbuf = string_tdb_data(temp);
dbuf = tdb_fetch(tdb, kbuf);
if(dbuf.dptr == NULL)
{
buffer_size = 0;
return buffer_size;
}
- init_unistr2(&name_index, kbuf.dptr, UNI_STR_TERMINATE);
+ init_unistr2(&name_index, (const char *)kbuf.dptr, UNI_STR_TERMINATE);
memcpy(buf1+buffer_size, (char *)name_index.buffer, working_size);
buffer_size += working_size;
/* Now encode the actual name */
else
snprintf(buf, buflen, "%d", key_part1);
- key->dptr = buf;
- key->dsize = strlen(buf);
+ *key = string_tdb_data(buf);
return;
}
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
+ SAFE_FREE(data.dptr);
return (uint32)atoi(buf);
}
uint32 reg_perfcount_get_perf_data_block(uint32 base_index,
prs_struct *ps,
PERF_DATA_BLOCK *block,
- char *object_ids)
+ const char *object_ids)
{
uint32 buffer_size = 0;
const char *fname = counters_directory( NAMES_DB );
/*********************************************************************
*********************************************************************/
-WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, char *object_ids)
+WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids)
{
/*
* For a detailed description of the layout of this structure,