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:
parent
f29bbb7f06
commit
50bb5a3868
13
src/common.c
13
src/common.c
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user