struct regsubkey_ctr *ctr)
{
TDB_DATA dbuf;
- uint8 *buffer = NULL;
+ uint8_t *buffer = NULL;
int i = 0;
uint32_t len, buflen;
uint32_t num_subkeys = regsubkey_ctr_numkeys(ctr);
/* allocate some initial memory */
- buffer = (uint8 *)SMB_MALLOC(1024);
+ buffer = (uint8_t *)SMB_MALLOC(1024);
if (buffer == NULL) {
werr = WERR_NOMEM;
goto done;
{
WERROR werr;
uint32_t num_items;
- uint8 *buf;
+ uint8_t *buf;
uint32_t buflen, len;
int i;
fstring subkeyname;
Unpack a list of registry values frem the TDB
***************************************************************************/
-static int regdb_unpack_values(struct regval_ctr *values, uint8 *buf, int buflen)
+static int regdb_unpack_values(struct regval_ctr *values, uint8_t *buf, int buflen)
{
int len = 0;
uint32_t type;
fstring valuename;
uint32_t size;
- uint8 *data_p;
+ uint8_t *data_p;
uint32_t num_values = 0;
int i;
Pack all values in all printer keys
***************************************************************************/
-static int regdb_pack_values(struct regval_ctr *values, uint8 *buf, int buflen)
+static int regdb_pack_values(struct regval_ctr *values, uint8_t *buf, int buflen)
{
int len = 0;
int i;
goto done;
}
- data.dptr = talloc_array(ctx, uint8, len);
+ data.dptr = talloc_array(ctx, uint8_t, len);
data.dsize = len;
len = regdb_pack_values(values, data.dptr, data.dsize);
goto done;
}
- status = unmarshall_sec_desc(mem_ctx, (uint8 *)data.dptr, data.dsize,
+ status = unmarshall_sec_desc(mem_ctx, (uint8_t *)data.dptr, data.dsize,
psecdesc);
if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MEMORY)) {
base_index = reg_perfcount_get_base_index();
buffer_size = reg_perfcount_get_counter_names(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Counters", REG_MULTI_SZ, (uint8 *)buffer,
+ regval_ctr_addvalue(regvals, "Counters", REG_MULTI_SZ, (uint8_t *)buffer,
buffer_size);
if(buffer_size > 0) {
}
buffer_size = reg_perfcount_get_counter_help(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, (uint8 *)buffer, buffer_size);
+ regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, (uint8_t *)buffer, buffer_size);
if(buffer_size > 0) {
SAFE_FREE(buffer);
}
static char* trim_reg_path( const char *path )
{
const char *p;
- uint16 key_len = strlen(KEY_SHARES);
+ uint16_t key_len = strlen(KEY_SHARES);
/*
* sanity check...this really should never be True.
bool prs_align_uint64(prs_struct *ps)
{
bool ret;
- uint8 old_align = ps->align;
+ uint8_t old_align = ps->align;
ps->align = 8;
ret = prs_align(ps);
bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16)
{
- char *q = prs_mem_get(ps, sizeof(uint16));
+ char *q = prs_mem_get(ps, sizeof(uint16_t));
if (q == NULL)
return False;
DEBUGADD(5,("%s%04x %s: %04x\n", tab_depth(5,depth), ps->data_offset, name, *data16));
- ps->data_offset += sizeof(uint16);
+ ps->data_offset += sizeof(uint16_t);
return True;
}
Stream an array of uint8s. Length is number of uint8s.
********************************************************************/
-bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len)
+bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8_t *data8s, int len)
{
int i;
char *q = prs_mem_get(ps, len);
* always little-endian.
*/
bool bigendian_data;
- uint8 align; /* data alignment */
+ uint8_t align; /* data alignment */
bool is_dynamic; /* Do we own this memory or not ? */
uint32_t data_offset; /* Current working offset into data. */
uint32_t buffer_size; /* Current allocated size of the buffer. */
bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16);
bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32_t *data32);
bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64);
-bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
+bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8_t *data8s, int len);
#endif
return buffer_size;
}
/* First encode the name_index */
- working_size = (kbuf.dsize + 1)*sizeof(uint16);
+ working_size = (kbuf.dsize + 1)*sizeof(uint16_t);
buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
if(!buf1) {
buffer_size = 0;
memcpy(buf1+buffer_size, (char *)name_index.data, working_size);
buffer_size += working_size;
/* Now encode the actual name */
- working_size = (dbuf.dsize + 1)*sizeof(uint16);
+ working_size = (dbuf.dsize + 1)*sizeof(uint16_t);
buf1 = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
if(!buf1) {
buffer_size = 0;
obj->counter_data.ByteLength += dsize + padding;
obj->counter_data.data = talloc_realloc(mem_ctx,
obj->counter_data.data,
- uint8,
+ uint8_t,
obj->counter_data.ByteLength - sizeof(uint32_t));
if(obj->counter_data.data == NULL)
return False;
inst->counter_data.ByteLength = data.dsize + sizeof(inst->counter_data.ByteLength);
inst->counter_data.data = talloc_realloc(mem_ctx,
inst->counter_data.data,
- uint8,
+ uint8_t,
data.dsize);
if(inst->counter_data.data == NULL)
return False;
}
inst->data = talloc_realloc(mem_ctx,
inst->data,
- uint8,
+ uint8_t,
inst->NameLength);
if (inst->data == NULL) {
SAFE_FREE(data.dptr);
pad = 8 - pad;
inst->data = talloc_realloc(mem_ctx,
inst->data,
- uint8,
+ uint8_t,
inst->NameLength + pad);
memset(inst->data + inst->NameLength, 0, pad);
inst->ByteLength += pad;
goto err_out;
}
block->SystemNameLength = (strlen_w(temp) * 2) + 2;
- block->data = talloc_zero_array(mem_ctx, uint8, block->SystemNameLength + (8 - (block->SystemNameLength % 8)));
+ block->data = talloc_zero_array(mem_ctx, uint8_t, block->SystemNameLength + (8 - (block->SystemNameLength % 8)));
if (block->data == NULL) {
goto err_out;
}
}
counter_data->data = talloc_realloc(mem_ctx,
counter_data->data,
- uint8,
+ uint8_t,
counter_data->ByteLength - sizeof(counter_data->ByteLength) + pad);
if (counter_data->data == NULL) {
return 0;
pad = 8 - pad;
object[obj].counter_data.data = talloc_realloc(mem_ctx,
object[obj].counter_data.data,
- uint8,
+ uint8_t,
object[obj].counter_data.ByteLength + pad);
memset((void *)(object[obj].counter_data.data + object[obj].counter_data.ByteLength), 0, pad);
object[obj].counter_data.ByteLength += pad;
static bool prs_nk_rec( const char *desc, prs_struct *ps, int depth, REGF_NK_REC *nk )
{
- uint16 class_length, name_length;
+ uint16_t class_length, name_length;
uint32_t start;
uint32_t data_size, start_off, end_off;
uint32_t unknown_off = REGF_OFFSET_NONE;
static bool hbin_prs_sk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_SK_REC *sk )
{
prs_struct *ps = &hbin->ps;
- uint16 tag = 0xFFFF;
+ uint16_t tag = 0xFFFF;
uint32_t data_size, start_off, end_off;
static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_VK_REC *vk, REGF_FILE *file )
{
uint32_t offset;
- uint16 name_length;
+ uint16_t name_length;
prs_struct *ps = &hbin->ps;
uint32_t data_size, start_off, end_off;
uint32_t data_rec_size;
if ( UNMARSHALLING(&hbin->ps) ) {
- if ( !(vk->data = PRS_ALLOC_MEM( ps, uint8, vk->data_size) ) )
+ if ( !(vk->data = PRS_ALLOC_MEM( ps, uint8_t, vk->data_size) ) )
return False;
}
hblock->dirty = True;
}
else {
- if ( !(vk->data = PRS_ALLOC_MEM( ps, uint8, 4 ) ) )
+ if ( !(vk->data = PRS_ALLOC_MEM( ps, uint8_t, 4 ) ) )
return False;
SIVAL( vk->data, 0, vk->data_off );
}
static bool next_record( REGF_HBIN *hbin, const char *hdr, bool *eob )
{
- uint8 header[REC_HDR_SIZE];
+ uint8_t header[REC_HDR_SIZE];
uint32_t record_size;
uint32_t curr_off, block_size;
bool found = False;
block_size = prs_data_size( ps );
record_size = 0;
- memset( header, 0x0, sizeof(uint8)*REC_HDR_SIZE );
+ memset( header, 0x0, sizeof(uint8_t)*REC_HDR_SIZE );
while ( !found ) {
curr_off = curr_off+record_size;
/* the record size is sizeof(hdr) + name + static members + data_size_field */
- size = sizeof(uint32_t)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32);
+ size = sizeof(uint32_t)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32_t);
/* multiple of 8 */
size_mod8 = size & 0xfffffff8;
/* the record size is sizeof(hdr) + name + static members + data_size_field */
- size = REC_HDR_SIZE + (sizeof(uint16)*3) + (sizeof(uint32_t)*3) + sizeof(uint32);
+ size = REC_HDR_SIZE + (sizeof(uint16_t)*3) + (sizeof(uint32_t)*3) + sizeof(uint32_t);
if ( vk->valuename )
size += strlen(vk->valuename);
/* the record size is sizeof(hdr) + num_keys + sizeof of hash_array + data_size_uint32_t */
- size = REC_HDR_SIZE + sizeof(uint16) + (sizeof(REGF_HASH_REC) * num_keys) + sizeof(uint32_t);
+ size = REC_HDR_SIZE + sizeof(uint16_t) + (sizeof(REGF_HASH_REC) * num_keys) + sizeof(uint32_t);
/* multiple of 8 */
size_mod8 = size & 0xfffffff8;
if ( vk->data_size > sizeof(uint32_t) ) {
uint32_t data_size = ( (vk->data_size+sizeof(uint32_t)) & 0xfffffff8 ) + 8;
- vk->data = (uint8 *)talloc_memdup( file->mem_ctx,
+ vk->data = (uint8_t *)talloc_memdup( file->mem_ctx,
regval_data_p(value),
vk->data_size );
if (vk->data == NULL) {
typedef struct {
uint32_t nk_off;
- uint8 keycheck[sizeof(uint32_t)];
+ uint8_t keycheck[sizeof(uint32_t)];
char *fullname;
} REGF_HASH_REC;
uint32_t rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */
char header[REC_HDR_SIZE];
- uint16 num_keys;
+ uint16_t num_keys;
REGF_HASH_REC *hashes;
} REGF_LF_REC;
char *valuename;
uint32_t data_size;
uint32_t data_off;
- uint8 *data;
+ uint8_t *data;
uint32_t type;
- uint16 flag;
+ uint16_t flag;
} REGF_VK_REC;
/* header information */
char header[REC_HDR_SIZE];
- uint16 key_type;
+ uint16_t key_type;
NTTIME mtime;
uint32_t parent_off; /* back pointer in registry hive */
uint32_t classname_off;