diff options
| author | Brian Potchik <brian@vector35.com> | 2018-10-22 13:12:42 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2018-10-22 13:12:42 -0400 |
| commit | af095afc4bad164177d079d8562801ea8df5da0f (patch) | |
| tree | 9dc95fbb904cc11f3ea98692b588af08dccff59b /python/settings.py | |
| parent | bc1a1cffe78edebd763960da030f22aea1d2b2b8 (diff) | |
Obtain the BinaryView handle automatically for the Settings set API.
Diffstat (limited to 'python/settings.py')
| -rw-r--r-- | python/settings.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/settings.py b/python/settings.py index ce7c140a..135cd342 100644 --- a/python/settings.py +++ b/python/settings.py @@ -154,18 +154,28 @@ class Settings(object): return (out_list, SettingsScope(c_scope.value)) def set_bool(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetBool(self.registry_id, view, scope, id, value) def set_double(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetDouble(self.registry_id, view, scope, id, value) def set_integer(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetUInt64(self.registry_id, view, scope, id, value) def set_string(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetString(self.registry_id, view, scope, id, value) def set_string_list(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle length = ctypes.c_ulonglong() length.value = len(value) string_list = (ctypes.c_char_p * len(value))() |
