Exemple #1
0
 internal static void GetKeySecurity(
     this VirtualKey key,
     Win32Api.SECURITY_INFORMATION SecurityInformation,
     IntPtr pSecurityDescriptor,
     /*ref UInt32*/ IntPtr lpcbSecurityDescriptor)
 {
     key.ApplyReadOperation(null,
                            new KeySecurity(Win32Api.KeySecurity.MAXIMUM_ALLOWED),
                            keyImpl => keyImpl.TryApply(new GetKeySecurity(SecurityInformation,
                                                                           pSecurityDescriptor, lpcbSecurityDescriptor)));
 }
Exemple #2
0
 internal static void NtQueryKey(this VirtualKey key, Win32Api.KeyInformationClass KeyInformationClass,
     IntPtr KeyInformation, uint Length, out uint ResultLength)
 {
     ResultLength = 0;
     NtQueryKey handler = new NtQueryKey(KeyInformationClass, KeyInformation, Length);
     try
     {
         key.ApplyReadOperation(null,
             new KeySecurity(Win32Api.KeySecurity.KEY_QUERY_VALUE),
             keyImpl => keyImpl.TryApply(handler));
     }
     finally
     {
         ResultLength = handler.ResultLength;
     }
 }