コード例 #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
ファイル: ShellMethods.cs プロジェクト: maryamariyan/WInterop
 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
ファイル: ShellMethods.cs プロジェクト: maryamariyan/WInterop
 public static extern HRESULT AssocQueryKeyW(
     ASSOCF flags,
     ASSOCKEY key,
     string pszAssoc,
     string pszExtra,
     out RegistryKeyHandle phkeyOut);