<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 19, 2014 at 12:49 PM, Kai Blaschke <span dir="ltr"><<a href="mailto:kai.blaschke@kb-dev.net" target="_blank">kai.blaschke@kb-dev.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you need to do something that requires admin privileges, you should<br>
try to do it and check for an access denied error. If it fails with<br>
access denied, you should skip the test. (Ideally, you should try<br>
running your test with a limited account on Windows.)<br>
</blockquote>
<br></span>
Non-admin users lack the proper access rights to change anything in HKLM, so at least on modern systems with active UAC the test won't work.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would be more worried about the fact that it's changing a global<br>
user preference. Maybe you should just read the key and verify that<br>
the API matches the value there.<br>
</blockquote>
<br></span>
It's worse, to fully test both OS variants, the test would have to delete and create subkeys, since Microsoft put the value under a subkey of the name of the former value since Vista. That's nothing I'd like to do on some unsuspecting user's machine.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is probably more depth than you should be putting into<br>
investigating native's behavior. If it's supposed to be a boolean, and<br>
the expected values are 1 and 0, you can assume it's one of those and<br>
not worry about what happens if it's 256 (unless you know a real<br>
application that sets that value).<br>
</blockquote>
<br></span>
Yeah, that's what the documentation states, too. I tested this just out of curiosity.<br>
<br>
I'll leave it with my current code for both the implemenation and the test, and submit the patch for reviewing.<br></blockquote><div><br></div><div>Kai, out of curiosity, is there an app that depends on being able to enable FIPS mode?</div><div>--JuanĀ </div></div></div></div>