private void PopulateData()
        {
            if (!_data_populated)
            {
                _data_populated = true;
                if (NtObject.CanOpenType(TypeName))
                {
                    try
                    {
                        using (var result = ToObject(false))
                        {
                            if (!result.IsSuccess)
                            {
                                return;
                            }
                            var obj = result.Result;
                            if (obj.IsAccessMaskGranted(GenericAccessRights.ReadControl))
                            {
                                _sd = obj.GetSecurityDescriptor(SecurityInformation.AllBasic, false).GetResultOrDefault();
                            }

                            if (obj is NtSymbolicLink link && link.IsAccessGranted(SymbolicLinkAccessRights.Query))
                            {
                                _symlink_target = link.GetTarget(false).GetResultOrDefault();
                            }

                            _maximum_granted_access = obj.GrantedAccessMask.ToSpecificAccess(obj.NtType.AccessRightsType);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
        private void PopulateData()
        {
            if (!_data_populated)
            {
                _data_populated = true;
                if (NtObject.CanOpenType(TypeName))
                {
                    try
                    {
                        using (NtObject obj = ToObject())
                        {
                            if (obj.IsAccessMaskGranted(GenericAccessRights.ReadControl))
                            {
                                _sd = obj.SecurityDescriptor;
                            }

                            NtSymbolicLink link = obj as NtSymbolicLink;
                            if (link != null && link.IsAccessGranted(SymbolicLinkAccessRights.Query))
                            {
                                _symlink_target = link.Target;
                            }

                            _maximum_granted_access = obj.GrantedAccessMask.ToSpecificAccess(obj.NtType.AccessRightsType);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
 void ReadSecurityDescriptor()
 {
     try
     {
         if (NtObject.CanOpenType(_type_name))
         {
             using (NtObject obj = NtObject.OpenWithType(_type_name, _name, _directory.Directory, GenericAccessRights.ReadControl))
             {
                 _sd = obj.GetSecurityDescriptorBytes(SecurityInformation.Owner | SecurityInformation.Group | SecurityInformation.Dacl | SecurityInformation.Label);
             }
         }
     }
     catch
     {
         _sd = new byte[0];
     }
 }
        private protected void PopulateData()
        {
            if (!_data_populated)
            {
                _data_populated = true;
                _is_symlink     = false;
                if (NtObject.CanOpenType(TypeName))
                {
                    try
                    {
                        using (var result = ToObject(false))
                        {
                            if (!result.IsSuccess)
                            {
                                return;
                            }
                            var obj = result.Result;
                            if (obj.IsAccessMaskGranted(GenericAccessRights.ReadControl))
                            {
                                _sd = obj.GetSecurityDescriptor(SecurityInformation.AllBasic, false).GetResultOrDefault();
                            }

                            if (obj is NtSymbolicLink link)
                            {
                                _symlink_target = link.GetTarget(false).GetResultOrDefault(string.Empty);
                            }
                            else if (obj is NtKey key)
                            {
                                PopulateKeyData(key);
                            }
                            else if (obj is NtFile file)
                            {
                                PopulateDeviceData(file);
                            }

                            _maximum_granted_access = obj.GrantedAccessMask.ToSpecificAccess(obj.NtType.AccessRightsType);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }