I'm trying to get to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\GameUX\, but the only subkey being returned in C# is MachineSettings - even though there are additional subkeys, including Games and several keys named for different user SIDs. How can I access these other keys? Even a standard user account can read the content of both Games and that account's own SID (when looking in regedit)...
A:
So the issue was related to running a 32-bit application in a 64-bit Windows environment. 64-bit Windows sandboxes 32-bit content (which is why there's a C:\Program Files (x86)) in a way that is transparent to applications. 32-bit applications that use the registry access a sandboxed hive inside HKLM\WOW6423Node, which is why I wasn't seeing the expected result when querying a key inside HKLM.
Fortunately, .NET 4.0 (introduced with VS.NET 2010 and its Express Edition counterparts) includes a super easy function that lets a 32-bit application see and use the 64-bit registry (and vice versa).
shifuimam
2010-05-27 22:10:02