In the context of a generalized .NET-based component, which can be hosted in a variety of scenarios - i.e., 64 bit or not, interactive process or not, I need to write to the registry in an area that's subject to UAC virtualisation. However, I want to prevent such access from being virtualized in order that each execution is not subject to the vagaries of the present context (i.e., dont want to have one reading from HKLM as it has a manifest and the other from HKCU..VirtualStore because it doesnt).
In other words, I'm looking for something analogous to KEY_WOW64_64KEY or reg.exe REG_KEY_DONT_VIRTUALIZE
to indicate that I dont want to be virtualised under any circumstances. Or is there some form of canonicalization-related syntax I can use to force it a la the way you specify a >260 char filename?
I'm fine with the code failing if the executing user doesnt have appropriate permissions on the registry key in question.
This question is strongly related to [this question on detecting registry virtualization] (http://stackoverflow.com/questions/1002709/detecting-registry-virtualization), but detecting definitely isnt enough in this context.