25#if !defined(LOCAL_REGISTRY) && !defined(__NT__)
26# define LOCAL_REGISTRY
33# define IDA_REGISTRY_NAME "ida"
35# define IDA_REGISTRY_NAME "IDA"
37#define HVUI_REGISTRY_NAME "hvui"
43#define ROOT_KEY_NAME "Software\\Hex-Rays\\IDA"
51idaman THREAD_SAFE
bool ida_export reg_bin_op(
58idaman THREAD_SAFE
bool ida_export reg_str_get(
qstring *buf,
const char *name,
const char *subkey);
59idaman THREAD_SAFE
void ida_export reg_str_set(
const char *name,
const char *subkey,
const char *buf);
60idaman THREAD_SAFE
int ida_export reg_int_op(
64 const char *subkey =
nullptr);
88idaman THREAD_SAFE
bool ida_export
reg_delete(
const char *name,
const char *subkey =
nullptr);
100idaman THREAD_SAFE
bool ida_export
reg_exists(
const char *name,
const char *subkey =
nullptr);
144 const char *rem =
nullptr,
145 bool ignorecase =
false);
158 const char *subkey =
nullptr)
160 reg_bin_op(name,
true, CONST_CAST(
void *)(data), datalen, subkey);
171 const char *subkey =
nullptr)
189 const char *subkey =
nullptr)
191 return reg_bin_op(name,
false, data, datalen, subkey);
207 const char *subkey =
nullptr)
209 return reg_bin_op(name,
false, data, datalen, subkey, 1);
222 const char *subkey =
nullptr)
224 return reg_bin_op(name,
false, data, 0, subkey, 2);
236 const char *subkey =
nullptr)
238 reg_str_set(name, subkey, utf8);
251 const char *subkey =
nullptr)
253 return reg_str_get(utf8, name, subkey);
265 return reg_int_op(name,
false,
defval, subkey);
274inline THREAD_SAFE
void reg_write_int(
const char *name,
int value,
const char *subkey =
nullptr)
276 reg_int_op(name,
true, value, subkey);
288 return reg_int_op(name,
false,
int(
defval), subkey) != 0;
297inline THREAD_SAFE
void reg_write_bool(
const char *name,
int value,
const char *subkey =
nullptr)
299 reg_int_op(name,
true, value != 0, subkey);
327 const char *rem =
nullptr)
330 subkey, add, maxrecs, rem,
343#define _RVN_(f) regname_ ## f
345#ifndef __DEFINE_REG_NAMES__
346#define REG_VAL_NAME(n,s) \
347 extern const char _RVN_(n)[]
349#define REG_VAL_NAME(n,s) \
350 extern const char _RVN_(n)[]; \
351 const char _RVN_(n)[] = s
354#define REG_BOOL_FUNC(func, valname) \
355REG_VAL_NAME(func, valname); \
356inline THREAD_SAFE void regset_ ## func(bool value) \
357 { reg_write_bool(_RVN_(func), value); } \
358inline THREAD_SAFE bool regget_ ## func(bool def) \
359 { return reg_read_bool(_RVN_(func), def); }
361#define REG_INT_FUNC(func, valname) \
362REG_VAL_NAME(func,valname); \
363inline THREAD_SAFE void regset_ ## func(int value) \
365 reg_int_op(_RVN_(func), true, value); \
367inline THREAD_SAFE int regget_ ## func(int def=0) \
369 return reg_int_op(_RVN_(func), false, def); \
375idaman THREAD_SAFE
bool ida_export set_registry_name(
const char *name);
378extern const char regkey_history[];
379extern int max_history_files;
381#define MAX_HISTORY_FILES_DEF 10
383inline THREAD_SAFE
void regget_history(
qstrvec_t *list)
388inline THREAD_SAFE
void reg_update_history(
const char *addfile,
const char *removefile =
nullptr)
395inline THREAD_SAFE
void reg_history_size_truncate(
void)
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2609
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2423
size_t const char * defval
Definition kernwin.hpp:7959
_qstring< char > qstring
regular string
Definition pro.h:3694
qvector< qstring > qstrvec_t
vector of strings
Definition pro.h:3697
THREAD_SAFE bool reg_subkey_subkeys(qstrvec_t *out, const char *name)
Get all subkey names of given key.
Definition registry.hpp:305
idaman THREAD_SAFE bool ida_export reg_subkey_exists(const char *name)
Is there already a key with the given name?
THREAD_SAFE bool reg_read_bool(const char *name, bool defval, const char *subkey=nullptr)
Read boolean value from the registry.
Definition registry.hpp:286
THREAD_SAFE bool reg_read_binary_part(const char *name, void *data, size_t datalen, const char *subkey=nullptr)
Read a chunk of binary data from the registry.
Definition registry.hpp:203
idaman THREAD_SAFE bool ida_export reg_exists(const char *name, const char *subkey=nullptr)
Is there already a value with the given name?
idaman THREAD_SAFE void ida_export reg_read_strlist(qstrvec_t *list, const char *subkey)
Retrieve all string values associated with the given key.
idaman THREAD_SAFE void ida_export reg_write_strlist(const qstrvec_t &in, const char *subkey)
Write string values associated with the given key.
idaman THREAD_SAFE bool ida_export reg_data_type(regval_type_t *out, const char *name, const char *subkey=nullptr)
Get data type of a given value.
THREAD_SAFE int reg_read_int(const char *name, int defval, const char *subkey=nullptr)
Read integer value from the registry.
Definition registry.hpp:263
idaman THREAD_SAFE bool ida_export reg_delete_subkey(const char *name)
Delete a key from the registry.
THREAD_SAFE bool reg_read_binary(const char *name, void *data, size_t datalen, const char *subkey=nullptr)
Read binary data from the registry.
Definition registry.hpp:185
idaman THREAD_SAFE bool ida_export reg_delete_tree(const char *name)
Delete a subtree from the registry.
THREAD_SAFE void reg_write_bool(const char *name, int value, const char *subkey=nullptr)
Write boolean value to the registry.
Definition registry.hpp:297
THREAD_SAFE void reg_write_binary(const char *name, const void *data, size_t datalen, const char *subkey=nullptr)
Write binary data to the registry.
Definition registry.hpp:154
regval_type_t
Types of values stored in the registry.
Definition registry.hpp:69
@ reg_binary
binary data
Definition registry.hpp:72
@ reg_dword
32-bit number
Definition registry.hpp:73
@ reg_sz
utf8 string
Definition registry.hpp:71
@ reg_unknown
unknown
Definition registry.hpp:70
THREAD_SAFE void reg_update_filestrlist(const char *subkey, const char *add, size_t maxrecs, const char *rem=nullptr)
Update registry with a file list.
Definition registry.hpp:323
idaman THREAD_SAFE bool ida_export reg_subkey_children(qstrvec_t *out, const char *name, bool subkeys)
Retrieve the child names of the given key.
idaman THREAD_SAFE void ida_export reg_update_strlist(const char *subkey, const char *add, size_t maxrecs, const char *rem=nullptr, bool ignorecase=false)
Update list of strings associated with given key.
THREAD_SAFE void reg_write_string(const char *name, const char *utf8, const char *subkey=nullptr)
Write a string to the registry.
Definition registry.hpp:233
THREAD_SAFE bool reg_read_string(qstring *utf8, const char *name, const char *subkey=nullptr)
Read a string from the registry.
Definition registry.hpp:248
THREAD_SAFE void reg_write_int(const char *name, int value, const char *subkey=nullptr)
Write integer value to the registry.
Definition registry.hpp:274
THREAD_SAFE bool reg_subkey_values(qstrvec_t *out, const char *name)
Get all value names under given key.
Definition registry.hpp:313
idaman THREAD_SAFE bool ida_export reg_delete(const char *name, const char *subkey=nullptr)
Delete a value from the registry.