[DllImport("advapi32.dll", SetLastError=true)]
static extern int RegDisableReflectionKey(IntPtr hBase);
Declare Function RegDisableReflectionKey Lib "advapi32.dll" (hBase As IntPtr) As Int
None.
Do you know one? Please contribute it!
None.
Please add some!
hiveKey = Registry.LocalMachine.OpenSubKey(subKey);
Type type = typeof(RegistryKey);
FieldInfo fi = type.GetField(
"hkey",
BindingFlags.NonPublic | BindingFlags.Instance);
SafeHandle handle = (SafeHandle)fi.GetValue(hiveKey);
IntPtr realHandle = handle.DangerousGetHandle();
int errorCode = RegDisableReflectionKey(handle.DangerousGetHandle());