util/syspolicy: add read boolean setting (#9592)

This commit is contained in:
Claire Wang
2023-09-29 21:27:04 -04:00
committed by GitHub
parent 324f0d5f80
commit a56e58c244
7 changed files with 88 additions and 2 deletions

View File

@@ -30,3 +30,11 @@ func (windowsHandler) ReadUInt64(key string) (uint64, error) {
}
return value, err
}
func (windowsHandler) ReadBoolean(key string) (bool, error) {
value, err := winutil.GetPolicyInteger(key)
if errors.Is(err, winutil.ErrNoValue) {
err = ErrNoSuchKey
}
return value != 0, err
}