CombineName() static private method

utility: Combine the sub key name to the current name to produce a fully qualified sub key name.
static private CombineName ( RegistryKey rkey, string localName ) : string
rkey RegistryKey
localName string
return string
コード例 #1
0
        public RegistryKey CreateSubKey(RegistryKey rkey, string keyName)
        {
            IntPtr handle = Win32RegistryApi.GetHandle(rkey);
            IntPtr intPtr;
            int    num = Win32RegistryApi.RegCreateKey(handle, keyName, out intPtr);

            if (num == 1018)
            {
                throw RegistryKey.CreateMarkedForDeletionException();
            }
            if (num != 0)
            {
                this.GenerateException(num);
            }
            return(new RegistryKey(intPtr, Win32RegistryApi.CombineName(rkey, keyName), true));
        }
コード例 #2
0
        public RegistryKey OpenSubKey(RegistryKey rkey, string keyName, bool writable)
        {
            int num = 131097;

            if (writable)
            {
                num |= 131078;
            }
            IntPtr handle = Win32RegistryApi.GetHandle(rkey);
            IntPtr intPtr;
            int    num2 = Win32RegistryApi.RegOpenKeyEx(handle, keyName, IntPtr.Zero, num, out intPtr);

            if (num2 == 2 || num2 == 1018)
            {
                return(null);
            }
            if (num2 != 0)
            {
                this.GenerateException(num2);
            }
            return(new RegistryKey(intPtr, Win32RegistryApi.CombineName(rkey, keyName), writable));
        }