On 19/02/2020 18:35, Nikolay Sivov wrote:
See attached diff. Specifying both flags returns ERROR_INVALID_PARAMETER.
I think this is exactly why that should never be done intentionally, but on tests.
My point is that RegGetValue() could simply convert flags and rely on RegOpenKeyEx() to validate them, instead of validation in two places.
I would agree with you if flags were implicitly passed through, which is not the case here.
My point is: *No redundancy here: 2 functions, 2 sets of flags, 2 validations. *What if flag conversion is broken? *What when RegOpenKeyEx() is not called? (See tests on PATCH 2/2.)