1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Implemented reg_check_value to check if a value exists.

This commit is contained in:
Daniel Collins 2012-11-12 20:42:55 +00:00
parent f29bbb7f06
commit 50bb5a3868
2 changed files with 15 additions and 0 deletions

View File

@ -87,6 +87,19 @@ void reg_close(HKEY key)
}
}
/* Check if a value exists.
* Returns true on success, false on failure.
*/
bool reg_check_value(HKEY key, const char *name)
{
if(key != NULL && RegQueryValueEx(key, name, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
return true;
}
return false;
}
bool reg_get_bin(HKEY key, const char *name, void *buf, size_t size, const void *default_value)
{
if(key != NULL)

View File

@ -45,6 +45,8 @@ HKEY reg_open_main(bool readwrite);
HKEY reg_open_subkey(HKEY parent, const char *path, bool readwrite);
void reg_close(HKEY key);
bool reg_check_value(HKEY key, const char *name);
bool reg_get_bin(HKEY key, const char *name, void *buf, size_t size, const void *default_value);
bool reg_set_bin(HKEY key, const char *name, void *buf, size_t size);