, , . RegistryKey, , , IntPtr. , . , , - , , . , - .
:
[DllImport("advapi32.dll", CharSet=CharSet.Auto)]
internal static extern int RegOpenKeyEx(SafeRegistryHandle key, string subkey,
int options, int sam, out SafeRegistryHandle result);
, safe handle. .