Exemple #1
0
        /// <summary>
        /// Display the edit security dialog.
        /// </summary>
        /// <param name="hwnd">Parent window handle.</param>
        /// <param name="name">The name of the object to display.</param>
        /// <param name="sd">The security descriptor to display.</param>
        /// <param name="access_type">An enumerated type for the access mask.</param>
        /// <param name="generic_mapping">Generic mapping for the access rights.</param>
        /// <param name="valid_access">Valid access mask for the access rights.</param>
        public static void EditSecurity(IntPtr hwnd, string name, SecurityDescriptor sd,
                                        Type access_type, AccessMask valid_access, GenericMapping generic_mapping)
        {
            Dictionary <uint, String> access = GetMaskDictionary(access_type, valid_access);

            using (var impl = new SecurityInformationImpl(name, sd, access, generic_mapping)) {
                Win32NativeMethods.EditSecurity(hwnd, impl);
            }
        }
Exemple #2
0
        /// <summary>
        /// Display the edit security dialog.
        /// </summary>
        /// <param name="hwnd">Parent window handle.</param>
        /// <param name="handle">NT object to display the security.</param>
        /// <param name="object_name">The name of the object to display.</param>
        /// <param name="read_only">True to force the UI to read only.</param>
        public static void EditSecurity(IntPtr hwnd, NtObject handle, string object_name, bool read_only)
        {
            Dictionary <uint, String> access = GetMaskDictionary(handle.NtType.AccessRightsType, handle.NtType.ValidAccess);

            using (SecurityInformationImpl impl = new SecurityInformationImpl(object_name, handle, access,
                                                                              handle.NtType.GenericMapping, read_only)) {
                Win32NativeMethods.EditSecurity(hwnd, impl);
            }
        }
Exemple #3
0
        /// <summary>
        /// Display the edit security dialog.
        /// </summary>
        /// <param name="hwnd">Parent window handle.</param>
        /// <param name="name">The name of the object to display.</param>
        /// <param name="sd">The security descriptor to display.</param>
        /// <param name="type">The NT type of the object.</param>
        public static void EditSecurity(IntPtr hwnd, string name, SecurityDescriptor sd, NtType type)
        {
            Dictionary <uint, String> access = GetMaskDictionary(type);

            using (var impl = new SecurityInformationImpl(name, sd, access, type.GenericMapping))
            {
                EditSecurity(hwnd, impl);
            }
        }