Is there a way to check whether the current user can write to the registry? More specifically if it's not an administrator, can it write to HKEY_LOCAL_MACHINE or the policy keys on HKEY_CURRENT_USER.
I tried with LookupPrivilegeValue() but I don't think it's the right thing to do.
Code is appreciated.