mirror of
https://github.com/samba-team/samba.git
synced 2025-10-18 19:33:16 +03:00
Convert all uses of uint32/16/8 to _t in source3/registry.
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
committed by
Jeremy Allison
parent
a685404dce
commit
ddcf0565bb
@@ -1035,7 +1035,7 @@ static WERROR regdb_store_keys_internal2(struct db_context *db,
|
||||
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);
|
||||
@@ -1062,7 +1062,7 @@ static WERROR regdb_store_keys_internal2(struct db_context *db,
|
||||
|
||||
/* allocate some initial memory */
|
||||
|
||||
buffer = (uint8 *)SMB_MALLOC(1024);
|
||||
buffer = (uint8_t *)SMB_MALLOC(1024);
|
||||
if (buffer == NULL) {
|
||||
werr = WERR_NOMEM;
|
||||
goto done;
|
||||
@@ -1730,7 +1730,7 @@ static WERROR regdb_fetch_keys_internal(struct db_context *db, const char *key,
|
||||
{
|
||||
WERROR werr;
|
||||
uint32_t num_items;
|
||||
uint8 *buf;
|
||||
uint8_t *buf;
|
||||
uint32_t buflen, len;
|
||||
int i;
|
||||
fstring subkeyname;
|
||||
@@ -1820,13 +1820,13 @@ static int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr)
|
||||
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;
|
||||
|
||||
@@ -1862,7 +1862,7 @@ static int regdb_unpack_values(struct regval_ctr *values, uint8 *buf, int buflen
|
||||
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;
|
||||
@@ -2004,7 +2004,7 @@ static NTSTATUS regdb_store_values_internal(struct db_context *db,
|
||||
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);
|
||||
@@ -2115,7 +2115,7 @@ static WERROR regdb_get_secdesc(TALLOC_CTX *mem_ctx, const char *key,
|
||||
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)) {
|
||||
|
@@ -45,7 +45,7 @@ static int hkpt_params_fetch_values(const char *key, struct regval_ctr *regvals)
|
||||
|
||||
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) {
|
||||
@@ -53,7 +53,7 @@ static int hkpt_params_fetch_values(const char *key, struct regval_ctr *regvals)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@
|
||||
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.
|
||||
|
@@ -283,7 +283,7 @@ bool prs_align(prs_struct *ps)
|
||||
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);
|
||||
@@ -335,7 +335,7 @@ void prs_switch_type(prs_struct *ps, bool io)
|
||||
|
||||
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;
|
||||
|
||||
@@ -353,7 +353,7 @@ bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16)
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -415,7 +415,7 @@ bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64)
|
||||
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);
|
||||
|
@@ -33,7 +33,7 @@ typedef struct _prs_struct {
|
||||
* 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. */
|
||||
@@ -75,6 +75,6 @@ void prs_switch_type(prs_struct *ps, bool io);
|
||||
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
|
||||
|
@@ -185,7 +185,7 @@ static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
|
||||
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;
|
||||
@@ -199,7 +199,7 @@ static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
|
||||
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;
|
||||
@@ -590,7 +590,7 @@ static bool _reg_perfcount_get_counter_info(struct PERF_DATA_BLOCK *block,
|
||||
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;
|
||||
@@ -730,7 +730,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
|
||||
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;
|
||||
@@ -762,7 +762,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
|
||||
}
|
||||
inst->data = talloc_realloc(mem_ctx,
|
||||
inst->data,
|
||||
uint8,
|
||||
uint8_t,
|
||||
inst->NameLength);
|
||||
if (inst->data == NULL) {
|
||||
SAFE_FREE(data.dptr);
|
||||
@@ -784,7 +784,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
|
||||
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;
|
||||
@@ -995,7 +995,7 @@ static bool _reg_perfcount_init_data_block(struct PERF_DATA_BLOCK *block,
|
||||
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;
|
||||
}
|
||||
@@ -1071,7 +1071,7 @@ static uint32_t _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *blo
|
||||
}
|
||||
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;
|
||||
@@ -1091,7 +1091,7 @@ static uint32_t _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *blo
|
||||
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;
|
||||
|
@@ -338,7 +338,7 @@ static bool prs_hbin_block( const char *desc, prs_struct *ps, int depth, REGF_HB
|
||||
|
||||
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;
|
||||
@@ -722,7 +722,7 @@ static bool hbin_prs_lf_records( const char *desc, REGF_HBIN *hbin, int depth, R
|
||||
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;
|
||||
|
||||
|
||||
@@ -801,7 +801,7 @@ static bool hbin_prs_sk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_
|
||||
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;
|
||||
|
||||
@@ -866,7 +866,7 @@ static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -891,7 +891,7 @@ static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_
|
||||
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 );
|
||||
}
|
||||
@@ -1095,7 +1095,7 @@ static bool hbin_prs_key( REGF_FILE *file, REGF_HBIN *hbin, REGF_NK_REC *nk )
|
||||
|
||||
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;
|
||||
@@ -1112,7 +1112,7 @@ static bool next_record( REGF_HBIN *hbin, const char *hdr, bool *eob )
|
||||
|
||||
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;
|
||||
@@ -1619,7 +1619,7 @@ static uint32_t sk_record_data_size( struct security_descriptor * sd )
|
||||
|
||||
/* 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;
|
||||
@@ -1640,7 +1640,7 @@ static uint32_t vk_record_data_size( REGF_VK_REC *vk )
|
||||
|
||||
/* 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);
|
||||
@@ -1664,7 +1664,7 @@ static uint32_t lf_record_data_size( uint32_t num_keys )
|
||||
|
||||
/* 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;
|
||||
@@ -1722,7 +1722,7 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk,
|
||||
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) {
|
||||
|
@@ -82,7 +82,7 @@ typedef struct regf_hbin {
|
||||
|
||||
typedef struct {
|
||||
uint32_t nk_off;
|
||||
uint8 keycheck[sizeof(uint32_t)];
|
||||
uint8_t keycheck[sizeof(uint32_t)];
|
||||
char *fullname;
|
||||
} REGF_HASH_REC;
|
||||
|
||||
@@ -92,7 +92,7 @@ typedef struct {
|
||||
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;
|
||||
|
||||
@@ -108,9 +108,9 @@ typedef struct {
|
||||
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;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ typedef struct {
|
||||
/* 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;
|
||||
|
Reference in New Issue
Block a user