Cleanup security permission and resource consumption attribute references (dotnet...
authorJan Kotas <jkotas@microsoft.com>
Sat, 2 Feb 2019 08:09:09 +0000 (00:09 -0800)
committerGitHub <noreply@github.com>
Sat, 2 Feb 2019 08:09:09 +0000 (00:09 -0800)
Commit migrated from https://github.com/dotnet/corefx/commit/2c2e4a599889652ec579a870054b0f8915ea70fd

70 files changed:
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/CompilerServices/Conversions.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.Windows.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/MalformedLineException.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/TextFieldParser.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/NativeMethods.Windows.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Information.vb
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
src/libraries/System.Data.Common/src/System/Data/DataTable.cs
src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs
src/libraries/System.Data.SqlClient/src/System.Data.SqlClient.csproj
src/libraries/System.Data.SqlClient/src/System/Data/Sql/InvalidUdtException.cs
src/libraries/System.Data.SqlClient/src/System/Data/Sql/SqlNorm.cs
src/libraries/System.Data.SqlClient/src/System/Data/SqlClient/SqlFileStream.Windows.cs
src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs
src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs
src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/ConsoleTraceListener.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AdvancedFilters.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthenticablePrincipal.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Computer.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Context.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Group.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Principal.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/UnknownPrincipal.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/User.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/exceptions.cs
src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/interopt.cs
src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj
src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapConnection.cs
src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryContext.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Exception.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs
src/libraries/System.DirectoryServices/src/System/DirectoryServices/SearchResult.cs
src/libraries/System.Drawing.Common/src/System/Drawing/Design/CategoryNameCollection.cs
src/libraries/System.Drawing.Common/tests/Drawing2D/GraphicsPathIteratorTests.cs
src/libraries/System.Drawing.Common/tests/Text/PrivateFontCollectionTests.cs
src/libraries/System.Drawing.Common/tests/mono/System.Drawing.Imaging/JpegCodecTests.cs
src/libraries/System.Drawing.Common/tests/mono/System.Drawing/BitmapTests.cs
src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeAccessRule.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeAuditRule.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeSecurity.cs
src/libraries/System.Management/src/System.Management.csproj
src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs
src/libraries/System.Management/src/System/Management/ManagementException.cs
src/libraries/System.Management/src/System/Management/ManagementScope.cs
src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs
src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj
src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheMemoryMonitor.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/Dbg.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/HostFileChangeMonitor.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStore.cs
src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CertUsageType.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/SignedXml.cs
src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/Utils.cs

index 2f8301e..7cbc84d 100644 (file)
     <Reference Include="System.Runtime" />
     <Reference Include="System.Runtime.Extensions" />
     <Reference Include="System.Runtime.InteropServices" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Text.RegularExpressions" />
     <Reference Include="System.Threading" />
     <Reference Include="System.Threading.Tasks" />
index cbdfa19..872255a 100644 (file)
@@ -8,7 +8,6 @@ Imports System.Globalization
 Imports System.Diagnostics
 Imports System.Dynamic
 Imports System.Reflection
-Imports System.Security
 
 Imports Microsoft.VisualBasic.CompilerServices.Symbols
 Imports Microsoft.VisualBasic.CompilerServices.ConversionResolution
@@ -2490,7 +2489,6 @@ MisMatch:
             Return ChangeType(Expression, TargetType, False)
         End Function
 
-        <SecuritySafeCritical()>
         Friend Shared Function ChangeType(ByVal Expression As Object, ByVal TargetType As Type, ByVal Dynamic As Boolean) As Object
             If TargetType Is Nothing Then
                 Throw New ArgumentException(SR.Format(SR.Argument_InvalidNullValue1, "TargetType"))
index 977a91e..983b7aa 100644 (file)
@@ -8,7 +8,6 @@ Imports System
 Imports System.ComponentModel
 Imports System.Diagnostics
 Imports System.Security
-Imports System.Runtime.Versioning
 Imports System.Text
 
 Imports Microsoft.VisualBasic.CompilerServices
@@ -33,9 +32,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' Copy/MoveFile will call this directly. Copy/MoveDirectory will call ShellCopyOrMoveDirectory first
         ''' to change the path if needed.
         ''' </remarks>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub ShellCopyOrMove(ByVal Operation As CopyOrMove, ByVal TargetType As FileOrDirectory,
             ByVal FullSourcePath As String, ByVal FullTargetPath As String, ByVal ShowUI As UIOptionInternal, ByVal OnUserCancel As UICancelOption)
             Debug.Assert(System.Enum.IsDefined(GetType(CopyOrMove), Operation))
@@ -98,9 +94,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <remarks>
         ''' We don't need to consider Recursive flag here since we already verify that in DeleteDirectory.
         ''' </remarks>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub ShellDelete(ByVal FullPath As String,
             ByVal ShowUI As UIOptionInternal, ByVal recycle As RecycleOption, ByVal OnUserCancel As UICancelOption, ByVal FileOrDirectory As FileOrDirectory)
 
@@ -126,15 +119,9 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="FullTarget">The full path to the target. Nothing if this is a Delete operation.</param>
         ''' <param name="OnUserCancel">Value from UICancelOption, specifying to throw or not when user cancels the operation.</param>
         '''<remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt, UI:=True)>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub ShellFileOperation(ByVal OperationType As SHFileOperationType, ByVal OperationFlags As ShFileOperationFlags,
             ByVal FullSource As String, ByVal FullTarget As String, ByVal OnUserCancel As UICancelOption, ByVal FileOrDirectory As FileOrDirectory)
 
-            ' Apply HostProtectionAttribute(UI = true) to indicate this function belongs to UI type.
-
             Debug.Assert(System.Enum.IsDefined(GetType(SHFileOperationType), OperationType))
             Debug.Assert(OperationType <> SHFileOperationType.FO_RENAME, "Don't call Shell to rename!!!")
             Debug.Assert(FullSource <> "" And IO.Path.IsPathRooted(FullSource), "Invalid FullSource path!!!")
@@ -173,7 +160,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="SourcePath">The source file / directory path.</param>
         ''' <param name="TargetPath">The target file / directory path. Nothing in case of delete.</param>
         ''' <returns>A fully initialized SHFILEOPSTRUCT.</returns>
-        <SecurityCritical()>
         Private Shared Function GetShellOperationInfo(
                             ByVal OperationType As SHFileOperationType, ByVal OperationFlags As ShFileOperationFlags,
                             ByVal SourcePath As String, Optional ByVal TargetPath As String = Nothing) As SHFILEOPSTRUCT
@@ -190,7 +176,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="SourcePaths">A string array containing the paths of source files. Must not be empty.</param>
         ''' <param name="TargetPath">The target file / directory path. Nothing in case of delete.</param>
         ''' <returns>A fully initialized SHFILEOPSTRUCT.</returns>
-        <SecurityCritical()>
         Private Shared Function GetShellOperationInfo(
                             ByVal OperationType As SHFileOperationType, ByVal OperationFlags As ShFileOperationFlags,
                             ByVal SourcePaths() As String, Optional ByVal TargetPath As String = Nothing) As SHFILEOPSTRUCT
@@ -291,7 +276,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' - Exception message does not contain the path since at this point it is normalized.
         ''' - Instead of using PInvoke of GetMessage and MakeHRFromErrorCode, use managed code.
         ''' </remarks>
-        <SecurityCritical()>
         Private Shared Sub ThrowWinIOError(ByVal errorCode As Integer)
             Select Case errorCode
                 Case NativeTypes.ERROR_FILE_NOT_FOUND
index 08a1fbc..0ea1042 100644 (file)
@@ -11,7 +11,6 @@ Imports System.ComponentModel
 Imports System.Diagnostics
 Imports System.Globalization
 Imports System.Security
-Imports System.Runtime.Versioning
 Imports System.Text
 
 Imports Microsoft.VisualBasic.CompilerServices
@@ -22,7 +21,6 @@ Namespace Microsoft.VisualBasic.FileIO
     '''  This class represents the file system on a computer. It allows browsing the existing drives, special directories;
     '''  and also contains some commonly use methods for IO tasks.
     ''' </summary>
-    '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
     Partial Public Class FileSystem
         ''' <summary>
         ''' Return the names of all available drives on the computer.
@@ -374,8 +372,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String)
             CopyOrMoveDirectory(CopyOrMove.Copy, sourceDirectoryName, destinationDirectoryName,
                                 overwrite:=False, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -388,8 +384,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="overwrite">True to overwrite existing files with the same name. Otherwise False.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String, ByVal overwrite As Boolean)
             CopyOrMoveDirectory(CopyOrMove.Copy, sourceDirectoryName, destinationDirectoryName,
                                 overwrite, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -403,8 +397,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String, ByVal showUI As UIOption)
             CopyOrMoveDirectory(CopyOrMove.Copy, sourceDirectoryName, destinationDirectoryName,
                                 overwrite:=False, ToUIOptionInternal(showUI), UICancelOption.ThrowException)
@@ -429,8 +421,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyFile(ByVal sourceFileName As String, ByVal destinationFileName As String)
             CopyOrMoveFile(CopyOrMove.Copy, sourceFileName, destinationFileName,
                            overwrite:=False, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -442,8 +432,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="overwrite">True to overwrite existing file with the same name. Otherwise False.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal overwrite As Boolean)
             CopyOrMoveFile(CopyOrMove.Copy, sourceFileName, destinationFileName,
                            overwrite, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -457,8 +445,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal showUI As UIOption)
             CopyOrMoveFile(CopyOrMove.Copy, sourceFileName, destinationFileName,
                            overwrite:=False, ToUIOptionInternal(showUI), UICancelOption.ThrowException)
@@ -474,8 +460,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
         ''' <param name="onUserCancel">ThrowException to throw exception if user cancels the operation. Otherwise DoNothing.</param>
         ''' <remarks>onUserCancel will be ignored if showUI = HideDialogs.</remarks>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub CopyFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal showUI As UIOption, ByVal onUserCancel As UICancelOption)
             CopyOrMoveFile(CopyOrMove.Copy, sourceFileName, destinationFileName,
                            overwrite:=False, ToUIOptionInternal(showUI), onUserCancel)
@@ -502,8 +486,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="directory">The path to the directory.</param>
         ''' <param name="onDirectoryNotEmpty">DeleteAllContents to delete everything. ThrowIfDirectoryNonEmpty to throw exception if the directory is not empty.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteDirectory(ByVal directory As String, ByVal onDirectoryNotEmpty As DeleteDirectoryOption)
             DeleteDirectoryInternal(directory, onDirectoryNotEmpty,
                 UIOptionInternal.NoUI, RecycleOption.DeletePermanently, UICancelOption.ThrowException)
@@ -515,8 +497,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="directory">The path to the directory.</param>
         ''' <param name="showUI">True to shows progress window. Otherwise, False.</param>
         ''' <param name="recycle">SendToRecycleBin to delete to Recycle Bin. Otherwise DeletePermanently.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteDirectory(ByVal directory As String, ByVal showUI As UIOption, ByVal recycle As RecycleOption)
             DeleteDirectoryInternal(directory, DeleteDirectoryOption.DeleteAllContents,
                                     ToUIOptionInternal(showUI), recycle, UICancelOption.ThrowException)
@@ -529,8 +509,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
         ''' <param name="recycle">SendToRecycleBin to delete to Recycle Bin. Otherwise DeletePermanently.</param>
         ''' <param name="onUserCancel">Throw exception when user cancel the UI operation or not.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteDirectory(ByVal directory As String,
             ByVal showUI As UIOption, ByVal recycle As RecycleOption, ByVal onUserCancel As UICancelOption)
             DeleteDirectoryInternal(directory, DeleteDirectoryOption.DeleteAllContents,
@@ -541,8 +519,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' Delete the given file.
         ''' </summary>
         ''' <param name="file">The path to the file.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteFile(ByVal file As String)
             DeleteFileInternal(file, UIOptionInternal.NoUI, RecycleOption.DeletePermanently, UICancelOption.ThrowException)
         End Sub
@@ -553,8 +529,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="file">The path to the file.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
         ''' <param name="recycle">SendToRecycleBin to delete to Recycle Bin. Otherwise DeletePermanently.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteFile(ByVal file As String, ByVal showUI As UIOption, ByVal recycle As RecycleOption)
             DeleteFileInternal(file, ToUIOptionInternal(showUI), recycle, UICancelOption.ThrowException)
         End Sub
@@ -568,8 +542,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="onUserCancel">Throw exception when user cancel the UI operation or not.</param>
         ''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath() exceptions: if FilePath is invalid.</exception>
         ''' <exception cref="IO.FileNotFoundException">if a file does not exist at FilePath</exception>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub DeleteFile(ByVal file As String, ByVal showUI As UIOption, ByVal recycle As RecycleOption,
                                      ByVal onUserCancel As UICancelOption)
 
@@ -582,8 +554,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String)
             CopyOrMoveDirectory(CopyOrMove.Move, sourceDirectoryName, destinationDirectoryName,
                 overwrite:=False, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -595,8 +565,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>        ''' <param name="overwrite">True to overwrite existing files with the same name. Otherwise False.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String, ByVal overwrite As Boolean)
             CopyOrMoveDirectory(CopyOrMove.Move, sourceDirectoryName, destinationDirectoryName,
                 overwrite, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -610,8 +578,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceDirectoryName">The path to the source directory, can be relative or absolute.</param>
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String, ByVal showUI As UIOption)
             CopyOrMoveDirectory(CopyOrMove.Move, sourceDirectoryName, destinationDirectoryName,
                                 overwrite:=False, ToUIOptionInternal(showUI), UICancelOption.ThrowException)
@@ -626,8 +592,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="destinationDirectoryName">The path to the target directory, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
         ''' <param name="onUserCancel">ThrowException to throw exception if user cancels the operation. Otherwise DoNothing.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveDirectory(ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String, ByVal showUI As UIOption, ByVal onUserCancel As UICancelOption)
             CopyOrMoveDirectory(CopyOrMove.Move, sourceDirectoryName, destinationDirectoryName,
                                 overwrite:=False, ToUIOptionInternal(showUI), onUserCancel)
@@ -638,8 +602,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveFile(ByVal sourceFileName As String, ByVal destinationFileName As String)
             CopyOrMoveFile(CopyOrMove.Move, sourceFileName, destinationFileName,
                            overwrite:=False, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -651,8 +613,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="overwrite">True to overwrite existing file with the same name. Otherwise False.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal overwrite As Boolean)
             CopyOrMoveFile(CopyOrMove.Move, sourceFileName, destinationFileName,
                            overwrite, UIOptionInternal.NoUI, UICancelOption.ThrowException)
@@ -666,8 +626,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="sourceFileName">The path to the source file, can be relative or absolute.</param>
         ''' <param name="destinationFileName">The path to the destination file, can be relative or absolute. Parent directory will always be created.</param>
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal showUI As UIOption)
             CopyOrMoveFile(CopyOrMove.Move, sourceFileName, destinationFileName,
                            overwrite:=False, ToUIOptionInternal(showUI), UICancelOption.ThrowException)
@@ -683,8 +641,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="showUI">ShowDialogs to display progress and confirmation dialogs. Otherwise HideDialogs.</param>
         ''' <param name="onUserCancel">ThrowException to throw exception if user cancels the operation. Otherwise DoNothing.</param>
         ''' <remarks>onUserCancel will be ignored if showUI = HideDialogs.</remarks>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Public Shared Sub MoveFile(ByVal sourceFileName As String, ByVal destinationFileName As String, ByVal showUI As UIOption, ByVal onUserCancel As UICancelOption)
             CopyOrMoveFile(CopyOrMove.Move, sourceFileName, destinationFileName,
                            overwrite:=False, ToUIOptionInternal(showUI), onUserCancel)
@@ -931,9 +887,6 @@ Namespace Microsoft.VisualBasic.FileIO
         '''     IOException: Target directory is under source directory - cyclic operation.
         '''     IOException: TargetDirectoryPath points to an existing file.
         '''     IOException: Some files and directories can not be copied.</exception>
-        <SecuritySafeCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub CopyOrMoveDirectory(ByVal operation As CopyOrMove,
                                                ByVal sourceDirectoryName As String, ByVal destinationDirectoryName As String,
                                                ByVal overwrite As Boolean, ByVal showUI As UIOptionInternal, ByVal onUserCancel As UICancelOption)
@@ -1003,8 +956,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="targetDirectoryPath">Target path - must be full path.</param>
         ''' <param name="Overwrite">True to overwrite the files. Otherwise, False.</param>
         ''' <exception cref="IO.IOException">Some files or directories cannot be copied or moved.</exception>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub FxCopyOrMoveDirectory(ByVal operation As CopyOrMove,
                                                  ByVal sourceDirectoryPath As String, ByVal targetDirectoryPath As String, ByVal overwrite As Boolean)
 
@@ -1054,8 +1005,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="SourceDirectoryNode">The source node. Only copy / move directories contained in the source node.</param>
         ''' <param name="Overwrite">True to overwrite sub-files. Otherwise False.</param>
         ''' <param name="Exceptions">The list of accumulated exceptions while doing the copy / move</param>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub CopyOrMoveDirectoryNode(ByVal Operation As CopyOrMove,
                                                    ByVal SourceDirectoryNode As DirectoryNode, ByVal Overwrite As Boolean, ByVal Exceptions As ListDictionary)
 
@@ -1137,9 +1086,6 @@ Namespace Microsoft.VisualBasic.FileIO
         '''   ArgumenNullException: If NewName = "".
         '''   ArgumentException: If NewName contains path information.
         ''' </exception>
-        <SecuritySafeCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub CopyOrMoveFile(ByVal operation As CopyOrMove,
                                           ByVal sourceFileName As String, ByVal destinationFileName As String,
                                           ByVal overwrite As Boolean, ByVal showUI As UIOptionInternal, ByVal onUserCancel As UICancelOption
@@ -1216,9 +1162,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="recycle">SendToRecycleBin to delete to Recycle Bin. Otherwise DeletePermanently.</param>
         ''' <param name="onUserCancel">Throw exception when user cancel the UI operation or not.</param>
         ''' <remarks>If user wants shell features, onDirectoryNotEmpty is ignored.</remarks>
-        <SecuritySafeCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub DeleteDirectoryInternal(ByVal directory As String, ByVal onDirectoryNotEmpty As DeleteDirectoryOption,
                                                    ByVal showUI As UIOptionInternal, ByVal recycle As RecycleOption, ByVal onUserCancel As UICancelOption)
 
@@ -1259,9 +1202,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="recycle">DeletePermanently or SendToRecycleBin</param>
         ''' <param name="onUserCancel">DoNothing or ThrowException</param>
         ''' <remarks></remarks>
-        <SecuritySafeCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Private Shared Sub DeleteFileInternal(ByVal file As String, ByVal showUI As UIOptionInternal, ByVal recycle As RecycleOption,
                                               ByVal onUserCancel As UICancelOption)
             ' Verify enums
index f530ce7..2efdab0 100644 (file)
@@ -7,8 +7,6 @@ Option Strict On
 Imports System
 Imports System.ComponentModel
 Imports System.Globalization
-Imports System.Security
-Imports System.Security.Permissions
 
 Imports Microsoft.VisualBasic.CompilerServices.Utils
 
@@ -110,8 +108,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="info"></param>
         ''' <param name="context"></param>
         ''' <remarks></remarks>
-        <SecurityCritical()>
-        <SecurityPermission(SecurityAction.Demand, SerializationFormatter:=True)>
         <EditorBrowsable(EditorBrowsableState.Advanced)>
         Public Overrides Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
             If info IsNot Nothing Then ' Fix FxCop violation ValidateArgumentsOfPublicMethods.
index 71130c8..4b503cd 100644 (file)
@@ -29,7 +29,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="path">The path of the file to be parsed</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal path As String)
 
             ' Default to UTF-8 and detect encoding
@@ -42,7 +41,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="path">The path of the file to be parsed</param>
         ''' <param name="defaultEncoding">The decoding to default to if encoding isn't determined from file</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal path As String, ByVal defaultEncoding As System.Text.Encoding)
 
             ' Default to detect encoding
@@ -56,7 +54,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="defaultEncoding">The decoding to default to if encoding isn't determined from file</param>
         ''' <param name="detectEncoding">Indicates whether or not to try to detect the encoding from the BOM</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal path As String, ByVal defaultEncoding As System.Text.Encoding, ByVal detectEncoding As Boolean)
 
             InitializeFromPath(path, defaultEncoding, detectEncoding)
@@ -67,7 +64,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="stream"></param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal stream As Stream)
 
             ' Default to UTF-8 and detect encoding
@@ -80,7 +76,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="stream"></param>
         ''' <param name="defaultEncoding">The decoding to default to if encoding isn't determined from file</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal stream As Stream, ByVal defaultEncoding As System.Text.Encoding)
 
             ' Default to detect encoding
@@ -94,7 +89,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="defaultEncoding">The decoding to default to if encoding isn't determined from file</param>
         ''' <param name="detectEncoding">Indicates whether or not to try to detect the encoding from the BOM</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal stream As Stream, ByVal defaultEncoding As System.Text.Encoding, ByVal detectEncoding As Boolean)
 
             InitializeFromStream(stream, defaultEncoding, detectEncoding)
@@ -108,7 +102,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' <param name="detectEncoding">Indicates whether or not to try to detect the encoding from the BOM</param>
         ''' <param name="leaveOpen">Indicates whether or not to leave the passed in stream open</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal stream As Stream, ByVal defaultEncoding As System.Text.Encoding, ByVal detectEncoding As Boolean, ByVal leaveOpen As Boolean)
 
             m_LeaveOpen = leaveOpen
@@ -120,7 +113,6 @@ Namespace Microsoft.VisualBasic.FileIO
         ''' </summary>
         ''' <param name="reader">The TextReader that does the reading</param>
         ''' <remarks></remarks>
-        '<HostProtection(Resources:=HostProtectionResource.ExternalProcessMgmt)>
         Public Sub New(ByVal reader As TextReader)
 
             If reader Is Nothing Then
index 0470a56..5bec609 100644 (file)
@@ -5,16 +5,12 @@ Option Strict On
 Option Explicit On
 
 Imports System
-Imports System.Security
 Imports System.Runtime.InteropServices
-Imports System.Runtime.Versioning
 
 Namespace Microsoft.VisualBasic.CompilerServices
 
     <ComVisible(False)>
     Friend NotInheritable Class NativeMethods
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.None)>
         <PreserveSig()>
         Friend Declare Function _
             CloseHandle _
@@ -26,9 +22,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' </summary>
         ''' <param name="lpFileOp">32-bit SHFILEOPSTRUCT</param>
         ''' <returns>0 if successful, non-zero otherwise.</returns>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
-        <ResourceConsumption(ResourceScope.Machine)>
         Friend Shared Function SHFileOperation(ByRef lpFileOp As SHFILEOPSTRUCT) As Int32
             If (IntPtr.Size = 4) Then ' 32-bit platforms
                 Return SHFileOperation32(lpFileOp)
@@ -67,8 +60,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' You cannot use SHFileOperation to move special folders My Documents and My Pictures from a local drive to a remote computer.
         ''' File deletion is recursive unless you set the FOF_NORECURSION flag.
         ''' </remarks>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
         <DllImport("shell32.dll", CharSet:=CharSet.Auto, EntryPoint:="SHFileOperation", SetLastError:=True, ThrowOnUnmappableChar:=True)>
         Private Shared Function SHFileOperation32(ByRef lpFileOp As SHFILEOPSTRUCT) As Int32
         End Function
@@ -114,8 +105,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' <summary>
         ''' Copies, moves, renames or deletes a file system object on 64-bit platforms.
         ''' </summary>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
         <DllImport("shell32.dll", CharSet:=CharSet.Auto, EntryPoint:="SHFileOperation", SetLastError:=True, ThrowOnUnmappableChar:=True)>
         Private Shared Function SHFileOperation64(ByRef lpFileOp As SHFILEOPSTRUCT64) As Int32
         End Function
@@ -205,8 +194,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' Win 95/98/Me: SHChangeNotify is supported by Microsoft Layer for Unicode.
         ''' To use this http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mslu/winprog/microsoft_layer_for_unicode_on_windows_95_98_me_systems.asp
         ''' </remarks>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.None)>
         <DllImport("shell32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
         Friend Shared Sub SHChangeNotify(ByVal wEventId As UInt32, ByVal uFlags As UInt32,
                 ByVal dwItem1 As IntPtr, ByVal dwItem2 As IntPtr)
@@ -236,8 +223,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' The MoveFileEx function moves an existing file or directory.
         ''' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/movefileex.asp
         ''' </summary>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.Machine)>
         <DllImport("kernel32",
              PreserveSig:=True,
              CharSet:=CharSet.Auto,
index cfef037..3ac3b77 100644 (file)
@@ -6,8 +6,6 @@ Option Strict On
 
 Imports System
 Imports System.Diagnostics
-Imports System.Security
-Imports System.Runtime.ConstrainedExecution
 Imports System.Runtime.InteropServices
 Imports Microsoft.Win32.SafeHandles
 
@@ -28,8 +26,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
             Public lpSecurityDescriptor As IntPtr
             Public bInheritHandle As Boolean
 
-            <SecuritySafeCritical()>
-            <ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)>
             Public Overloads Sub Dispose() Implements IDisposable.Dispose
                 If lpSecurityDescriptor <> IntPtr.Zero Then
                     UnsafeNativeMethods.LocalFree(lpSecurityDescriptor)
@@ -49,23 +45,18 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' This is required because call to constructor of SafeHandle is not allowed in constrained region.
         ''' </summary>
         ''' <remarks>VSWhidbey 544308</remarks>
-        <SecurityCritical()>
-        <SuppressUnmanagedCodeSecurity()>
         Friend NotInheritable Class LateInitSafeHandleZeroOrMinusOneIsInvalid
             Inherits SafeHandleZeroOrMinusOneIsInvalid
 
-            <SecurityCritical()>
             Friend Sub New()
                 MyBase.New(True)
             End Sub
 
-            <SecurityCritical()>
             Friend Sub InitialSetHandle(ByVal h As IntPtr)
                 Debug.Assert(MyBase.IsInvalid, "Safe handle should only be set once.")
                 MyBase.SetHandle(h)
             End Sub
 
-            <SecurityCritical()>
             Protected Overrides Function ReleaseHandle() As Boolean
                 Return NativeMethods.CloseHandle(Me.handle) <> 0
             End Function
@@ -81,8 +72,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' (using LateInitSafeHandleZeroOrMinusOneIsInvalid.InitialSetHandle) to correctly use and dispose the handle.
         ''' </remarks>
         <StructLayout(LayoutKind.Sequential)>
-        <System.Security.SecurityCritical()>
-        <System.Security.SuppressUnmanagedCodeSecurity()>
         Friend NotInheritable Class PROCESS_INFORMATION
             Public hProcess As IntPtr = IntPtr.Zero
             Public hThread As IntPtr = IntPtr.Zero
@@ -103,8 +92,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' </summary>
         ''' <remarks></remarks>
         <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)>
-        <System.Security.SecurityCritical()>
-        <System.Security.SuppressUnmanagedCodeSecurity()>
         Friend NotInheritable Class STARTUPINFO
             Implements IDisposable
 
@@ -132,13 +119,11 @@ Namespace Microsoft.VisualBasic.CompilerServices
 
             Private m_HasBeenDisposed As Boolean ' To detect redundant calls. Default initialize = False.
 
-            <SecuritySafeCritical()>
             Protected Overrides Sub Finalize()
                 Dispose(False)
             End Sub
 
             ' IDisposable
-            <SecurityCritical()>
             Private Sub Dispose(ByVal disposing As Boolean)
                 If Not m_HasBeenDisposed Then
                     If disposing Then
@@ -167,8 +152,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
             End Sub
 
             ' This code correctly implements the disposable pattern.
-            <SecuritySafeCritical()>
-            <ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)>
             Friend Sub Dispose() Implements IDisposable.Dispose
                 ' Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.
                 Dispose(True)
index 1f9d8dd..41b8b59 100644 (file)
@@ -3,14 +3,11 @@
 ' See the LICENSE file in the project root for more information.
 
 Imports System
-Imports System.Security
 Imports System.Runtime.InteropServices
-Imports System.Runtime.Versioning
 
 Namespace Microsoft.VisualBasic.CompilerServices
 
     <ComVisible(False)>
-    <SuppressUnmanagedCodeSecurityAttribute()>
     Friend NotInheritable Class UnsafeNativeMethods
         ''' <summary>
         ''' Frees memory allocated from the local heap. i.e. frees memory allocated
@@ -19,8 +16,6 @@ Namespace Microsoft.VisualBasic.CompilerServices
         ''' <param name="LocalHandle"></param>
         ''' <returns></returns>
         ''' <remarks></remarks>
-        <SecurityCritical()>
-        <ResourceExposure(ResourceScope.None)>
         <DllImport("kernel32", ExactSpelling:=True, SetLastError:=True)>
         Friend Shared Function LocalFree(ByVal LocalHandle As IntPtr) As IntPtr
         End Function
index 4093de9..715fb30 100644 (file)
@@ -5,7 +5,6 @@
 Imports System
 Imports System.Globalization
 Imports System.Security
-Imports System.Security.Permissions
 Imports Microsoft.VisualBasic.CompilerServices
 Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils
 Imports Microsoft.VisualBasic.CompilerServices.Utils
index 0d7f513..33d8d59 100644 (file)
@@ -7,7 +7,6 @@ namespace Microsoft.Win32
     using System;
     using System.Diagnostics;
     using System.Security;
-    using System.Security.Permissions;
     using System.Collections;
     using System.Collections.Generic;
     using System.ComponentModel;
index ee23530..c241db1 100644 (file)
@@ -1225,7 +1225,6 @@ namespace System.Data
                         view.SetIndex2("", DataViewRowState.CurrentRows, null, true);
                     }
 
-                    // avoid HostProtectionAttribute(Synchronization=true) by not calling virtual methods from inside a lock
                     view = Interlocked.CompareExchange<DataView>(ref _defaultView, view, null);
                     if (null == view)
                     {
index f0f82ce..6be6ec5 100644 (file)
     <Reference Include="System.Runtime.Extensions" />
     <Reference Include="System.Runtime.InteropServices" />
     <Reference Include="System.Security.Claims" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal" />
     <Reference Include="System.Security.Principal.Windows" />
     <Reference Include="System.Text.Encoding.CodePages" />
index 8df9483..8c2e06d 100644 (file)
@@ -8,7 +8,6 @@ using System.Diagnostics;
 using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Runtime.InteropServices;
-using System.Security.Permissions;
 using System.Text;
 using SysTx = System.Transactions;
 
index 757b391..9bd2a80 100644 (file)
     <Reference Include="System.Security.Claims" />
     <Reference Include="System.Security.Principal" />
     <Reference Include="System.Security.Principal.Windows" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Text.Encoding.CodePages" />
     <Reference Include="System.Text.Encoding.Extensions" />
     <Reference Include="System.Text.RegularExpressions" />
index 63cad1b..0f0bbeb 100644 (file)
@@ -5,7 +5,6 @@
 using System;
 using System.Data.Common;
 using System.Runtime.Serialization;
-using System.Security.Permissions;
 
 namespace Microsoft.SqlServer.Server
 {
index 16ae5c6..6677516 100644 (file)
@@ -10,7 +10,6 @@ using System.IO;
 using System.Globalization;
 using System.Reflection;
 using System.Runtime.InteropServices;
-using System.Security.Permissions;
 using System.Text;
 using System.Runtime.CompilerServices;
 using System.Data.SqlTypes;
@@ -603,4 +602,4 @@ namespace Microsoft.SqlServer.Server
 
         internal override int Size => 8;
     }
-}
\ No newline at end of file
+}
index 1232ceb..2d9cff2 100644 (file)
@@ -10,7 +10,6 @@ using System.Globalization;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Versioning;
-using System.Security.Permissions;
 using Microsoft.Win32.SafeHandles;
 using System.Buffers;
 
@@ -274,7 +273,6 @@ namespace System.Data.SqlTypes
             _m_fs.Flush();
         }
 
-        [HostProtection(ExternalThreading = true)]
         public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
         {
             if (_m_disposed)
@@ -291,7 +289,6 @@ namespace System.Data.SqlTypes
             return _m_fs.EndRead(asyncResult);
         }
 
-        [HostProtection(ExternalThreading = true)]
         public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
         {
             if (_m_disposed)
index d78eb58..890b42a 100644 (file)
     <Reference Include="System.Runtime.Extensions" />
     <Reference Include="System.Runtime.InteropServices" />
     <Reference Include="System.Resources.ResourceManager" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal.Windows" />
     <Reference Include="System.Threading" />
     <Reference Include="System.Threading.AccessControl" />
index 0e6b469..6c329e0 100644 (file)
@@ -10,7 +10,6 @@ using System.Globalization;
 using System.IO;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-using System.Security.Permissions;
 using System.Threading;
 using Microsoft.Win32;
 using Microsoft.Win32.SafeHandles;
@@ -1171,7 +1170,6 @@ namespace System.Diagnostics
             boolFlags[Flag_monitoring] = isMonitoring;
         }
 
-        [HostProtection(Synchronization = true)]
         private static void RemoveListenerComponent(EventLogInternal component, string compLogName)
         {
             lock (InternalSyncObject)
index cf79f02..fed02da 100644 (file)
@@ -13,7 +13,6 @@ using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Runtime.Versioning;
 using System.Security;
-using System.Security.Permissions;
 using System.Security.Principal;
 using System.Text;
 using System.Threading;
index 9316dd3..636166f 100644 (file)
@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System.Security.Permissions;
-
 namespace System.Diagnostics
 {
     public class ConsoleTraceListener : TextWriterTraceListener {
index 1853a33..b907794 100644 (file)
     <Reference Include="System.IO.FileSystem.AccessControl" />
     <Reference Include="System.Runtime" />
     <Reference Include="System.Security.AccessControl" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal.Windows" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
index 7382b2d..f5d8424 100644 (file)
@@ -13,7 +13,6 @@ namespace System.DirectoryServices.AccountManagement
     using System.Runtime.InteropServices;
     using System;
     using System.Security;
-    using System.Security.Permissions;
     using System.Text;
 
     internal class Constants
index faff0ee..ac06dd5 100644 (file)
@@ -40,7 +40,6 @@
   </ItemGroup>
   <ItemGroup>
     <Reference Include="System.Security.AccessControl" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal.Windows" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
index 90b9bec..9d2036a 100644 (file)
@@ -7,7 +7,6 @@ using System.Security.Principal;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
-using System.Security.Permissions;
 using System.IO;
 
 namespace System.DirectoryServices.ActiveDirectory
index 284c7ab..715a38d 100644 (file)
@@ -7,7 +7,6 @@ using System.ComponentModel;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Security.Authentication;
-using System.Security.Permissions;
 
 namespace System.DirectoryServices.ActiveDirectory
 {
index 4f71da6..bfb9b10 100644 (file)
@@ -6,7 +6,6 @@ using System.Text;
 using System.Net;
 using System.Collections;
 using System.Security.Principal;
-using System.Security.Permissions;
 using System.Runtime.InteropServices;
 using System.Diagnostics;
 using System.Globalization;
index 56127ea..79fbb6c 100644 (file)
@@ -8,7 +8,6 @@ using System.DirectoryServices.Interop;
 using System.ComponentModel;
 using System.Threading;
 using System.Reflection;
-using System.Security.Permissions;
 using System.DirectoryServices.Design;
 using System.Globalization;
 using System.Net;
index 15b8dae..0ff213c 100644 (file)
@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information.
 
 using System.Net;
-using System.Security.Permissions;
 
 namespace System.DirectoryServices
 {
index d100e2f..d08a4d0 100644 (file)
@@ -5,7 +5,6 @@ using System.Collections.Generic;
 using System.Drawing.Tests;
 using System.IO;
 using System.Runtime.InteropServices;
-using System.Security.Permissions;
 using Xunit;
 
 namespace System.Drawing.Text.Tests
index 5c849c1..192b97d 100644 (file)
@@ -39,7 +39,6 @@ using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Runtime.Serialization.Formatters.Binary;
 using System.Security.Cryptography;
-using System.Security.Permissions;
 using System.Text;
 using System.Xml.Serialization;
 using Xunit;
index bc14699..0ad3216 100644 (file)
@@ -34,7 +34,6 @@ using System.Drawing.Drawing2D;
 using System.Drawing.Imaging;
 using System.IO;
 using System.Runtime.InteropServices;
-using System.Security.Permissions;
 using Xunit;
 
 namespace MonoTests.System.Drawing.Imaging
index db29ad7..2aca610 100644 (file)
@@ -7,7 +7,6 @@ using System.Security.Principal;
 
 namespace System.IO.Pipes
 {
-    // [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
     public sealed class PipeAccessRule : AccessRule
     {
         //
index db9a6c7..0d96778 100644 (file)
@@ -7,7 +7,6 @@ using System.Security.Principal;
 
 namespace System.IO.Pipes
 {
-    //[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
     public sealed class PipeAuditRule : AuditRule
     {
         public PipeAuditRule(
index 0fe4809..28fea11 100644 (file)
@@ -9,7 +9,6 @@ using System.Runtime.InteropServices;
 
 namespace System.IO.Pipes
 {
-    //[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
     public class PipeSecurity : NativeObjectSecurity
     {
         public PipeSecurity()
index 0777c68..1352ac3 100644 (file)
@@ -74,7 +74,6 @@
     <Reference Include="Microsoft.Win32.Primitives" />
     <Reference Include="Microsoft.Win32.Registry" />
     <Reference Include="System.CodeDom" />
-    <Reference Include="System.Security.Permissions" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
     <Reference Include="System.Collections.NonGeneric" />
index 70e751d..a0be649 100644 (file)
@@ -7,7 +7,6 @@ using System.Runtime.InteropServices;
 using System.Security;
 using System.Runtime.Serialization;
 using System.Threading;
-using System.Security.Permissions;
 using System.Runtime.Versioning;
 using System.Text;
 
index a5c60b4..6235ccc 100644 (file)
@@ -9,7 +9,6 @@ using System.IO;
 using System.Reflection;
 using System.ComponentModel.Design.Serialization;
 using System.Security;
-using System.Security.Permissions;
 using Microsoft.Win32;
 
 namespace System.Management
index 68bee7f..35d0ac9 100644 (file)
@@ -6,7 +6,6 @@ namespace System.Runtime.Serialization
 {
     using System;
     using System.Security;
-    using System.Security.Permissions;
     using System.Runtime.CompilerServices;
 
     internal sealed class SurrogateDataContract : DataContract
index fc12c71..2750203 100644 (file)
@@ -72,6 +72,5 @@
   <ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' OR '$(TargetGroup)' == 'uap'">
     <Reference Include="System.Collections" />
     <Reference Include="System.Diagnostics.Debug" />
-    <Reference Include="System.Security.Permissions" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index 2761f39..ef37968 100644 (file)
@@ -92,7 +92,6 @@
     <Reference Include="System.Runtime.Extensions" />
     <Reference Include="System.Runtime.InteropServices" />
     <Reference Include="System.Runtime.InteropServices.RuntimeInformation" />
-    <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal.Windows" />
     <Reference Include="System.Threading" />
     <Reference Include="System.Threading.AccessControl" />
index bc30c05..863bec4 100644 (file)
@@ -7,7 +7,6 @@ using System.Runtime.Caching.Configuration;
 using System.Runtime.Caching.Hosting;
 using System.Diagnostics;
 using System.Security;
-using System.Security.Permissions;
 using System.Threading;
 
 namespace System.Runtime.Caching
index c13d332..6b95ddd 100644 (file)
@@ -15,7 +15,6 @@ using System.Reflection;
 using System.Runtime.ConstrainedExecution;
 using System.Runtime.InteropServices;
 using System.Security;
-using System.Security.Permissions;
 using System.Threading;
 using System.Runtime.Versioning;
 
index fdcd29e..b0f3bf0 100644 (file)
@@ -11,7 +11,6 @@ using System.Diagnostics.CodeAnalysis;
 using System.Runtime.Caching.Resources;
 using System.Globalization;
 using System.Security;
-using System.Security.Permissions;
 using System.Text;
 using System.Threading;
 
index 0ae4064..9188fe2 100644 (file)
@@ -12,7 +12,6 @@ using System.Collections.ObjectModel;
 using System.Configuration;
 using System.Diagnostics.CodeAnalysis;
 using System.Security;
-using System.Security.Permissions;
 using System.Threading;
 
 namespace System.Runtime.Caching
index 2537063..914c809 100644 (file)
@@ -8,7 +8,6 @@ using System.Collections.Specialized;
 using System.Threading;
 using System.Diagnostics;
 using System.Security;
-using System.Security.Permissions;
 using System.Diagnostics.CodeAnalysis;
 
 namespace System.Runtime.Caching
index 4b8dd7f..3725285 100644 (file)
@@ -6,7 +6,6 @@ using System;
 using System.Globalization;
 using System.Reflection;
 using System.Security;
-using System.Security.Permissions;
 using System.Diagnostics.CodeAnalysis;
 using System.Runtime.InteropServices;
 
index 97eea98..8e86c8b 100644 (file)
@@ -9,7 +9,6 @@ using System.Diagnostics;
 using System.Globalization;
 using System.IO;
 using System.Security.Cryptography.X509Certificates;
-using System.Security.Permissions;
 using System.Text;
 using System.Threading;
 using System.Xml;
index b9f93ec..ebc2bf4 100644 (file)
@@ -8,7 +8,6 @@ using System.Diagnostics;
 using System.Globalization;
 using System.IO;
 using System.Security.Cryptography.X509Certificates;
-using System.Security.Permissions;
 using System.Text;
 using System.Threading;
 using System.Xml;
index 46d835e..aec094b 100644 (file)
@@ -12,7 +12,6 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
-using System.Security.Permissions;
 using System.Xml;
 using Microsoft.Win32;
 
index d5f2a92..b4e896c 100644 (file)
@@ -11,7 +11,6 @@ using System.IO;
 using System.Security;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
-using System.Security.Permissions;
 using System.Text;
 using System.Threading;
 using System.Xml;