Пример #1
0
 public unsafe static extern WindowsError RegQueryValueExW(
     RegistryKeyHandle hKey,
     string lpValueName,
     void *lpReserved,
     RegistryValueType *lpType,
     void *lpData,
     uint *lpcbData);
Пример #2
0
 public static extern HResult AssocQueryStringByKeyW(
     AssociationFlags flags,
     AssociationString str,
     RegistryKeyHandle hkAssoc,
     string pszExtra,
     SafeHandle pszOut,
     ref uint pcchOut);
Пример #3
0
 public unsafe static extern NTStatus NtEnumerateValueKey(
     RegistryKeyHandle KeyHandle,
     uint Index,
     KeyValueInformationClass KeyValueInformationClass,
     void *KeyValueInformation,
     uint Length,
     out uint ResultLength);
Пример #4
0
 public static extern HRESULT AssocQueryStringByKeyW(
     ASSOCF flags,
     ASSOCSTR str,
     RegistryKeyHandle hkAssoc,
     string pszExtra,
     SafeHandle pszOut,
     ref uint pcchOut);
Пример #5
0
        public void GetTextAssociation_BaseClassKey()
        {
            RegistryKeyHandle key = ShellMethods.AssocQueryKey(AssociationFlags.None, AssociationKey.BaseClass, ".txt", null);

            string name = Registry.QueryKeyName(key);

            // \REGISTRY\USER\S-1-5-21-2477298427-4111324449-2912218533-1001_Classes\*
            name.Should().StartWith(@"\REGISTRY\USER\S-").And.EndWith(@"_Classes\*");
        }
Пример #6
0
 public unsafe static extern WindowsError RegEnumValueW(
     RegistryKeyHandle hKey,
     uint dwIndex,
     void *lpValueName,
     ref uint lpcchValueName,
     void *lpReserved,
     RegistryValueType *lpType,
     void *lpData,
     uint *lpcbData);
Пример #7
0
        public void GetTextAssociation_ShellExecClassKey()
        {
            RegistryKeyHandle key = ShellMethods.AssocQueryKey(ASSOCF.None, ASSOCKEY.ShellExecClass, ".txt", null);

            // \REGISTRY\USER\S-1-5-21-2477298427-4111324449-2912218533-1001_Classes\Applications\notepad++.exe
            string name = RegistryMethods.QueryKeyName(key);

            name.Should().StartWith(@"\REGISTRY\USER\S-").And.EndWith(".exe");
        }
Пример #8
0
 public static extern WindowsError RegQueryInfoKeyW(
     RegistryKeyHandle hKey,
     SafeHandle lpClass,
     ref uint lpcClass,
     IntPtr lpReserved,
     out uint lpcSubKeys,
     out uint lpcMaxSubKeyLen,
     out uint lpcMaxClassLen,
     out uint lpcValues,
     out uint lpcMaxValueNameLen,
     out uint lpcMaxValueLen,
     out uint lpcbSecurityDescriptor,
     out FileTime lpftLastWriteTime);
Пример #9
0
        public void GetTextAssociation_ShellExecClassKey()
        {
            RegistryKeyHandle key = ShellMethods.AssocQueryKey(AssociationFlags.None, AssociationKey.ShellExecClass, ".txt", null);

            string name = Registry.QueryKeyName(key);

            if (name.StartsWith(@"\REGISTRY\MACHINE"))
            {
                // No user overrides.
                name.Should().StartWith(@"\REGISTRY\MACHINE\SOFTWARE\Classes\txtfile");
            }
            else
            {
                // Has a user setting, should be something like:
                name.Should().StartWith(@"\REGISTRY\USER\S-").And.EndWith(".exe");
            }
        }
Пример #10
0
        public void GetTextAssociation_ClassKey()
        {
            RegistryKeyHandle key = ShellMethods.AssocQueryKey(AssociationFlags.None, AssociationKey.Class, ".txt", null);

            // \REGISTRY\USER\S-1-5-21-2477298427-4111324449-2912218533-1001_Classes\Applications\notepad++.exe
            string name = Registry.QueryKeyName(key);

            if (name.StartsWith(@"\REGISTRY\MACHINE"))
            {
                // No user overrides.
                name.Should().StartWith(@"\REGISTRY\MACHINE\SOFTWARE\Classes\txtfile");
            }
            else
            {
                // Has a user setting, should be something like:
                name.Should().StartWith(@"\REGISTRY\USER\S-").And.EndWith(".exe");
            }
        }
Пример #11
0
 public static extern HResult AssocQueryKeyW(
     AssociationFlags flags,
     AssociationKey key,
     string pszAssoc,
     string pszExtra,
     out RegistryKeyHandle phkeyOut);
Пример #12
0
 public unsafe static extern NTStatus NtQueryKey(
     RegistryKeyHandle KeyHandle,
     KeyInformationClass KeyInformationClass,
     void *KeyInformation,
     uint Length,
     out uint ResultLength);
Пример #13
0
 public static extern WindowsError RegOpenKeyExW(
     RegistryKeyHandle hKey,
     string lpSubKey,
     uint ulOptions,
     RegistryAccessRights samDesired,
     out RegistryKeyHandle phkResult);
Пример #14
0
 public static extern HRESULT AssocQueryKeyW(
     ASSOCF flags,
     ASSOCKEY key,
     string pszAssoc,
     string pszExtra,
     out RegistryKeyHandle phkeyOut);