{
struct dirent *e;
const struct dir_key *dk = talloc_get_type(k, struct dir_key);
- int i = 0;
+ unsigned int i = 0;
DIR *d;
d = opendir(dk->path);
}
static WERROR reg_dir_enum_value(TALLOC_CTX *mem_ctx,
- struct hive_key *key, int idx,
+ struct hive_key *key, uint32_t idx,
const char **name,
uint32_t *type, DATA_BLOB *data)
{
const struct dir_key *dk = talloc_get_type(key, struct dir_key);
DIR *d;
struct dirent *e;
- int i;
+ unsigned int i;
d = opendir(dk->path);
if (d == NULL) {
/** Obtain name of specific hkey. */
_PUBLIC_ const char *reg_get_predef_name(uint32_t hkey)
{
- int i;
+ unsigned int i;
for (i = 0; reg_predefined_keys[i].name; i++) {
if (reg_predefined_keys[i].handle == hkey)
return reg_predefined_keys[i].name;
const char *name,
struct registry_key **key)
{
- int i;
+ unsigned int i;
for (i = 0; reg_predefined_keys[i].name; i++) {
if (!strcasecmp(reg_predefined_keys[i].name, name))
*/
_PUBLIC_ WERROR reg_key_get_subkey_by_index(TALLOC_CTX *mem_ctx,
const struct registry_key *key,
- int idx, const char **name,
+ uint32_t idx, const char **name,
const char **keyclass,
NTTIME *last_changed_time)
{
struct ldb_context *ldb;
struct ldb_dn *dn;
struct ldb_message **subkeys, **values;
- int subkey_count, value_count;
+ unsigned int subkey_count, value_count;
};
static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
}
static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct hive_key *k,
- int idx, const char **name,
+ uint32_t idx, const char **name,
uint32_t *data_type, DATA_BLOB *data)
{
struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data);
static WERROR ldb_del_key(const struct hive_key *key, const char *name)
{
- int i, ret;
+ unsigned int i;
+ int ret;
struct ldb_key_data *parentkd = talloc_get_type(key, struct ldb_key_data);
struct ldb_dn *ldap_path;
TALLOC_CTX *mem_ctx = talloc_init("ldb_del_key");
ret = ldb_add(kd->ldb, msg);
if (ret == LDB_ERR_ENTRY_ALREADY_EXISTS) {
- int i;
+ unsigned int i;
for (i = 0; i < msg->num_elements; i++) {
if (msg->elements[i].flags != LDB_FLAG_MOD_DELETE)
msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
if (max_subkeynamelen != NULL) {
- int i;
+ unsigned int i;
struct ldb_message_element *el;
*max_subkeynamelen = 0;
}
if (max_valnamelen != NULL || max_valbufsize != NULL) {
- int i;
+ unsigned int i;
struct ldb_message_element *el;
W_ERROR_NOT_OK_RETURN(cache_values(kd));
struct local_key *local_parent;
struct hive_key *hivekey;
const char **elements;
- int i;
+ unsigned int i;
const char *last_part;
last_part = strrchr(name, '\\');
struct registry_local *reg_local = talloc_get_type(rctx,
struct registry_local);
struct mountpoint *mp = talloc(rctx, struct mountpoint);
- int i = 0;
+ unsigned int i = 0;
mp->path.predefined_key = key_id;
mp->prev = mp->next = NULL;
const struct reg_diff_callbacks *callbacks,
void *callback_data)
{
- int i;
+ unsigned int i;
struct registry_key *t1 = NULL, *t2 = NULL;
char *tmppath;
const char *keyname1;
const struct reg_diff_callbacks *callbacks,
void *callback_data)
{
- int i;
+ unsigned int i;
WERROR error;
for (i = 0; reg_predefined_keys[i].name; i++) {
static struct hbin_block *hbin_by_offset(const struct regf_data *data,
uint32_t offset, uint32_t *rel_offset)
{
- int i;
+ unsigned int i;
for (i = 0; data->hbins[i]; i++) {
if (offset >= data->hbins[i]->offset_from_first &&
static uint32_t regf_hdr_checksum(const uint8_t *buffer)
{
uint32_t checksum = 0, x;
- int i;
+ unsigned int i;
for (i = 0; i < 0x01FB; i+= 4) {
x = IVAL(buffer, i);
DATA_BLOB ret;
uint32_t rel_offset = -1; /* Relative offset ! */
struct hbin_block *hbin = NULL;
- int i;
+ unsigned int i;
*offset = 0;
int32_t orig_size;
int32_t needed_size;
int32_t possible_size;
- int i;
+ unsigned int i;
SMB_ASSERT(orig_offset > 0);
static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key,
- int idx, const char **name,
+ uint32_t idx, const char **name,
uint32_t *data_type, DATA_BLOB *data)
{
const struct regf_key_data *private_data =
struct hive_key *key, const char *name,
uint32_t *type, DATA_BLOB *data)
{
- int i;
+ unsigned int i;
const char *vname;
WERROR error;
uint32_t vk_offset;
bool found_offset = false;
DATA_BLOB values;
- uint32_t i;
+ unsigned int i;
if (nk->values_offset == -1) {
return WERR_BADFILE;
if (key->nk->subkeys_offset != -1) {
char *sk_name;
struct hive_key *sk = (struct hive_key *)key;
- int i = key->nk->num_subkeys;
+ unsigned int i = key->nk->num_subkeys;
while (i--) {
/* Get subkey information. */
error = regf_get_subkey_by_index(parent_nk, sk, 0,
char *val_name;
struct hive_key *sk = (struct hive_key *)key;
DATA_BLOB data;
- int i = key->nk->num_values;
+ unsigned int i = key->nk->num_values;
while (i--) {
/* Get value information. */
error = regf_get_value(parent_nk, sk, 0,
static WERROR regf_save_hbin(struct regf_data *regf)
{
struct tdr_push *push = tdr_push_init(regf, regf->iconv_convenience);
- int i;
+ unsigned int i;
W_ERROR_HAVE_NO_MEMORY(push);
struct regf_data *regf;
struct regf_hdr *regf_hdr;
struct tdr_pull *pull;
- int i;
+ unsigned int i;
regf = (struct regf_data *)talloc_zero(parent_ctx, struct regf_data);
* Retrieve a registry value with a specific index.
*/
WERROR (*enum_value) (TALLOC_CTX *mem_ctx,
- struct hive_key *key, int idx,
+ struct hive_key *key, uint32_t idx,
const char **name, uint32_t *type,
DATA_BLOB *data);
uint32_t *max_valbufsize);
WERROR reg_key_get_subkey_by_index(TALLOC_CTX *mem_ctx,
const struct registry_key *key,
- int idx,
+ uint32_t idx,
const char **name,
const char **classname,
NTTIME *last_mod_time);
static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv)
{
- int i;
+ unsigned int i;
WERROR error;
uint32_t valuetype;
DATA_BLOB valuedata;
static WERROR cmd_help(struct regshell_context *ctx,
int argc, char **argv)
{
- int i;
+ unsigned int i;
printf("Available commands:\n");
for(i = 0; regshell_cmds[i].name; i++) {
printf("%s - %s\n", regshell_cmds[i].name,
{
/* Complete command */
char **matches;
- int i, len, samelen=0, count=1;
+ size_t len, samelen=0;
+ unsigned int i, count=1;
matches = malloc_array_p(char *, MAX_COMPLETIONS);
if (!matches) return NULL;
{
struct registry_key *base;
const char *subkeyname;
- int i, j = 1;
- int samelen = 0;
- int len;
+ unsigned int i, j = 1;
+ size_t len, samelen = 0;
char **matches;
const char *base_n = "";
TALLOC_CTX *mem_ctx;
return 1;
if (ctx->current == NULL) {
- int i;
+ unsigned int i;
for (i = 0; (reg_predefined_keys[i].handle != 0) &&
(ctx->current == NULL); i++) {
DATA_BLOB valuedata;
struct security_descriptor *sec_desc;
WERROR error;
- int i;
+ unsigned int i;
TALLOC_CTX *mem_ctx;
for(i = 0; i < level; i++) putchar(' '); puts(name);
/** Return string description of registry value type */
_PUBLIC_ const char *str_regtype(int type)
{
- int i;
+ unsigned int i;
for (i = 0; reg_value_types[i].name; i++) {
if (reg_value_types[i].id == type)
return reg_value_types[i].name;
const char *data_str, uint32_t *type,
DATA_BLOB *data)
{
- int i;
+ unsigned int i;
*type = -1;
/* Find the correct type */
{
struct registry_key *predef;
WERROR error;
- int predeflength;
+ size_t predeflength;
char *predefname;
if (strchr(name, '\\') != NULL)