diff options
author | Richard Sharpe <rsharpe@samba.org> | 2015-04-14 07:50:28 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-04-16 00:37:28 +0200 |
commit | 07d3ba435a3a8012da0107b6ff12a7d8951c9650 (patch) | |
tree | 0994e66a414ba91353416e2f565064aba3168783 /source3 | |
parent | a65e22c6bdf32c2bb014a2ed52794590a49dda34 (diff) | |
download | samba-07d3ba435a3a8012da0107b6ff12a7d8951c9650.tar.gz |
Change the registry subsystem to use uint32_t from uint32. Also change session.h.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 16 00:37:28 CEST 2015 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/registry.h | 8 | ||||
-rw-r--r-- | source3/include/session.h | 2 | ||||
-rw-r--r-- | source3/registry/reg_api.c | 20 | ||||
-rw-r--r-- | source3/registry/reg_api.h | 10 | ||||
-rw-r--r-- | source3/registry/reg_api_util.c | 4 | ||||
-rw-r--r-- | source3/registry/reg_api_util.h | 4 | ||||
-rw-r--r-- | source3/registry/reg_backend_db.c | 18 | ||||
-rw-r--r-- | source3/registry/reg_backend_hkpt_params.c | 4 | ||||
-rw-r--r-- | source3/registry/reg_backend_netlogon_params.c | 2 | ||||
-rw-r--r-- | source3/registry/reg_backend_smbconf.c | 4 | ||||
-rw-r--r-- | source3/registry/reg_dispatcher.c | 4 | ||||
-rw-r--r-- | source3/registry/reg_dispatcher.h | 4 | ||||
-rw-r--r-- | source3/registry/reg_parse_prs.c | 30 | ||||
-rw-r--r-- | source3/registry/reg_parse_prs.h | 22 | ||||
-rw-r--r-- | source3/registry/reg_perfcount.c | 66 | ||||
-rw-r--r-- | source3/registry/reg_perfcount.h | 12 | ||||
-rw-r--r-- | source3/registry/regfio.c | 144 | ||||
-rw-r--r-- | source3/registry/regfio.h | 92 |
18 files changed, 225 insertions, 225 deletions
diff --git a/source3/include/registry.h b/source3/include/registry.h index f7a537ed0be..0de392f15d9 100644 --- a/source3/include/registry.h +++ b/source3/include/registry.h @@ -47,8 +47,8 @@ struct registry_ops { WERROR (*create_subkey)(const char *key, const char *subkey); WERROR (*delete_subkey)(const char *key, const char *subkey, bool lazy); bool (*store_values)( const char *key, struct regval_ctr *val ); - bool (*reg_access_check)( const char *keyname, uint32 requested, - uint32 *granted, + bool (*reg_access_check)( const char *keyname, uint32_t requested, + uint32_t *granted, const struct security_token *token ); WERROR (*get_secdesc)(TALLOC_CTX *mem_ctx, const char *key, struct security_descriptor **psecdesc); @@ -61,9 +61,9 @@ struct registry_ops { /* structure to store the registry handles */ struct registry_key_handle { - uint32 type; + uint32_t type; char *name; /* full name of registry key */ - uint32 access_granted; + uint32_t access_granted; struct registry_ops *ops; }; diff --git a/source3/include/session.h b/source3/include/session.h index ba96ae367c7..fe41954ab50 100644 --- a/source3/include/session.h +++ b/source3/include/session.h @@ -34,7 +34,7 @@ struct sessionid { fstring netbios_name; fstring remote_machine; fstring id_str; - uint32 id_num; + uint32_t id_num; struct server_id pid; fstring ip_addr_str; time_t connect_start; diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index d1c70ec497e..586bf03643a 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -133,7 +133,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, const struct security_token *token, - uint32 access_desired, + uint32_t access_desired, struct registry_key **pregkey) { WERROR result = WERR_OK; @@ -229,7 +229,7 @@ done: } WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, - uint32 desired_access, + uint32_t desired_access, const struct security_token *token, struct registry_key **pkey) { @@ -252,7 +252,7 @@ WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, **********************************************************************/ WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent, - const char *name, uint32 desired_access, + const char *name, uint32_t desired_access, struct registry_key **pkey) { struct registry_key *direct_parent = parent; @@ -304,7 +304,7 @@ error: } WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **name, NTTIME *last_write_time) + uint32_t idx, char **name, NTTIME *last_write_time) { WERROR err; @@ -335,7 +335,7 @@ WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, } WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **pname, struct registry_value **pval) + uint32_t idx, char **pname, struct registry_value **pval) { struct registry_value *val; struct regval_blob *blob; @@ -377,7 +377,7 @@ WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, static WERROR reg_enumvalue_nocachefill(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **pname, + uint32_t idx, char **pname, struct registry_value **pval) { struct registry_value *val; @@ -416,7 +416,7 @@ WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, const char *name, struct registry_value **pval) { WERROR err; - uint32 i; + uint32_t i; if (!(key->key->access_granted & KEY_QUERY_VALUE)) { return WERR_ACCESS_DENIED; @@ -500,7 +500,7 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, uint32_t *max_valbufsize, uint32_t *secdescsize, NTTIME *last_changed_time) { - uint32 i, max_size; + uint32_t i, max_size; size_t max_len; TALLOC_CTX *mem_ctx; WERROR err; @@ -557,7 +557,7 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, } WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, - const char *subkeypath, uint32 desired_access, + const char *subkeypath, uint32_t desired_access, struct registry_key **pkey, enum winreg_CreateAction *paction) { @@ -958,7 +958,7 @@ static WERROR reg_deletekey_recursive_internal(struct registry_key *parent, WERROR werr = WERR_OK; struct registry_key *key; char *subkey_name = NULL; - uint32 i; + uint32_t i; TALLOC_CTX *mem_ctx = talloc_stackframe(); DEBUG(5, ("reg_deletekey_recursive_internal: deleting '%s' from '%s'\n", diff --git a/source3/registry/reg_api.h b/source3/registry/reg_api.h index 41c4792e590..535e4ff3151 100644 --- a/source3/registry/reg_api.h +++ b/source3/registry/reg_api.h @@ -24,16 +24,16 @@ #define _REG_API_H WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, - uint32 desired_access, + uint32_t desired_access, const struct security_token *token, struct registry_key **pkey); WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent, - const char *name, uint32 desired_access, + const char *name, uint32_t desired_access, struct registry_key **pkey); WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **name, NTTIME *last_write_time); + uint32_t idx, char **name, NTTIME *last_write_time); WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **pname, struct registry_value **pval); + uint32_t idx, char **pname, struct registry_value **pval); WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, const char *name, struct registry_value **pval); WERROR reg_querymultiplevalues(TALLOC_CTX *mem_ctx, @@ -48,7 +48,7 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, uint32_t *max_valbufsize, uint32_t *secdescsize, NTTIME *last_changed_time); WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, - const char *subkeypath, uint32 desired_access, + const char *subkeypath, uint32_t desired_access, struct registry_key **pkey, enum winreg_CreateAction *paction); WERROR reg_deletekey(struct registry_key *parent, const char *path); diff --git a/source3/registry/reg_api_util.c b/source3/registry/reg_api_util.c index e86e3e3fc32..b206e7d898e 100644 --- a/source3/registry/reg_api_util.c +++ b/source3/registry/reg_api_util.c @@ -32,7 +32,7 @@ * Utility function to open a complete registry path including the hive prefix. */ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, const struct security_token *token, + uint32_t desired_access, const struct security_token *token, struct registry_key **pkey) { struct registry_key *hive, *key; @@ -89,7 +89,7 @@ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, */ WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, + uint32_t desired_access, const struct security_token *token, enum winreg_CreateAction *paction, struct registry_key **pkey) diff --git a/source3/registry/reg_api_util.h b/source3/registry/reg_api_util.h index b5ce0fdbe47..692d0777efe 100644 --- a/source3/registry/reg_api_util.h +++ b/source3/registry/reg_api_util.h @@ -29,11 +29,11 @@ * Utility function to open a complete registry path including the hive prefix. */ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, const struct security_token *token, + uint32_t desired_access, const struct security_token *token, struct registry_key **pkey); WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, + uint32_t desired_access, const struct security_token *token, enum winreg_CreateAction *paction, struct registry_key **pkey); diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 44a3d9fd356..0cb43d55749 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -153,10 +153,10 @@ static const char *builtin_registry_paths[] = { struct builtin_regkey_value { const char *path; const char *valuename; - uint32 type; + uint32_t type; union { const char *string; - uint32 dw_value; + uint32_t dw_value; } data; }; @@ -286,7 +286,7 @@ static void regdb_ctr_add_value(struct regval_ctr *ctr, case REG_DWORD: regval_ctr_addvalue(ctr, value->valuename, REG_DWORD, (uint8_t *)&value->data.dw_value, - sizeof(uint32)); + sizeof(uint32_t)); break; case REG_SZ: @@ -1037,8 +1037,8 @@ static WERROR regdb_store_keys_internal2(struct db_context *db, TDB_DATA dbuf; uint8 *buffer = NULL; int i = 0; - uint32 len, buflen; - uint32 num_subkeys = regsubkey_ctr_numkeys(ctr); + uint32_t len, buflen; + uint32_t num_subkeys = regsubkey_ctr_numkeys(ctr); char *keyname = NULL; TALLOC_CTX *ctx = talloc_stackframe(); WERROR werr; @@ -1731,7 +1731,7 @@ static WERROR regdb_fetch_keys_internal(struct db_context *db, const char *key, WERROR werr; uint32_t num_items; uint8 *buf; - uint32 buflen, len; + uint32_t buflen, len; int i; fstring subkeyname; TALLOC_CTX *frame = talloc_stackframe(); @@ -1823,11 +1823,11 @@ static int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr) static int regdb_unpack_values(struct regval_ctr *values, uint8 *buf, int buflen) { int len = 0; - uint32 type; + uint32_t type; fstring valuename; - uint32 size; + uint32_t size; uint8 *data_p; - uint32 num_values = 0; + uint32_t num_values = 0; int i; /* loop and unpack the rest of the registry values */ diff --git a/source3/registry/reg_backend_hkpt_params.c b/source3/registry/reg_backend_hkpt_params.c index d34d1acf3ca..2ecfecd011f 100644 --- a/source3/registry/reg_backend_hkpt_params.c +++ b/source3/registry/reg_backend_hkpt_params.c @@ -36,8 +36,8 @@ extern struct registry_ops regdb_ops; static int hkpt_params_fetch_values(const char *key, struct regval_ctr *regvals) { - uint32 base_index; - uint32 buffer_size; + uint32_t base_index; + uint32_t buffer_size; char *buffer = NULL; /* This is ALMOST the same as perflib_009_params, but HKPT has diff --git a/source3/registry/reg_backend_netlogon_params.c b/source3/registry/reg_backend_netlogon_params.c index a98c92e4d69..d7cf3c6f902 100644 --- a/source3/registry/reg_backend_netlogon_params.c +++ b/source3/registry/reg_backend_netlogon_params.c @@ -36,7 +36,7 @@ extern struct registry_ops regdb_ops; static int netlogon_params_fetch_values(const char *key, struct regval_ctr *regvals) { - uint32 dwValue; + uint32_t dwValue; if (!pdb_get_account_policy(PDB_POLICY_REFUSE_MACHINE_PW_CHANGE, &dwValue)) { dwValue = 0; diff --git a/source3/registry/reg_backend_smbconf.c b/source3/registry/reg_backend_smbconf.c index a056654c894..001a5f769c6 100644 --- a/source3/registry/reg_backend_smbconf.c +++ b/source3/registry/reg_backend_smbconf.c @@ -57,8 +57,8 @@ static bool smbconf_store_values(const char *key, struct regval_ctr *val) return regdb_ops.store_values(key, val); } -static bool smbconf_reg_access_check(const char *keyname, uint32 requested, - uint32 *granted, +static bool smbconf_reg_access_check(const char *keyname, uint32_t requested, + uint32_t *granted, const struct security_token *token) { if (!security_token_has_privilege(token, SEC_PRIV_DISK_OPERATOR)) { diff --git a/source3/registry/reg_dispatcher.c b/source3/registry/reg_dispatcher.c index 0f87b27698c..8c94413796d 100644 --- a/source3/registry/reg_dispatcher.c +++ b/source3/registry/reg_dispatcher.c @@ -161,8 +161,8 @@ int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val) underlying registry backend ***********************************************************************/ -bool regkey_access_check(struct registry_key_handle *key, uint32 requested, - uint32 *granted, +bool regkey_access_check(struct registry_key_handle *key, uint32_t requested, + uint32_t *granted, const struct security_token *token ) { struct security_descriptor *sec_desc; diff --git a/source3/registry/reg_dispatcher.h b/source3/registry/reg_dispatcher.h index ec4474629c3..76485b3ffad 100644 --- a/source3/registry/reg_dispatcher.h +++ b/source3/registry/reg_dispatcher.h @@ -29,8 +29,8 @@ WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey, bo int fetch_reg_keys(struct registry_key_handle *key, struct regsubkey_ctr *subkey_ctr); int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val); -bool regkey_access_check(struct registry_key_handle *key, uint32 requested, - uint32 *granted, +bool regkey_access_check(struct registry_key_handle *key, uint32_t requested, + uint32_t *granted, const struct security_token *token); WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key, struct security_descriptor **psecdesc); diff --git a/source3/registry/reg_parse_prs.c b/source3/registry/reg_parse_prs.c index 14aa3fac018..41580f40374 100644 --- a/source3/registry/reg_parse_prs.c +++ b/source3/registry/reg_parse_prs.c @@ -48,7 +48,7 @@ void prs_debug(prs_struct *ps, int depth, const char *desc, const char *fn_name) * @return False if allocation fails, otherwise True. **/ -bool prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, bool io) +bool prs_init(prs_struct *ps, uint32_t size, TALLOC_CTX *ctx, bool io) { ZERO_STRUCTP(ps); ps->io = io; @@ -131,9 +131,9 @@ TALLOC_CTX *prs_get_mem_context(prs_struct *ps) Also depends on the data stream mode (io). ********************************************************************/ -bool prs_grow(prs_struct *ps, uint32 extra_space) +bool prs_grow(prs_struct *ps, uint32_t extra_space) { - uint32 new_size; + uint32_t new_size; ps->grow_size = MAX(ps->grow_size, ps->data_offset + extra_space); @@ -209,7 +209,7 @@ char *prs_data_p(prs_struct *ps) Get the current data size (external interface). ********************************************************************/ -uint32 prs_data_size(prs_struct *ps) +uint32_t prs_data_size(prs_struct *ps) { return ps->buffer_size; } @@ -218,7 +218,7 @@ uint32 prs_data_size(prs_struct *ps) Fetch the current offset (external interface). ********************************************************************/ -uint32 prs_offset(prs_struct *ps) +uint32_t prs_offset(prs_struct *ps) { return ps->data_offset; } @@ -227,7 +227,7 @@ uint32 prs_offset(prs_struct *ps) Set the current offset (external interface). ********************************************************************/ -bool prs_set_offset(prs_struct *ps, uint32 offset) +bool prs_set_offset(prs_struct *ps, uint32_t offset) { if ((offset > ps->data_offset) && !prs_grow(ps, offset - ps->data_offset)) { @@ -242,7 +242,7 @@ bool prs_set_offset(prs_struct *ps, uint32 offset) Append the data from a buffer into a parse_struct. ********************************************************************/ -bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len) +bool prs_copy_data_in(prs_struct *dst, const char *src, uint32_t len) { if (len == 0) return True; @@ -263,10 +263,10 @@ bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len) bool prs_align(prs_struct *ps) { - uint32 mod = ps->data_offset & (ps->align-1); + uint32_t mod = ps->data_offset & (ps->align-1); if (ps->align != 0 && mod != 0) { - uint32 extra_space = (ps->align - mod); + uint32_t extra_space = (ps->align - mod); if(!prs_grow(ps, extra_space)) return False; memset(&ps->data_p[ps->data_offset], '\0', (size_t)extra_space); @@ -296,7 +296,7 @@ bool prs_align_uint64(prs_struct *ps) Ensure we can read/write to a given offset. ********************************************************************/ -char *prs_mem_get(prs_struct *ps, uint32 extra_size) +char *prs_mem_get(prs_struct *ps, uint32_t extra_size) { if(UNMARSHALLING(ps)) { /* @@ -362,9 +362,9 @@ bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16) Stream a uint32. ********************************************************************/ -bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32) +bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32_t *data32) { - char *q = prs_mem_get(ps, sizeof(uint32)); + char *q = prs_mem_get(ps, sizeof(uint32_t)); if (q == NULL) return False; @@ -382,7 +382,7 @@ bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32) DEBUGADD(5,("%s%04x %s: %08x\n", tab_depth(5,depth), ps->data_offset, name, *data32)); - ps->data_offset += sizeof(uint32); + ps->data_offset += sizeof(uint32_t); return True; } @@ -393,7 +393,7 @@ bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32) bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64) { if (UNMARSHALLING(ps)) { - uint32 high, low; + uint32_t high, low; if (!prs_uint32(name, ps, depth+1, &low)) return False; @@ -405,7 +405,7 @@ bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64) return True; } else { - uint32 high = (*data64) >> 32, low = (*data64) & 0xFFFFFFFF; + uint32_t high = (*data64) >> 32, low = (*data64) & 0xFFFFFFFF; return prs_uint32(name, ps, depth+1, &low) && prs_uint32(name, ps, depth+1, &high); } diff --git a/source3/registry/reg_parse_prs.h b/source3/registry/reg_parse_prs.h index 29940152729..de69a684ea1 100644 --- a/source3/registry/reg_parse_prs.h +++ b/source3/registry/reg_parse_prs.h @@ -35,9 +35,9 @@ typedef struct _prs_struct { bool bigendian_data; uint8 align; /* data alignment */ bool is_dynamic; /* Do we own this memory or not ? */ - uint32 data_offset; /* Current working offset into data. */ - uint32 buffer_size; /* Current allocated size of the buffer. */ - uint32 grow_size; /* size requested via prs_grow() calls */ + uint32_t data_offset; /* Current working offset into data. */ + uint32_t buffer_size; /* Current allocated size of the buffer. */ + uint32_t grow_size; /* size requested via prs_grow() calls */ /* The buffer itself. If "is_dynamic" is true this * MUST BE TALLOC'ed off mem_ctx. */ char *data_p; @@ -57,23 +57,23 @@ typedef struct _prs_struct { #define RPC_PARSE_ALIGN 4 void prs_debug(prs_struct *ps, int depth, const char *desc, const char *fn_name); -bool prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, bool io); +bool prs_init(prs_struct *ps, uint32_t size, TALLOC_CTX *ctx, bool io); void prs_mem_free(prs_struct *ps); char *prs_alloc_mem_(prs_struct *ps, size_t size, unsigned int count); char *prs_alloc_mem(prs_struct *ps, size_t size, unsigned int count); TALLOC_CTX *prs_get_mem_context(prs_struct *ps); -bool prs_grow(prs_struct *ps, uint32 extra_space); +bool prs_grow(prs_struct *ps, uint32_t extra_space); char *prs_data_p(prs_struct *ps); -uint32 prs_data_size(prs_struct *ps); -uint32 prs_offset(prs_struct *ps); -bool prs_set_offset(prs_struct *ps, uint32 offset); -bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len); +uint32_t prs_data_size(prs_struct *ps); +uint32_t prs_offset(prs_struct *ps); +bool prs_set_offset(prs_struct *ps, uint32_t offset); +bool prs_copy_data_in(prs_struct *dst, const char *src, uint32_t len); bool prs_align(prs_struct *ps); bool prs_align_uint64(prs_struct *ps); -char *prs_mem_get(prs_struct *ps, uint32 extra_size); +char *prs_mem_get(prs_struct *ps, uint32_t extra_size); 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 *data32); +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); diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c index 57ce3075eb9..8ec6e1465ab 100644 --- a/source3/registry/reg_perfcount.c +++ b/source3/registry/reg_perfcount.c @@ -72,13 +72,13 @@ static char *counters_directory(const char *dbname) /********************************************************************* *********************************************************************/ -uint32 reg_perfcount_get_base_index(void) +uint32_t reg_perfcount_get_base_index(void) { char *fname; TDB_CONTEXT *names; TDB_DATA kbuf, dbuf; char key[] = "1"; - uint32 retval = 0; + uint32_t retval = 0; char buf[PERFCOUNT_MAX_LEN]; fname = counters_directory(NAMES_DB); @@ -121,7 +121,7 @@ uint32 reg_perfcount_get_base_index(void) TALLOC_FREE(fname); memset(buf, 0, PERFCOUNT_MAX_LEN); memcpy(buf, dbuf.dptr, dbuf.dsize); - retval = (uint32)atoi(buf); + retval = (uint32_t)atoi(buf); SAFE_FREE(dbuf.dptr); return retval; } @@ -129,9 +129,9 @@ uint32 reg_perfcount_get_base_index(void) /********************************************************************* *********************************************************************/ -uint32 reg_perfcount_get_last_counter(uint32 base_index) +uint32_t reg_perfcount_get_last_counter(uint32_t base_index) { - uint32 retval; + uint32_t retval; if(base_index == 0) retval = 0; @@ -144,9 +144,9 @@ uint32 reg_perfcount_get_last_counter(uint32 base_index) /********************************************************************* *********************************************************************/ -uint32 reg_perfcount_get_last_help(uint32 last_counter) +uint32_t reg_perfcount_get_last_help(uint32_t last_counter) { - uint32 retval; + uint32_t retval; if(last_counter == 0) retval = 0; @@ -160,15 +160,15 @@ uint32 reg_perfcount_get_last_help(uint32 last_counter) /********************************************************************* *********************************************************************/ -static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, +static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, int keyval, char **retbuf, - uint32 buffer_size) + uint32_t buffer_size) { TDB_DATA kbuf, dbuf; char temp[256]; char *buf1 = *retbuf; - uint32 working_size = 0; + uint32_t working_size = 0; DATA_BLOB name_index, name; bool ok; @@ -224,10 +224,10 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb, /********************************************************************* *********************************************************************/ -uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf) +uint32_t reg_perfcount_get_counter_help(uint32_t base_index, char **retbuf) { char *buf1 = NULL; - uint32 buffer_size = 0; + uint32_t buffer_size = 0; TDB_CONTEXT *names; char *fname; int i; @@ -274,10 +274,10 @@ uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf) /********************************************************************* *********************************************************************/ -uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf) +uint32_t reg_perfcount_get_counter_names(uint32_t base_index, char **retbuf) { char *buf1 = NULL; - uint32 buffer_size = 0; + uint32_t buffer_size = 0; TDB_CONTEXT *names; char *fname; int i; @@ -376,7 +376,7 @@ static bool _reg_perfcount_ischild(TDB_DATA data) /********************************************************************* *********************************************************************/ -static uint32 _reg_perfcount_get_numinst(int objInd, TDB_CONTEXT *names) +static uint32_t _reg_perfcount_get_numinst(int objInd, TDB_CONTEXT *names) { TDB_DATA key, data; char buf[PERFCOUNT_MAX_LEN]; @@ -385,12 +385,12 @@ static uint32 _reg_perfcount_get_numinst(int objInd, TDB_CONTEXT *names) data = tdb_fetch(names, key); if(data.dptr == NULL) - return (uint32)PERF_NO_INSTANCES; + return (uint32_t)PERF_NO_INSTANCES; memset(buf, 0, PERFCOUNT_MAX_LEN); memcpy(buf, data.dptr, data.dsize); SAFE_FREE(data.dptr); - return (uint32)atoi(buf); + return (uint32_t)atoi(buf); } /********************************************************************* @@ -428,7 +428,7 @@ static bool _reg_perfcount_add_object(struct PERF_DATA_BLOCK *block, block->objects[block->NumObjectTypes].NumInstances = _reg_perfcount_get_numinst(num, names); block->objects[block->NumObjectTypes].counters = NULL; block->objects[block->NumObjectTypes].instances = NULL; - block->objects[block->NumObjectTypes].counter_data.ByteLength = sizeof(uint32); + block->objects[block->NumObjectTypes].counter_data.ByteLength = sizeof(uint32_t); block->objects[block->NumObjectTypes].counter_data.data = NULL; block->objects[block->NumObjectTypes].DetailLevel = PERF_DETAIL_NOVICE; block->NumObjectTypes+=1; @@ -472,9 +472,9 @@ static bool _reg_perfcount_get_counter_data(TDB_DATA key, TDB_DATA *data) /********************************************************************* *********************************************************************/ -static uint32 _reg_perfcount_get_size_field(uint32 CounterType) +static uint32_t _reg_perfcount_get_size_field(uint32_t CounterType) { - uint32 retval; + uint32_t retval; retval = CounterType; @@ -489,7 +489,7 @@ static uint32 _reg_perfcount_get_size_field(uint32 CounterType) /********************************************************************* *********************************************************************/ -static uint32 _reg_perfcount_compute_scale(int64_t data) +static uint32_t _reg_perfcount_compute_scale(int64_t data) { int scale = 0; if(data == 0) @@ -505,7 +505,7 @@ static uint32 _reg_perfcount_compute_scale(int64_t data) scale++; } - return (uint32)scale; + return (uint32_t)scale; } /********************************************************************* @@ -522,7 +522,7 @@ static bool _reg_perfcount_get_counter_info(struct PERF_DATA_BLOCK *block, size_t dsize, padding; long int data32, dbuf[2]; int64_t data64; - uint32 counter_size; + uint32_t counter_size; obj->counters[obj->NumCounters].DefaultScale = 0; dbuf[0] = dbuf[1] = 0; @@ -591,20 +591,20 @@ static bool _reg_perfcount_get_counter_info(struct PERF_DATA_BLOCK *block, obj->counter_data.data = talloc_realloc(mem_ctx, obj->counter_data.data, uint8, - obj->counter_data.ByteLength - sizeof(uint32)); + obj->counter_data.ByteLength - sizeof(uint32_t)); if(obj->counter_data.data == NULL) return False; if(dbuf[0] != 0 || dbuf[1] != 0) { memcpy((void *)(obj->counter_data.data + - (obj->counter_data.ByteLength - (sizeof(uint32) + dsize))), + (obj->counter_data.ByteLength - (sizeof(uint32_t) + dsize))), (const void *)dbuf, dsize); } else { /* Handling PERF_SIZE_VARIABLE_LEN */ memcpy((void *)(obj->counter_data.data + - (obj->counter_data.ByteLength - (sizeof(uint32) + dsize))), + (obj->counter_data.ByteLength - (sizeof(uint32_t) + dsize))), (const void *)buf, dsize); } obj->counters[obj->NumCounters].CounterOffset = obj->counter_data.ByteLength - dsize; @@ -775,7 +775,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in inst->ParentObjectTitleIndex = 0; inst->ParentObjectTitlePointer = 0; inst->UniqueID = PERF_NO_UNIQUE_ID; - inst->NameOffset = 6 * sizeof(uint32); + inst->NameOffset = 6 * sizeof(uint32_t); inst->ByteLength = inst->NameOffset + inst->NameLength; /* Need to be aligned on a 64-bit boundary here for counter_data */ @@ -1017,7 +1017,7 @@ err_out: /********************************************************************* *********************************************************************/ -static uint32 _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block, TALLOC_CTX *mem_ctx) +static uint32_t _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block, TALLOC_CTX *mem_ctx) { int obj, cnt, inst, pad, i; struct PERF_OBJECT_TYPE *object; @@ -1111,13 +1111,13 @@ static uint32 _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block /********************************************************************* *********************************************************************/ -static uint32 reg_perfcount_get_perf_data_block(uint32 base_index, +static uint32_t reg_perfcount_get_perf_data_block(uint32_t base_index, TALLOC_CTX *mem_ctx, struct PERF_DATA_BLOCK *block, const char *object_ids, bool bigendian_data) { - uint32 buffer_size = 0; + uint32_t buffer_size = 0; char *fname; TDB_CONTEXT *names; int retval = 0; @@ -1296,7 +1296,7 @@ static bool _reg_perfcount_marshall_perf_counter_data(prs_struct *ps, if(!prs_uint32("ByteLength", ps, depth, &counter_data.ByteLength)) return False; - if(!prs_uint8s(False, "CounterData", ps, depth, counter_data.data, counter_data.ByteLength - sizeof(uint32))) + if(!prs_uint8s(False, "CounterData", ps, depth, counter_data.data, counter_data.ByteLength - sizeof(uint32_t))) return False; if(!prs_align_uint64(ps)) return False; @@ -1418,7 +1418,7 @@ static bool _reg_perfcount_marshall_perf_objects(prs_struct *ps, struct PERF_DAT /********************************************************************* *********************************************************************/ -WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids) +WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32_t max_buf_size, uint32_t *outbuf_len, const char *object_ids) { /* * For a detailed description of the layout of this structure, @@ -1429,7 +1429,7 @@ WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbu * http://msdn2.microsoft.com/en-us/library/aa373105.aspx -- vl */ struct PERF_DATA_BLOCK block; - uint32 buffer_size, base_index; + uint32_t buffer_size, base_index; buffer_size = 0; base_index = reg_perfcount_get_base_index(); diff --git a/source3/registry/reg_perfcount.h b/source3/registry/reg_perfcount.h index 515790ac522..eb5cb221007 100644 --- a/source3/registry/reg_perfcount.h +++ b/source3/registry/reg_perfcount.h @@ -24,11 +24,11 @@ #include "reg_parse_prs.h" -uint32 reg_perfcount_get_base_index(void); -uint32 reg_perfcount_get_last_counter(uint32 base_index); -uint32 reg_perfcount_get_last_help(uint32 last_counter); -uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf); -uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf); -WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids); +uint32_t reg_perfcount_get_base_index(void); +uint32_t reg_perfcount_get_last_counter(uint32_t base_index); +uint32_t reg_perfcount_get_last_help(uint32_t last_counter); +uint32_t reg_perfcount_get_counter_help(uint32_t base_index, char **retbuf); +uint32_t reg_perfcount_get_counter_names(uint32_t base_index, char **retbuf); +WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32_t max_buf_size, uint32_t *outbuf_len, const char *object_ids); #endif /* _REG_PERFCOUNT_H */ diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index e49de2625e5..6feea47ed53 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -45,7 +45,7 @@ static bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth) { - uint32 low, high; + uint32_t low, high; if (nttime == NULL) return False; @@ -75,11 +75,11 @@ static bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int de /******************************************************************* *******************************************************************/ -static int write_block( REGF_FILE *file, prs_struct *ps, uint32 offset ) +static int write_block( REGF_FILE *file, prs_struct *ps, uint32_t offset ) { int bytes_written, returned; char *buffer = prs_data_p( ps ); - uint32 buffer_size = prs_data_size( ps ); + uint32_t buffer_size = prs_data_size( ps ); SMB_STRUCT_STAT sbuf; if ( file->fd == -1 ) @@ -113,7 +113,7 @@ static int write_block( REGF_FILE *file, prs_struct *ps, uint32 offset ) /******************************************************************* *******************************************************************/ -static int read_block( REGF_FILE *file, prs_struct *ps, uint32 file_offset, uint32 block_size ) +static int read_block( REGF_FILE *file, prs_struct *ps, uint32_t file_offset, uint32_t block_size ) { int bytes_read, returned; char *buffer; @@ -199,9 +199,9 @@ static bool write_hbin_block( REGF_FILE *file, REGF_HBIN *hbin ) /* write free space record if any is available */ if ( hbin->free_off != REGF_OFFSET_NONE ) { - uint32 header = 0xffffffff; + uint32_t header = 0xffffffff; - if ( !prs_set_offset( &hbin->ps, hbin->free_off-sizeof(uint32) ) ) + if ( !prs_set_offset( &hbin->ps, hbin->free_off-sizeof(uint32_t) ) ) return False; if ( !prs_uint32( "free_size", &hbin->ps, 0, &hbin->free_size ) ) return False; @@ -303,7 +303,7 @@ static bool prs_regf_block( const char *desc, prs_struct *ps, int depth, REGF_FI static bool prs_hbin_block( const char *desc, prs_struct *ps, int depth, REGF_HBIN *hbin ) { - uint32 block_size2; + uint32_t block_size2; prs_debug(ps, depth, desc, "prs_regf_block"); depth++; @@ -339,9 +339,9 @@ 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; - uint32 start; - uint32 data_size, start_off, end_off; - uint32 unknown_off = REGF_OFFSET_NONE; + uint32_t start; + uint32_t data_size, start_off, end_off; + uint32_t unknown_off = REGF_OFFSET_NONE; nk->hbin_off = prs_offset( ps ); start = nk->hbin_off; @@ -351,7 +351,7 @@ static bool prs_nk_rec( const char *desc, prs_struct *ps, int depth, REGF_NK_REC /* back up and get the data_size */ - if ( !prs_set_offset( ps, prs_offset(ps)-sizeof(uint32)) ) + if ( !prs_set_offset( ps, prs_offset(ps)-sizeof(uint32_t)) ) return False; start_off = prs_offset( ps ); if ( !prs_uint32( "rec_size", ps, depth, &nk->rec_size )) @@ -442,10 +442,10 @@ static bool prs_nk_rec( const char *desc, prs_struct *ps, int depth, REGF_NK_REC /******************************************************************* *******************************************************************/ -static uint32 regf_block_checksum( prs_struct *ps ) +static uint32_t regf_block_checksum( prs_struct *ps ) { char *buffer = prs_data_p( ps ); - uint32 checksum, x; + uint32_t checksum, x; int i; /* XOR of all bytes 0x0000 - 0x01FB */ @@ -466,7 +466,7 @@ static uint32 regf_block_checksum( prs_struct *ps ) static bool read_regf_block( REGF_FILE *file ) { prs_struct ps; - uint32 checksum; + uint32_t checksum; /* grab the first block from the file */ @@ -496,7 +496,7 @@ static bool read_regf_block( REGF_FILE *file ) static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) { REGF_HBIN *hbin; - uint32 record_size, curr_off, block_size, header; + uint32_t record_size, curr_off, block_size, header; if ( !(hbin = talloc_zero(file->mem_ctx, REGF_HBIN)) ) return NULL; @@ -521,7 +521,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) /* remember that the record_size is in the 4 bytes preceeding the record itself */ - if ( !prs_set_offset( &hbin->ps, file->data_offset+HBIN_HDR_SIZE-sizeof(uint32) ) ) + if ( !prs_set_offset( &hbin->ps, file->data_offset+HBIN_HDR_SIZE-sizeof(uint32_t) ) ) return NULL; record_size = 0; @@ -567,7 +567,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) /* account for the fact that the curr_off is 4 bytes behind the actual record header */ - hbin->free_off = curr_off + sizeof(uint32); + hbin->free_off = curr_off + sizeof(uint32_t); hbin->free_size = record_size; } @@ -584,7 +584,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) block for it *******************************************************************/ -static bool hbin_contains_offset( REGF_HBIN *hbin, uint32 offset ) +static bool hbin_contains_offset( REGF_HBIN *hbin, uint32_t offset ) { if ( !hbin ) return False; @@ -600,10 +600,10 @@ static bool hbin_contains_offset( REGF_HBIN *hbin, uint32 offset ) block for it *******************************************************************/ -static REGF_HBIN* lookup_hbin_block( REGF_FILE *file, uint32 offset ) +static REGF_HBIN* lookup_hbin_block( REGF_FILE *file, uint32_t offset ) { REGF_HBIN *hbin = NULL; - uint32 block_off; + uint32_t block_off; /* start with the open list */ @@ -659,7 +659,7 @@ static bool hbin_prs_lf_records( const char *desc, REGF_HBIN *hbin, int depth, R { int i; REGF_LF_REC *lf = &nk->subkeys; - uint32 data_size, start_off, end_off; + uint32_t data_size, start_off, end_off; prs_debug(&hbin->ps, depth, desc, "prs_lf_records"); depth++; @@ -676,7 +676,7 @@ static bool hbin_prs_lf_records( const char *desc, REGF_HBIN *hbin, int depth, R /* backup and get the data_size */ - if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32)) ) + if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32_t)) ) return False; start_off = prs_offset( &hbin->ps ); if ( !prs_uint32( "rec_size", &hbin->ps, depth, &lf->rec_size )) @@ -723,7 +723,7 @@ static bool hbin_prs_sk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_ { prs_struct *ps = &hbin->ps; uint16 tag = 0xFFFF; - uint32 data_size, start_off, end_off; + uint32_t data_size, start_off, end_off; prs_debug(ps, depth, desc, "hbin_prs_sk_rec"); @@ -734,7 +734,7 @@ static bool hbin_prs_sk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_ /* backup and get the data_size */ - if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32)) ) + if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32_t)) ) return False; start_off = prs_offset( &hbin->ps ); if ( !prs_uint32( "rec_size", &hbin->ps, depth, &sk->rec_size )) @@ -800,17 +800,17 @@ 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 offset; + uint32_t offset; uint16 name_length; prs_struct *ps = &hbin->ps; - uint32 data_size, start_off, end_off; + uint32_t data_size, start_off, end_off; prs_debug(ps, depth, desc, "prs_vk_rec"); depth++; /* backup and get the data_size */ - if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32)) ) + if ( !prs_set_offset( &hbin->ps, prs_offset(&hbin->ps)-sizeof(uint32_t)) ) return False; start_off = prs_offset( &hbin->ps ); if ( !prs_uint32( "rec_size", &hbin->ps, depth, &vk->rec_size )) @@ -863,7 +863,7 @@ static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_ if ( !(vk->data_size & VK_DATA_IN_OFFSET) ) { REGF_HBIN *hblock = hbin; - uint32 data_rec_size; + uint32_t data_rec_size; if ( UNMARSHALLING(&hbin->ps) ) { if ( !(vk->data = PRS_ALLOC_MEM( ps, uint8, vk->data_size) ) ) @@ -875,11 +875,11 @@ static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_ if ( !(hblock = lookup_hbin_block( file, vk->data_off )) ) return False; } - if ( !(prs_set_offset( &hblock->ps, (vk->data_off+HBIN_HDR_SIZE-hblock->first_hbin_off)-sizeof(uint32) )) ) + if ( !(prs_set_offset( &hblock->ps, (vk->data_off+HBIN_HDR_SIZE-hblock->first_hbin_off)-sizeof(uint32_t) )) ) return False; if ( MARSHALLING(&hblock->ps) ) { - data_rec_size = ( (vk->data_size+sizeof(uint32)) & 0xfffffff8 ) + 8; + data_rec_size = ( (vk->data_size+sizeof(uint32_t)) & 0xfffffff8 ) + 8; data_rec_size = ( data_rec_size - 1 ) ^ 0xFFFFFFFF; } if ( !prs_uint32( "data_rec_size", &hblock->ps, depth, &data_rec_size )) @@ -918,7 +918,7 @@ static bool hbin_prs_vk_rec( const char *desc, REGF_HBIN *hbin, int depth, REGF_ static bool hbin_prs_vk_records( const char *desc, REGF_HBIN *hbin, int depth, REGF_NK_REC *nk, REGF_FILE *file ) { int i; - uint32 record_size; + uint32_t record_size; prs_debug(&hbin->ps, depth, desc, "prs_vk_records"); depth++; @@ -935,11 +935,11 @@ static bool hbin_prs_vk_records( const char *desc, REGF_HBIN *hbin, int depth, R /* convert the offset to something relative to this HBIN block */ - if ( !prs_set_offset( &hbin->ps, nk->values_off+HBIN_HDR_SIZE-hbin->first_hbin_off-sizeof(uint32)) ) + if ( !prs_set_offset( &hbin->ps, nk->values_off+HBIN_HDR_SIZE-hbin->first_hbin_off-sizeof(uint32_t)) ) return False; if ( MARSHALLING( &hbin->ps) ) { - record_size = ( ( nk->num_values * sizeof(uint32) ) & 0xfffffff8 ) + 8; + record_size = ( ( nk->num_values * sizeof(uint32_t) ) & 0xfffffff8 ) + 8; record_size = (record_size - 1) ^ 0xFFFFFFFF; } @@ -953,7 +953,7 @@ static bool hbin_prs_vk_records( const char *desc, REGF_HBIN *hbin, int depth, R for ( i=0; i<nk->num_values; i++ ) { REGF_HBIN *sub_hbin = hbin; - uint32 new_offset; + uint32_t new_offset; if ( !hbin_contains_offset( hbin, nk->values[i].rec_off ) ) { sub_hbin = lookup_hbin_block( file, nk->values[i].rec_off ); @@ -982,7 +982,7 @@ static bool hbin_prs_vk_records( const char *desc, REGF_HBIN *hbin, int depth, R /******************************************************************* *******************************************************************/ -static REGF_SK_REC* find_sk_record_by_offset( REGF_FILE *file, uint32 offset ) +static REGF_SK_REC* find_sk_record_by_offset( REGF_FILE *file, uint32_t offset ) { REGF_SK_REC *p_sk; @@ -1096,8 +1096,8 @@ 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]; - uint32 record_size; - uint32 curr_off, block_size; + uint32_t record_size; + uint32_t curr_off, block_size; bool found = False; prs_struct *ps = &hbin->ps; @@ -1108,7 +1108,7 @@ static bool next_record( REGF_HBIN *hbin, const char *hdr, bool *eob ) /* assume that the current offset is at the record header and we need to backup to read the record size */ - curr_off -= sizeof(uint32); + curr_off -= sizeof(uint32_t); block_size = prs_data_size( ps ); record_size = 0; @@ -1134,7 +1134,7 @@ static bool next_record( REGF_HBIN *hbin, const char *hdr, bool *eob ) if ( memcmp( header, hdr, REC_HDR_SIZE ) == 0 ) { found = True; - curr_off += sizeof(uint32); + curr_off += sizeof(uint32_t); } } @@ -1374,7 +1374,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) { REGF_NK_REC *nk; REGF_HBIN *hbin; - uint32 offset = REGF_BLOCKSIZE; + uint32_t offset = REGF_BLOCKSIZE; bool found = False; bool eob; @@ -1429,7 +1429,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) { REGF_NK_REC *subkey; REGF_HBIN *hbin; - uint32 nk_offset; + uint32_t nk_offset; /* see if there is anything left to report */ @@ -1462,7 +1462,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) /******************************************************************* *******************************************************************/ -static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size ) +static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32_t block_size ) { REGF_HBIN *hbin; SMB_STRUCT_STAT sbuf; @@ -1481,7 +1481,7 @@ static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size ) hbin->file_off = sbuf.st_ex_size; hbin->free_off = HBIN_HEADER_REC_SIZE; - hbin->free_size = block_size - hbin->free_off + sizeof(uint32); + hbin->free_size = block_size - hbin->free_off + sizeof(uint32_t); hbin->block_size = block_size; hbin->first_hbin_off = hbin->file_off - REGF_BLOCKSIZE; @@ -1503,7 +1503,7 @@ static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size ) /******************************************************************* *******************************************************************/ -static void update_free_space( REGF_HBIN *hbin, uint32 size_used ) +static void update_free_space( REGF_HBIN *hbin, uint32_t size_used ) { hbin->free_off += size_used; hbin->free_size -= size_used; @@ -1518,10 +1518,10 @@ static void update_free_space( REGF_HBIN *hbin, uint32 size_used ) /******************************************************************* *******************************************************************/ -static REGF_HBIN* find_free_space( REGF_FILE *file, uint32 size ) +static REGF_HBIN* find_free_space( REGF_FILE *file, uint32_t size ) { REGF_HBIN *hbin, *p_hbin; - uint32 block_off; + uint32_t block_off; bool cached; /* check open block list */ @@ -1577,7 +1577,7 @@ static REGF_HBIN* find_free_space( REGF_FILE *file, uint32 size ) /* no free space; allocate a new one */ if ( !hbin ) { - uint32 alloc_size; + uint32_t alloc_size; /* allocate in multiples of REGF_ALLOC_BLOCK; make sure (size + hbin_header) fits */ @@ -1593,7 +1593,7 @@ static REGF_HBIN* find_free_space( REGF_FILE *file, uint32 size ) done: /* set the offset to be ready to write */ - if ( !prs_set_offset( &hbin->ps, hbin->free_off-sizeof(uint32) ) ) + if ( !prs_set_offset( &hbin->ps, hbin->free_off-sizeof(uint32_t) ) ) return NULL; /* write the record size as a placeholder for now, it should be @@ -1611,15 +1611,15 @@ done: /******************************************************************* *******************************************************************/ -static uint32 sk_record_data_size( struct security_descriptor * sd ) +static uint32_t sk_record_data_size( struct security_descriptor * sd ) { - uint32 size, size_mod8; + uint32_t size, size_mod8; size_mod8 = 0; /* the record size is sizeof(hdr) + name + static members + data_size_field */ - size = sizeof(uint32)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32); + size = sizeof(uint32_t)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32); /* multiple of 8 */ size_mod8 = size & 0xfffffff8; @@ -1632,15 +1632,15 @@ static uint32 sk_record_data_size( struct security_descriptor * sd ) /******************************************************************* *******************************************************************/ -static uint32 vk_record_data_size( REGF_VK_REC *vk ) +static uint32_t vk_record_data_size( REGF_VK_REC *vk ) { - uint32 size, size_mod8; + uint32_t size, size_mod8; size_mod8 = 0; /* the record size is sizeof(hdr) + name + static members + data_size_field */ - size = REC_HDR_SIZE + (sizeof(uint16)*3) + (sizeof(uint32)*3) + sizeof(uint32); + size = REC_HDR_SIZE + (sizeof(uint16)*3) + (sizeof(uint32_t)*3) + sizeof(uint32); if ( vk->valuename ) size += strlen(vk->valuename); @@ -1656,15 +1656,15 @@ static uint32 vk_record_data_size( REGF_VK_REC *vk ) /******************************************************************* *******************************************************************/ -static uint32 lf_record_data_size( uint32 num_keys ) +static uint32_t lf_record_data_size( uint32_t num_keys ) { - uint32 size, size_mod8; + uint32_t size, size_mod8; size_mod8 = 0; - /* the record size is sizeof(hdr) + num_keys + sizeof of hash_array + data_size_uint32 */ + /* 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); + size = REC_HDR_SIZE + sizeof(uint16) + (sizeof(REGF_HASH_REC) * num_keys) + sizeof(uint32_t); /* multiple of 8 */ size_mod8 = size & 0xfffffff8; @@ -1677,15 +1677,15 @@ static uint32 lf_record_data_size( uint32 num_keys ) /******************************************************************* *******************************************************************/ -static uint32 nk_record_data_size( REGF_NK_REC *nk ) +static uint32_t nk_record_data_size( REGF_NK_REC *nk ) { - uint32 size, size_mod8; + uint32_t size, size_mod8; size_mod8 = 0; - /* the record size is static + length_of_keyname + length_of_classname + data_size_uint32 */ + /* the record size is static + length_of_keyname + length_of_classname + data_size_uint32_t */ - size = 0x4c + strlen(nk->keyname) + sizeof(uint32); + size = 0x4c + strlen(nk->keyname) + sizeof(uint32_t); if ( nk->classname ) size += strlen( nk->classname ); @@ -1719,8 +1719,8 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk, vk->data_size = regval_size( value ); vk->type = regval_type( value ); - if ( vk->data_size > sizeof(uint32) ) { - uint32 data_size = ( (vk->data_size+sizeof(uint32)) & 0xfffffff8 ) + 8; + 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, regval_data_p(value), @@ -1765,7 +1765,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) { REGF_NK_REC *nk; REGF_HBIN *vlist_hbin = NULL; - uint32 size; + uint32_t size; if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) return NULL; @@ -1806,7 +1806,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) REGF_HASH_REC *hash = &parent->subkeys.hashes[parent->subkey_index]; hash->nk_off = prs_offset( &nk->hbin->ps ) + nk->hbin->first_hbin_off - HBIN_HDR_SIZE; - memcpy(hash->keycheck, name, MIN(strlen(name),sizeof(uint32))); + memcpy(hash->keycheck, name, MIN(strlen(name),sizeof(uint32_t))); hash->fullname = talloc_strdup( file->mem_ctx, name ); parent->subkey_index++; @@ -1821,7 +1821,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->sk_off = REGF_OFFSET_NONE; if ( sec_desc ) { - uint32 sk_size = sk_record_data_size( sec_desc ); + uint32_t sk_size = sk_record_data_size( sec_desc ); REGF_HBIN *sk_hbin; /* search for it in the existing list of sd's */ @@ -1850,7 +1850,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) /* size value must be self-inclusive */ nk->sec_desc->size = ndr_size_security_descriptor(sec_desc, 0) - + sizeof(uint32); + + sizeof(uint32_t); DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, REGF_SK_REC *); @@ -1885,8 +1885,8 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->subkeys_off = REGF_OFFSET_NONE; if ( (nk->num_subkeys = regsubkey_ctr_numkeys( subkeys )) != 0 ) { - uint32 lf_size = lf_record_data_size( nk->num_subkeys ); - uint32 namelen; + uint32_t lf_size = lf_record_data_size( nk->num_subkeys ); + uint32_t namelen; int i; if (!(nk->subkeys.hbin = find_free_space( file, lf_size ))) { @@ -1919,7 +1919,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->values_off = REGF_OFFSET_NONE; if ( (nk->num_values = regval_ctr_numvals( values )) != 0 ) { - uint32 vlist_size = ( ( nk->num_values * sizeof(uint32) ) & 0xfffffff8 ) + 8; + uint32_t vlist_size = ( ( nk->num_values * sizeof(uint32_t) ) & 0xfffffff8 ) + 8; int i; if (!(vlist_hbin = find_free_space( file, vlist_size ))) { @@ -1937,7 +1937,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) /* create the vk records */ for ( i=0; i<nk->num_values; i++ ) { - uint32 vk_size, namelen, datalen; + uint32_t vk_size, namelen, datalen; struct regval_blob *r; r = regval_ctr_specific_value( values, i ); diff --git a/source3/registry/regfio.h b/source3/registry/regfio.h index 3c2b6560bfa..71365c064b1 100644 --- a/source3/registry/regfio.h +++ b/source3/registry/regfio.h @@ -64,14 +64,14 @@ struct regsubkey_ctr; struct regf_hbin; typedef struct regf_hbin { struct regf_hbin *prev, *next; - uint32 file_off; /* my offset in the registry file */ - uint32 free_off; /* offset to free space within the hbin record */ - uint32 free_size; /* amount of data left in the block */ + uint32_t file_off; /* my offset in the registry file */ + uint32_t free_off; /* offset to free space within the hbin record */ + uint32_t free_size; /* amount of data left in the block */ int ref_count; /* how many active records are pointing to this block (not used currently) */ char header[HBIN_HDR_SIZE]; /* "hbin" */ - uint32 first_hbin_off; /* offset from first hbin block */ - uint32 block_size; /* block size of this blockually a multiple of 4096Kb) */ + uint32_t first_hbin_off; /* offset from first hbin block */ + uint32_t block_size; /* block size of this blockually a multiple of 4096Kb) */ prs_struct ps; /* data */ @@ -81,15 +81,15 @@ typedef struct regf_hbin { /* ??? List -- list of key offsets and hashed names for consistency */ typedef struct { - uint32 nk_off; - uint8 keycheck[sizeof(uint32)]; + uint32_t nk_off; + uint8 keycheck[sizeof(uint32_t)]; char *fullname; } REGF_HASH_REC; typedef struct { REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing this nk record */ - uint32 hbin_off; /* offset from beginning of this hbin block */ - uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ + uint32_t hbin_off; /* offset from beginning of this hbin block */ + uint32_t rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ char header[REC_HDR_SIZE]; uint16 num_keys; @@ -100,16 +100,16 @@ typedef struct { typedef struct { REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing this nk record */ - uint32 hbin_off; /* offset from beginning of this hbin block */ - uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ - uint32 rec_off; /* offset stored in the value list */ + uint32_t hbin_off; /* offset from beginning of this hbin block */ + uint32_t rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ + uint32_t rec_off; /* offset stored in the value list */ char header[REC_HDR_SIZE]; char *valuename; - uint32 data_size; - uint32 data_off; + uint32_t data_size; + uint32_t data_off; uint8 *data; - uint32 type; + uint32_t type; uint16 flag; } REGF_VK_REC; @@ -120,17 +120,17 @@ struct _regf_sk_rec; typedef struct _regf_sk_rec { struct _regf_sk_rec *next, *prev; REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing this nk record */ - uint32 hbin_off; /* offset from beginning of this hbin block */ - uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ + uint32_t hbin_off; /* offset from beginning of this hbin block */ + uint32_t rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ - uint32 sk_off; /* offset parsed from NK record used as a key + uint32_t sk_off; /* offset parsed from NK record used as a key to lookup reference to this SK record */ char header[REC_HDR_SIZE]; - uint32 prev_sk_off; - uint32 next_sk_off; - uint32 ref_count; - uint32 size; + uint32_t prev_sk_off; + uint32_t next_sk_off; + uint32_t ref_count; + uint32_t size; struct security_descriptor *sec_desc; } REGF_SK_REC; @@ -138,38 +138,38 @@ typedef struct _regf_sk_rec { typedef struct { REGF_HBIN *hbin; /* pointer to HBIN record (in memory) containing this nk record */ - uint32 hbin_off; /* offset from beginning of this hbin block */ - uint32 subkey_index; /* index to next subkey record to return */ - uint32 rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ + uint32_t hbin_off; /* offset from beginning of this hbin block */ + uint32_t subkey_index; /* index to next subkey record to return */ + uint32_t rec_size; /* ((start_offset - end_offset) & 0xfffffff8) */ /* header information */ char header[REC_HDR_SIZE]; uint16 key_type; NTTIME mtime; - uint32 parent_off; /* back pointer in registry hive */ - uint32 classname_off; + uint32_t parent_off; /* back pointer in registry hive */ + uint32_t classname_off; char *classname; char *keyname; /* max lengths */ - uint32 max_bytes_subkeyname; /* max subkey name * 2 */ - uint32 max_bytes_subkeyclassname; /* max subkey classname length (as if) */ - uint32 max_bytes_valuename; /* max valuename * 2 */ - uint32 max_bytes_value; /* max value data size */ + uint32_t max_bytes_subkeyname; /* max subkey name * 2 */ + uint32_t max_bytes_subkeyclassname; /* max subkey classname length (as if) */ + uint32_t max_bytes_valuename; /* max valuename * 2 */ + uint32_t max_bytes_value; /* max value data size */ /* unknowns */ - uint32 unk_index; /* nigel says run time index ? */ + uint32_t unk_index; /* nigel says run time index ? */ /* children */ - uint32 num_subkeys; - uint32 subkeys_off; /* hash records that point to NK records */ - uint32 num_values; - uint32 values_off; /* value lists which point to VK records */ - uint32 sk_off; /* offset to SK record */ + uint32_t num_subkeys; + uint32_t subkeys_off; /* hash records that point to NK records */ + uint32_t num_values; + uint32_t values_off; /* value lists which point to VK records */ + uint32_t sk_off; /* offset to SK record */ /* link in the other records here */ @@ -192,21 +192,21 @@ typedef struct { /* file format information */ char header[REGF_HDR_SIZE]; /* "regf" */ - uint32 data_offset; /* offset to record in the first (or any?) hbin block */ - uint32 last_block; /* offset to last hbin block in file */ - uint32 checksum; /* XOR of bytes 0x0000 - 0x01FB */ + uint32_t data_offset; /* offset to record in the first (or any?) hbin block */ + uint32_t last_block; /* offset to last hbin block in file */ + uint32_t checksum; /* XOR of bytes 0x0000 - 0x01FB */ NTTIME mtime; REGF_SK_REC *sec_desc_list; /* list of security descriptors referenced by NK records */ /* unknowns used to simply writing */ - uint32 unknown1; - uint32 unknown2; - uint32 unknown3; - uint32 unknown4; - uint32 unknown5; - uint32 unknown6; + uint32_t unknown1; + uint32_t unknown2; + uint32_t unknown3; + uint32_t unknown4; + uint32_t unknown5; + uint32_t unknown6; } REGF_FILE; |