Exemple #1
0
        public virtual uint GetDwordValue(string root, string path, string name)
        {
            uint value = 0;
            var  hr    = native.GetDwordValue(root, path, name, out value);

            if (hr != ERROR_SUCCESS)
            {
                if (hr == 2)
                {
                    throw new KeyNotFoundException();
                }
                if (hr == 13)
                {
                    throw new ArgumentException("Invalid format.");
                }
                if (hr == 1260)
                {
                    throw new UnauthorizedAccessException();
                }
                throw new ArgumentException("Error getting int value: " + hr);
            }
            return(value);
        }