Exemplo n.º 1
0
        /// <summary>
        ///     Constructor, uses an already-open pointer as a key.
        /// </summary>
        /// <param name="parent">The parent key.</param>
        /// <param name="ptr">Handle to an open key.</param>
        /// <param name="name">The name of the open key.</param>
        internal OffregKey(OffregKey parent, IntPtr ptr, string name)
        {
            _intPtr = ptr;

            Name     = name;
            FullName = (parent == null || parent.FullName == null ? "" : parent.FullName + "\\") + name;
            _parent  = parent;

            _metadata = new QueryInfoKeyData();
            RefreshMetadata();
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Constructor, uses an already-open pointer as a key.
        /// </summary>
        /// <param name="parent">The parent key.</param>
        /// <param name="ptr">Handle to an open key.</param>
        /// <param name="name">The name of the open key.</param>
        internal OffregKey(OffregKey parent, IntPtr ptr, string name)
        {
            _intPtr = ptr;

            Name = name;
            FullName = (parent == null || parent.FullName == null ? "" : parent.FullName + "\\") + name;
            _parent = parent;

            _metadata = new QueryInfoKeyData();
            RefreshMetadata();
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Constructor, opens a subkey.
        /// </summary>
        /// <param name="parentKey">The parent key.</param>
        /// <param name="name">The name of the subkey to open.</param>
        internal OffregKey(OffregKey parentKey, string name)
        {
            Win32Result result = OffregNative.OpenKey(parentKey._intPtr, name, out _intPtr);

            if (result != Win32Result.ERROR_SUCCESS)
                throw new Win32Exception((int)result);

            Name = name;
            FullName = (parentKey.FullName == null ? "" : parentKey.FullName + "\\") + name;
            _parent = parentKey;

            _metadata = new QueryInfoKeyData();
            RefreshMetadata();
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Constructor, opens a subkey.
        /// </summary>
        /// <param name="parentKey">The parent key.</param>
        /// <param name="name">The name of the subkey to open.</param>
        internal OffregKey(OffregKey parentKey, string name)
        {
            Win32Result result = OffregNative.OpenKey(parentKey._intPtr, name, out _intPtr);

            if (result != Win32Result.ERROR_SUCCESS)
            {
                throw new Win32Exception((int)result);
            }

            Name     = name;
            FullName = (parentKey.FullName == null ? "" : parentKey.FullName + "\\") + name;
            _parent  = parentKey;

            _metadata = new QueryInfoKeyData();
            RefreshMetadata();
        }