Microsoft.Win32.RegistryKey.GetValueKindCore C# (CSharp) Method

GetValueKindCore() private method

private GetValueKindCore ( string name ) : RegistryValueKind
name string
return RegistryValueKind
        private RegistryValueKind GetValueKindCore(string name)
        {
            int type = 0;
            int datasize = 0;
            int ret = Interop.Advapi32.RegQueryValueEx(_hkey, name, null, ref type, (byte[])null, ref datasize);
            if (ret != 0)
            {
                Win32Error(ret, null);
            }

            return
                type == Interop.Advapi32.RegistryValues.REG_NONE ? RegistryValueKind.None :
                !Enum.IsDefined(typeof(RegistryValueKind), type) ? RegistryValueKind.Unknown :
                (RegistryValueKind)type;
        }