summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Moseley <danmose@microsoft.com>2017-02-04 22:36:42 -0800
committerGitHub <noreply@github.com>2017-02-04 22:36:42 -0800
commitee5862c6a257e60e263537d975ab6c513179d47f (patch)
tree46ad0e815b897f5c86b26789fcdb23b987aa5bb2
parent43dfb0b289978f408dcb1aa008395fe9b90db062 (diff)
downloadcoreclr-ee5862c6a257e60e263537d975ab6c513179d47f.tar.gz
coreclr-ee5862c6a257e60e263537d975ab6c513179d47f.tar.bz2
coreclr-ee5862c6a257e60e263537d975ab6c513179d47f.zip
Remove stripped code (#9269)
Delete essentially all the code that the BCL rewriter is removing. Added back some code it shouldn't have been removing, eg., serialization code, debugger visualizers, and some changing of 'protected' to 'protected internal'
-rw-r--r--clr.defines.targets2
-rw-r--r--clr.props2
-rw-r--r--src/mscorlib/Common/PinnableBufferCache.cs24
-rw-r--r--src/mscorlib/Common/Preprocessed/AssemblyRefs.g.cs1049
-rw-r--r--src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs6
-rw-r--r--src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs67
-rw-r--r--src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs2
-rw-r--r--src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs23
-rw-r--r--src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs33
-rw-r--r--src/mscorlib/corefx/SR.cs10
-rw-r--r--src/mscorlib/corefx/System/IO/PathInternal.Unix.cs22
-rw-r--r--src/mscorlib/corefx/System/IO/PathInternal.Windows.cs44
-rw-r--r--src/mscorlib/corefx/System/IO/PathInternal.cs58
-rw-r--r--src/mscorlib/corefx/System/IO/Win32Marshal.cs25
-rw-r--r--src/mscorlib/corefx/System/Runtime/InteropServices/StringBuffer.cs20
-rw-r--r--src/mscorlib/model.xml2
-rw-r--r--src/mscorlib/mscorlib.shared.sources.props2426
-rw-r--r--src/mscorlib/ref/mscorlib.cs82
-rw-r--r--src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs2
-rw-r--r--src/mscorlib/src/Microsoft/Win32/Registry.cs20
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryKey.cs460
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryOptions.cs25
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs2
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryView.cs2
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFileMappingHandle.cs39
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLocalAllocHandle.cs29
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs2
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeViewOfFileHandle.cs46
-rw-r--r--src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs13
-rw-r--r--src/mscorlib/src/Microsoft/Win32/Win32Native.cs545
-rw-r--r--src/mscorlib/src/System/Activator.cs162
-rw-r--r--src/mscorlib/src/System/AppContext/AppContext.cs2
-rw-r--r--src/mscorlib/src/System/AppDomain.cs120
-rw-r--r--src/mscorlib/src/System/AppDomainAttributes.cs20
-rw-r--r--src/mscorlib/src/System/AppDomainManager.cs2
-rw-r--r--src/mscorlib/src/System/AppDomainSetup.cs4
-rw-r--r--src/mscorlib/src/System/AppDomainUnloadedException.cs12
-rw-r--r--src/mscorlib/src/System/ApplicationId.cs141
-rw-r--r--src/mscorlib/src/System/Array.cs15
-rw-r--r--src/mscorlib/src/System/BCLDebug.cs66
-rw-r--r--src/mscorlib/src/System/CLRConfig.cs20
-rw-r--r--src/mscorlib/src/System/CannotUnloadAppDomainException.cs49
-rw-r--r--src/mscorlib/src/System/CfgParser.cs564
-rw-r--r--src/mscorlib/src/System/Collections/ArrayList.cs2083
-rw-r--r--src/mscorlib/src/System/Collections/CollectionBase.cs19
-rw-r--r--src/mscorlib/src/System/Collections/Comparer.cs2
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs371
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs30
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs322
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs49
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs280
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs101
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs1715
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Comparer.cs3
-rw-r--r--src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs118
-rw-r--r--src/mscorlib/src/System/Collections/Hashtable.cs315
-rw-r--r--src/mscorlib/src/System/Collections/IHashCodeProvider.cs2
-rw-r--r--src/mscorlib/src/System/Collections/KeyValuePairs.cs40
-rw-r--r--src/mscorlib/src/System/Collections/SortedList.cs1008
-rw-r--r--src/mscorlib/src/System/Collections/Stack.cs379
-rw-r--r--src/mscorlib/src/System/CompatibilitySwitches.cs1
-rw-r--r--src/mscorlib/src/System/Configuration/Assemblies/AssemblyHash.cs74
-rw-r--r--src/mscorlib/src/System/ContextMarshalException.cs45
-rw-r--r--src/mscorlib/src/System/DateTime.cs6
-rw-r--r--src/mscorlib/src/System/Decimal.cs9
-rw-r--r--src/mscorlib/src/System/Diagnostics/Assert.cs8
-rw-r--r--src/mscorlib/src/System/Diagnostics/LogSwitch.cs13
-rw-r--r--src/mscorlib/src/System/Diagnostics/Stacktrace.cs1
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs77
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs2
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs12
-rw-r--r--src/mscorlib/src/System/Diagnostics/log.cs115
-rw-r--r--src/mscorlib/src/System/Environment.cs201
-rw-r--r--src/mscorlib/src/System/Exception.cs27
-rw-r--r--src/mscorlib/src/System/GC.cs12
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarData.cs35
-rw-r--r--src/mscorlib/src/System/Globalization/CultureData.cs110
-rw-r--r--src/mscorlib/src/System/Globalization/CultureInfo.cs18
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeFormat.cs8
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs2
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingTable.cs4
-rw-r--r--src/mscorlib/src/System/Guid.cs8
-rw-r--r--src/mscorlib/src/System/IAppDomainPauseManager.cs40
-rw-r--r--src/mscorlib/src/System/IO/Directory.cs6
-rw-r--r--src/mscorlib/src/System/IO/DriveNotFoundException.cs7
-rw-r--r--src/mscorlib/src/System/IO/File.cs4
-rw-r--r--src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs7
-rw-r--r--src/mscorlib/src/System/IO/__Error.cs27
-rw-r--r--src/mscorlib/src/System/MissingFieldException.cs8
-rw-r--r--src/mscorlib/src/System/MissingMemberException.cs10
-rw-r--r--src/mscorlib/src/System/MissingMethodException.cs8
-rw-r--r--src/mscorlib/src/System/Number.cs4
-rw-r--r--src/mscorlib/src/System/OperatingSystem.cs19
-rw-r--r--src/mscorlib/src/System/PlatformID.cs2
-rw-r--r--src/mscorlib/src/System/Reflection/Assembly.cs355
-rw-r--r--src/mscorlib/src/System/Reflection/AssemblyNameProxy.cs28
-rw-r--r--src/mscorlib/src/System/Reflection/ConstructorInfo.cs24
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs230
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs323
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs27
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs12
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs160
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs24
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs3
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs16
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs45
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs143
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs311
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs176
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs32
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs19
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs8
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs30
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs141
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs183
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs18
-rw-r--r--src/mscorlib/src/System/Reflection/MethodBase.cs14
-rw-r--r--src/mscorlib/src/System/Reflection/MethodInfo.cs22
-rw-r--r--src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs5
-rw-r--r--src/mscorlib/src/System/Resources/IResourceWriter.cs45
-rw-r--r--src/mscorlib/src/System/Resources/ResourceManager.cs2
-rw-r--r--src/mscorlib/src/System/Resources/ResourceReader.cs4
-rw-r--r--src/mscorlib/src/System/RtType.cs30
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/AssemblyAttributesGoHere.cs43
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DecoratedNameAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/GcSettings.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/COMException.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs72
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs31
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs62
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs9
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs62
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs98
-rw-r--r--src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs29
-rw-r--r--src/mscorlib/src/System/Runtime/MemoryFailPoint.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/ProfileOptimization.cs48
-rw-r--r--src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs7
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs257
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs41
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs51
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs29
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs136
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs56
-rw-r--r--src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkId.cs28
-rw-r--r--src/mscorlib/src/System/RuntimeHandles.cs121
-rw-r--r--src/mscorlib/src/System/Security/AccessControl/Enums.cs64
-rw-r--r--src/mscorlib/src/System/Security/BuiltInPermissionSets.cs255
-rw-r--r--src/mscorlib/src/System/Security/CodeAccessPermission.cs78
-rw-r--r--src/mscorlib/src/System/Security/CodeAccessSecurityEngine.cs17
-rw-r--r--src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs151
-rw-r--r--src/mscorlib/src/System/Security/HostProtectionException.cs135
-rw-r--r--src/mscorlib/src/System/Security/HostSecurityManager.cs90
-rw-r--r--src/mscorlib/src/System/Security/IEvidenceFactory.cs11
-rw-r--r--src/mscorlib/src/System/Security/IPermission.cs2
-rw-r--r--src/mscorlib/src/System/Security/ISecurityEncodable.cs17
-rw-r--r--src/mscorlib/src/System/Security/ISecurityPolicyEncodable.cs17
-rw-r--r--src/mscorlib/src/System/Security/IStackWalk.cs23
-rw-r--r--src/mscorlib/src/System/Security/NamedPermissionSet.cs2
-rw-r--r--src/mscorlib/src/System/Security/PermissionListSet.cs270
-rw-r--r--src/mscorlib/src/System/Security/PermissionSet.cs331
-rw-r--r--src/mscorlib/src/System/Security/PermissionSetTriple.cs188
-rw-r--r--src/mscorlib/src/System/Security/PermissionToken.cs101
-rw-r--r--src/mscorlib/src/System/Security/Permissions/EnvironmentPermission.cs52
-rw-r--r--src/mscorlib/src/System/Security/Permissions/FileDialogPermission.cs4
-rw-r--r--src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs355
-rw-r--r--src/mscorlib/src/System/Security/Permissions/GACIdentityPermission.cs103
-rw-r--r--src/mscorlib/src/System/Security/Permissions/HostProtectionPermission.cs4
-rw-r--r--src/mscorlib/src/System/Security/Permissions/IBuiltInPermission.cs24
-rw-r--r--src/mscorlib/src/System/Security/Permissions/IUnrestrictedPermission.cs2
-rw-r--r--src/mscorlib/src/System/Security/Permissions/IsolatedStorageFilePermission.cs163
-rw-r--r--src/mscorlib/src/System/Security/Permissions/IsolatedStoragePermission.cs157
-rw-r--r--src/mscorlib/src/System/Security/Permissions/PermissionAttributes.cs629
-rw-r--r--src/mscorlib/src/System/Security/Permissions/PermissionState.cs2
-rw-r--r--src/mscorlib/src/System/Security/Permissions/ReflectionPermission.cs4
-rw-r--r--src/mscorlib/src/System/Security/Permissions/RegistryPermission.cs56
-rw-r--r--src/mscorlib/src/System/Security/Permissions/SecurityPermission.cs5
-rw-r--r--src/mscorlib/src/System/Security/Permissions/SiteIdentityPermission.cs248
-rw-r--r--src/mscorlib/src/System/Security/Permissions/StrongNameIdentityPermission.cs401
-rw-r--r--src/mscorlib/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs17
-rw-r--r--src/mscorlib/src/System/Security/Permissions/UIPermission.cs57
-rw-r--r--src/mscorlib/src/System/Security/Permissions/URLIdentityPermission.cs281
-rw-r--r--src/mscorlib/src/System/Security/Permissions/ZoneIdentityPermission.cs205
-rw-r--r--src/mscorlib/src/System/Security/Permissions/keycontainerpermission.cs621
-rw-r--r--src/mscorlib/src/System/Security/Policy/ApplicationTrust.cs38
-rw-r--r--src/mscorlib/src/System/Security/Policy/Evidence.cs2
-rw-r--r--src/mscorlib/src/System/Security/Policy/EvidenceBase.cs128
-rw-r--r--src/mscorlib/src/System/Security/Policy/EvidenceTypeDescriptor.cs160
-rw-r--r--src/mscorlib/src/System/Security/Policy/IDelayEvaluatedEvidence.cs34
-rw-r--r--src/mscorlib/src/System/Security/Policy/IIdentityPermissionFactory.cs20
-rw-r--r--src/mscorlib/src/System/Security/Policy/IRuntimeEvidenceFactory.cs36
-rw-r--r--src/mscorlib/src/System/Security/Policy/PolicyException.cs50
-rw-r--r--src/mscorlib/src/System/Security/Policy/PolicyStatement.cs114
-rw-r--r--src/mscorlib/src/System/Security/Policy/Site.cs105
-rw-r--r--src/mscorlib/src/System/Security/Policy/StrongName.cs110
-rw-r--r--src/mscorlib/src/System/Security/Policy/URL.cs98
-rw-r--r--src/mscorlib/src/System/Security/Policy/Zone.cs93
-rw-r--r--src/mscorlib/src/System/Security/SecurityContext.cs9
-rw-r--r--src/mscorlib/src/System/Security/SecurityElement.cs875
-rw-r--r--src/mscorlib/src/System/Security/SecurityException.cs23
-rw-r--r--src/mscorlib/src/System/Security/SecurityManager.cs16
-rw-r--r--src/mscorlib/src/System/Security/SecurityRuntime.cs36
-rw-r--r--src/mscorlib/src/System/Security/SecurityZone.cs15
-rw-r--r--src/mscorlib/src/System/Security/Util/Config.cs80
-rw-r--r--src/mscorlib/src/System/Security/Util/Hex.cs72
-rw-r--r--src/mscorlib/src/System/Security/Util/StringExpressionSet.cs5
-rw-r--r--src/mscorlib/src/System/Security/Util/TokenBasedSet.cs91
-rw-r--r--src/mscorlib/src/System/Security/Util/URLString.cs184
-rw-r--r--src/mscorlib/src/System/Security/Util/XMLUtil.cs435
-rw-r--r--src/mscorlib/src/System/Security/Util/sitestring.cs54
-rw-r--r--src/mscorlib/src/System/SharedStatics.cs31
-rw-r--r--src/mscorlib/src/System/StringComparer.cs160
-rw-r--r--src/mscorlib/src/System/Text/DecoderFallback.cs8
-rw-r--r--src/mscorlib/src/System/Text/Encoding.cs64
-rw-r--r--src/mscorlib/src/System/Threading/AsyncLocal.cs2
-rw-r--r--src/mscorlib/src/System/Threading/EventWaitHandle.cs13
-rw-r--r--src/mscorlib/src/System/Threading/IObjectHandle.cs31
-rw-r--r--src/mscorlib/src/System/Threading/LockCookie.cs57
-rw-r--r--src/mscorlib/src/System/Threading/Mutex.cs32
-rw-r--r--src/mscorlib/src/System/Threading/SynchronizationContext.cs5
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs1
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs171
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs203
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/Task.cs63
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs16
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs17
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs9
-rw-r--r--src/mscorlib/src/System/Threading/Thread.cs107
-rw-r--r--src/mscorlib/src/System/Threading/ThreadAbortException.cs5
-rw-r--r--src/mscorlib/src/System/Threading/Timer.cs87
-rw-r--r--src/mscorlib/src/System/Type.cs21
-rw-r--r--src/mscorlib/src/System/Variant.cs15
-rw-r--r--src/mscorlib/src/System/__ComObject.cs6
-rw-r--r--src/mscorlib/src/mscorlib.Friends.cs10
-rw-r--r--src/vm/ecalllist.h65
248 files changed, 1335 insertions, 25701 deletions
diff --git a/clr.defines.targets b/clr.defines.targets
index 689fa06a35..f09ff973b2 100644
--- a/clr.defines.targets
+++ b/clr.defines.targets
@@ -7,7 +7,6 @@
<CDefines Condition="'$(FeatureAppX)' == 'true'">$(CDefines);FEATURE_APPX</CDefines>
<CDefines Condition="'$(FeatureArrayStubAsIL)' == 'true'">$(CDefines);FEATURE_ARRAYSTUB_AS_IL</CDefines>
<CDefines Condition="'$(FeatureStubsAsIL)' == 'true'">$(CDefines);FEATURE_STUBS_AS_IL</CDefines>
- <CDefines Condition="'$(FeatureCasPolicy)' == 'true'">$(CDefines);FEATURE_CAS_POLICY</CDefines>
<CDefines Condition="'$(FeatureClassicCominterop)' == 'true'">$(CDefines);FEATURE_CLASSIC_COMINTEROP</CDefines>
<CDefines Condition="'$(FeatureClickonce)' == 'true'">$(CDefines);FEATURE_CLICKONCE</CDefines>
<CDefines Condition="'$(FeatureTraceLogging)' == 'true'">$(CDefines);FEATURE_TRACELOGGING</CDefines>
@@ -97,7 +96,6 @@
<DefineConstants Condition="'$(FeatureAppX)' == 'true'">$(DefineConstants);FEATURE_APPX</DefineConstants>
<DefineConstants Condition="'$(FeatureArrayStubAsIL)' == 'true'">$(DefineConstants);FEATURE_ARRAYSTUB_AS_IL</DefineConstants>
<DefineConstants Condition="'$(FeatureStubsAsIL)' == 'true'">$(DefineConstants);FEATURE_STUBS_AS_IL</DefineConstants>
- <DefineConstants Condition="'$(FeatureCasPolicy)' == 'true'">$(DefineConstants);FEATURE_CAS_POLICY</DefineConstants>
<DefineConstants Condition="'$(FeatureClassicCominterop)' == 'true'">$(DefineConstants);FEATURE_CLASSIC_COMINTEROP</DefineConstants>
<DefineConstants Condition="'$(FeatureClickonce)' == 'true'">$(DefineConstants);FEATURE_CLICKONCE</DefineConstants>
<DefineConstants Condition="'$(FeatureCominterop)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP</DefineConstants>
diff --git a/clr.props b/clr.props
index 21462c96f8..b1d3618609 100644
--- a/clr.props
+++ b/clr.props
@@ -126,7 +126,6 @@
<!-- If you add new features to this list make sure that they are not affecting codegen or content of datastructures persisted in NGen image -->
<EnCSupported>false</EnCSupported>
<PerfcountersSupportedBuild>false</PerfcountersSupportedBuild>
- <FeatureCasPolicy>false</FeatureCasPolicy>
<FeatureEventTrace>false</FeatureEventTrace>
<FeatureFusion>false</FeatureFusion>
<FeatureIncludeAllInterfaces>false</FeatureIncludeAllInterfaces>
@@ -242,7 +241,6 @@
<ResgenDefines Condition="'$(FeatureImpersonation)' == '1'">$(ResgenDefines) /define:FEATURE_IMPERSONATION</ResgenDefines>
<ResgenDefines Condition="'$(FeatureIsostore)' == '1'">$(ResgenDefines) /define:FEATURE_ISOSTORE</ResgenDefines>
<ResgenDefines Condition="'$(FeatureMacl)' == '1'">$(ResgenDefines) /define:FEATURE_MACL</ResgenDefines>
- <ResgenDefines Condition="'$(FeatureCasPolicy)' == '1'">$(ResgenDefines) /define:FEATURE_CAS_POLICY</ResgenDefines>
<ResgenDefines Condition="'$(FeatureRemoting)' == '1'">$(ResgenDefines) /define:FEATURE_REMOTING</ResgenDefines>
<ResgenDefines Condition="'$(FeatureIdentityReference)' == '1'">$(ResgenDefines) /define:FEATURE_IDENTITY_REFERENCE</ResgenDefines>
<ResgenDefines Condition="'$(FeatureDisplayCultureInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_CULTURE_INFO</ResgenDefines>
diff --git a/src/mscorlib/Common/PinnableBufferCache.cs b/src/mscorlib/Common/PinnableBufferCache.cs
index fc6e13a899..60c1642ab9 100644
--- a/src/mscorlib/Common/PinnableBufferCache.cs
+++ b/src/mscorlib/Common/PinnableBufferCache.cs
@@ -21,22 +21,6 @@ namespace System
{
internal sealed class PinnableBufferCache
{
- /// <summary>
- /// Create a new cache for pinned byte[] buffers
- /// </summary>
- /// <param name="cacheName">A name used in diagnostic messages</param>
- /// <param name="numberOfElements">The size of byte[] buffers in the cache (they are all the same size)</param>
- public PinnableBufferCache(string cacheName, int numberOfElements) : this(cacheName, () => new byte[numberOfElements]) { }
-
- /// <summary>
- /// Get a buffer from the buffer manager. If no buffers exist, allocate a new one.
- /// </summary>
- public byte[] AllocateBuffer() { return (byte[])Allocate(); }
-
- /// <summary>
- /// Return a buffer back to the buffer manager.
- /// </summary>
- public void FreeBuffer(byte[] buffer) { Free(buffer); }
/// <summary>
/// Create a PinnableBufferCache that works on any object (it is intended for OverlappedData)
@@ -537,9 +521,6 @@ namespace System
public bool IsEnabled() { return false; }
public void DebugMessage(string message) {}
- public void DebugMessage1(string message, long value) {}
- public void DebugMessage2(string message, long value1, long value2) {}
- public void DebugMessage3(string message, long value1, long value2, long value3) {}
public void Create(string cacheName) {}
public void AllocateBuffer(string cacheName, ulong objectId, int objectHash, int objectGen, int freeCountAfter) {}
public void AllocateBufferFromNotGen2(string cacheName, int notGen2CountAfter) {}
@@ -560,10 +541,5 @@ namespace System
{
return 0;
}
-
- static internal unsafe long AddressOfObject(byte[] array)
- {
- return 0;
- }
}
}
diff --git a/src/mscorlib/Common/Preprocessed/AssemblyRefs.g.cs b/src/mscorlib/Common/Preprocessed/AssemblyRefs.g.cs
index 24a1866a5d..d5866a4bcd 100644
--- a/src/mscorlib/Common/Preprocessed/AssemblyRefs.g.cs
+++ b/src/mscorlib/Common/Preprocessed/AssemblyRefs.g.cs
@@ -15,1068 +15,19 @@ using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-/**
- * Version strings for Frameworks.
- *
- */
-
-//
-// Insert just the #defines in winver.h, so that the
-// C# compiler can include this file after macro preprocessing.
-//
-
-
-
-
-
-
-
-
-
-// #line 21 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-//
-// winver.h is bad for rc.exe & csc.exe whereas verrsrc.h does not have an include guard
-// yet defines the same structure twice if RC_INVOKED is not #defined.
-// Temporarily enable RC_INVOKED protection around the #include.
-//
-
-
-
-
-
-
-// #line 1 "c:\\program files (x86)\\windows kits\\8.1\\include\\um\\verrsrc.h"
-// #line 1 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-/*
-
-
-
-Module Name:
-
- winapifamily.h
-
-Abstract:
-
- Master include file for API family partitioning.
-
-*/
-
-
-
-
-
-// #pragma once
-// #line 21 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-
-/*
- * When compiling C and C++ code using SDK header files, the development
- * environment can specify a target platform by #define-ing the
- * pre-processor symbol WINAPI_FAMILY to one of the following values.
- * Each FAMILY value denotes an application family for which a different
- * subset of the total set of header-file-defined APIs are available.
- * Setting the WINAPI_FAMILY value will effectively hide from the
- * editing and compilation environments the existence of APIs that
- * are not applicable to the family of applications targeting a
- * specific platform.
- */
-
-/*
- * The WINAPI_FAMILY values of 0 and 1 are reserved to ensure that
- * an error will occur if WINAPI_FAMILY is set to any
- * WINAPI_PARTITION value (which must be 0 or 1, see below).
- */
-
-
-
-/* The value of WINAPI_FAMILY_DESKTOP_APP may change in future SDKs. */
-/* Additional WINAPI_FAMILY values may be defined in future SDKs. */
-
-/*
- * For compatibility with Windows 8 header files, the following
- * synonym for WINAPI_FAMILY_PC_APP is temporarily #define'd.
- * Use of this symbol should be considered deprecated.
- */
-
-
-/*
- * If no WINAPI_FAMILY value is specified, then all APIs available to
- * Windows desktop applications are exposed.
- */
-
-
-// #line 59 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-
-/*
- * API PARTITONs are part of an indirection mechanism for mapping between
- * individual APIs and the FAMILYs to which they apply.
- * Each PARTITION is a category or subset of named APIs. PARTITIONs
- * are permitted to have overlapping membership -- some single API
- * might be part of more than one PARTITION. In support of new
- * FAMILYs that might be added in future SDKs, any single current
- * PARTITION might in that future SDK be split into two or more new PARTITIONs.
- * Accordingly, application developers should avoid taking dependencies on
- * PARTITION names; developers' only dependency upon the symbols defined
- * in this file should be their reliance on the WINAPI_FAMILY names and values.
- */
-
-/*
- * Current PARTITIONS are each #undef'ed below, and then will be #define-ed
- * to be either 1 or 0 or depending on the active WINAPI_FAMILY.
- */
-
-
-
-
-
-
-
-/*
- * The mapping between families and partitions is summarized here.
- * An X indicates that the given partition is active for the given
- * platform/family.
- *
- * +---------------+
- * | *Partition* |
- * +---+---+---+---+
- * | | | | P |
- * | | | | H |
- * | D | | | O |
- * | E | | P | N |
- * | S | | C | E |
- * | K | | _ | _ |
- * | T | A | A | A |
- * +-------------------------+-+ O | P | P | P |
- * | *Platform/Family* \| P | P | P | P |
- * +---------------------------+---+---+---+---+
- * | WINAPI_FAMILY_DESKTOP_APP | X | X | X | |
- * +---------------------------+---+---+---+---+
- * | WINAPI_FAMILY_PC_APP | | X | X | |
- * +---------------------------+---+---+---+---+
- * | WINAPI_FAMILY_PHONE_APP | | X | | X |
- * +---------------------------+---+---+---+---+
- *
- * The table above is encoded in the following expressions,
- * each of which evaluates to 1 or 0.
- *
- * Whenever a new family is added, all of these expressions
- * need to be reconsidered.
- */
-
-
-// #line 118 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-
-
-
-
-
-/*
- * For compatibility with Windows Phone 8 header files, the following
- * synonym for WINAPI_PARTITION_PHONE_APP is temporarily #define'd.
- * Use of this symbol should be regarded as deprecated.
- */
-
-
-/*
- * Header files use the WINAPI_FAMILY_PARTITION macro to assign one or
- * more declarations to some group of partitions. The macro chooses
- * whether the preprocessor will emit or omit a sequence of declarations
- * bracketed by an #if/#endif pair. All header file references to the
- * WINAPI_PARTITION_* values should be in the form of occurrences of
- * WINAPI_FAMILY_PARTITION(...).
- *
- * For example, the following usage of WINAPI_FAMILY_PARTITION identifies
- * a sequence of declarations that are part of both the Windows Desktop
- * Partition and the Windows-Phone-Specific Store Partition:
- *
- * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
- * ...
- * #endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
- *
- * The comment on the closing #endif allow tools as well as people to find the
- * matching #ifdef properly.
- *
- * Usages of WINAPI_FAMILY_PARTITION may be combined, when the partitition definitions are
- * related. In particular one might use declarations like
- *
- * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
- *
- * or
- *
- * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
- *
- * Direct references to WINAPI_PARTITION_ values (eg #if !WINAPI_FAMILY_PARTITION_...)
- * should not be used.
- */
-
-
-/*
- * Macro used to #define or typedef a symbol used for selective deprecation
- * of individual methods of a COM interfaces that are otherwise available
- * for a given set of partitions.
- */
-
-
-/*
- * For compatibility with Windows 8 header files, the following
- * symbol is temporarily conditionally #define'd. Additional symbols
- * like this should be not defined in winapifamily.h, but rather should be
- * introduced locally to the header files of the component that needs them.
- */
-
-
-// #line 179 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-
-// #line 181 "c:\\program files (x86)\\windows kits\\8.1\\include\\shared\\winapifamily.h"
-// #line 2 "c:\\program files (x86)\\windows kits\\8.1\\include\\um\\verrsrc.h"
-
-/****************************************************************************
-** *
-* verrsrc.h - Version Resource definitions *
-* *
-* Include file declaring version resources in rc files *
-* *
-* *
-* *
-\*****************************************************************************/
-
-// #pragma region Application Family
-
-
-/* ----- Symbols ----- */
-
-
-
-
-/* ----- VS_VERSION.dwFileFlags ----- */
-
-
-
-
-// #line 27 "c:\\program files (x86)\\windows kits\\8.1\\include\\um\\verrsrc.h"
-
-
-
-/* ----- VS_VERSION.dwFileFlags ----- */
-
-
-
-
-
-
-
-/* ----- VS_VERSION.dwFileOS ----- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/* ----- VS_VERSION.dwFileType ----- */
-
-
-
-
-
-
-
-
-/* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_DRV ----- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT ----- */
-
-
-
-
-// #line 88 "c:\\program files (x86)\\windows kits\\8.1\\include\\um\\verrsrc.h"
-// // #pragma region
-
-// #pragma region Desktop Family
-
-
-/* ----- VerFindFile() flags ----- */
-
-
-
-
-
-
-/* ----- VerInstallFile() flags ----- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 171 "c:\\program files (x86)\\windows kits\\8.1\\include\\um\\verrsrc.h"
-// #pragma region
-
-// #line 37 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-//
-// Include the definitions for rmj, rmm, rup, rpt
-//
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-
-// #line 6 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\version.h"
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\ndpversion_generated.h"
-
-
-
-
-// #line 6 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\ndpversion_generated.h"
-
-
-
-
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\buildnumber.h"
-
-
-
-
-// #line 6 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\buildnumber.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 12 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\ndpversion_generated.h"
-// #line 2 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\version.h"
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 8 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\asm_version.h"
-
-
-
-
-
-
-
-
-
-
-
-// #line 13 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\asm_version.h"
-
-
-
-
-
-// #line 19 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\asm_version.h"
-
-// #line 12 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-// #line 13 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 161 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-
-
-// #line 167 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-
-
-// #line 173 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-
-
-
-
-
-// #line 180 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\product_version.h"
-
-// #line 48 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-/*
- * Product version, name and copyright
- */
-
-// #line 1 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-
-
-
-// #line 6 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-
-
-// #line 10 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-
-
-
-// #line 15 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-// #line 16 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-// The following copyright is intended for display in the Windows Explorer property box for a DLL or EXE
-// See \\lca\pdm\TMGUIDE\Copyright\Crt_Tmk_Notices.xls for copyright guidelines
-//
-
-
-
-
-// #line 25 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-
-
-// #line 29 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-
-
-
-
-
-
-// #line 37 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-// #line 38 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-
-// VSWhidbey #495749
-// Note: The following legal copyright is intended for situations where the copyright symbol doesn't display
-// properly. For example, the following copyright should be displayed as part of the logo for DOS command-line
-// applications. If you change the format or wording of the following copyright, you should apply the same
-// change to fxresstrings.txt (for managed applications).
-
-
-
-// #line 48 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxverstrings.h"
-// #line 54 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-/*
- * File version, names, description.
- */
-
-// FX_VER_INTERNALNAME_STR is passed in by the build environment.
-
-
-
-
-
-
-
-// FX_VER_FILEDESCRIPTION_STR is defined in RC files that include fxver.h
-
-
-
-// #line 72 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-// #line 78 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-// #line 85 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-//URT_VFT passed in by the build environment.
-
-
-
-
-
-
-
-/* default is nodebug */
-
-
-
-
-// #line 102 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// DEBUG flag is set for debug build, not set for retail build
-// #if defined(DEBUG) || defined(_DEBUG)
-// #define VER_DEBUG VS_FF_DEBUG
-// #else // DEBUG
-// #define VER_DEBUG 0
-// #endif // DEBUG
-
-
-/* default is prerelease */
-
-
-// #line 115 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// #line 117 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// PRERELEASE flag is always set unless building SHIP version
-// #ifndef _SHIP
-// #define VER_PRERELEASE VS_FF_PRERELEASE
-// #else
-// #define VER_PRERELEASE 0
-// #endif // _SHIP
-
-
-
-// #line 128 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// #line 130 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// PRIVATEBUILD flag is set if not built by build lab
-// #ifndef _VSBUILD
-// #define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD
-// #else // _VSBUILD
-// #define VER_PRIVATEBUILD 0
-// #endif // _VSBUILD
-
-
-
-// #line 141 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// #line 143 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 164 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-
-
-
-// #line 174 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-// #line 180 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-
-
-// #line 189 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-// #line 193 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 248 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// #line 250 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-
-
-// #line 254 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-
-// #line 256 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\include\\fxver.h"
-// #line 24 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\assemblyrefs.cspp"
-
internal static class FXAssembly {
internal const string Version = "4.0.0.0";
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// #line 44 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\assemblyrefs.cspp"
-
internal static class ThisAssembly {
- internal const string Title = "System.Private.CoreLib.dll";
- internal const string Description = "System.Private.CoreLib.dll";
- internal const string DefaultAlias = "System.Private.CoreLib.dll";
- internal const string Copyright = "\u00A9 Microsoft Corporation. All rights reserved.";
internal const string Version = "4.0.0.0";
- internal const string InformationalVersion = "4.0.22306.0";
- internal const string DailyBuildNumberStr = "22306";
- internal const string BuildRevisionStr = "0";
internal const int DailyBuildNumber = 22306;
}
-
-#pragma warning disable 436
internal static class AssemblyRef {
internal const string EcmaPublicKey = "b77a5c561934e089";
internal const string EcmaPublicKeyToken = "b77a5c561934e089";
- internal const string EcmaPublicKeyFull = "00000000000000000400000000000000";
-
- internal const string SilverlightPublicKey = "31bf3856ad364e35";
- internal const string SilverlightPublicKeyToken = "31bf3856ad364e35";
- internal const string SilverlightPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
-
- internal const string SilverlightPlatformPublicKey = "7cec85d7bea7798e";
- internal const string SilverlightPlatformPublicKeyToken = "7cec85d7bea7798e";
- internal const string SilverlightPlatformPublicKeyFull = "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
-
-
- internal const string PlatformPublicKey = SilverlightPlatformPublicKey;
- internal const string PlatformPublicKeyToken = SilverlightPlatformPublicKeyToken;
- internal const string PlatformPublicKeyFull = SilverlightPlatformPublicKeyFull;
-
-
-
-
-// #line 81 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\assemblyrefs.cspp"
-
- internal const string Mscorlib = "mscorlib, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + PlatformPublicKey;
- internal const string SystemData = "System.Data, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemDataOracleClient = "System.Data.OracleClient, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string System = "System, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + PlatformPublicKey;
- internal const string SystemCore = "System.Core, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + PlatformPublicKey;
- internal const string SystemNumerics = "System.Numerics, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + PlatformPublicKey;
- internal const string SystemRuntimeRemoting = "System.Runtime.Remoting, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemThreadingTasksDataflow = "System.Threading.Tasks.Dataflow, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + PlatformPublicKey;
- internal const string SystemWindowsForms = "System.Windows.Forms, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemXml = "System.Xml, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
-
- internal const string MicrosoftPublicKey = "b03f5f7f11d50a3a";
internal const string MicrosoftPublicKeyToken = "b03f5f7f11d50a3a";
- internal const string MicrosoftPublicKeyFull = "002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293";
-
- internal const string SharedLibPublicKey = "31bf3856ad364e35";
- internal const string SharedLibPublicKeyToken = "31bf3856ad364e35";
- internal const string SharedLibPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
-
- internal const string SystemComponentModelDataAnnotations = "System.ComponentModel.DataAnnotations, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemConfiguration = "System.Configuration, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemConfigurationInstall = "System.Configuration.Install, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemDeployment = "System.Deployment, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemDesign = "System.Design, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemDirectoryServices = "System.DirectoryServices, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemDrawingDesign = "System.Drawing.Design, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemDrawing = "System.Drawing, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemEnterpriseServices = "System.EnterpriseServices, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemManagement = "System.Management, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemMessaging = "System.Messaging, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemNetHttp = "System.Net.Http, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemNetHttpWebRequest = "System.Net.Http.WebRequest, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemRuntimeSerializationFormattersSoap = "System.Runtime.Serialization.Formatters.Soap, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
internal const string SystemRuntimeWindowsRuntime = "System.Runtime.WindowsRuntime, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemRuntimeWindowsRuntimeUIXaml = "System.Runtime.WindowsRuntimeUIXaml, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemSecurity = "System.Security, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemServiceModelWeb = "System.ServiceModel.Web, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemServiceProcess = "System.ServiceProcess, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemWeb = "System.Web, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemWebAbstractions = "System.Web.Abstractions, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebDynamicData = "System.Web.DynamicData, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebDynamicDataDesign = "System.Web.DynamicData.Design, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebEntityDesign = "System.Web.Entity.Design, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + EcmaPublicKey;
- internal const string SystemWebExtensions = "System.Web.Extensions, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebExtensionsDesign = "System.Web.Extensions.Design, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebMobile = "System.Web.Mobile, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemWebRegularExpressions = "System.Web.RegularExpressions, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string SystemWebRouting = "System.Web.Routing, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
- internal const string SystemWebServices = "System.Web.Services, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
-
- internal const string WindowsBase = "WindowsBase, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + SharedLibPublicKey;
-
- internal const string MicrosoftVisualStudio = "Microsoft.VisualStudio, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string MicrosoftVisualStudioWindowsForms = "Microsoft.VisualStudio.Windows.Forms, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string VJSharpCodeProvider = "VJSharpCodeProvider, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
-
- internal const string ASPBrowserCapsPublicKey = "b7bd7678b977bd8f";
- internal const string ASPBrowserCapsFactory = "ASP.BrowserCapsFactory, Version=" + FXAssembly.Version + ", Culture=neutral, PublicKeyToken=" + ASPBrowserCapsPublicKey;
-
-
- // We do not want these sitting in non-VS specific files. If you need them,
- // add this line to sources:
- // C_DEFINES=$(C_DEFINES) /DINCLUDE_VSREFS
- //
- // M.VS.dll and M.VSDesigner.dll should also be included here, but it
- // turns out that everyone, from Data, to XSP to Winforms to diagnostics
- // has thrown some designer-specific code into M.VS.dll or M.VSDesigner.dll.
- //
-
-
-
-
-
-
-// #line 157 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\assemblyrefs.cspp"
- // VS Provided Assemblies... we can't strong bind to these, they
- // update their assembly versions too often
- //
- internal const string MicrosoftVSDesigner = "Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string MicrosoftVisualStudioWeb = "Microsoft.VisualStudio.Web, Version=10.0.0.0, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string MicrosoftWebDesign = "Microsoft.Web.Design.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string MicrosoftVSDesignerMobile = "Microsoft.VSDesigner.Mobile, Version=8.0.0.0, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- internal const string MicrosoftJScript = "Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
-
- //internal const string MicrosoftVSDesigner = "Microsoft.VSDesigner, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
- //internal const string MicrosoftJScript = "Microsoft.JScript, Culture=neutral, PublicKeyToken=" + MicrosoftPublicKey;
}
-#pragma warning restore 436
-// #line 172 "d:\\projectk_2\\src\\ndp\\clr\\src\\bcl.oss\\open\\src\\common\\assemblyrefs.cspp"
diff --git a/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs b/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs
index a11a23ce8c..1b6d26e40f 100644
--- a/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs
+++ b/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs
@@ -7,12 +7,6 @@ internal static partial class Interop
private static partial class Libraries
{
internal const string GlobalizationInterop = "System.Globalization.Native"; // CoreFX wrappers for ICU
- // Shims
internal const string SystemNative = "System.Native";
- internal const string HttpNative = "System.Net.Http.Native";
- internal const string NetSecurityNative = "System.Net.Security.Native";
- internal const string CryptoNative = "System.Security.Cryptography.Native.OpenSsl";
- internal const string GlobalizationNative = "System.Globalization.Native";
- internal const string CompressionNative = "System.IO.Compression.Native";
}
}
diff --git a/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs b/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs
index 1165a2da95..f19f9dcf52 100644
--- a/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs
+++ b/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs
@@ -6,77 +6,10 @@ internal static partial class Interop
{
internal static class Libraries
{
- internal const string Advapi32 = "advapi32.dll";
internal const string BCrypt = "BCrypt.dll";
- internal const string Combase = "combase.dll";
- internal const string Console_L1 = "api-ms-win-core-console-l1-1-0.dll";
- internal const string Console_L2 = "api-ms-win-core-console-l2-1-0.dll";
- internal const string CoreFile_L1 = "api-ms-win-core-file-l1-1-0.dll";
- internal const string CoreFile_L1_2 = "api-ms-win-core-file-l1-2-0.dll";
- internal const string CoreFile_L2 = "api-ms-win-core-file-l2-1-0.dll";
internal const string Crypt32 = "crypt32.dll";
- internal const string Debug = "api-ms-win-core-debug-l1-1-0.dll";
- internal const string Error_L1 = "api-ms-win-core-winrt-error-l1-1-0.dll";
- internal const string ErrorHandling = "api-ms-win-core-errorhandling-l1-1-0.dll";
- internal const string Eventing = "api-ms-win-eventing-provider-l1-1-0.dll";
- internal const string Handle = "api-ms-win-core-handle-l1-1-0.dll";
- internal const string Heap = "api-ms-win-core-heap-obsolete-l1-1-0.dll";
- internal const string Heap_L1 = "api-ms-win-core-heap-l1-1-0.dll";
- internal const string IO = "api-ms-win-core-io-l1-1-0.dll";
- internal const string IpHlpApi = "iphlpapi.dll";
internal const string Kernel32 = "kernel32.dll";
- internal const string Kernel32_L1 = "api-ms-win-core-kernel32-legacy-l1-1-1.dll";
- internal const string Kernel32_L2 = "api-ms-win-core-kernel32-legacy-l1-1-0.dll";
- internal const string Keyboard = "ext-ms-win-ntuser-keyboard-l1-2-1.dll";
- internal const string LibraryLoader = "api-ms-win-core-libraryloader-l1-1-0.dll";
- internal const string Localization = "api-ms-win-core-localization-l1-2-0.dll";
- internal const string Memory_L1_0 = "api-ms-win-core-memory-l1-1-0.dll";
- internal const string Memory_L1_1 = "api-ms-win-core-memory-l1-1-1.dll";
- internal const string Memory_L1_2 = "api-ms-win-core-memory-l1-1-2.dll";
- internal const string Memory_L1_3 = "api-ms-win-core-memory-l1-1-3.dll";
- internal const string NCrypt = "ncrypt.dll";
internal const string NtDll = "ntdll.dll";
internal const string OleAut32 = "oleaut32.dll";
- internal const string Pipe = "api-ms-win-core-namedpipe-l1-1-0.dll";
- internal const string Pipe_L2 = "api-ms-win-core-namedpipe-l1-2-1.dll";
- internal const string ProcessEnvironment = "api-ms-win-core-processenvironment-l1-1-0.dll";
- internal const string ProcessThread_L1 = "api-ms-win-core-processthreads-l1-1-0.dll";
- internal const string ProcessThread_L1_1 = "api-ms-win-core-processthreads-l1-1-1.dll";
- internal const string ProcessThread_L1_2 = "api-ms-win-core-processthreads-l1-1-2.dll";
- internal const string ProcessTopology = "api-ms-win-core-processtopology-obsolete-l1-1-0.dll";
- internal const string Profile = "api-ms-win-core-profile-l1-1-0.dll";
- internal const string Psapi = "api-ms-win-core-psapi-l1-1-0.dll";
- internal const string Psapi_Obsolete = "api-ms-win-core-psapi-obsolete-l1-1-0.dll";
- internal const string Registry_L1 = "api-ms-win-core-registry-l1-1-0.dll";
- internal const string Registry_L2 = "api-ms-win-core-registry-l2-1-0.dll";
- internal const string RoBuffer = "api-ms-win-core-winrt-robuffer-l1-1-0.dll";
- internal const string SecurityBase = "api-ms-win-security-base-l1-1-0.dll";
- internal const string SecurityCpwl = "api-ms-win-security-cpwl-l1-1-0.dll";
- internal const string SecurityCryptoApi = "api-ms-win-security-cryptoapi-l1-1-0.dll";
- internal const string SecurityLsa = "api-ms-win-security-lsalookup-l2-1-0.dll";
- internal const string SecurityLsaPolicy = "api-ms-win-security-lsapolicy-l1-1-0.dll";
- internal const string SecurityProvider = "api-ms-win-security-provider-l1-1-0.dll";
- internal const string SecuritySddl = "api-ms-win-security-sddl-l1-1-0.dll";
- internal const string ServiceCore = "api-ms-win-service-core-l1-1-1.dll";
- internal const string ServiceMgmt_L1 = "api-ms-win-service-management-l1-1-0.dll";
- internal const string ServiceMgmt_L2 = "api-ms-win-service-management-l2-1-0.dll";
- internal const string ServiceWinSvc = "api-ms-win-service-winsvc-l1-1-0.dll";
- internal const string Shell = "shell32.dll";
- internal const string ShellFolders = "ext-ms-win-shell32-shellfolders-l1-1-0.dll";
- internal const string Sspi = "sspicli.dll";
- internal const string String_L1 = "api-ms-win-core-string-l1-1-0.dll";
- internal const string Synch = "api-ms-win-core-synch-l1-1-0.dll";
- internal const string SystemInfo_L1_1 = "api-ms-win-core-sysinfo-l1-1-0.dll";
- internal const string SystemInfo_L1_2 = "api-ms-win-core-sysinfo-l1-2-0.dll";
- internal const string SystemInfo_L2_1 = "api-ms-win-core-sysinfo-l2-1-0.dll";
- internal const string ThreadPool = "api-ms-win-core-threadpool-l1-2-0.dll";
- internal const string User32 = "user32.dll";
- internal const string Util = "api-ms-win-core-util-l1-1-0.dll";
- internal const string Version = "api-ms-win-core-version-l1-1-0.dll";
- internal const string WinHttp = "winhttp.dll";
- internal const string Winsock = "Ws2_32.dll";
- internal const string Wow64 = "api-ms-win-core-wow64-l1-1-0.dll";
- internal const string Ws2_32 = "ws2_32.dll";
- internal const string Zlib = "clrcompression.dll";
}
}
diff --git a/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs b/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs
index caa0329bd0..bd2a64cf14 100644
--- a/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs
+++ b/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs
@@ -10,8 +10,6 @@ internal partial class Interop
{
internal partial class NtDll
{
- [DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, EntryPoint = "RtlZeroMemory")]
- internal static extern void ZeroMemory(SafeBSTRHandle address, uint length);
[DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, EntryPoint = "RtlZeroMemory")]
internal static extern void ZeroMemory(IntPtr address, UIntPtr length);
diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs
index a24a0ba069..6e3ebb9ae9 100644
--- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs
+++ b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs
@@ -6,29 +6,6 @@ internal partial class Interop
{
internal partial class Kernel32
{
- internal partial class IOReparseOptions
- {
- internal const uint IO_REPARSE_TAG_FILE_PLACEHOLDER = 0x80000015;
- internal const uint IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003;
- }
-
- internal partial class FileOperations
- {
- internal const int OPEN_EXISTING = 3;
- internal const int COPY_FILE_FAIL_IF_EXISTS = 0x00000001;
-
- internal const int FILE_ACTION_ADDED = 1;
- internal const int FILE_ACTION_REMOVED = 2;
- internal const int FILE_ACTION_MODIFIED = 3;
- internal const int FILE_ACTION_RENAMED_OLD_NAME = 4;
- internal const int FILE_ACTION_RENAMED_NEW_NAME = 5;
-
- internal const int FILE_FLAG_BACKUP_SEMANTICS = 0x02000000;
- internal const int FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000;
- internal const int FILE_FLAG_OVERLAPPED = 0x40000000;
-
- internal const int FILE_LIST_DIRECTORY = 0x0001;
- }
internal const uint SEM_FAILCRITICALERRORS = 1;
}
diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs
index e7e0ef0d9b..e31a453ba9 100644
--- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs
+++ b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs
@@ -10,39 +10,6 @@ internal partial class Interop
{
internal partial class Kernel32
{
- [DllImport(Libraries.Kernel32, SetLastError = true)]
- internal static extern bool SetFileInformationByHandle(SafeFileHandle hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ref FILE_BASIC_INFO lpFileInformation, uint dwBufferSize);
-
- // Default values indicate "no change". Use defaults so that we don't force callsites to be aware of the default values
- internal static unsafe bool SetFileTime(
- SafeFileHandle hFile,
- long creationTime = -1,
- long lastAccessTime = -1,
- long lastWriteTime = -1,
- long changeTime = -1,
- uint fileAttributes = 0)
- {
- FILE_BASIC_INFO basicInfo = new FILE_BASIC_INFO()
- {
- CreationTime = creationTime,
- LastAccessTime = lastAccessTime,
- LastWriteTime = lastWriteTime,
- ChangeTime = changeTime,
- FileAttributes = fileAttributes
- };
-
- return SetFileInformationByHandle(hFile, FILE_INFO_BY_HANDLE_CLASS.FileBasicInfo, ref basicInfo, (uint)Marshal.SizeOf<FILE_BASIC_INFO>());
- }
-
- internal struct FILE_BASIC_INFO
- {
- internal long CreationTime;
- internal long LastAccessTime;
- internal long LastWriteTime;
- internal long ChangeTime;
- internal uint FileAttributes;
- }
-
internal enum FILE_INFO_BY_HANDLE_CLASS : uint
{
FileBasicInfo = 0x0u,
diff --git a/src/mscorlib/corefx/SR.cs b/src/mscorlib/corefx/SR.cs
index 686de82fde..012bb86a66 100644
--- a/src/mscorlib/corefx/SR.cs
+++ b/src/mscorlib/corefx/SR.cs
@@ -175,7 +175,7 @@ internal static class SR
{
get { return Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber"); }
}
-
+
public static string Argument_EmptyDecString
{
get { return Environment.GetResourceString("Argument_EmptyDecString"); }
@@ -525,23 +525,23 @@ internal static class SR
{
get { return Environment.GetResourceString("InvalidOperation_NativeOverlappedReused"); }
}
-
+
public static string ArgumentOutOfRange_Length
{
get { return Environment.GetResourceString("ArgumentOutOfRange_Length"); }
}
- public static string ArgumentOutOfRange_IndexString
+ public static string ArgumentOutOfRange_IndexString
{
get { return Environment.GetResourceString("ArgumentOutOfRange_IndexString"); }
}
- public static string ArgumentOutOfRange_Capacity
+ public static string ArgumentOutOfRange_Capacity
{
get { return Environment.GetResourceString("ArgumentOutOfRange_Capacity"); }
}
- public static string Arg_CryptographyException
+ public static string Arg_CryptographyException
{
get { return Environment.GetResourceString("Arg_CryptographyException"); }
}
diff --git a/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs b/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs
index adc4da7e3f..08dc1d0251 100644
--- a/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs
+++ b/src/mscorlib/corefx/System/IO/PathInternal.Unix.cs
@@ -43,22 +43,6 @@ namespace System.IO
}
/// <summary>
- /// Returns true if the path is too long
- /// </summary>
- internal static bool IsPathTooLong(string fullPath)
- {
- return fullPath.Length >= Interop.Sys.MaxPath;
- }
-
- /// <summary>
- /// Returns true if the directory is too long
- /// </summary>
- internal static bool IsDirectoryTooLong(string fullPath)
- {
- return fullPath.Length >= Interop.Sys.MaxPath;
- }
-
- /// <summary>
/// Normalize separators in the given path. Compresses forward slash runs.
/// </summary>
internal static string NormalizeDirectorySeparators(string path)
@@ -110,12 +94,6 @@ namespace System.IO
return ch == DirectorySeparatorChar;
}
- internal static bool HasInvalidVolumeSeparator(string path)
- {
- // This is only ever true for Windows
- return false;
- }
-
internal static bool IsPartiallyQualified(string path)
{
// This is much simpler than Windows where paths can be rooted, but not fully qualified (such as Drive Relative)
diff --git a/src/mscorlib/corefx/System/IO/PathInternal.Windows.cs b/src/mscorlib/corefx/System/IO/PathInternal.Windows.cs
index 560b9d1b57..0ec9b30f99 100644
--- a/src/mscorlib/corefx/System/IO/PathInternal.Windows.cs
+++ b/src/mscorlib/corefx/System/IO/PathInternal.Windows.cs
@@ -74,24 +74,6 @@ namespace System.IO
}
/// <summary>
- /// Returns true if the path is too long
- /// </summary>
- internal static bool IsPathTooLong(string fullPath)
- {
- // We'll never know precisely what will fail as paths get changed internally in Windows and
- // may grow to exceed MaxLongPath.
- return fullPath.Length >= MaxLongPath;
- }
-
- /// <summary>
- /// Returns true if the directory is too long
- /// </summary>
- internal static bool IsDirectoryTooLong(string fullPath)
- {
- return IsPathTooLong(fullPath);
- }
-
- /// <summary>
/// Adds the extended path prefix (\\?\) if not already a device path, IF the path is not relative,
/// AND the path is more than 259 characters. (> MAX_PATH + null)
/// </summary>
@@ -456,31 +438,5 @@ namespace System.IO
{
return IsDirectorySeparator(ch) || VolumeSeparatorChar == ch;
}
-
- /// <summary>
- /// Validates volume separator only occurs as C: or \\?\C:. This logic is meant to filter out Alternate Data Streams.
- /// </summary>
- /// <returns>True if the path has an invalid volume separator.</returns>
- internal static bool HasInvalidVolumeSeparator(string path)
- {
- // Toss out paths with colons that aren't a valid drive specifier.
- // Cannot start with a colon and can only be of the form "C:" or "\\?\C:".
- // (Note that we used to explicitly check "http:" and "file:"- these are caught by this check now.)
-
- // We don't care about skipping starting space for extended paths. Assume no knowledge of extended paths if we're forcing old path behavior.
- int startIndex = IsExtended(path) ? ExtendedPathPrefix.Length : PathStartSkip(path);
-
- // If we start with a colon
- if ((path.Length > startIndex && path[startIndex] == VolumeSeparatorChar)
- // Or have an invalid drive letter and colon
- || (path.Length >= startIndex + 2 && path[startIndex + 1] == VolumeSeparatorChar && !IsValidDriveChar(path[startIndex]))
- // Or have any colons beyond the drive colon
- || (path.Length > startIndex + 2 && path.IndexOf(VolumeSeparatorChar, startIndex + 2) != -1))
- {
- return true;
- }
-
- return false;
- }
}
}
diff --git a/src/mscorlib/corefx/System/IO/PathInternal.cs b/src/mscorlib/corefx/System/IO/PathInternal.cs
index ee67680df5..6b4c3b2d30 100644
--- a/src/mscorlib/corefx/System/IO/PathInternal.cs
+++ b/src/mscorlib/corefx/System/IO/PathInternal.cs
@@ -40,64 +40,6 @@ namespace System.IO
if (HasIllegalCharacters(path))
throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path));
}
-
-
- /// <summary>
- /// Returns true if the given StringBuilder starts with the given value.
- /// </summary>
- /// <param name="value">The string to compare against the start of the StringBuilder.</param>
- internal static bool StartsWithOrdinal(this StringBuilder builder, string value)
- {
- if (value == null || builder.Length < value.Length)
- return false;
-
- for (int i = 0; i < value.Length; i++)
- {
- if (builder[i] != value[i]) return false;
- }
- return true;
- }
-
- /// <summary>
- /// Returns true if the given string starts with the given value.
- /// </summary>
- /// <param name="value">The string to compare against the start of the source string.</param>
- internal static bool StartsWithOrdinal(this string source, string value)
- {
- if (value == null || source.Length < value.Length)
- return false;
-
- return source.StartsWith(value, StringComparison.Ordinal);
- }
-
- /// <summary>
- /// Trims the specified characters from the end of the StringBuilder.
- /// </summary>
- internal static StringBuilder TrimEnd(this StringBuilder builder, params char[] trimChars)
- {
- if (trimChars == null || trimChars.Length == 0)
- return builder;
-
- int end = builder.Length - 1;
-
- for (; end >= 0; end--)
- {
- int i = 0;
- char ch = builder[end];
- for (; i < trimChars.Length; i++)
- {
- if (trimChars[i] == ch) break;
- }
- if (i == trimChars.Length)
- {
- // Not a trim char
- break;
- }
- }
-
- builder.Length = end + 1;
- return builder;
- }
/// <summary>
/// Returns the start index of the filename
diff --git a/src/mscorlib/corefx/System/IO/Win32Marshal.cs b/src/mscorlib/corefx/System/IO/Win32Marshal.cs
index 8bdab0b049..ef76c27010 100644
--- a/src/mscorlib/corefx/System/IO/Win32Marshal.cs
+++ b/src/mscorlib/corefx/System/IO/Win32Marshal.cs
@@ -23,16 +23,6 @@ namespace System.IO
}
/// <summary>
- /// Converts, resetting it, the last Win32 error into a corresponding <see cref="Exception"/> object, optionally
- /// including the specified path in the error message.
- /// </summary>
- internal static Exception GetExceptionForLastWin32Error(string path)
- {
- int errorCode = Marshal.GetLastWin32Error();
- return GetExceptionForWin32Error(errorCode, path);
- }
-
- /// <summary>
/// Converts the specified Win32 error into a corresponding <see cref="Exception"/> object.
/// </summary>
internal static Exception GetExceptionForWin32Error(int errorCode)
@@ -109,21 +99,6 @@ namespace System.IO
}
/// <summary>
- /// Returns a Win32 error code for the specified HRESULT if it came from FACILITY_WIN32
- /// If not, returns the HRESULT unchanged
- /// </summary>
- internal static int TryMakeWin32ErrorCodeFromHR(int hr)
- {
- if ((0xFFFF0000 & hr) == 0x80070000)
- {
- // Win32 error, Win32Marshal.GetExceptionForWin32Error expects the Win32 format
- hr &= 0x0000FFFF;
- }
-
- return hr;
- }
-
- /// <summary>
/// Returns a string message for the specified Win32 error code.
/// </summary>
internal static string GetMessage(int errorCode)
diff --git a/src/mscorlib/corefx/System/Runtime/InteropServices/StringBuffer.cs b/src/mscorlib/corefx/System/Runtime/InteropServices/StringBuffer.cs
index 8779a63fdd..fdd0b95590 100644
--- a/src/mscorlib/corefx/System/Runtime/InteropServices/StringBuffer.cs
+++ b/src/mscorlib/corefx/System/Runtime/InteropServices/StringBuffer.cs
@@ -164,26 +164,6 @@ namespace System.Runtime.InteropServices
}
/// <summary>
- /// Append the given string.
- /// </summary>
- /// <param name="value">The string to append.</param>
- /// <param name="startIndex">The index in the input string to start appending from.</param>
- /// <param name="count">The count of characters to copy from the input string, or -1 for all remaining.</param>
- /// <exception cref="ArgumentNullException">Thrown if <paramref name="value"/> is null.</exception>
- /// <exception cref="ArgumentOutOfRangeException">
- /// Thrown if <paramref name="startIndex"/> or <paramref name="count"/> are outside the range
- /// of <paramref name="value"/> characters.
- /// </exception>
- public void Append(string value, int startIndex = 0, int count = -1)
- {
- CopyFrom(
- bufferIndex: _length,
- source: value,
- sourceIndex: startIndex,
- count: count);
- }
-
- /// <summary>
/// Append the given buffer.
/// </summary>
/// <param name="value">The buffer to append.</param>
diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml
index 2864561d1d..102e5e5376 100644
--- a/src/mscorlib/model.xml
+++ b/src/mscorlib/model.xml
@@ -8160,7 +8160,7 @@
<Member Name="Dispose" />
</Type>
<Type Name="System.Threading.ThreadPoolBoundHandle">
- <Member Name="get_Handle" />
+ <Member Name="get_Handle" />
<Member Name="AllocateNativeOverlapped(System.Threading.IOCompletionCallback,System.Object,System.Object)" />
<Member Name="AllocateNativeOverlapped(System.Threading.PreAllocatedOverlapped)" />
<Member Name="BindHandle(System.Runtime.InteropServices.SafeHandle)" />
diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props
index 5c51e47d93..7e15d798de 100644
--- a/src/mscorlib/mscorlib.shared.sources.props
+++ b/src/mscorlib/mscorlib.shared.sources.props
@@ -1,1245 +1,1181 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AccessedThroughPropertyAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AssemblyAttributesGoHere.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeHelpers.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerGeneratedAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CustomConstantAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DateTimeConstantAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DiscardableAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DecimalConstantAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DisablePrivateReflectionAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilationRelaxations.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerGlobalScopeAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ExtensionAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FormattableStringFactory.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FixedBufferAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IndexerNameAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\InternalsVisibleToAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsVolatile.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\MethodImplAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FixedAddressValueTypeAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\UnsafeValueTypeAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AssemblySettingAttributes.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerMarshalOverride.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\jithelpers.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\Unsafe.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SpecialNameAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SuppressMergeCheckAttribute.cs" />
- <CompilerServicesSources Condition="'$(FeatureICastable)' == 'true'" Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ICastable.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SuppressIldasmAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DecoratedNameAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeForwardedToAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeForwardedFromAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ReferenceAssemblyAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeCompatibilityAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeWrappedException.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ConditionalWeakTable.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerFilePathAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerLineNumberAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerMemberNameAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\StateMachineAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IteratorStateMachineAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncStateMachineAttribute.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncMethodBuilder.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IAsyncStateMachine.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\INotifyCompletion.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TaskAwaiter.cs" />
- <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\YieldAwaitable.cs" />
- </ItemGroup>
- <ItemGroup>
- <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\CriticalFinalizerObject.cs" />
- <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\ReliabilityContractAttribute.cs" />
- <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\PrePrepareMethodAttribute.cs" />
- </ItemGroup>
- <ItemGroup>
- <RuntimeSources Include="$(BclSourcesRoot)\System\Runtime\MemoryFailPoint.cs" />
- <RuntimeSources Include="$(BclSourcesRoot)\System\Runtime\GcSettings.cs" />
- <RuntimeSources Include="$(BclSourcesRoot)\System\Runtime\ProfileOptimization.cs" />
- </ItemGroup>
- <ItemGroup>
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\CollectionBase.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ArrayList.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\Stack.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\Comparer.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\CompatibleComparer.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ListDictionaryInternal.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\EmptyReadOnlyDictionaryInternal.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\Hashtable.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\DictionaryEntry.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ICollection.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IComparer.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IDictionary.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IDictionaryEnumerator.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEnumerable.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEnumerator.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEqualityComparer.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IHashCodeProvider.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IList.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\KeyValuePairs.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\SortedList.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IStructuralEquatable.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IStructuralComparable.cs" />
- <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\StructuralComparisons.cs" />
- </ItemGroup>
- <ItemGroup>
- <ComponentModelSources Include="$(BclSourcesRoot)\System\ComponentModel\EditorBrowsableAttribute.cs" />
- </ItemGroup>
- <ItemGroup>
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ArrayWithOffset.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Attributes.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CallingConvention.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CharSet.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\COMException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ExternalException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GcHandle.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandleCookieTable.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\HandleRef.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomMarshaler.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\IException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidOleVariantTypeException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\LayoutKind.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\MarshalDirectiveException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\PInvokeMap.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\RuntimeEnvironment.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SEHException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeBuffer.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeHandle.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\BStrWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CurrencyWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ErrorWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UnknownWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\VariantWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComMemberType.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomAdapter.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomQueryInterface.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidComObjectException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeArrayRankMismatchException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeArrayTypeMismatchException.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeCallableAttribute.cs" />
- <InteropSources Condition="'$(FeatureCominterop)' != 'true'" Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NonPortable.cs" />
- <InteropSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Runtime\InteropServices\DispatchWrapper.cs" />
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomFactory.cs" />
- </ItemGroup>
- <ItemGroup>
- <InteropSources Include="$(CoreFxSourcesRoot)\System\Runtime\InteropServices\StringBuffer.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureClassicCominterop)' == 'true'">
- <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ITypeLibConverter.cs" />
- </ItemGroup>
- <ItemGroup>
- <InteropExpandoSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Expando\IExpando.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureClassicCominterop)' == 'true'">
- <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsHelper.cs" />
- <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsInfo.cs" />
- <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsMethod.cs" />
- <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsSink.cs" />
- <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeMethods.cs" />
- </ItemGroup>
- <ItemGroup>
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IBindCtx.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IConnectionPointContainer.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IConnectionPoint.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumMoniker.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumConnections.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumConnectionPoints.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumString.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumVARIANT.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IMoniker.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IPersistFile.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IRunningObjectTable.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IStream.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeComp.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeInfo.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeLib.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeLib2.cs" />
- <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeInfo2.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\Attributes.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ConstantSplittableMap.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryKeyCollection.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryValueCollection.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EnumeratorToIteratorAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorToListAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorToCollectionAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorViewToReadOnlyCollectionAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapToDictionaryAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapToCollectionAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapViewToReadOnlyCollectionAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToVectorAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryToMapAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\BindableVectorToListAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\BindableVectorToCollectionAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToBindableVectorAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToBindableVectorViewAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationToken.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationTokenTable.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IActivationFactory.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IRestrictedErrorInfo.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IMapViewToIReadOnlyDictionaryAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IVectorViewToIReadOnlyListAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReadOnlyDictionaryToIMapViewAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReadOnlyListToIVectorViewAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IteratorToEnumeratorAdapter.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ManagedActivationFactory.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\NativeMethods.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\PropertyValue.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeMarshal.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeMetadata.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IClosable.cs" />
- <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\RuntimeClass.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIPropertyValueImpl.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIReferenceImpl.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IPropertyValue.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReference.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsFoundationEventHandler.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ICustomPropertyProvider.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ICustomProperty.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CustomPropertyImpl.cs' />
- <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeBufferHelper.cs' />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
- <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IIterable.cs" />
- <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IIterator.cs" />
- <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IVector.cs" />
- <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IMap.cs" />
- <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIKeyValuePairImpl.cs" />
- </ItemGroup>
- <ItemGroup>
- <SystemSources Include="$(BclSourcesRoot)\System\AggregateException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContext.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextSwitches.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.CoreClrOverrides.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.Defaults.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.Defaults.Central.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CurrentTimeZone.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZone.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Object.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ICloneable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Action.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Array.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArraySegment.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IComparable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IEquatable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ThrowHelper.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Tuple.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\String.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\String.Comparison.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\String.Manipulation.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\String.Searching.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StringComparer.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StringComparison.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StringSplitOptions.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Text\StringBuilder.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Text\StringBuilderCache.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Exception.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\FormattableString.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DateTime.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DateTimeKind.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DateTimeOffset.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\SystemException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\OutOfMemoryException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StackOverflowException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DataMisalignedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ExecutionEngineException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Delegate.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MulticastDelegate.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\__Filters.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\__HResults.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\BCLDebug.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MemberAccessException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Activator.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AccessViolationException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ApplicationException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppDomain.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppDomainSetup.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppDomainManager.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IAppDomainPauseManager.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppDomainAttributes.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AppDomainUnloadedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ApplicationId.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArgumentException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArgumentNullException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArgumentOutOfRangeException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArgIterator.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArithmeticException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ArrayTypeMismatchException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AsyncCallback.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Attribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AttributeTargets.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\AttributeUsageAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\BadImageFormatException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\BitConverter.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Boolean.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Buffer.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Byte.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CannotUnloadAppDomainException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Char.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CharEnumerator.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CfgParser.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CLSCompliantAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeUnloadedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CompatibilitySwitches.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\LowLevelConsole.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ContextMarshalException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Convert.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StringFreezingAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Currency.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DayOfWeek.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DBNull.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Decimal.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DefaultBinder.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DelegateSerializationHolder.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DivideByZeroException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Double.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DuplicateWaitObjectException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Empty.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Enum.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\EntryPointNotFoundException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\DllNotFoundException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Environment.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\EventArgs.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\EventHandler.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\FieldAccessException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\FlagsAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\FormatException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\GC.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Guid.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IAsyncResult.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ICustomFormatter.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IDisposable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IFormatProvider.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IFormattable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IndexOutOfRangeException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IObservable.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IObserver.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IProgress.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InsufficientMemoryException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InsufficientExecutionStackException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Lazy.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Int16.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Int32.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Int64.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IntPtr.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Internal.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InvalidCastException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InvalidOperationException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InvalidProgramException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\InvalidTimeZoneException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IConvertible.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\IServiceObjectProvider.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MarshalByRefObject.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Math.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MathF.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\mda.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MethodAccessException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MidpointRounding.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MissingFieldException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MissingMemberException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MissingMethodException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\MulticastNotSupportedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\NonSerializedAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\NotFiniteNumberException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\NotImplementedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\NotSupportedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\NullReferenceException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Number.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ObjectDisposedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ObsoleteAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\OperatingSystem.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\OperationCanceledException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\OverflowException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ParamArrayAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ParamsArray.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ParseNumbers.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\PlatformID.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\PlatformNotSupportedException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Progress.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Random.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\RankException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ResId.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\RtType.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\RuntimeHandles.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\SByte.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\SerializableAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\SharedStatics.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Single.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\StubHelpers.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ThreadAttributes.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeoutException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeSpan.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.AdjustmentRule.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.StringSerializer.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.TransitionTime.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneNotFoundException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Type.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeAccessException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeNameParser.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeCode.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypedReference.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeInitializationException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\TypeLoadException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UInt16.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UInt32.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UInt64.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UIntPtr.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UnauthorizedAccessException.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UnitySerializationHolder.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UnhandledExceptionEventArgs.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\UnhandledExceptionEventHandler.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ValueType.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Version.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Void.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\WeakReference.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\WeakReferenceOfT.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\XmlIgnoreMemberAttribute.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\CLRConfig.cs" />
- <SystemSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\__ComObject.cs" />
- <SystemSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Variant.cs" />
- <SystemSources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\OleAutBinder.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ByReference.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\Span.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ReadOnlySpan.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.Unix.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
- <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.Win32.cs" />
- </ItemGroup>
- <ItemGroup>
- <InternalSources Include="$(BclSourcesRoot)\Internal\Runtime\Augments\EnvironmentAugments.cs" />
- <InternalSources Include="$(BclSourcesRoot)\Internal\Runtime\Augments\RuntimeThread.cs" />
- </ItemGroup>
- <ItemGroup>
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\__Filters.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AmbiguousMatchException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Assembly.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyName.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyNameProxy.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyNameFlags.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Associates.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeExtensions.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeFormatException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Binder.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\BindingFlags.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CallingConventions.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ConstructorInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttribute.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\DefaultMemberAttribute.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\EventAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\EventInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\FieldAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\FieldInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\GenericParameterAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ICustomAttributeProvider.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IReflectableType.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IntrospectionExtensions.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\RuntimeReflectionExtensions.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\InterfaceMapping.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\InvalidFilterCriteriaException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IReflect.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\LoaderAllocator.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ManifestResourceInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MdConstant.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MdImport.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberFilter.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberInfoSerializationHolder.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberTypes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodBase.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodImplAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Missing.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Module.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ObfuscateAssemblyAttribute.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ObfuscationAttribute.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodBody.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterModifier.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Pointer.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\PropertyAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\PropertyInfo.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ReflectionContext.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ReflectionTypeLoadException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ResourceAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\StrongNameKeyPair.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetInvocationException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetParameterCountException.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeAttributes.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeDelegator.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeFilter.cs" />
- <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilderData.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilderAccess.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AQNBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ConstructorBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicILGenerator.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicMethod.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EventBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EventToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ILGenerator.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ISymWrapperCore.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\Label.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\LocalBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodBuilderInstantiation.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SymbolType.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SymbolMethod.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\CustomAttributeBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ModuleBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ModuleBuilderData.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PEFileKinds.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OpCodes.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\Opcode.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OpcodeType.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\StackBehaviour.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OperandType.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FlowControl.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ParameterBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ParameterToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SignatureHelper.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SignatureToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\StringToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilderInstantiation.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\GenericTypeParameterBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EnumBuilder.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeToken.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\XXXOnTypeBuilderInstantiation.cs" />
- <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\UnmanagedMarshal.cs" />
- </ItemGroup>
- <ItemGroup>
- <ReflectionMetadataSources Include="$(BclSourcesRoot)\System\Reflection\Metadata\AssemblyExtensions.cs" />
- </ItemGroup>
- <ItemGroup>
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormat.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeParse.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeStyles.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\NumberStyles.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanFormat.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanParse.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DaylightTime.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' != 'true'">
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\BidiCategory.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\Calendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarData.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarAlgorithmType.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarWeekRule.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendricalCalculationsHelper.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CharUnicodeInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CompareInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureNotFoundException.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureTypes.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormatInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormatInfoScanner.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DigitShapes.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GlobalizationAssembly.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendarTypes.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendarHelper.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HebrewCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HijriCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\UmAlQuraCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\PersianCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\KoreanCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\RegionInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\SortKey.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\SortVersion.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\StringInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TaiwanCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TextElementEnumerator.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TextInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\ThaiBuddhistCalendar.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanStyles.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\NumberFormatInfo.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\UnicodeCategory.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureData.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HebrewNumber.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\ChineseLunisolarCalendar.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\EastAsianLunisolarCalendar.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\JapaneseLunisolarCalendar.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\JulianCalendar.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\KoreanLunisolarCalendar.cs" />
- <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\TaiwanLunisolarCalendar.cs" />
- </ItemGroup>
- <ItemGroup>
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\SR.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true'">
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\Calendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarAlgorithmType.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarData.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarWeekRule.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendricalCalculationsHelper.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CharUnicodeInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CharUnicodeInfoData.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\ChineseLunisolarCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CompareInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureData.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureTypes.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureNotFoundException.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DateTimeFormatInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DateTimeFormatInfoScanner.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\EastAsianLunisolarCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendarHelper.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendarTypes.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HebrewCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HebrewNumber.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HijriCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\IdnMapping.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\InternalGlobalizationHelper.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseLunisolarCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JulianCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\KoreanCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\KoreanLunisolarCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\NumberFormatInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\PersianCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\RegionInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\SortKey.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\SortVersion.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\StringInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TaiwanCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TaiwanLunisolarCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextElementEnumerator.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\ThaiBuddhistCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TimeSpanStyles.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\UmAlQuraCalendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\UnicodeCategory.cs " />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true' and '$(TargetsUnix)' == 'true'">
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.Unix.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.Unix.cs" />
- <GlobalizationSources Include="$(BclSourcesRoot)\System\Text\Normalization.Unix.cs" />
-
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Calendar.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Casing.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Collation.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Idna.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Locale.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Normalization.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.ResultCode.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.TimeZoneInfo.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Utils.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarData.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CompareInfo.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureData.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureInfo.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DigitShapes.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HijriCalendar.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\IdnMapping.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseCalendar.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\LocaleData.Unix.cs" />
- <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextInfo.Unix.cs" />
- </ItemGroup>
- <ItemGroup>
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AbandonedMutexException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AsyncLocal.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AutoResetEvent.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SendOrPostCallback.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SynchronizationContext.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\EventResetMode.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\EventWaitHandle.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ExecutionContext.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Interlocked.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\IObjectHandle.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\LockCookie.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\LockRecursionException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ManualResetEvent.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Monitor.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Mutex.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Overlapped.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ParameterizedThreadStart.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Semaphore.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SemaphoreFullException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SynchronizationLockException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Thread.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadAbortException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadInterruptedException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadPool.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadPriority.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStart.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadState.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStateException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\ThreadStaticAttribute.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStartException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Timeout.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Timer.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Volatile.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\WaitHandle.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\WaitHandleCannotBeOpenedException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ApartmentState.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SpinLock.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SpinWait.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CountdownEvent.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\LazyInitializer.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadLocal.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SemaphoreSlim.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ManualResetEventSlim.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationTokenRegistration.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationTokenSource.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationToken.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\future.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\FutureFactory.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\Task.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskContinuation.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskCanceledException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskSchedulerException.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskExceptionHolder.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskFactory.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskScheduler.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ThreadPoolTaskScheduler.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskCompletionSource.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\AsyncCausalityTracer.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ProducerConsumerQueues.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TPLETWProvider.cs" />
- <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskToApm.cs" />
- <ThreadingSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Threading\Tasks\IAsyncCausalityTracerStatics.cs" />
- </ItemGroup>
- <ItemGroup>
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.cs" />
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\Error.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <SafehandleSources Include="$(CoreFxSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs" />
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.Unix.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
- <SafehandleSources Include="$(CoreFxSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFileHandle.Windows.cs" />
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.Win32.cs" />
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStreamCompletionSource.Win32.cs" />
- <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\Win32Marshal.cs" />
- </ItemGroup>
- <ItemGroup>
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Unix.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Unix.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Win32.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Windows.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathHelper.Windows.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Windows.cs" />
- <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Windows.StringBuffer.cs" />
- </ItemGroup>
- <ItemGroup>
- <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\DeferredDisposableLifetime.cs" />
- <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.cs" />
- <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolBoundHandleOverlapped.cs" />
- <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolPreAllocatedOverlapped.cs" />
- </ItemGroup>
- <ItemGroup>
- <IoSources Include="$(BclSourcesRoot)\System\IO\__Error.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\__HResults.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\BinaryReader.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\BinaryWriter.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\Directory.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\SearchOption.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\DirectoryNotFoundException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\DriveNotFoundException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\EncodingCache.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\EndOfStreamException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\File.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileAccess.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileLoadException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileMode.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileNotFoundException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileOptions.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileShare.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\FileSystemEnumerable.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\IOException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\MemoryStream.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\PathTooLongException.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\PinnedBufferMemoryStream.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\SeekOrigin.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\Stream.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\StreamHelpers.CopyValidation.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\StreamReader.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\TextReader.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryAccessor.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStream.cs" />
- <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStreamWrapper.cs" />
- </ItemGroup>
- <ItemGroup>
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\Attributes.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\BuiltInPermissionSets.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\CodeAccessPermission.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\CodeAccessSecurityEngine.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\IEvidenceFactory.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\IPermission.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\ISecurityEncodable.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\ISecurityPolicyEncodable.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\IStackWalk.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\FrameSecurityDescriptor.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\HostSecurityManager.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\NamedPermissionSet.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSetEnumerator.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSet.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionToken.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSetTriple.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionListSet.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityContext.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityException.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityState.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\HostProtectionException.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityManager.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityRuntime.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityZone.cs" />
- <SecuritySources Include="$(BclSourcesRoot)\System\Security\VerificationException.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\Config.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\Hex.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\sitestring.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\StringExpressionSet.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\TokenBasedSet.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\TokenBasedSetEnumerator.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\URLString.cs" />
- <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\XMLUtil.cs" />
- </ItemGroup>
- <ItemGroup>
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Assert.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilter.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilters.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\ConditionalAttribute.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Debugger.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\DebuggerAttributes.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\ICustomDebuggerNotification.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\log.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\LoggingLevels.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\LogSwitch.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Stacktrace.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Stackframe.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\EditAndContinueHelper.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\ActivityTracker.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventActivityOptions.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventDescriptor.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventProvider.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource_CoreCLR.cs" />
- <DiagnosticsSources Condition="'$(FeatureXplatEventSource)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSourceException.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\FrameworkEventSource.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\StubEnvironment.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\Winmeta.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ArrayTypeInfo.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ConcurrentSet.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ConcurrentSetItem.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\DataCollector.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EmptyStruct.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EnumerableTypeInfo.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EnumHelper.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventDataAttribute.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventFieldAttribute.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventFieldFormat.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventIgnoreAttribute.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventPayload.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventSourceOptions.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\FieldMetadata.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\InvokeTypeInfo.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\NameInfo.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\PropertyValue.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\PropertyAnalysis.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\SimpleEventTypes.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\SimpleTypeInfos.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\Statics.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingDataCollector.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingDataType.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventSource.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventTraits.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventTypes.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingMetadataCollector.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingTypeInfo.cs" />
- <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TypeAnalysis.cs" />
- </ItemGroup>
- <ItemGroup>
- <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\CodeAnalysis\SuppressMessageAttribute.cs" />
- <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\Contracts\Contracts.cs" />
- <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\Contracts\ContractsBCL.cs" />
- </ItemGroup>
- <ItemGroup>
- <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\ISymDocumentWriter.cs" />
- <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\ISymWriter.cs" />
- <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\SymAddressKind.cs" />
- <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\Token.cs" />
- </ItemGroup>
- <ItemGroup>
- <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\CorruptingExceptionCommon.cs" />
- <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\ExceptionServicesCommon.cs" />
- <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\ExceptionNotification.cs" />
- </ItemGroup>
- <ItemGroup>
- <HostingSources Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.cs" />
- </ItemGroup>
- <ItemGroup>
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterConverter.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterServices.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IDeserializationCallback.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IFormatter.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IFormatterConverter.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IObjectReference.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\ISerializable.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\ISerializationSurrogate.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\ISurrogateSelector.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\MemberHolder.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationAttributes.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationBinder.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationException.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationFieldInfo.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfo.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfoEnumerator.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\StreamingContext.cs" />
- <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SafeSerializationManager.cs" />
- </ItemGroup>
- <ItemGroup>
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\TargetFrameworkAttribute.cs" />
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\TargetFrameworkId.cs" />
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\CompatibilitySwitch.cs" />
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\NonVersionableAttribute.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <ConfigurationAssembliesSources Include="$(BclSourcesRoot)\System\Configuration\Assemblies\AssemblyHash.cs" />
- <ConfigurationAssembliesSources Include="$(BclSourcesRoot)\System\Configuration\Assemblies\AssemblyHashAlgorithm.cs" />
- <ConfigurationAssembliesSources Include="$(BclSourcesRoot)\System\Configuration\Assemblies\AssemblyVersionCompatibility.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <RemotingSources Include="$(BclSourcesRoot)\System\Runtime\Remoting\ObjectHandle.cs" />
- </ItemGroup>
- <ItemGroup>
- <TextSources Include="$(BclSourcesRoot)\System\Text\ASCIIEncoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Decoder.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderNLS.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderBestFitFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderExceptionFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderReplacementFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Encoder.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderNLS.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderBestFitFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderExceptionFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderReplacementFallback.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Encoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingForwarder.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingInfo.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingNLS.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingProvider.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Latin1Encoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Normalization.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\Normalization.Windows.cs" Condition="'$(TargetsUnix)' != 'true'"/>
- <TextSources Include="$(BclSourcesRoot)\System\Text\UnicodeEncoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\UTF7Encoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\UTF8Encoding.cs" />
- <TextSources Include="$(BclSourcesRoot)\System\Text\UTF32Encoding.cs" />
- </ItemGroup>
- <ItemGroup>
- <SecurityAclSources Include="$(BclSourcesRoot)\System\Security\AccessControl\Enums.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(FeatureCasPolicy)' != 'true'">
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\ApplicationTrust.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\Evidence.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\EvidenceBase.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\EvidenceTypeDescriptor.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\IDelayEvaluatedEvidence.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\IIdentityPermissionFactory.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\IRuntimeEvidenceFactory.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\PolicyException.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\PolicyStatement.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\Site.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\StrongName.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\URL.cs" />
- <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\Zone.cs" />
- </ItemGroup>
- <ItemGroup>
- <XmlSources Include="$(BclSourcesRoot)\System\Security\SecurityElement.cs" />
- </ItemGroup>
- <ItemGroup>
- <Win32Sources Include="$(BclSourcesRoot)\Microsoft\Win32\UnsafeNativeMethods.cs" />
- <Win32Sources Include="$(BclSourcesRoot)\Microsoft\Win32\Win32Native.cs" />
- <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\Registry.cs" />
- <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryKey.cs" />
- <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryOptions.cs" />
- <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryValueKind.cs" />
- <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryView.cs" />
- <Win32Sources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\OAVariantLib.cs" />
- </ItemGroup>
- <ItemGroup>
- <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\IIdentity.cs" />
- <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\IPrincipal.cs" />
- <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\TokenImpersonationLevel.cs" />
- </ItemGroup>
- <ItemGroup>
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\__FastResourceComparer.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\__HResults.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\FileBasedResourceGroveler.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\IResourceGroveler.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\IResourceReader.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\IResourceWriter.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\LooselyLinkedResourceReference.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ManifestBasedResourceGroveler.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\MissingManifestResourceException.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\MissingSatelliteAssemblyException.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\NeutralResourcesLanguageAttribute.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceFallbackManager.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceManager.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceReader.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceSet.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceTypeCode.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\RuntimeResourceSet.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\SatelliteContractVersionAttribute.cs" />
- <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\UltimateResourceFallbackLocation.cs" />
- </ItemGroup>
- <ItemGroup>
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\EnvironmentPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\FileDialogPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\FileIOPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\HostProtectionPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IBuiltInPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IsolatedStoragePermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IsolatedStorageFilePermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\PermissionState.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\PermissionAttributes.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\ReflectionPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\SecurityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\SiteIdentityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\StrongNameIdentityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\StrongNamePublicKeyBlob.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\UIPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\URLIdentityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\ZoneIdentityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\GACIdentityPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IUnrestrictedPermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\keycontainerpermission.cs" />
- <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\RegistryPermission.cs" />
- </ItemGroup>
- <ItemGroup>
- <GenericsSources Include="$(BclSourcesRoot)\System\Nullable.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\Comparer.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\Dictionary.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\EqualityComparer.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\DebugView.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\ICollection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IComparer.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IDictionary.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEnumerable.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEnumerator.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEqualityComparer.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IList.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyCollection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyList.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyDictionary.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\KeyNotFoundException.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\KeyValuePair.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\List.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\ArraySortHelper.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\Collection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\ReadOnlyCollection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\ReadOnlyDictionary.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\KeyedCollection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentStack.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\IProducerConsumerCollection.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentDictionary.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentQueue.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\Partitioner.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\OrderablePartitioner.cs" />
- <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\PartitionerStatic.cs" />
- </ItemGroup>
- <ItemGroup>
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFileMappingHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFindHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeViewOfFileHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeWaitHandle.cs" />
- <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\Win32SafeHandles.cs" />
- <SafehandleSources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
- </ItemGroup>
- <ItemGroup>
- <NumericsSources Include="$(BclSourcesRoot)\System\Numerics\Hashing\HashHelpers.cs" />
- </ItemGroup>
- <ItemGroup>
- <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ArrayPool.cs" />
- <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ArrayPoolEventSource.cs" />
- <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ConfigurableArrayPool.cs" />
- <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\TlsOverPerCoreLockedStacksArrayPool.cs" />
- <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\Utilities.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\CryptographicException.cs" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\System\HResults.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.BOOL.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.Errors.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.Libraries.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\BCrypt\Interop.NTSTATUS.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CancelIoEx.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CloseHandle.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CreateFile.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FileTypes.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FileOperations.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FlushFileBuffers.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FormatMessage.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFileInformationByHandleEx.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFileType_SafeHandle.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFullPathNameW.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetLongPathNameW.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetTempFileNameW.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetTempPathW.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.LockFile.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SafeCreateFile.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SECURITY_ATTRIBUTES.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SecurityOptions.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetEndOfFile.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetErrorMode.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetFileInformationByHandle.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetFilePointerEx.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.UnsafeCreateFile.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs" />
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.cs" />
- </ItemGroup>
-
- <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
- <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SafeBSTRHandle.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.Windows.cs" />
- <!-- Interop sources -->
- <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\Crypt32\Interop.CryptProtectMemory.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\NtDll\Interop.ZeroMemory.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WideCharToMultiByte.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\oleaut32\Interop.SysAllocStringLen.cs" />
- <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\oleaut32\Interop.SysStringLen.cs" />
- </ItemGroup>
-
- <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.Unix.cs" />
- </ItemGroup>
-
- <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\System\HResults.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.Errors.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.IOErrors.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.Libraries.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Close.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.GetCwd.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.GetUnixName.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Fcntl.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FLock.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FSync.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FTruncate.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.LSeek.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.MksTemps.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Open.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.OpenFlags.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.PathConf.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Permissions.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.PosixFAdvise.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Read.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Stat.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Unlink.cs" />
- <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Write.cs" />
- </ItemGroup>
- <ItemGroup>
- <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Debug.cs" />
- </ItemGroup>
- <ItemGroup>
- <MscorlibSources Include="@(SystemSources)"/>
- <MscorlibSources Include="@(ThreadingSources)"/>
- <MscorlibSources Include="@(DeploymentSources)"/>
- <MscorlibSources Include="@(CollectionsSources)"/>
- <MscorlibSources Include="@(ComponentModelSources)"/>
- <MscorlibSources Include="@(GenericsSources)"/>
- <MscorlibSources Include="@(DiagnosticsSources)"/>
- <MscorlibSources Include="@(DiagnosticsCodeanalysisSources)"/>
- <MscorlibSources Include="@(DiagnosticsSymbolstoreSources)"/>
- <MscorlibSources Include="@(ReflectionSources)"/>
- <MscorlibSources Include="@(ExceptionservicesSources)"/>
- <MscorlibSources Include="@(HostingSources)"/>
- <MscorlibSources Include="@(SerializationSources)"/>
- <MscorlibSources Include="@(GlobalizationSources)"/>
- <MscorlibSources Include="@(TextSources)"/>
- <MscorlibSources Include="@(ResourcesSources)"/>
- <MscorlibSources Include="@(Win32Sources)"/>
- <MscorlibSources Include="@(SafehandleSources)"/>
- <MscorlibSources Include="@(SecUtilSources)"/>
- <MscorlibSources Include="@(SecurityPolicySources)"/>
- <MscorlibSources Include="@(SecurityPrincipalSources)"/>
- <MscorlibSources Include="@(ReliabilitySources)"/>
- <MscorlibSources Include="@(InteropSources)"/>
- <MscorlibSources Include="@(InteropComtypesSources)"/>
- <MscorlibSources Include="@(InteropComeventsSources)"/>
- <MscorlibSources Include="@(InteropExpandoSources)"/>
- <MscorlibSources Include="@(InteropWinRTSources)"/>
- <MscorlibSources Include="@(WinRTTSources)"/>
- <MscorlibSources Include="@(WinRTCollectionSources)"/>
- <MscorlibSources Include="@(IoSources)"/>
- <MscorlibSources Include="@(FileStreamSources)"/>
- <MscorlibSources Include="@(CompilerServicesSources)"/>
- <MscorlibSources Include="@(RuntimeSources)"/>
- <MscorlibSources Include="@(XmlSources)"/>
- <MscorlibSources Include="@(PermissionsSources)"/>
- <MscorlibSources Include="@(SecuritySources)"/>
- <MscorlibSources Include="@(RemotingSources)"/>
- <MscorlibSources Include="@(IsostoreSources)"/>
- <MscorlibSources Include="@(SerializationFormattersSources)"/>
- <MscorlibSources Include="@(SerializationFormattersBinarySources)"/>
- <MscorlibSources Include="@(ReflectionEmitSources)"/>
- <MscorlibSources Include="@(ReflectionMetadataSources)"/>
- <MscorlibSources Include="@(ConfigurationAssembliesSources)"/>
- <MscorlibSources Include="@(SecCryptographySources)"/>
- <MscorlibSources Include="@(SecPublickeySources)"/>
- <MscorlibSources Include="@(SecurityAclSources)"/>
- <MscorlibSources Include="@(IdentitySources)"/>
- <MscorlibSources Include="@(VersioningSources)"/>
- <MscorlibSources Include="@(DesignerServicesSources)"/>
- <MscorlibSources Include="@(InternalSources)"/>
- <MscorlibSources Include="@(NumericsSources)"/>
- <MscorlibSources Include="$(BclSourcesRoot)\GlobalSuppressions.cs"/>
- <MscorlibSources Include="@(BuffersSources)"/>
- <MscorlibSources Include="@(WindowsInteropSources)"/>
- <MscorlibSources Include="@(UnixInteropSources)"/>
- </ItemGroup>
-</Project>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AccessedThroughPropertyAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeHelpers.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerGeneratedAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CustomConstantAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DateTimeConstantAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DiscardableAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DecimalConstantAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DisablePrivateReflectionAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilationRelaxations.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerGlobalScopeAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ExtensionAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FormattableStringFactory.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FixedBufferAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IndexerNameAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\InternalsVisibleToAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IsVolatile.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\MethodImplAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\FixedAddressValueTypeAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\UnsafeValueTypeAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AssemblySettingAttributes.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeDependencyAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CompilerMarshalOverride.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\jithelpers.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\Unsafe.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SpecialNameAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SuppressMergeCheckAttribute.cs" />
+ <CompilerServicesSources Condition="'$(FeatureICastable)' == 'true'" Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ICastable.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\SuppressIldasmAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeForwardedToAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TypeForwardedFromAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ReferenceAssemblyAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeCompatibilityAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeWrappedException.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\ConditionalWeakTable.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerFilePathAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerLineNumberAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\CallerMemberNameAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\StateMachineAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IteratorStateMachineAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncStateMachineAttribute.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncMethodBuilder.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\IAsyncStateMachine.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\INotifyCompletion.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\TaskAwaiter.cs" />
+ <CompilerServicesSources Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\YieldAwaitable.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\CriticalFinalizerObject.cs" />
+ <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\ReliabilityContractAttribute.cs" />
+ <ReliabilitySources Include="$(BclSourcesRoot)\System\Runtime\Reliability\PrePrepareMethodAttribute.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <RuntimeSources Include="$(BclSourcesRoot)\System\Runtime\MemoryFailPoint.cs" />
+ <RuntimeSources Include="$(BclSourcesRoot)\System\Runtime\GcSettings.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\CollectionBase.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ArrayList.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\Comparer.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\CompatibleComparer.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ListDictionaryInternal.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\EmptyReadOnlyDictionaryInternal.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\Hashtable.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\DictionaryEntry.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\ICollection.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IComparer.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IDictionary.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IDictionaryEnumerator.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEnumerable.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEnumerator.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IEqualityComparer.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IHashCodeProvider.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IList.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IStructuralEquatable.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\IStructuralComparable.cs" />
+ <CollectionsSources Include="$(BclSourcesRoot)\System\Collections\StructuralComparisons.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ComponentModelSources Include="$(BclSourcesRoot)\System\ComponentModel\EditorBrowsableAttribute.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ArrayWithOffset.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Attributes.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CallingConvention.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CharSet.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\COMException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CriticalHandle.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ExternalException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GcHandle.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandleCookieTable.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\HandleRef.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomMarshaler.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\IException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidOleVariantTypeException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\LayoutKind.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\MarshalDirectiveException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\PInvokeMap.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\RuntimeEnvironment.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SEHException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeBuffer.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeHandle.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\BStrWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\CurrencyWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ErrorWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UnknownWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\VariantWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComMemberType.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomAdapter.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomQueryInterface.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\InvalidComObjectException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeArrayRankMismatchException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeArrayTypeMismatchException.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeCallableAttribute.cs" />
+ <InteropSources Condition="'$(FeatureCominterop)' != 'true'" Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NonPortable.cs" />
+ <InteropSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Runtime\InteropServices\DispatchWrapper.cs" />
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ICustomFactory.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <InteropSources Include="$(CoreFxSourcesRoot)\System\Runtime\InteropServices\StringBuffer.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureClassicCominterop)' == 'true'">
+ <InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ITypeLibConverter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <InteropExpandoSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Expando\IExpando.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureClassicCominterop)' == 'true'">
+ <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsHelper.cs" />
+ <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsInfo.cs" />
+ <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsMethod.cs" />
+ <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComEventsSink.cs" />
+ <InteropComeventsSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeMethods.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IBindCtx.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IConnectionPointContainer.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IConnectionPoint.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumMoniker.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumConnections.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumConnectionPoints.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumString.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IEnumVARIANT.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IMoniker.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IPersistFile.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IRunningObjectTable.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\IStream.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeComp.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeInfo.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeLib.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeLib2.cs" />
+ <InteropComtypesSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ComTypes\ITypeInfo2.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\Attributes.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ConstantSplittableMap.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryKeyCollection.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryValueCollection.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EnumeratorToIteratorAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorToListAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorToCollectionAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\VectorViewToReadOnlyCollectionAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapToDictionaryAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapToCollectionAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\MapViewToReadOnlyCollectionAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToVectorAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\DictionaryToMapAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\BindableVectorToListAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\BindableVectorToCollectionAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToBindableVectorAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ListToBindableVectorViewAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationToken.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationTokenTable.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IActivationFactory.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IRestrictedErrorInfo.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IMapViewToIReadOnlyDictionaryAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IVectorViewToIReadOnlyListAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReadOnlyDictionaryToIMapViewAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReadOnlyListToIVectorViewAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IteratorToEnumeratorAdapter.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ManagedActivationFactory.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\NativeMethods.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\PropertyValue.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeMarshal.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeMetadata.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IClosable.cs" />
+ <InteropWinRTSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\RuntimeClass.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIPropertyValueImpl.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIReferenceImpl.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IPropertyValue.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IReference.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsFoundationEventHandler.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ICustomPropertyProvider.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\ICustomProperty.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CustomPropertyImpl.cs' />
+ <WinRTTSources Include='$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeBufferHelper.cs' />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCominterop)' == 'true'">
+ <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IIterable.cs" />
+ <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IIterator.cs" />
+ <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IVector.cs" />
+ <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\IMap.cs" />
+ <WinRTCollectionSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\CLRIKeyValuePairImpl.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SystemSources Include="$(BclSourcesRoot)\System\AggregateException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContext.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextSwitches.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.CoreClrOverrides.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.Defaults.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppContext\AppContextDefaultValues.Defaults.Central.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\CurrentTimeZone.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZone.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Object.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ICloneable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Action.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Array.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArraySegment.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IComparable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IEquatable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ThrowHelper.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Tuple.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\String.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\String.Comparison.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\String.Manipulation.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\String.Searching.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StringComparer.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StringComparison.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StringSplitOptions.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Text\StringBuilder.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Text\StringBuilderCache.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Exception.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\FormattableString.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DateTime.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DateTimeKind.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DateTimeOffset.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\SystemException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\OutOfMemoryException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StackOverflowException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DataMisalignedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ExecutionEngineException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Delegate.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MulticastDelegate.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\__Filters.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\__HResults.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\BCLDebug.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MemberAccessException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Activator.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AccessViolationException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ApplicationException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppDomain.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppDomainSetup.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppDomainManager.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IAppDomainPauseManager.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppDomainAttributes.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AppDomainUnloadedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArgumentException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArgumentNullException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArgumentOutOfRangeException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArgIterator.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArithmeticException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ArrayTypeMismatchException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AsyncCallback.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Attribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AttributeTargets.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\AttributeUsageAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\BadImageFormatException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\BitConverter.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Boolean.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Buffer.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Byte.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Char.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\CharEnumerator.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\CLSCompliantAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeUnloadedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\CompatibilitySwitches.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\LowLevelConsole.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Convert.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StringFreezingAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Currency.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DayOfWeek.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DBNull.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Decimal.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DefaultBinder.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DelegateSerializationHolder.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DivideByZeroException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Double.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DuplicateWaitObjectException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Empty.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Enum.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\EntryPointNotFoundException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\DllNotFoundException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Environment.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\EventArgs.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\EventHandler.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\FieldAccessException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\FlagsAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\FormatException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\GC.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Guid.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IAsyncResult.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ICustomFormatter.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IDisposable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IFormatProvider.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IFormattable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IndexOutOfRangeException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IObservable.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IObserver.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IProgress.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InsufficientMemoryException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InsufficientExecutionStackException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Lazy.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Int16.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Int32.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Int64.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IntPtr.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Internal.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InvalidCastException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InvalidOperationException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InvalidProgramException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\InvalidTimeZoneException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IConvertible.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\IServiceObjectProvider.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MarshalByRefObject.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Math.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MathF.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\mda.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MethodAccessException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MidpointRounding.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MissingFieldException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MissingMemberException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MissingMethodException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\MulticastNotSupportedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\NonSerializedAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\NotFiniteNumberException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\NotImplementedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\NotSupportedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\NullReferenceException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Number.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ObjectDisposedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ObsoleteAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\OperatingSystem.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\OperationCanceledException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\OverflowException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ParamArrayAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ParamsArray.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ParseNumbers.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\PlatformID.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\PlatformNotSupportedException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Progress.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Random.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\RankException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ResId.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\RtType.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\RuntimeHandles.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\SByte.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\SerializableAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\SharedStatics.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Single.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\StubHelpers.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ThreadAttributes.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeoutException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeSpan.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.AdjustmentRule.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.StringSerializer.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.TransitionTime.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneNotFoundException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Type.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeAccessException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeNameParser.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeCode.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypedReference.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeInitializationException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\TypeLoadException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UInt16.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UInt32.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UInt64.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UIntPtr.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UnauthorizedAccessException.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UnitySerializationHolder.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UnhandledExceptionEventArgs.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\UnhandledExceptionEventHandler.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ValueType.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Version.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Void.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\WeakReference.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\WeakReferenceOfT.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\XmlIgnoreMemberAttribute.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\CLRConfig.cs" />
+ <SystemSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\__ComObject.cs" />
+ <SystemSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Variant.cs" />
+ <SystemSources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\OleAutBinder.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ByReference.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\Span.cs" />
+ <SystemSources Include="$(BclSourcesRoot)\System\ReadOnlySpan.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.Unix.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
+ <SystemSources Include="$(BclSourcesRoot)\System\TimeZoneInfo.Win32.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <InternalSources Include="$(BclSourcesRoot)\Internal\Runtime\Augments\EnvironmentAugments.cs" />
+ <InternalSources Include="$(BclSourcesRoot)\Internal\Runtime\Augments\RuntimeThread.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\__Filters.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AmbiguousMatchException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Assembly.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyName.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AssemblyNameFlags.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Associates.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeExtensions.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeFormatException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Binder.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\BindingFlags.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CallingConventions.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ConstructorInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\CustomAttribute.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\DefaultMemberAttribute.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\EventAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\EventInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\FieldAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\FieldInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\GenericParameterAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ICustomAttributeProvider.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IReflectableType.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IntrospectionExtensions.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\RuntimeReflectionExtensions.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\InterfaceMapping.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\InvalidFilterCriteriaException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\IReflect.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\LoaderAllocator.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ManifestResourceInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MdConstant.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MdImport.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberFilter.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberInfoSerializationHolder.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MemberTypes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodBase.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodImplAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Missing.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Module.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ObfuscateAssemblyAttribute.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ObfuscationAttribute.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\MethodBody.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ParameterModifier.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\Pointer.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\PropertyAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\PropertyInfo.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ReflectionContext.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ReflectionTypeLoadException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\ResourceAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\StrongNameKeyPair.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetInvocationException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TargetParameterCountException.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeAttributes.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeDelegator.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeFilter.cs" />
+ <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\TypeInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilderData.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilderAccess.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\AQNBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ConstructorBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicILGenerator.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicMethod.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EventBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EventToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ILGenerator.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ISymWrapperCore.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\Label.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\LocalBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodBuilderInstantiation.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SymbolType.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SymbolMethod.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\CustomAttributeBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ModuleBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ModuleBuilderData.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PEFileKinds.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OpCodes.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\Opcode.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OpcodeType.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\StackBehaviour.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\OperandType.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\FlowControl.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ParameterBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\ParameterToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SignatureHelper.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\SignatureToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\StringToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilderInstantiation.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\GenericTypeParameterBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\EnumBuilder.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeToken.cs" />
+ <ReflectionEmitSources Include="$(BclSourcesRoot)\System\Reflection\Emit\XXXOnTypeBuilderInstantiation.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ReflectionMetadataSources Include="$(BclSourcesRoot)\System\Reflection\Metadata\AssemblyExtensions.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormat.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeParse.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeStyles.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\NumberStyles.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanFormat.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanParse.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DaylightTime.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' != 'true'">
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\BidiCategory.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\Calendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarData.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarAlgorithmType.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendarWeekRule.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CalendricalCalculationsHelper.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CharUnicodeInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CompareInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureNotFoundException.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureTypes.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormatInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DateTimeFormatInfoScanner.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\DigitShapes.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GlobalizationAssembly.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendarTypes.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\GregorianCalendarHelper.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HebrewCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HijriCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\UmAlQuraCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\PersianCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\IdnMapping.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\KoreanCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\RegionInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\SortKey.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\SortVersion.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\StringInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TaiwanCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TextElementEnumerator.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TextInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\ThaiBuddhistCalendar.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\TimeSpanStyles.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\NumberFormatInfo.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\UnicodeCategory.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\CultureData.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\HebrewNumber.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\ChineseLunisolarCalendar.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\EastAsianLunisolarCalendar.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\JapaneseLunisolarCalendar.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\JulianCalendar.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\KoreanLunisolarCalendar.cs" />
+ <GlobalizationSources Condition="'$(FeatureOnlyCoreCalendars)'==''" Include="$(BclSourcesRoot)\System\Globalization\TaiwanLunisolarCalendar.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\SR.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true'">
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\Calendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarAlgorithmType.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarData.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarWeekRule.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendricalCalculationsHelper.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CharUnicodeInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CharUnicodeInfoData.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\ChineseLunisolarCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CompareInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureData.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureTypes.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureNotFoundException.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DateTimeFormatInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DateTimeFormatInfoScanner.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\EastAsianLunisolarCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendarHelper.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\GregorianCalendarTypes.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HebrewCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HebrewNumber.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HijriCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\IdnMapping.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\InternalGlobalizationHelper.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseLunisolarCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JulianCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\KoreanCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\KoreanLunisolarCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\NumberFormatInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\PersianCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\RegionInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\SortKey.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\SortVersion.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\StringInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TaiwanCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TaiwanLunisolarCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextElementEnumerator.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\ThaiBuddhistCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TimeSpanStyles.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\UmAlQuraCalendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\UnicodeCategory.cs " />
+ </ItemGroup>
+ <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true' and '$(TargetsUnix)' == 'true'">
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.Unix.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.Unix.cs" />
+ <GlobalizationSources Include="$(BclSourcesRoot)\System\Text\Normalization.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Calendar.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Casing.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Collation.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Idna.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Locale.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Normalization.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.ResultCode.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.TimeZoneInfo.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Globalization.Native\Interop.Utils.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CalendarData.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CompareInfo.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureData.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\CultureInfo.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\DigitShapes.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\HijriCalendar.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\IdnMapping.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\JapaneseCalendar.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\LocaleData.Unix.cs" />
+ <GlobalizationSources Include="$(CoreFxSourcesRoot)\System\Globalization\TextInfo.Unix.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AbandonedMutexException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AsyncLocal.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\AutoResetEvent.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SendOrPostCallback.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SynchronizationContext.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\EventResetMode.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\EventWaitHandle.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ExecutionContext.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Interlocked.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\LockRecursionException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ManualResetEvent.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Monitor.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Mutex.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Overlapped.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ParameterizedThreadStart.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Semaphore.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SemaphoreFullException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SynchronizationLockException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Thread.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadAbortException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadInterruptedException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadPool.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadPriority.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStart.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadState.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStateException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\ThreadStaticAttribute.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadStartException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Timeout.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Timer.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Volatile.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\WaitHandle.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\WaitHandleCannotBeOpenedException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ApartmentState.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SpinLock.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SpinWait.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CountdownEvent.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\LazyInitializer.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ThreadLocal.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\SemaphoreSlim.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\ManualResetEventSlim.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationTokenRegistration.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationTokenSource.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\CancellationToken.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\future.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\FutureFactory.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\Task.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskContinuation.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskCanceledException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskSchedulerException.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskExceptionHolder.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskFactory.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskScheduler.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ThreadPoolTaskScheduler.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskCompletionSource.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\AsyncCausalityTracer.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\ProducerConsumerQueues.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TPLETWProvider.cs" />
+ <ThreadingSources Include="$(BclSourcesRoot)\System\Threading\Tasks\TaskToApm.cs" />
+ <ThreadingSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Threading\Tasks\IAsyncCausalityTracerStatics.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.cs" />
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\Error.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
+ <SafehandleSources Include="$(CoreFxSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs" />
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.Unix.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
+ <SafehandleSources Include="$(CoreFxSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFileHandle.Windows.cs" />
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStream.Win32.cs" />
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\FileStreamCompletionSource.Win32.cs" />
+ <FileStreamSources Include="$(CoreFxSourcesRoot)\System\IO\Win32Marshal.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Unix.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Unix.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Win32.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\Path.Windows.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathHelper.Windows.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Windows.cs" />
+ <IoSources Include="$(CoreFxSourcesRoot)\System\IO\PathInternal.Windows.StringBuffer.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\DeferredDisposableLifetime.cs" />
+ <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolBoundHandle.cs" />
+ <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolBoundHandleOverlapped.cs" />
+ <ThreadingSources Include="$(CoreFxSourcesRoot)\System\Threading\ClrThreadPoolPreAllocatedOverlapped.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <IoSources Include="$(BclSourcesRoot)\System\IO\__Error.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\__HResults.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\BinaryReader.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\BinaryWriter.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\Directory.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\SearchOption.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\DirectoryNotFoundException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\DriveNotFoundException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\EncodingCache.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\EndOfStreamException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\File.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileAccess.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileLoadException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileMode.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileNotFoundException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileOptions.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileShare.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\FileSystemEnumerable.cs" Condition="'$(TargetsUnix)' == 'true'" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\IOException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\MemoryStream.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\PathTooLongException.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\PinnedBufferMemoryStream.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\SeekOrigin.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\Stream.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\StreamHelpers.CopyValidation.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\TextReader.cs" Condition="'$(TargetsUnix)' == 'true'" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\StreamReader.cs" Condition="'$(TargetsUnix)' == 'true'" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryAccessor.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStream.cs" />
+ <IoSources Include="$(BclSourcesRoot)\System\IO\UnmanagedMemoryStreamWrapper.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\Attributes.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\CodeAccessPermission.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\CodeAccessSecurityEngine.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\IPermission.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\FrameSecurityDescriptor.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\NamedPermissionSet.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSetEnumerator.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSet.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionToken.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionSetTriple.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\PermissionListSet.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityContext.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityException.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityState.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityManager.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityRuntime.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\SecurityZone.cs" />
+ <SecuritySources Include="$(BclSourcesRoot)\System\Security\VerificationException.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\Hex.cs" />
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\sitestring.cs" />
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\StringExpressionSet.cs" />
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\TokenBasedSet.cs" />
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\TokenBasedSetEnumerator.cs" />
+ <SecUtilSources Include="$(BclSourcesRoot)\System\Security\Util\URLString.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Assert.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilter.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\AssertFilters.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\ConditionalAttribute.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Debugger.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\DebuggerAttributes.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\ICustomDebuggerNotification.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\log.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\LoggingLevels.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\LogSwitch.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Stacktrace.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Stackframe.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\EditAndContinueHelper.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\ActivityTracker.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventActivityOptions.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventDescriptor.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventProvider.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource_CoreCLR.cs" />
+ <DiagnosticsSources Condition="'$(FeatureXplatEventSource)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSourceException.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\FrameworkEventSource.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\StubEnvironment.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\Winmeta.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ArrayTypeInfo.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ConcurrentSet.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\ConcurrentSetItem.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\DataCollector.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EmptyStruct.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EnumerableTypeInfo.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EnumHelper.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventDataAttribute.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventFieldAttribute.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventFieldFormat.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventIgnoreAttribute.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventPayload.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\EventSourceOptions.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\FieldMetadata.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\InvokeTypeInfo.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\NameInfo.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\PropertyValue.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\PropertyAnalysis.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\SimpleEventTypes.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\SimpleTypeInfos.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\Statics.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingDataCollector.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingDataType.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventSource.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventTraits.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventTypes.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingMetadataCollector.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingTypeInfo.cs" />
+ <DiagnosticsSources Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TypeAnalysis.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\CodeAnalysis\SuppressMessageAttribute.cs" />
+ <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\Contracts\Contracts.cs" />
+ <DiagnosticsCodeanalysisSources Include="$(BclSourcesRoot)\System\Diagnostics\Contracts\ContractsBCL.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\ISymDocumentWriter.cs" />
+ <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\ISymWriter.cs" />
+ <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\SymAddressKind.cs" />
+ <DiagnosticsSymbolstoreSources Include="$(BclSourcesRoot)\System\Diagnostics\SymbolStore\Token.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\CorruptingExceptionCommon.cs" />
+ <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\ExceptionServicesCommon.cs" />
+ <ExceptionservicesSources Include="$(BclSourcesRoot)\System\Runtime\ExceptionServices\ExceptionNotification.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <HostingSources Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterConverter.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\FormatterServices.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IDeserializationCallback.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IFormatterConverter.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\IObjectReference.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\ISerializable.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationAttributes.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationException.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfo.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfoEnumerator.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\StreamingContext.cs" />
+ <SerializationSources Include="$(BclSourcesRoot)\System\Runtime\Serialization\SafeSerializationManager.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\TargetFrameworkAttribute.cs" />
+ <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\CompatibilitySwitch.cs" Condition="'$(TargetsUnix)' == 'true'" />
+ <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\NonVersionableAttribute.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ConfigurationAssembliesSources Include="$(BclSourcesRoot)\System\Configuration\Assemblies\AssemblyHashAlgorithm.cs" />
+ <ConfigurationAssembliesSources Include="$(BclSourcesRoot)\System\Configuration\Assemblies\AssemblyVersionCompatibility.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <RemotingSources Include="$(BclSourcesRoot)\System\Runtime\Remoting\ObjectHandle.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <TextSources Include="$(BclSourcesRoot)\System\Text\ASCIIEncoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Decoder.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderNLS.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderBestFitFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderExceptionFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\DecoderReplacementFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Encoder.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderNLS.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderBestFitFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderExceptionFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncoderReplacementFallback.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Encoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingForwarder.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingInfo.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingNLS.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\EncodingProvider.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Latin1Encoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Normalization.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\Normalization.Windows.cs" Condition="'$(TargetsUnix)' != 'true'"/>
+ <TextSources Include="$(BclSourcesRoot)\System\Text\UnicodeEncoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\UTF7Encoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\UTF8Encoding.cs" />
+ <TextSources Include="$(BclSourcesRoot)\System\Text\UTF32Encoding.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecurityAclSources Include="$(BclSourcesRoot)\System\Security\AccessControl\Enums.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\ApplicationTrust.cs" />
+ <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\Evidence.cs" />
+ <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\EvidenceBase.cs" />
+ <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\PolicyStatement.cs" />
+ <SecurityPolicySources Include="$(BclSourcesRoot)\System\Security\Policy\StrongName.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <Win32Sources Include="$(BclSourcesRoot)\Microsoft\Win32\UnsafeNativeMethods.cs" />
+ <Win32Sources Include="$(BclSourcesRoot)\Microsoft\Win32\Win32Native.cs" />
+ <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\Registry.cs" />
+ <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryKey.cs" />
+ <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryValueKind.cs" />
+ <Win32Sources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\RegistryView.cs" />
+ <Win32Sources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\OAVariantLib.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\IIdentity.cs" />
+ <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\IPrincipal.cs" />
+ <SecurityPrincipalSources Include="$(BclSourcesRoot)\System\Security\Principal\TokenImpersonationLevel.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\__FastResourceComparer.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\__HResults.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\FileBasedResourceGroveler.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\IResourceGroveler.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\IResourceReader.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\LooselyLinkedResourceReference.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ManifestBasedResourceGroveler.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\MissingManifestResourceException.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\MissingSatelliteAssemblyException.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\NeutralResourcesLanguageAttribute.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceFallbackManager.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceManager.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceReader.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceSet.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\ResourceTypeCode.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\RuntimeResourceSet.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\SatelliteContractVersionAttribute.cs" />
+ <ResourcesSources Include="$(BclSourcesRoot)\System\Resources\UltimateResourceFallbackLocation.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\EnvironmentPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\FileDialogPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\FileIOPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\HostProtectionPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IBuiltInPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\PermissionState.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\PermissionAttributes.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\ReflectionPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\SecurityPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\StrongNamePublicKeyBlob.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\UIPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\IUnrestrictedPermission.cs" />
+ <PermissionsSources Include="$(BclSourcesRoot)\System\Security\Permissions\RegistryPermission.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <GenericsSources Include="$(BclSourcesRoot)\System\Nullable.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\Comparer.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\Dictionary.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\EqualityComparer.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\DebugView.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\ICollection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IComparer.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IDictionary.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEnumerable.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEnumerator.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IEqualityComparer.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IList.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyCollection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyList.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\IReadOnlyDictionary.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\KeyNotFoundException.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\KeyValuePair.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\List.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Generic\ArraySortHelper.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\Collection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\ReadOnlyCollection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\ReadOnlyDictionary.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\ObjectModel\KeyedCollection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentStack.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\IProducerConsumerCollection.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentDictionary.cs" />
+ <GenericsSources Include="$(BclSourcesRoot)\System\Collections\Concurrent\ConcurrentQueue.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeFindHandle.cs" />
+ <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs" />
+ <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeWaitHandle.cs" />
+ <SafehandleSources Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\Win32SafeHandles.cs" />
+ <SafehandleSources Condition="'$(FeatureWin32Registry)' == 'true'" Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <NumericsSources Include="$(BclSourcesRoot)\System\Numerics\Hashing\HashHelpers.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ArrayPool.cs" />
+ <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ArrayPoolEventSource.cs" />
+ <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\ConfigurableArrayPool.cs" />
+ <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\TlsOverPerCoreLockedStacksArrayPool.cs" />
+ <BuffersSources Include="$(CoreFxSourcesRoot)\System\Buffers\Utilities.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\CryptographicException.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\System\HResults.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.BOOL.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.Errors.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\Interop.Libraries.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\BCrypt\Interop.NTSTATUS.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CancelIoEx.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CloseHandle.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.CreateFile.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FileTypes.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FileOperations.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FlushFileBuffers.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.FormatMessage.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFileInformationByHandleEx.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFileType_SafeHandle.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetFullPathNameW.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetLongPathNameW.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetTempFileNameW.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.GetTempPathW.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.LockFile.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SafeCreateFile.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SECURITY_ATTRIBUTES.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SecurityOptions.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetEndOfFile.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetErrorMode.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetFileInformationByHandle.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.SetFilePointerEx.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.UnsafeCreateFile.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_IntPtr.cs" />
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WriteFile_SafeHandle_NativeOverlapped.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' != 'true'">
+ <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SafeBSTRHandle.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.Windows.cs" />
+ <!-- Interop sources -->
+ <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\Crypt32\Interop.CryptProtectMemory.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\NtDll\Interop.ZeroMemory.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\kernel32\Interop.WideCharToMultiByte.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\oleaut32\Interop.SysAllocStringLen.cs" />
+ <SecuritySources Include="$(CoreFxSourcesRoot)\Interop\Windows\oleaut32\Interop.SysStringLen.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
+ <SecuritySources Include="$(CoreFxSourcesRoot)\System\Security\SecureString.Unix.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetsUnix)' == 'true'">
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\System\HResults.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.Errors.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.IOErrors.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\Interop.Libraries.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Close.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.GetCwd.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.GetUnixName.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Fcntl.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FLock.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FSync.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.FTruncate.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.LSeek.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.MksTemps.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Open.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.OpenFlags.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.PathConf.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Permissions.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.PosixFAdvise.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Read.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Stat.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Unlink.cs" />
+ <UnixInteropSources Include="$(CoreFxSourcesRoot)\Interop\Unix\System.Native\Interop.Write.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <WindowsInteropSources Include="$(CoreFxSourcesRoot)\Debug.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <MscorlibSources Include="@(SystemSources)"/>
+ <MscorlibSources Include="@(ThreadingSources)"/>
+ <MscorlibSources Include="@(DeploymentSources)"/>
+ <MscorlibSources Include="@(CollectionsSources)"/>
+ <MscorlibSources Include="@(ComponentModelSources)"/>
+ <MscorlibSources Include="@(GenericsSources)"/>
+ <MscorlibSources Include="@(DiagnosticsSources)"/>
+ <MscorlibSources Include="@(DiagnosticsCodeanalysisSources)"/>
+ <MscorlibSources Include="@(DiagnosticsSymbolstoreSources)"/>
+ <MscorlibSources Include="@(ReflectionSources)"/>
+ <MscorlibSources Include="@(ExceptionservicesSources)"/>
+ <MscorlibSources Include="@(HostingSources)"/>
+ <MscorlibSources Include="@(SerializationSources)"/>
+ <MscorlibSources Include="@(GlobalizationSources)"/>
+ <MscorlibSources Include="@(TextSources)"/>
+ <MscorlibSources Include="@(ResourcesSources)"/>
+ <MscorlibSources Include="@(Win32Sources)"/>
+ <MscorlibSources Include="@(SafehandleSources)"/>
+ <MscorlibSources Include="@(SecUtilSources)"/>
+ <MscorlibSources Include="@(SecurityPolicySources)"/>
+ <MscorlibSources Include="@(SecurityPrincipalSources)"/>
+ <MscorlibSources Include="@(ReliabilitySources)"/>
+ <MscorlibSources Include="@(InteropSources)"/>
+ <MscorlibSources Include="@(InteropComtypesSources)"/>
+ <MscorlibSources Include="@(InteropComeventsSources)"/>
+ <MscorlibSources Include="@(InteropExpandoSources)"/>
+ <MscorlibSources Include="@(InteropWinRTSources)"/>
+ <MscorlibSources Include="@(WinRTTSources)"/>
+ <MscorlibSources Include="@(WinRTCollectionSources)"/>
+ <MscorlibSources Include="@(IoSources)"/>
+ <MscorlibSources Include="@(FileStreamSources)"/>
+ <MscorlibSources Include="@(CompilerServicesSources)"/>
+ <MscorlibSources Include="@(RuntimeSources)"/>
+ <MscorlibSources Include="@(XmlSources)"/>
+ <MscorlibSources Include="@(PermissionsSources)"/>
+ <MscorlibSources Include="@(SecuritySources)"/>
+ <MscorlibSources Include="@(RemotingSources)"/>
+ <MscorlibSources Include="@(IsostoreSources)"/>
+ <MscorlibSources Include="@(SerializationFormattersSources)"/>
+ <MscorlibSources Include="@(SerializationFormattersBinarySources)"/>
+ <MscorlibSources Include="@(ReflectionEmitSources)"/>
+ <MscorlibSources Include="@(ReflectionMetadataSources)"/>
+ <MscorlibSources Include="@(ConfigurationAssembliesSources)"/>
+ <MscorlibSources Include="@(SecCryptographySources)"/>
+ <MscorlibSources Include="@(SecPublickeySources)"/>
+ <MscorlibSources Include="@(SecurityAclSources)"/>
+ <MscorlibSources Include="@(IdentitySources)"/>
+ <MscorlibSources Include="@(VersioningSources)"/>
+ <MscorlibSources Include="@(DesignerServicesSources)"/>
+ <MscorlibSources Include="@(InternalSources)"/>
+ <MscorlibSources Include="@(NumericsSources)"/>
+ <MscorlibSources Include="$(BclSourcesRoot)\GlobalSuppressions.cs"/>
+ <MscorlibSources Include="@(BuffersSources)"/>
+ <MscorlibSources Include="@(WindowsInteropSources)"/>
+ <MscorlibSources Include="@(UnixInteropSources)"/>
+ </ItemGroup>
+</Project>
diff --git a/src/mscorlib/ref/mscorlib.cs b/src/mscorlib/ref/mscorlib.cs
index 46b6d084fb..680bf20675 100644
--- a/src/mscorlib/ref/mscorlib.cs
+++ b/src/mscorlib/ref/mscorlib.cs
@@ -6823,43 +6823,6 @@ namespace System.IO
public virtual void WriteByte(byte value) { }
}
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public partial class StreamReader : System.IO.TextReader
- {
- public static readonly new System.IO.StreamReader Null;
- public StreamReader(System.IO.Stream stream) { }
- public StreamReader(System.IO.Stream stream, bool detectEncodingFromByteOrderMarks) { }
- public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding) { }
- public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
- public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
- public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize, bool leaveOpen) { }
- public StreamReader(string path) { }
- public StreamReader(string path, bool detectEncodingFromByteOrderMarks) { }
- public StreamReader(string path, System.Text.Encoding encoding) { }
- public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
- [System.Security.SecuritySafeCriticalAttribute]
- public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
- public virtual System.IO.Stream BaseStream { get { throw null; } }
- public virtual System.Text.Encoding CurrentEncoding { get { throw null; } }
- public bool EndOfStream { get { throw null; } }
- public override void Close() { }
- public void DiscardBufferedData() { }
- protected override void Dispose(bool disposing) { }
- public override int Peek() { throw null; }
- public override int Read() { throw null; }
- public override int Read(char[] buffer, int index, int count) { buffer = default(char[]); throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
- public override int ReadBlock(char[] buffer, int index, int count) { buffer = default(char[]); throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
- public override string ReadLine() { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<string> ReadLineAsync() { throw null; }
- public override string ReadToEnd() { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
- }
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
public partial class StreamWriter : System.IO.TextWriter
{
public static readonly new System.IO.StreamWriter Null;
@@ -6900,26 +6863,6 @@ namespace System.IO
public override System.Threading.Tasks.Task WriteLineAsync(string value) { throw null; }
}
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public partial class StringReader : System.IO.TextReader
- {
- public StringReader(string s) { }
- public override void Close() { }
- protected override void Dispose(bool disposing) { }
- public override int Peek() { throw null; }
- public override int Read() { throw null; }
- public override int Read(char[] buffer, int index, int count) { buffer = default(char[]); throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
- public override string ReadLine() { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<string> ReadLineAsync() { throw null; }
- public override string ReadToEnd() { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
- }
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
public partial class StringWriter : System.IO.TextWriter
{
public StringWriter() { }
@@ -6950,31 +6893,6 @@ namespace System.IO
public override System.Threading.Tasks.Task WriteLineAsync(string value) { throw null; }
}
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public abstract partial class TextReader : System.IDisposable
- {
- public static readonly System.IO.TextReader Null;
- protected TextReader() { }
- public virtual void Close() { }
- public void Dispose() { }
- protected virtual void Dispose(bool disposing) { }
- public virtual int Peek() { throw null; }
- public virtual int Read() { throw null; }
- public virtual int Read(char[] buffer, int index, int count) { buffer = default(char[]); throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public virtual System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
- public virtual int ReadBlock(char[] buffer, int index, int count) { buffer = default(char[]); throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public virtual System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
- public virtual string ReadLine() { throw null; }
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public virtual System.Threading.Tasks.Task<string> ReadLineAsync() { throw null; }
- public virtual string ReadToEnd() { throw null; }
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Runtime.InteropServices.ComVisibleAttribute(false)]
- public virtual System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
- public static System.IO.TextReader Synchronized(System.IO.TextReader reader) { throw null; }
- }
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
public abstract partial class TextWriter : System.IDisposable
{
protected char[] CoreNewLine;
diff --git a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
index 8f3a8c47c2..4846205b80 100644
--- a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
+++ b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
@@ -16,6 +16,8 @@ namespace Internal.Runtime.Augments
{
public class RuntimeThread : CriticalFinalizerObject
{
+ internal RuntimeThread() {}
+
public static RuntimeThread Create(ThreadStart start) => new Thread(start);
public static RuntimeThread Create(ThreadStart start, int maxStackSize) => new Thread(start, maxStackSize);
public static RuntimeThread Create(ParameterizedThreadStart start) => new Thread(start);
diff --git a/src/mscorlib/src/Microsoft/Win32/Registry.cs b/src/mscorlib/src/Microsoft/Win32/Registry.cs
index 3ee5f4648b..1a34ef656c 100644
--- a/src/mscorlib/src/Microsoft/Win32/Registry.cs
+++ b/src/mscorlib/src/Microsoft/Win32/Registry.cs
@@ -16,7 +16,7 @@ namespace Microsoft.Win32 {
*/
//This class contains only static members and does not need to be serializable.
[ComVisible(true)]
- public static class Registry {
+ internal static class Registry {
static Registry()
{
}
@@ -130,24 +130,6 @@ namespace Microsoft.Win32 {
key.Close();
}
}
-
- public static void SetValue(string keyName, string valueName, object value ) {
- SetValue(keyName, valueName, value, RegistryValueKind.Unknown);
- }
-
- public static void SetValue(string keyName, string valueName, object value, RegistryValueKind valueKind ) {
- string subKeyName;
- RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out subKeyName);
- BCLDebug.Assert(basekey != null, "basekey can't be null!");
- RegistryKey key = basekey.CreateSubKey(subKeyName);
- BCLDebug.Assert(key != null, "An exception should be thrown if failed!");
- try {
- key.SetValue(valueName, value, valueKind);
- }
- finally {
- key.Close();
- }
- }
}
}
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
index ff678f132c..090be8284a 100644
--- a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
+++ b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
@@ -68,21 +68,6 @@ namespace Microsoft.Win32
using System.Diagnostics.CodeAnalysis;
/**
- * Registry hive values. Useful only for GetRemoteBaseKey
- */
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum RegistryHive
- {
- ClassesRoot = unchecked((int)0x80000000),
- CurrentUser = unchecked((int)0x80000001),
- LocalMachine = unchecked((int)0x80000002),
- Users = unchecked((int)0x80000003),
- PerformanceData = unchecked((int)0x80000004),
- CurrentConfig = unchecked((int)0x80000005),
- }
-
- /**
* Registry encapsulation. To get an instance of a RegistryKey use the
* Registry class's static members then call OpenSubKey.
*
@@ -91,7 +76,7 @@ namespace Microsoft.Win32
* @security(checkClassLinking=on)
*/
[ComVisible(true)]
- public sealed class RegistryKey : MarshalByRefObject, IDisposable
+ internal sealed class RegistryKey : MarshalByRefObject, IDisposable
{
// We could use const here, if C# supported ELEMENT_TYPE_I fully.
@@ -168,17 +153,6 @@ namespace Microsoft.Win32
* Creates a RegistryKey.
*
* This key is bound to hkey, if writable is <b>false</b> then no write operations
- * will be allowed.
- */
- private RegistryKey(SafeRegistryHandle hkey, bool writable, RegistryView view)
- : this(hkey, writable, false, false, false, view) {
- }
-
-
- /**
- * Creates a RegistryKey.
- *
- * This key is bound to hkey, if writable is <b>false</b> then no write operations
* will be allowed. If systemkey is set then the hkey won't be released
* when the object is GC'ed.
* The remoteKey flag when set to true indicates that we are dealing with registry entries
@@ -239,262 +213,11 @@ namespace Microsoft.Win32
}
}
- public void Flush() {
- if (hkey != null) {
- if (IsDirty()) {
- Win32Native.RegFlushKey(hkey);
- }
- }
- }
-
void IDisposable.Dispose()
{
Dispose(true);
}
- /**
- * Creates a new subkey, or opens an existing one.
- *
- * @param subkey Name or path to subkey to create or open.
- *
- * @return the subkey, or <b>null</b> if the operation failed.
- */
- [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread safety")]
- public RegistryKey CreateSubKey(String subkey) {
- return CreateSubKey(subkey, checkMode);
- }
-
- [ComVisible(false)]
- public RegistryKey CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
- {
- return CreateSubKeyInternal(subkey, permissionCheck, null, RegistryOptions.None);
- }
-
- [ComVisible(false)]
- public RegistryKey CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
- {
- return CreateSubKeyInternal(subkey, permissionCheck, null, options);
- }
-
- [ComVisible(false)]
- public RegistryKey CreateSubKey(String subkey, bool writable)
- {
- return CreateSubKeyInternal(subkey, writable ? RegistryKeyPermissionCheck.ReadWriteSubTree : RegistryKeyPermissionCheck.ReadSubTree, null, RegistryOptions.None);
- }
-
- [ComVisible(false)]
- public RegistryKey CreateSubKey(String subkey, bool writable, RegistryOptions options)
- {
- return CreateSubKeyInternal(subkey, writable ? RegistryKeyPermissionCheck.ReadWriteSubTree : RegistryKeyPermissionCheck.ReadSubTree, null, options);
- }
-
- [ComVisible(false)]
- private unsafe RegistryKey CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, object registrySecurityObj, RegistryOptions registryOptions)
- {
- ValidateKeyOptions(registryOptions);
- ValidateKeyName(subkey);
- ValidateKeyMode(permissionCheck);
- EnsureWriteable();
- subkey = FixupName(subkey); // Fixup multiple slashes to a single slash
-
- // only keys opened under read mode is not writable
- if (!remoteKey) {
- RegistryKey key = InternalOpenSubKey(subkey, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree));
- if (key != null) { // Key already exits
- CheckPermission(RegistryInternalCheck.CheckSubKeyWritePermission, subkey, false, RegistryKeyPermissionCheck.Default);
- CheckPermission(RegistryInternalCheck.CheckSubTreePermission, subkey, false, permissionCheck);
- key.checkMode = permissionCheck;
- return key;
- }
- }
-
- CheckPermission(RegistryInternalCheck.CheckSubKeyCreatePermission, subkey, false, RegistryKeyPermissionCheck.Default);
-
- Win32Native.SECURITY_ATTRIBUTES secAttrs = null;
-
- int disposition = 0;
-
- // By default, the new key will be writable.
- SafeRegistryHandle result = null;
- int ret = Win32Native.RegCreateKeyEx(hkey,
- subkey,
- 0,
- null,
- (int)registryOptions /* specifies if the key is volatile */,
- GetRegistryKeyAccess(permissionCheck != RegistryKeyPermissionCheck.ReadSubTree) | (int)regView,
- secAttrs,
- out result,
- out disposition);
-
- if (ret == 0 && !result.IsInvalid) {
- RegistryKey key = new RegistryKey(result, (permissionCheck != RegistryKeyPermissionCheck.ReadSubTree), false, remoteKey, false, regView);
- CheckPermission(RegistryInternalCheck.CheckSubTreePermission, subkey, false, permissionCheck);
- key.checkMode = permissionCheck;
-
- if (subkey.Length == 0)
- key.keyName = keyName;
- else
- key.keyName = keyName + "\\" + subkey;
- return key;
- }
- else if (ret != 0) // syscall failed, ret is an error code.
- Win32Error(ret, keyName + "\\" + subkey); // Access denied?
-
- BCLDebug.Assert(false, "Unexpected code path in RegistryKey::CreateSubKey");
- return null;
- }
-
- /**
- * Deletes the specified subkey. Will throw an exception if the subkey has
- * subkeys. To delete a tree of subkeys use, DeleteSubKeyTree.
- *
- * @param subkey SubKey to delete.
- *
- * @exception InvalidOperationException thrown if the subkey has child subkeys.
- */
- public void DeleteSubKey(String subkey) {
- DeleteSubKey(subkey, true);
- }
-
- public void DeleteSubKey(String subkey, bool throwOnMissingSubKey) {
- ValidateKeyName(subkey);
- EnsureWriteable();
- subkey = FixupName(subkey); // Fixup multiple slashes to a single slash
- CheckPermission(RegistryInternalCheck.CheckSubKeyWritePermission, subkey, false, RegistryKeyPermissionCheck.Default);
-
- // Open the key we are deleting and check for children. Be sure to
- // explicitly call close to avoid keeping an extra HKEY open.
- //
- RegistryKey key = InternalOpenSubKey(subkey,false);
- if (key != null) {
- try {
- if (key.InternalSubKeyCount() > 0) {
- ThrowHelper.ThrowInvalidOperationException(ExceptionResource.InvalidOperation_RegRemoveSubKey);
- }
- }
- finally {
- key.Close();
- }
-
- int ret;
-
- try {
- ret = Win32Native.RegDeleteKeyEx(hkey, subkey, (int)regView, 0);
- }
- catch (EntryPointNotFoundException) {
- ret = Win32Native.RegDeleteKey(hkey, subkey);
- }
-
- if (ret!=0) {
- if (ret == Win32Native.ERROR_FILE_NOT_FOUND) {
- if (throwOnMissingSubKey)
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent);
- }
- else
- Win32Error(ret, null);
- }
- }
- else { // there is no key which also means there is no subkey
- if (throwOnMissingSubKey)
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent);
- }
- }
-
- /**
- * Recursively deletes a subkey and any child subkeys.
- *
- * @param subkey SubKey to delete.
- */
- public void DeleteSubKeyTree(String subkey) {
- DeleteSubKeyTree(subkey, true /*throwOnMissingSubKey*/);
- }
-
- [ComVisible(false)]
- public void DeleteSubKeyTree(String subkey, Boolean throwOnMissingSubKey) {
- ValidateKeyName(subkey);
-
- // Security concern: Deleting a hive's "" subkey would delete all
- // of that hive's contents. Don't allow "".
- if (subkey.Length==0 && IsSystemKey()) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyDelHive);
- }
-
- EnsureWriteable();
-
- subkey = FixupName(subkey); // Fixup multiple slashes to a single slash
- CheckPermission(RegistryInternalCheck.CheckSubTreeWritePermission, subkey, false, RegistryKeyPermissionCheck.Default);
-
- RegistryKey key = InternalOpenSubKey(subkey, true);
- if (key != null) {
- try {
- if (key.InternalSubKeyCount() > 0) {
- String[] keys = key.InternalGetSubKeyNames();
-
- for (int i=0; i<keys.Length; i++) {
- key.DeleteSubKeyTreeInternal(keys[i]);
- }
- }
- }
- finally {
- key.Close();
- }
-
- int ret;
- try {
- ret = Win32Native.RegDeleteKeyEx(hkey, subkey, (int)regView, 0);
- }
- catch (EntryPointNotFoundException) {
- ret = Win32Native.RegDeleteKey(hkey, subkey);
- }
-
- if (ret!=0) Win32Error(ret, null);
- }
- else if(throwOnMissingSubKey) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent);
- }
- }
-
- // An internal version which does no security checks or argument checking. Skipping the
- // security checks should give us a slight perf gain on large trees.
- private void DeleteSubKeyTreeInternal(string subkey) {
- RegistryKey key = InternalOpenSubKey(subkey, true);
- if (key != null) {
- try {
- if (key.InternalSubKeyCount() > 0) {
- String[] keys = key.InternalGetSubKeyNames();
-
- for (int i=0; i<keys.Length; i++) {
- key.DeleteSubKeyTreeInternal(keys[i]);
- }
- }
- }
- finally {
- key.Close();
- }
-
- int ret;
- try {
- ret = Win32Native.RegDeleteKeyEx(hkey, subkey, (int)regView, 0);
- }
- catch (EntryPointNotFoundException) {
- ret = Win32Native.RegDeleteKey(hkey, subkey);
- }
- if (ret!=0) Win32Error(ret, null);
- }
- else {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyAbsent);
- }
- }
-
- /**
- * Deletes the specified value from this key.
- *
- * @param name Name of value to delete.
- */
- public void DeleteValue(String name) {
- DeleteValue(name, true);
- }
-
public void DeleteValue(String name, bool throwOnMissingValue) {
EnsureWriteable();
CheckPermission(RegistryInternalCheck.CheckValueWritePermission, name, false, RegistryKeyPermissionCheck.Default);
@@ -552,68 +275,6 @@ namespace Microsoft.Win32
return key;
}
-
- [ComVisible(false)]
- public static RegistryKey OpenBaseKey(RegistryHive hKey, RegistryView view) {
- ValidateKeyView(view);
- CheckUnmanagedCodePermission();
- return GetBaseKey((IntPtr)((int)hKey), view);
- }
-
- /**
- * Retrieves a new RegistryKey that represents the requested key on a foreign
- * machine. Valid values for hKey are members of the RegistryHive enum, or
- * Win32 integers such as:
- *
- * HKEY_CLASSES_ROOT,
- * HKEY_CURRENT_USER,
- * HKEY_LOCAL_MACHINE,
- * HKEY_USERS,
- * HKEY_PERFORMANCE_DATA,
- * HKEY_CURRENT_CONFIG,
- * HKEY_DYN_DATA.
- *
- * @param hKey HKEY_* to open.
- * @param machineName the machine to connect to
- *
- * @return the RegistryKey requested.
- */
- public static RegistryKey OpenRemoteBaseKey(RegistryHive hKey, String machineName) {
- return OpenRemoteBaseKey(hKey, machineName, RegistryView.Default);
- }
-
- [ComVisible(false)]
- public static RegistryKey OpenRemoteBaseKey(RegistryHive hKey, String machineName, RegistryView view) {
- if (machineName==null)
- throw new ArgumentNullException(nameof(machineName));
- int index = (int)hKey & 0x0FFFFFFF;
- if (index < 0 || index >= hkeyNames.Length || ((int)hKey & 0xFFFFFFF0) != 0x80000000) {
- throw new ArgumentException(Environment.GetResourceString("Arg_RegKeyOutOfRange"));
- }
- ValidateKeyView(view);
-
- CheckUnmanagedCodePermission();
- // connect to the specified remote registry
- SafeRegistryHandle foreignHKey = null;
- int ret = Win32Native.RegConnectRegistry(machineName, new SafeRegistryHandle(new IntPtr((int)hKey), false), out foreignHKey);
-
- if (ret == Win32Native.ERROR_DLL_INIT_FAILED)
- // return value indicates an error occurred
- throw new ArgumentException(Environment.GetResourceString("Arg_DllInitFailure"));
-
- if (ret != 0)
- Win32ErrorStatic(ret, null);
-
- if (foreignHKey.IsInvalid)
- // return value indicates an error occurred
- throw new ArgumentException(Environment.GetResourceString("Arg_RegKeyNoRemoteConnect", machineName));
-
- RegistryKey key = new RegistryKey(foreignHKey, true, false, true, ((IntPtr) hKey) == HKEY_PERFORMANCE_DATA, view);
- key.checkMode = RegistryKeyPermissionCheck.Default;
- key.keyName = hkeyNames[index];
- return key;
- }
-
/**
* Retrieves a subkey. If readonly is <b>true</b>, then the subkey is opened with
* read-only access.
@@ -685,26 +346,6 @@ namespace Microsoft.Win32
return OpenSubKey(name, false);
}
- /**
- * Retrieves the count of subkeys.
- *
- * @return a count of subkeys.
- */
- public int SubKeyCount {
- get {
- CheckPermission(RegistryInternalCheck.CheckKeyReadPermission, null, false, RegistryKeyPermissionCheck.Default);
- return InternalSubKeyCount();
- }
- }
-
- [ComVisible(false)]
- public RegistryView View {
- get {
- EnsureNotDisposed();
- return regView;
- }
- }
-
internal int InternalSubKeyCount() {
EnsureNotDisposed();
@@ -770,18 +411,6 @@ namespace Microsoft.Win32
return names;
}
- /**
- * Retrieves the count of values.
- *
- * @return a count of values.
- */
- public int ValueCount {
- get {
- CheckPermission(RegistryInternalCheck.CheckKeyReadPermission, null, false, RegistryKeyPermissionCheck.Default);
- return InternalValueCount();
- }
- }
-
internal int InternalValueCount() {
EnsureNotDisposed();
int values = 0;
@@ -1110,37 +739,6 @@ namespace Microsoft.Win32
return data;
}
-
- [ComVisible(false)]
- public RegistryValueKind GetValueKind(string name) {
- CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
- EnsureNotDisposed();
-
- int type = 0;
- int datasize = 0;
- int ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, (byte[])null, ref datasize);
- if (ret != 0)
- Win32Error(ret, null);
- if (type == Win32Native.REG_NONE)
- return RegistryValueKind.None;
- else if (!Enum.IsDefined(typeof(RegistryValueKind), type))
- return RegistryValueKind.Unknown;
- else
- return (RegistryValueKind) type;
- }
-
- /**
- * Retrieves the current state of the dirty property.
- *
- * A key is marked as dirty if any operation has occurred that modifies the
- * contents of the key.
- *
- * @return <b>true</b> if the key has been modified.
- */
- private bool IsDirty() {
- return (this.state & STATE_DIRTY) != 0;
- }
-
private bool IsSystemKey() {
return (this.state & STATE_SYSTEMKEY) != 0;
}
@@ -1153,13 +751,6 @@ namespace Microsoft.Win32
return (this.state & STATE_PERF_DATA) != 0;
}
- public String Name {
- get {
- EnsureNotDisposed();
- return keyName;
- }
- }
-
private void SetDirty() {
this.state |= STATE_DIRTY;
}
@@ -1392,19 +983,6 @@ namespace Microsoft.Win32
}
}
- internal static void Win32ErrorStatic(int errorCode, String str) {
- switch (errorCode) {
- case Win32Native.ERROR_ACCESS_DENIED:
- if (str != null)
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_RegistryKeyGeneric_Key", str));
- else
- throw new UnauthorizedAccessException();
-
- default:
- throw new IOException(Win32Native.GetMessage(errorCode), errorCode);
- }
- }
-
internal static String FixupName(String name)
{
BCLDebug.Assert(name!=null,"[FixupName]name!=null");
@@ -1798,26 +1376,6 @@ namespace Microsoft.Win32
return winAccess;
}
- static int GetRegistryKeyAccess(RegistryKeyPermissionCheck mode) {
- int winAccess = 0;
- switch(mode) {
- case RegistryKeyPermissionCheck.ReadSubTree:
- case RegistryKeyPermissionCheck.Default:
- winAccess = Win32Native.KEY_READ;
- break;
-
- case RegistryKeyPermissionCheck.ReadWriteSubTree:
- winAccess = Win32Native.KEY_READ| Win32Native.KEY_WRITE;
- break;
-
- default:
- BCLDebug.Assert(false, "unexpected code path");
- break;
- }
-
- return winAccess;
- }
-
private RegistryKeyPermissionCheck GetSubKeyPermissonCheck(bool subkeyWritable) {
if( checkMode == RegistryKeyPermissionCheck.Default) {
return checkMode;
@@ -1851,18 +1409,6 @@ namespace Microsoft.Win32
ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyStrLenBug);
}
-
- static private void ValidateKeyMode(RegistryKeyPermissionCheck mode) {
- if( mode < RegistryKeyPermissionCheck.Default || mode > RegistryKeyPermissionCheck.ReadWriteSubTree) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidRegistryKeyPermissionCheck, ExceptionArgument.mode);
- }
- }
-
- static private void ValidateKeyOptions(RegistryOptions options) {
- if (options < RegistryOptions.None || options > RegistryOptions.Volatile) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidRegistryOptionsCheck, ExceptionArgument.options);
- }
- }
static private void ValidateKeyView(RegistryView view) {
if (view != RegistryView.Default && view != RegistryView.Registry32 && view != RegistryView.Registry64) {
@@ -1877,14 +1423,14 @@ namespace Microsoft.Win32
}
[Flags]
- public enum RegistryValueOptions {
+ internal enum RegistryValueOptions {
None = 0,
DoNotExpandEnvironmentNames = 1
}
// the name for this API is meant to mimic FileMode, which has similar values
- public enum RegistryKeyPermissionCheck {
+ internal enum RegistryKeyPermissionCheck {
Default = 0,
ReadSubTree = 1,
ReadWriteSubTree = 2
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryOptions.cs b/src/mscorlib/src/Microsoft/Win32/RegistryOptions.cs
deleted file mode 100644
index 4d5e3aaab1..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/RegistryOptions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-//
-// Implements Microsoft.Win32.RegistryOptions
-//
-// ======================================================================================
-namespace Microsoft.Win32 {
- using System;
-
- [Flags]
- public enum RegistryOptions {
- None = Win32Native.REG_OPTION_NON_VOLATILE, // 0x0000
- Volatile = Win32Native.REG_OPTION_VOLATILE, // 0x0001
-///
-/// Consider exposing more options in a future release. Users can access this
-/// functionality by calling [RegistryKey].Handle and pinvoking
-///
-/// CreateLink = Win32Native.REG_OPTION_CREATE_LINK, // 0x0002
-/// BackupRestore = Win32Native.REG_OPTION_BACKUP_RESTORE,// 0x0004
- };
-}
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs b/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
index c88d5f920a..9f9475666c 100644
--- a/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
+++ b/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
@@ -5,7 +5,7 @@
namespace Microsoft.Win32 {
[System.Runtime.InteropServices.ComVisible(true)]
- public enum RegistryValueKind {
+ internal enum RegistryValueKind {
String = Win32Native.REG_SZ,
ExpandString = Win32Native.REG_EXPAND_SZ,
Binary = Win32Native.REG_BINARY,
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryView.cs b/src/mscorlib/src/Microsoft/Win32/RegistryView.cs
index 7fbc2b3391..302a603e0c 100644
--- a/src/mscorlib/src/Microsoft/Win32/RegistryView.cs
+++ b/src/mscorlib/src/Microsoft/Win32/RegistryView.cs
@@ -11,7 +11,7 @@
namespace Microsoft.Win32 {
using System;
- public enum RegistryView {
+ internal enum RegistryView {
Default = 0, // 0x0000 operate on the default registry view
Registry64 = Win32Native.KEY_WOW64_64KEY, // 0x0100 operate on the 64-bit registry view
Registry32 = Win32Native.KEY_WOW64_32KEY, // 0x0200 operate on the 32-bit registry view
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFileMappingHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFileMappingHandle.cs
deleted file mode 100644
index cb915fe7c3..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFileMappingHandle.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** A wrapper for file handles
-**
-**
-===========================================================*/
-using System;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-using System.Runtime.Versioning;
-
-namespace Microsoft.Win32.SafeHandles
-{
- internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid
- {
- internal SafeFileMappingHandle() : base(true) {}
-
- // 0 is an Invalid Handle
- internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle)
- {
- SetHandle(handle);
- }
-
- override protected bool ReleaseHandle()
- {
- return Win32Native.CloseHandle(handle);
- }
- }
-}
-
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLocalAllocHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLocalAllocHandle.cs
deleted file mode 100644
index d6c1577eeb..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLocalAllocHandle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace Microsoft.Win32.SafeHandles
-{
- using System;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Runtime.ConstrainedExecution;
-
- internal sealed class SafeLocalAllocHandle : SafeBuffer {
- private SafeLocalAllocHandle () : base(true) {}
-
- // 0 is an Invalid Handle
- internal SafeLocalAllocHandle (IntPtr handle) : base (true) {
- SetHandle(handle);
- }
-
- internal static SafeLocalAllocHandle InvalidHandle {
- get { return new SafeLocalAllocHandle(IntPtr.Zero); }
- }
-
- override protected bool ReleaseHandle()
- {
- return Win32Native.LocalFree(handle) == IntPtr.Zero;
- }
- }
-}
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
index 4f96b81e72..ad8918825e 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
@@ -17,7 +17,7 @@ namespace Microsoft.Win32.SafeHandles {
using System.Runtime.ConstrainedExecution;
using System.Runtime.Versioning;
- public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid {
+ internal sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid {
internal SafeRegistryHandle() : base(true) {}
public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) {
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeViewOfFileHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeViewOfFileHandle.cs
deleted file mode 100644
index 38a9323c0b..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeViewOfFileHandle.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** A wrapper for file handles
-**
-**
-===========================================================*/
-using System;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-using System.Runtime.Versioning;
-using Microsoft.Win32;
-using Microsoft.Win32.SafeHandles;
-
-namespace Microsoft.Win32.SafeHandles
-{
- internal sealed class SafeViewOfFileHandle : SafeHandleZeroOrMinusOneIsInvalid
- {
- internal SafeViewOfFileHandle() : base(true) {}
-
- // 0 is an Invalid Handle
- internal SafeViewOfFileHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) {
- SetHandle(handle);
- }
-
- override protected bool ReleaseHandle()
- {
- if (Win32Native.UnmapViewOfFile(handle))
- {
- handle = IntPtr.Zero;
- return true;
- }
-
- return false;
- }
- }
-}
-
diff --git a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
index 19d638d61a..a9b07086ba 100644
--- a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
+++ b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
@@ -120,19 +120,6 @@ namespace Microsoft.Win32 {
[DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventUnregister", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
internal static extern uint EventUnregister([In] long registrationHandle);
- //
- // Writing (Publishing/Logging) APIs
- //
- //
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
- [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventWrite", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
- internal static extern unsafe int EventWrite(
- [In] long registrationHandle,
- [In] ref EventDescriptor eventDescriptor,
- [In] int userDataCount,
- [In] EventProvider.EventData* userData
- );
-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
[DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventWriteString", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
internal static extern unsafe int EventWriteString(
diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
index 4b459e3b53..06bf82a4d0 100644
--- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
+++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
@@ -380,20 +380,6 @@ namespace Microsoft.Win32 {
}
[StructLayout(LayoutKind.Sequential)]
- internal struct SYSTEM_INFO {
- internal int dwOemId; // This is a union of a DWORD and a struct containing 2 WORDs.
- internal int dwPageSize;
- internal IntPtr lpMinimumApplicationAddress;
- internal IntPtr lpMaximumApplicationAddress;
- internal IntPtr dwActiveProcessorMask;
- internal int dwNumberOfProcessors;
- internal int dwProcessorType;
- internal int dwAllocationGranularity;
- internal short wProcessorLevel;
- internal short wProcessorRevision;
- }
-
- [StructLayout(LayoutKind.Sequential)]
internal class SECURITY_ATTRIBUTES {
internal int nLength = 0;
// don't remove null, or this field will disappear in bcl.small
@@ -429,206 +415,6 @@ namespace Microsoft.Win32 {
}
[StructLayout(LayoutKind.Sequential)]
- internal struct FILE_TIME {
- public FILE_TIME(long fileTime) {
- ftTimeLow = (uint) fileTime;
- ftTimeHigh = (uint) (fileTime >> 32);
- }
-
- public long ToTicks() {
- return ((long) ftTimeHigh << 32) + ftTimeLow;
- }
-
- internal uint ftTimeLow;
- internal uint ftTimeHigh;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct KERB_S4U_LOGON {
- internal uint MessageType;
- internal uint Flags;
- internal UNICODE_INTPTR_STRING ClientUpn; // REQUIRED: UPN for client
- internal UNICODE_INTPTR_STRING ClientRealm; // Optional: Client Realm, if known
- }
-
- [StructLayoutAttribute(LayoutKind.Sequential)]
- internal struct LSA_OBJECT_ATTRIBUTES {
- internal int Length;
- internal IntPtr RootDirectory;
- internal IntPtr ObjectName;
- internal int Attributes;
- internal IntPtr SecurityDescriptor;
- internal IntPtr SecurityQualityOfService;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct UNICODE_STRING {
- internal ushort Length;
- internal ushort MaximumLength;
- [MarshalAs(UnmanagedType.LPWStr)] internal string Buffer;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct UNICODE_INTPTR_STRING {
- /// <remarks>
- /// Note - this constructor extracts the raw pointer from the safe handle, so any
- /// strings created with this version of the constructor will be unsafe to use after the buffer
- /// has been freed.
- /// </remarks>
- internal UNICODE_INTPTR_STRING (int stringBytes, SafeLocalAllocHandle buffer) {
- BCLDebug.Assert(buffer == null || (stringBytes >= 0 && (ulong)stringBytes <= buffer.ByteLength),
- "buffer == null || (stringBytes >= 0 && stringBytes <= buffer.ByteLength)");
-
- this.Length = (ushort) stringBytes;
- this.MaxLength = (ushort) buffer.ByteLength;
-
- // Marshaling with a SafePointer does not work correctly, so unfortunately we need to extract
- // the raw handle here.
- this.Buffer = buffer.DangerousGetHandle();
- }
-
- /// <remarks>
- /// This constructor should be used for constructing UNICODE_STRING structures with pointers
- /// into a block of memory managed by a SafeHandle or the GC. It shouldn't be used to own
- /// any memory on its own.
- /// </remarks>
- internal UNICODE_INTPTR_STRING(int stringBytes, IntPtr buffer) {
- BCLDebug.Assert((stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero),
- "(stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero)");
-
- this.Length = (ushort)stringBytes;
- this.MaxLength = (ushort)stringBytes;
- this.Buffer = buffer;
- }
-
- internal ushort Length;
- internal ushort MaxLength;
- internal IntPtr Buffer;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct LSA_TRANSLATED_NAME {
- internal int Use;
- internal UNICODE_INTPTR_STRING Name;
- internal int DomainIndex;
- }
-
- [StructLayoutAttribute(LayoutKind.Sequential)]
- internal struct LSA_TRANSLATED_SID {
- internal int Use;
- internal uint Rid;
- internal int DomainIndex;
- }
-
- [StructLayoutAttribute(LayoutKind.Sequential)]
- internal struct LSA_TRANSLATED_SID2 {
- internal int Use;
- internal IntPtr Sid;
- internal int DomainIndex;
- uint Flags;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct LSA_TRUST_INFORMATION {
- internal UNICODE_INTPTR_STRING Name;
- internal IntPtr Sid;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- internal struct LSA_REFERENCED_DOMAIN_LIST {
- internal int Entries;
- internal IntPtr Domains;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct LUID {
- internal uint LowPart;
- internal uint HighPart;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct LUID_AND_ATTRIBUTES {
- internal LUID Luid;
- internal uint Attributes;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct QUOTA_LIMITS {
- internal IntPtr PagedPoolLimit;
- internal IntPtr NonPagedPoolLimit;
- internal IntPtr MinimumWorkingSetSize;
- internal IntPtr MaximumWorkingSetSize;
- internal IntPtr PagefileLimit;
- internal IntPtr TimeLimit;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct SECURITY_LOGON_SESSION_DATA {
- internal uint Size;
- internal LUID LogonId;
- internal UNICODE_INTPTR_STRING UserName;
- internal UNICODE_INTPTR_STRING LogonDomain;
- internal UNICODE_INTPTR_STRING AuthenticationPackage;
- internal uint LogonType;
- internal uint Session;
- internal IntPtr Sid;
- internal long LogonTime;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct SID_AND_ATTRIBUTES {
- internal IntPtr Sid;
- internal uint Attributes;
- internal static readonly long SizeOf = (long)Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct TOKEN_GROUPS {
- internal uint GroupCount;
- internal SID_AND_ATTRIBUTES Groups; // SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- internal struct TOKEN_PRIMARY_GROUP
- {
- internal IntPtr PrimaryGroup;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct TOKEN_PRIVILEGE {
- internal uint PrivilegeCount;
- internal LUID_AND_ATTRIBUTES Privilege;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct TOKEN_SOURCE {
- private const int TOKEN_SOURCE_LENGTH = 8;
-
- [MarshalAs(UnmanagedType.ByValArray, SizeConst=TOKEN_SOURCE_LENGTH)]
- internal char[] Name;
- internal LUID SourceIdentifier;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct TOKEN_STATISTICS {
- internal LUID TokenId;
- internal LUID AuthenticationId;
- internal long ExpirationTime;
- internal uint TokenType;
- internal uint ImpersonationLevel;
- internal uint DynamicCharged;
- internal uint DynamicAvailable;
- internal uint GroupCount;
- internal uint PrivilegeCount;
- internal LUID ModifiedId;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- internal struct TOKEN_USER {
- internal SID_AND_ATTRIBUTES User;
- }
-
- [StructLayout(LayoutKind.Sequential)]
internal struct MEMORYSTATUSEX {
// The length field must be set to the size of this data structure.
internal int length;
@@ -676,9 +462,6 @@ namespace Microsoft.Win32 {
// From WinBase.h
internal const int SEM_FAILCRITICALERRORS = 1;
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern void GetSystemInfo(ref SYSTEM_INFO lpSystemInfo);
-
[DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=true)]
internal static extern int FormatMessage(int dwFlags, IntPtr lpSource,
int dwMessageId, int dwLanguageId, [Out]StringBuilder lpBuffer,
@@ -704,12 +487,6 @@ namespace Microsoft.Win32 {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static extern IntPtr LocalAlloc_NoSafeHandle(int uFlags, UIntPtr sizetdwBytes);
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true)]
- internal static extern
- SafeLocalAllocHandle LocalAlloc(
- [In] int uFlags,
- [In] UIntPtr sizetdwBytes);
-
[DllImport(KERNEL32, SetLastError=true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
internal static extern IntPtr LocalFree(IntPtr handle);
@@ -742,45 +519,6 @@ namespace Microsoft.Win32 {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
unsafe internal static extern bool VirtualFree(void* address, UIntPtr numBytes, int pageFreeMode);
-
-
- // Note - do NOT use this to call methods. Use P/Invoke, which will
- // do much better things w.r.t. marshaling, pinning memory, security
- // stuff, better interactions with thread aborts, etc. This is used
- // solely by DoesWin32MethodExist for avoiding try/catch EntryPointNotFoundException
- // in scenarios where an OS Version check is insufficient
- [DllImport(KERNEL32, CharSet=CharSet.Ansi, BestFitMapping=false, SetLastError=true, ExactSpelling=true)]
- private static extern IntPtr GetProcAddress(IntPtr hModule, String methodName);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=false, SetLastError=true)]
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- private static extern IntPtr GetModuleHandle(String moduleName);
-
- internal static bool DoesWin32MethodExist(String moduleName, String methodName)
- {
- // GetModuleHandle does not increment the module's ref count, so we don't need to call FreeLibrary.
- IntPtr hModule = Win32Native.GetModuleHandle(moduleName);
- if (hModule == IntPtr.Zero) {
- BCLDebug.Assert(hModule != IntPtr.Zero, "GetModuleHandle failed. Dll isn't loaded?");
- return false;
- }
- IntPtr functionPointer = Win32Native.GetProcAddress(hModule, methodName);
- return (functionPointer != IntPtr.Zero);
- }
-
- // There is no need to call CloseProcess or to use a SafeHandle if you get the handle
- // using GetCurrentProcess as it returns a pseudohandle
- [DllImport(KERNEL32, SetLastError = true, CallingConvention = CallingConvention.Winapi)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool IsWow64Process(
- [In]
- IntPtr hSourceProcessHandle,
- [Out, MarshalAs(UnmanagedType.Bool)]
- out bool isWow64);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern uint GetTempPath(int bufferLen, [Out]StringBuilder buffer);
-
[DllImport(KERNEL32, CharSet=CharSet.Ansi, ExactSpelling=true, EntryPoint="lstrlenA")]
internal static extern int lstrlenA(IntPtr ptr);
@@ -807,10 +545,8 @@ namespace Microsoft.Win32 {
[DllImport(Win32Native.OLEAUT32)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
internal static extern uint SysStringByteLen(IntPtr bstr);
-#endif
- [DllImport(KERNEL32)]
- internal static extern int GetACP();
+#endif
[DllImport(KERNEL32, SetLastError=true)]
internal static extern bool SetEvent(SafeWaitHandle handle);
@@ -835,119 +571,13 @@ namespace Microsoft.Win32 {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal static extern bool ReleaseMutex(SafeWaitHandle handle);
- [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
- internal unsafe static extern int GetFullPathName(char* path, int numBufferChars, char* buffer, IntPtr mustBeZero);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal unsafe static extern int GetFullPathName(String path, int numBufferChars, [Out]StringBuilder buffer, IntPtr mustBeZero);
-
- [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
- internal unsafe static extern int GetLongPathName(char* path, char* longPathBuffer, int bufferLength);
-
- [DllImport(KERNEL32, SetLastError = true, ExactSpelling = true)]
- internal unsafe static extern uint GetFullPathNameW(char* path, uint numBufferChars, SafeHandle buffer, IntPtr mustBeZero);
-
- [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
- internal static extern int GetLongPathName(String path, [Out]StringBuilder longPathBuffer, int bufferLength);
-
- [DllImport(KERNEL32, SetLastError = true, ExactSpelling = true)]
- internal static extern uint GetLongPathNameW(SafeHandle lpszShortPath, SafeHandle lpszLongPath, uint cchBuffer);
-
- [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)]
- internal static extern uint GetLongPathNameW(string lpszShortPath, SafeHandle lpszLongPath, uint cchBuffer);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern SafeFileMappingHandle CreateFileMapping(SafeFileHandle hFile, IntPtr lpAttributes, uint fProtect, uint dwMaximumSizeHigh, uint dwMaximumSizeLow, String lpName);
-
- [DllImport(KERNEL32, SetLastError=true, ExactSpelling=true)]
- internal static extern IntPtr MapViewOfFile(
- SafeFileMappingHandle handle, uint dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, UIntPtr dwNumerOfBytesToMap);
-
- [DllImport(KERNEL32, ExactSpelling=true)]
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- internal static extern bool UnmapViewOfFile(IntPtr lpBaseAddress );
-
[DllImport(KERNEL32, SetLastError=true)]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
internal static extern bool CloseHandle(IntPtr handle);
- [DllImport(KERNEL32)]
- internal static extern int GetFileType(SafeFileHandle handle);
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern bool SetEndOfFile(SafeFileHandle hFile);
-
- [DllImport(KERNEL32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool FlushFileBuffers(SafeFileHandle hFile);
-
- [DllImport(KERNEL32, SetLastError=true, EntryPoint="SetFilePointer")]
- private unsafe static extern int SetFilePointerWin32(SafeFileHandle handle, int lo, int * hi, int origin);
-
- internal unsafe static long SetFilePointer(SafeFileHandle handle, long offset, System.IO.SeekOrigin origin, out int hr) {
- hr = 0;
- int lo = (int) offset;
- int hi = (int) (offset >> 32);
- lo = SetFilePointerWin32(handle, lo, &hi, (int) origin);
-
- if (lo == -1 && ((hr = Marshal.GetLastWin32Error()) != 0))
- return -1;
- return (long) (((ulong) ((uint) hi)) << 32) | ((uint) lo);
- }
-
- // Note there are two different ReadFile prototypes - this is to use
- // the type system to force you to not trip across a "feature" in
- // Win32's async IO support. You can't do the following three things
- // simultaneously: overlapped IO, free the memory for the overlapped
- // struct in a callback (or an EndRead method called by that callback),
- // and pass in an address for the numBytesRead parameter.
-
- [DllImport(KERNEL32, SetLastError=true)]
- unsafe internal static extern int ReadFile(SafeFileHandle handle, byte* bytes, int numBytesToRead, IntPtr numBytesRead_mustBeZero, NativeOverlapped* overlapped);
-
- [DllImport(KERNEL32, SetLastError=true)]
- unsafe internal static extern int ReadFile(SafeFileHandle handle, byte* bytes, int numBytesToRead, out int numBytesRead, IntPtr mustBeZero);
-
- // Note there are two different WriteFile prototypes - this is to use
- // the type system to force you to not trip across a "feature" in
- // Win32's async IO support. You can't do the following three things
- // simultaneously: overlapped IO, free the memory for the overlapped
- // struct in a callback (or an EndWrite method called by that callback),
- // and pass in an address for the numBytesRead parameter.
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static unsafe extern int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped);
-
[DllImport(KERNEL32, SetLastError=true)]
internal static unsafe extern int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero);
- // This is only available on Vista or higher
- [DllImport(KERNEL32, SetLastError=true)]
- internal static unsafe extern bool CancelIoEx(SafeFileHandle handle, NativeOverlapped* lpOverlapped);
-
- // NOTE: The out parameters are PULARGE_INTEGERs and may require
- // some byte munging magic.
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern bool GetDiskFreeSpaceEx(String drive, out long freeBytesForUser, out long totalBytes, out long freeBytes);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern int GetDriveType(String drive);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern bool GetVolumeInformation(String drive, [Out]StringBuilder volumeName, int volumeNameBufLen, out int volSerialNumber, out int maxFileNameLen, out int fileSystemFlags, [Out]StringBuilder fileSystemName, int fileSystemNameBufLen);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern bool SetVolumeLabel(String driveLetter, String volumeName);
-
- // The following 4 methods are used by Microsoft.WlcProfile
- [DllImport(KERNEL32)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool QueryPerformanceCounter(out long value);
-
- [DllImport(KERNEL32)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool QueryPerformanceFrequency(out long value);
-
[DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern SafeWaitHandle CreateSemaphore(SECURITY_ATTRIBUTES lpSecurityAttributes, int initialCount, int maximumCount, String name);
@@ -976,24 +606,8 @@ namespace Microsoft.Win32 {
}
[DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern int GetWindowsDirectory([Out]StringBuilder sb, int length);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
internal static extern int GetSystemDirectory([Out]StringBuilder sb, int length);
- [DllImport(KERNEL32, SetLastError=true)]
- internal unsafe static extern bool SetFileTime(SafeFileHandle hFile, FILE_TIME* creationTime,
- FILE_TIME* lastAccessTime, FILE_TIME* lastWriteTime);
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern int GetFileSize(SafeFileHandle hFile, out int highSize);
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh);
-
internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // WinBase.h
// Note, these are #defines used to extract handles, and are NOT handles.
@@ -1142,36 +756,6 @@ namespace Microsoft.Win32 {
}
[DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- private static extern bool CopyFileEx(String src,
- String dst,
- IntPtr progressRoutine,
- IntPtr progressData,
- ref uint cancel,
- uint flags);
-
- internal static bool CopyFile(String src, String dst, bool failIfExists)
- {
- uint cancel = 0;
- return CopyFileEx(src, dst, IntPtr.Zero, IntPtr.Zero, ref cancel, failIfExists ? 1U : 0U);
- }
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool CreateDirectory(
- String path, SECURITY_ATTRIBUTES lpSecurityAttributes);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool DeleteFile(String path);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool ReplaceFile(String replacedFileName, String replacementFileName, String backupFileName, int dwReplaceFlags, IntPtr lpExclude, IntPtr lpReserved);
-
- [DllImport(ADVAPI32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool DecryptFile(String path, int reservedMustBeZero);
-
- [DllImport(ADVAPI32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool EncryptFile(String path);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern SafeFindHandle FindFirstFile(String fileName, [In, Out] Win32Native.WIN32_FIND_DATA data);
[DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
@@ -1184,11 +768,6 @@ namespace Microsoft.Win32 {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
internal static extern bool FindClose(IntPtr handle);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int GetCurrentDirectory(
- int nBufferLength,
- [Out]StringBuilder lpBuffer);
-
[DllImport(KERNEL32, SetLastError = true, ExactSpelling = true)]
internal static extern uint GetCurrentDirectoryW(uint nBufferLength, char[] lpBuffer);
@@ -1196,37 +775,11 @@ namespace Microsoft.Win32 {
internal static extern bool GetFileAttributesEx(String name, int fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation);
[DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool SetFileAttributes(String name, int attr);
-
- [DllImport(KERNEL32, SetLastError=true)]
- internal static extern int GetLogicalDrives();
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern uint GetTempFileName(String tmpPath, String prefix, uint uniqueIdOrZero, [Out]StringBuilder tmpFileName);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- private static extern bool MoveFileEx(String src, String dst, uint flags);
-
- internal static bool MoveFile(String src, String dst)
- {
- return MoveFileEx(src, dst, 2 /* MOVEFILE_COPY_ALLOWED */);
- }
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool DeleteVolumeMountPoint(String mountPoint);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern bool RemoveDirectory(String path);
-
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern bool SetCurrentDirectory(String path);
[DllImport(KERNEL32, SetLastError=false, EntryPoint="SetErrorMode", ExactSpelling=true)]
private static extern int SetErrorMode_VistaAndOlder(int newMode);
- [DllImport(KERNEL32, SetLastError=true, EntryPoint="SetThreadErrorMode")]
- private static extern bool SetErrorMode_Win7AndNewer(int newMode, out int oldMode);
-
// RTM versions of Win7 and Windows Server 2008 R2
private static readonly Version ThreadErrorModeMinOsVersion = new Version(6, 1, 7600);
@@ -1241,13 +794,6 @@ namespace Microsoft.Win32 {
[DllImport(KERNEL32)]
internal static extern unsafe int WideCharToMultiByte(uint cp, uint flags, char* pwzSource, int cchSource, byte* pbDestBuffer, int cbDestBuffer, IntPtr null1, IntPtr null2);
- // A Win32 HandlerRoutine
- internal delegate bool ConsoleCtrlHandlerRoutine(int controlType);
-
- [DllImport(KERNEL32, SetLastError=true)]
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- internal static extern bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, bool addOrRemove);
-
[DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
internal static extern bool SetEnvironmentVariable(string lpName, string lpValue);
@@ -1263,9 +809,6 @@ namespace Microsoft.Win32 {
[DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true)]
internal static extern uint GetCurrentProcessId();
- [DllImport(ADVAPI32, CharSet=CharSet.Auto)]
- internal static extern bool GetUserName([Out]StringBuilder lpBuffer, ref int nSize);
-
[DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=false)]
internal extern static int GetComputerName([Out]StringBuilder nameBuffer, ref int bufferSize);
@@ -1282,24 +825,6 @@ namespace Microsoft.Win32 {
internal static extern IntPtr CoTaskMemRealloc(IntPtr pv, UIntPtr cb);
#if FEATURE_WIN32_REGISTRY
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegConnectRegistry(String machineName,
- SafeRegistryHandle key, out SafeRegistryHandle result);
-
- // Note: RegCreateKeyEx won't set the last error on failure - it returns
- // an error code if it fails.
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegCreateKeyEx(SafeRegistryHandle hKey, String lpSubKey,
- int Reserved, String lpClass, int dwOptions,
- int samDesired, SECURITY_ATTRIBUTES lpSecurityAttributes,
- out SafeRegistryHandle hkResult, out int lpdwDisposition);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegDeleteKey(SafeRegistryHandle hKey, String lpSubKey);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegDeleteKeyEx(SafeRegistryHandle hKey, String lpSubKey,
- int samDesired, int Reserved);
[DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern int RegDeleteValue(SafeRegistryHandle hKey, String lpValueName);
@@ -1316,17 +841,9 @@ namespace Microsoft.Win32 {
IntPtr lpReserved_MustBeZero, int[] lpType, byte[] lpData,
int[] lpcbData);
-
- [DllImport(ADVAPI32)]
- internal static extern int RegFlushKey(SafeRegistryHandle hKey);
-
[DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern int RegOpenKeyEx(SafeRegistryHandle hKey, String lpSubKey,
int ulOptions, int samDesired, out SafeRegistryHandle hkResult);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegOpenKeyEx(IntPtr hKey, String lpSubKey,
- int ulOptions, int samDesired, out SafeRegistryHandle hkResult);
[DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern int RegQueryInfoKey(SafeRegistryHandle hKey, [Out]StringBuilder lpClass,
@@ -1357,11 +874,6 @@ namespace Microsoft.Win32 {
ref int lpcbData);
[DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int RegQueryValueEx(SafeRegistryHandle hKey, String lpValueName,
- int[] lpReserved, ref int lpType, [Out]StringBuilder lpData,
- ref int lpcbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
internal static extern int RegSetValueEx(SafeRegistryHandle hKey, String lpValueName,
int Reserved, RegistryValueKind dwType, byte[] lpData, int cbData);
@@ -1440,47 +952,11 @@ namespace Microsoft.Win32 {
internal const int CSIDL_MYMUSIC = 0x000d;
internal const int CSIDL_MYPICTURES = 0x0027;
- [DllImport(SHELL32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken, int dwFlags, [Out]StringBuilder lpszPath);
-
internal const int NameSamCompatible = 2;
-
- [DllImport(SECUR32, CharSet=CharSet.Unicode, SetLastError=true)]
- // Win32 return type is BOOLEAN (which is 1 byte and not BOOL which is 4bytes)
- internal static extern byte GetUserNameEx(int format, [Out]StringBuilder domainName, ref uint domainNameLen);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
- internal static extern bool LookupAccountName(string machineName, string accountName, byte[] sid,
- ref int sidLen, [Out]StringBuilder domainName, ref uint domainNameLen, out int peUse);
[DllImport(USER32, SetLastError=true, BestFitMapping=false)]
internal static extern IntPtr SendMessageTimeout(IntPtr hWnd, int Msg, IntPtr wParam, String lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true)]
- internal static extern IntPtr GetCurrentProcess();
-
- [DllImport(KERNEL32, CharSet=CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurityAttribute()]
- internal unsafe static extern int WideCharToMultiByte(
- int CodePage,
- UInt32 dwFlags,
- char* lpWideCharStr,
- int cchWideChar,
- byte* lpMultiByteStr,
- int cchMultiByte,
- char* lpDefaultChar,
- bool* lpUsedDefaultChar);
-
- [DllImport(KERNEL32, CharSet=CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurityAttribute()]
- internal unsafe static extern int MultiByteToWideChar(
- int CodePage,
- UInt32 dwFlags,
- byte* lpMultiByteStr,
- int cchMultiByte,
- char* lpWideCharStr,
- int cchWideChar);
-
[DllImport(KERNEL32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal extern static bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime);
@@ -1491,25 +967,6 @@ namespace Microsoft.Win32 {
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] buffer, int length);
#else
private const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002;
-
- [DllImport("BCrypt.dll", CharSet = CharSet.Unicode)]
- private static extern uint BCryptGenRandom(IntPtr hAlgorithm, [In, Out] byte[] pbBuffer, int cbBuffer, int dwFlags);
-
- internal static void Random(bool bStrong, byte[] buffer, int length)
- {
- uint status = BCryptGenRandom(IntPtr.Zero, buffer, length, BCRYPT_USE_SYSTEM_PREFERRED_RNG);
- if (status != STATUS_SUCCESS)
- {
- if (status == STATUS_NO_MEMORY)
- {
- throw new OutOfMemoryException();
- }
- else
- {
- throw new InvalidOperationException();
- }
- }
- }
#endif
}
}
diff --git a/src/mscorlib/src/System/Activator.cs b/src/mscorlib/src/System/Activator.cs
index 769e4cbd36..67f525b01b 100644
--- a/src/mscorlib/src/System/Activator.cs
+++ b/src/mscorlib/src/System/Activator.cs
@@ -206,31 +206,6 @@ namespace System {
null,
activationAttributes);
}
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- static public ObjectHandle CreateInstance(String assemblyName,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityInfo)
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return CreateInstance(assemblyName,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- securityInfo,
- ref stackMark);
- }
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static ObjectHandle CreateInstance(string assemblyName,
@@ -311,29 +286,6 @@ namespace System {
}
}
- [Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- static public ObjectHandle CreateInstanceFrom(String assemblyFile,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityInfo)
-
- {
- return CreateInstanceFromInternal(assemblyFile,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- securityInfo);
- }
-
public static ObjectHandle CreateInstanceFrom(string assemblyFile,
string typeName,
bool ignoreCase,
@@ -385,120 +337,6 @@ namespace System {
}
}
- //
- // This API is designed to be used when a host needs to execute code in an AppDomain
- // with restricted security permissions. In that case, we demand in the client domain
- // and assert in the server domain because the server domain might not be trusted enough
- // to pass the security checks when activating the type.
- //
-
- public static ObjectHandle CreateInstance (AppDomain domain, string assemblyName, string typeName) {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
- return domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName);
- }
-
- [Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public static ObjectHandle CreateInstance (AppDomain domain,
- string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes) {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
-
- return domain.InternalCreateInstanceWithNoSecurity(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
- }
-
- public static ObjectHandle CreateInstance(AppDomain domain,
- string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes)
- {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
-
- return domain.InternalCreateInstanceWithNoSecurity(assemblyName,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- null);
- }
-
- //
- // This API is designed to be used when a host needs to execute code in an AppDomain
- // with restricted security permissions. In that case, we demand in the client domain
- // and assert in the server domain because the server domain might not be trusted enough
- // to pass the security checks when activating the type.
- //
-
- public static ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName) {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
- return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile, typeName);
- }
-
- [Obsolete("Methods which use Evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public static ObjectHandle CreateInstanceFrom (AppDomain domain,
- string assemblyFile,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes) {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
-
- return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
- }
-
- public static ObjectHandle CreateInstanceFrom(AppDomain domain,
- string assemblyFile,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes)
- {
- if (domain == null)
- throw new ArgumentNullException(nameof(domain));
- Contract.EndContractBlock();
-
- return domain.InternalCreateInstanceFromWithNoSecurity(assemblyFile,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- null);
- }
-
public static ObjectHandle CreateComInstanceFrom(String assemblyName,
String typeName)
{
diff --git a/src/mscorlib/src/System/AppContext/AppContext.cs b/src/mscorlib/src/System/AppContext/AppContext.cs
index e318f93b89..5a3b732fa8 100644
--- a/src/mscorlib/src/System/AppContext/AppContext.cs
+++ b/src/mscorlib/src/System/AppContext/AppContext.cs
@@ -84,7 +84,7 @@ namespace System
}
public static event System.EventHandler ProcessExit;
- public static event System.EventHandler Unloading;
+ internal static event System.EventHandler Unloading;
private static void OnProcessExit(object sender, EventArgs e)
{
diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs
index 3aeb465e4f..b7506cd632 100644
--- a/src/mscorlib/src/System/AppDomain.cs
+++ b/src/mscorlib/src/System/AppDomain.cs
@@ -98,7 +98,7 @@ namespace System
[Serializable]
[ComVisible(true)]
- public delegate void AppDomainInitializer(string[] args);
+ internal delegate void AppDomainInitializer(string[] args);
internal class AppDomainInitializerInfo
{
@@ -175,8 +175,7 @@ namespace System
}
}
-
- public sealed class AppDomain : IEvidenceFactory
+ internal sealed class AppDomain
{
// Domain security information
// These fields initialized from the other side only. (NOTE: order
@@ -733,121 +732,6 @@ namespace System
typeName);
}
- internal ObjectHandle InternalCreateInstanceWithNoSecurity (string assemblyName, string typeName) {
- PermissionSet.s_fullTrust.Assert();
- return CreateInstance(assemblyName, typeName);
- }
-
- public ObjectHandle CreateInstanceFrom(String assemblyFile,
- String typeName)
-
- {
- // jit does not check for that, so we should do it ...
- if (this == null)
- throw new NullReferenceException();
- Contract.EndContractBlock();
-
- return Activator.CreateInstanceFrom(assemblyFile,
- typeName);
- }
-
- internal ObjectHandle InternalCreateInstanceFromWithNoSecurity (string assemblyName, string typeName) {
- PermissionSet.s_fullTrust.Assert();
- return CreateInstanceFrom(assemblyName, typeName);
- }
-
- [Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstance which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public ObjectHandle CreateInstance(String assemblyName,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes)
- {
- // jit does not check for that, so we should do it ...
- if (this == null)
- throw new NullReferenceException();
-
- if (assemblyName == null)
- throw new ArgumentNullException(nameof(assemblyName));
- Contract.EndContractBlock();
-
-#pragma warning disable 618
- return Activator.CreateInstance(assemblyName,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- securityAttributes);
-#pragma warning restore 618
- }
-
- internal ObjectHandle InternalCreateInstanceWithNoSecurity (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes)
- {
- PermissionSet.s_fullTrust.Assert();
-#pragma warning disable 618
- return CreateInstance(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
-#pragma warning restore 618
- }
-
- [Obsolete("Methods which use evidence to sandbox are obsolete and will be removed in a future release of the .NET Framework. Please use an overload of CreateInstanceFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public ObjectHandle CreateInstanceFrom(String assemblyFile,
- String typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes)
-
- {
- // jit does not check for that, so we should do it ...
- if (this == null)
- throw new NullReferenceException();
- Contract.EndContractBlock();
-
- return Activator.CreateInstanceFrom(assemblyFile,
- typeName,
- ignoreCase,
- bindingAttr,
- binder,
- args,
- culture,
- activationAttributes,
- securityAttributes);
- }
-
- internal ObjectHandle InternalCreateInstanceFromWithNoSecurity (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- Object[] args,
- CultureInfo culture,
- Object[] activationAttributes,
- Evidence securityAttributes)
- {
- PermissionSet.s_fullTrust.Assert();
-#pragma warning disable 618
- return CreateInstanceFrom(assemblyName, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes, securityAttributes);
-#pragma warning restore 618
- }
-
public static AppDomain CurrentDomain
{
get {
diff --git a/src/mscorlib/src/System/AppDomainAttributes.cs b/src/mscorlib/src/System/AppDomainAttributes.cs
index 0980b5fe90..05d2984108 100644
--- a/src/mscorlib/src/System/AppDomainAttributes.cs
+++ b/src/mscorlib/src/System/AppDomainAttributes.cs
@@ -15,7 +15,7 @@ namespace System {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum LoaderOptimization
+ internal enum LoaderOptimization
{
NotSpecified = 0,
SingleDomain = 1,
@@ -26,23 +26,5 @@ namespace System {
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
DisallowBindings = 4
}
-
- [AttributeUsage (AttributeTargets.Method)]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class LoaderOptimizationAttribute : Attribute
- {
- internal byte _val;
-
- public LoaderOptimizationAttribute(byte value)
- {
- _val = value;
- }
- public LoaderOptimizationAttribute(LoaderOptimization value)
- {
- _val = (byte) value;
- }
- public LoaderOptimization Value
- { get {return (LoaderOptimization) _val;} }
- }
}
diff --git a/src/mscorlib/src/System/AppDomainManager.cs b/src/mscorlib/src/System/AppDomainManager.cs
index 71bc088d1d..13e12bf32e 100644
--- a/src/mscorlib/src/System/AppDomainManager.cs
+++ b/src/mscorlib/src/System/AppDomainManager.cs
@@ -16,7 +16,7 @@ namespace System
using System.Runtime.InteropServices;
[System.Runtime.InteropServices.ComVisible(true)]
- public class AppDomainManager : MarshalByRefObject
+ internal class AppDomainManager : MarshalByRefObject
{
public AppDomainManager () {}
diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs
index f3e6f79663..eb4894e8bd 100644
--- a/src/mscorlib/src/System/AppDomainSetup.cs
+++ b/src/mscorlib/src/System/AppDomainSetup.cs
@@ -28,7 +28,7 @@ namespace System
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class AppDomainSetup
+ internal sealed class AppDomainSetup
{
[Serializable]
internal enum LoaderInformation
@@ -54,7 +54,7 @@ namespace System
ConfigurationBytesValue = 15, // LOADER_CONFIGURATION_BYTES
LoaderMaximum = 18 // LOADER_MAXIMUM
}
-
+
// Constants from fusionsetup.h.
private const string LOADER_OPTIMIZATION = "LOADER_OPTIMIZATION";
private const string CONFIGURATION_EXTENSION = ".config";
diff --git a/src/mscorlib/src/System/AppDomainUnloadedException.cs b/src/mscorlib/src/System/AppDomainUnloadedException.cs
index 8ba37dc4c5..9a0abb8104 100644
--- a/src/mscorlib/src/System/AppDomainUnloadedException.cs
+++ b/src/mscorlib/src/System/AppDomainUnloadedException.cs
@@ -17,21 +17,11 @@ namespace System {
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class AppDomainUnloadedException : SystemException {
+ internal class AppDomainUnloadedException : SystemException {
public AppDomainUnloadedException()
: base(Environment.GetResourceString("Arg_AppDomainUnloadedException")) {
SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED);
}
-
- public AppDomainUnloadedException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED);
- }
-
- public AppDomainUnloadedException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED);
- }
//
//This constructor is required for serialization.
diff --git a/src/mscorlib/src/System/ApplicationId.cs b/src/mscorlib/src/System/ApplicationId.cs
deleted file mode 100644
index 93fc37dd99..0000000000
--- a/src/mscorlib/src/System/ApplicationId.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-//
-//
-// This class identifies a deployment or manifest identity.
-//
-
-namespace System {
- using System.Reflection;
- using System.Security;
- using System.Security.Policy;
- using System.Security.Util;
- using System.Text;
- using System.Diagnostics.Contracts;
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class ApplicationId {
- private string m_name;
- private Version m_version;
- private string m_processorArchitecture;
- private string m_culture;
- internal byte[] m_publicKeyToken;
-
- internal ApplicationId () {}
-
- //
- // Public.
- //
-
- public ApplicationId (byte[] publicKeyToken, string name, Version version, string processorArchitecture, string culture) {
- if (name == null)
- throw new ArgumentNullException(nameof(name));
- if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyApplicationName"));
- if (version == null)
- throw new ArgumentNullException(nameof(version));
- if (publicKeyToken == null)
- throw new ArgumentNullException(nameof(publicKeyToken));
- Contract.EndContractBlock();
-
- m_publicKeyToken = new byte[publicKeyToken.Length];
- Array.Copy(publicKeyToken, 0, m_publicKeyToken, 0, publicKeyToken.Length);
- m_name = name;
- m_version = version;
- m_processorArchitecture = processorArchitecture;
- m_culture = culture;
- }
-
- public byte[] PublicKeyToken {
- get {
- byte[] publicKeyToken = new byte[m_publicKeyToken.Length];
- Array.Copy(m_publicKeyToken, 0, publicKeyToken, 0, m_publicKeyToken.Length);
- return publicKeyToken;
- }
- }
-
- public string Name {
- get {
- return m_name;
- }
- }
-
- public Version Version {
- get {
- return m_version;
- }
- }
-
- public string ProcessorArchitecture {
- get {
- return m_processorArchitecture;
- }
- }
-
- public string Culture {
- get {
- return m_culture;
- }
- }
-
- public ApplicationId Copy () {
- return new ApplicationId(m_publicKeyToken, m_name, m_version, m_processorArchitecture, m_culture);
- }
-
- public override string ToString () {
- StringBuilder sb = StringBuilderCache.Acquire();
- sb.Append(this.m_name);
- if (m_culture != null) {
- sb.Append(", culture=\"");
- sb.Append(m_culture);
- sb.Append("\"");
- }
- sb.Append(", version=\"");
- sb.Append(m_version.ToString());
- sb.Append("\"");
- if (m_publicKeyToken != null) {
- sb.Append(", publicKeyToken=\"");
- sb.Append(Hex.EncodeHexString(m_publicKeyToken));
- sb.Append("\"");
- }
- if (m_processorArchitecture != null) {
- sb.Append(", processorArchitecture =\"");
- sb.Append(this.m_processorArchitecture);
- sb.Append("\"");
- }
- return StringBuilderCache.GetStringAndRelease(sb);
- }
-
- public override bool Equals (Object o) {
- ApplicationId other = (o as ApplicationId);
- if (other == null)
- return false;
-
- if (!(Equals(this.m_name, other.m_name) &&
- Equals(this.m_version, other.m_version) &&
- Equals(this.m_processorArchitecture, other.m_processorArchitecture) &&
- Equals(this.m_culture, other.m_culture)))
- return false;
-
- if (this.m_publicKeyToken.Length != other.m_publicKeyToken.Length)
- return false;
-
- for (int i = 0; i < this.m_publicKeyToken.Length; ++i) {
- if (this.m_publicKeyToken[i] != other.m_publicKeyToken[i])
- return false;
- }
-
- return true;
- }
-
- public override int GetHashCode() {
- // Note: purposely skipping publicKeyToken, processor architecture and culture as they
- // are less likely to make things not equal than name and version.
- return m_name.GetHashCode() ^ m_version.GetHashCode();
- }
- }
-}
diff --git a/src/mscorlib/src/System/Array.cs b/src/mscorlib/src/System/Array.cs
index 3b370514c9..3d29270f99 100644
--- a/src/mscorlib/src/System/Array.cs
+++ b/src/mscorlib/src/System/Array.cs
@@ -224,21 +224,6 @@ namespace System {
return CreateInstance(elementType, length);
}
- internal static Array UnsafeCreateInstance(Type elementType, int length1, int length2)
- {
- return CreateInstance(elementType, length1, length2);
- }
-
- internal static Array UnsafeCreateInstance(Type elementType, params int[] lengths)
- {
- return CreateInstance(elementType, lengths);
- }
-
- internal static Array UnsafeCreateInstance(Type elementType, int[] lengths, int[] lowerBounds)
- {
- return CreateInstance(elementType, lengths, lowerBounds);
- }
-
// Copies length elements from sourceArray, starting at index 0, to
// destinationArray, starting at index 0.
//
diff --git a/src/mscorlib/src/System/BCLDebug.cs b/src/mscorlib/src/System/BCLDebug.cs
index 0ca6e616f2..e700f55fa2 100644
--- a/src/mscorlib/src/System/BCLDebug.cs
+++ b/src/mscorlib/src/System/BCLDebug.cs
@@ -54,7 +54,6 @@ namespace System {
#if _DEBUG
internal static volatile bool m_domainUnloadAdded;
#endif
- internal static volatile PermissionSet m_MakeConsoleErrorLoggingWork;
static readonly SwitchStructure[] switches = {
new SwitchStructure("NLS", 0x00000001),
@@ -263,40 +262,6 @@ namespace System {
System.Diagnostics.Log.LogMessage((LoggingLevels)((int)level), logSwitch, StringBuilderCache.GetStringAndRelease(sb));
}
- // Note this overload doesn't take a format string. You probably don't
- // want this one.
- [Pure]
- [Conditional("_LOGGING")]
- public static void Trace(String switchName, params Object[]messages) {
- if (m_loggingNotEnabled) {
- return;
- }
-
- LogSwitch logSwitch;
- if (!CheckEnabled(switchName, LogLevel.Trace, out logSwitch)) {
- return;
- }
-
- StringBuilder sb = StringBuilderCache.Acquire();
-
- for (int i=0; i<messages.Length; i++) {
- String s;
- try {
- if (messages[i]==null) {
- s = "<null>";
- } else {
- s = messages[i].ToString();
- }
- } catch {
- s = "<unable to convert>";
- }
- sb.Append(s);
- }
-
- sb.Append(Environment.NewLine);
- System.Diagnostics.Log.LogMessage(LoggingLevels.TraceLevel0, logSwitch, StringBuilderCache.GetStringAndRelease(sb));
- }
-
[Pure]
[Conditional("_LOGGING")]
public static void Trace(String switchName, String format, params Object[] messages) {
@@ -316,22 +281,6 @@ namespace System {
System.Diagnostics.Log.LogMessage(LoggingLevels.TraceLevel0, logSwitch, StringBuilderCache.GetStringAndRelease(sb));
}
- [Conditional("_LOGGING")]
- public static void DumpStack(String switchName) {
- LogSwitch logSwitch;
-
- if (!m_registryChecked) {
- CheckRegistry();
- }
-
- if (!CheckEnabled(switchName, LogLevel.Trace, out logSwitch)) {
- return;
- }
-
- StackTrace trace = new StackTrace();
- System.Diagnostics.Log.LogMessage(LoggingLevels.TraceLevel0, logSwitch, trace.ToString());
- }
-
// For perf-related asserts. On a debug build, set the registry key
// BCLPerfWarnings to non-zero.
[Conditional("_DEBUG")]
@@ -377,21 +326,6 @@ namespace System {
#endif
}
-#if !BIT64 // 32
-#endif
- internal static bool CorrectnessEnabled()
- {
-#if BIT64
- return false;
-#else // 32
- if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize())
- return false;
- if (!m_registryChecked)
- CheckRegistry();
- return m_correctnessWarnings;
-#endif // BIT64
- }
-
// Whether SafeHandles include a stack trace showing where they
// were allocated. Only useful in checked & debug builds.
internal static bool SafeHandleStackTracesEnabled {
diff --git a/src/mscorlib/src/System/CLRConfig.cs b/src/mscorlib/src/System/CLRConfig.cs
index 01ad7c31ab..16c610b82b 100644
--- a/src/mscorlib/src/System/CLRConfig.cs
+++ b/src/mscorlib/src/System/CLRConfig.cs
@@ -9,26 +9,6 @@ using System.Security;
namespace System {
-/// <summary>
-/// For now, this class should be the central point to collect all managed declarations
-/// of native functions designed to expose config switches.
-/// In Dev11 M2.2 we will redesign this class to expose CLRConfig from within the CLR
-/// and refactor managed Fx code to access all compat switches through here.
-/// </summary>
-[FriendAccessAllowed]
-internal class CLRConfig {
-
- [FriendAccessAllowed]
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- [SuppressUnmanagedCodeSecurity]
- internal static extern bool CheckLegacyManagedDeflateStream();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- [SuppressUnmanagedCodeSecurity]
- internal static extern bool CheckThrowUnobservedTaskExceptions();
-
-} // internal class CLRConfig
-
} // namespace System
// file CLRConfig
diff --git a/src/mscorlib/src/System/CannotUnloadAppDomainException.cs b/src/mscorlib/src/System/CannotUnloadAppDomainException.cs
deleted file mode 100644
index 6b07eae5e2..0000000000
--- a/src/mscorlib/src/System/CannotUnloadAppDomainException.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-**
-**
-** Purpose: Exception class for failed attempt to unload an AppDomain.
-**
-**
-=============================================================================*/
-
-namespace System {
-
- using System.Runtime.Serialization;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public class CannotUnloadAppDomainException : SystemException {
- public CannotUnloadAppDomainException()
- : base(Environment.GetResourceString("Arg_CannotUnloadAppDomainException")) {
- SetErrorCode(__HResults.COR_E_CANNOTUNLOADAPPDOMAIN);
- }
-
- public CannotUnloadAppDomainException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_CANNOTUNLOADAPPDOMAIN);
- }
-
- public CannotUnloadAppDomainException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_CANNOTUNLOADAPPDOMAIN);
- }
-
- //
- //This constructor is required for serialization.
- //
- protected CannotUnloadAppDomainException(SerializationInfo info, StreamingContext context) : base(info, context) {
- }
- }
-}
-
-
-
-
-
-
-
diff --git a/src/mscorlib/src/System/CfgParser.cs b/src/mscorlib/src/System/CfgParser.cs
deleted file mode 100644
index b21da7fe94..0000000000
--- a/src/mscorlib/src/System/CfgParser.cs
+++ /dev/null
@@ -1,564 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
- **
- **
- **
- ** Purpose: XMLParser and Tree builder internal to BCL
- **
- **
- ===========================================================*/
-
-namespace System
-{
- using System.Runtime.InteropServices;
- using System.Collections;
- using System.Collections.Generic;
- using System.Runtime.CompilerServices;
- using System.Security.Permissions;
- using System.Security;
- using System.Globalization;
- using System.IO;
- using System.Runtime.Versioning;
- using System.Diagnostics.Contracts;
-
- [Serializable]
- internal enum ConfigEvents
- {
- StartDocument = 0,
- StartDTD = StartDocument + 1,
- EndDTD = StartDTD + 1,
- StartDTDSubset = EndDTD + 1,
- EndDTDSubset = StartDTDSubset + 1,
- EndProlog = EndDTDSubset + 1,
- StartEntity = EndProlog + 1,
- EndEntity = StartEntity + 1,
- EndDocument = EndEntity + 1,
- DataAvailable = EndDocument + 1,
- LastEvent = DataAvailable
- }
-
- [Serializable]
- internal enum ConfigNodeType
- {
- Element = 1,
- Attribute = Element + 1,
- Pi = Attribute + 1,
- XmlDecl = Pi + 1,
- DocType = XmlDecl + 1,
- DTDAttribute = DocType + 1,
- EntityDecl = DTDAttribute + 1,
- ElementDecl = EntityDecl + 1,
- AttlistDecl = ElementDecl + 1,
- Notation = AttlistDecl + 1,
- Group = Notation + 1,
- IncludeSect = Group + 1,
- PCData = IncludeSect + 1,
- CData = PCData + 1,
- IgnoreSect = CData + 1,
- Comment = IgnoreSect + 1,
- EntityRef = Comment + 1,
- Whitespace = EntityRef + 1,
- Name = Whitespace + 1,
- NMToken = Name + 1,
- String = NMToken + 1,
- Peref = String + 1,
- Model = Peref + 1,
- ATTDef = Model + 1,
- ATTType = ATTDef + 1,
- ATTPresence = ATTType + 1,
- DTDSubset = ATTPresence + 1,
- LastNodeType = DTDSubset + 1
- }
-
- [Serializable]
- internal enum ConfigNodeSubType
- {
- Version = (int)ConfigNodeType.LastNodeType,
- Encoding = Version + 1,
- Standalone = Encoding + 1,
- NS = Standalone + 1,
- XMLSpace = NS + 1,
- XMLLang = XMLSpace + 1,
- System = XMLLang + 1,
- Public = System + 1,
- NData = Public + 1,
- AtCData = NData + 1,
- AtId = AtCData + 1,
- AtIdref = AtId + 1,
- AtIdrefs = AtIdref + 1,
- AtEntity = AtIdrefs + 1,
- AtEntities = AtEntity + 1,
- AtNmToken = AtEntities + 1,
- AtNmTokens = AtNmToken + 1,
- AtNotation = AtNmTokens + 1,
- AtRequired = AtNotation + 1,
- AtImplied = AtRequired + 1,
- AtFixed = AtImplied + 1,
- PentityDecl = AtFixed + 1,
- Empty = PentityDecl + 1,
- Any = Empty + 1,
- Mixed = Any + 1,
- Sequence = Mixed + 1,
- Choice = Sequence + 1,
- Star = Choice + 1,
- Plus = Star + 1,
- Questionmark = Plus + 1,
- LastSubNodeType = Questionmark + 1
- }
-
- internal abstract class BaseConfigHandler
- {
- // These delegates must be at the very start of the object
- // This is necessary because unmanaged code takes a dependency on this layout
- // Any changes made to this must be reflected in ConfigHelper.h in ConfigFactory class
- protected Delegate[] eventCallbacks;
- public BaseConfigHandler()
- {
- InitializeCallbacks();
- }
- private void InitializeCallbacks()
- {
- if (eventCallbacks == null)
- {
- eventCallbacks = new Delegate[6];
- eventCallbacks[0] = new NotifyEventCallback(this.NotifyEvent);
- eventCallbacks[1] = new BeginChildrenCallback(this.BeginChildren);
- eventCallbacks[2] = new EndChildrenCallback(this.EndChildren);
- eventCallbacks[3] = new ErrorCallback(this.Error);
- eventCallbacks[4] = new CreateNodeCallback(this.CreateNode);
- eventCallbacks[5] = new CreateAttributeCallback(this.CreateAttribute);
- }
- }
-
- private delegate void NotifyEventCallback(ConfigEvents nEvent);
- public abstract void NotifyEvent(ConfigEvents nEvent);
-
- private delegate void BeginChildrenCallback(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength);
- public abstract void BeginChildren(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength);
-
- private delegate void EndChildrenCallback(int fEmpty,
- int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength);
- public abstract void EndChildren(int fEmpty,
- int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength);
-
- private delegate void ErrorCallback(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
- public abstract void Error(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
-
- private delegate void CreateNodeCallback(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
- public abstract void CreateNode(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
-
- private delegate void CreateAttributeCallback(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
- public abstract void CreateAttribute(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern void RunParser(String fileName);
- }
-
- // Class used to build a DOM like tree of parsed XML
- internal class ConfigTreeParser : BaseConfigHandler
- {
- ConfigNode rootNode = null;
- ConfigNode currentNode = null;
- String fileName = null;
- int attributeEntry;
- String key = null;
- String [] treeRootPath = null; // element to start tree
- bool parsing = false;
- int depth = 0;
- int pathDepth = 0;
- int searchDepth = 0;
- bool bNoSearchPath = false;
-
- // Track state for error message formatting
- String lastProcessed = null;
- bool lastProcessedEndElement;
-
-
- // NOTE: This parser takes a path eg. /configuration/system.runtime.remoting
- // and will return a node which matches this.
- internal ConfigNode Parse(String fileName, String configPath)
- {
- return Parse(fileName, configPath, false);
- }
-
- internal ConfigNode Parse(String fileName, String configPath, bool skipSecurityStuff)
- {
- if (fileName == null)
- throw new ArgumentNullException(nameof(fileName));
- Contract.EndContractBlock();
- this.fileName = fileName;
- if (configPath[0] == '/'){
- treeRootPath = configPath.Substring(1).Split('/');
- pathDepth = treeRootPath.Length - 1;
- bNoSearchPath = false;
- }
- else{
- treeRootPath = new String[1];
- treeRootPath[0] = configPath;
- bNoSearchPath = true;
- }
-
- if (!skipSecurityStuff) {
- (new FileIOPermission(FileIOPermissionAccess.Read, Path.GetFullPath(fileName))).Demand();
- }
-#pragma warning disable 618
- (new SecurityPermission(SecurityPermissionFlag.UnmanagedCode)).Assert();
-#pragma warning restore 618
-
- try
- {
- RunParser(fileName);
- }
- catch(FileNotFoundException) {
- throw; // Pass these through unadulterated.
- }
- catch(DirectoryNotFoundException) {
- throw; // Pass these through unadulterated.
- }
- catch(UnauthorizedAccessException) {
- throw;
- }
- catch(FileLoadException) {
- throw;
- }
- catch(Exception inner) {
- String message = GetInvalidSyntaxMessage();
- // Neither Exception nor ApplicationException are the "right" exceptions here.
- // Desktop throws ApplicationException for backwards compatibility.
- // On Silverlight we don't have ApplicationException, so fall back to Exception.
- throw new Exception(message, inner);
- }
- return rootNode;
- }
-
- public override void NotifyEvent(ConfigEvents nEvent)
- {
- BCLDebug.Trace("REMOTE", "NotifyEvent "+((Enum)nEvent).ToString()+"\n");
- }
-
- public override void BeginChildren(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength)
- {
- //Trace("BeginChildren",size,subType,nType,terminal,text,textLength,prefixLength,0);
- if (!parsing &&
- (!bNoSearchPath
- && depth == (searchDepth + 1)
- && String.Compare(text, treeRootPath[searchDepth], StringComparison.Ordinal) == 0))
- {
- searchDepth++;
- }
- }
-
- public override void EndChildren(int fEmpty,
- int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)] String text,
- int textLength,
- int prefixLength)
- {
- lastProcessed = text;
- lastProcessedEndElement = true;
- if (parsing)
- {
- //Trace("EndChildren",size,subType,nType,terminal,text,textLength,prefixLength,fEmpty);
-
- if (currentNode == rootNode)
- {
- // End of section of tree which is parsed
- parsing = false;
- }
-
- currentNode = currentNode.Parent;
- }
- else if (nType == ConfigNodeType.Element){
- if(depth == searchDepth && String.Compare(text, treeRootPath[searchDepth - 1], StringComparison.Ordinal) == 0)
- {
- searchDepth--;
- depth--;
- }
- else
- depth--;
- }
- }
-
- public override void Error(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength)
- {
- //Trace("Error",size,subType,nType,terminal,text,textLength,prefixLength,0);
- }
-
- public override void CreateNode(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength)
- {
- //Trace("CreateNode",size,subType,nType,terminal,text,textLength,prefixLength,0);
-
- if (nType == ConfigNodeType.Element)
- {
- // New Node
- lastProcessed = text;
- lastProcessedEndElement = false;
-
- if (parsing
- || (bNoSearchPath &&
- String.Compare(text, treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0)
- || (depth == searchDepth && searchDepth == pathDepth &&
- String.Compare(text, treeRootPath[pathDepth], StringComparison.OrdinalIgnoreCase) == 0 ))
- {
- parsing = true;
-
- ConfigNode parentNode = currentNode;
- currentNode = new ConfigNode(text, parentNode);
- if (rootNode == null)
- rootNode = currentNode;
- else
- parentNode.AddChild(currentNode);
- }
- else
- depth++;
- }
- else if (nType == ConfigNodeType.PCData)
- {
- // Data node
- if (currentNode != null)
- {
- currentNode.Value = text;
- }
- }
- }
-
- public override void CreateAttribute(int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength)
- {
- //Trace("CreateAttribute",size,subType,nType,terminal,text,textLength,prefixLength,0);
- if (parsing)
- {
- // if the value of the attribute is null, the parser doesn't come back, so need to store the attribute when the
- // attribute name is encountered
- if (nType == ConfigNodeType.Attribute)
- {
- attributeEntry = currentNode.AddAttribute(text, "");
- key = text;
- }
- else if (nType == ConfigNodeType.PCData)
- {
- currentNode.ReplaceAttribute(attributeEntry, key, text);
- }
- else
- {
- String message = GetInvalidSyntaxMessage();
- // Neither Exception nor ApplicationException are the "right" exceptions here.
- // Desktop throws ApplicationException for backwards compatibility.
- // On Silverlight we don't have ApplicationException, so fall back to Exception.
- throw new Exception(message);
- }
- }
- }
-
-#if _DEBUG
- [System.Diagnostics.Conditional("_LOGGING")]
- private void Trace(String name,
- int size,
- ConfigNodeSubType subType,
- ConfigNodeType nType,
- int terminal,
- [MarshalAs(UnmanagedType.LPWStr)]String text,
- int textLength,
- int prefixLength, int fEmpty)
- {
-
- BCLDebug.Trace("REMOTE","Node "+name);
- BCLDebug.Trace("REMOTE","text "+text);
- BCLDebug.Trace("REMOTE","textLength "+textLength);
- BCLDebug.Trace("REMOTE","size "+size);
- BCLDebug.Trace("REMOTE","subType "+((Enum)subType).ToString());
- BCLDebug.Trace("REMOTE","nType "+((Enum)nType).ToString());
- BCLDebug.Trace("REMOTE","terminal "+terminal);
- BCLDebug.Trace("REMOTE","prefixLength "+prefixLength);
- BCLDebug.Trace("REMOTE","fEmpty "+fEmpty+"\n");
- }
-#endif
-
- private String GetInvalidSyntaxMessage()
- {
- String lastProcessedTag = null;
-
- if (lastProcessed != null)
- lastProcessedTag = (lastProcessedEndElement ? "</" : "<") + lastProcessed + ">";
-
- return Environment.GetResourceString("XML_Syntax_InvalidSyntaxInFile", fileName, lastProcessedTag);
- }
- }
-
- // Node in Tree produced by ConfigTreeParser
- internal class ConfigNode
- {
- String m_name = null;
- String m_value = null;
- ConfigNode m_parent = null;
- List<ConfigNode> m_children = new List<ConfigNode>(5);
- List<DictionaryEntry> m_attributes = new List<DictionaryEntry>(5);
-
- internal ConfigNode(String name, ConfigNode parent)
- {
- m_name = name;
- m_parent = parent;
- }
-
- internal String Name
- {
- get {return m_name;}
- }
-
- internal String Value
- {
- get {return m_value;}
- set {m_value = value;}
- }
-
- internal ConfigNode Parent
- {
- get {return m_parent;}
- }
-
- internal List<ConfigNode> Children
- {
- get {return m_children;}
- }
-
- internal List<DictionaryEntry> Attributes
- {
- get {return m_attributes;}
- }
-
- internal void AddChild(ConfigNode child)
- {
- child.m_parent = this;
- m_children.Add(child);
- }
-
- internal int AddAttribute(String key, String value)
- {
- m_attributes.Add(new DictionaryEntry(key, value));
- return m_attributes.Count-1;
- }
-
- internal void ReplaceAttribute(int index, String key, String value)
- {
- m_attributes[index] = new DictionaryEntry(key, value);
- }
-
-#if _DEBUG
- [System.Diagnostics.Conditional("_LOGGING")]
- internal void Trace()
- {
- BCLDebug.Trace("REMOTE","************ConfigNode************");
- BCLDebug.Trace("REMOTE","Name = "+m_name);
- if (m_value != null)
- BCLDebug.Trace("REMOTE","Value = "+m_value);
- if (m_parent != null)
- BCLDebug.Trace("REMOTE","Parent = "+m_parent.Name);
- for (int i=0; i<m_attributes.Count; i++)
- {
- DictionaryEntry de = (DictionaryEntry)m_attributes[i];
- BCLDebug.Trace("REMOTE","Key = "+de.Key+" Value = "+de.Value);
- }
-
- for (int i=0; i<m_children.Count; i++)
- {
- ((ConfigNode)m_children[i]).Trace();
- }
- }
-#endif
- }
-}
-
-
-
-
-
-
diff --git a/src/mscorlib/src/System/Collections/ArrayList.cs b/src/mscorlib/src/System/Collections/ArrayList.cs
index e7f121370b..b1eac1499e 100644
--- a/src/mscorlib/src/System/Collections/ArrayList.cs
+++ b/src/mscorlib/src/System/Collections/ArrayList.cs
@@ -36,7 +36,7 @@ namespace System.Collections {
[DebuggerDisplay("Count = {Count}")]
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public class ArrayList : IList, ICloneable
+ internal class ArrayList : IList, ICloneable
{
private Object[] _items;
[ContractPublicPropertyName("Count")]
@@ -47,12 +47,6 @@ namespace System.Collections {
private const int _defaultCapacity = 4;
private static readonly Object[] emptyArray = EmptyArray<Object>.Value;
-
- // Note: this constructor is a bogus constructor that does nothing
- // and is for use only with SyncArrayList.
- internal ArrayList( bool trash )
- {
- }
// Constructs a ArrayList. The list is initially empty and has a capacity
// of zero. Upon adding the first element to the list the capacity is
@@ -175,22 +169,6 @@ namespace System.Collections {
_version++;
}
}
-
- // Creates a ArrayList wrapper for a particular IList. This does not
- // copy the contents of the IList, but only wraps the ILIst. So any
- // changes to the underlying list will affect the ArrayList. This would
- // be useful if you want to Reverse a subrange of an IList, or want to
- // use a generic BinarySearch or Sort method without implementing one yourself.
- // However, since these methods are generic, the performance may not be
- // nearly as good for some operations as they would be on the IList itself.
- //
- public static ArrayList Adapter(IList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
- return new IListWrapper(list);
- }
// Adds the given object to the end of this list. The size of the list is
// increased by one. If required, the capacity of the list is doubled
@@ -211,52 +189,6 @@ namespace System.Collections {
public virtual void AddRange(ICollection c) {
InsertRange(_size, c);
}
-
- // Searches a section of the list for a given element using a binary search
- // algorithm. Elements of the list are compared to the search value using
- // the given IComparer interface. If comparer is null, elements of
- // the list are compared to the search value using the IComparable
- // interface, which in that case must be implemented by all elements of the
- // list and the given search value. This method assumes that the given
- // section of the list is already sorted; if this is not the case, the
- // result will be incorrect.
- //
- // The method returns the index of the given value in the list. If the
- // list does not contain the given value, the method returns a negative
- // integer. The bitwise complement operator (~) can be applied to a
- // negative result to produce the index of the first element (if any) that
- // is larger than the given search value. This is also the index at which
- // the search value should be inserted into the list in order for the list
- // to remain sorted.
- //
- // The method uses the Array.BinarySearch method to perform the
- // search.
- //
- public virtual int BinarySearch(int index, int count, Object value, IComparer comparer) {
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.Ensures(Contract.Result<int>() < Count);
- Contract.Ensures(Contract.Result<int>() < index + count);
- Contract.EndContractBlock();
-
- return Array.BinarySearch((Array)_items, index, count, value, comparer);
- }
-
- public virtual int BinarySearch(Object value)
- {
- Contract.Ensures(Contract.Result<int>() < Count);
- return BinarySearch(0, Count, value, null);
- }
-
- public virtual int BinarySearch(Object value, IComparer comparer)
- {
- Contract.Ensures(Contract.Result<int>() < Count);
- return BinarySearch(0, Count, value, comparer);
- }
// Clears the contents of ArrayList.
@@ -301,13 +233,6 @@ namespace System.Collections {
return false;
}
}
-
- // Copies this ArrayList into array, which must be of a
- // compatible array type.
- //
- public virtual void CopyTo(Array array) {
- CopyTo(array, 0);
- }
// Copies this ArrayList into array, which must be of a
// compatible array type.
@@ -319,20 +244,6 @@ namespace System.Collections {
// Delegate rest of error checking to Array.Copy.
Array.Copy(_items, 0, array, arrayIndex, _size);
}
-
- // Copies a section of this list to the given array at the given index.
- //
- // The method uses the Array.Copy method to copy the elements.
- //
- public virtual void CopyTo(int index, Array array, int arrayIndex, int count) {
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- if ((array != null) && (array.Rank != 1))
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- Contract.EndContractBlock();
- // Delegate rest of error checking to Array.Copy.
- Array.Copy(_items, index, array, arrayIndex, count);
- }
// Ensures that the capacity of this list is at least the given minimum
// value. If the currect capacity of the list is less than min, the
@@ -349,28 +260,6 @@ namespace System.Collections {
}
}
- // Returns a list wrapper that is fixed at the current size. Operations
- // that add or remove items will fail, however, replacing items is allowed.
- //
- public static IList FixedSize(IList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<IList>() != null);
- Contract.EndContractBlock();
- return new FixedSizeList(list);
- }
-
- // Returns a list wrapper that is fixed at the current size. Operations
- // that add or remove items will fail, however, replacing items is allowed.
- //
- public static ArrayList FixedSize(ArrayList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
- return new FixedSizeArrayList(list);
- }
-
// Returns an enumerator for this list with the given
// permission for removal of elements. If modifications made to the list
// while an enumeration is in progress, the MoveNext and
@@ -381,24 +270,6 @@ namespace System.Collections {
return new ArrayListEnumeratorSimple(this);
}
- // Returns an enumerator for a section of this list with the given
- // permission for removal of elements. If modifications made to the list
- // while an enumeration is in progress, the MoveNext and
- // GetObject methods of the enumerator will throw an exception.
- //
- public virtual IEnumerator GetEnumerator(int index, int count) {
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.Ensures(Contract.Result<IEnumerator>() != null);
- Contract.EndContractBlock();
-
- return new ArrayListEnumerator(this, index, count);
- }
-
// Returns the index of the first occurrence of a given value in a range of
// this list. The list is searched forwards from beginning to end.
// The elements of the list are compared to the given value using the
@@ -412,41 +283,6 @@ namespace System.Collections {
return Array.IndexOf((Array)_items, value, 0, _size);
}
- // Returns the index of the first occurrence of a given value in a range of
- // this list. The list is searched forwards, starting at index
- // startIndex and ending at count number of elements. The
- // elements of the list are compared to the given value using the
- // Object.Equals method.
- //
- // This method uses the Array.IndexOf method to perform the
- // search.
- //
- public virtual int IndexOf(Object value, int startIndex) {
- if (startIndex > _size)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.Ensures(Contract.Result<int>() < Count);
- Contract.EndContractBlock();
- return Array.IndexOf((Array)_items, value, startIndex, _size - startIndex);
- }
-
- // Returns the index of the first occurrence of a given value in a range of
- // this list. The list is searched forwards, starting at index
- // startIndex and upto count number of elements. The
- // elements of the list are compared to the given value using the
- // Object.Equals method.
- //
- // This method uses the Array.IndexOf method to perform the
- // search.
- //
- public virtual int IndexOf(Object value, int startIndex, int count) {
- if (startIndex > _size)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if (count <0 || startIndex > _size - count) throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
- Contract.Ensures(Contract.Result<int>() < Count);
- Contract.EndContractBlock();
- return Array.IndexOf((Array)_items, value, startIndex, count);
- }
-
// Inserts an element into this list at a given index. The size of the list
// is increased by one. If required, the capacity of the list is doubled
// before inserting the new element.
@@ -494,62 +330,6 @@ namespace System.Collections {
}
}
- // Returns the index of the last occurrence of a given value in a range of
- // this list. The list is searched backwards, starting at the end
- // and ending at the first element in the list. The elements of the list
- // are compared to the given value using the Object.Equals method.
- //
- // This method uses the Array.LastIndexOf method to perform the
- // search.
- //
- public virtual int LastIndexOf(Object value)
- {
- Contract.Ensures(Contract.Result<int>() < _size);
- return LastIndexOf(value, _size - 1, _size);
- }
-
- // Returns the index of the last occurrence of a given value in a range of
- // this list. The list is searched backwards, starting at index
- // startIndex and ending at the first element in the list. The
- // elements of the list are compared to the given value using the
- // Object.Equals method.
- //
- // This method uses the Array.LastIndexOf method to perform the
- // search.
- //
- public virtual int LastIndexOf(Object value, int startIndex)
- {
- if (startIndex >= _size)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.Ensures(Contract.Result<int>() < Count);
- Contract.EndContractBlock();
- return LastIndexOf(value, startIndex, startIndex + 1);
- }
-
- // Returns the index of the last occurrence of a given value in a range of
- // this list. The list is searched backwards, starting at index
- // startIndex and upto count elements. The elements of
- // the list are compared to the given value using the Object.Equals
- // method.
- //
- // This method uses the Array.LastIndexOf method to perform the
- // search.
- //
- public virtual int LastIndexOf(Object value, int startIndex, int count) {
- if (Count != 0 && (startIndex < 0 || count < 0))
- throw new ArgumentOutOfRangeException((startIndex<0 ? nameof(startIndex) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.Ensures(Contract.Result<int>() < Count);
- Contract.EndContractBlock();
-
- if (_size == 0) // Special case for an empty list
- return -1;
-
- if (startIndex >= _size || count > startIndex + 1)
- throw new ArgumentOutOfRangeException((startIndex>=_size ? nameof(startIndex) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_BiggerThanCollection"));
-
- return Array.LastIndexOf((Array)_items, value, startIndex, count);
- }
-
// Returns a read-only IList wrapper for the given IList.
//
[FriendAccessAllowed]
@@ -560,16 +340,6 @@ namespace System.Collections {
Contract.EndContractBlock();
return new ReadOnlyList(list);
}
-
- // Returns a read-only ArrayList wrapper for the given ArrayList.
- //
- public static ArrayList ReadOnly(ArrayList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
- return new ReadOnlyArrayList(list);
- }
// Removes the element at the given index. The size of the list is
// decreased by one.
@@ -600,159 +370,6 @@ namespace System.Collections {
_version++;
}
- // Removes a range of elements from this list.
- //
- public virtual void RemoveRange(int index, int count) {
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.Ensures(Count >= 0);
- //Contract.Ensures(Count == Contract.OldValue(Count) - count);
- Contract.EndContractBlock();
-
- if (count > 0) {
- int i = _size;
- _size -= count;
- if (index < _size) {
- Array.Copy(_items, index + count, _items, index, _size - index);
- }
- while (i > _size) _items[--i] = null;
- _version++;
- }
- }
-
- // Returns an IList that contains count copies of value.
- //
- public static ArrayList Repeat(Object value, int count) {
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count),Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
-
- ArrayList list = new ArrayList((count>_defaultCapacity)?count:_defaultCapacity);
- for(int i=0; i<count; i++)
- list.Add(value);
- return list;
- }
-
- // Reverses the elements in this list.
- public virtual void Reverse() {
- Reverse(0, Count);
- }
-
- // Reverses the elements in a range of this list. Following a call to this
- // method, an element in the range given by index and count
- // which was previously located at index i will now be located at
- // index index + (index + count - i - 1).
- //
- // This method uses the Array.Reverse method to reverse the
- // elements.
- //
- public virtual void Reverse(int index, int count) {
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
- Array.Reverse(_items, index, count);
- _version++;
- }
-
- // Sets the elements starting at the given index to the elements of the
- // given collection.
- //
- public virtual void SetRange(int index, ICollection c) {
- if (c==null) throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection"));
- Contract.EndContractBlock();
- int count = c.Count;
- if (index < 0 || index > _size - count) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
-
- if (count > 0) {
- c.CopyTo(_items, index);
- _version++;
- }
- }
-
- public virtual ArrayList GetRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
- return new Range(this,index, count);
- }
-
- // Sorts the elements in this list. Uses the default comparer and
- // Array.Sort.
- public virtual void Sort()
- {
- Sort(0, Count, Comparer.Default);
- }
-
- // Sorts the elements in this list. Uses Array.Sort with the
- // provided comparer.
- public virtual void Sort(IComparer comparer)
- {
- Sort(0, Count, comparer);
- }
-
- // Sorts the elements in a section of this list. The sort compares the
- // elements to each other using the given IComparer interface. If
- // comparer is null, the elements are compared to each other using
- // the IComparable interface, which in that case must be implemented by all
- // elements of the list.
- //
- // This method uses the Array.Sort method to sort the elements.
- //
- public virtual void Sort(int index, int count, IComparer comparer) {
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (count < 0)
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_size - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- Array.Sort(_items, index, count, comparer);
- _version++;
- }
-
- // Returns a thread-safe wrapper around an IList.
- //
- public static IList Synchronized(IList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<IList>() != null);
- Contract.EndContractBlock();
- return new SyncIList(list);
- }
-
- // Returns a thread-safe wrapper around a ArrayList.
- //
- public static ArrayList Synchronized(ArrayList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.Ensures(Contract.Result<ArrayList>() != null);
- Contract.EndContractBlock();
- return new SyncArrayList(list);
- }
-
- // ToArray returns a new Object array containing the contents of the ArrayList.
- // This requires copying the ArrayList, which is an O(n) operation.
- public virtual Object[] ToArray() {
- Contract.Ensures(Contract.Result<Object[]>() != null);
-
- Object[] array = new Object[_size];
- Array.Copy(_items, 0, array, 0, _size);
- return array;
- }
-
// ToArray returns a new array of a particular type containing the contents
// of the ArrayList. This requires copying the ArrayList and potentially
// downcasting all elements. This copy may fail and is an O(n) operation.
@@ -768,1070 +385,6 @@ namespace System.Collections {
return array;
}
- // Sets the capacity of this list to the size of the list. This method can
- // be used to minimize a list's memory overhead once it is known that no
- // new elements will be added to the list. To completely clear a list and
- // release all memory referenced by the list, execute the following
- // statements:
- //
- // list.Clear();
- // list.TrimToSize();
- //
- public virtual void TrimToSize() {
- Capacity = _size;
- }
-
-
- // This class wraps an IList, exposing it as a ArrayList
- // Note this requires reimplementing half of ArrayList...
- [Serializable]
- private class IListWrapper : ArrayList
- {
- private IList _list;
-
- internal IListWrapper(IList list) {
- _list = list;
- _version = 0; // list doesn't not contain a version number
- }
-
- public override int Capacity {
- get { return _list.Count; }
- set {
- if (value < Count) throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
- Contract.EndContractBlock();
- }
- }
-
- public override int Count {
- get { return _list.Count; }
- }
-
- public override bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public override bool IsFixedSize {
- get { return _list.IsFixedSize; }
- }
-
-
- public override bool IsSynchronized {
- get { return _list.IsSynchronized; }
- }
-
- public override Object this[int index] {
- get {
- return _list[index];
- }
- set {
- _list[index] = value;
- _version++;
- }
- }
-
- public override Object SyncRoot {
- get { return _list.SyncRoot; }
- }
-
- public override int Add(Object obj) {
- int i = _list.Add(obj);
- _version++;
- return i;
- }
-
- public override void AddRange(ICollection c) {
- InsertRange(Count, c);
- }
-
- // Other overloads with automatically work
- public override int BinarySearch(int index, int count, Object value, IComparer comparer)
- {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (this.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
- if (comparer == null)
- comparer = Comparer.Default;
-
- int lo = index;
- int hi = index + count - 1;
- int mid;
- while (lo <= hi) {
- mid = (lo+hi)/2;
- int r = comparer.Compare(value, _list[mid]);
- if (r == 0)
- return mid;
- if (r < 0)
- hi = mid-1;
- else
- lo = mid+1;
- }
- // return bitwise complement of the first element greater than value.
- // Since hi is less than lo now, ~lo is the correct item.
- return ~lo;
- }
-
- public override void Clear() {
- // If _list is an array, it will support Clear method.
- // We shouldn't allow clear operation on a FixedSized ArrayList
- if(_list.IsFixedSize) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- _list.Clear();
- _version++;
- }
-
- public override Object Clone() {
- // This does not do a shallow copy of _list into a ArrayList!
- // This clones the IListWrapper, creating another wrapper class!
- return new IListWrapper(_list);
- }
-
- public override bool Contains(Object obj) {
- return _list.Contains(obj);
- }
-
- public override void CopyTo(Array array, int index) {
- _list.CopyTo(array, index);
- }
-
- public override void CopyTo(int index, Array array, int arrayIndex, int count) {
- if (array==null)
- throw new ArgumentNullException(nameof(array));
- if (index < 0 || arrayIndex < 0)
- throw new ArgumentOutOfRangeException((index < 0) ? nameof(index) : nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if( count < 0)
- throw new ArgumentOutOfRangeException( nameof(count) , Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (array.Length - arrayIndex < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- Contract.EndContractBlock();
-
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
-
- for(int i=index; i<index+count; i++)
- array.SetValue(_list[i], arrayIndex++);
- }
-
- public override IEnumerator GetEnumerator() {
- return _list.GetEnumerator();
- }
-
- public override IEnumerator GetEnumerator(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
-
- return new IListWrapperEnumWrapper(this, index, count);
- }
-
- public override int IndexOf(Object value) {
- return _list.IndexOf(value);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex) {
- return IndexOf(value, startIndex, _list.Count - startIndex);
- }
-
- public override int IndexOf(Object value, int startIndex, int count) {
- if (startIndex < 0 || startIndex > this.Count) throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if (count < 0 || startIndex > this.Count - count) throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
- Contract.EndContractBlock();
-
- int endIndex = startIndex + count;
- if (value == null) {
- for(int i=startIndex; i<endIndex; i++)
- if (_list[i] == null)
- return i;
- return -1;
- } else {
- for(int i=startIndex; i<endIndex; i++)
- if (_list[i] != null && _list[i].Equals(value))
- return i;
- return -1;
- }
- }
-
- public override void Insert(int index, Object obj) {
- _list.Insert(index, obj);
- _version++;
- }
-
- public override void InsertRange(int index, ICollection c) {
- if (c==null)
- throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection"));
- if (index < 0 || index > this.Count) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
-
- if( c.Count > 0) {
- ArrayList al = _list as ArrayList;
- if( al != null) {
- // We need to special case ArrayList.
- // When c is a range of _list, we need to handle this in a special way.
- // See ArrayList.InsertRange for details.
- al.InsertRange(index, c);
- }
- else {
- IEnumerator en = c.GetEnumerator();
- while(en.MoveNext()) {
- _list.Insert(index++, en.Current);
- }
- }
- _version++;
- }
- }
-
- public override int LastIndexOf(Object value) {
- return LastIndexOf(value,_list.Count - 1, _list.Count);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex) {
- return LastIndexOf(value, startIndex, startIndex + 1);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex, int count) {
- if (_list.Count == 0)
- return -1;
-
- if (startIndex < 0 || startIndex >= _list.Count) throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if (count < 0 || count > startIndex + 1) throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
-
- int endIndex = startIndex - count + 1;
- if (value == null) {
- for(int i=startIndex; i >= endIndex; i--)
- if (_list[i] == null)
- return i;
- return -1;
- } else {
- for(int i=startIndex; i >= endIndex; i--)
- if (_list[i] != null && _list[i].Equals(value))
- return i;
- return -1;
- }
- }
-
- public override void Remove(Object value) {
- int index = IndexOf(value);
- if (index >=0)
- RemoveAt(index);
- }
-
- public override void RemoveAt(int index) {
- _list.RemoveAt(index);
- _version++;
- }
-
- public override void RemoveRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
-
- if( count > 0) // be consistent with ArrayList
- _version++;
-
- while(count > 0) {
- _list.RemoveAt(index);
- count--;
- }
- }
-
- public override void Reverse(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
-
- int i = index;
- int j = index + count - 1;
- while (i < j)
- {
- Object tmp = _list[i];
- _list[i++] = _list[j];
- _list[j--] = tmp;
- }
- _version++;
- }
-
- public override void SetRange(int index, ICollection c) {
- if (c==null) {
- throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection"));
- }
- Contract.EndContractBlock();
-
- if (index < 0 || index > _list.Count - c.Count) {
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- }
-
- if( c.Count > 0) {
- IEnumerator en = c.GetEnumerator();
- while(en.MoveNext()) {
- _list[index++] = en.Current;
- }
- _version++;
- }
- }
-
- public override ArrayList GetRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- return new Range(this,index, count);
- }
-
- public override void Sort(int index, int count, IComparer comparer) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (_list.Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
-
- Object [] array = new Object[count];
- CopyTo(index, array, 0, count);
- Array.Sort(array, 0, count, comparer);
- for(int i=0; i<count; i++)
- _list[i+index] = array[i];
-
- _version++;
- }
-
-
- public override Object[] ToArray() {
- Object[] array = new Object[Count];
- _list.CopyTo(array, 0);
- return array;
- }
-
- public override Array ToArray(Type type)
- {
- if (type==null)
- throw new ArgumentNullException(nameof(type));
- Contract.EndContractBlock();
- Array array = Array.UnsafeCreateInstance(type, _list.Count);
- _list.CopyTo(array, 0);
- return array;
- }
-
- public override void TrimToSize()
- {
- // Can't really do much here...
- }
-
- // This is the enumerator for an IList that's been wrapped in another
- // class that implements all of ArrayList's methods.
- [Serializable]
- private sealed class IListWrapperEnumWrapper : IEnumerator, ICloneable
- {
- private IEnumerator _en;
- private int _remaining;
- private int _initialStartIndex; // for reset
- private int _initialCount; // for reset
- private bool _firstCall; // firstCall to MoveNext
-
- private IListWrapperEnumWrapper()
- {
- }
-
- internal IListWrapperEnumWrapper(IListWrapper listWrapper, int startIndex, int count)
- {
- _en = listWrapper.GetEnumerator();
- _initialStartIndex = startIndex;
- _initialCount = count;
- while(startIndex-- > 0 && _en.MoveNext());
- _remaining = count;
- _firstCall = true;
- }
-
- public Object Clone() {
- // We must clone the underlying enumerator, I think.
- IListWrapperEnumWrapper clone = new IListWrapperEnumWrapper();
- clone._en = (IEnumerator) ((ICloneable)_en).Clone();
- clone._initialStartIndex = _initialStartIndex;
- clone._initialCount = _initialCount;
- clone._remaining = _remaining;
- clone._firstCall = _firstCall;
- return clone;
- }
-
- public bool MoveNext() {
- if (_firstCall) {
- _firstCall = false;
- return _remaining-- > 0 && _en.MoveNext();
- }
- if (_remaining < 0)
- return false;
- bool r = _en.MoveNext();
- return r && _remaining-- > 0;
- }
-
- public Object Current {
- get {
- if (_firstCall)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_remaining < 0)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- return _en.Current;
- }
- }
-
- public void Reset() {
- _en.Reset();
- int startIndex = _initialStartIndex;
- while(startIndex-- > 0 && _en.MoveNext());
- _remaining = _initialCount;
- _firstCall = true;
- }
- }
- }
-
-
- [Serializable]
- private class SyncArrayList : ArrayList
- {
- private ArrayList _list;
- private Object _root;
-
- internal SyncArrayList(ArrayList list)
- : base( false )
- {
- _list = list;
- _root = list.SyncRoot;
- }
-
- public override int Capacity {
- get {
- lock(_root) {
- return _list.Capacity;
- }
- }
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- set {
- lock(_root) {
- _list.Capacity = value;
- }
- }
- }
-
- public override int Count {
- get { lock(_root) { return _list.Count; } }
- }
-
- public override bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public override bool IsFixedSize {
- get { return _list.IsFixedSize; }
- }
-
-
- public override bool IsSynchronized {
- get { return true; }
- }
-
- public override Object this[int index] {
- get {
- lock(_root) {
- return _list[index];
- }
- }
- set {
- lock(_root) {
- _list[index] = value;
- }
- }
- }
-
- public override Object SyncRoot {
- get { return _root; }
- }
-
- public override int Add(Object value) {
- lock(_root) {
- return _list.Add(value);
- }
- }
-
- public override void AddRange(ICollection c) {
- lock(_root) {
- _list.AddRange(c);
- }
- }
-
- public override int BinarySearch(Object value) {
- lock(_root) {
- return _list.BinarySearch(value);
- }
- }
-
- public override int BinarySearch(Object value, IComparer comparer) {
- lock(_root) {
- return _list.BinarySearch(value, comparer);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int BinarySearch(int index, int count, Object value, IComparer comparer) {
- lock(_root) {
- return _list.BinarySearch(index, count, value, comparer);
- }
- }
-
- public override void Clear() {
- lock(_root) {
- _list.Clear();
- }
- }
-
- public override Object Clone() {
- lock(_root) {
- return new SyncArrayList((ArrayList)_list.Clone());
- }
- }
-
- public override bool Contains(Object item) {
- lock(_root) {
- return _list.Contains(item);
- }
- }
-
- public override void CopyTo(Array array) {
- lock(_root) {
- _list.CopyTo(array);
- }
- }
-
- public override void CopyTo(Array array, int index) {
- lock(_root) {
- _list.CopyTo(array, index);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void CopyTo(int index, Array array, int arrayIndex, int count) {
- lock(_root) {
- _list.CopyTo(index, array, arrayIndex, count);
- }
- }
-
- public override IEnumerator GetEnumerator() {
- lock(_root) {
- return _list.GetEnumerator();
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override IEnumerator GetEnumerator(int index, int count) {
- lock(_root) {
- return _list.GetEnumerator(index, count);
- }
- }
-
- public override int IndexOf(Object value) {
- lock(_root) {
- return _list.IndexOf(value);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex) {
- lock(_root) {
- return _list.IndexOf(value, startIndex);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex, int count) {
- lock(_root) {
- return _list.IndexOf(value, startIndex, count);
- }
- }
-
- public override void Insert(int index, Object value) {
- lock(_root) {
- _list.Insert(index, value);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void InsertRange(int index, ICollection c) {
- lock(_root) {
- _list.InsertRange(index, c);
- }
- }
-
- public override int LastIndexOf(Object value) {
- lock(_root) {
- return _list.LastIndexOf(value);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex) {
- lock(_root) {
- return _list.LastIndexOf(value, startIndex);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex, int count) {
- lock(_root) {
- return _list.LastIndexOf(value, startIndex, count);
- }
- }
-
- public override void Remove(Object value) {
- lock(_root) {
- _list.Remove(value);
- }
- }
-
- public override void RemoveAt(int index) {
- lock(_root) {
- _list.RemoveAt(index);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void RemoveRange(int index, int count) {
- lock(_root) {
- _list.RemoveRange(index, count);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Reverse(int index, int count) {
- lock(_root) {
- _list.Reverse(index, count);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void SetRange(int index, ICollection c) {
- lock(_root) {
- _list.SetRange(index, c);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override ArrayList GetRange(int index, int count) {
- lock(_root) {
- return _list.GetRange(index, count);
- }
- }
-
- public override void Sort() {
- lock(_root) {
- _list.Sort();
- }
- }
-
- public override void Sort(IComparer comparer) {
- lock(_root) {
- _list.Sort(comparer);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Sort(int index, int count, IComparer comparer) {
- lock(_root) {
- _list.Sort(index, count, comparer);
- }
- }
-
- public override Object[] ToArray() {
- lock(_root) {
- return _list.ToArray();
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override Array ToArray(Type type) {
- lock(_root) {
- return _list.ToArray(type);
- }
- }
-
- public override void TrimToSize() {
- lock(_root) {
- _list.TrimToSize();
- }
- }
- }
-
-
- [Serializable]
- private class SyncIList : IList
- {
- private IList _list;
- private Object _root;
-
- internal SyncIList(IList list) {
- _list = list;
- _root = list.SyncRoot;
- }
-
- public virtual int Count {
- get { lock(_root) { return _list.Count; } }
- }
-
- public virtual bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public virtual bool IsFixedSize {
- get { return _list.IsFixedSize; }
- }
-
-
- public virtual bool IsSynchronized {
- get { return true; }
- }
-
- public virtual Object this[int index] {
- get {
- lock(_root) {
- return _list[index];
- }
- }
- set {
- lock(_root) {
- _list[index] = value;
- }
- }
- }
-
- public virtual Object SyncRoot {
- get { return _root; }
- }
-
- public virtual int Add(Object value) {
- lock(_root) {
- return _list.Add(value);
- }
- }
-
-
- public virtual void Clear() {
- lock(_root) {
- _list.Clear();
- }
- }
-
- public virtual bool Contains(Object item) {
- lock(_root) {
- return _list.Contains(item);
- }
- }
-
- public virtual void CopyTo(Array array, int index) {
- lock(_root) {
- _list.CopyTo(array, index);
- }
- }
-
- public virtual IEnumerator GetEnumerator() {
- lock(_root) {
- return _list.GetEnumerator();
- }
- }
-
- public virtual int IndexOf(Object value) {
- lock(_root) {
- return _list.IndexOf(value);
- }
- }
-
- public virtual void Insert(int index, Object value) {
- lock(_root) {
- _list.Insert(index, value);
- }
- }
-
- public virtual void Remove(Object value) {
- lock(_root) {
- _list.Remove(value);
- }
- }
-
- public virtual void RemoveAt(int index) {
- lock(_root) {
- _list.RemoveAt(index);
- }
- }
- }
-
- [Serializable]
- private class FixedSizeList : IList
- {
- private IList _list;
-
- internal FixedSizeList(IList l) {
- _list = l;
- }
-
- public virtual int Count {
- get { return _list.Count; }
- }
-
- public virtual bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public virtual bool IsFixedSize {
- get { return true; }
- }
-
- public virtual bool IsSynchronized {
- get { return _list.IsSynchronized; }
- }
-
- public virtual Object this[int index] {
- get {
- return _list[index];
- }
- set {
- _list[index] = value;
- }
- }
-
- public virtual Object SyncRoot {
- get { return _list.SyncRoot; }
- }
-
- public virtual int Add(Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public virtual void Clear() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public virtual bool Contains(Object obj) {
- return _list.Contains(obj);
- }
-
- public virtual void CopyTo(Array array, int index) {
- _list.CopyTo(array, index);
- }
-
- public virtual IEnumerator GetEnumerator() {
- return _list.GetEnumerator();
- }
-
- public virtual int IndexOf(Object value) {
- return _list.IndexOf(value);
- }
-
- public virtual void Insert(int index, Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public virtual void Remove(Object value) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public virtual void RemoveAt(int index) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
- }
-
- [Serializable]
- private class FixedSizeArrayList : ArrayList
- {
- private ArrayList _list;
-
- internal FixedSizeArrayList(ArrayList l) {
- _list = l;
- _version = _list._version;
- }
-
- public override int Count {
- get { return _list.Count; }
- }
-
- public override bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public override bool IsFixedSize {
- get { return true; }
- }
-
- public override bool IsSynchronized {
- get { return _list.IsSynchronized; }
- }
-
- public override Object this[int index] {
- get {
- return _list[index];
- }
- set {
- _list[index] = value;
- _version = _list._version;
- }
- }
-
- public override Object SyncRoot {
- get { return _list.SyncRoot; }
- }
-
- public override int Add(Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public override void AddRange(ICollection c) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int BinarySearch(int index, int count, Object value, IComparer comparer) {
- return _list.BinarySearch(index, count, value, comparer);
- }
-
- public override int Capacity {
- get { return _list.Capacity; }
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- set { throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection")); }
- }
-
- public override void Clear() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public override Object Clone() {
- FixedSizeArrayList arrayList = new FixedSizeArrayList(_list);
- arrayList._list = (ArrayList)_list.Clone();
- return arrayList;
- }
-
- public override bool Contains(Object obj) {
- return _list.Contains(obj);
- }
-
- public override void CopyTo(Array array, int index) {
- _list.CopyTo(array, index);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void CopyTo(int index, Array array, int arrayIndex, int count) {
- _list.CopyTo(index, array, arrayIndex, count);
- }
-
- public override IEnumerator GetEnumerator() {
- return _list.GetEnumerator();
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override IEnumerator GetEnumerator(int index, int count) {
- return _list.GetEnumerator(index, count);
- }
-
- public override int IndexOf(Object value) {
- return _list.IndexOf(value);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex) {
- return _list.IndexOf(value, startIndex);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex, int count) {
- return _list.IndexOf(value, startIndex, count);
- }
-
- public override void Insert(int index, Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void InsertRange(int index, ICollection c) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public override int LastIndexOf(Object value) {
- return _list.LastIndexOf(value);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex) {
- return _list.LastIndexOf(value, startIndex);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex, int count) {
- return _list.LastIndexOf(value, startIndex, count);
- }
-
- public override void Remove(Object value) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- public override void RemoveAt(int index) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void RemoveRange(int index, int count) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void SetRange(int index, ICollection c) {
- _list.SetRange(index, c);
- _version = _list._version;
- }
-
- public override ArrayList GetRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- return new Range(this,index, count);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Reverse(int index, int count) {
- _list.Reverse(index, count);
- _version = _list._version;
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Sort(int index, int count, IComparer comparer) {
- _list.Sort(index, count, comparer);
- _version = _list._version;
- }
-
- public override Object[] ToArray() {
- return _list.ToArray();
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override Array ToArray(Type type) {
- return _list.ToArray(type);
- }
-
- public override void TrimToSize() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_FixedSizeCollection"));
- }
- }
-
[Serializable]
private class ReadOnlyList : IList
{
@@ -1908,626 +461,6 @@ namespace System.Collections {
}
[Serializable]
- private class ReadOnlyArrayList : ArrayList
- {
- private ArrayList _list;
-
- internal ReadOnlyArrayList(ArrayList l) {
- _list = l;
- }
-
- public override int Count {
- get { return _list.Count; }
- }
-
- public override bool IsReadOnly {
- get { return true; }
- }
-
- public override bool IsFixedSize {
- get { return true; }
- }
-
- public override bool IsSynchronized {
- get { return _list.IsSynchronized; }
- }
-
- public override Object this[int index] {
- get {
- return _list[index];
- }
- set {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
- }
-
- public override Object SyncRoot {
- get { return _list.SyncRoot; }
- }
-
- public override int Add(Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override void AddRange(ICollection c) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int BinarySearch(int index, int count, Object value, IComparer comparer) {
- return _list.BinarySearch(index, count, value, comparer);
- }
-
-
- public override int Capacity {
- get { return _list.Capacity; }
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- set { throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); }
- }
-
- public override void Clear() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override Object Clone() {
- ReadOnlyArrayList arrayList = new ReadOnlyArrayList(_list);
- arrayList._list = (ArrayList)_list.Clone();
- return arrayList;
- }
-
- public override bool Contains(Object obj) {
- return _list.Contains(obj);
- }
-
- public override void CopyTo(Array array, int index) {
- _list.CopyTo(array, index);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void CopyTo(int index, Array array, int arrayIndex, int count) {
- _list.CopyTo(index, array, arrayIndex, count);
- }
-
- public override IEnumerator GetEnumerator() {
- return _list.GetEnumerator();
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override IEnumerator GetEnumerator(int index, int count) {
- return _list.GetEnumerator(index, count);
- }
-
- public override int IndexOf(Object value) {
- return _list.IndexOf(value);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex) {
- return _list.IndexOf(value, startIndex);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOf(Object value, int startIndex, int count) {
- return _list.IndexOf(value, startIndex, count);
- }
-
- public override void Insert(int index, Object obj) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void InsertRange(int index, ICollection c) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override int LastIndexOf(Object value) {
- return _list.LastIndexOf(value);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex) {
- return _list.LastIndexOf(value, startIndex);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex, int count) {
- return _list.LastIndexOf(value, startIndex, count);
- }
-
- public override void Remove(Object value) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override void RemoveAt(int index) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void RemoveRange(int index, int count) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void SetRange(int index, ICollection c) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override ArrayList GetRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (Count - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- return new Range(this,index, count);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Reverse(int index, int count) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void Sort(int index, int count, IComparer comparer) {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
-
- public override Object[] ToArray() {
- return _list.ToArray();
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override Array ToArray(Type type) {
- return _list.ToArray(type);
- }
-
- public override void TrimToSize() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection"));
- }
- }
-
-
- // Implements an enumerator for a ArrayList. The enumerator uses the
- // internal version number of the list to ensure that no modifications are
- // made to the list while an enumeration is in progress.
- [Serializable]
- private sealed class ArrayListEnumerator : IEnumerator, ICloneable
- {
- private ArrayList list;
- private int index;
- private int endIndex; // Where to stop.
- private int version;
- private Object currentElement;
- private int startIndex; // Save this for Reset.
-
- internal ArrayListEnumerator(ArrayList list, int index, int count) {
- this.list = list;
- startIndex = index;
- this.index = index - 1;
- endIndex = this.index + count; // last valid index
- version = list._version;
- currentElement = null;
- }
-
- public Object Clone() {
- return MemberwiseClone();
- }
-
- public bool MoveNext() {
- if (version != list._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- if (index < endIndex) {
- currentElement = list[++index];
- return true;
- }
- else {
- index = endIndex + 1;
- }
-
- return false;
- }
-
- public Object Current {
- get {
- if (index < startIndex)
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- else if (index > endIndex) {
- throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- }
- return currentElement;
- }
- }
-
- public void Reset() {
- if (version != list._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- index = startIndex - 1;
- }
- }
-
- // Implementation of a generic list subrange. An instance of this class
- // is returned by the default implementation of List.GetRange.
- [Serializable]
- private class Range: ArrayList
- {
- private ArrayList _baseList;
- private int _baseIndex;
- [ContractPublicPropertyName("Count")]
- private int _baseSize;
- private int _baseVersion;
-
- internal Range(ArrayList list, int index, int count) : base(false) {
- _baseList = list;
- _baseIndex = index;
- _baseSize = count;
- _baseVersion = list._version;
- // we also need to update _version field to make Range of Range work
- _version = list._version;
- }
-
- private void InternalUpdateRange()
- {
- if (_baseVersion != _baseList._version)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnderlyingArrayListChanged"));
- }
-
- private void InternalUpdateVersion() {
- _baseVersion++;
- _version++;
- }
-
- public override int Add(Object value) {
- InternalUpdateRange();
- _baseList.Insert(_baseIndex + _baseSize, value);
- InternalUpdateVersion();
- return _baseSize++;
- }
-
- public override void AddRange(ICollection c) {
- if( c == null ) {
- throw new ArgumentNullException(nameof(c));
- }
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- int count = c.Count;
- if( count > 0) {
- _baseList.InsertRange(_baseIndex + _baseSize, c);
- InternalUpdateVersion();
- _baseSize += count;
- }
- }
-
- // Other overloads with automatically work
- public override int BinarySearch(int index, int count, Object value, IComparer comparer) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
- InternalUpdateRange();
-
- int i = _baseList.BinarySearch(_baseIndex + index, count, value, comparer);
- if (i >= 0) return i - _baseIndex;
- return i + _baseIndex;
- }
-
- public override int Capacity {
- get {
- return _baseList.Capacity;
- }
-
- set {
- if (value < Count) throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
- Contract.EndContractBlock();
- }
- }
-
-
- public override void Clear() {
- InternalUpdateRange();
- if (_baseSize != 0)
- {
- _baseList.RemoveRange(_baseIndex, _baseSize);
- InternalUpdateVersion();
- _baseSize = 0;
- }
- }
-
- public override Object Clone() {
- InternalUpdateRange();
- Range arrayList = new Range(_baseList,_baseIndex,_baseSize);
- arrayList._baseList = (ArrayList)_baseList.Clone();
- return arrayList;
- }
-
- public override bool Contains(Object item) {
- InternalUpdateRange();
- if (item==null) {
- for(int i=0; i<_baseSize; i++)
- if (_baseList[_baseIndex + i]==null)
- return true;
- return false;
- }
- else {
- for(int i=0; i<_baseSize; i++)
- if (_baseList[_baseIndex + i] != null && _baseList[_baseIndex + i].Equals(item))
- return true;
- return false;
- }
- }
-
- public override void CopyTo(Array array, int index) {
- if (array==null)
- throw new ArgumentNullException(nameof(array));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (array.Length - index < _baseSize)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.CopyTo(_baseIndex, array, index, _baseSize);
- }
-
- public override void CopyTo(int index, Array array, int arrayIndex, int count) {
- if (array==null)
- throw new ArgumentNullException(nameof(array));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (array.Length - arrayIndex < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.CopyTo(_baseIndex + index, array, arrayIndex, count);
- }
-
- public override int Count {
- get {
- InternalUpdateRange();
- return _baseSize;
- }
- }
-
- public override bool IsReadOnly {
- get { return _baseList.IsReadOnly; }
- }
-
- public override bool IsFixedSize {
- get { return _baseList.IsFixedSize; }
- }
-
- public override bool IsSynchronized {
- get { return _baseList.IsSynchronized; }
- }
-
- public override IEnumerator GetEnumerator() {
- return GetEnumerator(0,_baseSize);
- }
-
- public override IEnumerator GetEnumerator(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- return _baseList.GetEnumerator(_baseIndex + index, count);
- }
-
- public override ArrayList GetRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- return new Range(this, index, count);
- }
-
- public override Object SyncRoot {
- get {
- return _baseList.SyncRoot;
- }
- }
-
-
- public override int IndexOf(Object value) {
- InternalUpdateRange();
- int i = _baseList.IndexOf(value, _baseIndex, _baseSize);
- if (i >= 0) return i - _baseIndex;
- return -1;
- }
-
- public override int IndexOf(Object value, int startIndex) {
- if (startIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (startIndex > _baseSize)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- int i = _baseList.IndexOf(value, _baseIndex + startIndex, _baseSize - startIndex);
- if (i >= 0) return i - _baseIndex;
- return -1;
- }
-
- public override int IndexOf(Object value, int startIndex, int count) {
- if (startIndex < 0 || startIndex > _baseSize)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
-
- if (count < 0 || (startIndex > _baseSize - count))
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- int i = _baseList.IndexOf(value, _baseIndex + startIndex, count);
- if (i >= 0) return i - _baseIndex;
- return -1;
- }
-
- public override void Insert(int index, Object value) {
- if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.Insert(_baseIndex + index, value);
- InternalUpdateVersion();
- _baseSize++;
- }
-
- public override void InsertRange(int index, ICollection c) {
- if (index < 0 || index > _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if( c == null) {
- throw new ArgumentNullException(nameof(c));
- }
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- int count = c.Count;
- if( count > 0) {
- _baseList.InsertRange(_baseIndex + index, c);
- _baseSize += count;
- InternalUpdateVersion();
- }
- }
-
- public override int LastIndexOf(Object value) {
- InternalUpdateRange();
- int i = _baseList.LastIndexOf(value, _baseIndex + _baseSize - 1, _baseSize);
- if (i >= 0) return i - _baseIndex;
- return -1;
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex) {
- return LastIndexOf(value, startIndex, startIndex + 1);
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int LastIndexOf(Object value, int startIndex, int count) {
- InternalUpdateRange();
- if (_baseSize == 0)
- return -1;
-
- if (startIndex >= _baseSize)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if (startIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
-
- int i = _baseList.LastIndexOf(value, _baseIndex + startIndex, count);
- if (i >= 0) return i - _baseIndex;
- return -1;
- }
-
- // Don't need to override Remove
-
- public override void RemoveAt(int index) {
- if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.RemoveAt(_baseIndex + index);
- InternalUpdateVersion();
- _baseSize--;
- }
-
- public override void RemoveRange(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- // No need to call _bastList.RemoveRange if count is 0.
- // In addition, _baseList won't change the vresion number if count is 0.
- if( count > 0) {
- _baseList.RemoveRange(_baseIndex + index, count);
- InternalUpdateVersion();
- _baseSize -= count;
- }
- }
-
- public override void Reverse(int index, int count) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.Reverse(_baseIndex + index, count);
- InternalUpdateVersion();
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void SetRange(int index, ICollection c) {
- InternalUpdateRange();
- if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- _baseList.SetRange(_baseIndex + index, c);
- if( c.Count > 0) {
- InternalUpdateVersion();
- }
- }
-
- public override void Sort(int index, int count, IComparer comparer) {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException((index<0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (_baseSize - index < count)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- _baseList.Sort(_baseIndex + index, count, comparer);
- InternalUpdateVersion();
- }
-
- public override Object this[int index] {
- get {
- InternalUpdateRange();
- if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- return _baseList[_baseIndex + index];
- }
- set {
- InternalUpdateRange();
- if (index < 0 || index >= _baseSize) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- _baseList[_baseIndex + index] = value;
- InternalUpdateVersion();
- }
- }
-
- public override Object[] ToArray() {
- InternalUpdateRange();
- Object[] array = new Object[_baseSize];
- Array.Copy(_baseList._items, _baseIndex, array, 0, _baseSize);
- return array;
- }
-
- public override Array ToArray(Type type) {
- if (type==null)
- throw new ArgumentNullException(nameof(type));
- Contract.EndContractBlock();
-
- InternalUpdateRange();
- Array array = Array.UnsafeCreateInstance(type, _baseSize);
- _baseList.CopyTo(_baseIndex, array, 0, _baseSize);
- return array;
- }
-
- public override void TrimToSize() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_RangeCollection"));
- }
- }
-
- [Serializable]
private sealed class ArrayListEnumeratorSimple : IEnumerator, ICloneable {
private ArrayList list;
private int index;
@@ -2607,20 +540,6 @@ namespace System.Collections {
internal class ArrayListDebugView {
private ArrayList arrayList;
-
- public ArrayListDebugView( ArrayList arrayList) {
- if( arrayList == null)
- throw new ArgumentNullException(nameof(arrayList));
-
- this.arrayList = arrayList;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public Object[] Items {
- get {
- return arrayList.ToArray();
- }
- }
}
}
}
diff --git a/src/mscorlib/src/System/Collections/CollectionBase.cs b/src/mscorlib/src/System/Collections/CollectionBase.cs
index ae0c0d302d..f9c529f3ea 100644
--- a/src/mscorlib/src/System/Collections/CollectionBase.cs
+++ b/src/mscorlib/src/System/Collections/CollectionBase.cs
@@ -14,18 +14,13 @@ namespace System.Collections {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class CollectionBase : IList {
- ArrayList list;
+ private ArrayList list;
protected CollectionBase() {
list = new ArrayList();
}
-
- protected CollectionBase(int capacity) {
- list = new ArrayList(capacity);
- }
-
- protected ArrayList InnerList {
+ internal ArrayList InnerList {
get {
if (list == null)
list = new ArrayList();
@@ -37,16 +32,6 @@ namespace System.Collections {
get { return (IList)this; }
}
- [System.Runtime.InteropServices.ComVisible(false)]
- public int Capacity {
- get {
- return InnerList.Capacity;
- }
- set {
- InnerList.Capacity = value;
- }
- }
-
public int Count {
get {
diff --git a/src/mscorlib/src/System/Collections/Comparer.cs b/src/mscorlib/src/System/Collections/Comparer.cs
index 0e3c78b529..98dba6d776 100644
--- a/src/mscorlib/src/System/Collections/Comparer.cs
+++ b/src/mscorlib/src/System/Collections/Comparer.cs
@@ -22,7 +22,7 @@ namespace System.Collections {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class Comparer : IComparer , ISerializable
+ internal sealed class Comparer : IComparer , ISerializable
{
private CompareInfo m_compareInfo;
public static readonly Comparer Default = new Comparer(CultureInfo.CurrentCulture);
diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
index c1a6f7564c..f7b6883979 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs
@@ -139,149 +139,6 @@ namespace System.Collections.Concurrent
/// </summary>
public ConcurrentDictionary() : this(DefaultConcurrencyLevel, DEFAULT_CAPACITY, true, EqualityComparer<TKey>.Default) { }
- /// <summary>
- /// Initializes a new instance of the <see
- /// cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that is empty, has the specified concurrency level and capacity, and uses the default
- /// comparer for the key type.
- /// </summary>
- /// <param name="concurrencyLevel">The estimated number of threads that will update the
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently.</param>
- /// <param name="capacity">The initial number of elements that the <see
- /// cref="ConcurrentDictionary{TKey,TValue}"/>
- /// can contain.</param>
- /// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="concurrencyLevel"/> is
- /// less than 1.</exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> <paramref name="capacity"/> is less than
- /// 0.</exception>
- public ConcurrentDictionary(int concurrencyLevel, int capacity) : this(concurrencyLevel, capacity, false, EqualityComparer<TKey>.Default) { }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that contains elements copied from the specified <see
- /// cref="T:System.Collections.IEnumerable{KeyValuePair{TKey,TValue}}"/>, has the default concurrency
- /// level, has the default initial capacity, and uses the default comparer for the key type.
- /// </summary>
- /// <param name="collection">The <see
- /// cref="T:System.Collections.IEnumerable{KeyValuePair{TKey,TValue}}"/> whose elements are copied to
- /// the new
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="collection"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.ArgumentException"><paramref name="collection"/> contains one or more
- /// duplicate keys.</exception>
- public ConcurrentDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection) : this(collection, EqualityComparer<TKey>.Default) { }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that is empty, has the specified concurrency level and capacity, and uses the specified
- /// <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>.
- /// </summary>
- /// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>
- /// implementation to use when comparing keys.</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="comparer"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- public ConcurrentDictionary(IEqualityComparer<TKey> comparer) : this(DefaultConcurrencyLevel, DEFAULT_CAPACITY, true, comparer) { }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that contains elements copied from the specified <see
- /// cref="T:System.Collections.IEnumerable"/>, has the default concurrency level, has the default
- /// initial capacity, and uses the specified
- /// <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>.
- /// </summary>
- /// <param name="collection">The <see
- /// cref="T:System.Collections.IEnumerable{KeyValuePair{TKey,TValue}}"/> whose elements are copied to
- /// the new
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
- /// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>
- /// implementation to use when comparing keys.</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="collection"/> is a null reference
- /// (Nothing in Visual Basic). -or-
- /// <paramref name="comparer"/> is a null reference (Nothing in Visual Basic).
- /// </exception>
- public ConcurrentDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer)
- : this(comparer)
- {
- if (collection == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
-
- InitializeFromCollection(collection);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that contains elements copied from the specified <see cref="T:System.Collections.IEnumerable"/>,
- /// has the specified concurrency level, has the specified initial capacity, and uses the specified
- /// <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>.
- /// </summary>
- /// <param name="concurrencyLevel">The estimated number of threads that will update the
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently.</param>
- /// <param name="collection">The <see cref="T:System.Collections.IEnumerable{KeyValuePair{TKey,TValue}}"/> whose elements are copied to the new
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
- /// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/> implementation to use
- /// when comparing keys.</param>
- /// <exception cref="T:System.ArgumentNullException">
- /// <paramref name="collection"/> is a null reference (Nothing in Visual Basic).
- /// -or-
- /// <paramref name="comparer"/> is a null reference (Nothing in Visual Basic).
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// <paramref name="concurrencyLevel"/> is less than 1.
- /// </exception>
- /// <exception cref="T:System.ArgumentException"><paramref name="collection"/> contains one or more duplicate keys.</exception>
- public ConcurrentDictionary(
- int concurrencyLevel, IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer)
- : this(concurrencyLevel, DEFAULT_CAPACITY, false, comparer)
- {
- if (collection == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
- if (comparer == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.comparer);
-
- InitializeFromCollection(collection);
- }
-
- private void InitializeFromCollection(IEnumerable<KeyValuePair<TKey, TValue>> collection)
- {
- TValue dummy;
- foreach (KeyValuePair<TKey, TValue> pair in collection)
- {
- if (pair.Key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
-
- if (!TryAddInternal(pair.Key, pair.Value, false, false, out dummy))
- {
- ThrowHelper.ThrowArgumentException(ExceptionResource.ConcurrentDictionary_SourceContainsDuplicateKeys);
- }
- }
-
- if (m_budget == 0)
- {
- m_budget = m_tables.m_buckets.Length / m_tables.m_locks.Length;
- }
-
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// class that is empty, has the specified concurrency level, has the specified initial capacity, and
- /// uses the specified <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>.
- /// </summary>
- /// <param name="concurrencyLevel">The estimated number of threads that will update the
- /// <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently.</param>
- /// <param name="capacity">The initial number of elements that the <see
- /// cref="ConcurrentDictionary{TKey,TValue}"/>
- /// can contain.</param>
- /// <param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer{TKey}"/>
- /// implementation to use when comparing keys.</param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// <paramref name="concurrencyLevel"/> is less than 1. -or-
- /// <paramref name="capacity"/> is less than 0.
- /// </exception>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="comparer"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- public ConcurrentDictionary(int concurrencyLevel, int capacity, IEqualityComparer<TKey> comparer)
- : this(concurrencyLevel, capacity, false, comparer)
- {
- }
-
internal ConcurrentDictionary(int concurrencyLevel, int capacity, bool growLockArray, IEqualityComparer<TKey> comparer)
{
if (concurrencyLevel < 1)
@@ -488,91 +345,6 @@ namespace System.Collections.Concurrent
}
/// <summary>
- /// Compares the existing value for the specified key with a specified value, and if they're equal,
- /// updates the key with a third value.
- /// </summary>
- /// <param name="key">The key whose value is compared with <paramref name="comparisonValue"/> and
- /// possibly replaced.</param>
- /// <param name="newValue">The value that replaces the value of the element with <paramref
- /// name="key"/> if the comparison results in equality.</param>
- /// <param name="comparisonValue">The value that is compared to the value of the element with
- /// <paramref name="key"/>.</param>
- /// <returns>true if the value with <paramref name="key"/> was equal to <paramref
- /// name="comparisonValue"/> and replaced with <paramref name="newValue"/>; otherwise,
- /// false.</returns>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null
- /// reference.</exception>
- [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread safety")]
- public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue)
- {
- if (key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
-
- IEqualityComparer<TValue> valueComparer = EqualityComparer<TValue>.Default;
-
- while (true)
- {
- int bucketNo;
- int lockNo;
- int hashcode;
-
- Tables tables = m_tables;
- IEqualityComparer<TKey> comparer = tables.m_comparer;
-
- hashcode = comparer.GetHashCode(key);
- GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables.m_buckets.Length, tables.m_locks.Length);
-
- lock (tables.m_locks[lockNo])
- {
- // If the table just got resized, we may not be holding the right lock, and must retry.
- // This should be a rare occurence.
- if (tables != m_tables)
- {
- continue;
- }
-
- // Try to find this key in the bucket
- Node prev = null;
- for (Node node = tables.m_buckets[bucketNo]; node != null; node = node.m_next)
- {
- Assert((prev == null && node == tables.m_buckets[bucketNo]) || prev.m_next == node);
- if (comparer.Equals(node.m_key, key))
- {
- if (valueComparer.Equals(node.m_value, comparisonValue))
- {
- if (s_isValueWriteAtomic)
- {
- node.m_value = newValue;
- }
- else
- {
- Node newNode = new Node(node.m_key, newValue, hashcode, node.m_next);
-
- if (prev == null)
- {
- tables.m_buckets[bucketNo] = newNode;
- }
- else
- {
- prev.m_next = newNode;
- }
- }
-
- return true;
- }
-
- return false;
- }
-
- prev = node;
- }
-
- //didn't find the key
- return false;
- }
- }
- }
-
- /// <summary>
/// Removes all keys and values from the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
/// </summary>
public void Clear()
@@ -947,149 +719,6 @@ namespace System.Collections.Concurrent
}
}
- /// <summary>
- /// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// if the key does not already exist.
- /// </summary>
- /// <param name="key">The key of the element to add.</param>
- /// <param name="valueFactory">The function used to generate a value for the key</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="valueFactory"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.OverflowException">The dictionary contains too many
- /// elements.</exception>
- /// <returns>The value for the key. This will be either the existing value for the key if the
- /// key is already in the dictionary, or the new value for the key as returned by valueFactory
- /// if the key was not in the dictionary.</returns>
- public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
- {
- if (key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
- if (valueFactory == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.valueFactory);
-
- TValue resultingValue;
- if (TryGetValue(key, out resultingValue))
- {
- return resultingValue;
- }
- TryAddInternal(key, valueFactory(key), false, true, out resultingValue);
- return resultingValue;
- }
-
- /// <summary>
- /// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/>
- /// if the key does not already exist.
- /// </summary>
- /// <param name="key">The key of the element to add.</param>
- /// <param name="value">the value to be added, if the key does not already exist</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.OverflowException">The dictionary contains too many
- /// elements.</exception>
- /// <returns>The value for the key. This will be either the existing value for the key if the
- /// key is already in the dictionary, or the new value if the key was not in the dictionary.</returns>
- public TValue GetOrAdd(TKey key, TValue value)
- {
- if (key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
-
- TValue resultingValue;
- TryAddInternal(key, value, false, true, out resultingValue);
- return resultingValue;
- }
-
- /// <summary>
- /// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key does not already
- /// exist, or updates a key/value pair in the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key
- /// already exists.
- /// </summary>
- /// <param name="key">The key to be added or whose value should be updated</param>
- /// <param name="addValueFactory">The function used to generate a value for an absent key</param>
- /// <param name="updateValueFactory">The function used to generate a new value for an existing key
- /// based on the key's existing value</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="addValueFactory"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="updateValueFactory"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.OverflowException">The dictionary contains too many
- /// elements.</exception>
- /// <returns>The new value for the key. This will be either be the result of addValueFactory (if the key was
- /// absent) or the result of updateValueFactory (if the key was present).</returns>
- public TValue AddOrUpdate(TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
- {
- if (key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
- if (addValueFactory == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.addValueFactory);
- if (updateValueFactory == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.updateValueFactory);
-
- TValue newValue, resultingValue;
- while (true)
- {
- TValue oldValue;
- if (TryGetValue(key, out oldValue))
- //key exists, try to update
- {
- newValue = updateValueFactory(key, oldValue);
- if (TryUpdate(key, newValue, oldValue))
- {
- return newValue;
- }
- }
- else //try add
- {
- newValue = addValueFactory(key);
- if (TryAddInternal(key, newValue, false, true, out resultingValue))
- {
- return resultingValue;
- }
- }
- }
- }
-
- /// <summary>
- /// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key does not already
- /// exist, or updates a key/value pair in the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key
- /// already exists.
- /// </summary>
- /// <param name="key">The key to be added or whose value should be updated</param>
- /// <param name="addValue">The value to be added for an absent key</param>
- /// <param name="updateValueFactory">The function used to generate a new value for an existing key based on
- /// the key's existing value</param>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.ArgumentNullException"><paramref name="updateValueFactory"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="T:System.OverflowException">The dictionary contains too many
- /// elements.</exception>
- /// <returns>The new value for the key. This will be either be the result of addValueFactory (if the key was
- /// absent) or the result of updateValueFactory (if the key was present).</returns>
- public TValue AddOrUpdate(TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
- {
- if (key == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key);
- if (updateValueFactory == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.updateValueFactory);
- TValue newValue, resultingValue;
- while (true)
- {
- TValue oldValue;
- if (TryGetValue(key, out oldValue))
- //key exists, try to update
- {
- newValue = updateValueFactory(key, oldValue);
- if (TryUpdate(key, newValue, oldValue))
- {
- return newValue;
- }
- }
- else //try add
- {
- if (TryAddInternal(key, addValue, false, true, out resultingValue))
- {
- return resultingValue;
- }
- }
- }
- }
-
/// <summary>
diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
index 5828369fab..53309fe605 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs
@@ -212,36 +212,6 @@ namespace System.Collections.Concurrent
IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable<T>)this).GetEnumerator();
/// <summary>
- /// Attempts to add an object to the <see cref="Concurrent.IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">The object to add to the <see
- /// cref="Concurrent.IProducerConsumerCollection{T}"/>. The value can be a null
- /// reference (Nothing in Visual Basic) for reference types.
- /// </param>
- /// <returns>true if the object was added successfully; otherwise, false.</returns>
- /// <remarks>For <see cref="ConcurrentQueue{T}"/>, this operation will always add the object to the
- /// end of the <see cref="ConcurrentQueue{T}"/>
- /// and return true.</remarks>
- bool IProducerConsumerCollection<T>.TryAdd(T item)
- {
- Enqueue(item);
- return true;
- }
-
- /// <summary>
- /// Attempts to remove and return an object from the <see cref="Concurrent.IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">
- /// When this method returns, if the operation was successful, <paramref name="item"/> contains the
- /// object removed. If no object was available to be removed, the value is unspecified.
- /// </param>
- /// <returns>true if an element was removed and returned successfully; otherwise, false.</returns>
- /// <remarks>For <see cref="ConcurrentQueue{T}"/>, this operation will attempt to remove the object
- /// from the beginning of the <see cref="ConcurrentQueue{T}"/>.
- /// </remarks>
- bool IProducerConsumerCollection<T>.TryTake(out T item) => TryDequeue(out item);
-
- /// <summary>
/// Gets a value that indicates whether the <see cref="ConcurrentQueue{T}"/> is empty.
/// </summary>
/// <value>true if the <see cref="ConcurrentQueue{T}"/> is empty; otherwise, false.</value>
diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs
index c36d96c26c..d0a93e5382 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs
@@ -45,7 +45,7 @@ namespace System.Collections.Concurrent
/// </remarks>
[DebuggerDisplay("Count = {Count}")]
[DebuggerTypeProxy(typeof(SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView<>))]
- public class ConcurrentStack<T> : IProducerConsumerCollection<T>, IReadOnlyCollection<T>
+ internal class ConcurrentStack<T> : IProducerConsumerCollection<T>, IReadOnlyCollection<T>
{
/// <summary>
/// A simple (internal) node type used to store elements of concurrent stacks and queues.
@@ -79,61 +79,6 @@ namespace System.Collections.Concurrent
}
/// <summary>
- /// Initializes a new instance of the <see cref="ConcurrentStack{T}"/>
- /// class that contains elements copied from the specified collection
- /// </summary>
- /// <param name="collection">The collection whose elements are copied to the new <see
- /// cref="ConcurrentStack{T}"/>.</param>
- /// <exception cref="T:System.ArgumentNullException">The <paramref name="collection"/> argument is
- /// null.</exception>
- public ConcurrentStack(IEnumerable<T> collection)
- {
- if (collection == null)
- {
- throw new ArgumentNullException(nameof(collection));
- }
- InitializeFromCollection(collection);
- }
-
- /// <summary>
- /// Initializes the contents of the stack from an existing collection.
- /// </summary>
- /// <param name="collection">A collection from which to copy elements.</param>
- private void InitializeFromCollection(IEnumerable<T> collection)
- {
- // We just copy the contents of the collection to our stack.
- Node lastNode = null;
- foreach (T element in collection)
- {
- Node newNode = new Node(element);
- newNode.m_next = lastNode;
- lastNode = newNode;
- }
-
- m_head = lastNode;
- }
-
- /// <summary>
- /// Gets a value that indicates whether the <see cref="ConcurrentStack{T}"/> is empty.
- /// </summary>
- /// <value>true if the <see cref="ConcurrentStack{T}"/> is empty; otherwise, false.</value>
- /// <remarks>
- /// For determining whether the collection contains any items, use of this property is recommended
- /// rather than retrieving the number of items from the <see cref="Count"/> property and comparing it
- /// to 0. However, as this collection is intended to be accessed concurrently, it may be the case
- /// that another thread will modify the collection after <see cref="IsEmpty"/> returns, thus invalidating
- /// the result.
- /// </remarks>
- public bool IsEmpty
- {
- // Checks whether the stack is empty. Clearly the answer may be out of date even prior to
- // the function returning (i.e. if another thread concurrently adds to the stack). It does
- // guarantee, however, that, if another thread does not mutate the stack, a subsequent call
- // to TryPop will return true -- i.e. it will also read the stack as non-empty.
- get { return m_head == null; }
- }
-
- /// <summary>
/// Gets the number of elements contained in the <see cref="ConcurrentStack{T}"/>.
/// </summary>
/// <value>The number of elements contained in the <see cref="ConcurrentStack{T}"/>.</value>
@@ -196,18 +141,6 @@ namespace System.Collections.Concurrent
}
/// <summary>
- /// Removes all objects from the <see cref="ConcurrentStack{T}"/>.
- /// </summary>
- public void Clear()
- {
- // Clear the list by setting the head to null. We don't need to use an atomic
- // operation for this: anybody who is mutating the head by pushing or popping
- // will need to use an atomic operation to guarantee they serialize and don't
- // overwrite our setting of the head to null.
- m_head = null;
- }
-
- /// <summary>
/// Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an <see
/// cref="T:System.Array"/>, starting at a particular
/// <see cref="T:System.Array"/> index.
@@ -306,79 +239,6 @@ namespace System.Collections.Concurrent
PushCore(newNode, newNode);
}
- /// <summary>
- /// Inserts multiple objects at the top of the <see cref="ConcurrentStack{T}"/> atomically.
- /// </summary>
- /// <param name="items">The objects to push onto the <see cref="ConcurrentStack{T}"/>.</param>
- /// <exception cref="ArgumentNullException"><paramref name="items"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <remarks>
- /// When adding multiple items to the stack, using PushRange is a more efficient
- /// mechanism than using <see cref="Push"/> one item at a time. Additionally, PushRange
- /// guarantees that all of the elements will be added atomically, meaning that no other threads will
- /// be able to inject elements between the elements being pushed. Items at lower indices in
- /// the <paramref name="items"/> array will be pushed before items at higher indices.
- /// </remarks>
- public void PushRange(T[] items)
- {
- if (items == null)
- {
- throw new ArgumentNullException(nameof(items));
- }
- PushRange(items, 0, items.Length);
- }
-
- /// <summary>
- /// Inserts multiple objects at the top of the <see cref="ConcurrentStack{T}"/> atomically.
- /// </summary>
- /// <param name="items">The objects to push onto the <see cref="ConcurrentStack{T}"/>.</param>
- /// <param name="startIndex">The zero-based offset in <paramref name="items"/> at which to begin
- /// inserting elements onto the top of the <see cref="ConcurrentStack{T}"/>.</param>
- /// <param name="count">The number of elements to be inserted onto the top of the <see
- /// cref="ConcurrentStack{T}"/>.</param>
- /// <exception cref="ArgumentNullException"><paramref name="items"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref
- /// name="count"/> is negative. Or <paramref name="startIndex"/> is greater than or equal to the length
- /// of <paramref name="items"/>.</exception>
- /// <exception cref="ArgumentException"><paramref name="startIndex"/> + <paramref name="count"/> is
- /// greater than the length of <paramref name="items"/>.</exception>
- /// <remarks>
- /// When adding multiple items to the stack, using PushRange is a more efficient
- /// mechanism than using <see cref="Push"/> one item at a time. Additionally, PushRange
- /// guarantees that all of the elements will be added atomically, meaning that no other threads will
- /// be able to inject elements between the elements being pushed. Items at lower indices in the
- /// <paramref name="items"/> array will be pushed before items at higher indices.
- /// </remarks>
- public void PushRange(T[] items, int startIndex, int count)
- {
- ValidatePushPopRangeInput(items, startIndex, count);
-
- // No op if the count is zero
- if (count == 0)
- return;
-
-
- Node head, tail;
- head = tail = new Node(items[startIndex]);
- for (int i = startIndex + 1; i < startIndex + count; i++)
- {
- Node node = new Node(items[i]);
- node.m_next = head;
- head = node;
- }
-
- tail.m_next = m_head;
- if (Interlocked.CompareExchange(ref m_head, head, tail.m_next) == tail.m_next)
- {
- return;
- }
-
- // If we failed, go to the slow path and loop around until we succeed.
- PushCore(head, tail);
-
- }
-
/// <summary>
/// Push one or many nodes into the stack, if head and tails are equal then push one node to the stack other wise push the list between head
@@ -402,73 +262,6 @@ namespace System.Collections.Concurrent
}
/// <summary>
- /// Local helper function to validate the Pop Push range methods input
- /// </summary>
- private void ValidatePushPopRangeInput(T[] items, int startIndex, int count)
- {
- if (items == null)
- {
- throw new ArgumentNullException(nameof(items));
- }
- if (count < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ConcurrentStack_PushPopRange_CountOutOfRange"));
- }
- int length = items.Length;
- if (startIndex >= length || startIndex < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ConcurrentStack_PushPopRange_StartOutOfRange"));
- }
- if (length - count < startIndex) //instead of (startIndex + count > items.Length) to prevent overflow
- {
- throw new ArgumentException(Environment.GetResourceString("ConcurrentStack_PushPopRange_InvalidCount"));
- }
- }
-
- /// <summary>
- /// Attempts to add an object to the <see
- /// cref="T:System.Collections.Concurrent.IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">The object to add to the <see
- /// cref="T:System.Collections.Concurrent.IProducerConsumerCollection{T}"/>. The value can be a null
- /// reference (Nothing in Visual Basic) for reference types.
- /// </param>
- /// <returns>true if the object was added successfully; otherwise, false.</returns>
- /// <remarks>For <see cref="ConcurrentStack{T}"/>, this operation
- /// will always insert the object onto the top of the <see cref="ConcurrentStack{T}"/>
- /// and return true.</remarks>
- bool IProducerConsumerCollection<T>.TryAdd(T item)
- {
- Push(item);
- return true;
- }
-
- /// <summary>
- /// Attempts to return an object from the top of the <see cref="ConcurrentStack{T}"/>
- /// without removing it.
- /// </summary>
- /// <param name="result">When this method returns, <paramref name="result"/> contains an object from
- /// the top of the <see cref="T:System.Collections.Concurrent.ConccurrentStack{T}"/> or an
- /// unspecified value if the operation failed.</param>
- /// <returns>true if and object was returned successfully; otherwise, false.</returns>
- public bool TryPeek(out T result)
- {
- Node head = m_head;
-
- // If the stack is empty, return false; else return the element and true.
- if (head == null)
- {
- result = default(T);
- return false;
- }
- else
- {
- result = head.m_value;
- return true;
- }
- }
-
- /// <summary>
/// Attempts to pop and return the object at the top of the <see cref="ConcurrentStack{T}"/>.
/// </summary>
/// <param name="result">
@@ -498,83 +291,6 @@ namespace System.Collections.Concurrent
}
/// <summary>
- /// Attempts to pop and return multiple objects from the top of the <see cref="ConcurrentStack{T}"/>
- /// atomically.
- /// </summary>
- /// <param name="items">
- /// The <see cref="T:System.Array"/> to which objects popped from the top of the <see
- /// cref="ConcurrentStack{T}"/> will be added.
- /// </param>
- /// <returns>The number of objects successfully popped from the top of the <see
- /// cref="ConcurrentStack{T}"/> and inserted in
- /// <paramref name="items"/>.</returns>
- /// <exception cref="ArgumentNullException"><paramref name="items"/> is a null argument (Nothing
- /// in Visual Basic).</exception>
- /// <remarks>
- /// When popping multiple items, if there is little contention on the stack, using
- /// TryPopRange can be more efficient than using <see cref="TryPop"/>
- /// once per item to be removed. Nodes fill the <paramref name="items"/>
- /// with the first node to be popped at the startIndex, the second node to be popped
- /// at startIndex + 1, and so on.
- /// </remarks>
- public int TryPopRange(T[] items)
- {
- if (items == null)
- {
- throw new ArgumentNullException(nameof(items));
- }
-
- return TryPopRange(items, 0, items.Length);
- }
-
- /// <summary>
- /// Attempts to pop and return multiple objects from the top of the <see cref="ConcurrentStack{T}"/>
- /// atomically.
- /// </summary>
- /// <param name="items">
- /// The <see cref="T:System.Array"/> to which objects popped from the top of the <see
- /// cref="ConcurrentStack{T}"/> will be added.
- /// </param>
- /// <param name="startIndex">The zero-based offset in <paramref name="items"/> at which to begin
- /// inserting elements from the top of the <see cref="ConcurrentStack{T}"/>.</param>
- /// <param name="count">The number of elements to be popped from top of the <see
- /// cref="ConcurrentStack{T}"/> and inserted into <paramref name="items"/>.</param>
- /// <returns>The number of objects successfully popped from the top of
- /// the <see cref="ConcurrentStack{T}"/> and inserted in <paramref name="items"/>.</returns>
- /// <exception cref="ArgumentNullException"><paramref name="items"/> is a null reference
- /// (Nothing in Visual Basic).</exception>
- /// <exception cref="ArgumentOutOfRangeException"><paramref name="startIndex"/> or <paramref
- /// name="count"/> is negative. Or <paramref name="startIndex"/> is greater than or equal to the length
- /// of <paramref name="items"/>.</exception>
- /// <exception cref="ArgumentException"><paramref name="startIndex"/> + <paramref name="count"/> is
- /// greater than the length of <paramref name="items"/>.</exception>
- /// <remarks>
- /// When popping multiple items, if there is little contention on the stack, using
- /// TryPopRange can be more efficient than using <see cref="TryPop"/>
- /// once per item to be removed. Nodes fill the <paramref name="items"/>
- /// with the first node to be popped at the startIndex, the second node to be popped
- /// at startIndex + 1, and so on.
- /// </remarks>
- public int TryPopRange(T[] items, int startIndex, int count)
- {
- ValidatePushPopRangeInput(items, startIndex, count);
-
- // No op if the count is zero
- if (count == 0)
- return 0;
-
- Node poppedHead;
- int nodesCount = TryPopCore(count, out poppedHead);
- if (nodesCount > 0)
- {
- CopyRemovedItems(poppedHead, items, startIndex, nodesCount);
-
- }
- return nodesCount;
-
- }
-
- /// <summary>
/// Local helper function to Pop an item from the stack, slow path
/// </summary>
/// <param name="result">The popped item</param>
@@ -648,42 +364,6 @@ namespace System.Collections.Concurrent
}
}
-
- /// <summary>
- /// Local helper function to copy the poped elements into a given collection
- /// </summary>
- /// <param name="head">The head of the list to be copied</param>
- /// <param name="collection">The collection to place the popped items in</param>
- /// <param name="startIndex">the beginning of index of where to place the popped items</param>
- /// <param name="nodesCount">The number of nodes.</param>
- private void CopyRemovedItems(Node head, T[] collection, int startIndex, int nodesCount)
- {
- Node current = head;
- for (int i = startIndex; i < startIndex + nodesCount; i++)
- {
- collection[i] = current.m_value;
- current = current.m_next;
- }
-
- }
-
- /// <summary>
- /// Attempts to remove and return an object from the <see
- /// cref="T:System.Collections.Concurrent.IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">
- /// When this method returns, if the operation was successful, <paramref name="item"/> contains the
- /// object removed. If no object was available to be removed, the value is unspecified.
- /// </param>
- /// <returns>true if an element was removed and returned succesfully; otherwise, false.</returns>
- /// <remarks>For <see cref="ConcurrentStack{T}"/>, this operation will attempt to pope the object at
- /// the top of the <see cref="ConcurrentStack{T}"/>.
- /// </remarks>
- bool IProducerConsumerCollection<T>.TryTake(out T item)
- {
- return TryPop(out item);
- }
-
/// <summary>
/// Copies the items stored in the <see cref="ConcurrentStack{T}"/> to a new array.
/// </summary>
diff --git a/src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs b/src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs
index 56be7759c9..0347ece0ec 100644
--- a/src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs
+++ b/src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs
@@ -25,9 +25,8 @@ namespace System.Collections.Concurrent
/// All implementations of this interface must enable all members of this interface
/// to be used concurrently from multiple threads.
/// </remarks>
- public interface IProducerConsumerCollection<T> : IEnumerable<T>, ICollection
+ internal interface IProducerConsumerCollection<T> : IEnumerable<T>, ICollection
{
-
/// <summary>
/// Copies the elements of the <see cref="IProducerConsumerCollection{T}"/> to
/// an
@@ -51,35 +50,12 @@ namespace System.Collections.Concurrent
void CopyTo(T[] array, int index);
/// <summary>
- /// Attempts to add an object to the <see
- /// cref="IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">The object to add to the <see
- /// cref="IProducerConsumerCollection{T}"/>.</param>
- /// <returns>true if the object was added successfully; otherwise, false.</returns>
- /// <exception cref="T:System.ArgumentException">The <paramref name="item"/> was invalid for this collection.</exception>
- bool TryAdd(T item);
-
- /// <summary>
- /// Attempts to remove and return an object from the <see cref="IProducerConsumerCollection{T}"/>.
- /// </summary>
- /// <param name="item">
- /// When this method returns, if the object was removed and returned successfully, <paramref
- /// name="item"/> contains the removed object. If no object was available to be removed, the value is
- /// unspecified.
- /// </param>
- /// <returns>true if an object was removed and returned successfully; otherwise, false.</returns>
- bool TryTake(out T item);
-
- /// <summary>
/// Copies the elements contained in the <see cref="IProducerConsumerCollection{T}"/> to a new array.
/// </summary>
/// <returns>A new array containing the elements copied from the <see cref="IProducerConsumerCollection{T}"/>.</returns>
T[] ToArray();
-
}
-
/// <summary>
/// A debugger view of the IProducerConsumerCollection that makes it simple to browse the
/// collection's contents at a point in time.
@@ -89,28 +65,5 @@ namespace System.Collections.Concurrent
{
private IProducerConsumerCollection<T> m_collection; // The collection being viewed.
- /// <summary>
- /// Constructs a new debugger view object for the provided collection object.
- /// </summary>
- /// <param name="collection">A collection to browse in the debugger.</param>
- public SystemCollectionsConcurrent_ProducerConsumerCollectionDebugView(IProducerConsumerCollection<T> collection)
- {
- if (collection == null)
- {
- throw new ArgumentNullException(nameof(collection));
- }
-
- m_collection = collection;
- }
-
- /// <summary>
- /// Returns a snapshot of the underlying collection's elements.
- /// </summary>
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public T[] Items
- {
- get { return m_collection.ToArray(); }
- }
-
}
}
diff --git a/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs b/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs
deleted file mode 100644
index 33e3c88e9a..0000000000
--- a/src/mscorlib/src/System/Collections/Concurrent/OrderablePartitioner.cs
+++ /dev/null
@@ -1,280 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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;
-using System.Collections.Generic;
-using System.Security.Permissions;
-using System.Threading;
-
-namespace System.Collections.Concurrent
-{
-
- /// <summary>
- /// Represents a particular manner of splitting an orderable data source into multiple partitions.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in the collection.</typeparam>
- /// <remarks>
- /// <para>
- /// Each element in each partition has an integer index associated with it, which determines the relative
- /// order of that element against elements in other partitions.
- /// </para>
- /// <para>
- /// Inheritors of <see cref="OrderablePartitioner{TSource}"/> must adhere to the following rules:
- /// <ol>
- /// <li>All indices must be unique, such that there may not be duplicate indices. If all indices are not
- /// unique, the output ordering may be scrambled.</li>
- /// <li>All indices must be non-negative. If any indices are negative, consumers of the implementation
- /// may throw exceptions.</li>
- /// <li><see cref="GetPartitions"/> and <see cref="GetOrderablePartitions"/> should throw a
- /// <see cref="T:System.ArgumentOutOfRangeException"/> if the requested partition count is less than or
- /// equal to zero.</li>
- /// <li><see cref="GetPartitions"/> and <see cref="GetOrderablePartitions"/> should always return a number
- /// of enumerables equal to the requested partition count. If the partitioner runs out of data and cannot
- /// create as many partitions as requested, an empty enumerator should be returned for each of the
- /// remaining partitions. If this rule is not followed, consumers of the implementation may throw a <see
- /// cref="T:System.InvalidOperationException"/>.</li>
- /// <li><see cref="GetPartitions"/>, <see cref="GetOrderablePartitions"/>,
- /// <see cref="GetDynamicPartitions"/>, and <see cref="GetOrderableDynamicPartitions"/>
- /// should never return null. If null is returned, a consumer of the implementation may throw a
- /// <see cref="T:System.InvalidOperationException"/>.</li>
- /// <li><see cref="GetPartitions"/>, <see cref="GetOrderablePartitions"/>,
- /// <see cref="GetDynamicPartitions"/>, and <see cref="GetOrderableDynamicPartitions"/>
- /// should always return partitions that can fully and uniquely enumerate the input data source. All of
- /// the data and only the data contained in the input source should be enumerated, with no duplication
- /// that was not already in the input, unless specifically required by the particular partitioner's
- /// design. If this is not followed, the output ordering may be scrambled.</li>
- /// <li>If <see cref="KeysOrderedInEachPartition"/> returns true, each partition must return elements
- /// with increasing key indices.</li>
- /// <li>If <see cref="KeysOrderedAcrossPartitions"/> returns true, all the keys in partition numbered N
- /// must be larger than all the keys in partition numbered N-1.</li>
- /// <li>If <see cref="KeysNormalized"/> returns true, all indices must be monotonically increasing from
- /// 0, though not necessarily within a single partition.</li>
- /// </ol>
- /// </para>
- /// </remarks>
- public abstract class OrderablePartitioner<TSource> : Partitioner<TSource>
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="OrderablePartitioner{TSource}"/> class with the
- /// specified constraints on the index keys.
- /// </summary>
- /// <param name="keysOrderedInEachPartition">
- /// Indicates whether the elements in each partition are yielded in the order of
- /// increasing keys.
- /// </param>
- /// <param name="keysOrderedAcrossPartitions">
- /// Indicates whether elements in an earlier partition always come before
- /// elements in a later partition. If true, each element in partition 0 has a smaller order key than
- /// any element in partition 1, each element in partition 1 has a smaller order key than any element
- /// in partition 2, and so on.
- /// </param>
- /// <param name="keysNormalized">
- /// Indicates whether keys are normalized. If true, all order keys are distinct
- /// integers in the range [0 .. numberOfElements-1]. If false, order keys must still be dictinct, but
- /// only their relative order is considered, not their absolute values.
- /// </param>
- protected OrderablePartitioner(bool keysOrderedInEachPartition, bool keysOrderedAcrossPartitions, bool keysNormalized)
- {
- KeysOrderedInEachPartition = keysOrderedInEachPartition;
- KeysOrderedAcrossPartitions = keysOrderedAcrossPartitions;
- KeysNormalized = keysNormalized;
- }
-
- /// <summary>
- /// Partitions the underlying collection into the specified number of orderable partitions.
- /// </summary>
- /// <remarks>
- /// Each partition is represented as an enumerator over key-value pairs.
- /// The value of the pair is the element itself, and the key is an integer which determines
- /// the relative ordering of this element against other elements in the data source.
- /// </remarks>
- /// <param name="partitionCount">The number of partitions to create.</param>
- /// <returns>A list containing <paramref name="partitionCount"/> enumerators.</returns>
- public abstract IList<IEnumerator<KeyValuePair<long, TSource>>> GetOrderablePartitions(int partitionCount);
-
- /// <summary>
- /// Creates an object that can partition the underlying collection into a variable number of
- /// partitions.
- /// </summary>
- /// <remarks>
- /// <para>
- /// The returned object implements the <see
- /// cref="T:System.Collections.Generic.IEnumerable{TSource}"/> interface. Calling <see
- /// cref="System.Collections.Generic.IEnumerable{TSource}.GetEnumerator">GetEnumerator</see> on the
- /// object creates another partition over the sequence.
- /// </para>
- /// <para>
- /// Each partition is represented as an enumerator over key-value pairs. The value in the pair is the element
- /// itself, and the key is an integer which determines the relative ordering of this element against
- /// other elements.
- /// </para>
- /// <para>
- /// The <see cref="GetOrderableDynamicPartitions"/> method is only supported if the <see
- /// cref="System.Collections.Concurrent.Partitioner{TSource}.SupportsDynamicPartitions">SupportsDynamicPartitions</see>
- /// property returns true.
- /// </para>
- /// </remarks>
- /// <returns>An object that can create partitions over the underlying data source.</returns>
- /// <exception cref="NotSupportedException">Dynamic partitioning is not supported by this
- /// partitioner.</exception>
- public virtual IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions()
- {
- throw new NotSupportedException(Environment.GetResourceString("Partitioner_DynamicPartitionsNotSupported"));
- }
-
- /// <summary>
- /// Gets whether elements in each partition are yielded in the order of increasing keys.
- /// </summary>
- public bool KeysOrderedInEachPartition { get; private set; }
-
- /// <summary>
- /// Gets whether elements in an earlier partition always come before elements in a later partition.
- /// </summary>
- /// <remarks>
- /// If <see cref="KeysOrderedAcrossPartitions"/> returns true, each element in partition 0 has a
- /// smaller order key than any element in partition 1, each element in partition 1 has a smaller
- /// order key than any element in partition 2, and so on.
- /// </remarks>
- public bool KeysOrderedAcrossPartitions { get; private set; }
-
- /// <summary>
- /// Gets whether order keys are normalized.
- /// </summary>
- /// <remarks>
- /// If <see cref="KeysNormalized"/> returns true, all order keys are distinct integers in the range
- /// [0 .. numberOfElements-1]. If the property returns false, order keys must still be dictinct, but
- /// only their relative order is considered, not their absolute values.
- /// </remarks>
- public bool KeysNormalized { get; private set; }
-
- /// <summary>
- /// Partitions the underlying collection into the given number of ordered partitions.
- /// </summary>
- /// <remarks>
- /// The default implementation provides the same behavior as <see cref="GetOrderablePartitions"/> except
- /// that the returned set of partitions does not provide the keys for the elements.
- /// </remarks>
- /// <param name="partitionCount">The number of partitions to create.</param>
- /// <returns>A list containing <paramref name="partitionCount"/> enumerators.</returns>
- public override IList<IEnumerator<TSource>> GetPartitions(int partitionCount)
- {
- IList<IEnumerator<KeyValuePair<long, TSource>>> orderablePartitions = GetOrderablePartitions(partitionCount);
-
- if (orderablePartitions.Count != partitionCount)
- {
- throw new InvalidOperationException("OrderablePartitioner_GetPartitions_WrongNumberOfPartitions");
- }
-
- IEnumerator<TSource>[] partitions = new IEnumerator<TSource>[partitionCount];
- for (int i = 0; i < partitionCount; i++)
- {
- partitions[i] = new EnumeratorDropIndices(orderablePartitions[i]);
- }
- return partitions;
- }
-
- /// <summary>
- /// Creates an object that can partition the underlying collection into a variable number of
- /// partitions.
- /// </summary>
- /// <remarks>
- /// <para>
- /// The returned object implements the <see
- /// cref="T:System.Collections.Generic.IEnumerable{TSource}"/> interface. Calling <see
- /// cref="System.Collections.Generic.IEnumerable{TSource}.GetEnumerator">GetEnumerator</see> on the
- /// object creates another partition over the sequence.
- /// </para>
- /// <para>
- /// The default implementation provides the same behavior as <see cref="GetOrderableDynamicPartitions"/> except
- /// that the returned set of partitions does not provide the keys for the elements.
- /// </para>
- /// <para>
- /// The <see cref="GetDynamicPartitions"/> method is only supported if the <see
- /// cref="System.Collections.Concurrent.Partitioner{TSource}.SupportsDynamicPartitions"/>
- /// property returns true.
- /// </para>
- /// </remarks>
- /// <returns>An object that can create partitions over the underlying data source.</returns>
- /// <exception cref="NotSupportedException">Dynamic partitioning is not supported by this
- /// partitioner.</exception>
- public override IEnumerable<TSource> GetDynamicPartitions()
- {
- IEnumerable<KeyValuePair<long, TSource>> orderablePartitions = GetOrderableDynamicPartitions();
- return new EnumerableDropIndices(orderablePartitions);
- }
-
- /// <summary>
- /// Converts an enumerable over key-value pairs to an enumerable over values.
- /// </summary>
- private class EnumerableDropIndices : IEnumerable<TSource>, IDisposable
- {
- private readonly IEnumerable<KeyValuePair<long, TSource>> m_source;
- public EnumerableDropIndices(IEnumerable<KeyValuePair<long, TSource>> source)
- {
- m_source = source;
- }
- public IEnumerator<TSource> GetEnumerator()
- {
- return new EnumeratorDropIndices(m_source.GetEnumerator());
- }
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((EnumerableDropIndices)this).GetEnumerator();
- }
- public void Dispose()
- {
- IDisposable d = m_source as IDisposable;
- if (d != null)
- {
- d.Dispose();
- }
- }
- }
-
- private class EnumeratorDropIndices : IEnumerator<TSource>
- {
- private readonly IEnumerator<KeyValuePair<long, TSource>> m_source;
- public EnumeratorDropIndices(IEnumerator<KeyValuePair<long, TSource>> source)
- {
- m_source = source;
- }
- public bool MoveNext()
- {
- return m_source.MoveNext();
- }
- public TSource Current
- {
- get
- {
- return m_source.Current.Value;
- }
- }
- Object IEnumerator.Current
- {
- get
- {
- return ((EnumeratorDropIndices)this).Current;
- }
- }
- public void Dispose()
- {
- m_source.Dispose();
- }
- public void Reset()
- {
- m_source.Reset();
- }
- }
-
- }
-
-}
diff --git a/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs b/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs
deleted file mode 100644
index 0192b1942c..0000000000
--- a/src/mscorlib/src/System/Collections/Concurrent/Partitioner.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-//
-//
-//
-// Represents a particular way of splitting a collection into multiple partitions.
-//
-// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
-using System;
-using System.Collections.Generic;
-using System.Security.Permissions;
-using System.Threading;
-
-namespace System.Collections.Concurrent
-{
- /// <summary>
- /// Represents a particular manner of splitting a data source into multiple partitions.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in the collection.</typeparam>
- /// <remarks>
- /// <para>
- /// Inheritors of <see cref="Partitioner{TSource}"/> must adhere to the following rules:
- /// <ol>
- /// <li><see cref="GetPartitions"/> should throw a
- /// <see cref="T:System.ArgumentOutOfRangeException"/> if the requested partition count is less than or
- /// equal to zero.</li>
- /// <li><see cref="GetPartitions"/> should always return a number of enumerables equal to the requested
- /// partition count. If the partitioner runs out of data and cannot create as many partitions as
- /// requested, an empty enumerator should be returned for each of the remaining partitions. If this rule
- /// is not followed, consumers of the implementation may throw a <see
- /// cref="T:System.InvalidOperationException"/>.</li>
- /// <li><see cref="GetPartitions"/> and <see cref="GetDynamicPartitions"/>
- /// should never return null. If null is returned, a consumer of the implementation may throw a
- /// <see cref="T:System.InvalidOperationException"/>.</li>
- /// <li><see cref="GetPartitions"/> and <see cref="GetDynamicPartitions"/> should always return
- /// partitions that can fully and uniquely enumerate the input data source. All of the data and only the
- /// data contained in the input source should be enumerated, with no duplication that was not already in
- /// the input, unless specifically required by the particular partitioner's design. If this is not
- /// followed, the output ordering may be scrambled.</li>
- /// </ol>
- /// </para>
- /// </remarks>
- public abstract class Partitioner<TSource>
- {
- /// <summary>
- /// Partitions the underlying collection into the given number of partitions.
- /// </summary>
- /// <param name="partitionCount">The number of partitions to create.</param>
- /// <returns>A list containing <paramref name="partitionCount"/> enumerators.</returns>
- public abstract IList<IEnumerator<TSource>> GetPartitions(int partitionCount);
-
- /// <summary>
- /// Gets whether additional partitions can be created dynamically.
- /// </summary>
- /// <returns>
- /// true if the <see cref="Partitioner{TSource}"/> can create partitions dynamically as they are
- /// requested; false if the <see cref="Partitioner{TSource}"/> can only allocate
- /// partitions statically.
- /// </returns>
- /// <remarks>
- /// <para>
- /// If a derived class does not override and implement <see cref="GetDynamicPartitions"/>,
- /// <see cref="SupportsDynamicPartitions"/> should return false. The value of <see
- /// cref="SupportsDynamicPartitions"/> should not vary over the lifetime of this instance.
- /// </para>
- /// </remarks>
- public virtual bool SupportsDynamicPartitions
- {
- get { return false; }
- }
-
- /// <summary>
- /// Creates an object that can partition the underlying collection into a variable number of
- /// partitions.
- /// </summary>
- /// <remarks>
- /// <para>
- /// The returned object implements the <see
- /// cref="T:System.Collections.Generic.IEnumerable{TSource}"/> interface. Calling <see
- /// cref="System.Collections.Generic.IEnumerable{TSource}.GetEnumerator">GetEnumerator</see> on the
- /// object creates another partition over the sequence.
- /// </para>
- /// <para>
- /// The <see cref="GetDynamicPartitions"/> method is only supported if the <see
- /// cref="SupportsDynamicPartitions"/>
- /// property returns true.
- /// </para>
- /// </remarks>
- /// <returns>An object that can create partitions over the underlying data source.</returns>
- /// <exception cref="NotSupportedException">Dynamic partitioning is not supported by this
- /// partitioner.</exception>
- public virtual IEnumerable<TSource> GetDynamicPartitions()
- {
- throw new NotSupportedException(Environment.GetResourceString("Partitioner_DynamicPartitionsNotSupported"));
- }
- }
-}
diff --git a/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs b/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs
deleted file mode 100644
index 9b36c053ad..0000000000
--- a/src/mscorlib/src/System/Collections/Concurrent/PartitionerStatic.cs
+++ /dev/null
@@ -1,1715 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-#pragma warning disable 0420
-
-// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
-//
-//
-//
-// A class of default partitioners for Partitioner<TSource>
-//
-// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-
-using System.Collections.Generic;
-using System.Security.Permissions;
-using System.Threading;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-using System.Runtime.InteropServices;
-
-namespace System.Collections.Concurrent
-{
- /// <summary>
- /// Out-of-the-box partitioners are created with a set of default behaviors.
- /// For example, by default, some form of buffering and chunking will be employed to achieve
- /// optimal performance in the common scenario where an IEnumerable<> implementation is fast and
- /// non-blocking. These behaviors can be overridden via this enumeration.
- /// </summary>
- [Flags]
- public enum EnumerablePartitionerOptions
- {
- /// <summary>
- /// Use the default behavior (i.e., use buffering to achieve optimal performance)
- /// </summary>
- None = 0x0,
-
- /// <summary>
- /// Creates a partitioner that will take items from the source enumerable one at a time
- /// and will not use intermediate storage that can be accessed more efficiently by multiple threads.
- /// This option provides support for low latency (items will be processed as soon as they are available from
- /// the source) and partial support for dependencies between items (a thread cannot deadlock waiting for an item
- /// that it, itself, is responsible for processing).
- /// </summary>
- NoBuffering = 0x1
- }
-
- // The static class Partitioners implements 3 default partitioning strategies:
- // 1. dynamic load balance partitioning for indexable data source (IList and arrays)
- // 2. static partitioning for indexable data source (IList and arrays)
- // 3. dynamic load balance partitioning for enumerables. Enumerables have indexes, which are the natural order
- // of elements, but enuemrators are not indexable
- // - data source of type IList/arrays have both dynamic and static partitioning, as 1 and 3.
- // We assume that the source data of IList/Array is not changing concurrently.
- // - data source of type IEnumerable can only be partitioned dynamically (load-balance)
- // - Dynamic partitioning methods 1 and 3 are same, both being dynamic and load-balance. But the
- // implementation is different for data source of IList/Array vs. IEnumerable:
- // * When the source collection is IList/Arrays, we use Interlocked on the shared index;
- // * When the source collection is IEnumerable, we use Monitor to wrap around the access to the source
- // enumerator.
-
- /// <summary>
- /// Provides common partitioning strategies for arrays, lists, and enumerables.
- /// </summary>
- /// <remarks>
- /// <para>
- /// The static methods on <see cref="Partitioner"/> are all thread-safe and may be used concurrently
- /// from multiple threads. However, while a created partitioner is in use, the underlying data source
- /// should not be modified, whether from the same thread that's using a partitioner or from a separate
- /// thread.
- /// </para>
- /// </remarks>
- public static class Partitioner
- {
- /// <summary>
- /// Creates an orderable partitioner from an <see cref="System.Collections.Generic.IList{T}"/>
- /// instance.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in source list.</typeparam>
- /// <param name="list">The list to be partitioned.</param>
- /// <param name="loadBalance">
- /// A Boolean value that indicates whether the created partitioner should dynamically
- /// load balance between partitions rather than statically partition.
- /// </param>
- /// <returns>
- /// An orderable partitioner based on the input list.
- /// </returns>
- public static OrderablePartitioner<TSource> Create<TSource>(IList<TSource> list, bool loadBalance)
- {
- if (list == null)
- {
- throw new ArgumentNullException(nameof(list));
- }
- if (loadBalance)
- {
- return (new DynamicPartitionerForIList<TSource>(list));
- }
- else
- {
- return (new StaticIndexRangePartitionerForIList<TSource>(list));
- }
- }
-
- /// <summary>
- /// Creates an orderable partitioner from a <see cref="System.Array"/> instance.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in source array.</typeparam>
- /// <param name="array">The array to be partitioned.</param>
- /// <param name="loadBalance">
- /// A Boolean value that indicates whether the created partitioner should dynamically load balance
- /// between partitions rather than statically partition.
- /// </param>
- /// <returns>
- /// An orderable partitioner based on the input array.
- /// </returns>
- public static OrderablePartitioner<TSource> Create<TSource>(TSource[] array, bool loadBalance)
- {
- // This implementation uses 'ldelem' instructions for element retrieval, rather than using a
- // method call.
-
- if (array == null)
- {
- throw new ArgumentNullException(nameof(array));
- }
- if (loadBalance)
- {
- return (new DynamicPartitionerForArray<TSource>(array));
- }
- else
- {
- return (new StaticIndexRangePartitionerForArray<TSource>(array));
- }
- }
-
- /// <summary>
- /// Creates an orderable partitioner from a <see cref="System.Collections.Generic.IEnumerable{TSource}"/> instance.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in source enumerable.</typeparam>
- /// <param name="source">The enumerable to be partitioned.</param>
- /// <returns>
- /// An orderable partitioner based on the input array.
- /// </returns>
- /// <remarks>
- /// The ordering used in the created partitioner is determined by the natural order of the elements
- /// as retrieved from the source enumerable.
- /// </remarks>
- public static OrderablePartitioner<TSource> Create<TSource>(IEnumerable<TSource> source)
- {
- return Create<TSource>(source, EnumerablePartitionerOptions.None);
- }
-
- /// <summary>
- /// Creates an orderable partitioner from a <see cref="System.Collections.Generic.IEnumerable{TSource}"/> instance.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in source enumerable.</typeparam>
- /// <param name="source">The enumerable to be partitioned.</param>
- /// <param name="partitionerOptions">Options to control the buffering behavior of the partitioner.</param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The <paramref name="partitionerOptions"/> argument specifies an invalid value for <see
- /// cref="T:System.Collections.Concurrent.EnumerablePartitionerOptions"/>.
- /// </exception>
- /// <returns>
- /// An orderable partitioner based on the input array.
- /// </returns>
- /// <remarks>
- /// The ordering used in the created partitioner is determined by the natural order of the elements
- /// as retrieved from the source enumerable.
- /// </remarks>
- public static OrderablePartitioner<TSource> Create<TSource>(IEnumerable<TSource> source, EnumerablePartitionerOptions partitionerOptions)
- {
- if (source == null)
- {
- throw new ArgumentNullException(nameof(source));
- }
-
- if ((partitionerOptions & (~EnumerablePartitionerOptions.NoBuffering)) != 0)
- throw new ArgumentOutOfRangeException(nameof(partitionerOptions));
-
- return (new DynamicPartitionerForIEnumerable<TSource>(source, partitionerOptions));
- }
-
- /// <summary>Creates a partitioner that chunks the user-specified range.</summary>
- /// <param name="fromInclusive">The lower, inclusive bound of the range.</param>
- /// <param name="toExclusive">The upper, exclusive bound of the range.</param>
- /// <returns>A partitioner.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="toExclusive"/> argument is
- /// less than or equal to the <paramref name="fromInclusive"/> argument.</exception>
- public static OrderablePartitioner<Tuple<long, long>> Create(long fromInclusive, long toExclusive)
- {
- // How many chunks do we want to divide the range into? If this is 1, then the
- // answer is "one chunk per core". Generally, though, you'll achieve better
- // load balancing on a busy system if you make it higher than 1.
- int coreOversubscriptionRate = 3;
-
- if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException(nameof(toExclusive));
- long rangeSize = (toExclusive - fromInclusive) /
- (PlatformHelper.ProcessorCount * coreOversubscriptionRate);
- if (rangeSize == 0) rangeSize = 1;
- return Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize), EnumerablePartitionerOptions.NoBuffering); // chunk one range at a time
- }
-
- /// <summary>Creates a partitioner that chunks the user-specified range.</summary>
- /// <param name="fromInclusive">The lower, inclusive bound of the range.</param>
- /// <param name="toExclusive">The upper, exclusive bound of the range.</param>
- /// <param name="rangeSize">The size of each subrange.</param>
- /// <returns>A partitioner.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="toExclusive"/> argument is
- /// less than or equal to the <paramref name="fromInclusive"/> argument.</exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="rangeSize"/> argument is
- /// less than or equal to 0.</exception>
- public static OrderablePartitioner<Tuple<long, long>> Create(long fromInclusive, long toExclusive, long rangeSize)
- {
- if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException(nameof(toExclusive));
- if (rangeSize <= 0) throw new ArgumentOutOfRangeException(nameof(rangeSize));
- return Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize), EnumerablePartitionerOptions.NoBuffering); // chunk one range at a time
- }
-
- // Private method to parcel out range tuples.
- private static IEnumerable<Tuple<long, long>> CreateRanges(long fromInclusive, long toExclusive, long rangeSize)
- {
- // Enumerate all of the ranges
- long from, to;
- bool shouldQuit = false;
-
- for (long i = fromInclusive; (i < toExclusive) && !shouldQuit; i += rangeSize)
- {
- from = i;
- try { checked { to = i + rangeSize; } }
- catch (OverflowException)
- {
- to = toExclusive;
- shouldQuit = true;
- }
- if (to > toExclusive) to = toExclusive;
- yield return new Tuple<long, long>(from, to);
- }
- }
-
- /// <summary>Creates a partitioner that chunks the user-specified range.</summary>
- /// <param name="fromInclusive">The lower, inclusive bound of the range.</param>
- /// <param name="toExclusive">The upper, exclusive bound of the range.</param>
- /// <returns>A partitioner.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="toExclusive"/> argument is
- /// less than or equal to the <paramref name="fromInclusive"/> argument.</exception>
- public static OrderablePartitioner<Tuple<int, int>> Create(int fromInclusive, int toExclusive)
- {
- // How many chunks do we want to divide the range into? If this is 1, then the
- // answer is "one chunk per core". Generally, though, you'll achieve better
- // load balancing on a busy system if you make it higher than 1.
- int coreOversubscriptionRate = 3;
-
- if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException(nameof(toExclusive));
- int rangeSize = (toExclusive - fromInclusive) /
- (PlatformHelper.ProcessorCount * coreOversubscriptionRate);
- if (rangeSize == 0) rangeSize = 1;
- return Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize), EnumerablePartitionerOptions.NoBuffering); // chunk one range at a time
- }
-
- /// <summary>Creates a partitioner that chunks the user-specified range.</summary>
- /// <param name="fromInclusive">The lower, inclusive bound of the range.</param>
- /// <param name="toExclusive">The upper, exclusive bound of the range.</param>
- /// <param name="rangeSize">The size of each subrange.</param>
- /// <returns>A partitioner.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="toExclusive"/> argument is
- /// less than or equal to the <paramref name="fromInclusive"/> argument.</exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException"> The <paramref name="rangeSize"/> argument is
- /// less than or equal to 0.</exception>
- public static OrderablePartitioner<Tuple<int, int>> Create(int fromInclusive, int toExclusive, int rangeSize)
- {
- if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException(nameof(toExclusive));
- if (rangeSize <= 0) throw new ArgumentOutOfRangeException(nameof(rangeSize));
- return Partitioner.Create(CreateRanges(fromInclusive, toExclusive, rangeSize), EnumerablePartitionerOptions.NoBuffering); // chunk one range at a time
- }
-
- // Private method to parcel out range tuples.
- private static IEnumerable<Tuple<int, int>> CreateRanges(int fromInclusive, int toExclusive, int rangeSize)
- {
- // Enumerate all of the ranges
- int from, to;
- bool shouldQuit = false;
-
- for (int i = fromInclusive; (i < toExclusive) && !shouldQuit; i += rangeSize)
- {
- from = i;
- try { checked { to = i + rangeSize; } }
- catch (OverflowException)
- {
- to = toExclusive;
- shouldQuit = true;
- }
- if (to > toExclusive) to = toExclusive;
- yield return new Tuple<int, int>(from, to);
- }
- }
-
- #region DynamicPartitionEnumerator_Abstract class
- /// <summary>
- /// DynamicPartitionEnumerator_Abstract defines the enumerator for each partition for the dynamic load-balance
- /// partitioning algorithm.
- /// - Partition is an enumerator of KeyValuePairs, each corresponding to an item in the data source:
- /// the key is the index in the source collection; the value is the item itself.
- /// - a set of such partitions share a reader over data source. The type of the reader is specified by
- /// TSourceReader.
- /// - each partition requests a contiguous chunk of elements at a time from the source data. The chunk
- /// size is initially 1, and doubles every time until it reaches the maximum chunk size.
- /// The implementation for GrabNextChunk() method has two versions: one for data source of IndexRange
- /// types (IList and the array), one for data source of IEnumerable.
- /// - The method "Reset" is not supported for any partitioning algorithm.
- /// - The implementation for MoveNext() method is same for all dynanmic partitioners, so we provide it
- /// in this abstract class.
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in the data source</typeparam>
- /// <typeparam name="TSourceReader">Type of the reader on the data source</typeparam>
- //TSourceReader is
- // - IList<TSource>, when source data is IList<TSource>, the shared reader is source data itself
- // - TSource[], when source data is TSource[], the shared reader is source data itself
- // - IEnumerator<TSource>, when source data is IEnumerable<TSource>, and the shared reader is an
- // enumerator of the source data
- private abstract class DynamicPartitionEnumerator_Abstract<TSource, TSourceReader> : IEnumerator<KeyValuePair<long, TSource>>
- {
- //----------------- common fields and constructor for all dynamic partitioners -----------------
- //--- shared by all dervied class with souce data type: IList, Array, and IEnumerator
- protected readonly TSourceReader m_sharedReader;
-
- protected static int s_defaultMaxChunkSize = GetDefaultChunkSize<TSource>();
-
- //deferred allocating in MoveNext() with initial value 0, to avoid false sharing
- //we also use the fact that: (m_currentChunkSize==null) means MoveNext is never called on this enumerator
- protected SharedInt m_currentChunkSize;
-
- //deferring allocation in MoveNext() with initial value -1, to avoid false sharing
- protected SharedInt m_localOffset;
-
- private const int CHUNK_DOUBLING_RATE = 3; // Double the chunk size every this many grabs
- private int m_doublingCountdown; // Number of grabs remaining until chunk size doubles
- protected readonly int m_maxChunkSize; // s_defaultMaxChunkSize unless single-chunking is requested by the caller
-
- // m_sharedIndex shared by this set of partitions, and particularly when m_sharedReader is IEnuerable
- // it serves as tracking of the natual order of elements in m_sharedReader
- // the value of this field is passed in from outside (already initialized) by the constructor,
- protected readonly SharedLong m_sharedIndex;
-
- protected DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, SharedLong sharedIndex)
- : this(sharedReader, sharedIndex, false)
- {
- }
-
- protected DynamicPartitionEnumerator_Abstract(TSourceReader sharedReader, SharedLong sharedIndex, bool useSingleChunking)
- {
- m_sharedReader = sharedReader;
- m_sharedIndex = sharedIndex;
- m_maxChunkSize = useSingleChunking ? 1 : s_defaultMaxChunkSize;
- }
-
- // ---------------- abstract method declarations --------------
-
- /// <summary>
- /// Abstract method to request a contiguous chunk of elements from the source collection
- /// </summary>
- /// <param name="requestedChunkSize">specified number of elements requested</param>
- /// <returns>
- /// true if we successfully reserved at least one element (up to #=requestedChunkSize)
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- //GrabNextChunk does the following:
- // - grab # of requestedChunkSize elements from source data through shared reader,
- // - at the time of function returns, m_currentChunkSize is updated with the number of
- // elements actually got assigned (<=requestedChunkSize).
- // - GrabNextChunk returns true if at least one element is assigned to this partition;
- // false if the shared reader already hits the last element of the source data before
- // we call GrabNextChunk
- protected abstract bool GrabNextChunk(int requestedChunkSize);
-
- /// <summary>
- /// Abstract property, returns whether or not the shared reader has already read the last
- /// element of the source data
- /// </summary>
- protected abstract bool HasNoElementsLeft { get; set; }
-
- /// <summary>
- /// Get the current element in the current partition. Property required by IEnumerator interface
- /// This property is abstract because the implementation is different depending on the type
- /// of the source data: IList, Array or IEnumerable
- /// </summary>
- public abstract KeyValuePair<long, TSource> Current { get; }
-
- /// <summary>
- /// Dispose is abstract, and depends on the type of the source data:
- /// - For source data type IList and Array, the type of the shared reader is just the dataitself.
- /// We don't do anything in Dispose method for IList and Array.
- /// - For source data type IEnumerable, the type of the shared reader is an enumerator we created.
- /// Thus we need to dispose this shared reader enumerator, when there is no more active partitions
- /// left.
- /// </summary>
- public abstract void Dispose();
-
- /// <summary>
- /// Reset on partitions is not supported
- /// </summary>
- public void Reset()
- {
- throw new NotSupportedException();
- }
-
-
- /// <summary>
- /// Get the current element in the current partition. Property required by IEnumerator interface
- /// </summary>
- Object IEnumerator.Current
- {
- get
- {
- return ((DynamicPartitionEnumerator_Abstract<TSource, TSourceReader>)this).Current;
- }
- }
-
- /// <summary>
- /// Moves to the next element if any.
- /// Try current chunk first, if the current chunk do not have any elements left, then we
- /// attempt to grab a chunk from the source collection.
- /// </summary>
- /// <returns>
- /// true if successfully moving to the next position;
- /// false otherwise, if and only if there is no more elements left in the current chunk
- /// AND the source collection is exhausted.
- /// </returns>
- public bool MoveNext()
- {
- //perform deferred allocating of the local variables.
- if (m_localOffset == null)
- {
- Debug.Assert(m_currentChunkSize == null);
- m_localOffset = new SharedInt(-1);
- m_currentChunkSize = new SharedInt(0);
- m_doublingCountdown = CHUNK_DOUBLING_RATE;
- }
-
- if (m_localOffset.Value < m_currentChunkSize.Value - 1)
- //attempt to grab the next element from the local chunk
- {
- m_localOffset.Value++;
- return true;
- }
- else
- //otherwise it means we exhausted the local chunk
- //grab a new chunk from the source enumerator
- {
- // The second part of the || condition is necessary to handle the case when MoveNext() is called
- // after a previous MoveNext call returned false.
- Debug.Assert(m_localOffset.Value == m_currentChunkSize.Value - 1 || m_currentChunkSize.Value == 0);
-
- //set the requested chunk size to a proper value
- int requestedChunkSize;
- if (m_currentChunkSize.Value == 0) //first time grabbing from source enumerator
- {
- requestedChunkSize = 1;
- }
- else if (m_doublingCountdown > 0)
- {
- requestedChunkSize = m_currentChunkSize.Value;
- }
- else
- {
- requestedChunkSize = Math.Min(m_currentChunkSize.Value * 2, m_maxChunkSize);
- m_doublingCountdown = CHUNK_DOUBLING_RATE; // reset
- }
-
- // Decrement your doubling countdown
- m_doublingCountdown--;
-
- Debug.Assert(requestedChunkSize > 0 && requestedChunkSize <= m_maxChunkSize);
- //GrabNextChunk will update the value of m_currentChunkSize
- if (GrabNextChunk(requestedChunkSize))
- {
- Debug.Assert(m_currentChunkSize.Value <= requestedChunkSize && m_currentChunkSize.Value > 0);
- m_localOffset.Value = 0;
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- }
- #endregion
-
- #region Dynamic Partitioner for source data of IEnuemrable<> type
- /// <summary>
- /// Inherits from DynamicPartitioners
- /// Provides customized implementation of GetOrderableDynamicPartitions_Factory method, to return an instance
- /// of EnumerableOfPartitionsForIEnumerator defined internally
- /// </summary>
- /// <typeparam name="TSource">Type of elements in the source data</typeparam>
- private class DynamicPartitionerForIEnumerable<TSource> : OrderablePartitioner<TSource>
- {
- IEnumerable<TSource> m_source;
- readonly bool m_useSingleChunking;
-
- //constructor
- internal DynamicPartitionerForIEnumerable(IEnumerable<TSource> source, EnumerablePartitionerOptions partitionerOptions)
- : base(true, false, true)
- {
- m_source = source;
- m_useSingleChunking = ((partitionerOptions & EnumerablePartitionerOptions.NoBuffering) != 0);
- }
-
- /// <summary>
- /// Overrides OrderablePartitioner.GetOrderablePartitions.
- /// Partitions the underlying collection into the given number of orderable partitions.
- /// </summary>
- /// <param name="partitionCount">number of partitions requested</param>
- /// <returns>A list containing <paramref name="partitionCount"/> enumerators.</returns>
- override public IList<IEnumerator<KeyValuePair<long, TSource>>> GetOrderablePartitions(int partitionCount)
- {
- if (partitionCount <= 0)
- {
- throw new ArgumentOutOfRangeException(nameof(partitionCount));
- }
- IEnumerator<KeyValuePair<long, TSource>>[] partitions
- = new IEnumerator<KeyValuePair<long, TSource>>[partitionCount];
-
- IEnumerable<KeyValuePair<long, TSource>> partitionEnumerable = new InternalPartitionEnumerable(m_source.GetEnumerator(), m_useSingleChunking, true);
- for (int i = 0; i < partitionCount; i++)
- {
- partitions[i] = partitionEnumerable.GetEnumerator();
- }
- return partitions;
- }
-
- /// <summary>
- /// Overrides OrderablePartitioner.GetOrderableDyanmicPartitions
- /// </summary>
- /// <returns>a enumerable collection of orderable partitions</returns>
- override public IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions()
- {
- return new InternalPartitionEnumerable(m_source.GetEnumerator(), m_useSingleChunking, false);
- }
-
- /// <summary>
- /// Whether additional partitions can be created dynamically.
- /// </summary>
- override public bool SupportsDynamicPartitions
- {
- get { return true; }
- }
-
- #region Internal classes: InternalPartitionEnumerable, InternalPartitionEnumerator
- /// <summary>
- /// Provides customized implementation for source data of IEnumerable
- /// Different from the counterpart for IList/Array, this enumerable maintains several additional fields
- /// shared by the partitions it owns, including a boolean "m_hasNoElementsLef", a shared lock, and a
- /// shared count "m_activePartitionCount" used to track active partitions when they were created statically
- /// </summary>
- private class InternalPartitionEnumerable : IEnumerable<KeyValuePair<long, TSource>>, IDisposable
- {
- //reader through which we access the source data
- private readonly IEnumerator<TSource> m_sharedReader;
- private SharedLong m_sharedIndex;//initial value -1
-
- private volatile KeyValuePair<long, TSource>[] m_FillBuffer; // intermediate buffer to reduce locking
- private volatile int m_FillBufferSize; // actual number of elements in m_FillBuffer. Will start
- // at m_FillBuffer.Length, and might be reduced during the last refill
- private volatile int m_FillBufferCurrentPosition; //shared value to be accessed by Interlock.Increment only
- private volatile int m_activeCopiers; //number of active copiers
-
- //fields shared by all partitions that this Enumerable owns, their allocation is deferred
- private SharedBool m_hasNoElementsLeft; // no elements left at all.
- private SharedBool m_sourceDepleted; // no elements left in the enumerator, but there may be elements in the Fill Buffer
-
- //shared synchronization lock, created by this Enumerable
- private object m_sharedLock;//deferring allocation by enumerator
-
- private bool m_disposed;
-
- // If dynamic partitioning, then m_activePartitionCount == null
- // If static partitioning, then it keeps track of active partition count
- private SharedInt m_activePartitionCount;
-
- // records whether or not the user has requested single-chunking behavior
- private readonly bool m_useSingleChunking;
-
- internal InternalPartitionEnumerable(IEnumerator<TSource> sharedReader, bool useSingleChunking, bool isStaticPartitioning)
- {
- m_sharedReader = sharedReader;
- m_sharedIndex = new SharedLong(-1);
- m_hasNoElementsLeft = new SharedBool(false);
- m_sourceDepleted = new SharedBool(false);
- m_sharedLock = new object();
- m_useSingleChunking = useSingleChunking;
-
- // Only allocate the fill-buffer if single-chunking is not in effect
- if (!m_useSingleChunking)
- {
- // Time to allocate the fill buffer which is used to reduce the contention on the shared lock.
- // First pick the buffer size multiplier. We use 4 for when there are more than 4 cores, and just 1 for below. This is based on empirical evidence.
- int fillBufferMultiplier = (PlatformHelper.ProcessorCount > 4) ? 4 : 1;
-
- // and allocate the fill buffer using these two numbers
- m_FillBuffer = new KeyValuePair<long, TSource>[fillBufferMultiplier * Partitioner.GetDefaultChunkSize<TSource>()];
- }
-
- if (isStaticPartitioning)
- {
- // If this object is created for static partitioning (ie. via GetPartitions(int partitionCount),
- // GetOrderablePartitions(int partitionCount)), we track the active partitions, in order to dispose
- // this object when all the partitions have been disposed.
- m_activePartitionCount = new SharedInt(0);
- }
- else
- {
- // Otherwise this object is created for dynamic partitioning (ie, via GetDynamicPartitions(),
- // GetOrderableDynamicPartitions()), we do not need tracking. This object must be disposed
- // explicitly
- m_activePartitionCount = null;
- }
- }
-
- public IEnumerator<KeyValuePair<long, TSource>> GetEnumerator()
- {
- if (m_disposed)
- {
- throw new ObjectDisposedException(Environment.GetResourceString("PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed"));
- }
- else
- {
- return new InternalPartitionEnumerator(m_sharedReader, m_sharedIndex,
- m_hasNoElementsLeft, m_sharedLock, m_activePartitionCount, this, m_useSingleChunking);
- }
- }
-
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((InternalPartitionEnumerable)this).GetEnumerator();
- }
-
-
- ///////////////////
- //
- // Used by GrabChunk_Buffered()
- private void TryCopyFromFillBuffer(KeyValuePair<long, TSource>[] destArray,
- int requestedChunkSize,
- ref int actualNumElementsGrabbed)
- {
- actualNumElementsGrabbed = 0;
-
-
- // making a local defensive copy of the fill buffer reference, just in case it gets nulled out
- KeyValuePair<long, TSource>[] fillBufferLocalRef = m_FillBuffer;
- if (fillBufferLocalRef == null) return;
-
- // first do a quick check, and give up if the current position is at the end
- // so that we don't do an unncessary pair of Interlocked.Increment / Decrement calls
- if (m_FillBufferCurrentPosition >= m_FillBufferSize)
- {
- return; // no elements in the buffer to copy from
- }
-
- // We might have a chance to grab elements from the buffer. We will know for sure
- // when we do the Interlocked.Add below.
- // But first we must register as a potential copier in order to make sure
- // the elements we're copying from don't get overwritten by another thread
- // that starts refilling the buffer right after our Interlocked.Add.
- Interlocked.Increment(ref m_activeCopiers);
-
- int endPos = Interlocked.Add(ref m_FillBufferCurrentPosition, requestedChunkSize);
- int beginPos = endPos - requestedChunkSize;
-
- if (beginPos < m_FillBufferSize)
- {
- // adjust index and do the actual copy
- actualNumElementsGrabbed = (endPos < m_FillBufferSize) ? endPos : m_FillBufferSize - beginPos;
- Array.Copy(fillBufferLocalRef, beginPos, destArray, 0, actualNumElementsGrabbed);
- }
-
- // let the record show we are no longer accessing the buffer
- Interlocked.Decrement(ref m_activeCopiers);
- }
-
- /// <summary>
- /// This is the common entry point for consuming items from the source enumerable
- /// </summary>
- /// <returns>
- /// true if we successfully reserved at least one element
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- internal bool GrabChunk(KeyValuePair<long, TSource>[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
- {
- actualNumElementsGrabbed = 0;
-
- if (m_hasNoElementsLeft.Value)
- {
- return false;
- }
-
- if (m_useSingleChunking)
- {
- return GrabChunk_Single(destArray, requestedChunkSize, ref actualNumElementsGrabbed);
- }
- else
- {
- return GrabChunk_Buffered(destArray, requestedChunkSize, ref actualNumElementsGrabbed);
- }
- }
-
- /// <summary>
- /// Version of GrabChunk that grabs a single element at a time from the source enumerable
- /// </summary>
- /// <returns>
- /// true if we successfully reserved an element
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- internal bool GrabChunk_Single(KeyValuePair<long,TSource>[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
- {
- Debug.Assert(m_useSingleChunking, "Expected m_useSingleChecking to be true");
- Debug.Assert(requestedChunkSize == 1, "Got requested chunk size of " + requestedChunkSize + " when single-chunking was on");
- Debug.Assert(actualNumElementsGrabbed == 0, "Expected actualNumElementsGrabbed == 0, instead it is " + actualNumElementsGrabbed);
- Debug.Assert(destArray.Length == 1, "Expected destArray to be of length 1, instead its length is " + destArray.Length);
-
- lock (m_sharedLock)
- {
- if (m_hasNoElementsLeft.Value) return false;
-
- try
- {
- if (m_sharedReader.MoveNext())
- {
- m_sharedIndex.Value = checked(m_sharedIndex.Value + 1);
- destArray[0]
- = new KeyValuePair<long, TSource>(m_sharedIndex.Value,
- m_sharedReader.Current);
- actualNumElementsGrabbed = 1;
- return true;
- }
- else
- {
- //if MoveNext() return false, we set the flag to inform other partitions
- m_sourceDepleted.Value = true;
- m_hasNoElementsLeft.Value = true;
- return false;
- }
- }
- catch
- {
- // On an exception, make sure that no additional items are hereafter enumerated
- m_sourceDepleted.Value = true;
- m_hasNoElementsLeft.Value = true;
- throw;
- }
- }
- }
-
-
-
- /// <summary>
- /// Version of GrabChunk that uses buffering scheme to grab items out of source enumerable
- /// </summary>
- /// <returns>
- /// true if we successfully reserved at least one element (up to #=requestedChunkSize)
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- internal bool GrabChunk_Buffered(KeyValuePair<long,TSource>[] destArray, int requestedChunkSize, ref int actualNumElementsGrabbed)
- {
- Debug.Assert(requestedChunkSize > 0);
- Debug.Assert(!m_useSingleChunking, "Did not expect to be in single-chunking mode");
-
- TryCopyFromFillBuffer(destArray, requestedChunkSize, ref actualNumElementsGrabbed);
-
- if (actualNumElementsGrabbed == requestedChunkSize)
- {
- // that was easy.
- return true;
- }
- else if (m_sourceDepleted.Value)
- {
- // looks like we both reached the end of the fill buffer, and the source was depleted previously
- // this means no more work to do for any other worker
- m_hasNoElementsLeft.Value = true;
- m_FillBuffer = null;
- return (actualNumElementsGrabbed > 0);
- }
-
-
- //
- // now's the time to take the shared lock and enumerate
- //
- lock (m_sharedLock)
- {
- if (m_sourceDepleted.Value)
- {
- return (actualNumElementsGrabbed > 0);
- }
-
- try
- {
- // we need to make sure all array copiers are finished
- if (m_activeCopiers > 0)
- {
- SpinWait sw = new SpinWait();
- while( m_activeCopiers > 0) sw.SpinOnce();
- }
-
- Debug.Assert(m_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk
-
- // Now's the time to actually enumerate the source
-
- // We first fill up the requested # of elements in the caller's array
- // continue from the where TryCopyFromFillBuffer() left off
- for (; actualNumElementsGrabbed < requestedChunkSize; actualNumElementsGrabbed++)
- {
- if (m_sharedReader.MoveNext())
- {
- m_sharedIndex.Value = checked(m_sharedIndex.Value + 1);
- destArray[actualNumElementsGrabbed]
- = new KeyValuePair<long, TSource>(m_sharedIndex.Value,
- m_sharedReader.Current);
- }
- else
- {
- //if MoveNext() return false, we set the flag to inform other partitions
- m_sourceDepleted.Value = true;
- break;
- }
- }
-
- // taking a local snapshot of m_FillBuffer in case some other thread decides to null out m_FillBuffer
- // in the entry of this method after observing m_sourceCompleted = true
- var localFillBufferRef = m_FillBuffer;
-
- // If the big buffer seems to be depleted, we will also fill that up while we are under the lock
- // Note that this is the only place that m_FillBufferCurrentPosition can be reset
- if (m_sourceDepleted.Value == false && localFillBufferRef != null &&
- m_FillBufferCurrentPosition >= localFillBufferRef.Length)
- {
- for (int i = 0; i < localFillBufferRef.Length; i++)
- {
- if( m_sharedReader.MoveNext())
- {
- m_sharedIndex.Value = checked(m_sharedIndex.Value + 1);
- localFillBufferRef[i]
- = new KeyValuePair<long, TSource>(m_sharedIndex.Value,
- m_sharedReader.Current);
- }
- else
- {
- // No more elements left in the enumerator.
- // Record this, so that the next request can skip the lock
- m_sourceDepleted.Value = true;
-
- // also record the current count in m_FillBufferSize
- m_FillBufferSize = i;
-
- // and exit the for loop so that we don't keep incrementing m_FillBufferSize
- break;
- }
-
- }
-
- m_FillBufferCurrentPosition = 0;
- }
-
-
- }
- catch
- {
- // If an exception occurs, don't let the other enumerators try to enumerate.
- // NOTE: this could instead throw an InvalidOperationException, but that would be unexpected
- // and not helpful to the end user. We know the root cause is being communicated already.)
- m_sourceDepleted.Value = true;
- m_hasNoElementsLeft.Value = true;
- throw;
- }
- }
-
- return (actualNumElementsGrabbed > 0);
- }
-
- public void Dispose()
- {
- if (!m_disposed)
- {
- m_disposed = true;
- m_sharedReader.Dispose();
- }
- }
- }
-
- /// <summary>
- /// Inherits from DynamicPartitionEnumerator_Abstract directly
- /// Provides customized implementation for: GrabNextChunk, HasNoElementsLeft, Current, Dispose
- /// </summary>
- private class InternalPartitionEnumerator : DynamicPartitionEnumerator_Abstract<TSource, IEnumerator<TSource>>
- {
- //---- fields ----
- //cached local copy of the current chunk
- private KeyValuePair<long, TSource>[] m_localList; //defer allocating to avoid false sharing
-
- // the values of the following two fields are passed in from
- // outside(already initialized) by the constructor,
- private readonly SharedBool m_hasNoElementsLeft;
- private readonly object m_sharedLock;
- private readonly SharedInt m_activePartitionCount;
- private InternalPartitionEnumerable m_enumerable;
-
- //constructor
- internal InternalPartitionEnumerator(
- IEnumerator<TSource> sharedReader,
- SharedLong sharedIndex,
- SharedBool hasNoElementsLeft,
- object sharedLock,
- SharedInt activePartitionCount,
- InternalPartitionEnumerable enumerable,
- bool useSingleChunking)
- : base(sharedReader, sharedIndex, useSingleChunking)
- {
- m_hasNoElementsLeft = hasNoElementsLeft;
- m_sharedLock = sharedLock;
- m_enumerable = enumerable;
- m_activePartitionCount = activePartitionCount;
-
- if (m_activePartitionCount != null)
- {
- // If static partitioning, we need to increase the active partition count.
- Interlocked.Increment(ref m_activePartitionCount.Value);
- }
- }
-
- //overriding methods
-
- /// <summary>
- /// Reserves a contiguous range of elements from source data
- /// </summary>
- /// <param name="requestedChunkSize">specified number of elements requested</param>
- /// <returns>
- /// true if we successfully reserved at least one element (up to #=requestedChunkSize)
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- override protected bool GrabNextChunk(int requestedChunkSize)
- {
- Debug.Assert(requestedChunkSize > 0);
-
- if (HasNoElementsLeft)
- {
- return false;
- }
-
- // defer allocation to avoid false sharing
- if (m_localList == null)
- {
- m_localList = new KeyValuePair<long, TSource>[m_maxChunkSize];
- }
-
- // make the actual call to the enumerable that grabs a chunk
- return m_enumerable.GrabChunk(m_localList, requestedChunkSize, ref m_currentChunkSize.Value);
- }
-
- /// <summary>
- /// Returns whether or not the shared reader has already read the last
- /// element of the source data
- /// </summary>
- /// <remarks>
- /// We cannot call m_sharedReader.MoveNext(), to see if it hits the last element
- /// or not, because we can't undo MoveNext(). Thus we need to maintain a shared
- /// boolean value m_hasNoElementsLeft across all partitions
- /// </remarks>
- override protected bool HasNoElementsLeft
- {
- get { return m_hasNoElementsLeft.Value; }
- set
- {
- //we only set it from false to true once
- //we should never set it back in any circumstances
- Debug.Assert(value);
- Debug.Assert(!m_hasNoElementsLeft.Value);
- m_hasNoElementsLeft.Value = true;
- }
- }
-
- override public KeyValuePair<long, TSource> Current
- {
- get
- {
- //verify that MoveNext is at least called once before Current is called
- if (m_currentChunkSize == null)
- {
- throw new InvalidOperationException(Environment.GetResourceString("PartitionerStatic_CurrentCalledBeforeMoveNext"));
- }
- Debug.Assert(m_localList != null);
- Debug.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value);
- return (m_localList[m_localOffset.Value]);
- }
- }
-
- override public void Dispose()
- {
- // If this is static partitioning, ie. m_activePartitionCount != null, since the current partition
- // is disposed, we decrement the number of active partitions for the shared reader.
- if (m_activePartitionCount != null && Interlocked.Decrement(ref m_activePartitionCount.Value) == 0)
- {
- // If the number of active partitions becomes 0, we need to dispose the shared
- // reader we created in the m_enumerable object.
- m_enumerable.Dispose();
- }
- // If this is dynamic partitioning, ie. m_activePartitionCount != null, then m_enumerable needs to
- // be disposed explicitly by the user, and we do not need to anything here
- }
- }
- #endregion
-
- }
- #endregion
-
- #region Dynamic Partitioner for source data of IndexRange types (IList<> and Array<>)
- /// <summary>
- /// Dynamic load-balance partitioner. This class is abstract and to be derived from by
- /// the customized partitioner classes for IList, Array, and IEnumerable
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in the source data</typeparam>
- /// <typeparam name="TCollection"> Type of the source data collection</typeparam>
- private abstract class DynamicPartitionerForIndexRange_Abstract<TSource, TCollection> : OrderablePartitioner<TSource>
- {
- // TCollection can be: IList<TSource>, TSource[] and IEnumerable<TSource>
- // Derived classes specify TCollection, and implement the abstract method GetOrderableDynamicPartitions_Factory accordingly
- TCollection m_data;
-
- /// <summary>
- /// Constructs a new orderable partitioner
- /// </summary>
- /// <param name="data">source data collection</param>
- protected DynamicPartitionerForIndexRange_Abstract(TCollection data)
- : base(true, false, true)
- {
- m_data = data;
- }
-
- /// <summary>
- /// Partition the source data and create an enumerable over the resulting partitions.
- /// </summary>
- /// <param name="data">the source data collection</param>
- /// <returns>an enumerable of partitions of </returns>
- protected abstract IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions_Factory(TCollection data);
-
- /// <summary>
- /// Overrides OrderablePartitioner.GetOrderablePartitions.
- /// Partitions the underlying collection into the given number of orderable partitions.
- /// </summary>
- /// <param name="partitionCount">number of partitions requested</param>
- /// <returns>A list containing <paramref name="partitionCount"/> enumerators.</returns>
- override public IList<IEnumerator<KeyValuePair<long, TSource>>> GetOrderablePartitions(int partitionCount)
- {
- if (partitionCount <= 0)
- {
- throw new ArgumentOutOfRangeException(nameof(partitionCount));
- }
- IEnumerator<KeyValuePair<long, TSource>>[] partitions
- = new IEnumerator<KeyValuePair<long, TSource>>[partitionCount];
- IEnumerable<KeyValuePair<long, TSource>> partitionEnumerable = GetOrderableDynamicPartitions_Factory(m_data);
- for (int i = 0; i < partitionCount; i++)
- {
- partitions[i] = partitionEnumerable.GetEnumerator();
- }
- return partitions;
- }
-
- /// <summary>
- /// Overrides OrderablePartitioner.GetOrderableDyanmicPartitions
- /// </summary>
- /// <returns>a enumerable collection of orderable partitions</returns>
- override public IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions()
- {
- return GetOrderableDynamicPartitions_Factory(m_data);
- }
-
- /// <summary>
- /// Whether additional partitions can be created dynamically.
- /// </summary>
- override public bool SupportsDynamicPartitions
- {
- get { return true; }
- }
-
- }
-
- /// <summary>
- /// Defines dynamic partition for source data of IList and Array.
- /// This class inherits DynamicPartitionEnumerator_Abstract
- /// - implements GrabNextChunk, HasNoElementsLeft, and Dispose methods for IList and Array
- /// - Current property still remains abstract, implementation is different for IList and Array
- /// - introduces another abstract method SourceCount, which returns the number of elements in
- /// the source data. Implementation differs for IList and Array
- /// </summary>
- /// <typeparam name="TSource">Type of the elements in the data source</typeparam>
- /// <typeparam name="TSourceReader">Type of the reader on the source data</typeparam>
- private abstract class DynamicPartitionEnumeratorForIndexRange_Abstract<TSource, TSourceReader> : DynamicPartitionEnumerator_Abstract<TSource, TSourceReader>
- {
- //fields
- protected int m_startIndex; //initially zero
-
- //constructor
- protected DynamicPartitionEnumeratorForIndexRange_Abstract(TSourceReader sharedReader, SharedLong sharedIndex)
- : base(sharedReader, sharedIndex)
- {
- }
-
- //abstract methods
- //the Current property is still abstract, and will be implemented by derived classes
- //we add another abstract method SourceCount to get the number of elements from the source reader
-
- /// <summary>
- /// Get the number of elements from the source reader.
- /// It calls IList.Count or Array.Length
- /// </summary>
- protected abstract int SourceCount { get; }
-
- //overriding methods
-
- /// <summary>
- /// Reserves a contiguous range of elements from source data
- /// </summary>
- /// <param name="requestedChunkSize">specified number of elements requested</param>
- /// <returns>
- /// true if we successfully reserved at least one element (up to #=requestedChunkSize)
- /// false if all elements in the source collection have been reserved.
- /// </returns>
- override protected bool GrabNextChunk(int requestedChunkSize)
- {
- Debug.Assert(requestedChunkSize > 0);
-
- while (!HasNoElementsLeft)
- {
- Debug.Assert(m_sharedIndex != null);
- // use the new Volatile.Read method because it is cheaper than Interlocked.Read on AMD64 architecture
- long oldSharedIndex = Volatile.Read(ref m_sharedIndex.Value);
-
- if (HasNoElementsLeft)
- {
- //HasNoElementsLeft situation changed from false to true immediately
- //and oldSharedIndex becomes stale
- return false;
- }
-
- //there won't be overflow, because the index of IList/array is int, and we
- //have casted it to long.
- long newSharedIndex = Math.Min(SourceCount - 1, oldSharedIndex + requestedChunkSize);
-
-
- //the following CAS, if successful, reserves a chunk of elements [oldSharedIndex+1, newSharedIndex]
- //inclusive in the source collection
- if (Interlocked.CompareExchange(ref m_sharedIndex.Value, newSharedIndex, oldSharedIndex)
- == oldSharedIndex)
- {
- //set up local indexes.
- //m_currentChunkSize is always set to requestedChunkSize when source data had
- //enough elements of what we requested
- m_currentChunkSize.Value = (int)(newSharedIndex - oldSharedIndex);
- m_localOffset.Value = -1;
- m_startIndex = (int)(oldSharedIndex + 1);
- return true;
- }
- }
- //didn't get any element, return false;
- return false;
- }
-
- /// <summary>
- /// Returns whether or not the shared reader has already read the last
- /// element of the source data
- /// </summary>
- override protected bool HasNoElementsLeft
- {
- get
- {
- Debug.Assert(m_sharedIndex != null);
- // use the new Volatile.Read method because it is cheaper than Interlocked.Read on AMD64 architecture
- return Volatile.Read(ref m_sharedIndex.Value) >= SourceCount - 1;
- }
- set
- {
- Debug.Assert(false);
- }
- }
-
- /// <summary>
- /// For source data type IList and Array, the type of the shared reader is just the data itself.
- /// We don't do anything in Dispose method for IList and Array.
- /// </summary>
- override public void Dispose()
- { }
- }
-
-
- /// <summary>
- /// Inherits from DynamicPartitioners
- /// Provides customized implementation of GetOrderableDynamicPartitions_Factory method, to return an instance
- /// of EnumerableOfPartitionsForIList defined internally
- /// </summary>
- /// <typeparam name="TSource">Type of elements in the source data</typeparam>
- private class DynamicPartitionerForIList<TSource> : DynamicPartitionerForIndexRange_Abstract<TSource, IList<TSource>>
- {
- //constructor
- internal DynamicPartitionerForIList(IList<TSource> source)
- : base(source)
- { }
-
- //override methods
- override protected IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions_Factory(IList<TSource> m_data)
- {
- //m_data itself serves as shared reader
- return new InternalPartitionEnumerable(m_data);
- }
-
- /// <summary>
- /// Inherits from PartitionList_Abstract
- /// Provides customized implementation for source data of IList
- /// </summary>
- private class InternalPartitionEnumerable : IEnumerable<KeyValuePair<long, TSource>>
- {
- //reader through which we access the source data
- private readonly IList<TSource> m_sharedReader;
- private SharedLong m_sharedIndex;
-
- internal InternalPartitionEnumerable(IList<TSource> sharedReader)
- {
- m_sharedReader = sharedReader;
- m_sharedIndex = new SharedLong(-1);
- }
-
- public IEnumerator<KeyValuePair<long, TSource>> GetEnumerator()
- {
- return new InternalPartitionEnumerator(m_sharedReader, m_sharedIndex);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((InternalPartitionEnumerable)this).GetEnumerator();
- }
- }
-
- /// <summary>
- /// Inherits from DynamicPartitionEnumeratorForIndexRange_Abstract
- /// Provides customized implementation of SourceCount property and Current property for IList
- /// </summary>
- private class InternalPartitionEnumerator : DynamicPartitionEnumeratorForIndexRange_Abstract<TSource, IList<TSource>>
- {
- //constructor
- internal InternalPartitionEnumerator(IList<TSource> sharedReader, SharedLong sharedIndex)
- : base(sharedReader, sharedIndex)
- { }
-
- //overriding methods
- override protected int SourceCount
- {
- get { return m_sharedReader.Count; }
- }
- /// <summary>
- /// return a KeyValuePair of the current element and its key
- /// </summary>
- override public KeyValuePair<long, TSource> Current
- {
- get
- {
- //verify that MoveNext is at least called once before Current is called
- if (m_currentChunkSize == null)
- {
- throw new InvalidOperationException(Environment.GetResourceString("PartitionerStatic_CurrentCalledBeforeMoveNext"));
- }
-
- Debug.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value);
- return new KeyValuePair<long, TSource>(m_startIndex + m_localOffset.Value,
- m_sharedReader[m_startIndex + m_localOffset.Value]);
- }
- }
- }
- }
-
-
-
- /// <summary>
- /// Inherits from DynamicPartitioners
- /// Provides customized implementation of GetOrderableDynamicPartitions_Factory method, to return an instance
- /// of EnumerableOfPartitionsForArray defined internally
- /// </summary>
- /// <typeparam name="TSource">Type of elements in the source data</typeparam>
- private class DynamicPartitionerForArray<TSource> : DynamicPartitionerForIndexRange_Abstract<TSource, TSource[]>
- {
- //constructor
- internal DynamicPartitionerForArray(TSource[] source)
- : base(source)
- { }
-
- //override methods
- override protected IEnumerable<KeyValuePair<long, TSource>> GetOrderableDynamicPartitions_Factory(TSource[] m_data)
- {
- return new InternalPartitionEnumerable(m_data);
- }
-
- /// <summary>
- /// Inherits from PartitionList_Abstract
- /// Provides customized implementation for source data of Array
- /// </summary>
- private class InternalPartitionEnumerable : IEnumerable<KeyValuePair<long, TSource>>
- {
- //reader through which we access the source data
- private readonly TSource[] m_sharedReader;
- private SharedLong m_sharedIndex;
-
- internal InternalPartitionEnumerable(TSource[] sharedReader)
- {
- m_sharedReader = sharedReader;
- m_sharedIndex = new SharedLong(-1);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((InternalPartitionEnumerable)this).GetEnumerator();
- }
-
-
- public IEnumerator<KeyValuePair<long, TSource>> GetEnumerator()
- {
- return new InternalPartitionEnumerator(m_sharedReader, m_sharedIndex);
- }
- }
-
- /// <summary>
- /// Inherits from DynamicPartitionEnumeratorForIndexRange_Abstract
- /// Provides customized implementation of SourceCount property and Current property for Array
- /// </summary>
- private class InternalPartitionEnumerator : DynamicPartitionEnumeratorForIndexRange_Abstract<TSource, TSource[]>
- {
- //constructor
- internal InternalPartitionEnumerator(TSource[] sharedReader, SharedLong sharedIndex)
- : base(sharedReader, sharedIndex)
- { }
-
- //overriding methods
- override protected int SourceCount
- {
- get { return m_sharedReader.Length; }
- }
-
- override public KeyValuePair<long, TSource> Current
- {
- get
- {
- //verify that MoveNext is at least called once before Current is called
- if (m_currentChunkSize == null)
- {
- throw new InvalidOperationException(Environment.GetResourceString("PartitionerStatic_CurrentCalledBeforeMoveNext"));
- }
-
- Debug.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value);
- return new KeyValuePair<long, TSource>(m_startIndex + m_localOffset.Value,
- m_sharedReader[m_startIndex + m_localOffset.Value]);
- }
- }
- }
- }
- #endregion
-
-
- #region Static partitioning for IList and Array, abstract classes
- /// <summary>
- /// Static partitioning over IList.
- /// - dynamic and load-balance
- /// - Keys are ordered within each partition
- /// - Keys are ordered across partitions
- /// - Keys are normalized
- /// - Number of partitions is fixed once specified, and the elements of the source data are
- /// distributed to each partition as evenly as possible.
- /// </summary>
- /// <typeparam name="TSource">type of the elements</typeparam>
- /// <typeparam name="TCollection">Type of the source data collection</typeparam>
- private abstract class StaticIndexRangePartitioner<TSource, TCollection> : OrderablePartitioner<TSource>
- {
- protected StaticIndexRangePartitioner()
- : base(true, true, true)
- { }
-
- /// <summary>
- /// Abstract method to return the number of elements in the source data
- /// </summary>
- protected abstract int SourceCount { get; }
-
- /// <summary>
- /// Abstract method to create a partition that covers a range over source data,
- /// starting from "startIndex", ending at "endIndex"
- /// </summary>
- /// <param name="startIndex">start index of the current partition on the source data</param>
- /// <param name="endIndex">end index of the current partition on the source data</param>
- /// <returns>a partition enumerator over the specified range</returns>
- // The partitioning algorithm is implemented in GetOrderablePartitions method
- // This method delegates according to source data type IList/Array
- protected abstract IEnumerator<KeyValuePair<long, TSource>> CreatePartition(int startIndex, int endIndex);
-
- /// <summary>
- /// Overrides OrderablePartitioner.GetOrderablePartitions
- /// Return a list of partitions, each of which enumerate a fixed part of the source data
- /// The elements of the source data are distributed to each partition as evenly as possible.
- /// Specifically, if the total number of elements is N, and number of partitions is x, and N = a*x +b,
- /// where a is the quotient, and b is the remainder. Then the first b partitions each has a + 1 elements,
- /// and the last x-b partitions each has a elements.
- /// For example, if N=10, x =3, then
- /// partition 0 ranges [0,3],
- /// partition 1 ranges [4,6],
- /// partition 2 ranges [7,9].
- /// This also takes care of the situation of (x&gt;N), the last x-N partitions are empty enumerators.
- /// An empty enumerator is indicated by
- /// (m_startIndex == list.Count &amp;&amp; m_endIndex == list.Count -1)
- /// </summary>
- /// <param name="partitionCount">specified number of partitions</param>
- /// <returns>a list of partitions</returns>
- override public IList<IEnumerator<KeyValuePair<long, TSource>>> GetOrderablePartitions(int partitionCount)
- {
- if (partitionCount <= 0)
- {
- throw new ArgumentOutOfRangeException(nameof(partitionCount));
- }
-
- int quotient, remainder;
- quotient = Math.DivRem(SourceCount, partitionCount, out remainder);
-
- IEnumerator<KeyValuePair<long, TSource>>[] partitions = new IEnumerator<KeyValuePair<long, TSource>>[partitionCount];
- int lastEndIndex = -1;
- for (int i = 0; i < partitionCount; i++)
- {
- int startIndex = lastEndIndex + 1;
-
- if (i < remainder)
- {
- lastEndIndex = startIndex + quotient;
- }
- else
- {
- lastEndIndex = startIndex + quotient - 1;
- }
- partitions[i] = CreatePartition(startIndex, lastEndIndex);
- }
- return partitions;
- }
- }
-
- /// <summary>
- /// Static Partition for IList/Array.
- /// This class implements all methods required by IEnumerator interface, except for the Current property.
- /// Current Property is different for IList and Array. Arrays calls 'ldelem' instructions for faster element
- /// retrieval.
- /// </summary>
- //We assume the source collection is not being updated concurrently. Otherwise it will break the
- //static partitioning, since each partition operates on the source collection directly, it does
- //not have a local cache of the elements assigned to them.
- private abstract class StaticIndexRangePartition<TSource> : IEnumerator<KeyValuePair<long, TSource>>
- {
- //the start and end position in the source collection for the current partition
- //the partition is empty if and only if
- // (m_startIndex == m_data.Count && m_endIndex == m_data.Count-1)
- protected readonly int m_startIndex;
- protected readonly int m_endIndex;
-
- //the current index of the current partition while enumerating on the source collection
- protected volatile int m_offset;
-
- /// <summary>
- /// Constructs an instance of StaticIndexRangePartition
- /// </summary>
- /// <param name="startIndex">the start index in the source collection for the current partition </param>
- /// <param name="endIndex">the end index in the source collection for the current partition</param>
- protected StaticIndexRangePartition(int startIndex, int endIndex)
- {
- m_startIndex = startIndex;
- m_endIndex = endIndex;
- m_offset = startIndex - 1;
- }
-
- /// <summary>
- /// Current Property is different for IList and Array. Arrays calls 'ldelem' instructions for faster
- /// element retrieval.
- /// </summary>
- public abstract KeyValuePair<long, TSource> Current { get; }
-
- /// <summary>
- /// We don't dispose the source for IList and array
- /// </summary>
- public void Dispose()
- { }
-
- public void Reset()
- {
- throw new NotSupportedException();
- }
-
- /// <summary>
- /// Moves to the next item
- /// Before the first MoveNext is called: m_offset == m_startIndex-1;
- /// </summary>
- /// <returns>true if successful, false if there is no item left</returns>
- public bool MoveNext()
- {
- if (m_offset < m_endIndex)
- {
- m_offset++;
- return true;
- }
- else
- {
- //After we have enumerated over all elements, we set m_offset to m_endIndex +1.
- //The reason we do this is, for an empty enumerator, we need to tell the Current
- //property whether MoveNext has been called or not.
- //For an empty enumerator, it starts with (m_offset == m_startIndex-1 == m_endIndex),
- //and we don't set a new value to m_offset, then the above condition will always be
- //true, and the Current property will mistakenly assume MoveNext is never called.
- m_offset = m_endIndex + 1;
- return false;
- }
- }
-
- Object IEnumerator.Current
- {
- get
- {
- return ((StaticIndexRangePartition<TSource>)this).Current;
- }
- }
- }
- #endregion
-
- #region Static partitioning for IList
- /// <summary>
- /// Inherits from StaticIndexRangePartitioner
- /// Provides customized implementation of SourceCount and CreatePartition
- /// </summary>
- /// <typeparam name="TSource"></typeparam>
- private class StaticIndexRangePartitionerForIList<TSource> : StaticIndexRangePartitioner<TSource, IList<TSource>>
- {
- IList<TSource> m_list;
- internal StaticIndexRangePartitionerForIList(IList<TSource> list)
- : base()
- {
- Debug.Assert(list != null);
- m_list = list;
- }
- override protected int SourceCount
- {
- get { return m_list.Count; }
- }
- override protected IEnumerator<KeyValuePair<long, TSource>> CreatePartition(int startIndex, int endIndex)
- {
- return new StaticIndexRangePartitionForIList<TSource>(m_list, startIndex, endIndex);
- }
- }
-
- /// <summary>
- /// Inherits from StaticIndexRangePartition
- /// Provides customized implementation of Current property
- /// </summary>
- /// <typeparam name="TSource"></typeparam>
- private class StaticIndexRangePartitionForIList<TSource> : StaticIndexRangePartition<TSource>
- {
- //the source collection shared by all partitions
- private volatile IList<TSource> m_list;
-
- internal StaticIndexRangePartitionForIList(IList<TSource> list, int startIndex, int endIndex)
- : base(startIndex, endIndex)
- {
- Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1);
- m_list = list;
- }
-
- override public KeyValuePair<long, TSource> Current
- {
- get
- {
- //verify that MoveNext is at least called once before Current is called
- if (m_offset < m_startIndex)
- {
- throw new InvalidOperationException(Environment.GetResourceString("PartitionerStatic_CurrentCalledBeforeMoveNext"));
- }
-
- Debug.Assert(m_offset >= m_startIndex && m_offset <= m_endIndex);
- return (new KeyValuePair<long, TSource>(m_offset, m_list[m_offset]));
- }
- }
- }
- #endregion
-
- #region static partitioning for Arrays
- /// <summary>
- /// Inherits from StaticIndexRangePartitioner
- /// Provides customized implementation of SourceCount and CreatePartition for Array
- /// </summary>
- private class StaticIndexRangePartitionerForArray<TSource> : StaticIndexRangePartitioner<TSource, TSource[]>
- {
- TSource[] m_array;
- internal StaticIndexRangePartitionerForArray(TSource[] array)
- : base()
- {
- Debug.Assert(array != null);
- m_array = array;
- }
- override protected int SourceCount
- {
- get { return m_array.Length; }
- }
- override protected IEnumerator<KeyValuePair<long, TSource>> CreatePartition(int startIndex, int endIndex)
- {
- return new StaticIndexRangePartitionForArray<TSource>(m_array, startIndex, endIndex);
- }
- }
-
- /// <summary>
- /// Inherits from StaticIndexRangePartitioner
- /// Provides customized implementation of SourceCount and CreatePartition
- /// </summary>
- private class StaticIndexRangePartitionForArray<TSource> : StaticIndexRangePartition<TSource>
- {
- //the source collection shared by all partitions
- private volatile TSource[] m_array;
-
- internal StaticIndexRangePartitionForArray(TSource[] array, int startIndex, int endIndex)
- : base(startIndex, endIndex)
- {
- Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1);
- m_array = array;
- }
-
- override public KeyValuePair<long, TSource> Current
- {
- get
- {
- //verify that MoveNext is at least called once before Current is called
- if (m_offset < m_startIndex)
- {
- throw new InvalidOperationException(Environment.GetResourceString("PartitionerStatic_CurrentCalledBeforeMoveNext"));
- }
-
- Debug.Assert(m_offset >= m_startIndex && m_offset <= m_endIndex);
- return (new KeyValuePair<long, TSource>(m_offset, m_array[m_offset]));
- }
- }
- }
- #endregion
-
-
- #region Utility functions
- /// <summary>
- /// A very simple primitive that allows us to share a value across multiple threads.
- /// </summary>
- /// <typeparam name="TSource"></typeparam>
- private class SharedInt
- {
- internal volatile int Value;
-
- internal SharedInt(int value)
- {
- this.Value = value;
- }
-
- }
-
- /// <summary>
- /// A very simple primitive that allows us to share a value across multiple threads.
- /// </summary>
- private class SharedBool
- {
- internal volatile bool Value;
-
- internal SharedBool(bool value)
- {
- this.Value = value;
- }
-
- }
-
- /// <summary>
- /// A very simple primitive that allows us to share a value across multiple threads.
- /// </summary>
- private class SharedLong
- {
- internal long Value;
- internal SharedLong(long value)
- {
- this.Value = value;
- }
-
- }
-
- //--------------------
- // The following part calculates the default chunk size. It is copied from System.Linq.Parallel.Scheduling,
- // because mscorlib.dll cannot access System.Linq.Parallel.Scheduling
- //--------------------
-
- // The number of bytes we want "chunks" to be, when partitioning, etc. We choose 4 cache
- // lines worth, assuming 128b cache line. Most (popular) architectures use 64b cache lines,
- // but choosing 128b works for 64b too whereas a multiple of 64b isn't necessarily sufficient
- // for 128b cache systems. So 128b it is.
- private const int DEFAULT_BYTES_PER_CHUNK = 128 * 4;
-
- private static int GetDefaultChunkSize<TSource>()
- {
- int chunkSize;
-
- if (typeof(TSource).IsValueType)
- {
- chunkSize = 128;
- }
- else
- {
- Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
- chunkSize = (DEFAULT_BYTES_PER_CHUNK / IntPtr.Size);
- }
- return chunkSize;
- }
- #endregion
- }
-}
diff --git a/src/mscorlib/src/System/Collections/Generic/Comparer.cs b/src/mscorlib/src/System/Collections/Generic/Comparer.cs
index 4f06b0af69..056843a606 100644
--- a/src/mscorlib/src/System/Collections/Generic/Comparer.cs
+++ b/src/mscorlib/src/System/Collections/Generic/Comparer.cs
@@ -265,9 +265,6 @@ namespace System.Collections.Generic
Debug.Assert(typeof(T).IsEnum, "This type is only intended to be used to compare enums!");
}
- // Used by the serialization engine.
- private Int64EnumComparer(SerializationInfo info, StreamingContext context) { }
-
public override int Compare(T x, T y)
{
long lx = JitHelpers.UnsafeEnumCastLong(x);
diff --git a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
index df39b59a29..0f9259d2f3 100644
--- a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
+++ b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs
@@ -488,122 +488,4 @@ namespace System.Collections.Generic
return -1;
}
}
-
-#if FEATURE_RANDOMIZED_STRING_HASHING
- // This type is not serializeable by design. It does not exist in previous versions and will be removed
- // Once we move the framework to using secure hashing by default.
- internal sealed class RandomizedStringEqualityComparer : IEqualityComparer<String>, IEqualityComparer, IWellKnownStringEqualityComparer
- {
- private long _entropy;
-
- public RandomizedStringEqualityComparer() {
- _entropy = HashHelpers.GetEntropy();
- }
-
- public new bool Equals(object x, object y) {
- if (x == y) return true;
- if (x == null || y == null) return false;
- if ((x is string) && (y is string)) return Equals((string)x, (string)y);
- ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidArgumentForComparison);
- return false;
- }
-
- [Pure]
- public bool Equals(string x, string y) {
- if (x != null) {
- if (y != null) return x.Equals(y);
- return false;
- }
- if (y != null) return false;
- return true;
- }
-
- [Pure]
- public int GetHashCode(String obj) {
- if(obj == null) return 0;
- return String.InternalMarvin32HashString(obj, obj.Length, _entropy);
- }
-
- [Pure]
- public int GetHashCode(Object obj) {
- if(obj == null) return 0;
-
- string sObj = obj as string;
- if(sObj != null) return String.InternalMarvin32HashString(sObj, sObj.Length, _entropy);
-
- return obj.GetHashCode();
- }
-
- // Equals method for the comparer itself.
- public override bool Equals(Object obj) {
- RandomizedStringEqualityComparer comparer = obj as RandomizedStringEqualityComparer;
- return (comparer != null) && (this._entropy == comparer._entropy);
- }
-
- public override int GetHashCode() {
- return (this.GetType().GetHashCode() ^ ((int) (_entropy & 0x7FFFFFFF)));
- }
-
-
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new RandomizedStringEqualityComparer();
- }
-
- // We want to serialize the old comparer.
- IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
- return EqualityComparer<string>.Default;
- }
- }
-
- // This type is not serializeable by design. It does not exist in previous versions and will be removed
- // Once we move the framework to using secure hashing by default.
- internal sealed class RandomizedObjectEqualityComparer : IEqualityComparer, IWellKnownStringEqualityComparer
- {
- private long _entropy;
-
- public RandomizedObjectEqualityComparer() {
- _entropy = HashHelpers.GetEntropy();
- }
-
- [Pure]
- public new bool Equals(Object x, Object y) {
- if (x != null) {
- if (y != null) return x.Equals(y);
- return false;
- }
- if (y != null) return false;
- return true;
- }
-
- [Pure]
- public int GetHashCode(Object obj) {
- if(obj == null) return 0;
-
- string sObj = obj as string;
- if(sObj != null) return String.InternalMarvin32HashString(sObj, sObj.Length, _entropy);
-
- return obj.GetHashCode();
- }
-
- // Equals method for the comparer itself.
- public override bool Equals(Object obj){
- RandomizedObjectEqualityComparer comparer = obj as RandomizedObjectEqualityComparer;
- return (comparer != null) && (this._entropy == comparer._entropy);
- }
-
- public override int GetHashCode() {
- return (this.GetType().GetHashCode() ^ ((int) (_entropy & 0x7FFFFFFF)));
- }
-
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new RandomizedObjectEqualityComparer();
- }
-
- // We want to serialize the old comparer, which in this case was null.
- IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
- return null;
- }
- }
-#endif
}
-
diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs
index d4c7d8d673..473608af39 100644
--- a/src/mscorlib/src/System/Collections/Hashtable.cs
+++ b/src/mscorlib/src/System/Collections/Hashtable.cs
@@ -68,7 +68,7 @@ namespace System.Collections {
[DebuggerDisplay("Count = {Count}")]
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable {
+ internal class Hashtable : IDictionary, ISerializable, IDeserializationCallback, ICloneable {
/*
Implementation Notes:
The generic Dictionary was copied from Hashtable's source - any bug
@@ -165,75 +165,6 @@ namespace System.Collections {
private IEqualityComparer _keycomparer;
private Object _syncRoot;
- [Obsolete("Please use EqualityComparer property.")]
- protected IHashCodeProvider hcp
- {
- get
- {
- if( _keycomparer is CompatibleComparer) {
- return ((CompatibleComparer)_keycomparer).HashCodeProvider;
- }
- else if( _keycomparer == null) {
- return null;
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotMixComparisonInfrastructure"));
- }
- }
- set
- {
- if (_keycomparer is CompatibleComparer) {
- CompatibleComparer keyComparer = (CompatibleComparer)_keycomparer;
- _keycomparer = new CompatibleComparer(keyComparer.Comparer, value);
- }
- else if( _keycomparer == null) {
- _keycomparer = new CompatibleComparer((IComparer)null, value);
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotMixComparisonInfrastructure"));
- }
- }
- }
-
-
- [Obsolete("Please use KeyComparer properties.")]
- protected IComparer comparer
- {
- get
- {
- if( _keycomparer is CompatibleComparer) {
- return ((CompatibleComparer)_keycomparer).Comparer;
- }
- else if( _keycomparer == null) {
- return null;
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotMixComparisonInfrastructure"));
- }
- }
- set
- {
- if (_keycomparer is CompatibleComparer) {
- CompatibleComparer keyComparer = (CompatibleComparer)_keycomparer;
- _keycomparer = new CompatibleComparer(value, keyComparer.HashCodeProvider);
- }
- else if( _keycomparer == null) {
- _keycomparer = new CompatibleComparer(value, (IHashCodeProvider)null);
- }
- else {
- throw new ArgumentException(Environment.GetResourceString("Arg_CannotMixComparisonInfrastructure"));
- }
- }
- }
-
- protected IEqualityComparer EqualityComparer
- {
- get
- {
- return _keycomparer;
- }
- }
-
// Note: this constructor is a bogus constructor that does nothing
// and is for use only with SyncHashtable.
internal Hashtable( bool trash )
@@ -290,126 +221,31 @@ namespace System.Collections {
Debug.Assert( loadsize < hashsize, "Invalid hashtable loadsize!");
}
- // Constructs a new hashtable with the given initial capacity and load
- // factor. The capacity argument serves as an indication of the
- // number of entries the hashtable will contain. When this number (or an
- // approximation) is known, specifying it in the constructor can eliminate
- // a number of resizing operations that would otherwise be performed when
- // elements are added to the hashtable. The loadFactor argument
- // indicates the maximum ratio of hashtable entries to hashtable buckets.
- // Smaller load factors cause faster average lookup times at the cost of
- // increased memory consumption. A load factor of 1.0 generally provides
- // the best balance between speed and size. The hcp argument
- // is used to specify an Object that will provide hash codes for all
- // the Objects in the table. Using this, you can in effect override
- // GetHashCode() on each Object using your own hash function. The
- // comparer argument will let you specify a custom function for
- // comparing keys. By specifying user-defined objects for hcp
- // and comparer, users could make a hash table using strings
- // as keys do case-insensitive lookups.
- //
- [Obsolete("Please use Hashtable(int, float, IEqualityComparer) instead.")]
- public Hashtable(int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) : this(capacity, loadFactor) {
- if (hcp == null && comparer == null) {
- this._keycomparer = null;
- }
- else {
- this._keycomparer = new CompatibleComparer(comparer,hcp);
- }
- }
-
public Hashtable(int capacity, float loadFactor, IEqualityComparer equalityComparer) : this(capacity, loadFactor) {
this._keycomparer = equalityComparer;
}
-
- // Constructs a new hashtable using a custom hash function
- // and a custom comparison function for keys. This will enable scenarios
- // such as doing lookups with case-insensitive strings.
- //
- [Obsolete("Please use Hashtable(IEqualityComparer) instead.")]
- public Hashtable(IHashCodeProvider hcp, IComparer comparer) : this(0, 1.0f, hcp, comparer) {
- }
public Hashtable(IEqualityComparer equalityComparer) : this(0, 1.0f, equalityComparer) {
}
-
- // Constructs a new hashtable using a custom hash function
- // and a custom comparison function for keys. This will enable scenarios
- // such as doing lookups with case-insensitive strings.
- //
- [Obsolete("Please use Hashtable(int, IEqualityComparer) instead.")]
- public Hashtable(int capacity, IHashCodeProvider hcp, IComparer comparer)
- : this(capacity, 1.0f, hcp, comparer) {
- }
public Hashtable(int capacity, IEqualityComparer equalityComparer)
: this(capacity, 1.0f, equalityComparer) {
}
-
- // Constructs a new hashtable containing a copy of the entries in the given
- // dictionary. The hashtable is created with a load factor of 1.0.
- //
- public Hashtable(IDictionary d) : this(d, 1.0f) {
- }
-
- // Constructs a new hashtable containing a copy of the entries in the given
- // dictionary. The hashtable is created with the given load factor.
- //
- public Hashtable(IDictionary d, float loadFactor)
- : this(d, loadFactor, (IEqualityComparer)null) {
- }
-
- [Obsolete("Please use Hashtable(IDictionary, IEqualityComparer) instead.")]
- public Hashtable(IDictionary d, IHashCodeProvider hcp, IComparer comparer)
- : this(d, 1.0f, hcp, comparer) {
- }
-
- public Hashtable(IDictionary d, IEqualityComparer equalityComparer)
- : this(d, 1.0f, equalityComparer) {
- }
- [Obsolete("Please use Hashtable(IDictionary, float, IEqualityComparer) instead.")]
- public Hashtable(IDictionary d, float loadFactor, IHashCodeProvider hcp, IComparer comparer)
- : this((d != null ? d.Count : 0), loadFactor, hcp, comparer) {
- if (d==null)
- throw new ArgumentNullException(nameof(d), Environment.GetResourceString("ArgumentNull_Dictionary"));
- Contract.EndContractBlock();
-
- IDictionaryEnumerator e = d.GetEnumerator();
- while (e.MoveNext()) Add(e.Key, e.Value);
- }
-
- public Hashtable(IDictionary d, float loadFactor, IEqualityComparer equalityComparer)
- : this((d != null ? d.Count : 0), loadFactor, equalityComparer) {
- if (d==null)
- throw new ArgumentNullException(nameof(d), Environment.GetResourceString("ArgumentNull_Dictionary"));
- Contract.EndContractBlock();
-
- IDictionaryEnumerator e = d.GetEnumerator();
- while (e.MoveNext()) Add(e.Key, e.Value);
- }
-
- protected Hashtable(SerializationInfo info, StreamingContext context) {
- //We can't do anything with the keys and values until the entire graph has been deserialized
- //and we have a reasonable estimate that GetHashCode is not going to fail. For the time being,
- //we'll just cache this. The graph is not valid until OnDeserialization has been called.
- HashHelpers.SerializationInfoTable.Add(this, info);
- }
-
- // ‘InitHash’ is basically an implementation of classic DoubleHashing (see http://en.wikipedia.org/wiki/Double_hashing)
+ // InitHash is basically an implementation of classic DoubleHashing (see http://en.wikipedia.org/wiki/Double_hashing)
//
- // 1) The only ‘correctness’ requirement is that the ‘increment’ used to probe
+ // 1) The only correctness requirement is that the increment used to probe
// a. Be non-zero
- // b. Be relatively prime to the table size ‘hashSize’. (This is needed to insure you probe all entries in the table before you ‘wrap’ and visit entries already probed)
+ // b. Be relatively prime to the table size hashSize. (This is needed to insure you probe all entries in the table before you wrap and visit entries already probed)
// 2) Because we choose table sizes to be primes, we just need to insure that the increment is 0 < incr < hashSize
//
// Thus this function would work: Incr = 1 + (seed % (hashSize-1))
//
- // While this works well for ‘uniformly distributed’ keys, in practice, non-uniformity is common.
- // In particular in practice we can see ‘mostly sequential’ where you get long clusters of keys that ‘pack’.
- // To avoid bad behavior you want it to be the case that the increment is ‘large’ even for ‘small’ values (because small
- // values tend to happen more in practice). Thus we multiply ‘seed’ by a number that will make these small values
- // bigger (and not hurt large values). We picked HashPrime (101) because it was prime, and if ‘hashSize-1’ is not a multiple of HashPrime
+ // While this works well for uniformly distributed keys, in practice, non-uniformity is common.
+ // In particular in practice we can see mostly sequential where you get long clusters of keys that pack.
+ // To avoid bad behavior you want it to be the case that the increment is large even for small values (because small
+ // values tend to happen more in practice). Thus we multiply seed by a number that will make these small values
+ // bigger (and not hurt large values). We picked HashPrime (101) because it was prime, and if hashSize-1 is not a multiple of HashPrime
// (enforced in GetPrime), then incr has the potential of being every value from 1 to hashSize-1. The choice was largely arbitrary.
//
// Computes the hash function: H(key, i) = h1(key) + i*h2(key, hashSize).
@@ -517,29 +353,6 @@ namespace System.Collections {
} while (b.hash_coll < 0 && ++ntry < lbuckets.Length);
return false;
}
-
- // Checks if this hashtable contains an entry with the given value. The
- // values of the entries of the hashtable are compared to the given value
- // using the Object.Equals method. This method performs a linear
- // search and is thus be substantially slower than the ContainsKey
- // method.
- //
- public virtual bool ContainsValue(Object value) {
-
- if (value == null) {
- for (int i = buckets.Length; --i >= 0;) {
- if (buckets[i].key != null && buckets[i].key != buckets && buckets[i].val == null)
- return true;
- }
- }
- else {
- for (int i = buckets.Length; --i >= 0;) {
- Object val = buckets[i].val;
- if (val!=null && val.Equals(value)) return true;
- }
- }
- return false;
- }
// Copies the keys of this hashtable to a given array starting at a given
// index. This method is used by the implementation of the CopyTo method in
@@ -590,25 +403,6 @@ namespace System.Collections {
CopyEntries(array, arrayIndex);
}
- // Copies the values in this Hashtable to an KeyValuePairs array.
- // KeyValuePairs is different from Dictionary Entry in that it has special
- // debugger attributes on its fields.
-
- internal virtual KeyValuePairs[] ToKeyValuePairsArray() {
-
- KeyValuePairs[] array = new KeyValuePairs[count];
- int index = 0;
- bucket[] lbuckets = buckets;
- for (int i = lbuckets.Length; --i >= 0;) {
- Object keyv = lbuckets[i].key;
- if ((keyv != null) && (keyv != buckets)){
- array[index++] = new KeyValuePairs(keyv,lbuckets[i].val);
- }
- }
-
- return array;
- }
-
// Copies the values of this hashtable to a given array starting at a given
// index. This method is used by the implementation of the CopyTo method in
@@ -1293,13 +1087,6 @@ namespace System.Collections {
internal SyncHashtable(Hashtable table) : base(false) {
_table = table;
}
-
- internal SyncHashtable(SerializationInfo info, StreamingContext context) : base (info, context) {
- _table = (Hashtable)info.GetValue("ParentTable", typeof(Hashtable));
- if (_table==null) {
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
- }
- }
/*================================GetObjectData=================================
@@ -1379,12 +1166,6 @@ namespace System.Collections {
return _table.ContainsKey(key);
}
- public override bool ContainsValue(Object key) {
- lock(_table.SyncRoot) {
- return _table.ContainsValue(key);
- }
- }
-
public override void CopyTo(Array array, int arrayIndex) {
lock (_table.SyncRoot) {
_table.CopyTo(array, arrayIndex);
@@ -1438,10 +1219,6 @@ namespace System.Collections {
public override void OnDeserialization(Object sender) {
return;
}
-
- internal override KeyValuePairs[] ToKeyValuePairsArray() {
- return _table.ToKeyValuePairsArray();
- }
}
@@ -1539,23 +1316,6 @@ namespace System.Collections {
// internal debug view class for hashtable
internal class HashtableDebugView {
private Hashtable hashtable;
-
- public HashtableDebugView( Hashtable hashtable) {
- if( hashtable == null) {
- throw new ArgumentNullException(nameof(hashtable));
- }
- Contract.EndContractBlock();
-
- this.hashtable = hashtable;
- }
-
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public KeyValuePairs[] Items {
- get {
- return hashtable.ToKeyValuePairsArray();
- }
- }
}
}
@@ -1644,11 +1404,6 @@ namespace System.Collections {
return min;
}
- public static int GetMinPrime()
- {
- return primes[0];
- }
-
// Returns size of hashtable to grow to.
public static int ExpandPrime(int oldSize)
{
@@ -1670,33 +1425,6 @@ namespace System.Collections {
public const int MaxPrimeArrayLength = 0x7FEFFFFD;
#if FEATURE_RANDOMIZED_STRING_HASHING
- public static bool IsWellKnownEqualityComparer(object comparer)
- {
- return (comparer == null || comparer == System.Collections.Generic.EqualityComparer<string>.Default || comparer is IWellKnownStringEqualityComparer);
- }
-
- public static IEqualityComparer GetRandomizedEqualityComparer(object comparer)
- {
- Debug.Assert(comparer == null || comparer == System.Collections.Generic.EqualityComparer<string>.Default || comparer is IWellKnownStringEqualityComparer);
-
- if(comparer == null) {
- return new System.Collections.Generic.RandomizedObjectEqualityComparer();
- }
-
- if(comparer == System.Collections.Generic.EqualityComparer<string>.Default) {
- return new System.Collections.Generic.RandomizedStringEqualityComparer();
- }
-
- IWellKnownStringEqualityComparer cmp = comparer as IWellKnownStringEqualityComparer;
-
- if(cmp != null) {
- return cmp.GetRandomizedEqualityComparer();
- }
-
- Debug.Assert(false, "Missing case in GetRandomizedEqualityComparer!");
-
- return null;
- }
public static object GetEqualityComparerForSerialization(object comparer)
{
@@ -1716,33 +1444,8 @@ namespace System.Collections {
}
private const int bufferSize = 1024;
- private static byte[] data;
private static int currentIndex = bufferSize;
private static readonly object lockObj = new Object();
-
- internal static long GetEntropy()
- {
- lock(lockObj) {
- long ret;
-
- if(currentIndex == bufferSize)
- {
- if(data == null)
- {
- data = new byte[bufferSize];
- Debug.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
- }
-
- Microsoft.Win32.Win32Native.Random(true, data, data.Length);
- currentIndex = 0;
- }
-
- ret = BitConverter.ToInt64(data, currentIndex);
- currentIndex += 8;
-
- return ret;
- }
- }
#endif // FEATURE_RANDOMIZED_STRING_HASHING
}
}
diff --git a/src/mscorlib/src/System/Collections/IHashCodeProvider.cs b/src/mscorlib/src/System/Collections/IHashCodeProvider.cs
index aefa15e1e5..ae917b02fb 100644
--- a/src/mscorlib/src/System/Collections/IHashCodeProvider.cs
+++ b/src/mscorlib/src/System/Collections/IHashCodeProvider.cs
@@ -20,7 +20,7 @@ namespace System.Collections {
// GetHashCode() function on Objects, providing their own hash function.
[Obsolete("Please use IEqualityComparer instead.")]
[System.Runtime.InteropServices.ComVisible(true)]
- public interface IHashCodeProvider
+ internal interface IHashCodeProvider
{
// Interfaces are not serializable
// Returns a hash code for the given object.
diff --git a/src/mscorlib/src/System/Collections/KeyValuePairs.cs b/src/mscorlib/src/System/Collections/KeyValuePairs.cs
deleted file mode 100644
index 22bf92c456..0000000000
--- a/src/mscorlib/src/System/Collections/KeyValuePairs.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: KeyValuePairs to display items in collection class under debugger
-**
-**
-===========================================================*/
-
-namespace System.Collections {
- using System.Diagnostics;
-
- [DebuggerDisplay("{value}", Name = "[{key}]", Type = "" )]
- internal class KeyValuePairs {
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private object key;
-
- [DebuggerBrowsable(DebuggerBrowsableState.Never)]
- private object value;
-
- public KeyValuePairs(object key, object value) {
- this.value = value;
- this.key = key;
- }
-
- public object Key {
- get { return key; }
- }
-
- public object Value {
- get { return value; }
- }
- }
-}
diff --git a/src/mscorlib/src/System/Collections/SortedList.cs b/src/mscorlib/src/System/Collections/SortedList.cs
deleted file mode 100644
index 4a480a2c37..0000000000
--- a/src/mscorlib/src/System/Collections/SortedList.cs
+++ /dev/null
@@ -1,1008 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-**
-** Purpose: A sorted dictionary.
-**
-**
-===========================================================*/
-namespace System.Collections {
- using System;
- using System.Security.Permissions;
- using System.Diagnostics;
- using System.Diagnostics.CodeAnalysis;
- using System.Diagnostics.Contracts;
- using System.Globalization;
-
- // The SortedList class implements a sorted list of keys and values. Entries in
- // a sorted list are sorted by their keys and are accessible both by key and by
- // index. The keys of a sorted list can be ordered either according to a
- // specific IComparer implementation given when the sorted list is
- // instantiated, or according to the IComparable implementation provided
- // by the keys themselves. In either case, a sorted list does not allow entries
- // with duplicate keys.
- //
- // A sorted list internally maintains two arrays that store the keys and
- // values of the entries. The capacity of a sorted list is the allocated
- // length of these internal arrays. As elements are added to a sorted list, the
- // capacity of the sorted list is automatically increased as required by
- // reallocating the internal arrays. The capacity is never automatically
- // decreased, but users can call either TrimToSize or
- // Capacity explicitly.
- //
- // The GetKeyList and GetValueList methods of a sorted list
- // provides access to the keys and values of the sorted list in the form of
- // List implementations. The List objects returned by these
- // methods are aliases for the underlying sorted list, so modifications
- // made to those lists are directly reflected in the sorted list, and vice
- // versa.
- //
- // The SortedList class provides a convenient way to create a sorted
- // copy of another dictionary, such as a Hashtable. For example:
- //
- // Hashtable h = new Hashtable();
- // h.Add(...);
- // h.Add(...);
- // ...
- // SortedList s = new SortedList(h);
- //
- // The last line above creates a sorted list that contains a copy of the keys
- // and values stored in the hashtable. In this particular example, the keys
- // will be ordered according to the IComparable interface, which they
- // all must implement. To impose a different ordering, SortedList also
- // has a constructor that allows a specific IComparer implementation to
- // be specified.
- //
- [DebuggerTypeProxy(typeof(System.Collections.SortedList.SortedListDebugView))]
- [DebuggerDisplay("Count = {Count}")]
- [System.Runtime.InteropServices.ComVisible(true)]
- [Obsolete("Non-generic collections have been deprecated. Please use collections in System.Collections.Generic.")]
- [Serializable]
- public class SortedList : IDictionary, ICloneable
- {
- private Object[] keys;
- private Object[] values;
- private int _size;
- private int version;
- private IComparer comparer;
- private KeyList keyList;
- private ValueList valueList;
- [NonSerialized]
- private Object _syncRoot;
-
- private const int _defaultCapacity = 16;
-
- private static Object[] emptyArray = EmptyArray<Object>.Value;
-
- // Constructs a new sorted list. The sorted list is initially empty and has
- // a capacity of zero. Upon adding the first element to the sorted list the
- // capacity is increased to 16, and then increased in multiples of two as
- // required. The elements of the sorted list are ordered according to the
- // IComparable interface, which must be implemented by the keys of
- // all entries added to the sorted list.
- public SortedList() {
- Init();
- }
- private void Init()
- {
- keys = emptyArray;
- values = emptyArray;
- _size = 0;
- comparer = new Comparer(CultureInfo.CurrentCulture);
- }
-
- // Constructs a new sorted list. The sorted list is initially empty and has
- // a capacity of zero. Upon adding the first element to the sorted list the
- // capacity is increased to 16, and then increased in multiples of two as
- // required. The elements of the sorted list are ordered according to the
- // IComparable interface, which must be implemented by the keys of
- // all entries added to the sorted list.
- //
- public SortedList(int initialCapacity) {
- if (initialCapacity < 0)
- throw new ArgumentOutOfRangeException(nameof(initialCapacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- keys = new Object[initialCapacity];
- values = new Object[initialCapacity];
- comparer = new Comparer(CultureInfo.CurrentCulture);
- }
-
- // Constructs a new sorted list with a given IComparer
- // implementation. The sorted list is initially empty and has a capacity of
- // zero. Upon adding the first element to the sorted list the capacity is
- // increased to 16, and then increased in multiples of two as required. The
- // elements of the sorted list are ordered according to the given
- // IComparer implementation. If comparer is null, the
- // elements are compared to each other using the IComparable
- // interface, which in that case must be implemented by the keys of all
- // entries added to the sorted list.
- //
- public SortedList(IComparer comparer)
- : this() {
- if (comparer != null) this.comparer = comparer;
- }
-
- // Constructs a new sorted list with a given IComparer
- // implementation and a given initial capacity. The sorted list is
- // initially empty, but will have room for the given number of elements
- // before any reallocations are required. The elements of the sorted list
- // are ordered according to the given IComparer implementation. If
- // comparer is null, the elements are compared to each other using
- // the IComparable interface, which in that case must be implemented
- // by the keys of all entries added to the sorted list.
- //
- public SortedList(IComparer comparer, int capacity)
- : this(comparer) {
- Capacity = capacity;
- }
-
- // Constructs a new sorted list containing a copy of the entries in the
- // given dictionary. The elements of the sorted list are ordered according
- // to the IComparable interface, which must be implemented by the
- // keys of all entries in the the given dictionary as well as keys
- // subsequently added to the sorted list.
- //
- public SortedList(IDictionary d)
- : this(d, null) {
- }
-
- // Constructs a new sorted list containing a copy of the entries in the
- // given dictionary. The elements of the sorted list are ordered according
- // to the given IComparer implementation. If comparer is
- // null, the elements are compared to each other using the
- // IComparable interface, which in that case must be implemented
- // by the keys of all entries in the the given dictionary as well as keys
- // subsequently added to the sorted list.
- //
- public SortedList(IDictionary d, IComparer comparer)
- : this(comparer, (d != null ? d.Count : 0)) {
- if (d==null)
- throw new ArgumentNullException(nameof(d), Environment.GetResourceString("ArgumentNull_Dictionary"));
- Contract.EndContractBlock();
- d.Keys.CopyTo(keys, 0);
- d.Values.CopyTo(values, 0);
- Array.Sort(keys, values, comparer);
- _size = d.Count;
- }
-
- // Adds an entry with the given key and value to this sorted list. An
- // ArgumentException is thrown if the key is already present in the sorted list.
- //
- public virtual void Add(Object key, Object value) {
- if (key == null) throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
- Contract.EndContractBlock();
- int i = Array.BinarySearch(keys, 0, _size, key, comparer);
- if (i >= 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", GetKey(i), key));
- Insert(~i, key, value);
- }
-
- // Returns the capacity of this sorted list. The capacity of a sorted list
- // represents the allocated length of the internal arrays used to store the
- // keys and values of the list, and thus also indicates the maximum number
- // of entries the list can contain before a reallocation of the internal
- // arrays is required.
- //
- public virtual int Capacity {
- get {
- return keys.Length;
- }
- set {
- if (value < Count) {
- throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity"));
- }
- Contract.EndContractBlock();
-
- if (value != keys.Length) {
- if (value > 0) {
- Object[] newKeys = new Object[value];
- Object[] newValues = new Object[value];
- if (_size > 0) {
- Array.Copy(keys, 0, newKeys, 0, _size);
- Array.Copy(values, 0, newValues, 0, _size);
- }
- keys = newKeys;
- values = newValues;
- }
- else {
- // size can only be zero here.
- Debug.Assert( _size == 0, "Size is not zero");
- keys = emptyArray;
- values = emptyArray;
- }
- }
- }
- }
-
- // Returns the number of entries in this sorted list.
- //
- public virtual int Count {
- get {
- return _size;
- }
- }
-
- // Returns a collection representing the keys of this sorted list. This
- // method returns the same object as GetKeyList, but typed as an
- // ICollection instead of an IList.
- //
- public virtual ICollection Keys {
- get {
- return GetKeyList();
- }
- }
-
- // Returns a collection representing the values of this sorted list. This
- // method returns the same object as GetValueList, but typed as an
- // ICollection instead of an IList.
- //
- public virtual ICollection Values {
- get {
- return GetValueList();
- }
- }
-
- // Is this SortedList read-only?
- public virtual bool IsReadOnly {
- get { return false; }
- }
-
- public virtual bool IsFixedSize {
- get { return false; }
- }
-
- // Is this SortedList synchronized (thread-safe)?
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- // Synchronization root for this object.
- public virtual Object SyncRoot {
- get {
- if( _syncRoot == null) {
- System.Threading.Interlocked.CompareExchange<Object>(ref _syncRoot, new Object(), null);
- }
- return _syncRoot;
- }
- }
-
- // Removes all entries from this sorted list.
- public virtual void Clear() {
- // clear does not change the capacity
- version++;
- Array.Clear(keys, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references.
- Array.Clear(values, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references.
- _size = 0;
-
- }
-
- // Makes a virtually identical copy of this SortedList. This is a shallow
- // copy. IE, the Objects in the SortedList are not cloned - we copy the
- // references to those objects.
- public virtual Object Clone()
- {
- SortedList sl = new SortedList(_size);
- Array.Copy(keys, 0, sl.keys, 0, _size);
- Array.Copy(values, 0, sl.values, 0, _size);
- sl._size = _size;
- sl.version = version;
- sl.comparer = comparer;
- // Don't copy keyList nor valueList.
- return sl;
- }
-
-
- // Checks if this sorted list contains an entry with the given key.
- //
- public virtual bool Contains(Object key) {
- return IndexOfKey(key) >= 0;
- }
-
- // Checks if this sorted list contains an entry with the given key.
- //
- public virtual bool ContainsKey(Object key) {
- // Yes, this is a SPEC'ed duplicate of Contains().
- return IndexOfKey(key) >= 0;
- }
-
- // Checks if this sorted list contains an entry with the given value. The
- // values of the entries of the sorted list are compared to the given value
- // using the Object.Equals method. This method performs a linear
- // search and is substantially slower than the Contains
- // method.
- //
- public virtual bool ContainsValue(Object value) {
- return IndexOfValue(value) >= 0;
- }
-
- // Copies the values in this SortedList to an array.
- public virtual void CopyTo(Array array, int arrayIndex) {
- if (array == null)
- throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Array"));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (array.Length - arrayIndex < Count)
- throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"));
- Contract.EndContractBlock();
- for (int i = 0; i<Count; i++) {
- DictionaryEntry entry = new DictionaryEntry(keys[i],values[i]);
- array.SetValue(entry, i + arrayIndex);
- }
- }
-
- // Copies the values in this SortedList to an KeyValuePairs array.
- // KeyValuePairs is different from Dictionary Entry in that it has special
- // debugger attributes on its fields.
-
- internal virtual KeyValuePairs[] ToKeyValuePairsArray() {
- KeyValuePairs[] array = new KeyValuePairs[Count];
- for (int i = 0; i < Count; i++) {
- array[i] = new KeyValuePairs(keys[i],values[i]);
- }
- return array;
- }
-
- // Ensures that the capacity of this sorted list is at least the given
- // minimum value. If the currect capacity of the list is less than
- // min, the capacity is increased to twice the current capacity or
- // to min, whichever is larger.
- private void EnsureCapacity(int min) {
- int newCapacity = keys.Length == 0? 16: keys.Length * 2;
- // Allow the list to grow to maximum possible capacity (~2G elements) before encountering overflow.
- // Note that this check works even when _items.Length overflowed thanks to the (uint) cast
- if ((uint)newCapacity > Array.MaxArrayLength) newCapacity = Array.MaxArrayLength;
- if (newCapacity < min) newCapacity = min;
- Capacity = newCapacity;
- }
-
- // Returns the value of the entry at the given index.
- //
- public virtual Object GetByIndex(int index) {
- if (index < 0 || index >= Count)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
- return values[index];
- }
-
- // Returns an IEnumerator for this sorted list. If modifications
- // made to the sorted list while an enumeration is in progress,
- // the MoveNext and Remove methods
- // of the enumerator will throw an exception.
- //
- IEnumerator IEnumerable.GetEnumerator() {
- return new SortedListEnumerator(this, 0, _size, SortedListEnumerator.DictEntry);
- }
-
- // Returns an IDictionaryEnumerator for this sorted list. If modifications
- // made to the sorted list while an enumeration is in progress,
- // the MoveNext and Remove methods
- // of the enumerator will throw an exception.
- //
- public virtual IDictionaryEnumerator GetEnumerator() {
- return new SortedListEnumerator(this, 0, _size, SortedListEnumerator.DictEntry);
- }
-
- // Returns the key of the entry at the given index.
- //
- public virtual Object GetKey(int index) {
- if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
- return keys[index];
- }
-
- // Returns an IList representing the keys of this sorted list. The
- // returned list is an alias for the keys of this sorted list, so
- // modifications made to the returned list are directly reflected in the
- // underlying sorted list, and vice versa. The elements of the returned
- // list are ordered in the same way as the elements of the sorted list. The
- // returned list does not support adding, inserting, or modifying elements
- // (the Add, AddRange, Insert, InsertRange,
- // Reverse, Set, SetRange, and Sort methods
- // throw exceptions), but it does allow removal of elements (through the
- // Remove and RemoveRange methods or through an enumerator).
- // Null is an invalid key value.
- //
- public virtual IList GetKeyList() {
- if (keyList == null) keyList = new KeyList(this);
- return keyList;
- }
-
- // Returns an IList representing the values of this sorted list. The
- // returned list is an alias for the values of this sorted list, so
- // modifications made to the returned list are directly reflected in the
- // underlying sorted list, and vice versa. The elements of the returned
- // list are ordered in the same way as the elements of the sorted list. The
- // returned list does not support adding or inserting elements (the
- // Add, AddRange, Insert and InsertRange
- // methods throw exceptions), but it does allow modification and removal of
- // elements (through the Remove, RemoveRange, Set and
- // SetRange methods or through an enumerator).
- //
- public virtual IList GetValueList() {
- if (valueList == null) valueList = new ValueList(this);
- return valueList;
- }
-
- // Returns the value associated with the given key. If an entry with the
- // given key is not found, the returned value is null.
- //
- public virtual Object this[Object key] {
- get {
- int i = IndexOfKey(key);
- if (i >= 0) return values[i];
- return null;
- }
- set {
- if (key == null) throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
- Contract.EndContractBlock();
- int i = Array.BinarySearch(keys, 0, _size, key, comparer);
- if (i >= 0) {
- values[i] = value;
- version++;
- return;
- }
- Insert(~i, key, value);
- }
- }
-
- // Returns the index of the entry with a given key in this sorted list. The
- // key is located through a binary search, and thus the average execution
- // time of this method is proportional to Log2(size), where
- // size is the size of this sorted list. The returned value is -1 if
- // the given key does not occur in this sorted list. Null is an invalid
- // key value.
- //
- public virtual int IndexOfKey(Object key) {
- if (key == null)
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
- Contract.EndContractBlock();
- int ret = Array.BinarySearch(keys, 0, _size, key, comparer);
- return ret >=0 ? ret : -1;
- }
-
- // Returns the index of the first occurrence of an entry with a given value
- // in this sorted list. The entry is located through a linear search, and
- // thus the average execution time of this method is proportional to the
- // size of this sorted list. The elements of the list are compared to the
- // given value using the Object.Equals method.
- //
- public virtual int IndexOfValue(Object value) {
- return Array.IndexOf(values, value, 0, _size);
- }
-
- // Inserts an entry with a given key and value at a given index.
- private void Insert(int index, Object key, Object value) {
- if (_size == keys.Length) EnsureCapacity(_size + 1);
- if (index < _size) {
- Array.Copy(keys, index, keys, index + 1, _size - index);
- Array.Copy(values, index, values, index + 1, _size - index);
- }
- keys[index] = key;
- values[index] = value;
- _size++;
- version++;
- }
-
- // Removes the entry at the given index. The size of the sorted list is
- // decreased by one.
- //
- public virtual void RemoveAt(int index) {
- if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
- _size--;
- if (index < _size) {
- Array.Copy(keys, index + 1, keys, index, _size - index);
- Array.Copy(values, index + 1, values, index, _size - index);
- }
- keys[_size] = null;
- values[_size] = null;
- version++;
- }
-
- // Removes an entry from this sorted list. If an entry with the specified
- // key exists in the sorted list, it is removed. An ArgumentException is
- // thrown if the key is null.
- //
- public virtual void Remove(Object key) {
- int i = IndexOfKey(key);
- if (i >= 0)
- RemoveAt(i);
- }
-
- // Sets the value at an index to a given value. The previous value of
- // the given entry is overwritten.
- //
- public virtual void SetByIndex(int index, Object value) {
- if (index < 0 || index >= Count) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
- values[index] = value;
- version++;
- }
-
- // Returns a thread-safe SortedList.
- //
- public static SortedList Synchronized(SortedList list) {
- if (list==null)
- throw new ArgumentNullException(nameof(list));
- Contract.EndContractBlock();
- return new SyncSortedList(list);
- }
-
- // Sets the capacity of this sorted list to the size of the sorted list.
- // This method can be used to minimize a sorted list's memory overhead once
- // it is known that no new elements will be added to the sorted list. To
- // completely clear a sorted list and release all memory referenced by the
- // sorted list, execute the following statements:
- //
- // sortedList.Clear();
- // sortedList.TrimToSize();
- //
- public virtual void TrimToSize() {
- Capacity = _size;
- }
-
- [Serializable]
- private class SyncSortedList : SortedList
- {
- private SortedList _list;
- private Object _root;
-
-
- internal SyncSortedList(SortedList list) {
- _list = list;
- _root = list.SyncRoot;
- }
-
- public override int Count {
- get { lock(_root) { return _list.Count; } }
- }
-
- public override Object SyncRoot {
- get { return _root; }
- }
-
- public override bool IsReadOnly {
- get { return _list.IsReadOnly; }
- }
-
- public override bool IsFixedSize {
- get { return _list.IsFixedSize; }
- }
-
-
- public override bool IsSynchronized {
- get { return true; }
- }
-
- public override Object this[Object key] {
- get {
- lock(_root) {
- return _list[key];
- }
- }
- set {
- lock(_root) {
- _list[key] = value;
- }
- }
- }
-
- public override void Add(Object key, Object value) {
- lock(_root) {
- _list.Add(key, value);
- }
- }
-
- public override int Capacity {
- get{ lock(_root) { return _list.Capacity; } }
- }
-
- public override void Clear() {
- lock(_root) {
- _list.Clear();
- }
- }
-
- public override Object Clone() {
- lock(_root) {
- return _list.Clone();
- }
- }
-
- public override bool Contains(Object key) {
- lock(_root) {
- return _list.Contains(key);
- }
- }
-
- public override bool ContainsKey(Object key) {
- lock(_root) {
- return _list.ContainsKey(key);
- }
- }
-
- public override bool ContainsValue(Object key) {
- lock(_root) {
- return _list.ContainsValue(key);
- }
- }
-
- public override void CopyTo(Array array, int index) {
- lock(_root) {
- _list.CopyTo(array, index);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override Object GetByIndex(int index) {
- lock(_root) {
- return _list.GetByIndex(index);
- }
- }
-
- public override IDictionaryEnumerator GetEnumerator() {
- lock(_root) {
- return _list.GetEnumerator();
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override Object GetKey(int index) {
- lock(_root) {
- return _list.GetKey(index);
- }
- }
-
- public override IList GetKeyList() {
- lock(_root) {
- return _list.GetKeyList();
- }
- }
-
- public override IList GetValueList() {
- lock(_root) {
- return _list.GetValueList();
- }
- }
-
- public override int IndexOfKey(Object key) {
- if (key == null)
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
- Contract.EndContractBlock();
-
- lock(_root) {
- return _list.IndexOfKey(key);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override int IndexOfValue(Object value) {
- lock(_root) {
- return _list.IndexOfValue(value);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void RemoveAt(int index) {
- lock(_root) {
- _list.RemoveAt(index);
- }
- }
-
- public override void Remove(Object key) {
- lock(_root) {
- _list.Remove(key);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems.
- public override void SetByIndex(int index, Object value) {
- lock(_root) {
- _list.SetByIndex(index, value);
- }
- }
-
- internal override KeyValuePairs[] ToKeyValuePairsArray() {
- return _list.ToKeyValuePairsArray();
- }
-
- public override void TrimToSize() {
- lock(_root) {
- _list.TrimToSize();
- }
- }
- }
-
-
- [Serializable]
- private class SortedListEnumerator : IDictionaryEnumerator, ICloneable
- {
- private SortedList sortedList;
- private Object key;
- private Object value;
- private int index;
- private int startIndex; // Store for Reset.
- private int endIndex;
- private int version;
- private bool current; // Is the current element valid?
- private int getObjectRetType; // What should GetObject return?
-
- internal const int Keys = 1;
- internal const int Values = 2;
- internal const int DictEntry = 3;
-
- internal SortedListEnumerator(SortedList sortedList, int index, int count,
- int getObjRetType) {
- this.sortedList = sortedList;
- this.index = index;
- startIndex = index;
- endIndex = index + count;
- version = sortedList.version;
- getObjectRetType = getObjRetType;
- current = false;
- }
-
- public Object Clone()
- {
- return MemberwiseClone();
- }
-
- public virtual Object Key {
- get {
- if (version != sortedList.version) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
- return key;
- }
- }
-
- public virtual bool MoveNext() {
- if (version != sortedList.version) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
- if (index < endIndex) {
- key = sortedList.keys[index];
- value = sortedList.values[index];
- index++;
- current = true;
- return true;
- }
- key = null;
- value = null;
- current = false;
- return false;
- }
-
- public virtual DictionaryEntry Entry {
- get {
- if (version != sortedList.version) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion"));
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
- return new DictionaryEntry(key, value);
- }
- }
-
- public virtual Object Current {
- get {
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
-
- if (getObjectRetType==Keys)
- return key;
- else if (getObjectRetType==Values)
- return value;
- else
- return new DictionaryEntry(key, value);
- }
- }
-
- public virtual Object Value {
- get {
- if (version != sortedList.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- if (current == false) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen"));
- return value;
- }
- }
-
- public virtual void Reset() {
- if (version != sortedList.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- index = startIndex;
- current = false;
- key = null;
- value = null;
- }
- }
-
- [Serializable]
- private class KeyList : IList
- {
- private SortedList sortedList;
-
- internal KeyList(SortedList sortedList) {
- this.sortedList = sortedList;
- }
-
- public virtual int Count {
- get { return sortedList._size; }
- }
-
- public virtual bool IsReadOnly {
- get { return true; }
- }
-
- public virtual bool IsFixedSize {
- get { return true; }
- }
-
- public virtual bool IsSynchronized {
- get { return sortedList.IsSynchronized; }
- }
-
- public virtual Object SyncRoot {
- get { return sortedList.SyncRoot; }
- }
-
- public virtual int Add(Object key) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- // return 0; // suppress compiler warning
- }
-
- public virtual void Clear() {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual bool Contains(Object key) {
- return sortedList.Contains(key);
- }
-
- public virtual void CopyTo(Array array, int arrayIndex) {
- if (array != null && array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- Contract.EndContractBlock();
-
- // defer error checking to Array.Copy
- Array.Copy(sortedList.keys, 0, array, arrayIndex, sortedList.Count);
- }
-
- public virtual void Insert(int index, Object value) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual Object this[int index] {
- get {
- return sortedList.GetKey(index);
- }
- set {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet"));
- }
- }
-
- public virtual IEnumerator GetEnumerator() {
- return new SortedListEnumerator(sortedList, 0, sortedList.Count, SortedListEnumerator.Keys);
- }
-
- public virtual int IndexOf(Object key) {
- if (key==null)
- throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key"));
- Contract.EndContractBlock();
-
- int i = Array.BinarySearch(sortedList.keys, 0,
- sortedList.Count, key, sortedList.comparer);
- if (i >= 0) return i;
- return -1;
- }
-
- public virtual void Remove(Object key) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual void RemoveAt(int index) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
- }
-
- [Serializable]
- private class ValueList : IList
- {
- private SortedList sortedList;
-
- internal ValueList(SortedList sortedList) {
- this.sortedList = sortedList;
- }
-
- public virtual int Count {
- get { return sortedList._size; }
- }
-
- public virtual bool IsReadOnly {
- get { return true; }
- }
-
- public virtual bool IsFixedSize {
- get { return true; }
- }
-
- public virtual bool IsSynchronized {
- get { return sortedList.IsSynchronized; }
- }
-
- public virtual Object SyncRoot {
- get { return sortedList.SyncRoot; }
- }
-
- public virtual int Add(Object key) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual void Clear() {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual bool Contains(Object value) {
- return sortedList.ContainsValue(value);
- }
-
- public virtual void CopyTo(Array array, int arrayIndex) {
- if (array != null && array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- Contract.EndContractBlock();
-
- // defer error checking to Array.Copy
- Array.Copy(sortedList.values, 0, array, arrayIndex, sortedList.Count);
- }
-
- public virtual void Insert(int index, Object value) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual Object this[int index] {
- get {
- return sortedList.GetByIndex(index);
- }
- set {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
- }
-
- public virtual IEnumerator GetEnumerator() {
- return new SortedListEnumerator(sortedList, 0, sortedList.Count, SortedListEnumerator.Values);
- }
-
- public virtual int IndexOf(Object value) {
- return Array.IndexOf(sortedList.values, value, 0, sortedList.Count);
- }
-
- public virtual void Remove(Object value) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- public virtual void RemoveAt(int index) {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_SortedListNestedWrite));
- }
-
- }
-
- // internal debug view class for sorted list
- internal class SortedListDebugView {
- private SortedList sortedList;
-
- public SortedListDebugView( SortedList sortedList) {
- if( sortedList == null) {
- throw new ArgumentNullException(nameof(sortedList));
- }
- Contract.EndContractBlock();
-
- this.sortedList = sortedList;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public KeyValuePairs[] Items {
- get {
- return sortedList.ToKeyValuePairsArray();
- }
- }
- }
- }
-}
diff --git a/src/mscorlib/src/System/Collections/Stack.cs b/src/mscorlib/src/System/Collections/Stack.cs
deleted file mode 100644
index c3ad15abd8..0000000000
--- a/src/mscorlib/src/System/Collections/Stack.cs
+++ /dev/null
@@ -1,379 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-**
-**
-**
-** Purpose: An array implementation of a stack.
-**
-**
-=============================================================================*/
-namespace System.Collections {
- using System;
- using System.Security.Permissions;
- using System.Diagnostics;
- using System.Diagnostics.CodeAnalysis;
- using System.Diagnostics.Contracts;
-
- // A simple stack of objects. Internally it is implemented as an array,
- // so Push can be O(n). Pop is O(1).
- [DebuggerTypeProxy(typeof(System.Collections.Stack.StackDebugView))]
- [DebuggerDisplay("Count = {Count}")]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public class Stack : ICollection, ICloneable {
- private Object[] _array; // Storage for stack elements
- [ContractPublicPropertyName("Count")]
- private int _size; // Number of items in the stack.
- private int _version; // Used to keep enumerator in sync w/ collection.
- [NonSerialized]
- private Object _syncRoot;
-
- private const int _defaultCapacity = 10;
-
- public Stack() {
- _array = new Object[_defaultCapacity];
- _size = 0;
- _version = 0;
- }
-
- // Create a stack with a specific initial capacity. The initial capacity
- // must be a non-negative number.
- public Stack(int initialCapacity) {
- if (initialCapacity < 0)
- throw new ArgumentOutOfRangeException(nameof(initialCapacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- Contract.EndContractBlock();
- if (initialCapacity < _defaultCapacity)
- initialCapacity = _defaultCapacity; // Simplify doubling logic in Push.
- _array = new Object[initialCapacity];
- _size = 0;
- _version = 0;
- }
-
- // Fills a Stack with the contents of a particular collection. The items are
- // pushed onto the stack in the same order they are read by the enumerator.
- //
- public Stack(ICollection col) : this((col==null ? 32 : col.Count))
- {
- if (col==null)
- throw new ArgumentNullException(nameof(col));
- Contract.EndContractBlock();
- IEnumerator en = col.GetEnumerator();
- while(en.MoveNext())
- Push(en.Current);
- }
-
- public virtual int Count {
- get {
- Contract.Ensures(Contract.Result<int>() >= 0);
- return _size;
- }
- }
-
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- public virtual Object SyncRoot {
- get {
- if( _syncRoot == null) {
- System.Threading.Interlocked.CompareExchange<Object>(ref _syncRoot, new Object(), null);
- }
- return _syncRoot;
- }
- }
-
- // Removes all Objects from the Stack.
- public virtual void Clear() {
- Array.Clear(_array, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references.
- _size = 0;
- _version++;
- }
-
- public virtual Object Clone() {
- Contract.Ensures(Contract.Result<Object>() != null);
-
- Stack s = new Stack(_size);
- s._size = _size;
- Array.Copy(_array, 0, s._array, 0, _size);
- s._version = _version;
- return s;
- }
-
- public virtual bool Contains(Object obj) {
- int count = _size;
-
- while (count-- > 0) {
- if (obj == null) {
- if (_array[count] == null)
- return true;
- }
- else if (_array[count] != null && _array[count].Equals(obj)) {
- return true;
- }
- }
- return false;
- }
-
- // Copies the stack into an array.
- public virtual void CopyTo(Array array, int index) {
- if (array==null)
- throw new ArgumentNullException(nameof(array));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- if (index < 0)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- if (array.Length - index < _size)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- int i = 0;
- if (array is Object[]) {
- Object[] objArray = (Object[]) array;
- while(i < _size) {
- objArray[i+index] = _array[_size-i-1];
- i++;
- }
- }
- else {
- while(i < _size) {
- array.SetValue(_array[_size-i-1], i+index);
- i++;
- }
- }
- }
-
- // Returns an IEnumerator for this Stack.
- public virtual IEnumerator GetEnumerator() {
- Contract.Ensures(Contract.Result<IEnumerator>() != null);
- return new StackEnumerator(this);
- }
-
- // Returns the top object on the stack without removing it. If the stack
- // is empty, Peek throws an InvalidOperationException.
- public virtual Object Peek() {
- if (_size==0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EmptyStack"));
- Contract.EndContractBlock();
- return _array[_size-1];
- }
-
- // Pops an item from the top of the stack. If the stack is empty, Pop
- // throws an InvalidOperationException.
- public virtual Object Pop() {
- if (_size == 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EmptyStack"));
- //Contract.Ensures(Count == Contract.OldValue(Count) - 1);
- Contract.EndContractBlock();
- _version++;
- Object obj = _array[--_size];
- _array[_size] = null; // Free memory quicker.
- return obj;
- }
-
- // Pushes an item to the top of the stack.
- //
- public virtual void Push(Object obj) {
- //Contract.Ensures(Count == Contract.OldValue(Count) + 1);
- if (_size == _array.Length) {
- Object[] newArray = new Object[2*_array.Length];
- Array.Copy(_array, 0, newArray, 0, _size);
- _array = newArray;
- }
- _array[_size++] = obj;
- _version++;
- }
-
- // Returns a synchronized Stack.
- //
- public static Stack Synchronized(Stack stack) {
- if (stack==null)
- throw new ArgumentNullException(nameof(stack));
- Contract.Ensures(Contract.Result<Stack>() != null);
- Contract.EndContractBlock();
- return new SyncStack(stack);
- }
-
-
- // Copies the Stack to an array, in the same order Pop would return the items.
- public virtual Object[] ToArray()
- {
- Contract.Ensures(Contract.Result<Object[]>() != null);
-
- Object[] objArray = new Object[_size];
- int i = 0;
- while(i < _size) {
- objArray[i] = _array[_size-i-1];
- i++;
- }
- return objArray;
- }
-
- [Serializable]
- private class SyncStack : Stack
- {
- private Stack _s;
- private Object _root;
-
- internal SyncStack(Stack stack) {
- _s = stack;
- _root = stack.SyncRoot;
- }
-
- public override bool IsSynchronized {
- get { return true; }
- }
-
- public override Object SyncRoot {
- get {
- return _root;
- }
- }
-
- public override int Count {
- get {
- lock (_root) {
- return _s.Count;
- }
- }
- }
-
- public override bool Contains(Object obj) {
- lock (_root) {
- return _s.Contains(obj);
- }
- }
-
- public override Object Clone()
- {
- lock (_root) {
- return new SyncStack((Stack)_s.Clone());
- }
- }
-
- public override void Clear() {
- lock (_root) {
- _s.Clear();
- }
- }
-
- public override void CopyTo(Array array, int arrayIndex) {
- lock (_root) {
- _s.CopyTo(array, arrayIndex);
- }
- }
-
- public override void Push(Object value) {
- lock (_root) {
- _s.Push(value);
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Thread safety problems with precondition - can't express the precondition as of Dev10.
- public override Object Pop() {
- lock (_root) {
- return _s.Pop();
- }
- }
-
- public override IEnumerator GetEnumerator() {
- lock (_root) {
- return _s.GetEnumerator();
- }
- }
-
- [SuppressMessage("Microsoft.Contracts", "CC1055")] // Thread safety problems with precondition - can't express the precondition as of Dev10.
- public override Object Peek() {
- lock (_root) {
- return _s.Peek();
- }
- }
-
- public override Object[] ToArray() {
- lock (_root) {
- return _s.ToArray();
- }
- }
- }
-
-
- [Serializable]
- private class StackEnumerator : IEnumerator, ICloneable
- {
- private Stack _stack;
- private int _index;
- private int _version;
- private Object currentElement;
-
- internal StackEnumerator(Stack stack) {
- _stack = stack;
- _version = _stack._version;
- _index = -2;
- currentElement = null;
- }
-
- public Object Clone()
- {
- return MemberwiseClone();
- }
-
- public virtual bool MoveNext() {
- bool retval;
- if (_version != _stack._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- if (_index == -2) { // First call to enumerator.
- _index = _stack._size-1;
- retval = ( _index >= 0);
- if (retval)
- currentElement = _stack._array[_index];
- return retval;
- }
- if (_index == -1) { // End of enumeration.
- return false;
- }
-
- retval = (--_index >= 0);
- if (retval)
- currentElement = _stack._array[_index];
- else
- currentElement = null;
- return retval;
- }
-
- public virtual Object Current {
- get {
- if (_index == -2) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted));
- if (_index == -1) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded));
- return currentElement;
- }
- }
-
- public virtual void Reset() {
- if (_version != _stack._version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion));
- _index = -2;
- currentElement = null;
- }
- }
-
- internal class StackDebugView {
- private Stack stack;
-
- public StackDebugView( Stack stack) {
- if( stack == null)
- throw new ArgumentNullException(nameof(stack));
- Contract.EndContractBlock();
-
- this.stack = stack;
- }
-
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public Object[] Items {
- get {
- return stack.ToArray();
- }
- }
- }
- }
-}
diff --git a/src/mscorlib/src/System/CompatibilitySwitches.cs b/src/mscorlib/src/System/CompatibilitySwitches.cs
index d699917feb..58dd640f88 100644
--- a/src/mscorlib/src/System/CompatibilitySwitches.cs
+++ b/src/mscorlib/src/System/CompatibilitySwitches.cs
@@ -10,7 +10,6 @@ namespace System
internal static class CompatibilitySwitches
{
private static bool s_AreSwitchesSet;
- private static bool s_useLatestBehaviorWhenTFMNotSpecified; // Which behavior to use when the TFM is not specified.
public static bool IsCompatibilityBehaviorDefined
{
diff --git a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyHash.cs b/src/mscorlib/src/System/Configuration/Assemblies/AssemblyHash.cs
deleted file mode 100644
index a7b0e70266..0000000000
--- a/src/mscorlib/src/System/Configuration/Assemblies/AssemblyHash.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** Purpose:
-**
-**
-===========================================================*/
-namespace System.Configuration.Assemblies {
- using System;
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public struct AssemblyHash : ICloneable
- {
- private AssemblyHashAlgorithm _Algorithm;
- private byte[] _Value;
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public static readonly AssemblyHash Empty = new AssemblyHash(AssemblyHashAlgorithm.None, null);
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public AssemblyHash(byte[] value) {
- _Algorithm = AssemblyHashAlgorithm.SHA1;
- _Value = null;
-
- if (value != null) {
- int length = value.Length;
- _Value = new byte[length];
- Array.Copy(value, _Value, length);
- }
- }
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public AssemblyHash(AssemblyHashAlgorithm algorithm, byte[] value) {
- _Algorithm = algorithm;
- _Value = null;
-
- if (value != null) {
- int length = value.Length;
- _Value = new byte[length];
- Array.Copy(value, _Value, length);
- }
- }
-
- // Hash is made up of a byte array and a value from a class of supported
- // algorithm types.
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public AssemblyHashAlgorithm Algorithm {
- get { return _Algorithm; }
- set { _Algorithm = value; }
- }
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public byte[] GetValue() {
- return _Value;
- }
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public void SetValue(byte[] value) {
- _Value = value;
- }
-
- [Obsolete("The AssemblyHash class has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public Object Clone() {
- return new AssemblyHash(_Algorithm, _Value);
- }
- }
-
-}
diff --git a/src/mscorlib/src/System/ContextMarshalException.cs b/src/mscorlib/src/System/ContextMarshalException.cs
deleted file mode 100644
index f74a62b991..0000000000
--- a/src/mscorlib/src/System/ContextMarshalException.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-**
-**
-** Purpose: Exception class for attempting to pass an instance through a context
-** boundary, when the formal type and the instance's marshal style are
-** incompatible or cannot be marshaled.
-**
-** This is thrown by the VM when attempts to marshal the exception
-** object at the AppDomain transition boundary fails.
-=============================================================================*/
-
-namespace System {
- using System.Runtime.InteropServices;
- using System.Runtime.Remoting;
- using System;
- using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public class ContextMarshalException : SystemException {
- public ContextMarshalException()
- : base(Environment.GetResourceString("Arg_ContextMarshalException")) {
- SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
- }
-
- public ContextMarshalException(String message)
- : base(message) {
- SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
- }
-
- public ContextMarshalException(String message, Exception inner)
- : base(message, inner) {
- SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
- }
-
- protected ContextMarshalException(SerializationInfo info, StreamingContext context) : base(info, context) {
- }
-
- }
-
-}
diff --git a/src/mscorlib/src/System/DateTime.cs b/src/mscorlib/src/System/DateTime.cs
index 28348257aa..b18ac4a52b 100644
--- a/src/mscorlib/src/System/DateTime.cs
+++ b/src/mscorlib/src/System/DateTime.cs
@@ -710,12 +710,6 @@ namespace System {
return (Int64)dateData;
}
}
-
- // Return the underlying data, without adjust local times to the right time zone. Needed if performance
- // or compatibility are important.
- internal Int64 ToBinaryRaw() {
- return (Int64)dateData;
- }
// Returns the date part of this DateTime. The resulting value
// corresponds to this DateTime with the time-of-day part set to
diff --git a/src/mscorlib/src/System/Decimal.cs b/src/mscorlib/src/System/Decimal.cs
index fd16697199..1d2b311df7 100644
--- a/src/mscorlib/src/System/Decimal.cs
+++ b/src/mscorlib/src/System/Decimal.cs
@@ -346,9 +346,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void FCallAddSub(ref Decimal d1, ref Decimal d2, byte bSign);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void FCallAddSubOverflowed(ref Decimal d1, ref Decimal d2, byte bSign, ref bool overflowed);
-
// Rounds a Decimal to an integer value. The Decimal argument is rounded
// towards positive infinity.
public static Decimal Ceiling(Decimal d) {
@@ -403,9 +400,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void FCallDivide(ref Decimal d1, ref Decimal d2);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void FCallDivideOverflowed(ref Decimal d1, ref Decimal d2, ref bool overflowed);
-
// Checks if this Decimal is equal to a given object. Returns true
// if the given object is a boxed Decimal and its value is equal to the
@@ -697,9 +691,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void FCallMultiply(ref Decimal d1, ref Decimal d2);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void FCallMultiplyOverflowed(ref Decimal d1, ref Decimal d2, ref bool overflowed);
-
// Returns the negated value of the given Decimal. If d is non-zero,
// the result is -d. If d is zero, the result is zero.
//
diff --git a/src/mscorlib/src/System/Diagnostics/Assert.cs b/src/mscorlib/src/System/Diagnostics/Assert.cs
index 77cc6d8e46..75572d7d75 100644
--- a/src/mscorlib/src/System/Diagnostics/Assert.cs
+++ b/src/mscorlib/src/System/Diagnostics/Assert.cs
@@ -36,14 +36,6 @@ namespace System.Diagnostics {
}
}
- internal static void Check(bool condition, String conditionString, String message, int exitCode)
- {
- if (!condition)
- {
- Fail(conditionString, message, null, exitCode);
- }
- }
-
internal static void Fail(String conditionString, String message)
{
Fail(conditionString, message, null, COR_E_FAILFAST);
diff --git a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
index 84f6b91f65..14f0f26d98 100644
--- a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
+++ b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs
@@ -79,19 +79,6 @@ namespace System.Diagnostics {
get { return strName;}
}
- // Get property returns the description of the switch
- public virtual String Description
- {
- get {return strDescription;}
- }
-
-
- // Get property returns the parent of the switch
- public virtual LogSwitch Parent
- {
- get { return ParentSwitch; }
- }
-
// Property to Get/Set the level of log messages which are "on" for the switch.
//
diff --git a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
index 128ae3cea4..6060a649c5 100644
--- a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
+++ b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs
@@ -200,7 +200,6 @@ namespace System.Diagnostics {
}
public virtual int GetNumberOfFrames() { return iFrameCount;}
- public virtual void SetNumberOfFrames(int i) { iFrameCount = i;}
//
// serialization implementation
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
index a0d3640c2c..8365e18f64 100644
--- a/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
@@ -21,12 +21,8 @@ namespace System.Diagnostics.SymbolStore {
// Interface does not need to be marked with the serializable attribute
[System.Runtime.InteropServices.ComVisible(true)]
- public interface ISymbolWriter
+ internal interface ISymbolWriter
{
- // Set the IMetadataEmitter that this symbol writer is associated
- // with. This must be done only once before any other ISymbolWriter
- // methods are called.
- void Initialize(IntPtr emitter, String filename, bool fFullBuild);
// Define a source document. Guid's will be provided for the
// languages, vendors, and document types that we currently know
@@ -36,11 +32,6 @@ namespace System.Diagnostics.SymbolStore {
Guid languageVendor,
Guid documentType);
- // Define the method that the user has defined as their entrypoint
- // for this module. This would be, perhaps, the user's main method
- // rather than compiler generated stubs before main.
- void SetUserEntryPoint(SymbolToken entryMethod);
-
// Open a method to emit symbol information into. The given method
// becomes the current method for calls do define sequence points,
// parameters and lexical scopes. There is an implicit lexical
@@ -88,9 +79,6 @@ namespace System.Diagnostics.SymbolStore {
// last instruction in the scope.
void CloseScope(int endOffset);
- // Define the offset range for a given lexical scope.
- void SetScopeRange(int scopeID, int startOffset, int endOffset);
-
// Define a single variable in the current lexical
// scope. startOffset and endOffset are optional. If 0, then they
// are ignored and the variable is defined over the entire
@@ -109,80 +97,17 @@ namespace System.Diagnostics.SymbolStore {
int startOffset,
int endOffset);
- // Define a single parameter in the current method. The type of
- // each parameter is taken from its position (sequence) within the
- // method's signature.
- //
- // Note: if parameters are defined in the metadata for a given
- // method, then clearly one would not have to define them again
- // with calls to this method. The symbol readers will have to be
- // smart enough to check the normal metadata for these first then
- // fall back to the symbol store.
- void DefineParameter(String name,
- ParameterAttributes attributes,
- int sequence,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
-
- // Define a single variable not within a method. This is used for
- // certian fields in classes, bitfields, etc.
- void DefineField(SymbolToken parent,
- String name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
-
- // Define a single global variable.
- void DefineGlobalVariable(String name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
-
- // Close will close the ISymbolWriter and commit the symbols
- // to the symbol store. The ISymbolWriter becomes invalid
- // after this call for further updates.
- void Close();
-
// Defines a custom attribute based upon its name. Not to be
// confused with Metadata custom attributes, these attributes are
// held in the symbol store.
void SetSymAttribute(SymbolToken parent, String name, byte[] data);
- // Opens a new namespace. Call this before defining methods or
- // variables that live within a namespace. Namespaces can be nested.
- void OpenNamespace(String name);
-
- // Close the most recently opened namespace.
- void CloseNamespace();
-
// Specifies that the given, fully qualified namespace name is
// being used within the currently open lexical scope. Closing the
// current scope will also stop using the namespace, and the
// namespace will be in use in all scopes that inherit from the
// currently open scope.
void UsingNamespace(String fullName);
-
- // Specifies the true start and end of a method within a source
- // file. Use this to specify the extent of a method independently
- // of what sequence points exist within the method.
- void SetMethodSourceRange(ISymbolDocumentWriter startDoc,
- int startLine,
- int startColumn,
- ISymbolDocumentWriter endDoc,
- int endLine,
- int endColumn);
-
- // Used to set the underlying ISymUnmanagedWriter that a
- // managed ISymbolWriter may use to emit symbols with.
- void SetUnderlyingWriter(IntPtr underlyingWriter);
}
}
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
index a7f866f2ec..f3eaaee77c 100644
--- a/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
@@ -17,7 +17,7 @@ namespace System.Diagnostics.SymbolStore {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum SymAddressKind
+ internal enum SymAddressKind
{
// ILOffset: addr1 = IL local var or param index.
ILOffset = 1,
diff --git a/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs b/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs
index a8a6675a2f..4e00e7743d 100644
--- a/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs
+++ b/src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs
@@ -15,7 +15,7 @@ namespace System.Diagnostics.SymbolStore {
using System.Runtime.InteropServices;
[ComVisible(true)]
- public struct SymbolToken
+ internal struct SymbolToken
{
internal int m_token;
@@ -37,15 +37,5 @@ namespace System.Diagnostics.SymbolStore {
{
return obj.m_token == m_token;
}
-
- public static bool operator ==(SymbolToken a, SymbolToken b)
- {
- return a.Equals(b);
- }
-
- public static bool operator !=(SymbolToken a, SymbolToken b)
- {
- return !(a == b);
- }
}
}
diff --git a/src/mscorlib/src/System/Diagnostics/log.cs b/src/mscorlib/src/System/Diagnostics/log.cs
index 6916ce3a0a..3a72370e7f 100644
--- a/src/mscorlib/src/System/Diagnostics/log.cs
+++ b/src/mscorlib/src/System/Diagnostics/log.cs
@@ -13,18 +13,6 @@ namespace System.Diagnostics {
using System.Runtime.Versioning;
using System.Diagnostics.Contracts;
using System.Diagnostics.CodeAnalysis;
-
- // LogMessageEventHandlers are triggered when a message is generated which is
- // "on" per its switch.
- //
- // By default, the debugger (if attached) is the only event handler.
- // There is also a "built-in" console device which can be enabled
- // programatically, by registry (specifics....) or environment
- // variables.
- [Serializable]
- internal delegate void LogMessageEventHandler(LoggingLevels level, LogSwitch category,
- String message,
- StackTrace location);
// LogSwitchLevelHandlers are triggered when the level of a LogSwitch is modified
@@ -49,7 +37,6 @@ namespace System.Diagnostics {
// desired events are actually reported to the debugger.
internal static Hashtable m_Hashtable;
private static volatile bool m_fConsoleDeviceEnabled;
- private static LogMessageEventHandler _LogMessageEventHandler;
private static volatile LogSwitchLevelHandler _LogSwitchLevelHandler;
private static Object locker;
@@ -72,35 +59,6 @@ namespace System.Diagnostics {
GlobalSwitch.MinimumLevel = LoggingLevels.ErrorLevel;
}
- public static void AddOnLogMessage(LogMessageEventHandler handler)
- {
- lock (locker)
- _LogMessageEventHandler =
- (LogMessageEventHandler) MulticastDelegate.Combine(_LogMessageEventHandler, handler);
- }
-
- public static void RemoveOnLogMessage(LogMessageEventHandler handler)
- {
-
- lock (locker)
- _LogMessageEventHandler =
- (LogMessageEventHandler) MulticastDelegate.Remove(_LogMessageEventHandler, handler);
- }
-
- public static void AddOnLogSwitchLevel(LogSwitchLevelHandler handler)
- {
- lock (locker)
- _LogSwitchLevelHandler =
- (LogSwitchLevelHandler) MulticastDelegate.Combine(_LogSwitchLevelHandler, handler);
- }
-
- public static void RemoveOnLogSwitchLevel(LogSwitchLevelHandler handler)
- {
- lock (locker)
- _LogSwitchLevelHandler =
- (LogSwitchLevelHandler) MulticastDelegate.Remove(_LogSwitchLevelHandler, handler);
- }
-
internal static void InvokeLogSwitchLevelHandlers (LogSwitch ls, LoggingLevels newLevel)
{
LogSwitchLevelHandler handler = _LogSwitchLevelHandler;
@@ -119,15 +77,6 @@ namespace System.Diagnostics {
get { return m_fConsoleDeviceEnabled; }
set { m_fConsoleDeviceEnabled = value; }
}
-
- // Generates a log message. If its switch (or a parent switch) allows the
- // level for the message, it is "broadcast" to all of the log
- // devices.
- //
- public static void LogMessage(LoggingLevels level, String message)
- {
- LogMessage (level, GlobalSwitch, message);
- }
// Generates a log message. If its switch (or a parent switch) allows the
// level for the message, it is "broadcast" to all of the log
@@ -168,74 +117,10 @@ namespace System.Diagnostics {
LogMessage (LoggingLevels.TraceLevel0, logswitch, message);
}
- public static void Trace(String switchname, String message)
- {
- LogSwitch ls;
- ls = LogSwitch.GetSwitch (switchname);
- LogMessage (LoggingLevels.TraceLevel0, ls, message);
- }
-
public static void Trace(String message)
{
LogMessage (LoggingLevels.TraceLevel0, GlobalSwitch, message);
}
-
- public static void Status(LogSwitch logswitch, String message)
- {
- LogMessage (LoggingLevels.StatusLevel0, logswitch, message);
- }
-
- public static void Status(String switchname, String message)
- {
- LogSwitch ls;
- ls = LogSwitch.GetSwitch (switchname);
- LogMessage (LoggingLevels.StatusLevel0, ls, message);
- }
-
- public static void Status(String message)
- {
- LogMessage (LoggingLevels.StatusLevel0, GlobalSwitch, message);
- }
-
- public static void Warning(LogSwitch logswitch, String message)
- {
- LogMessage (LoggingLevels.WarningLevel, logswitch, message);
- }
-
- public static void Warning(String switchname, String message)
- {
- LogSwitch ls;
- ls = LogSwitch.GetSwitch (switchname);
- LogMessage (LoggingLevels.WarningLevel, ls, message);
- }
-
- public static void Warning(String message)
- {
- LogMessage (LoggingLevels.WarningLevel, GlobalSwitch, message);
- }
-
- public static void Error(LogSwitch logswitch, String message)
- {
- LogMessage (LoggingLevels.ErrorLevel, logswitch, message);
- }
-
- public static void Error(String switchname, String message)
- {
- LogSwitch ls;
- ls = LogSwitch.GetSwitch (switchname);
- LogMessage (LoggingLevels.ErrorLevel, ls, message);
-
- }
-
- public static void Error(String message)
- {
- LogMessage (LoggingLevels.ErrorLevel, GlobalSwitch, message);
- }
-
- public static void Panic(String message)
- {
- LogMessage (LoggingLevels.PanicLevel, GlobalSwitch, message);
- }
// Native method to inform the EE about the creation of a new LogSwitch
diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs
index 4e2156d2e1..425087f0d7 100644
--- a/src/mscorlib/src/System/Environment.cs
+++ b/src/mscorlib/src/System/Environment.cs
@@ -226,9 +226,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void FailFast(String message);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void FailFast(String message, uint exitCode);
-
// This overload of FailFast will allow you to specify the exception object
// whose bucket details *could* be used when undergoing the failfast process.
// To be specific:
@@ -252,7 +249,7 @@ namespace System {
**Arguments: The current directory to which to switch to the setter.
**Exceptions:
==============================================================================*/
- public static String CurrentDirectory
+ internal static String CurrentDirectory
{
get{
return Directory.GetCurrentDirectory();
@@ -264,7 +261,7 @@ namespace System {
}
// Returns the system directory (ie, C:\WinNT\System32).
- public static String SystemDirectory {
+ internal static String SystemDirectory {
get {
StringBuilder sb = new StringBuilder(Path.MaxPath);
int r = Win32Native.GetSystemDirectory(sb, Path.MaxPath);
@@ -276,20 +273,6 @@ namespace System {
}
}
- // Returns the windows directory (ie, C:\WinNT).
- // Used by NLS+ custom culures only at the moment.
- internal static String InternalWindowsDirectory {
- get {
- StringBuilder sb = new StringBuilder(Path.MaxPath);
- int r = Win32Native.GetWindowsDirectory(sb, Path.MaxPath);
- Debug.Assert(r < Path.MaxPath, "r < Path.MaxPath");
- if (r==0) __Error.WinIOError();
- String path = sb.ToString();
-
- return path;
- }
- }
-
public static String ExpandEnvironmentVariables(String name)
{
if (name == null)
@@ -381,15 +364,6 @@ namespace System {
}
}
- public static int SystemPageSize {
- get {
- (new EnvironmentPermission(PermissionState.Unrestricted)).Demand();
- Win32Native.SYSTEM_INFO info = new Win32Native.SYSTEM_INFO();
- Win32Native.GetSystemInfo(ref info);
- return info.dwPageSize;
- }
- }
-
/*==============================GetCommandLineArgs==============================
**Action: Gets the command line and splits it appropriately to deal with whitespace,
** quotes, and escape characters.
@@ -474,38 +448,6 @@ namespace System {
return block;
}
-
- /*===============================GetLogicalDrives===============================
- **Action: Retrieves the names of the logical drives on this machine in the form "C:\".
- **Arguments: None.
- **Exceptions: IOException.
- **Permissions: SystemInfo Permission.
- ==============================================================================*/
- public static String[] GetLogicalDrives() {
- new EnvironmentPermission(PermissionState.Unrestricted).Demand();
-
- int drives = Win32Native.GetLogicalDrives();
- if (drives==0)
- __Error.WinIOError();
- uint d = (uint)drives;
- int count = 0;
- while (d != 0) {
- if (((int)d & 1) != 0) count++;
- d >>= 1;
- }
- String[] result = new String[count];
- char[] root = new char[] {'A', ':', '\\'};
- d = (uint)drives;
- count = 0;
- while (d != 0) {
- if (((int)d & 1) != 0) {
- result[count++] = new String(root);
- }
- d >>= 1;
- root[0]++;
- }
- return result;
- }
/*===================================NewLine====================================
**Action: A property which returns the appropriate newline string for the given
@@ -543,23 +485,6 @@ namespace System {
}
}
-
- /*==================================WorkingSet==================================
- **Action:
- **Returns:
- **Arguments:
- **Exceptions:
- ==============================================================================*/
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity]
- private static extern long GetWorkingSet();
-
- public static long WorkingSet {
- get {
- new EnvironmentPermission(PermissionState.Unrestricted).Demand();
- return GetWorkingSet();
- }
- }
-
/*==================================OSVersion===================================
**Action:
@@ -567,7 +492,7 @@ namespace System {
**Arguments:
**Exceptions:
==============================================================================*/
- public static OperatingSystem OSVersion {
+ internal static OperatingSystem OSVersion {
get {
Contract.Ensures(Contract.Result<OperatingSystem>() != null);
@@ -724,16 +649,6 @@ namespace System {
return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3 });
}
- internal static string GetResourceString(string key, object val0, object val1, object val2, object val3, object val4)
- {
- return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3, val4 });
- }
-
- internal static string GetResourceString(string key, object val0, object val1, object val2, object val3, object val4, object val5)
- {
- return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3, val4, val5 });
- }
-
internal static String GetResourceString(string key, params object[] values)
{
return GetResourceStringFormatted(key, values);
@@ -747,84 +662,17 @@ namespace System {
return String.Format(CultureInfo.CurrentCulture, rs, values);
}
- // The following two internal methods are not used anywhere within the framework,
- // but are being kept around as external platforms built on top of us have taken
- // dependency by using private reflection on them for getting system resource strings
- private static String GetRuntimeResourceString(String key) {
- return GetResourceString(key);
- }
-
- private static String GetRuntimeResourceString(String key, params Object[] values) {
- return GetResourceStringFormatted(key,values);
- }
-
- public static bool Is64BitProcess {
- get {
-#if BIT64
- return true;
-#else // 32
- return false;
-#endif
- }
- }
-
- public static bool Is64BitOperatingSystem {
- get {
-#if BIT64
- // 64-bit programs run only on 64-bit
- return true;
-#else // 32
- bool isWow64; // WinXP SP2+ and Win2k3 SP1+
- return Win32Native.DoesWin32MethodExist(Win32Native.KERNEL32, "IsWow64Process")
- && Win32Native.IsWow64Process(Win32Native.GetCurrentProcess(), out isWow64)
- && isWow64;
-#endif
- }
- }
-
public static extern bool HasShutdownStarted {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
get;
}
- public static string UserName {
- get {
- new EnvironmentPermission(EnvironmentPermissionAccess.Read,"UserName").Demand();
-
- StringBuilder sb = new StringBuilder(256);
- int size = sb.Capacity;
- if (Win32Native.GetUserName(sb, ref size))
- {
- return sb.ToString();
- }
- return String.Empty;
- }
- }
-
- public static bool UserInteractive
+ internal static bool UserInteractive
{
get {
return true;
}
}
-
- public static string GetFolderPath(SpecialFolder folder) {
- if (!Enum.IsDefined(typeof(SpecialFolder), folder))
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)folder));
- Contract.EndContractBlock();
-
- return InternalGetFolderPath(folder, SpecialFolderOption.None);
- }
-
- public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) {
- if (!Enum.IsDefined(typeof(SpecialFolder),folder))
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)folder));
- if (!Enum.IsDefined(typeof(SpecialFolderOption),option))
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)option));
- Contract.EndContractBlock();
-
- return InternalGetFolderPath(folder, option);
- }
internal static string UnsafeGetFolderPath(SpecialFolder folder)
{
@@ -851,38 +699,7 @@ namespace System {
}
}
- public static string UserDomainName
- {
- get {
- new EnvironmentPermission(EnvironmentPermissionAccess.Read,"UserDomain").Demand();
-
- byte[] sid = new byte[1024];
- int sidLen = sid.Length;
- StringBuilder domainName = new StringBuilder(1024);
- uint domainNameLen = (uint) domainName.Capacity;
- int peUse;
-
- byte ret = Win32Native.GetUserNameEx(Win32Native.NameSamCompatible, domainName, ref domainNameLen);
- if (ret == 1) {
- string samName = domainName.ToString();
- int index = samName.IndexOf('\\');
- if( index != -1) {
- return samName.Substring(0, index);
- }
- }
- domainNameLen = (uint) domainName.Capacity;
-
- bool success = Win32Native.LookupAccountName(null, UserName, sid, ref sidLen, domainName, ref domainNameLen, out peUse);
- if (!success) {
- int errorCode = Marshal.GetLastWin32Error();
- throw new InvalidOperationException(Win32Native.GetMessage(errorCode));
- }
-
- return domainName.ToString();
- }
- }
-
- public enum SpecialFolderOption {
+ internal enum SpecialFolderOption {
None = 0,
Create = Win32Native.CSIDL_FLAG_CREATE,
DoNotVerify = Win32Native.CSIDL_FLAG_DONT_VERIFY,
@@ -894,7 +711,7 @@ namespace System {
//////!!!!!! 2) ndp\clr\src\BCL\System\Environment.cs !!!!!!////////
//////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!////////
[ComVisible(true)]
- public enum SpecialFolder {
+ internal enum SpecialFolder {
//
// Represents the file system directory that serves as a common repository for
// application-specific data for the current, roaming user.
@@ -1065,7 +882,7 @@ namespace System {
return GetEnvironmentVariableCore(variable);
}
- public static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target)
+ internal static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target)
{
if (variable == null)
{
@@ -1083,7 +900,7 @@ namespace System {
return GetEnvironmentVariablesCore();
}
- public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target)
+ internal static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target)
{
ValidateTarget(target);
@@ -1098,7 +915,7 @@ namespace System {
SetEnvironmentVariableCore(variable, value);
}
- public static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target)
+ internal static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target)
{
ValidateVariableAndValue(variable, ref value);
ValidateTarget(target);
diff --git a/src/mscorlib/src/System/Exception.cs b/src/mscorlib/src/System/Exception.cs
index 0edee80b1a..eb513afffc 100644
--- a/src/mscorlib/src/System/Exception.cs
+++ b/src/mscorlib/src/System/Exception.cs
@@ -537,33 +537,6 @@ namespace System {
}
- // This is used by remoting to preserve the server side stack trace
- // by appending it to the message ... before the exception is rethrown
- // at the client call site.
- internal Exception PrepForRemoting()
- {
- String tmp = null;
-
- if (_remoteStackIndex == 0)
- {
- tmp = Environment.NewLine+ "Server stack trace: " + Environment.NewLine
- + StackTrace
- + Environment.NewLine + Environment.NewLine
- + "Exception rethrown at ["+_remoteStackIndex+"]: " + Environment.NewLine;
- }
- else
- {
- tmp = StackTrace
- + Environment.NewLine + Environment.NewLine
- + "Exception rethrown at ["+_remoteStackIndex+"]: " + Environment.NewLine;
- }
-
- _remoteStackTraceString = tmp;
- _remoteStackIndex++;
-
- return this;
- }
-
// This method will clear the _stackTrace of the exception object upon deserialization
// to ensure that references from another AD/Process dont get accidently used.
[OnDeserialized]
diff --git a/src/mscorlib/src/System/GC.cs b/src/mscorlib/src/System/GC.cs
index e338e44526..81fd98cc7e 100644
--- a/src/mscorlib/src/System/GC.cs
+++ b/src/mscorlib/src/System/GC.cs
@@ -216,18 +216,6 @@ namespace System {
Contract.EndContractBlock();
return _CollectionCount(generation, 0);
}
-
- // pass in true to get the BGC or FGC count.
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- internal static int CollectionCount (int generation, bool getSpecialGCCount)
- {
- if (generation<0)
- {
- throw new ArgumentOutOfRangeException(nameof(generation), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
- }
- Contract.EndContractBlock();
- return _CollectionCount(generation, (getSpecialGCCount ? 1 : 0));
- }
// This method DOES NOT DO ANYTHING in and of itself. It's used to
// prevent a finalizable object from losing any outstanding references
diff --git a/src/mscorlib/src/System/Globalization/CalendarData.cs b/src/mscorlib/src/System/Globalization/CalendarData.cs
index 6f583fbcbc..d66331b31d 100644
--- a/src/mscorlib/src/System/Globalization/CalendarData.cs
+++ b/src/mscorlib/src/System/Globalization/CalendarData.cs
@@ -400,41 +400,6 @@ namespace System.Globalization
return "en-US";
}
- internal void FixupWin7MonthDaySemicolonBug()
- {
- int unescapedCharacterIndex = FindUnescapedCharacter(sMonthDay, ';');
- if (unescapedCharacterIndex > 0)
- {
- sMonthDay = sMonthDay.Substring(0, unescapedCharacterIndex);
- }
- }
- private static int FindUnescapedCharacter(string s, char charToFind)
- {
- bool inComment = false;
- int length = s.Length;
- for (int i = 0; i < length; i++)
- {
- char c = s[i];
-
- switch (c)
- {
- case '\'':
- inComment = !inComment;
- break;
- case '\\':
- i++; // escape sequence -- skip next character
- break;
- default:
- if (!inComment && charToFind == c)
- {
- return i;
- }
- break;
- }
- }
- return -1;
- }
-
// Get native two digit year max
[MethodImplAttribute(MethodImplOptions.InternalCall)]
diff --git a/src/mscorlib/src/System/Globalization/CultureData.cs b/src/mscorlib/src/System/Globalization/CultureData.cs
index 0bcb796152..a93b7d43bb 100644
--- a/src/mscorlib/src/System/Globalization/CultureData.cs
+++ b/src/mscorlib/src/System/Globalization/CultureData.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
@@ -1102,15 +1102,6 @@ namespace System.Globalization
}
}
- // (user can override) country code (RegionInfo)
- internal int ICOUNTRY
- {
- get
- {
- return DoGetLocaleInfoInt(LOCALE_ICOUNTRY);
- }
- }
-
// GeoId
internal int IGEOID
{
@@ -1214,15 +1205,6 @@ namespace System.Globalization
}
}
- // Default Country
- private int IDEFAULTCOUNTRY
- {
- get
- {
- return DoGetLocaleInfoInt(LOCALE_IDEFAULTCOUNTRY);
- }
- }
-
// Console fallback name (ie: locale to use for console apps for unicode-only locales)
internal int IINPUTLANGUAGEHANDLE
{
@@ -1262,26 +1244,6 @@ namespace System.Globalization
}
}
- /////////////
- // Numbers //
- ////////////
-
- // internal String sPositiveSign ; // (user can override) positive sign
- // internal String sNegativeSign ; // (user can override) negative sign
- // internal String[] saNativeDigits ; // (user can override) native characters for digits 0-9
- // internal int iDigitSubstitution ; // (user can override) Digit substitution 0=context, 1=none/arabic, 2=Native/national (2 seems to be unused) (Windows Only)
- // internal int iDigits ; // (user can override) number of fractional digits
- // internal int iNegativeNumber ; // (user can override) negative number format
-
- // Leading zeroes
- private bool ILEADINGZEROS
- {
- get
- {
- return (DoGetLocaleInfoInt(LOCALE_ILZERO) == 1);
- }
- }
-
// (user can override) grouping of digits
internal int[] WAGROUPING
@@ -1506,15 +1468,6 @@ namespace System.Globalization
}
}
- // Paper size
- private int IPAPERSIZE
- {
- get
- {
- return DoGetLocaleInfoInt(LOCALE_IPAPERSIZE);
- }
- }
-
////////////////////////////
// Calendar/Time (Gregorian) //
////////////////////////////
@@ -1712,20 +1665,6 @@ namespace System.Globalization
return index;
}
- // time duration format
- internal String[] SADURATION
- {
- get
- {
- if (this.saDurationFormats == null)
- {
- String durationFormat = DoGetLocaleInfo(LOCALE_SDURATION);
- this.saDurationFormats = new String[] { ReescapeWin32String(durationFormat) };
- }
- return this.saDurationFormats;
- }
- }
-
// (user can override) first day of week
internal int IFIRSTDAYOFWEEK
{
@@ -1944,11 +1883,6 @@ namespace System.Globalization
return calendarData;
}
- internal int CurrentEra(int calendarId)
- {
- return GetCalendar(calendarId).iCurrentEra;
- }
-
///////////////////
// Text Information //
///////////////////
@@ -2054,48 +1988,6 @@ namespace System.Globalization
}
}
- // Typical Scripts for this locale (latn;cyrl; etc)
-
- private String SSCRIPTS
- {
- get
- {
- if (this.sScripts == null)
- {
- this.sScripts = DoGetLocaleInfo(LOCALE_SSCRIPTS);
- }
- return this.sScripts;
- }
- }
-
- private String SOPENTYPELANGUAGETAG
- {
- get
- {
- return DoGetLocaleInfo(LOCALE_SOPENTYPELANGUAGETAG);
- }
- }
-
- private String FONTSIGNATURE
- {
- get
- {
- if (this.fontSignature == null)
- {
- this.fontSignature = DoGetLocaleInfo(LOCALE_FONTSIGNATURE);
- }
- return this.fontSignature;
- }
- }
-
- private String SKEYBOARDSTOINSTALL
- {
- get
- {
- return DoGetLocaleInfo(LOCALE_SKEYBOARDSTOINSTALL);
- }
- }
-
internal int IDEFAULTANSICODEPAGE // default ansi code page ID (ACP)
{
diff --git a/src/mscorlib/src/System/Globalization/CultureInfo.cs b/src/mscorlib/src/System/Globalization/CultureInfo.cs
index 4674baaf7f..795ff9e5dc 100644
--- a/src/mscorlib/src/System/Globalization/CultureInfo.cs
+++ b/src/mscorlib/src/System/Globalization/CultureInfo.cs
@@ -432,21 +432,8 @@ namespace System.Globalization {
this.cultureID = this.m_cultureData.ILANGUAGE;
#endif
}
-#endregion Serialization
-
- // Is it safe to pass the CultureInfo cross AppDomain boundaries, not necessarily as an instance
- // member of Thread. This is different from IsSafeCrossDomain, which implies passing the CultureInfo
- // as a Thread instance member.
- internal bool CanSendCrossDomain()
- {
- bool isSafe = false;
- if (this.GetType() == typeof(System.Globalization.CultureInfo))
- {
- isSafe = true;
- }
- return isSafe;
- }
+#endregion Serialization
// Constructor called by SQL Server's special munged culture - creates a culture with
// a TextInfo and CompareInfo that come from a supplied alternate source. This object
@@ -1811,9 +1798,6 @@ namespace System.Globalization {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern int nativeGetLocaleInfoExInt(String localeName, uint field);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern bool nativeSetThreadLocale(String localeName);
-
private static String GetDefaultLocaleName(int localeType)
{
Debug.Assert(localeType == LOCALE_USER_DEFAULT || localeType == LOCALE_SYSTEM_DEFAULT, "[CultureInfo.GetDefaultLocaleName] localeType must be LOCALE_USER_DEFAULT or LOCALE_SYSTEM_DEFAULT");
diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs
index c6e0591a74..1ace207952 100644
--- a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs
+++ b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs
@@ -1124,14 +1124,6 @@ namespace System {
// local DateTime with a format that will be interpreted as UTC.
internal static void InvalidFormatForLocal(String format, DateTime dateTime) {
}
-
- // This is an MDA for cases when the user is using a local format with
- // a Utc DateTime.
- internal static void InvalidFormatForUtc(String format, DateTime dateTime) {
-#if MDA_SUPPORTED
- Mda.DateTimeInvalidLocalFormat();
-#endif
- }
}
diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs
index b745b0b5d4..d4acf01378 100644
--- a/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs
+++ b/src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs
@@ -378,8 +378,6 @@ namespace System.Globalization {
private int nDataItem;
[OptionalField(VersionAdded = 2)]
internal bool m_isDefaultCalendar; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey)
- [OptionalField(VersionAdded = 2)]
- private static volatile Hashtable s_calendarNativeNames; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey)
// This was synthesized by Whidbey so we knew what words might appear in the middle of a date string
// Now we always synthesize so its not helpful
diff --git a/src/mscorlib/src/System/Globalization/EncodingTable.cs b/src/mscorlib/src/System/Globalization/EncodingTable.cs
index d908a2ac2b..b7c268a956 100644
--- a/src/mscorlib/src/System/Globalization/EncodingTable.cs
+++ b/src/mscorlib/src/System/Globalization/EncodingTable.cs
@@ -203,10 +203,6 @@ namespace System.Globalization
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private unsafe static extern InternalCodePageDataItem* GetCodePageData();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal unsafe static extern byte* nativeCreateOpenFileMapping(
- String inSectionName, int inBytesToAllocate, out IntPtr mappedFileHandle);
}
/*=================================InternalEncodingDataItem==========================
diff --git a/src/mscorlib/src/System/Guid.cs b/src/mscorlib/src/System/Guid.cs
index e2e36ba1b2..87b5270e7a 100644
--- a/src/mscorlib/src/System/Guid.cs
+++ b/src/mscorlib/src/System/Guid.cs
@@ -756,11 +756,6 @@ namespace System {
private static unsafe bool StringToShort(String str, int requiredLength, int flags, out short result, ref GuidResult parseResult) {
return StringToShort(str, null, requiredLength, flags, out result, ref parseResult);
}
- private static unsafe bool StringToShort(String str, ref int parsePos, int requiredLength, int flags, out short result, ref GuidResult parseResult) {
- fixed(int * ppos = &parsePos) {
- return StringToShort(str, ppos, requiredLength, flags, out result, ref parseResult);
- }
- }
private static unsafe bool StringToShort(String str, int* parsePos, int requiredLength, int flags, out short result, ref GuidResult parseResult) {
result = 0;
int x;
@@ -813,9 +808,6 @@ namespace System {
}
return true;
}
- private static unsafe bool StringToLong(String str, int flags, out long result, ref GuidResult parseResult) {
- return StringToLong(str, null, flags, out result, ref parseResult);
- }
private static unsafe bool StringToLong(String str, ref int parsePos, int flags, out long result, ref GuidResult parseResult) {
fixed(int * ppos = &parsePos) {
return StringToLong(str, ppos, flags, out result, ref parseResult);
diff --git a/src/mscorlib/src/System/IAppDomainPauseManager.cs b/src/mscorlib/src/System/IAppDomainPauseManager.cs
index 902a79bd2a..cd3a9033de 100644
--- a/src/mscorlib/src/System/IAppDomainPauseManager.cs
+++ b/src/mscorlib/src/System/IAppDomainPauseManager.cs
@@ -32,46 +32,6 @@ namespace System
}
static readonly AppDomainPauseManager instance = new AppDomainPauseManager();
- internal static AppDomainPauseManager Instance
- {
- get { return instance; }
- }
-
- // FAS: IAppDomainPauseConsumer interface implementation
- // currently there is nothing we do here as the implementation
- // of updating pause times have been moved to native CorHost2
- public void Pausing()
- {
- }
-
- public void Paused()
- {
- Debug.Assert(!isPaused);
-
- if(ResumeEvent == null)
- ResumeEvent = new ManualResetEvent(false);
- else
- ResumeEvent.Reset();
-
- Timer.Pause();
-
- // Set IsPaused at the last as other threads seeing it set, will expect a valid
- // reset ResumeEvent. Also the requirement here is that only after Paused
- // returns other threads should block on this event. So there is a race condition here.
- isPaused = true;
- }
-
- public void Resuming()
- {
- Debug.Assert(isPaused);
- isPaused = false;
- ResumeEvent.Set();
- }
-
- public void Resumed()
- {
- Timer.Resume();
- }
private static volatile bool isPaused;
diff --git a/src/mscorlib/src/System/IO/Directory.cs b/src/mscorlib/src/System/IO/Directory.cs
index c3b150d470..abbf1b5fe1 100644
--- a/src/mscorlib/src/System/IO/Directory.cs
+++ b/src/mscorlib/src/System/IO/Directory.cs
@@ -27,7 +27,7 @@ using System.Diagnostics.Contracts;
namespace System.IO
{
[ComVisible(true)]
- public static class Directory {
+ internal static class Directory {
// Private class that holds search data that is passed around
// in the heap based stack recursion
@@ -49,6 +49,7 @@ namespace System.IO
public readonly SearchOption searchOption;
}
+#if PLATFORM_UNIX
public static IEnumerable<String> EnumerateFiles(String path, String searchPattern, SearchOption searchOption)
{
if (path == null)
@@ -84,13 +85,14 @@ namespace System.IO
return FileSystemEnumerableFactory.CreateFileNameIterator(path, path, searchPattern,
includeFiles, includeDirs, searchOption, true);
}
+#endif // PLATFORM_UNIX
internal static String InternalGetDirectoryRoot(String path) {
if (path == null) return null;
return path.Substring(0, PathInternal.GetRootLength(path));
}
- /*===============================CurrentDirectory===============================
+ /*===============================CurrentDirectory===============================
**Action: Provides a getter and setter for the current directory. The original
** current DirectoryInfo is the one from which the process was started.
**Returns: The current DirectoryInfo (from the getter). Void from the setter.
diff --git a/src/mscorlib/src/System/IO/DriveNotFoundException.cs b/src/mscorlib/src/System/IO/DriveNotFoundException.cs
index 04155bcc0e..9d9c0ff009 100644
--- a/src/mscorlib/src/System/IO/DriveNotFoundException.cs
+++ b/src/mscorlib/src/System/IO/DriveNotFoundException.cs
@@ -18,7 +18,7 @@ namespace System.IO {
//Thrown when trying to access a drive that is not availabe.
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public class DriveNotFoundException : IOException {
+ internal class DriveNotFoundException : IOException {
public DriveNotFoundException()
: base(Environment.GetResourceString("Arg_DriveNotFoundException")) {
SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
@@ -28,11 +28,6 @@ namespace System.IO {
: base(message) {
SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
}
-
- public DriveNotFoundException(String message, Exception innerException)
- : base(message, innerException) {
- SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
- }
protected DriveNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) {
}
diff --git a/src/mscorlib/src/System/IO/File.cs b/src/mscorlib/src/System/IO/File.cs
index b5464d77e2..e3a68c4533 100644
--- a/src/mscorlib/src/System/IO/File.cs
+++ b/src/mscorlib/src/System/IO/File.cs
@@ -29,7 +29,7 @@ namespace System.IO
// Class for creating FileStream objects, and some basic file management
// routines such as Delete, etc.
[ComVisible(true)]
- public static class File
+ internal static class File
{
private const int ERROR_INVALID_PARAMETER = 87;
internal const int GENERIC_READ = unchecked((int)0x80000000);
@@ -107,6 +107,7 @@ namespace System.IO
return bytes;
}
+#if PLATFORM_UNIX
public static String[] ReadAllLines(String path)
{
if (path == null)
@@ -133,6 +134,7 @@ namespace System.IO
return lines.ToArray();
}
+#endif // PLATFORM_UNIX
// Returns 0 on success, otherwise a Win32 error code. Note that
// classes should use -1 as the uninitialized state for dataInitialized.
diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs
index d78632639b..3a89dff5a7 100644
--- a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs
+++ b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs
@@ -115,13 +115,6 @@ namespace System.IO {
Initialize(buffer, offset, length, access, false);
}
- // We must create one of these without doing a security check. This
- // class is created while security is trying to start up. Plus, doing
- // a Demand from Assembly.GetManifestResourceStream isn't useful.
- internal UnmanagedMemoryStream(SafeBuffer buffer, long offset, long length, FileAccess access, bool skipSecurityCheck) {
- Initialize(buffer, offset, length, access, skipSecurityCheck);
- }
-
protected void Initialize(SafeBuffer buffer, long offset, long length, FileAccess access) {
Initialize(buffer, offset, length, access, false);
}
diff --git a/src/mscorlib/src/System/IO/__Error.cs b/src/mscorlib/src/System/IO/__Error.cs
index ad4972de54..73d90a55a1 100644
--- a/src/mscorlib/src/System/IO/__Error.cs
+++ b/src/mscorlib/src/System/IO/__Error.cs
@@ -51,10 +51,6 @@ namespace System.IO {
internal static void ReadNotSupported() {
throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream"));
}
-
- internal static void SeekNotSupported() {
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnseekableStream"));
- }
internal static void WrongAsyncResult() {
throw new ArgumentException(Environment.GetResourceString("Arg_WrongAsyncResult"));
@@ -187,34 +183,11 @@ namespace System.IO {
throw new IOException(Win32Native.GetMessage(errorCode), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath);
}
}
-
- // An alternative to WinIOError with friendlier messages for drives
- internal static void WinIODriveError(String driveName) {
- int errorCode = Marshal.GetLastWin32Error();
- WinIODriveError(driveName, errorCode);
- }
-
- internal static void WinIODriveError(String driveName, int errorCode)
- {
- switch (errorCode) {
- case Win32Native.ERROR_PATH_NOT_FOUND:
- case Win32Native.ERROR_INVALID_DRIVE:
- throw new DriveNotFoundException(Environment.GetResourceString("IO.DriveNotFound_Drive", driveName));
-
- default:
- WinIOError(errorCode, driveName);
- break;
- }
- }
internal static void WriteNotSupported() {
throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream"));
}
- internal static void WriterClosed() {
- throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_WriterClosed"));
- }
-
// From WinError.h
internal const int ERROR_FILE_NOT_FOUND = Win32Native.ERROR_FILE_NOT_FOUND;
internal const int ERROR_PATH_NOT_FOUND = Win32Native.ERROR_PATH_NOT_FOUND;
diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs
index d96d0378e3..841d3b9a85 100644
--- a/src/mscorlib/src/System/MissingFieldException.cs
+++ b/src/mscorlib/src/System/MissingFieldException.cs
@@ -51,14 +51,6 @@ namespace System {
}
}
- // Called from the EE
- private MissingFieldException(String className, String fieldName, byte[] signature)
- {
- ClassName = className;
- MemberName = fieldName;
- Signature = signature;
- }
-
public MissingFieldException(String className, String fieldName)
{
ClassName = className;
diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs
index ab773dc467..02fb217d1f 100644
--- a/src/mscorlib/src/System/MissingMemberException.cs
+++ b/src/mscorlib/src/System/MissingMemberException.cs
@@ -64,16 +64,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String FormatSignature(byte [] signature);
-
-
- // Potentially called from the EE
- private MissingMemberException(String className, String memberName, byte[] signature)
- {
- ClassName = className;
- MemberName = memberName;
- Signature = signature;
- }
-
public MissingMemberException(String className, String memberName)
{
ClassName = className;
diff --git a/src/mscorlib/src/System/MissingMethodException.cs b/src/mscorlib/src/System/MissingMethodException.cs
index 79434900a1..1ca7a2e273 100644
--- a/src/mscorlib/src/System/MissingMethodException.cs
+++ b/src/mscorlib/src/System/MissingMethodException.cs
@@ -53,14 +53,6 @@ namespace System {
}
}
- // Called from the EE
- private MissingMethodException(String className, String methodName, byte[] signature)
- {
- ClassName = className;
- MemberName = methodName;
- Signature = signature;
- }
-
public MissingMethodException(String className, String methodName)
{
ClassName = className;
diff --git a/src/mscorlib/src/System/Number.cs b/src/mscorlib/src/System/Number.cs
index 3412c02c31..66d05673a6 100644
--- a/src/mscorlib/src/System/Number.cs
+++ b/src/mscorlib/src/System/Number.cs
@@ -310,10 +310,6 @@ namespace System {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal unsafe static extern Boolean NumberBufferToDouble(byte* number, ref Double value);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- [System.Runtime.CompilerServices.FriendAccessAllowed]
- internal static extern unsafe string FormatNumberBuffer(byte* number, string format, NumberFormatInfo info, char* allDigits);
-
// Constants used by number parsing
private const Int32 NumberMaxDigits = 50;
diff --git a/src/mscorlib/src/System/OperatingSystem.cs b/src/mscorlib/src/System/OperatingSystem.cs
index a11d4bcce8..64d84838f2 100644
--- a/src/mscorlib/src/System/OperatingSystem.cs
+++ b/src/mscorlib/src/System/OperatingSystem.cs
@@ -20,7 +20,7 @@ namespace System {
[ComVisible(true)]
[Serializable]
- public sealed class OperatingSystem : ICloneable , ISerializable
+ internal sealed class OperatingSystem : ICloneable , ISerializable
{
private Version _version;
private PlatformID _platform;
@@ -30,9 +30,6 @@ namespace System {
private OperatingSystem()
{
}
-
- public OperatingSystem(PlatformID platform, Version version) : this(platform, version, null) {
- }
internal OperatingSystem(PlatformID platform, Version version, string servicePack) {
if( platform < PlatformID.Win32S || platform > PlatformID.MacOSX) {
@@ -82,20 +79,6 @@ namespace System {
info.AddValue("_servicePack", _servicePack);
}
- public PlatformID Platform {
- get { return _platform; }
- }
-
- public string ServicePack {
- get {
- if( _servicePack == null) {
- return string.Empty;
- }
-
- return _servicePack;
- }
- }
-
public Version Version {
get { return _version; }
}
diff --git a/src/mscorlib/src/System/PlatformID.cs b/src/mscorlib/src/System/PlatformID.cs
index 57941996ee..af2d8dfe1d 100644
--- a/src/mscorlib/src/System/PlatformID.cs
+++ b/src/mscorlib/src/System/PlatformID.cs
@@ -14,7 +14,7 @@ namespace System {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum PlatformID
+ internal enum PlatformID
{
Win32S = 0,
Win32Windows = 1,
diff --git a/src/mscorlib/src/System/Reflection/Assembly.cs b/src/mscorlib/src/System/Reflection/Assembly.cs
index cfa8da1067..da94492747 100644
--- a/src/mscorlib/src/System/Reflection/Assembly.cs
+++ b/src/mscorlib/src/System/Reflection/Assembly.cs
@@ -29,8 +29,6 @@ namespace System.Reflection
using StackCrawlMark = System.Threading.StackCrawlMark;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
- using SecurityZone = System.Security.SecurityZone;
- using IEvidenceFactory = System.Security.IEvidenceFactory;
using System.Runtime.Serialization;
using Microsoft.Win32;
using System.Threading;
@@ -44,7 +42,7 @@ namespace System.Reflection
[Serializable]
- public abstract class Assembly : IEvidenceFactory, ICustomAttributeProvider, ISerializable
+ public abstract class Assembly : ICustomAttributeProvider, ISerializable
{
protected Assembly() {}
@@ -118,7 +116,7 @@ namespace System.Reflection
// Evidence is protected in Assembly.Load()
[Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static Assembly LoadFrom(String assemblyFile,
+ internal static Assembly LoadFrom(String assemblyFile,
Evidence securityEvidence)
{
Contract.Ensures(Contract.Result<Assembly>() != null);
@@ -135,28 +133,6 @@ namespace System.Reflection
ref stackMark);
}
- // Evidence is protected in Assembly.Load()
- [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static Assembly LoadFrom(String assemblyFile,
- Evidence securityEvidence,
- byte[] hashValue,
- AssemblyHashAlgorithm hashAlgorithm)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
-
- return RuntimeAssembly.InternalLoadFrom(
- assemblyFile,
- securityEvidence,
- hashValue,
- hashAlgorithm,
- false,
- false,
- ref stackMark);
- }
-
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
public static Assembly LoadFrom(String assemblyFile,
byte[] hashValue,
@@ -224,17 +200,6 @@ namespace System.Reflection
throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength"));
throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReflectionOnlyLoad"));
}
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public static Assembly Load(String assemblyString, Evidence assemblySecurity)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
- Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return RuntimeAssembly.InternalLoad(assemblyString, assemblySecurity, ref stackMark, false /*forIntrospection*/);
- }
// Locate an assembly by its name. The name can be strong or
// weak. The assembly is loaded into the domain of the caller.
@@ -270,17 +235,6 @@ namespace System.Reflection
return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, null, null, ref stackMark, true /*thrownOnFileNotFound*/, false /*forIntrospection*/, false /*suppressSecurityChecks*/, ptrLoadContextBinder);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of Load which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public static Assembly Load(AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
- Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return RuntimeAssembly.InternalLoadAssemblyName(assemblyRef, assemblySecurity, null, ref stackMark, true /*thrownOnFileNotFound*/, false /*forIntrospection*/, false /*suppressSecurityChecks*/);
- }
-
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public static Assembly LoadWithPartialName(String partialName)
{
@@ -335,33 +289,6 @@ namespace System.Reflection
return alc.LoadFromStream(assemblyStream, symbolStream);
}
- // Load an assembly from a byte array, controlling where the grant set of this assembly is
- // propigated from.
- [MethodImpl(MethodImplOptions.NoInlining)] // Due to the stack crawl mark
- public static Assembly Load(byte[] rawAssembly,
- byte[] rawSymbolStore,
- SecurityContextSource securityContextSource)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
- Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-
- AppDomain.CheckLoadByteArraySupported();
-
- if (securityContextSource < SecurityContextSource.CurrentAppDomain ||
- securityContextSource > SecurityContextSource.CurrentAssembly)
- {
- throw new ArgumentOutOfRangeException(nameof(securityContextSource));
- }
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return RuntimeAssembly.nLoadImage(rawAssembly,
- rawSymbolStore,
- null, // evidence
- ref stackMark,
- false, // fIntrospection
- securityContextSource);
- }
-
private static Dictionary<string, Assembly> s_loadfile = new Dictionary<string, Assembly>();
public static Assembly LoadFile(String path)
@@ -393,25 +320,6 @@ namespace System.Reflection
return result;
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static Assembly Load(Stream assemblyStream, Stream pdbStream)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
- Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return RuntimeAssembly.InternalLoadFromStream(assemblyStream, pdbStream, ref stackMark);
- }
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static Assembly Load(Stream assemblyStream)
- {
- Contract.Ensures(Contract.Result<Assembly>() != null);
- Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly);
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return RuntimeAssembly.InternalLoadFromStream(assemblyStream, null, ref stackMark);
- }
-
/*
* Get the assembly that the current code is running from.
*/
@@ -855,15 +763,6 @@ namespace System.Reflection
}
- // Keep this in sync with LOADCTX_TYPE defined in fusionpriv.idl
- internal enum LoadContext
- {
- DEFAULT,
- LOADFROM,
- UNKNOWN,
- HOSTED,
- }
-
[Serializable]
internal class RuntimeAssembly : Assembly
{
@@ -1074,10 +973,6 @@ namespace System.Reflection
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- internal extern static void GetForwardedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
private extern static void GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes);
public override Type[] GetExportedTypes()
@@ -1351,15 +1246,6 @@ namespace System.Reflection
ASSEMBLY_FLAGS flags = Flags;
return (flags & ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION) != 0;
}
-
- private bool IsDesignerBindingContext()
- {
- return RuntimeAssembly.nIsDesignerBindingContext(this);
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static bool nIsDesignerBindingContext(RuntimeAssembly assembly);
#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -1400,57 +1286,6 @@ namespace System.Reflection
}
}
- // Loads the assembly with a COFF based IMAGE containing
- // an emitted assembly. The assembly is loaded into the domain
- // of the caller. Currently is implemented only for UnmanagedMemoryStream
- // (no derived classes since we are not calling Read())
- internal static RuntimeAssembly InternalLoadFromStream(Stream assemblyStream, Stream pdbStream, ref StackCrawlMark stackMark)
- {
- if (assemblyStream == null)
- throw new ArgumentNullException(nameof(assemblyStream));
-
- if (assemblyStream.GetType()!=typeof(UnmanagedMemoryStream))
- throw new NotSupportedException();
-
- if (pdbStream!= null && pdbStream.GetType()!=typeof(UnmanagedMemoryStream))
- throw new NotSupportedException();
-
- AppDomain.CheckLoadFromSupported();
-
- UnmanagedMemoryStream umAssemblyStream = (UnmanagedMemoryStream)assemblyStream;
- UnmanagedMemoryStream umPdbStream = (UnmanagedMemoryStream)pdbStream;
-
- unsafe
- {
- byte* umAssemblyStreamBuffer=umAssemblyStream.PositionPointer;
- byte* umPdbStreamBuffer=(umPdbStream!=null)?umPdbStream.PositionPointer:null;
- long assemblyDataLength = umAssemblyStream.Length-umAssemblyStream.Position;
- long pdbDataLength = (umPdbStream!=null)?(umPdbStream.Length-umPdbStream.Position):0;
-
- // use Seek() to benefit from boundary checking, the actual read is done using *StreamBuffer
- umAssemblyStream.Seek(assemblyDataLength,SeekOrigin.Current);
-
- if(umPdbStream != null)
- {
- umPdbStream.Seek(pdbDataLength,SeekOrigin.Current);
- }
-
- BCLDebug.Assert(assemblyDataLength > 0L, "assemblyDataLength > 0L");
-
- RuntimeAssembly assembly = null;
-
- nLoadFromUnmanagedArray(false,
- umAssemblyStreamBuffer,
- (ulong)assemblyDataLength,
- umPdbStreamBuffer,
- (ulong)pdbDataLength,
- JitHelpers.GetStackCrawlMarkHandle(ref stackMark),
- JitHelpers.GetObjectHandleOnStack(ref assembly));
-
- return assembly;
- }
- }
-
// Returns the module in this assembly with name 'name'
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -1579,10 +1414,6 @@ namespace System.Reflection
}
}
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool IsGlobalAssemblyCache(RuntimeAssembly assembly);
-
public override bool GlobalAssemblyCache
{
get
@@ -1591,10 +1422,6 @@ namespace System.Reflection
}
}
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static Int64 GetHostContext(RuntimeAssembly assembly);
-
public override Int64 HostContext
{
get
@@ -1764,19 +1591,6 @@ namespace System.Reflection
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- private static extern void GetRawBytes(RuntimeAssembly assembly, ObjectHandleOnStack retRawBytes);
-
- // Get the raw bytes of the assembly
- internal byte[] GetRawBytes()
- {
- byte[] rawBytes = null;
-
- GetRawBytes(GetNativeHandle(), JitHelpers.GetObjectHandleOnStack(ref rawBytes));
- return rawBytes;
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
private static extern void GetPublicKey(RuntimeAssembly assembly, ObjectHandleOnStack retPublicKey);
internal byte[] GetPublicKey()
@@ -1788,50 +1602,6 @@ namespace System.Reflection
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- private extern static void GetGrantSet(RuntimeAssembly assembly, ObjectHandleOnStack granted, ObjectHandleOnStack denied);
-
- internal void GetGrantSet(out PermissionSet newGrant, out PermissionSet newDenied)
- {
- PermissionSet granted = null, denied = null;
- GetGrantSet(GetNativeHandle(), JitHelpers.GetObjectHandleOnStack(ref granted), JitHelpers.GetObjectHandleOnStack(ref denied));
- newGrant = granted; newDenied = denied;
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private extern static bool IsAllSecurityCritical(RuntimeAssembly assembly);
-
- // Is everything introduced by this assembly critical
- internal bool IsAllSecurityCritical()
- {
- return IsAllSecurityCritical(GetNativeHandle());
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private extern static bool IsAllSecuritySafeCritical(RuntimeAssembly assembly);
-
- // Is everything introduced by this assembly safe critical
- internal bool IsAllSecuritySafeCritical()
- {
- return IsAllSecuritySafeCritical(GetNativeHandle());
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private extern static bool IsAllPublicAreaSecuritySafeCritical(RuntimeAssembly assembly);
-
- // Is everything introduced by this assembly safe critical
- internal bool IsAllPublicAreaSecuritySafeCritical()
- {
- return IsAllPublicAreaSecuritySafeCritical(GetNativeHandle());
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
private extern static bool IsAllSecurityTransparent(RuntimeAssembly assembly);
@@ -1921,117 +1691,6 @@ namespace System.Reflection
return retAssembly;
}
- // Helper method used by InternalGetSatelliteAssembly only. Not abstracted for use elsewhere.
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- private RuntimeAssembly InternalProbeForSatelliteAssemblyNextToParentAssembly(AssemblyName an,
- String name,
- String codeBase,
- CultureInfo culture,
- bool throwOnFileNotFound,
- bool useLoadFile,
- ref StackCrawlMark stackMark)
- {
- // if useLoadFile == false, we do LoadFrom binds
-
- RuntimeAssembly retAssembly = null;
- String location = null;
-
- if (useLoadFile)
- location = Location;
-
- FileNotFoundException dllNotFoundException = null;
-
- StringBuilder assemblyFile = new StringBuilder(useLoadFile ? location : codeBase,
- 0,
- useLoadFile ? location.LastIndexOf('\\') + 1 : codeBase.LastIndexOf('/') + 1,
- Path.MaxPath);
- assemblyFile.Append(an.CultureInfo.Name);
- assemblyFile.Append(useLoadFile ? '\\' : '/');
- assemblyFile.Append(name);
- assemblyFile.Append(".DLL");
-
- string fileNameOrCodeBase = assemblyFile.ToString();
-
- AssemblyName loadFromAsmName = null;
-
- if (useLoadFile == false)
- {
- loadFromAsmName = new AssemblyName();
- // set just the codebase - we want this to be a pure LoadFrom
- loadFromAsmName.CodeBase = fileNameOrCodeBase;
- }
-
- try
- {
- try
- {
- retAssembly = useLoadFile ? nLoadFile(fileNameOrCodeBase, null) :
- nLoad(loadFromAsmName, fileNameOrCodeBase, null, this, ref stackMark,
- IntPtr.Zero,
- throwOnFileNotFound, false, false);
- }
- catch (FileNotFoundException)
- {
- // Create our own exception since the one caught doesn't have a filename associated with it, making it less useful for debugging.
- dllNotFoundException = new FileNotFoundException(String.Format(culture,
- Environment.GetResourceString("IO.FileNotFound_FileName"),
- fileNameOrCodeBase),
- fileNameOrCodeBase); // Save this exception so we can throw it if we also don't find the .EXE
- retAssembly = null;
- }
-
- if (retAssembly == null)
- {
- // LoadFile will always throw, but LoadFrom will only throw if throwOnFileNotFound is true.
- // If an exception was thrown, we must have a dllNotFoundException ready for throwing later.
- BCLDebug.Assert((useLoadFile == false && throwOnFileNotFound == false) || dllNotFoundException != null,
- "(useLoadFile == false && throwOnFileNotFound == false) || dllNotFoundException != null");
-
- assemblyFile.Remove(assemblyFile.Length - 4, 4);
- assemblyFile.Append(".EXE");
- fileNameOrCodeBase = assemblyFile.ToString();
-
- if (useLoadFile == false)
- loadFromAsmName.CodeBase = fileNameOrCodeBase;
-
- try
- {
- retAssembly = useLoadFile ? nLoadFile(fileNameOrCodeBase, null) :
- nLoad(loadFromAsmName, fileNameOrCodeBase, null, this, ref stackMark,
- IntPtr.Zero,
- false /* do not throw on file not found */, false, false);
-
- }
- catch (FileNotFoundException)
- {
- retAssembly = null;
- }
-
- // It would be messy to have a FileNotFoundException that reports both .DLL and .EXE not found.
- // Using a .DLL extension for satellite assemblies is the more common scenario,
- // so just throw that exception.
-
- // In classic (i.e. non-AppX) mode, if binder logging is turned on, there will be separate logs for
- // the .DLL and .EXE load attempts if the user is interested in digging deeper.
-
- if (retAssembly == null && throwOnFileNotFound)
- throw dllNotFoundException;
- }
- }
- catch (DirectoryNotFoundException)
- {
- if (throwOnFileNotFound)
- throw;
- retAssembly = null;
- }
- // No other exceptions should be caught here.
-
- return retAssembly;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern RuntimeAssembly nLoadFile(String path, Evidence evidence);
-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static internal extern RuntimeAssembly nLoadImage(byte[] rawAssembly,
byte[] rawSymbolStore,
@@ -2042,16 +1701,6 @@ namespace System.Reflection
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- static internal extern unsafe void nLoadFromUnmanagedArray(bool fIntrospection,
- byte* assemblyContent,
- ulong assemblySize,
- byte* pdbContent,
- ulong pdbSize,
- StackCrawlMarkHandle stackMark,
- ObjectHandleOnStack retAssembly);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
private extern static void GetModules(RuntimeAssembly assembly,
bool loadIfNotFound,
bool getResourceModules,
diff --git a/src/mscorlib/src/System/Reflection/AssemblyNameProxy.cs b/src/mscorlib/src/System/Reflection/AssemblyNameProxy.cs
deleted file mode 100644
index 8c8fa8d286..0000000000
--- a/src/mscorlib/src/System/Reflection/AssemblyNameProxy.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-**
-**
-**
-** Purpose: Remotable version the AssemblyName
-**
-**
-===========================================================*/
-namespace System.Reflection {
- using System;
- using System.Runtime.Versioning;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- public class AssemblyNameProxy : MarshalByRefObject
- {
- public AssemblyName GetAssemblyName(String assemblyFile)
- {
- return AssemblyName.GetAssemblyName(assemblyFile);
- }
- }
-}
diff --git a/src/mscorlib/src/System/Reflection/ConstructorInfo.cs b/src/mscorlib/src/System/Reflection/ConstructorInfo.cs
index c5549d0cb6..72115e94e3 100644
--- a/src/mscorlib/src/System/Reflection/ConstructorInfo.cs
+++ b/src/mscorlib/src/System/Reflection/ConstructorInfo.cs
@@ -133,14 +133,6 @@ namespace System.Reflection
return false;
}
-
- internal override bool IsDynamicallyInvokable
- {
- get
- {
- return !AppDomain.ProfileAPICheck || !IsNonW8PFrameworkAPI();
- }
- }
#endif // FEATURE_APPX
internal INVOCATION_FLAGS InvocationFlags
@@ -268,20 +260,6 @@ namespace System.Reflection
}
internal BindingFlags BindingFlags { get { return m_bindingFlags; } }
-
- // Differs from MethodHandle in that it will return a valid handle even for reflection only loaded types
- internal RuntimeMethodHandle GetMethodHandle()
- {
- return new RuntimeMethodHandle(this);
- }
-
- internal bool IsOverloaded
- {
- get
- {
- return m_reflectedTypeCache.GetConstructorList(MemberListType.CaseSensitive, Name).Length > 1;
- }
- }
#endregion
#region Object Overrides
@@ -537,7 +515,7 @@ namespace System.Reflection
#pragma warning disable 618
- [ReflectionPermissionAttribute(SecurityAction.Demand, Flags = ReflectionPermissionFlag.MemberAccess)]
+ [ReflectionPermission(SecurityAction.Demand, Flags = ReflectionPermissionFlag.MemberAccess)]
#pragma warning restore 618
public override MethodBody GetMethodBody()
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs
index 34b657f70e..aed61f64fc 100644
--- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs
@@ -218,11 +218,6 @@ namespace System.Reflection.Emit
return InternalAssembly.GetNativeHandle();
}
- internal Version GetVersion()
- {
- return InternalAssembly.GetVersion();
- }
-
#if FEATURE_APPX
internal bool ProfileAPICheck
{
@@ -554,19 +549,8 @@ namespace System.Reflection.Emit
return dynModule;
} // DefineDynamicModuleInternalNoLock
- #endregion
-
- private Assembly LoadISymWrapper()
- {
- if (m_assemblyData.m_ISymWrapperAssembly != null)
- return m_assemblyData.m_ISymWrapperAssembly;
-
- Assembly assem = Assembly.Load("ISymWrapper, Version=" + ThisAssembly.Version +
- ", Culture=neutral, PublicKeyToken=" + AssemblyRef.MicrosoftPublicKeyToken);
- m_assemblyData.m_ISymWrapperAssembly = assem;
- return assem;
- }
+#endregion
internal void CheckContext(params Type[][] typess)
{
@@ -834,46 +818,6 @@ namespace System.Reflection.Emit
}
return null;
}
-
- /**********************************************
- *
- * Setting the entry point if the assembly builder is building
- * an exe.
- *
- **********************************************/
- public void SetEntryPoint(
- MethodInfo entryMethod)
- {
- SetEntryPoint(entryMethod, PEFileKinds.ConsoleApplication);
- }
- public void SetEntryPoint(
- MethodInfo entryMethod, // entry method for the assembly. We use this to determine the entry module
- PEFileKinds fileKind) // file kind for the assembly.
- {
- lock(SyncRoot)
- {
- SetEntryPointNoLock(entryMethod, fileKind);
- }
- }
-
- private void SetEntryPointNoLock(
- MethodInfo entryMethod, // entry method for the assembly. We use this to determine the entry module
- PEFileKinds fileKind) // file kind for the assembly.
- {
-
- if (entryMethod == null)
- throw new ArgumentNullException(nameof(entryMethod));
- Contract.EndContractBlock();
-
- BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilder.SetEntryPoint");
-
- Module tmpModule = entryMethod.Module;
- if (tmpModule == null || !InternalAssembly.Equals(tmpModule.Assembly))
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EntryMethodNotDefinedInAssembly"));
-
- m_assemblyData.m_entryPointMethod = entryMethod;
- m_assemblyData.m_peFileKind = fileKind;
- }
/**********************************************
@@ -942,78 +886,6 @@ namespace System.Reflection.Emit
}
}
-
- /**********************************************
- *
- * Saves the assembly to disk. Also saves all dynamic modules defined
- * in this dynamic assembly. Assembly file name can be the same as one of
- * the module's name. If so, assembly info is stored within that module.
- * Assembly file name can be different from all of the modules underneath. In
- * this case, assembly is stored stand alone.
- *
- **********************************************/
-
- public void Save(String assemblyFileName) // assembly file name
- {
- Save(assemblyFileName, System.Reflection.PortableExecutableKinds.ILOnly, System.Reflection.ImageFileMachine.I386);
- }
-
- public void Save(String assemblyFileName,
- PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
- {
- lock(SyncRoot)
- {
- SaveNoLock(assemblyFileName, portableExecutableKind, imageFileMachine);
- }
- }
-
- private void SaveNoLock(String assemblyFileName,
- PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
- {
- // AssemblyBuilderAccess.Save can never be set in CoreCLR
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CantSaveTransientAssembly"));
- }
-
- internal bool IsPersistable()
- {
- {
- return false;
- }
- }
-
- /**********************************************
- *
- * Internal helper to walk the nested type hierachy
- *
- **********************************************/
- private int DefineNestedComType(Type type, int tkResolutionScope, int tkTypeDef)
- {
- Type enclosingType = type.DeclaringType;
- if (enclosingType == null)
- {
- // Use full type name for non-nested types.
- return AddExportedTypeOnDisk(GetNativeHandle(), type.FullName, tkResolutionScope, tkTypeDef, type.Attributes);
- }
-
- tkResolutionScope = DefineNestedComType(enclosingType, tkResolutionScope, tkTypeDef);
- // Use simple name for nested types.
- return AddExportedTypeOnDisk(GetNativeHandle(), type.Name, tkResolutionScope, tkTypeDef, type.Attributes);
- }
-
- internal int DefineExportedTypeInMemory(Type type, int tkResolutionScope, int tkTypeDef)
- {
- Type enclosingType = type.DeclaringType;
- if (enclosingType == null)
- {
- // Use full type name for non-nested types.
- return AddExportedTypeInMemory(GetNativeHandle(), type.FullName, tkResolutionScope, tkTypeDef, type.Attributes);
- }
-
- tkResolutionScope = DefineExportedTypeInMemory(enclosingType, tkResolutionScope, tkTypeDef);
- // Use simple name for nested types.
- return AddExportedTypeInMemory(GetNativeHandle(), type.Name, tkResolutionScope, tkTypeDef, type.Attributes);
- }
-
/**********************************************
*
* Private methods
@@ -1025,105 +897,5 @@ namespace System.Reflection.Emit
* @internonly
**********************************************/
private AssemblyBuilder() {}
-
- // Create a new module in which to emit code. This module will not contain the manifest.
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void DefineDynamicModule(RuntimeAssembly containingAssembly,
- bool emitSymbolInfo,
- String name,
- String filename,
- StackCrawlMarkHandle stackMark,
- ref IntPtr pInternalSymWriter,
- ObjectHandleOnStack retModule,
- bool fIsTransient,
- out int tkFile);
-
- private static Module DefineDynamicModule(RuntimeAssembly containingAssembly,
- bool emitSymbolInfo,
- String name,
- String filename,
- ref StackCrawlMark stackMark,
- ref IntPtr pInternalSymWriter,
- bool fIsTransient,
- out int tkFile)
- {
- RuntimeModule retModule = null;
-
- DefineDynamicModule(containingAssembly.GetNativeHandle(),
- emitSymbolInfo,
- name,
- filename,
- JitHelpers.GetStackCrawlMarkHandle(ref stackMark),
- ref pInternalSymWriter,
- JitHelpers.GetObjectHandleOnStack(ref retModule),
- fIsTransient,
- out tkFile);
-
- return retModule;
- }
-
- // The following functions are native helpers for creating on-disk manifest
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void PrepareForSavingManifestToDisk(RuntimeAssembly assembly, RuntimeModule assemblyModule); // module to contain assembly information if assembly is embedded
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void SaveManifestToDisk(RuntimeAssembly assembly,
- String strFileName,
- int entryPoint,
- int fileKind,
- int portableExecutableKind,
- int ImageFileMachine);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern int AddFile(RuntimeAssembly assembly, String strFileName);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void SetFileHashValue(RuntimeAssembly assembly,
- int tkFile,
- String strFullFileName);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern int AddExportedTypeInMemory(RuntimeAssembly assembly,
- String strComTypeName,
- int tkAssemblyRef,
- int tkTypeDef,
- TypeAttributes flags);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern int AddExportedTypeOnDisk(RuntimeAssembly assembly,
- String strComTypeName,
- int tkAssemblyRef,
- int tkTypeDef,
- TypeAttributes flags);
-
- // Add an entry to assembly's manifestResource table for a stand alone resource.
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void AddStandAloneResource(RuntimeAssembly assembly,
- String strName,
- String strFileName,
- String strFullFileName,
- int attribute);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
-#pragma warning disable 618
- static private extern void AddDeclarativeSecurity(RuntimeAssembly assembly, SecurityAction action, byte[] blob, int length);
-#pragma warning restore 618
-
- // Functions for defining unmanaged resources.
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- static private extern void CreateVersionInfoResource(String filename, String title, String iconFilename, String description,
- String copyright, String trademark, String company, String product,
- String productVersion, String fileVersion, int lcid, bool isDll,
- StringHandleOnStack retFileName);
}
}
diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs
index f0f83e7d2a..4e2dee0a66 100644
--- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs
@@ -14,7 +14,6 @@ namespace System.Reflection.Emit {
using System.Security;
using System.Diagnostics;
using CultureInfo = System.Globalization.CultureInfo;
- using IResourceWriter = System.Resources.IResourceWriter;
using System.IO;
using System.Runtime.Versioning;
using System.Diagnostics.SymbolStore;
@@ -52,12 +51,6 @@ namespace System.Reflection.Emit {
{
m_moduleBuilderList.Add(dynModule);
}
-
- // Helper to add a resource information into the tracking list
- internal void AddResWriter(ResWriterData resData)
- {
- m_resWriterList.Add(resData);
- }
// Helper to track CAs to persist onto disk
@@ -110,194 +103,6 @@ namespace System.Reflection.Emit {
m_CACons[m_iCAs] = con;
m_iCAs++;
}
-
- // Helper to calculate unmanaged version info from Assembly's custom attributes.
- // If DefineUnmanagedVersionInfo is called, the parameter provided will override
- // the CA's value.
- //
- internal void FillUnmanagedVersionInfo()
- {
- // Get the lcid set on the assembly name as default if available
- // Note that if LCID is not avaible from neither AssemblyName or AssemblyCultureAttribute,
- // it is default to -1 which is treated as language neutral.
- //
- CultureInfo locale = m_assembly.GetLocale();
-#if FEATURE_USE_LCID
- if (locale != null)
- m_nativeVersion.m_lcid = locale.LCID;
-#endif
-
- for (int i = 0; i < m_iCABuilder; i++)
- {
- // check for known attributes
- Type conType = m_CABuilders[i].m_con.DeclaringType;
- if (m_CABuilders[i].m_constructorArgs.Length == 0 || m_CABuilders[i].m_constructorArgs[0] == null)
- continue;
-
- if (conType.Equals(typeof(System.Reflection.AssemblyCopyrightAttribute)))
- {
- // assert that we should only have one argument for this CA and the type should
- // be a string.
- //
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- m_nativeVersion.m_strCopyright = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyTrademarkAttribute)))
- {
- // assert that we should only have one argument for this CA and the type should
- // be a string.
- //
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- m_nativeVersion.m_strTrademark = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyProductAttribute)))
- {
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- // assert that we should only have one argument for this CA and the type should
- // be a string.
- //
- m_nativeVersion.m_strProduct = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyCompanyAttribute)))
- {
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- // assert that we should only have one argument for this CA and the type should
- // be a string.
- //
- m_nativeVersion.m_strCompany = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyDescriptionAttribute)))
- {
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- m_nativeVersion.m_strDescription = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyTitleAttribute)))
- {
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- m_nativeVersion.m_strTitle = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyInformationalVersionAttribute)))
- {
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- m_nativeVersion.m_strProductVersion = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyCultureAttribute)))
- {
- // retrieve the LCID
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- // CultureInfo attribute overrides the lcid from AssemblyName.
- CultureInfo culture = new CultureInfo(m_CABuilders[i].m_constructorArgs[0].ToString());
-#if FEATURE_USE_LCID
- m_nativeVersion.m_lcid = culture.LCID;
-#endif
- }
- else if (conType.Equals(typeof(System.Reflection.AssemblyFileVersionAttribute)))
- {
- if (m_CABuilders[i].m_constructorArgs.Length != 1)
- {
- throw new ArgumentException(Environment.GetResourceString(
- "Argument_BadCAForUnmngRSC",
- m_CABuilders[i].m_con.ReflectedType.Name));
- }
- if (m_OverrideUnmanagedVersionInfo == false)
- {
- m_nativeVersion.m_strFileVersion = m_CABuilders[i].m_constructorArgs[0].ToString();
- }
- }
- }
- }
-
-
- // Helper to ensure the resource name is unique underneath assemblyBuilder
- internal void CheckResNameConflict(String strNewResName)
- {
- int size = m_resWriterList.Count;
- int i;
- for (i = 0; i < size; i++)
- {
- ResWriterData resWriter = m_resWriterList[i];
- if (resWriter.m_strName.Equals(strNewResName))
- {
- // Cannot have two resources with the same name
- throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateResourceName"));
- }
- }
- }
-
-
- // Helper to ensure the module name is unique underneath assemblyBuilder
- internal void CheckNameConflict(String strNewModuleName)
- {
- int size = m_moduleBuilderList.Count;
- int i;
- for (i = 0; i < size; i++)
- {
- ModuleBuilder moduleBuilder = m_moduleBuilderList[i];
- if (moduleBuilder.m_moduleData.m_strModuleName.Equals(strNewModuleName))
- {
- // Cannot have two dynamic modules with the same name
- throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateModuleName"));
- }
- }
-
- // Right now dynamic modules can only be added to dynamic assemblies in which
- // all modules are dynamic. Otherwise we would also need to check the static modules
- // with this:
- // if (m_assembly.GetModule(strNewModuleName) != null)
- // {
- // // Cannot have two dynamic modules with the same name
- // throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateModuleName"));
- // }
- }
// Helper to ensure the type name is unique underneath assemblyBuilder
internal void CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
@@ -320,102 +125,6 @@ namespace System.Reflection.Emit {
// }
}
-
- // Helper to ensure the file name is unique underneath assemblyBuilder. This includes
- // modules and resources.
- //
- //
- //
- internal void CheckFileNameConflict(String strFileName)
- {
- int size = m_moduleBuilderList.Count;
- int i;
- for (i = 0; i < size; i++)
- {
- ModuleBuilder moduleBuilder = m_moduleBuilderList[i];
- if (moduleBuilder.m_moduleData.m_strFileName != null)
- {
- if (String.Compare(moduleBuilder.m_moduleData.m_strFileName, strFileName, StringComparison.OrdinalIgnoreCase) == 0)
- {
- // Cannot have two dynamic module with the same name
- throw new ArgumentException(Environment.GetResourceString("Argument_DuplicatedFileName"));
- }
- }
- }
- size = m_resWriterList.Count;
- for (i = 0; i < size; i++)
- {
- ResWriterData resWriter = m_resWriterList[i];
- if (resWriter.m_strFileName != null)
- {
- if (String.Compare(resWriter.m_strFileName, strFileName, StringComparison.OrdinalIgnoreCase) == 0)
- {
- // Cannot have two dynamic module with the same name
- throw new ArgumentException(Environment.GetResourceString("Argument_DuplicatedFileName"));
- }
- }
- }
-
- }
-
- // Helper to look up which module that assembly is supposed to be stored at
- //
- //
- //
- internal ModuleBuilder FindModuleWithFileName(String strFileName)
- {
- int size = m_moduleBuilderList.Count;
- int i;
- for (i = 0; i < size; i++)
- {
- ModuleBuilder moduleBuilder = m_moduleBuilderList[i];
- if (moduleBuilder.m_moduleData.m_strFileName != null)
- {
- if (String.Compare(moduleBuilder.m_moduleData.m_strFileName, strFileName, StringComparison.OrdinalIgnoreCase) == 0)
- {
- return moduleBuilder;
- }
- }
- }
- return null;
- }
-
- // Helper to look up module by name.
- //
- //
- //
- internal ModuleBuilder FindModuleWithName(String strName)
- {
- int size = m_moduleBuilderList.Count;
- int i;
- for (i = 0; i < size; i++)
- {
- ModuleBuilder moduleBuilder = m_moduleBuilderList[i];
- if (moduleBuilder.m_moduleData.m_strModuleName != null)
- {
- if (String.Compare(moduleBuilder.m_moduleData.m_strModuleName, strName, StringComparison.OrdinalIgnoreCase) == 0)
- return moduleBuilder;
- }
- }
- return null;
- }
-
-
- // add type to public COMType tracking list
- internal void AddPublicComType(Type type)
- {
- BCLDebug.Log("DYNIL","## DYNIL LOGGING: AssemblyBuilderData.AddPublicComType( " + type.FullName + " )");
- if (m_isSaved == true)
- {
- // assembly has been saved before!
- throw new InvalidOperationException(Environment.GetResourceString(
- "InvalidOperation_CannotAlterAssembly"));
- }
- EnsurePublicComTypeCapacity();
- m_publicComTypeList[m_iPublicComTypeCount] = type;
- m_iPublicComTypeCount++;
- }
-
// add security permission requests
internal void AddPermissionRequests(
PermissionSet required,
@@ -433,20 +142,6 @@ namespace System.Reflection.Emit {
m_OptionalPset = optional;
m_RefusedPset = refused;
}
-
- private void EnsurePublicComTypeCapacity()
- {
- if (m_publicComTypeList == null)
- {
- m_publicComTypeList = new Type[m_iInitialSize];
- }
- if (m_iPublicComTypeCount == m_publicComTypeList.Length)
- {
- Type[] tempTypeList = new Type[m_iPublicComTypeCount * 2];
- Array.Copy(m_publicComTypeList, 0, tempTypeList, 0, m_iPublicComTypeCount);
- m_publicComTypeList = tempTypeList;
- }
- }
internal List<ModuleBuilder> m_moduleBuilderList;
internal List<ResWriterData> m_resWriterList;
@@ -497,24 +192,6 @@ namespace System.Reflection.Emit {
**********************************************/
internal class ResWriterData
{
- internal ResWriterData(
- IResourceWriter resWriter,
- Stream memoryStream,
- String strName,
- String strFileName,
- String strFullFileName,
- ResourceAttributes attribute)
- {
- m_resWriter = resWriter;
- m_memoryStream = memoryStream;
- m_strName = strName;
- m_strFileName = strFileName;
- m_strFullFileName = strFullFileName;
- m_nextResWriter = null;
- m_attribute = attribute;
- }
-
- internal IResourceWriter m_resWriter;
internal String m_strName;
internal String m_strFileName;
internal String m_strFullFileName;
diff --git a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs
index 3e1f348ee8..8b1a3b6277 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs
@@ -62,11 +62,6 @@ namespace System.Reflection.Emit
{
return m_methodBuilder.GetTypeBuilder();
}
-
- internal ModuleBuilder GetModuleBuilder()
- {
- return GetTypeBuilder().GetModuleBuilder();
- }
#endregion
#region Object Overrides
@@ -178,11 +173,6 @@ namespace System.Reflection.Emit
return m_methodBuilder.DefineParameter(iSequence, attributes, strParamName);
}
- public void SetSymCustomAttribute(String name, byte[] data)
- {
- m_methodBuilder.SetSymCustomAttribute(name, data);
- }
-
public ILGenerator GetILGenerator()
{
if (m_isDefaultConstructor)
@@ -199,16 +189,6 @@ namespace System.Reflection.Emit
return m_methodBuilder.GetILGenerator(streamSize);
}
- public void SetMethodBody(byte[] il, int maxStack, byte[] localSignature, IEnumerable<ExceptionHandler> exceptionHandlers, IEnumerable<int> tokenFixups)
- {
- if (m_isDefaultConstructor)
- {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DefaultConstructorDefineBody"));
- }
-
- m_methodBuilder.SetMethodBody(il, maxStack, localSignature, exceptionHandlers, tokenFixups);
- }
-
public override CallingConventions CallingConvention
{
get
@@ -224,13 +204,6 @@ namespace System.Reflection.Emit
{
return m_methodBuilder.GetModule();
}
-
-
- [Obsolete("This property has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")] //It always returns null.
- public Type ReturnType
- {
- get { return GetReturnType(); }
- }
// This always returns null. Is that what we want?
internal override Type GetReturnType()
diff --git a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
index c40a31d723..da8c7d97cc 100644
--- a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
@@ -553,18 +553,6 @@ namespace System.Reflection.Emit {
}
//*************************************************
- // Upon saving to disk, we need to create the memberRef token for the custom attribute's type
- // first of all. So when we snap the in-memory module for on disk, this token will be there.
- // We also need to enforce the use of MemberRef. Because MemberDef token might move.
- // This function has to be called before we snap the in-memory module for on disk (i.e. Presave on
- // ModuleBuilder.
- //*************************************************
- internal int PrepareCreateCustomAttributeToDisk(ModuleBuilder mod)
- {
- return mod.InternalGetConstructorToken(m_con, true).Token;
- }
-
- //*************************************************
// Call this function with toDisk=1, after on disk module has been snapped.
//*************************************************
internal void CreateCustomAttribute(ModuleBuilder mod, int tkOwner, int tkAttrib, bool toDisk)
diff --git a/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs
index 7b17f66b16..6429e6052a 100644
--- a/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs
@@ -267,43 +267,6 @@ namespace System.Reflection.Emit
PutInteger4(token);
}
- public override void EmitCalli(OpCode opcode,
- CallingConvention unmanagedCallConv,
- Type returnType,
- Type[] parameterTypes)
- {
- int stackchange = 0;
- int cParams = 0;
- int i;
- SignatureHelper sig;
-
- if (parameterTypes != null)
- cParams = parameterTypes.Length;
-
- sig = SignatureHelper.GetMethodSigHelper(unmanagedCallConv, returnType);
-
- if (parameterTypes != null)
- for (i = 0; i < cParams; i++)
- sig.AddArgument(parameterTypes[i]);
-
- // If there is a non-void return type, push one.
- if (returnType != typeof(void))
- stackchange++;
-
- // Pop off arguments if any.
- if (parameterTypes != null)
- stackchange -= cParams;
-
- // Pop the native function pointer.
- stackchange--;
- UpdateStackSize(OpCodes.Calli, stackchange);
-
- EnsureCapacity(7);
- Emit(OpCodes.Calli);
- int token = GetTokenForSig(sig.GetSignature(true));
- PutInteger4(token);
- }
-
public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
{
if (methodInfo == null)
@@ -964,7 +927,7 @@ namespace System.Reflection.Emit
[System.Runtime.InteropServices.ComVisible(true)]
- public class DynamicILInfo
+ internal class DynamicILInfo
{
#region Private Data Members
private DynamicMethod m_method;
@@ -976,18 +939,6 @@ namespace System.Reflection.Emit
private int m_methodSignature;
#endregion
- #region Constructor
- internal DynamicILInfo(DynamicScope scope, DynamicMethod method, byte[] methodSignature)
- {
- m_method = method;
- m_scope = scope;
- m_methodSignature = m_scope.GetTokenFor(methodSignature);
- m_exceptions = EmptyArray<Byte>.Value;
- m_code = EmptyArray<Byte>.Value;
- m_localSignature = EmptyArray<Byte>.Value;
- }
- #endregion
-
#region Internal Methods
internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm)
{
@@ -1014,113 +965,8 @@ namespace System.Reflection.Emit
public DynamicMethod DynamicMethod { get { return m_method; } }
internal DynamicScope DynamicScope { get { return m_scope; } }
- public void SetCode(byte[] code, int maxStackSize)
- {
- m_code = (code != null) ? (byte[])code.Clone() : EmptyArray<Byte>.Value;
- m_maxStackSize = maxStackSize;
- }
-
- [CLSCompliant(false)]
- public unsafe void SetCode(byte* code, int codeSize, int maxStackSize)
- {
- if (codeSize < 0)
- throw new ArgumentOutOfRangeException(nameof(codeSize), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
-
- if (codeSize > 0 && code == null)
- throw new ArgumentNullException(nameof(code));
- Contract.EndContractBlock();
-
- m_code = new byte[codeSize];
- for (int i = 0; i < codeSize; i++)
- {
- m_code[i] = *code;
- code++;
- }
-
- m_maxStackSize = maxStackSize;
- }
-
- public void SetExceptions(byte[] exceptions)
- {
- m_exceptions = (exceptions != null) ? (byte[])exceptions.Clone() : EmptyArray<Byte>.Value;
- }
-
- [CLSCompliant(false)]
- public unsafe void SetExceptions(byte* exceptions, int exceptionsSize)
- {
- if (exceptionsSize < 0)
- throw new ArgumentOutOfRangeException(nameof(exceptionsSize), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
-
- if (exceptionsSize > 0 && exceptions == null)
- throw new ArgumentNullException(nameof(exceptions));
- Contract.EndContractBlock();
-
- m_exceptions = new byte[exceptionsSize];
-
- for (int i = 0; i < exceptionsSize; i++)
- {
- m_exceptions[i] = *exceptions;
- exceptions++;
- }
- }
-
- public void SetLocalSignature(byte[] localSignature)
- {
- m_localSignature = (localSignature != null) ? (byte[])localSignature.Clone() : EmptyArray<Byte>.Value;
- }
-
- [CLSCompliant(false)]
- public unsafe void SetLocalSignature(byte* localSignature, int signatureSize)
- {
- if (signatureSize < 0)
- throw new ArgumentOutOfRangeException(nameof(signatureSize), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"));
-
- if (signatureSize > 0 && localSignature == null)
- throw new ArgumentNullException(nameof(localSignature));
- Contract.EndContractBlock();
-
- m_localSignature = new byte[signatureSize];
- for (int i = 0; i < signatureSize; i++)
- {
- m_localSignature[i] = *localSignature;
- localSignature++;
- }
- }
- #endregion
-
- #region Public Scope Methods
- public int GetTokenFor(RuntimeMethodHandle method)
- {
- return DynamicScope.GetTokenFor(method);
- }
- public int GetTokenFor(DynamicMethod method)
- {
- return DynamicScope.GetTokenFor(method);
- }
- public int GetTokenFor(RuntimeMethodHandle method, RuntimeTypeHandle contextType)
- {
- return DynamicScope.GetTokenFor(method, contextType);
- }
- public int GetTokenFor(RuntimeFieldHandle field)
- {
- return DynamicScope.GetTokenFor(field);
- }
- public int GetTokenFor(RuntimeFieldHandle field, RuntimeTypeHandle contextType)
- {
- return DynamicScope.GetTokenFor(field, contextType);
- }
- public int GetTokenFor(RuntimeTypeHandle type)
- {
- return DynamicScope.GetTokenFor(type);
- }
- public int GetTokenFor(string literal)
- {
- return DynamicScope.GetTokenFor(literal);
- }
- public int GetTokenFor(byte[] signature)
- {
- return DynamicScope.GetTokenFor(signature);
- }
+#endregion
+#region Public Scope Methods
#endregion
}
diff --git a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs
index 7af6ff3df0..77a835fb14 100644
--- a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs
@@ -588,30 +588,6 @@ namespace System.Reflection.Emit
return null;
}
- public DynamicILInfo GetDynamicILInfo()
- {
-#pragma warning disable 618
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-#pragma warning restore 618
-
- if (m_DynamicILInfo != null)
- return m_DynamicILInfo;
-
- return GetDynamicILInfo(new DynamicScope());
- }
-
- internal DynamicILInfo GetDynamicILInfo(DynamicScope scope)
- {
- if (m_DynamicILInfo == null)
- {
- byte[] methodSignature = SignatureHelper.GetMethodSigHelper(
- null, CallingConvention, ReturnType, null, null, m_parameterTypes, null, null).GetSignature(true);
- m_DynamicILInfo = new DynamicILInfo(scope, this, methodSignature);
- }
-
- return m_DynamicILInfo;
- }
-
public ILGenerator GetILGenerator() {
return GetILGenerator(64);
}
diff --git a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
index 19bcf6f60a..6dce6958aa 100644
--- a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs
@@ -337,9 +337,6 @@ namespace System.Reflection.Emit {
{
return m_typeBuilder.IsDefined(attributeType, inherit);
}
-
-
- internal int MetadataTokenInternal { get { return m_typeBuilder.MetadataTokenInternal; } }
/*****************************************************
*
diff --git a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs
index 415dc45cbc..1ac2684c37 100644
--- a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs
@@ -68,8 +68,6 @@ namespace System.Reflection.Emit
{
ModuleBuilder.SetFieldRVAContent(m_typeBuilder.GetModuleBuilder().GetNativeHandle(), m_tkField.Token, data, size);
}
-
- internal TypeBuilder GetTypeBuilder() { return m_typeBuilder; }
#endregion
#region MemberInfo Overrides
@@ -182,20 +180,6 @@ namespace System.Reflection.Emit
TypeBuilder.SetFieldLayoutOffset(m_typeBuilder.GetModuleBuilder().GetNativeHandle(), GetToken().Token, iOffset);
}
- [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- public void SetMarshal(UnmanagedMarshal unmanagedMarshal)
- {
- if (unmanagedMarshal == null)
- throw new ArgumentNullException(nameof(unmanagedMarshal));
- Contract.EndContractBlock();
-
- m_typeBuilder.ThrowIfCreated();
-
- byte[] ubMarshal = unmanagedMarshal.InternalGetBytes();
-
- TypeBuilder.SetFieldMarshal(m_typeBuilder.GetModuleBuilder().GetNativeHandle(), GetToken().Token, ubMarshal, ubMarshal.Length);
- }
-
public void SetConstant(Object defaultValue)
{
m_typeBuilder.ThrowIfCreated();
diff --git a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
index 284beb1045..0602da70b0 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs
@@ -537,51 +537,6 @@ namespace System.Reflection.Emit
PutInteger4(modBuilder.GetSignatureToken(sig).Token);
}
- public virtual void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type returnType, Type[] parameterTypes)
- {
- int stackchange = 0;
- int cParams = 0;
- int i;
- SignatureHelper sig;
-
- ModuleBuilder modBuilder = (ModuleBuilder) m_methodBuilder.Module;
-
- if (parameterTypes != null)
- {
- cParams = parameterTypes.Length;
- }
-
- sig = SignatureHelper.GetMethodSigHelper(
- modBuilder,
- unmanagedCallConv,
- returnType);
-
- if (parameterTypes != null)
- {
- for (i = 0; i < cParams; i++)
- {
- sig.AddArgument(parameterTypes[i]);
- }
- }
-
- // If there is a non-void return type, push one.
- if (returnType != typeof(void))
- stackchange++;
-
- // Pop off arguments if any.
- if (parameterTypes != null)
- stackchange -= cParams;
-
- // Pop the native function pointer.
- stackchange--;
- UpdateStackSize(OpCodes.Calli, stackchange);
-
- EnsureCapacity(7);
- Emit(OpCodes.Calli);
- RecordTokenFixup();
- PutInteger4(modBuilder.GetSignatureToken(sig).Token);
- }
-
public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
{
if (methodInfo == null)
diff --git a/src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs b/src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs
index a737895829..e6f4622f0e 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs
@@ -166,23 +166,6 @@ namespace System.Reflection.Emit
private SymWriter()
{
}
-
- //=========================================================================================
- // Public interface methods start here.
- //=========================================================================================
-
-
- //------------------------------------------------------------------------------
- // Initialize() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.Initialize(IntPtr emitter, String filename, bool fFullBuild)
- {
- int hr = m_vtable.Initialize(m_pWriter, emitter, filename, (IntPtr)0, fFullBuild);
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
//------------------------------------------------------------------------------
// DefineDocument() wrapper
@@ -207,18 +190,6 @@ namespace System.Reflection.Emit
}
//------------------------------------------------------------------------------
- // SetUserEntryPoint() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.SetUserEntryPoint(SymbolToken entryMethod)
- {
- int hr = m_vtable.SetUserEntryPoint(m_pWriter, entryMethod.GetToken());
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
-
- //------------------------------------------------------------------------------
// OpenMethod() wrapper
//------------------------------------------------------------------------------
void ISymbolWriter.OpenMethod(SymbolToken method)
@@ -326,18 +297,6 @@ namespace System.Reflection.Emit
throw Marshal.GetExceptionForHR(hr);
}
}
-
- //------------------------------------------------------------------------------
- // SetScopeRange() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.SetScopeRange(int scopeID, int startOffset, int endOffset)
- {
- int hr = m_vtable.SetScopeRange(m_pWriter, scopeID, startOffset, endOffset);
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
//------------------------------------------------------------------------------
// DefineLocalVariable() wrapper
@@ -368,62 +327,7 @@ namespace System.Reflection.Emit
throw Marshal.GetExceptionForHR(hr);
}
}
-
- //------------------------------------------------------------------------------
- // DefineParameter() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.DefineParameter(String name,
- ParameterAttributes attributes,
- int sequence,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- throw new NotSupportedException(); // Intentionally not supported to match desktop CLR
- }
-
- //------------------------------------------------------------------------------
- // DefineField() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.DefineField(SymbolToken parent,
- String name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- throw new NotSupportedException(); // Intentionally not supported to match desktop CLR
- }
-
- //------------------------------------------------------------------------------
- // DefineGlobalVariable() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.DefineGlobalVariable(String name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- throw new NotSupportedException(); // Intentionally not supported to match desktop CLR
- }
-
- //------------------------------------------------------------------------------
- // Close() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.Close()
- {
- int hr = m_vtable.Close(m_pWriter);
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
-
+
//------------------------------------------------------------------------------
// SetSymAttribute() wrapper
//------------------------------------------------------------------------------
@@ -437,30 +341,6 @@ namespace System.Reflection.Emit
}
//------------------------------------------------------------------------------
- // OpenNamespace() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.OpenNamespace(String name)
- {
- int hr = m_vtable.OpenNamespace(m_pWriter, name);
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
-
- //------------------------------------------------------------------------------
- // CloseNamespace() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.CloseNamespace()
- {
- int hr = m_vtable.CloseNamespace(m_pWriter);
- if (hr < 0)
- {
- throw Marshal.GetExceptionForHR(hr);
- }
- }
-
- //------------------------------------------------------------------------------
// UsingNamespace() wrapper
//------------------------------------------------------------------------------
void ISymbolWriter.UsingNamespace(String name)
@@ -471,27 +351,6 @@ namespace System.Reflection.Emit
throw Marshal.GetExceptionForHR(hr);
}
}
-
- //------------------------------------------------------------------------------
- // SetMethodSourceRange() wrapper
- //------------------------------------------------------------------------------
- void ISymbolWriter.SetMethodSourceRange(ISymbolDocumentWriter startDoc,
- int startLine,
- int startColumn,
- ISymbolDocumentWriter endDoc,
- int endLine,
- int endColumn)
- {
- throw new NotSupportedException(); // Intentionally not supported to match desktop CLR
- }
-
- //------------------------------------------------------------------------------
- // SetUnderlyingWriter() wrapper.
- //------------------------------------------------------------------------------
- void ISymbolWriter.SetUnderlyingWriter(IntPtr ppUnderlyingWriter)
- {
- throw new NotSupportedException(); // Intentionally not supported on Telesto as it's a very unsafe api
- }
//------------------------------------------------------------------------------
// InternalSetUnderlyingWriter() wrapper.
diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs
index 74fd9aa196..59147215ca 100644
--- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs
@@ -64,11 +64,6 @@ namespace System.Reflection.Emit
#endregion
#region Constructor
- internal MethodBuilder(String name, MethodAttributes attributes, CallingConventions callingConvention,
- Type returnType, Type[] parameterTypes, ModuleBuilder mod, TypeBuilder type, bool bIsGlobalMethod)
- {
- Init(name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null, mod, type, bIsGlobalMethod);
- }
internal MethodBuilder(String name, MethodAttributes attributes, CallingConventions callingConvention,
Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers,
@@ -368,11 +363,6 @@ namespace System.Reflection.Emit
}
}
- internal void SetToken(MethodToken token)
- {
- m_tkMethod = token;
- }
-
internal byte[] GetBody()
{
// Returns the il bytes of this method.
@@ -848,199 +838,13 @@ namespace System.Reflection.Emit
return new ParameterBuilder(this, position, attributes, strParamName);
}
- [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- public void SetMarshal(UnmanagedMarshal unmanagedMarshal)
- {
- ThrowIfGeneric ();
-
- // set Marshal info for the return type
-
- m_containingType.ThrowIfCreated();
-
- if (m_retParam == null)
- {
- m_retParam = new ParameterBuilder(this, 0, 0, null);
- }
-
- m_retParam.SetMarshal(unmanagedMarshal);
- }
-
private List<SymCustomAttr> m_symCustomAttrs;
private struct SymCustomAttr
{
- public SymCustomAttr(String name, byte[] data)
- {
- m_name = name;
- m_data = data;
- }
public String m_name;
public byte[] m_data;
}
- public void SetSymCustomAttribute(String name, byte[] data)
- {
- // Note that this API is rarely used. Support for custom attributes in PDB files was added in
- // Whidbey and as of 8/2007 the only known user is the C# compiler. There seems to be little
- // value to this for Reflection.Emit users since they can always use metadata custom attributes.
- // Some versions of the symbol writer used in the CLR will ignore these entirely. This API has
- // been removed from the Silverlight API surface area, but we should also consider removing it
- // from future desktop product versions as well.
-
- ThrowIfGeneric ();
-
- // This is different from CustomAttribute. This is stored into the SymWriter.
- m_containingType.ThrowIfCreated();
-
- ModuleBuilder dynMod = (ModuleBuilder) m_module;
- if ( dynMod.GetSymWriter() == null)
- {
- // Cannot SetSymCustomAttribute when it is not a debug module
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
- }
-
- if (m_symCustomAttrs == null)
- m_symCustomAttrs = new List<SymCustomAttr>();
-
- m_symCustomAttrs.Add(new SymCustomAttr(name, data));
- }
-
- public void SetMethodBody(byte[] il, int maxStack, byte[] localSignature, IEnumerable<ExceptionHandler> exceptionHandlers, IEnumerable<int> tokenFixups)
- {
- if (il == null)
- {
- throw new ArgumentNullException(nameof(il), Environment.GetResourceString("ArgumentNull_Array"));
- }
- if (maxStack < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(maxStack), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
- Contract.EndContractBlock();
-
- if (m_bIsBaked)
- {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBaked"));
- }
-
- m_containingType.ThrowIfCreated();
- ThrowIfGeneric();
-
- byte[] newLocalSignature = null;
- ExceptionHandler[] newHandlers = null;
- int[] newTokenFixups = null;
-
- byte[] newIL = (byte[])il.Clone();
-
- if (localSignature != null)
- {
- newLocalSignature = (byte[])localSignature.Clone();
- }
-
- if (exceptionHandlers != null)
- {
- newHandlers = ToArray(exceptionHandlers);
- CheckExceptionHandlerRanges(newHandlers, newIL.Length);
-
- // Note: Fixup entries for type tokens stored in ExceptionHandlers are added by the method body emitter.
- }
-
- if (tokenFixups != null)
- {
- newTokenFixups = ToArray(tokenFixups);
- int maxTokenOffset = newIL.Length - 4;
-
- for (int i = 0; i < newTokenFixups.Length; i++)
- {
- // Check that fixups are within the range of this method's IL, otherwise some random memory might get "fixed up".
- if (newTokenFixups[i] < 0 || newTokenFixups[i] > maxTokenOffset)
- {
- throw new ArgumentOutOfRangeException("tokenFixups[" + i + "]", Environment.GetResourceString("ArgumentOutOfRange_Range", 0, maxTokenOffset));
- }
- }
- }
-
- m_ubBody = newIL;
- m_localSignature = newLocalSignature;
- m_exceptions = newHandlers;
- m_mdMethodFixups = newTokenFixups;
- m_maxStack = maxStack;
-
- // discard IL generator, all information stored in it is now irrelevant
- m_ilGenerator = null;
- m_bIsBaked = true;
- }
-
- private static T[] ToArray<T>(IEnumerable<T> sequence)
- {
- T[] array = sequence as T[];
- if (array != null)
- {
- return (T[])array.Clone();
- }
-
- return new List<T>(sequence).ToArray();
- }
-
- private static void CheckExceptionHandlerRanges(ExceptionHandler[] exceptionHandlers, int maxOffset)
- {
- // Basic checks that the handler ranges are within the method body (ranges are end-exclusive).
- // Doesn't verify that the ranges are otherwise correct - it is very well possible to emit invalid IL.
- for (int i = 0; i < exceptionHandlers.Length; i++)
- {
- var handler = exceptionHandlers[i];
- if (handler.m_filterOffset > maxOffset || handler.m_tryEndOffset > maxOffset || handler.m_handlerEndOffset > maxOffset)
- {
- throw new ArgumentOutOfRangeException("exceptionHandlers[" + i + "]", Environment.GetResourceString("ArgumentOutOfRange_Range", 0, maxOffset));
- }
-
- // Type token might be 0 if the ExceptionHandler was created via a default constructor.
- // Other tokens migth also be invalid. We only check nil tokens as the implementation (SectEH_Emit in corhlpr.cpp) requires it,
- // and we can't check for valid tokens until the module is baked.
- if (handler.Kind == ExceptionHandlingClauseOptions.Clause && handler.ExceptionTypeToken == 0)
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeToken", handler.ExceptionTypeToken), "exceptionHandlers[" + i + "]");
- }
- }
- }
-
- /// <summary>
- /// Obsolete.
- /// </summary>
- public void CreateMethodBody(byte[] il, int count)
- {
- ThrowIfGeneric();
-
- // Note that when user calls this function, there are a few information that client is
- // not able to supply: local signature, exception handlers, max stack size, a list of Token fixup, a list of RVA fixup
-
- if (m_bIsBaked)
- {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBaked"));
- }
-
- m_containingType.ThrowIfCreated();
-
- if (il != null && (count < 0 || count > il.Length))
- {
- throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- }
-
- if (il == null)
- {
- m_ubBody = null;
- return;
- }
-
- m_ubBody = new byte[count];
- Buffer.BlockCopy(il, 0, m_ubBody, 0, count);
-
- m_localSignature = null;
- m_exceptions = null;
- m_mdMethodFixups = null;
- m_maxStack = DefaultMaxStack;
-
- m_bIsBaked = true;
- }
-
public void SetImplementationFlags(MethodImplAttributes attributes)
{
ThrowIfGeneric ();
@@ -1312,7 +1116,7 @@ namespace System.Reflection.Emit
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[ComVisible(false)]
- public struct ExceptionHandler : IEquatable<ExceptionHandler>
+ internal struct ExceptionHandler : IEquatable<ExceptionHandler>
{
// Keep in sync with unmanged structure.
internal readonly int m_exceptionClass;
@@ -1323,118 +1127,7 @@ namespace System.Reflection.Emit
internal readonly int m_handlerEndOffset;
internal readonly ExceptionHandlingClauseOptions m_kind;
- public int ExceptionTypeToken
- {
- get { return m_exceptionClass; }
- }
-
- public int TryOffset
- {
- get { return m_tryStartOffset; }
- }
-
- public int TryLength
- {
- get { return m_tryEndOffset - m_tryStartOffset; }
- }
-
- public int FilterOffset
- {
- get { return m_filterOffset; }
- }
-
- public int HandlerOffset
- {
- get { return m_handlerStartOffset; }
- }
-
- public int HandlerLength
- {
- get { return m_handlerEndOffset - m_handlerStartOffset; }
- }
-
- public ExceptionHandlingClauseOptions Kind
- {
- get { return m_kind; }
- }
-
- #region Constructors
-
- /// <summary>
- /// Creates a description of an exception handler.
- /// </summary>
- /// <param name="tryOffset">The offset of the first instruction protected by this handler.</param>
- /// <param name="tryLength">The number of bytes protected by this handler.</param>
- /// <param name="filterOffset">The filter code begins at the specified offset and ends at the first instruction of the handler block. Specify 0 if not applicable (this is not a filter handler).</param>
- /// <param name="handlerOffset">The offset of the first instruction of this handler.</param>
- /// <param name="handlerLength">The number of bytes of the handler.</param>
- /// <param name="kind">The kind of handler, the handler might be a catch handler, filter handler, fault handler, or finally handler.</param>
- /// <param name="exceptionTypeToken">The token of the exception type handled by this handler. Specify 0 if not applicable (this is finally handler).</param>
- /// <exception cref="ArgumentOutOfRangeException">
- /// Some of the instruction offset is negative,
- /// the end offset of specified range is less than its start offset,
- /// or <paramref name="kind"/> has an invalid value.
- /// </exception>
- public ExceptionHandler(int tryOffset, int tryLength, int filterOffset, int handlerOffset, int handlerLength,
- ExceptionHandlingClauseOptions kind, int exceptionTypeToken)
- {
- if (tryOffset < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(tryOffset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
-
- if (tryLength < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(tryLength), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
-
- if (filterOffset < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(filterOffset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
-
- if (handlerOffset < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(handlerOffset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
-
- if (handlerLength < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(handlerLength), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
- }
-
- if ((long)tryOffset + tryLength > Int32.MaxValue)
- {
- throw new ArgumentOutOfRangeException(nameof(tryLength), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, Int32.MaxValue - tryOffset));
- }
-
- if ((long)handlerOffset + handlerLength > Int32.MaxValue)
- {
- throw new ArgumentOutOfRangeException(nameof(handlerLength), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, Int32.MaxValue - handlerOffset));
- }
-
- // Other tokens migth also be invalid. We only check nil tokens as the implementation (SectEH_Emit in corhlpr.cpp) requires it,
- // and we can't check for valid tokens until the module is baked.
- if (kind == ExceptionHandlingClauseOptions.Clause && (exceptionTypeToken & 0x00FFFFFF) == 0)
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeToken", exceptionTypeToken), nameof(exceptionTypeToken));
- }
-
- Contract.EndContractBlock();
-
- if (!IsValidKind(kind))
- {
- throw new ArgumentOutOfRangeException(nameof(kind), Environment.GetResourceString("ArgumentOutOfRange_Enum"));
- }
-
- m_tryStartOffset = tryOffset;
- m_tryEndOffset = tryOffset + tryLength;
- m_filterOffset = filterOffset;
- m_handlerStartOffset = handlerOffset;
- m_handlerEndOffset = handlerOffset + handlerLength;
- m_kind = kind;
- m_exceptionClass = exceptionTypeToken;
- }
+#region Constructors
internal ExceptionHandler(int tryStartOffset, int tryEndOffset, int filterOffset, int handlerStartOffset, int handlerEndOffset,
int kind, int exceptionTypeToken)
diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs
index 5b69b6e607..57ad1665c0 100644
--- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs
@@ -53,7 +53,6 @@ namespace System.Reflection.Emit
public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_method.GetCustomAttributes(attributeType, inherit); }
public override bool IsDefined(Type attributeType, bool inherit) { return m_method.IsDefined(attributeType, inherit); }
public override Module Module { get { return m_method.Module; } }
- public new Type GetType() { return base.GetType(); }
#endregion
#region MethodBase Members
diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
index 399ca50928..a7e06b24bf 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
@@ -245,61 +245,8 @@ namespace System.Reflection.Emit
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- private extern static void PreSavePEFile(RuntimeModule module, int portableExecutableKind, int imageFileMachine);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void SavePEFile(RuntimeModule module, String fileName, int entryPoint, int isExe, bool isManifestFile);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void AddResource(
- RuntimeModule module, String strName,
- byte[] resBytes, int resByteCount, int tkFile, int attribute,
- int portableExecutableKind, int imageFileMachine);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void SetModuleName(RuntimeModule module, String strModuleName);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
internal extern static void SetFieldRVAContent(RuntimeModule module, int fdToken, byte[] data, int length);
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void DefineNativeResourceFile(RuntimeModule module,
- String strFilename,
- int portableExecutableKind,
- int ImageFileMachine);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void DefineNativeResourceBytes(RuntimeModule module,
- byte[] pbResource, int cbResource,
- int portableExecutableKind,
- int imageFileMachine);
-
- internal void DefineNativeResource(PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
- {
- string strResourceFileName = m_moduleData.m_strResourceFileName;
- byte[] resourceBytes = m_moduleData.m_resourceBytes;
-
- if (strResourceFileName != null)
- {
- DefineNativeResourceFile(GetNativeHandle(),
- strResourceFileName,
- (int)portableExecutableKind, (int)imageFileMachine);
- }
- else
- if (resourceBytes != null)
- {
- DefineNativeResourceBytes(GetNativeHandle(),
- resourceBytes, resourceBytes.Length,
- (int)portableExecutableKind, (int)imageFileMachine);
- }
- }
-
#endregion
#region Internal Members
@@ -433,17 +380,6 @@ namespace System.Reflection.Emit
m_TypeBuilderDict = new Dictionary<string, Type>();
}
- // This is a method for changing module and file name of the manifest module (created by default for
- // each assembly).
- internal void ModifyModuleName(string name)
- {
- // Reset the names in the managed ModuleBuilderData
- m_moduleData.ModifyModuleName(name);
-
- // Reset the name in the underlying metadata
- ModuleBuilder.SetModuleName(GetNativeHandle(), name);
- }
-
internal void SetSymWriter(ISymbolWriter writer)
{
m_iSymWriter = writer;
@@ -1473,41 +1409,6 @@ namespace System.Reflection.Emit
return new MethodToken(mr);
}
- public MethodToken GetConstructorToken(ConstructorInfo constructor, IEnumerable<Type> optionalParameterTypes)
- {
- if (constructor == null)
- {
- throw new ArgumentNullException(nameof(constructor));
- }
-
- lock (SyncRoot)
- {
- // useMethodDef is not applicable - constructors aren't generic
- return new MethodToken(GetMethodTokenInternal(constructor, optionalParameterTypes, false));
- }
- }
-
- public MethodToken GetMethodToken(MethodInfo method, IEnumerable<Type> optionalParameterTypes)
- {
- if (method == null)
- {
- throw new ArgumentNullException(nameof(method));
- }
-
- // useMethodDef flag only affects the result if we pass in a generic method definition.
- // If the caller is looking for a token for an ldtoken/ldftn/ldvirtftn instruction and passes in a generic method definition info/builder,
- // we correclty return the MethodDef/Ref token of the generic definition that can be used with ldtoken/ldftn/ldvirtftn.
- //
- // If the caller is looking for a token for a call/callvirt/jmp instruction and passes in a generic method definition info/builder,
- // we also return the generic MethodDef/Ref token, which is indeed not acceptable for call/callvirt/jmp instruction.
- // But the caller can always instantiate the info/builder and pass it in. Then we build the right MethodSpec.
-
- lock (SyncRoot)
- {
- return new MethodToken(GetMethodTokenInternal(method, optionalParameterTypes, true));
- }
- }
-
internal int GetMethodTokenInternal(MethodBase method, IEnumerable<Type> optionalParameterTypes, bool useMethodDef)
{
int tk = 0;
@@ -1841,7 +1742,7 @@ namespace System.Reflection.Emit
// For these reasons, we should consider making this API internal in Arrowhead
// (as it is in Silverlight), and consider validating that we're within a call
// to TypeBuilder.CreateType whenever this is used.
- public ISymbolWriter GetSymWriter()
+ internal ISymbolWriter GetSymWriter()
{
return m_iSymWriter;
}
@@ -1870,81 +1771,6 @@ namespace System.Reflection.Emit
return m_iSymWriter.DefineDocument(url, language, languageVendor, documentType);
}
- public void SetUserEntryPoint(MethodInfo entryPoint)
- {
- lock(SyncRoot)
- {
- SetUserEntryPointNoLock(entryPoint);
- }
- }
-
- private void SetUserEntryPointNoLock(MethodInfo entryPoint)
- {
- // Set the user entry point. Compiler may generate startup stub before calling user main.
- // The startup stub will be the entry point. While the user "main" will be the user entry
- // point so that debugger will not step into the compiler entry point.
-
- if (entryPoint == null)
- {
- throw new ArgumentNullException(nameof(entryPoint));
- }
- Contract.EndContractBlock();
-
- if (m_iSymWriter == null)
- {
- // Cannot set entry point when it is not a debug module
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
- }
-
- if (entryPoint.DeclaringType != null)
- {
- if (!entryPoint.Module.Equals(this))
- {
- // you cannot pass in a MethodInfo that is not contained by this ModuleBuilder
- throw new InvalidOperationException(Environment.GetResourceString("Argument_NotInTheSameModuleBuilder"));
- }
- }
- else
- {
- // unfortunately this check is missing for global function passed in as RuntimeMethodInfo.
- // The problem is that Reflection does not
- // allow us to get the containing module giving a global function
- MethodBuilder mb = entryPoint as MethodBuilder;
- if (mb != null && mb.GetModuleBuilder() != this)
- {
- // you cannot pass in a MethodInfo that is not contained by this ModuleBuilder
- throw new InvalidOperationException(Environment.GetResourceString("Argument_NotInTheSameModuleBuilder"));
- }
- }
-
- // get the metadata token value and create the SymbolStore's token value class
- SymbolToken tkMethod = new SymbolToken(GetMethodTokenInternal(entryPoint).Token);
-
- // set the UserEntryPoint
- m_iSymWriter.SetUserEntryPoint(tkMethod);
- }
-
- public void SetSymCustomAttribute(String name, byte[] data)
- {
- lock(SyncRoot)
- {
- SetSymCustomAttributeNoLock(name, data);
- }
- }
-
- private void SetSymCustomAttributeNoLock(String name, byte[] data)
- {
- if (m_iSymWriter == null)
- {
- // Cannot SetSymCustomAttribute when it is not a debug module
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
- }
-
- // This API has never worked. It seems like we might want to call m_iSymWriter.SetSymAttribute,
- // but we don't have a metadata token to associate the attribute with. Instead
- // MethodBuilder.SetSymCustomAttribute could be used to associate a symbol attribute with a specific method.
- }
-
[Pure]
public bool IsTransient()
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
index 96e60d9a4e..4b6f8b4efe 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs
@@ -52,36 +52,6 @@ namespace System.Reflection.Emit
}
}
- // This is a method for changing module and file name of the manifest module (created by default for
- // each assembly).
- internal virtual void ModifyModuleName(String strModuleName)
- {
- Debug.Assert(m_strModuleName == AssemblyBuilder.MANIFEST_MODULE_NAME, "Changing names for non-manifest module");
- InitNames(strModuleName, null /*strFileName*/);
- }
-
- internal int FileToken
- {
- get
- {
- // Before save, the scope of m_tkFile is the in-memory assembly manifest
- // During save, the scope of m_tkFile is the on-disk assembly manifest
- // For transient modules m_tkFile never change.
-
- // Theoretically no one should emit anything after a dynamic assembly has
- // been saved. So m_tkFile shouldn't used when m_isSaved is true.
- // But that was never completely enforced: you can still emit everything after
- // the assembly has been saved (except for public types in persistent modules).
-
- return m_tkFile;
- }
-
- set
- {
- m_tkFile = value;
- }
- }
-
internal String m_strModuleName; // scope name (can be different from file name)
internal String m_strFileName;
internal bool m_fGlobalBeenCreated;
@@ -93,8 +63,6 @@ namespace System.Reflection.Emit
private int m_tkFile;
internal bool m_isSaved;
- [NonSerialized]
- internal ResWriterData m_embeddedRes;
internal const String MULTI_BYTE_VALUE_CLASS = "$ArrayType$";
internal String m_strResourceFileName;
internal byte[] m_resourceBytes;
diff --git a/src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs
index 0c10eb4965..a78934d81e 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs
@@ -21,23 +21,6 @@ namespace System.Reflection.Emit {
public class ParameterBuilder
{
- // set ParamMarshal
- [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- public virtual void SetMarshal(UnmanagedMarshal unmanagedMarshal)
- {
- if (unmanagedMarshal == null)
- {
- throw new ArgumentNullException(nameof(unmanagedMarshal));
- }
- Contract.EndContractBlock();
-
- byte [] ubMarshal = unmanagedMarshal.InternalGetBytes();
- TypeBuilder.SetFieldMarshal(
- m_methodBuilder.GetModuleBuilder().GetNativeHandle(),
- m_pdToken.Token,
- ubMarshal,
- ubMarshal.Length);
- }
// Set the default value of the parameter
public virtual void SetConstant(Object defaultValue)
@@ -108,8 +91,6 @@ namespace System.Reflection.Emit {
{
return m_pdToken;
}
-
- internal int MetadataTokenInternal { get { return m_pdToken.Token; } }
public virtual String Name {
get {return m_strParamName;}
diff --git a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs
index 17cc1b950b..500a6860d9 100644
--- a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs
@@ -81,14 +81,6 @@ namespace System.Reflection.Emit {
{
get {return m_prToken;}
}
-
- internal int MetadataTokenInternal
- {
- get
- {
- return m_tkProperty;
- }
- }
public override Module Module
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs
index b939cbb5ad..dd72bef03b 100644
--- a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs
@@ -515,36 +515,6 @@ namespace System.Reflection.Emit
}
}
-
- private void AddData(uint data)
- {
- if (m_currSig + 4 > m_signature.Length)
- {
- m_signature = ExpandArray(m_signature);
- }
-
- m_signature[m_currSig++] = (byte)((data) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>8) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>16) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>24) & 0xFF);
- }
-
- private void AddData(ulong data)
- {
- if (m_currSig + 8 > m_signature.Length)
- {
- m_signature = ExpandArray(m_signature);
- }
-
- m_signature[m_currSig++] = (byte)((data) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>8) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>16) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>24) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>32) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>40) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>48) & 0xFF);
- m_signature[m_currSig++] = (byte)((data>>56) & 0xFF);
- }
private void AddElementType(CorElementType cvt)
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
index b0d968d3b9..ff7eb6563c 100644
--- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs
@@ -224,10 +224,6 @@ namespace System.Reflection.Emit {
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- internal static extern void SetPInvokeData(RuntimeModule module, String DllName, String name, int token, int linkFlags);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
internal static extern int DefineProperty(RuntimeModule module, int tkParent, String name, PropertyAttributes attributes,
byte[] signature, int sigLength);
@@ -267,42 +263,10 @@ namespace System.Reflection.Emit {
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- internal static extern void SetFieldMarshal(RuntimeModule module, int tk, byte[] ubMarshal, int ubSize);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
private static extern unsafe void SetConstantValue(RuntimeModule module, int tk, int corType, void* pValue);
- #endregion
- #region Internal\Private Static Members
- private static bool IsPublicComType(Type type)
- {
- // Internal Helper to determine if a type should be added to ComType table.
- // A top level type should be added if it is Public.
- // A nested type should be added if the top most enclosing type is Public
- // and all the enclosing types are NestedPublic
-
- Type enclosingType = type.DeclaringType;
- if (enclosingType != null)
- {
- if (IsPublicComType(enclosingType))
- {
- if ((type.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic)
- {
- return true;
- }
- }
- }
- else
- {
- if ((type.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public)
- {
- return true;
- }
- }
-
- return false;
- }
+#endregion
+#region Internal\Private Static Members
[Pure]
internal static bool IsTypeEqual(Type t1, Type t2)
@@ -653,105 +617,8 @@ namespace System.Reflection.Emit {
m_module.AddType(FullName, this);
}
- #endregion
-
- #region Private Members
- private MethodBuilder DefinePInvokeMethodHelperNoLock(
- String name, String dllName, String importName, MethodAttributes attributes, CallingConventions callingConvention,
- Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers,
- Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers,
- CallingConvention nativeCallConv, CharSet nativeCharSet)
- {
- if (name == null)
- throw new ArgumentNullException(nameof(name));
-
- if (name.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name));
-
- if (dllName == null)
- throw new ArgumentNullException(nameof(dllName));
-
- if (dllName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(dllName));
-
- if (importName == null)
- throw new ArgumentNullException(nameof(importName));
-
- if (importName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(importName));
-
- if ((attributes & MethodAttributes.Abstract) != 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadPInvokeMethod"));
- Contract.EndContractBlock();
-
- if ((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface)
- throw new ArgumentException(Environment.GetResourceString("Argument_BadPInvokeOnInterface"));
-
- ThrowIfCreated();
-
- attributes = attributes | MethodAttributes.PinvokeImpl;
- MethodBuilder method = new MethodBuilder(name, attributes, callingConvention,
- returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers,
- parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers,
- m_module, this, false);
-
- //The signature grabbing code has to be up here or the signature won't be finished
- //and our equals check won't work.
- int sigLength;
- byte[] sigBytes = method.GetMethodSignature().InternalGetSignature(out sigLength);
-
- if (m_listMethods.Contains(method))
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_MethodRedefined"));
- }
- m_listMethods.Add(method);
-
- MethodToken token = method.GetToken();
-
- int linkFlags = 0;
- switch(nativeCallConv)
- {
- case CallingConvention.Winapi:
- linkFlags =(int)PInvokeMap.CallConvWinapi;
- break;
- case CallingConvention.Cdecl:
- linkFlags =(int)PInvokeMap.CallConvCdecl;
- break;
- case CallingConvention.StdCall:
- linkFlags =(int)PInvokeMap.CallConvStdcall;
- break;
- case CallingConvention.ThisCall:
- linkFlags =(int)PInvokeMap.CallConvThiscall;
- break;
- case CallingConvention.FastCall:
- linkFlags =(int)PInvokeMap.CallConvFastcall;
- break;
- }
- switch(nativeCharSet)
- {
- case CharSet.None:
- linkFlags |=(int)PInvokeMap.CharSetNotSpec;
- break;
- case CharSet.Ansi:
- linkFlags |=(int)PInvokeMap.CharSetAnsi;
- break;
- case CharSet.Unicode:
- linkFlags |=(int)PInvokeMap.CharSetUnicode;
- break;
- case CharSet.Auto:
- linkFlags |=(int)PInvokeMap.CharSetAuto;
- break;
- }
-
- SetPInvokeData(m_module.GetNativeHandle(),
- dllName,
- importName,
- token.Token,
- linkFlags);
- method.SetToken(token);
-
- return method;
- }
+#endregion
+#region Private Members
private FieldBuilder DefineDataHelper(String name, byte[] data, int size, FieldAttributes attributes)
{
diff --git a/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs b/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs
deleted file mode 100644
index 28e95e2456..0000000000
--- a/src/mscorlib/src/System/Reflection/Emit/UnmanagedMarshal.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Reflection.Emit
-{
- using System.Runtime.InteropServices;
- using System;
- using System.Security.Permissions;
-
- // This class is describing the fieldmarshal.
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- [Obsolete("An alternate API is available: Emit the MarshalAs custom attribute instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- public sealed class UnmanagedMarshal
- {
- /******************************
-[System.Runtime.InteropServices.ComVisible(true)]
- * public static constructors. You can only construct
- * UnmanagedMarshal using these static constructors.
- ******************************/
- public static UnmanagedMarshal DefineUnmanagedMarshal(UnmanagedType unmanagedType)
- {
- if (unmanagedType == UnmanagedType.ByValTStr ||
- unmanagedType == UnmanagedType.SafeArray ||
- unmanagedType == UnmanagedType.CustomMarshaler ||
- unmanagedType == UnmanagedType.ByValArray ||
- unmanagedType == UnmanagedType.LPArray)
- {
- // not a simple native marshal
- throw new ArgumentException(Environment.GetResourceString("Argument_NotASimpleNativeType"));
- }
- return new UnmanagedMarshal(unmanagedType, Guid.Empty, 0, (UnmanagedType) 0);
- }
- public static UnmanagedMarshal DefineByValTStr(int elemCount)
- {
- return new UnmanagedMarshal(UnmanagedType.ByValTStr, Guid.Empty, elemCount, (UnmanagedType) 0);
- }
-
- public static UnmanagedMarshal DefineSafeArray(UnmanagedType elemType)
- {
- return new UnmanagedMarshal(UnmanagedType.SafeArray, Guid.Empty, 0, elemType);
- }
-
- public static UnmanagedMarshal DefineByValArray(int elemCount)
- {
- return new UnmanagedMarshal(UnmanagedType.ByValArray, Guid.Empty, elemCount, (UnmanagedType) 0);
- }
-
- public static UnmanagedMarshal DefineLPArray(UnmanagedType elemType)
- {
- return new UnmanagedMarshal(UnmanagedType.LPArray, Guid.Empty, 0, elemType);
- }
-
-
-
-
-
-
- // accessor function for the native type
- public UnmanagedType GetUnmanagedType
- {
- get { return m_unmanagedType; }
- }
-
- public Guid IIDGuid
- {
- get
- {
- if (m_unmanagedType == UnmanagedType.CustomMarshaler)
- return m_guid;
-
- // throw exception here. There is Guid only if CustomMarshaler
- throw new ArgumentException(Environment.GetResourceString("Argument_NotACustomMarshaler"));
- }
- }
- public int ElementCount
- {
- get
- {
- if (m_unmanagedType != UnmanagedType.ByValArray &&
- m_unmanagedType != UnmanagedType.ByValTStr)
- {
- // throw exception here. There is NumElement only if NativeTypeFixedArray
- throw new ArgumentException(Environment.GetResourceString("Argument_NoUnmanagedElementCount"));
- }
- return m_numElem;
- }
- }
- public UnmanagedType BaseType
- {
- get
- {
- if (m_unmanagedType != UnmanagedType.LPArray && m_unmanagedType != UnmanagedType.SafeArray)
- {
- // throw exception here. There is NestedUnmanagedType only if LPArray or SafeArray
- throw new ArgumentException(Environment.GetResourceString("Argument_NoNestedMarshal"));
- }
- return m_baseType;
- }
- }
-
- private UnmanagedMarshal(UnmanagedType unmanagedType, Guid guid, int numElem, UnmanagedType type)
- {
- m_unmanagedType = unmanagedType;
- m_guid = guid;
- m_numElem = numElem;
- m_baseType = type;
- }
-
- /************************
- *
- * Data member
- *
- *************************/
- internal UnmanagedType m_unmanagedType;
- internal Guid m_guid;
- internal int m_numElem;
- internal UnmanagedType m_baseType;
-
-
- /************************
- * this function return the byte representation of the marshal info.
- *************************/
- internal byte[] InternalGetBytes()
- {
- byte[] buf;
- if (m_unmanagedType == UnmanagedType.SafeArray || m_unmanagedType == UnmanagedType.LPArray)
- {
-
- // syntax for NativeTypeSafeArray is
- // <SafeArray | LPArray> <base type>
- //
- int cBuf = 2;
- buf = new byte[cBuf];
- buf[0] = (byte) (m_unmanagedType);
- buf[1] = (byte) (m_baseType);
- return buf;
- }
- else
- if (m_unmanagedType == UnmanagedType.ByValArray ||
- m_unmanagedType == UnmanagedType.ByValTStr)
- {
- // <ByValArray | ByValTStr> <encoded integer>
- //
- int cBuf;
- int iBuf = 0;
-
- if (m_numElem <= 0x7f)
- cBuf = 1;
- else if (m_numElem <= 0x3FFF)
- cBuf = 2;
- else
- cBuf = 4;
-
- // the total buffer size is the one byte + encoded integer size
- cBuf = cBuf + 1;
- buf = new byte[cBuf];
-
-
- buf[iBuf++] = (byte) (m_unmanagedType);
- if (m_numElem <= 0x7F)
- {
- buf[iBuf++] = (byte)(m_numElem & 0xFF);
- } else if (m_numElem <= 0x3FFF)
- {
- buf[iBuf++] = (byte)((m_numElem >> 8) | 0x80);
- buf[iBuf++] = (byte)(m_numElem & 0xFF);
- } else if (m_numElem <= 0x1FFFFFFF)
- {
- buf[iBuf++] = (byte)((m_numElem >> 24) | 0xC0);
- buf[iBuf++] = (byte)((m_numElem >> 16) & 0xFF);
- buf[iBuf++] = (byte)((m_numElem >> 8) & 0xFF);
- buf[iBuf++] = (byte)((m_numElem) & 0xFF);
- }
- return buf;
- }
- buf = new byte[1];
- buf[0] = (byte) (m_unmanagedType);
- return buf;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs
index aaaffc0df6..ca0faf31ca 100644
--- a/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs
@@ -51,23 +51,7 @@ namespace System.Reflection.Emit
public override Object[] GetCustomAttributes(bool inherit) { return m_method.GetCustomAttributes(inherit); }
public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_method.GetCustomAttributes(attributeType, inherit); }
public override bool IsDefined(Type attributeType, bool inherit) { return m_method.IsDefined(attributeType, inherit); }
- internal int MetadataTokenInternal
- {
- get
- {
- MethodBuilder mb = m_method as MethodBuilder;
-
- if (mb != null)
- return mb.MetadataTokenInternal;
- else
- {
- Debug.Assert(m_method is RuntimeMethodInfo);
- return m_method.MetadataToken;
- }
- }
- }
public override Module Module { get { return m_method.Module; } }
- public new Type GetType() { return base.GetType(); }
#endregion
#region MethodBase Members
@@ -164,7 +148,6 @@ namespace System.Reflection.Emit
}
}
public override Module Module { get { return m_ctor.Module; } }
- public new Type GetType() { return base.GetType(); }
#endregion
#region MethodBase Members
@@ -265,7 +248,6 @@ namespace System.Reflection.Emit
}
}
public override Module Module { get { return m_field.Module; } }
- public new Type GetType() { return base.GetType(); }
#endregion
#region Public Abstract\Virtual Members
diff --git a/src/mscorlib/src/System/Reflection/MethodBase.cs b/src/mscorlib/src/System/Reflection/MethodBase.cs
index fe2ab7169b..e1fd1db480 100644
--- a/src/mscorlib/src/System/Reflection/MethodBase.cs
+++ b/src/mscorlib/src/System/Reflection/MethodBase.cs
@@ -128,20 +128,6 @@ namespace System.Reflection
private IntPtr GetMethodDesc() { return MethodHandle.Value; }
#if FEATURE_APPX
-
- // The C# dynamic and VB late bound binders need to call this API. Since we don't have time to make this
- // public in Dev11, the C# and VB binders currently call this through a delegate.
- // When we make this API public (hopefully) in Dev12 we need to change the C# and VB binders to call this
- // probably statically. The code is located in:
- // C#: ndp\fx\src\CSharp\Microsoft\CSharp\SymbolTable.cs - Microsoft.CSharp.RuntimeBinder.SymbolTable..cctor
- // VB: vb\runtime\msvbalib\helpers\Symbols.vb - Microsoft.VisualBasic.CompilerServices.Symbols..cctor
- internal virtual bool IsDynamicallyInvokable
- {
- get
- {
- return true;
- }
- }
#endif
#endregion
diff --git a/src/mscorlib/src/System/Reflection/MethodInfo.cs b/src/mscorlib/src/System/Reflection/MethodInfo.cs
index 14c03788d4..7f6645a273 100644
--- a/src/mscorlib/src/System/Reflection/MethodInfo.cs
+++ b/src/mscorlib/src/System/Reflection/MethodInfo.cs
@@ -130,14 +130,6 @@ namespace System.Reflection
return false;
}
-
- internal override bool IsDynamicallyInvokable
- {
- get
- {
- return !AppDomain.ProfileAPICheck || !IsNonW8PFrameworkAPI();
- }
- }
#endif
internal INVOCATION_FLAGS InvocationFlags
@@ -300,12 +292,6 @@ namespace System.Reflection
internal BindingFlags BindingFlags { get { return m_bindingFlags; } }
- // Differs from MethodHandle in that it will return a valid handle even for reflection only loaded types
- internal RuntimeMethodHandle GetMethodHandle()
- {
- return new RuntimeMethodHandle(this);
- }
-
internal RuntimeMethodInfo GetParentDefinition()
{
if (!IsVirtual || m_declaringType.IsInterface)
@@ -519,14 +505,6 @@ namespace System.Reflection
return RuntimeMethodHandle.GetImplAttributes(this);
}
- internal bool IsOverloaded
- {
- get
- {
- return m_reflectedTypeCache.GetMethodList(MemberListType.CaseSensitive, Name).Length > 1;
- }
- }
-
public override RuntimeMethodHandle MethodHandle
{
get
diff --git a/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs b/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs
index 70681138c5..3c9ce1b3af 100644
--- a/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs
+++ b/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs
@@ -33,11 +33,6 @@ namespace System.Reflection {
SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
}
- // private constructor. This is called from inside the runtime.
- private ReflectionTypeLoadException(String message) : base(message) {
- SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
- }
-
public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions) : base(null)
{
_classes = classes;
diff --git a/src/mscorlib/src/System/Resources/IResourceWriter.cs b/src/mscorlib/src/System/Resources/IResourceWriter.cs
deleted file mode 100644
index ae41b84cd7..0000000000
--- a/src/mscorlib/src/System/Resources/IResourceWriter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-**
-**
-** Purpose: Default way to write strings to a COM+ resource
-** file.
-**
-**
-===========================================================*/
-namespace System.Resources {
- using System;
- using System.IO;
- [System.Runtime.InteropServices.ComVisible(true)]
- public interface IResourceWriter : IDisposable
- {
- // Interface does not need to be marked with the serializable attribute
- // Adds a string resource to the list of resources to be written to a file.
- // They aren't written until WriteFile() is called.
- //
- void AddResource(String name, String value);
-
- // Adds a resource to the list of resources to be written to a file.
- // They aren't written until WriteFile() is called.
- //
- void AddResource(String name, Object value);
-
- // Adds a named byte array as a resource to the list of resources to
- // be written to a file. They aren't written until WriteFile() is called.
- //
- void AddResource(String name, byte[] value);
-
- // Closes the underlying resource file.
- void Close();
-
- // After calling AddResource, this writes all resources to the output
- // stream. This does NOT close the output stream.
- void Generate();
- }
-}
diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs
index 5c521e1130..832ac17ea4 100644
--- a/src/mscorlib/src/System/Resources/ResourceManager.cs
+++ b/src/mscorlib/src/System/Resources/ResourceManager.cs
@@ -162,7 +162,7 @@ namespace System.Resources {
// Sets is a many-to-one table of CultureInfos mapped to ResourceSets.
// Don't synchronize ResourceSets - too fine-grained a lock to be effective
[Obsolete("call InternalGetResourceSet instead")]
- protected Hashtable ResourceSets;
+ internal Hashtable ResourceSets;
// don't serialize the cache of ResourceSets
diff --git a/src/mscorlib/src/System/Resources/ResourceReader.cs b/src/mscorlib/src/System/Resources/ResourceReader.cs
index a03f4d8da0..8b81e2b799 100644
--- a/src/mscorlib/src/System/Resources/ResourceReader.cs
+++ b/src/mscorlib/src/System/Resources/ResourceReader.cs
@@ -198,10 +198,6 @@ namespace System.Resources {
// Unaligned, little endian format
return buffer[0] | (buffer[1] << 8) | (buffer[2] << 16) | (buffer[3] << 24);
}
-
- private void SkipInt32() {
- _store.BaseStream.Seek(4, SeekOrigin.Current);
- }
private void SkipString() {
diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs
index b30c12e370..cbf7ebf558 100644
--- a/src/mscorlib/src/System/RtType.cs
+++ b/src/mscorlib/src/System/RtType.cs
@@ -968,29 +968,6 @@ namespace System
}
}
- private static void AddElementTypes(Type template, IList<Type> types)
- {
- if (!template.HasElementType)
- return;
-
- AddElementTypes(template.GetElementType(), types);
-
- for (int i = 0; i < types.Count; i ++)
- {
- if (template.IsArray)
- {
- if (template.IsSzArray)
- types[i] = types[i].MakeArrayType();
- else
- types[i] = types[i].MakeArrayType(template.GetArrayRank());
- }
- else if (template.IsPointer)
- {
- types[i] = types[i].MakePointerType();
- }
- }
- }
-
private void AddSpecialInterface(ref ListBuilder<RuntimeType> list, Filter filter, RuntimeType iList, bool addSubInterface)
{
if (iList.IsAssignableFrom(ReflectedType))
@@ -2525,8 +2502,6 @@ namespace System
private static readonly RuntimeType ObjectType = (RuntimeType)typeof(System.Object);
private static readonly RuntimeType StringType = (RuntimeType)typeof(System.String);
private static readonly RuntimeType DelegateType = (RuntimeType)typeof(System.Delegate);
-
- private static Type[] s_SICtorParamTypes;
#endregion
#region Constructor
@@ -3583,11 +3558,6 @@ namespace System
#endif // FEATURE_COMINTEROP
- internal override bool HasProxyAttributeImpl()
- {
- return RuntimeTypeHandle.HasProxyAttribute(this);
- }
-
internal bool IsDelegate()
{
return GetBaseType() == typeof(System.MulticastDelegate);
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/AssemblyAttributesGoHere.cs b/src/mscorlib/src/System/Runtime/CompilerServices/AssemblyAttributesGoHere.cs
deleted file mode 100644
index c021353475..0000000000
--- a/src/mscorlib/src/System/Runtime/CompilerServices/AssemblyAttributesGoHere.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-namespace System.Runtime.CompilerServices {
-
- using System;
-
- // NOTE TO DEVELOPERS: These classes are used by ALink (the assembly linker).
- // They're used for metadata tokens for making multi-module assemblies.
- // Do not randomly touch these classes.
- [System.Runtime.CompilerServices.FriendAccessAllowed]
- internal sealed class AssemblyAttributesGoHere
- {
-
- internal AssemblyAttributesGoHere()
- {
- }
- }
- [System.Runtime.CompilerServices.FriendAccessAllowed]
- internal sealed class AssemblyAttributesGoHereS
- {
- internal AssemblyAttributesGoHereS()
- {
- }
- }
- [System.Runtime.CompilerServices.FriendAccessAllowed]
- internal sealed class AssemblyAttributesGoHereM
- {
- internal AssemblyAttributesGoHereM()
- {
- }
- }
- [System.Runtime.CompilerServices.FriendAccessAllowed]
- internal sealed class AssemblyAttributesGoHereSM
- {
- internal AssemblyAttributesGoHereSM()
- {
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
index 65755f6baa..1cd830cfca 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs
@@ -18,7 +18,6 @@ namespace System.Runtime.CompilerServices
{
[Serializable]
[AttributeUsage(AttributeTargets.Class)]
- [System.Runtime.InteropServices.ComVisible(true)]
public class CompilerGlobalScopeAttribute : Attribute
{
public CompilerGlobalScopeAttribute () {}
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/DecoratedNameAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/DecoratedNameAttribute.cs
deleted file mode 100644
index 75558d4e7e..0000000000
--- a/src/mscorlib/src/System/Runtime/CompilerServices/DecoratedNameAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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;
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.CompilerServices
-{
- [AttributeUsage(AttributeTargets.All),
- ComVisible(false)]
- internal sealed class DecoratedNameAttribute : Attribute
- {
- public DecoratedNameAttribute(string decoratedName)
- {}
- }
-}
-
diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs b/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
index d9e067bd4c..147c103047 100644
--- a/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs
@@ -26,18 +26,6 @@ namespace System.Runtime.CompilerServices
}
}
- internal static TypeForwardedToAttribute[] GetCustomAttribute(RuntimeAssembly assembly)
- {
- Type[] types = null;
- RuntimeAssembly.GetForwardedTypes(assembly.GetNativeHandle(), JitHelpers.GetObjectHandleOnStack(ref types));
-
- TypeForwardedToAttribute[] attributes = new TypeForwardedToAttribute[types.Length];
- for (int i = 0; i < types.Length; ++i)
- attributes[i] = new TypeForwardedToAttribute(types[i]);
-
- return attributes;
- }
-
}
}
diff --git a/src/mscorlib/src/System/Runtime/GcSettings.cs b/src/mscorlib/src/System/Runtime/GcSettings.cs
index 91997f5297..48e50bf821 100644
--- a/src/mscorlib/src/System/Runtime/GcSettings.cs
+++ b/src/mscorlib/src/System/Runtime/GcSettings.cs
@@ -37,7 +37,7 @@ namespace System.Runtime {
Succeeded = 0,
NoGCInProgress = 1 // NoGCRegion is in progress, can't change pause mode.
};
-
+
public static GCLatencyMode LatencyMode
{
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
index fd500fdbce..d5e1df699f 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
@@ -46,18 +46,6 @@ namespace System.Runtime.InteropServices {
SetErrorCode(errorCode);
}
- internal COMException(int hresult)
- : base(Win32Native.GetMessage(hresult))
- {
- SetErrorCode(hresult);
- }
-
- internal COMException(String message, int hresult, Exception inner)
- : base(message, inner)
- {
- SetErrorCode(hresult);
- }
-
protected COMException(SerializationInfo info, StreamingContext context) : base(info, context) {
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs
index 2da0c5eea3..c2f56b0580 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs
@@ -45,52 +45,6 @@ namespace System.Runtime.InteropServices {
get { return _d; }
set { _d = value; }
}
-
- public object Invoke(object[] args) {
- if (_d == null)
- return null;
-
- if (_once == false) {
- PreProcessSignature();
- _once = true;
- }
-
- if (_cachedTargetTypes != null && _expectedParamsCount == args.Length) {
- for (int i = 0; i < _expectedParamsCount; i++) {
- if (_cachedTargetTypes[i] != null) {
- args[i] = Enum.ToObject(_cachedTargetTypes[i], args[i]);
- }
- }
- }
-
- return _d.DynamicInvoke(args);
- }
-
- private void PreProcessSignature() {
- ParameterInfo[] parameters = _d.Method.GetParameters();
- _expectedParamsCount = parameters.Length;
-
- Type[] enumTypes = new Type[_expectedParamsCount];
-
- bool needToHandleCoercion = false;
-
- for (int i = 0; i < _expectedParamsCount; i++) {
- ParameterInfo pi = parameters[i];
- // recognize only 'ref Enum' signatures and cache
- // both enum type and the underlying type.
- if (pi.ParameterType.IsByRef &&
- pi.ParameterType.HasElementType &&
- pi.ParameterType.GetElementType().IsEnum) {
-
- needToHandleCoercion = true;
- enumTypes[i] = pi.ParameterType.GetElementType();
- }
- }
-
- if (needToHandleCoercion == true) {
- _cachedTargetTypes = enumTypes;
- }
- }
}
#region private fields
@@ -145,15 +99,9 @@ namespace System.Runtime.InteropServices {
return methods;
}
-
- #endregion
-
- #region public properties / methods
-
- internal int DispId {
- get { return _dispid; }
- }
+#endregion
+#region public properties / methods
internal bool Empty {
get { return _delegateWrappers == null || _delegateWrappers.Length == 0; }
@@ -225,22 +173,6 @@ namespace System.Runtime.InteropServices {
_delegateWrappers = newDelegateWrappers;
}
- internal object Invoke(object[] args) {
- BCLDebug.Assert(Empty == false, "event sink is executed but delegates list is empty");
-
- // Issue: see code:ComEventsHelper#ComEventsRetValIssue
- object result = null;
- DelegateWrapper[] invocationList = _delegateWrappers;
- foreach (DelegateWrapper wrapper in invocationList) {
- if (wrapper == null || wrapper.Delegate == null)
- continue;
-
- result = wrapper.Invoke(args);
- }
-
- return result;
- }
-
#endregion
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs b/src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs
index 62b65d1aff..64c6a5aedf 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs
@@ -18,21 +18,12 @@ namespace System.Runtime.InteropServices.Expando {
[Guid("AFBF15E6-C37C-11d2-B88E-00A0C9B471B8")]
[System.Runtime.InteropServices.ComVisible(true)]
- public interface IExpando : IReflect
+ internal interface IExpando : IReflect
{
// Add a new Field to the reflection object. The field has
// name as its name.
FieldInfo AddField(String name);
- // Add a new Property to the reflection object. The property has
- // name as its name.
- PropertyInfo AddProperty(String name);
-
- // Add a new Method to the reflection object. The method has
- // name as its name and method is a delegate
- // to the method.
- MethodInfo AddMethod(String name, Delegate method);
-
// Removes the specified member.
void RemoveMember(MemberInfo m);
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
index 5530819c5f..25ec876f90 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs
@@ -296,8 +296,6 @@ namespace System.Runtime.InteropServices
internal static extern IntPtr InternalAddrOfPinnedObject(IntPtr handle);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void InternalCheckDomain(IntPtr handle);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern GCHandleType InternalGetHandleType(IntPtr handle);
// The actual integer handle value that the EE uses internally.
private IntPtr m_handle;
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs b/src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs
index 1dccb66fc2..afa934caaf 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs
@@ -21,22 +21,4 @@ namespace System.Runtime.InteropServices {
using System;
using System.Reflection;
using System.Reflection.Emit;
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum ImporterEventKind
- {
- NOTIF_TYPECONVERTED = 0,
- NOTIF_CONVERTWARNING = 1,
- ERROR_REFTOINVALIDTYPELIB = 2,
- }
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum ExporterEventKind
- {
- NOTIF_TYPECONVERTED = 0,
- NOTIF_CONVERTWARNING = 1,
- ERROR_REFTOINVALIDASSEMBLY = 2
- }
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs b/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs
index 650ea65697..818034ee34 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs
@@ -18,42 +18,11 @@ namespace System.Runtime.InteropServices {
[
System.Security.SuppressUnmanagedCodeSecurity,
- DllImport("oleaut32.dll", PreserveSig = false),
- System.Security.SecurityCritical
- ]
- internal static extern void VariantClear(IntPtr variant);
-
- [
- System.Security.SuppressUnmanagedCodeSecurity,
ComImport,
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid("00020400-0000-0000-C000-000000000046")
]
internal interface IDispatch {
-
- void GetTypeInfoCount(out uint pctinfo);
-
- void GetTypeInfo(uint iTInfo, int lcid, out IntPtr info);
-
- void GetIDsOfNames(
- ref Guid iid,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 2)]
- string[] names,
- uint cNames,
- int lcid,
- [Out]
- [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I4, SizeParamIndex = 2)]
- int[] rgDispId);
-
- void Invoke(
- int dispIdMember,
- ref Guid riid,
- int lcid,
- ComTypes.INVOKEKIND wFlags,
- ref ComTypes.DISPPARAMS pDispParams,
- IntPtr pvarResult,
- IntPtr pExcepInfo,
- IntPtr puArgErr);
}
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
index 15aaf14afe..03c4cd7ea3 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs
@@ -31,75 +31,13 @@ namespace System.Runtime.InteropServices
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String GetModuleFileName();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetDeveloperPath();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetHostBindingFile();
-
- public static bool FromGlobalAccessCache(Assembly a)
- {
- return a.GlobalAssemblyCache;
- }
-
[MethodImpl (MethodImplOptions.NoInlining)]
public static String GetSystemVersion()
{
return Assembly.GetExecutingAssembly().ImageRuntimeVersion;
}
- public static String GetRuntimeDirectory()
- {
- String dir = GetRuntimeDirectoryImpl();
- new FileIOPermission(FileIOPermissionAccess.PathDiscovery, dir).Demand();
- return dir;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern String GetRuntimeDirectoryImpl();
-
#if FEATURE_COMINTEROP
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern IntPtr GetRuntimeInterfaceImpl(
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid clsid,
- [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid);
-
- //
- // This function does the equivalent of calling GetInterface(clsid, riid) on the
- // ICLRRuntimeInfo representing this runtime. See MetaHost.idl for a list of
- // CLSIDs and IIDs supported by this method.
- //
- // Returns unmanaged pointer to requested interface on success. Throws
- // COMException with failed HR if there is a QI failure.
- //
- [ComVisible(false)]
- public static IntPtr GetRuntimeInterfaceAsIntPtr(Guid clsid, Guid riid)
- {
- return GetRuntimeInterfaceImpl(clsid, riid);
- }
-
- //
- // This function does the equivalent of calling GetInterface(clsid, riid) on the
- // ICLRRuntimeInfo representing this runtime. See MetaHost.idl for a list of
- // CLSIDs and IIDs supported by this method.
- //
- // Returns an RCW to requested interface on success. Throws
- // COMException with failed HR if there is a QI failure.
- //
- [ComVisible(false)]
- public static object GetRuntimeInterfaceAsObject(Guid clsid, Guid riid)
- {
- IntPtr p = IntPtr.Zero;
- try {
- p = GetRuntimeInterfaceImpl(clsid, riid);
- return Marshal.GetObjectForIUnknown(p);
- } finally {
- if(p != IntPtr.Zero) {
- Marshal.Release(p);
- }
- }
- }
#endif // FEATURE_COMINTEROP
}
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs
index 80b24f5529..7fa2420530 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs
@@ -35,7 +35,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
[System.Runtime.CompilerServices.FriendAccessAllowed]
internal sealed class WindowsRuntimeImportAttribute : Attribute
{
- public WindowsRuntimeImportAttribute()
+ internal WindowsRuntimeImportAttribute()
{ }
}
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs
index 702e0c9e52..b7dad17a6b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs
@@ -148,15 +148,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
return CoerceScalarValue<String>(PropertyType.String);
}
- [Pure]
- public Object GetInspectable()
- {
- if (this.Type != PropertyType.Inspectable)
- throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Inspectable"), __HResults.TYPE_E_TYPEMISMATCH);
- Contract.EndContractBlock();
- return _data;
- }
-
[Pure]
public Guid GetGuid()
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
index a5abb4f23e..3a896ecbe3 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs
@@ -53,25 +53,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
this.items = CreateKeyValueArray(data.Count, data.GetEnumerator());
}
- internal ConstantSplittableMap(IMapView<TKey, TValue> data)
- {
- if (data == null)
- throw new ArgumentNullException(nameof(data));
-
- if (((UInt32)Int32.MaxValue) < data.Size)
- {
- Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge"));
- e.SetErrorCode(__HResults.E_BOUNDS);
- throw e;
- }
-
- int size = (int)data.Size;
-
- this.firstItemIndex = 0;
- this.lastItemIndex = size - 1;
- this.items = CreateKeyValueArray(size, data.GetEnumerator());
- }
-
private ConstantSplittableMap(KeyValuePair<TKey, TValue>[] items, Int32 firstItemIndex, Int32 lastItemIndex)
{
@@ -94,22 +75,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
return kvArray;
}
- private KeyValuePair<TKey, TValue>[] CreateKeyValueArray(Int32 count, IEnumerator<IKeyValuePair<TKey, TValue>> data)
- {
- KeyValuePair<TKey, TValue>[] kvArray = new KeyValuePair<TKey, TValue>[count];
-
- Int32 i = 0;
- while (data.MoveNext())
- {
- IKeyValuePair<TKey, TValue> current = data.Current;
- kvArray[i++] = new KeyValuePair<TKey, TValue>(current.Key, current.Value);
- }
-
- Array.Sort(kvArray, keyValuePairComparator);
-
- return kvArray;
- }
-
public int Count {
get {
@@ -179,14 +144,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
secondPartition = new ConstantSplittableMap<TKey, TValue>(items, pivot + 1, lastItemIndex);
}
- #region IReadOnlyDictionary members
-
- public bool ContainsKey(TKey key)
- {
- KeyValuePair<TKey, TValue> searchKey = new KeyValuePair<TKey, TValue>(key, default(TValue));
- int index = Array.BinarySearch(items, firstItemIndex, Count, searchKey, keyValuePairComparator);
- return index >= 0;
- }
+#region IReadOnlyDictionary members
public bool TryGetValue(TKey key, out TValue value)
{
@@ -203,24 +161,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
return true;
}
- public TValue this[TKey key] {
- get {
- return Lookup(key);
- }
- }
-
- public IEnumerable<TKey> Keys {
- get {
- throw new NotImplementedException("NYI");
- }
- }
-
- public IEnumerable<TValue> Values {
- get {
- throw new NotImplementedException("NYI");
- }
- }
-
#endregion IReadOnlyDictionary members
#region IKeyValuePair Enumerator
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
index a77ff005b9..6982911a13 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs
@@ -57,9 +57,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
void Append(T value);
void RemoveAtEnd();
void Clear();
- [Pure]
- uint GetMany(uint startIndex, [Out] T[] items);
- void ReplaceAll(T[] items);
}
[ComImport]
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs
index 242ff759a8..57655ec861 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs
@@ -135,12 +135,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime
restTokens = null;
}
- internal EventRegistrationTokenList(EventRegistrationTokenList list)
- {
- firstToken = list.firstToken;
- restTokens = list.restTokens;
- }
-
// Push a new token into this list
// Returns true if you need to copy back this list into the dictionary (so that you
// don't lose change outside the dictionary). false otherwise.
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
index 9ca959c528..ce1bd4626b 100644
--- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
+++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs
@@ -16,94 +16,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime
using System.Runtime.InteropServices;
using System.Security;
- public static class WindowsRuntimeMetadata
+ internal static class WindowsRuntimeMetadata
{
- // Wrapper for Win8 API RoResolveNamespace with default Windows SDK path as installed .winmd files in %WINDIR%\system32\WinMetadata.
- public static IEnumerable<string> ResolveNamespace(string namespaceName, IEnumerable<string> packageGraphFilePaths)
- {
- return ResolveNamespace(namespaceName, null, packageGraphFilePaths);
- }
-
- // Wrapper for Win8 API RoResolveNamespace.
- public static IEnumerable<string> ResolveNamespace(string namespaceName, string windowsSdkFilePath, IEnumerable<string> packageGraphFilePaths)
- {
- if (namespaceName == null)
- throw new ArgumentNullException(nameof(namespaceName));
- Contract.EndContractBlock();
-
- string[] packageGraphFilePathsArray = null;
- if (packageGraphFilePaths != null)
- {
- List<string> packageGraphFilePathsList = new List<string>(packageGraphFilePaths);
- packageGraphFilePathsArray = new string[packageGraphFilePathsList.Count];
-
- int index = 0;
- foreach (string packageGraphFilePath in packageGraphFilePathsList)
- {
- packageGraphFilePathsArray[index] = packageGraphFilePath;
- index++;
- }
- }
-
- string[] retFileNames = null;
- nResolveNamespace(
- namespaceName,
- windowsSdkFilePath,
- packageGraphFilePathsArray,
- ((packageGraphFilePathsArray == null) ? 0 : packageGraphFilePathsArray.Length),
- JitHelpers.GetObjectHandleOnStack(ref retFileNames));
-
- return retFileNames;
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private extern static void nResolveNamespace(
- string namespaceName,
- string windowsSdkFilePath,
- string[] packageGraphFilePaths,
- int cPackageGraphFilePaths,
- ObjectHandleOnStack retFileNames);
+ private static EventHandler<DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve;
-#if FEATURE_REFLECTION_ONLY_LOAD
- [method: System.Security.SecurityCritical]
- public static event EventHandler<NamespaceResolveEventArgs> ReflectionOnlyNamespaceResolve;
-
- internal static RuntimeAssembly[] OnReflectionOnlyNamespaceResolveEvent(AppDomain appDomain, RuntimeAssembly assembly, string namespaceName)
- {
- EventHandler<NamespaceResolveEventArgs> eventHandler = ReflectionOnlyNamespaceResolve;
- if (eventHandler != null)
- {
- Delegate[] ds = eventHandler.GetInvocationList();
- int len = ds.Length;
- for (int i = 0; i < len; i++)
- {
- NamespaceResolveEventArgs eventArgs = new NamespaceResolveEventArgs(namespaceName, assembly);
-
- ((EventHandler<NamespaceResolveEventArgs>)ds[i])(appDomain, eventArgs);
-
- Collection<Assembly> assembliesCollection = eventArgs.ResolvedAssemblies;
- if (assembliesCollection.Count > 0)
- {
- RuntimeAssembly[] retAssemblies = new RuntimeAssembly[assembliesCollection.Count];
- int retIndex = 0;
- foreach (Assembly asm in assembliesCollection)
- {
- retAssemblies[retIndex] = AppDomain.GetRuntimeAssembly(asm);
- retIndex++;
- }
- return retAssemblies;
- }
- }
- }
-
- return null;
- }
-#endif //FEATURE_REFLECTION_ONLY
-
- [method: System.Security.SecurityCritical]
- public static event EventHandler<DesignerNamespaceResolveEventArgs> DesignerNamespaceResolve;
-
internal static string[] OnDesignerNamespaceResolveEvent(AppDomain appDomain, string namespaceName)
{
EventHandler<DesignerNamespaceResolveEventArgs> eventHandler = DesignerNamespaceResolve;
@@ -183,19 +99,11 @@ namespace System.Runtime.InteropServices.WindowsRuntime
#endif //FEATURE_REFLECTION_ONLY
[ComVisible(false)]
- public class DesignerNamespaceResolveEventArgs : EventArgs
+ internal class DesignerNamespaceResolveEventArgs : EventArgs
{
private string _NamespaceName;
private Collection<string> _ResolvedAssemblyFiles;
- public string NamespaceName
- {
- get
- {
- return _NamespaceName;
- }
- }
-
public Collection<string> ResolvedAssemblyFiles
{
get
diff --git a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
index 94af350029..2be8b13274 100644
--- a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
+++ b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs
@@ -18,9 +18,6 @@ namespace System.Runtime.Loader
{
public abstract class AssemblyLoadContext
{
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern bool OverrideDefaultAssemblyLoadContextForCurrentDomain(IntPtr ptrNativeAssemblyLoadContext);
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
@@ -29,10 +26,6 @@ namespace System.Runtime.Loader
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private static extern IntPtr InitializeAssemblyLoadContext(IntPtr ptrAssemblyLoadContext, bool fRepresentsTPALoadContext);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern IntPtr LoadFromAssemblyName(IntPtr ptrNativeAssemblyLoadContext, bool fRepresentsTPALoadContext);
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
@@ -351,28 +344,6 @@ namespace System.Runtime.Loader
return s_DefaultAssemblyLoadContext;
}
}
-
- // This will be used to set the AssemblyLoadContext for DefaultContext, for the AppDomain,
- // by a host. Once set, the runtime will invoke the LoadFromAssemblyName method against it to perform
- // assembly loads for the DefaultContext.
- //
- // This method will throw if the Default AssemblyLoadContext is already set or the Binding model is already locked.
- public static void InitializeDefaultContext(AssemblyLoadContext context)
- {
- if (context == null)
- {
- throw new ArgumentNullException(nameof(context));
- }
-
- // Try to override the default assembly load context
- if (!AssemblyLoadContext.OverrideDefaultAssemblyLoadContextForCurrentDomain(context.m_pNativeAssemblyLoadContext))
- {
- throw new InvalidOperationException(Environment.GetResourceString("AppDomain_BindingModelIsLocked"));
- }
-
- // Update the managed side as well.
- s_DefaultAssemblyLoadContext = context;
- }
// This call opens and closes the file, but does not add the
// assembly to the domain.
diff --git a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs
index bd87d9027c..3d3a42caab 100644
--- a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs
+++ b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs
@@ -472,10 +472,6 @@ namespace System.Runtime
_availPageFile >> 20, _totalFreeAddressSpace >> 20,
_lastKnownFreeAddressSpace >> 20, _reservedMem);
}
-
- public String StackTrace {
- get { return _stackTrace; }
- }
}
#endif
}
diff --git a/src/mscorlib/src/System/Runtime/ProfileOptimization.cs b/src/mscorlib/src/System/Runtime/ProfileOptimization.cs
deleted file mode 100644
index ca4227c011..0000000000
--- a/src/mscorlib/src/System/Runtime/ProfileOptimization.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// This class defines entry point for multi-core JIT API
-//
-//
-namespace System.Runtime {
-
- using System;
-
- using System.Reflection;
-
- using System.Security;
- using System.Security.Permissions;
-
- using System.Runtime;
- using System.Runtime.InteropServices;
- using System.Runtime.Versioning;
- using System.Runtime.CompilerServices;
-
-
- public static class ProfileOptimization
- {
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- internal static extern void InternalSetProfileRoot(string directoryPath);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- internal static extern void InternalStartProfile(string profile, IntPtr ptrNativeAssemblyLoadContext);
-
- public static void SetProfileRoot(string directoryPath)
- {
- InternalSetProfileRoot(directoryPath);
- }
-
- public static void StartProfile(string profile)
- {
- InternalStartProfile(profile, IntPtr.Zero);
- }
- }
-
-}
-
diff --git a/src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs b/src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs
index d9774d636b..67c934d034 100644
--- a/src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs
+++ b/src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs
@@ -23,7 +23,7 @@ namespace System.Runtime.ConstrainedExecution
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
- public sealed class PrePrepareMethodAttribute : Attribute
+ internal sealed class PrePrepareMethodAttribute : Attribute
{
public PrePrepareMethodAttribute()
{
diff --git a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs b/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs
index 5555670498..0298d014e3 100644
--- a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs
+++ b/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs
@@ -21,8 +21,7 @@ namespace System.Runtime.Remoting
[ClassInterface(ClassInterfaceType.AutoDual)]
[System.Runtime.InteropServices.ComVisible(true)]
- public class ObjectHandle:
- IObjectHandle
+ public class ObjectHandle
{
private Object WrappedObject;
@@ -30,12 +29,12 @@ namespace System.Runtime.Remoting
{
}
- public ObjectHandle(Object o)
+ internal ObjectHandle(Object o)
{
WrappedObject = o;
}
- public Object Unwrap()
+ internal Object Unwrap()
{
return WrappedObject;
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
index b710ed0b3a..03638ab1a7 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
@@ -18,7 +18,7 @@ namespace System.Runtime.Serialization {
using System.Diagnostics.Contracts;
[System.Runtime.InteropServices.ComVisible(true)]
- public class FormatterConverter : IFormatterConverter {
+ internal class FormatterConverter : IFormatterConverter {
public FormatterConverter() {
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
index 4257b2c274..191ca00ddd 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
@@ -52,173 +52,9 @@ namespace System.Runtime.Serialization {
return nativeGetUninitializedObject((RuntimeType)type);
}
- public static Object GetSafeUninitializedObject(Type type) {
- if ((object)type == null) {
- throw new ArgumentNullException(nameof(type));
- }
- Contract.EndContractBlock();
-
- if (!(type is RuntimeType)) {
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidType", type.ToString()));
- }
-
- try {
- return nativeGetSafeUninitializedObject((RuntimeType)type);
- }
- catch(SecurityException e) {
- throw new SerializationException(Environment.GetResourceString("Serialization_Security", type.FullName), e);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Object nativeGetSafeUninitializedObject(RuntimeType type);
-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern Object nativeGetUninitializedObject(RuntimeType type);
private static Binder s_binder = Type.DefaultBinder;
- internal static void SerializationSetValue(MemberInfo fi, Object target, Object value)
- {
- Contract.Requires(fi != null);
-
- RtFieldInfo rtField = fi as RtFieldInfo;
-
- if (rtField != null)
- {
- rtField.CheckConsistency(target);
- rtField.UnsafeSetValue(target, value, BindingFlags.Default, s_binder, null);
- return;
- }
-
- SerializationFieldInfo serField = fi as SerializationFieldInfo;
- if (serField != null)
- {
- serField.InternalSetValue(target, value, BindingFlags.Default, s_binder, null);
- return;
- }
-
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFieldInfo"));
- }
-
- // Fill in the members of obj with the data contained in data.
- // Returns the number of members populated.
- //
- public static Object PopulateObjectMembers(Object obj, MemberInfo[] members, Object[] data) {
- if (obj==null) {
- throw new ArgumentNullException(nameof(obj));
- }
-
- if (members==null) {
- throw new ArgumentNullException(nameof(members));
- }
-
- if (data==null) {
- throw new ArgumentNullException(nameof(data));
- }
-
- if (members.Length!=data.Length) {
- throw new ArgumentException(Environment.GetResourceString("Argument_DataLengthDifferent"));
- }
- Contract.EndContractBlock();
-
- MemberInfo mi;
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]Enter.");
-
- for (int i=0; i<members.Length; i++) {
- mi = members[i];
-
- if (mi==null) {
- throw new ArgumentNullException(nameof(members), Environment.GetResourceString("ArgumentNull_NullMember", i));
- }
-
- //If we find an empty, it means that the value was never set during deserialization.
- //This is either a forward reference or a null. In either case, this may break some of the
- //invariants mantained by the setter, so we'll do nothing with it for right now.
- if (data[i]!=null) {
- if (mi.MemberType==MemberTypes.Field) {
- SerializationSetValue(mi, obj, data[i]);
- } else {
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMemberInfo"));
- }
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]\tType:", obj.GetType(), "\tMember:",
- members[i].Name, " with member type: ", ((FieldInfo)members[i]).FieldType);
- }
- //Console.WriteLine("X");
- }
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]Leave.");
-
- return obj;
- }
-
- // Extracts the data from obj. members is the array of members which we wish to
- // extract (must be FieldInfos or PropertyInfos). For each supplied member, extract the matching value and
- // return it in a Object[] of the same size.
- //
- public static Object[] GetObjectData(Object obj, MemberInfo[] members) {
-
- if (obj==null) {
- throw new ArgumentNullException(nameof(obj));
- }
-
- if (members==null) {
- throw new ArgumentNullException(nameof(members));
- }
- Contract.EndContractBlock();
-
- int numberOfMembers = members.Length;
-
- Object[] data = new Object[numberOfMembers];
- MemberInfo mi;
-
- for (int i=0; i<numberOfMembers; i++) {
- mi=members[i];
-
- if (mi==null) {
- throw new ArgumentNullException(nameof(members), Environment.GetResourceString("ArgumentNull_NullMember", i));
- }
-
- if (mi.MemberType==MemberTypes.Field) {
- Debug.Assert(mi is RuntimeFieldInfo || mi is SerializationFieldInfo,
- "[FormatterServices.GetObjectData]mi is RuntimeFieldInfo || mi is SerializationFieldInfo.");
-
- RtFieldInfo rfi = mi as RtFieldInfo;
- if (rfi != null) {
- rfi.CheckConsistency(obj);
- data[i] = rfi.UnsafeGetValue(obj);
- } else {
- data[i] = ((SerializationFieldInfo)mi).InternalGetValue(obj);
- }
- } else {
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMemberInfo"));
- }
- }
-
- return data;
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public static ISerializationSurrogate GetSurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
- {
- if (innerSurrogate == null)
- throw new ArgumentNullException(nameof(innerSurrogate));
- Contract.EndContractBlock();
- return new SurrogateForCyclicalReference(innerSurrogate);
- }
-
- /*=============================GetTypeFromAssembly==============================
- **Action:
- **Returns:
- **Arguments:
- **Exceptions:
- ==============================================================================*/
- public static Type GetTypeFromAssembly(Assembly assem, String name) {
- if (assem==null)
- throw new ArgumentNullException(nameof(assem));
- Contract.EndContractBlock();
- return assem.GetType(name, false, false);
- }
/*============================LoadAssemblyFromString============================
**Action: Loads an assembly from a given string. The current assembly loading story
@@ -239,99 +75,6 @@ namespace System.Runtime.Serialization {
Assembly found = Assembly.Load(assemblyName);
return found;
}
-
- internal static Assembly LoadAssemblyFromStringNoThrow(String assemblyName) {
- try {
- return LoadAssemblyFromString(assemblyName);
- }
- catch (Exception e){
- BCLDebug.Trace("SER", "[LoadAssemblyFromString]", e.ToString());
- }
- return null;
- }
-
- internal static string GetClrAssemblyName(Type type, out bool hasTypeForwardedFrom) {
- if ((object)type == null) {
- throw new ArgumentNullException(nameof(type));
- }
-
- object[] typeAttributes = type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), false);
- if (typeAttributes != null && typeAttributes.Length > 0) {
- hasTypeForwardedFrom = true;
- TypeForwardedFromAttribute typeForwardedFromAttribute = (TypeForwardedFromAttribute)typeAttributes[0];
- return typeForwardedFromAttribute.AssemblyFullName;
- }
- else {
- hasTypeForwardedFrom = false;
- return type.Assembly.FullName;
- }
- }
-
- internal static string GetClrTypeFullName(Type type) {
- if (type.IsArray) {
- return GetClrTypeFullNameForArray(type);
- }
- else {
- return GetClrTypeFullNameForNonArrayTypes(type);
- }
- }
-
- static string GetClrTypeFullNameForArray(Type type) {
- int rank = type.GetArrayRank();
- if (rank == 1)
- {
- return String.Format(CultureInfo.InvariantCulture, "{0}{1}", GetClrTypeFullName(type.GetElementType()), "[]");
- }
- else
- {
- StringBuilder builder = new StringBuilder(GetClrTypeFullName(type.GetElementType())).Append("[");
- for (int commaIndex = 1; commaIndex < rank; commaIndex++)
- {
- builder.Append(",");
- }
- builder.Append("]");
- return builder.ToString();
- }
- }
-
- static string GetClrTypeFullNameForNonArrayTypes(Type type) {
- if (!type.IsGenericType) {
- return type.FullName;
- }
-
- Type[] genericArguments = type.GetGenericArguments();
- StringBuilder builder = new StringBuilder(type.GetGenericTypeDefinition().FullName).Append("[");
- bool hasTypeForwardedFrom;
-
- foreach (Type genericArgument in genericArguments) {
- builder.Append("[").Append(GetClrTypeFullName(genericArgument)).Append(", ");
- builder.Append(GetClrAssemblyName(genericArgument, out hasTypeForwardedFrom)).Append("],");
- }
-
- //remove the last comma and close typename for generic with a close bracket
- return builder.Remove(builder.Length - 1, 1).Append("]").ToString();
- }
- }
-
- internal sealed class SurrogateForCyclicalReference : ISerializationSurrogate
- {
- ISerializationSurrogate innerSurrogate;
- internal SurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
- {
- if (innerSurrogate == null)
- throw new ArgumentNullException(nameof(innerSurrogate));
- this.innerSurrogate = innerSurrogate;
- }
-
- public void GetObjectData(Object obj, SerializationInfo info, StreamingContext context)
- {
- innerSurrogate.GetObjectData(obj, info, context);
- }
-
- public Object SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
- {
- return innerSurrogate.SetObjectData(obj, info, context, selector);
- }
}
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs b/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs
deleted file mode 100644
index 8d91d95acf..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Interface: IFormatter;
-**
-**
-** Purpose: The interface for all formatters.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System.Runtime.Remoting;
- using System;
- using System.IO;
-
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface IFormatter {
- Object Deserialize(Stream serializationStream);
-
- void Serialize(Stream serializationStream, Object graph);
-
-
- ISurrogateSelector SurrogateSelector {
- get;
- set;
- }
-
- SerializationBinder Binder {
- get;
- set;
- }
-
- StreamingContext Context {
- get;
- set;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs b/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs
deleted file mode 100644
index 226bbdcc75..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Interface: ISurrogate
-**
-**
-** Purpose: The interface implemented by an object which
-** supports surrogates.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Security.Permissions;
- using System;
- using System.Reflection;
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface ISerializationSurrogate {
- // Interface does not need to be marked with the serializable attribute
- // Returns a SerializationInfo completely populated with all of the data needed to reinstantiate the
- // the object at the other end of serialization.
- //
- void GetObjectData(Object obj, SerializationInfo info, StreamingContext context);
-
- // Reinflate the object using all of the information in data. The information in
- // members is used to find the particular field or property which needs to be set.
- //
- Object SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector);
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs b/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs
deleted file mode 100644
index 87b7845894..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Interface: ISurrogateSelector
-**
-**
-** Purpose: A user-supplied class for doing the type to surrogate
-** mapping.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
-
- using System.Runtime.Remoting;
- using System.Security.Permissions;
- using System;
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface ISurrogateSelector {
- // Interface does not need to be marked with the serializable attribute
- // Specifies the next ISurrogateSelector to be examined for surrogates if the current
- // instance doesn't have a surrogate for the given type and assembly in the given context.
- void ChainSelector(ISurrogateSelector selector);
-
- // Returns the appropriate surrogate for the given type in the given context.
- ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector);
-
-
- // Return the next surrogate in the chain. Returns null if no more exist.
- ISurrogateSelector GetNextSelector();
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs b/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs
deleted file mode 100644
index 1303e40c27..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** Purpose: This is a lightweight class designed to hold the members
-** and StreamingContext for a particular class.
-**
-**
-============================================================*/
-namespace System.Runtime.Serialization {
-
- using System.Runtime.Remoting;
- using System;
- using System.Reflection;
- [Serializable]
- internal class MemberHolder {
-// disable csharp compiler warning #0414: field assigned unused value
-#pragma warning disable 0414
- internal MemberInfo[] members = null;
-#pragma warning restore 0414
- internal Type memberType;
- internal StreamingContext context;
-
- internal MemberHolder(Type type, StreamingContext ctx) {
- memberType = type;
- context = ctx;
- }
-
- public override int GetHashCode() {
- return memberType.GetHashCode();
- }
-
- public override bool Equals(Object obj) {
- if (!(obj is MemberHolder)) {
- return false;
- }
-
- MemberHolder temp = (MemberHolder)obj;
-
- if (Object.ReferenceEquals(temp.memberType, memberType) && temp.context.State == context.State) {
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs b/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
index 4160979dc5..260e873bc7 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// 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;
@@ -211,10 +211,7 @@ namespace System.Runtime.Serialization
private StreamingContext m_streamingContext;
private List<object> m_serializedStates = new List<object>();
- internal SafeSerializationEventArgs(StreamingContext streamingContext)
- {
- m_streamingContext = streamingContext;
- }
+ internal SafeSerializationEventArgs() {}
public void AddSerializedState(ISafeSerializationData serializedState)
{
@@ -226,11 +223,6 @@ namespace System.Runtime.Serialization
m_serializedStates.Add(serializedState);
}
- internal IList<object> SerializedStates
- {
- get { return m_serializedStates; }
- }
-
public StreamingContext StreamingContext
{
get { return m_streamingContext; }
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs
deleted file mode 100644
index 7457991008..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Interface: SerializationBinder
-**
-**
-** Purpose: The base class of serialization binders.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System;
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public abstract class SerializationBinder {
-
- public virtual void BindToName(Type serializedType, out String assemblyName, out String typeName)
- {
- assemblyName = null;
- typeName = null;
- }
-
- public abstract Type BindToType(String assemblyName, String typeName);
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs
deleted file mode 100644
index 82536ce3b4..0000000000
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** Purpose: Provides a methods of representing imaginary fields
-** which are unique to serialization. In this case, what we're
-** representing is the private members of parent classes. We
-** aggregate the RuntimeFieldInfo associated with this member
-** and return a managled form of the name. The name that we
-** return is .parentname.fieldname
-**
-**
-============================================================*/
-
-namespace System.Runtime.Serialization {
-
- using System;
- using System.Reflection;
- using System.Globalization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
- using System.Threading;
-
- internal sealed class SerializationFieldInfo : FieldInfo {
-
- internal const String FakeNameSeparatorString = "+";
-
- private RuntimeFieldInfo m_field;
- private String m_serializationName;
-
- public override Module Module { get { return m_field.Module; } }
- public override int MetadataToken { get { return m_field.MetadataToken; } }
-
- internal SerializationFieldInfo(RuntimeFieldInfo field, String namePrefix) {
- Debug.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null");
- Debug.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null");
-
- m_field = field;
- m_serializationName = String.Concat(namePrefix, FakeNameSeparatorString, m_field.Name);
- }
-
- //
- // MemberInfo methods
- //
- public override String Name {
- get {
- return m_serializationName;
- }
- }
-
- public override Type DeclaringType {
- get {
- return m_field.DeclaringType;
- }
- }
-
- public override Type ReflectedType {
- get {
- return m_field.ReflectedType;
- }
- }
-
- public override Object[] GetCustomAttributes(bool inherit) {
- return m_field.GetCustomAttributes(inherit);
- }
-
- public override Object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return m_field.GetCustomAttributes(attributeType, inherit);
- }
-
- public override bool IsDefined(Type attributeType, bool inherit) {
- return m_field.IsDefined(attributeType, inherit);
- }
-
- //
- // FieldInfo methods
- //
- public override Type FieldType {
- get {
- return m_field.FieldType;
- }
- }
-
- public override Object GetValue(Object obj) {
- return m_field.GetValue(obj);
- }
-
- internal Object InternalGetValue(Object obj) {
- RtFieldInfo field = m_field as RtFieldInfo;
- if (field != null)
- {
- field.CheckConsistency(obj);
- return field.UnsafeGetValue(obj);
- }
- else
- return m_field.GetValue(obj);
- }
-
- public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- m_field.SetValue(obj, value, invokeAttr, binder, culture);
- }
-
- internal void InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- RtFieldInfo field = m_field as RtFieldInfo;
- if (field != null)
- {
- field.CheckConsistency(obj);
- field.UnsafeSetValue(obj, value, invokeAttr, binder, culture);
- }
- else
- m_field.SetValue(obj, value, invokeAttr, binder, culture);
- }
-
- internal RuntimeFieldInfo FieldInfo {
- get {
- return m_field;
- }
- }
-
- public override RuntimeFieldHandle FieldHandle {
- get {
- return m_field.FieldHandle;
- }
- }
-
- public override FieldAttributes Attributes {
- get {
- return m_field.Attributes;
- }
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
index 55909c85fd..567ad9ca7a 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
@@ -146,49 +146,10 @@ namespace System.Runtime.Serialization
}
}
- private static bool Compare(byte[] a, byte[] b)
- {
- // if either or both assemblies do not have public key token, we should demand, hence, returning false will force a demand
- if (a == null || b == null || a.Length == 0 || b.Length == 0 || a.Length != b.Length)
- {
- return false;
- }
- else
- {
- for (int i = 0; i < a.Length; i++)
- {
- if (a[i] != b[i]) return false;
- }
-
- return true;
- }
- }
-
internal static void DemandForUnsafeAssemblyNameAssignments(string originalAssemblyName, string newAssemblyName)
{
}
- internal static bool IsAssemblyNameAssignmentSafe(string originalAssemblyName, string newAssemblyName)
- {
- if (originalAssemblyName == newAssemblyName)
- {
- return true;
- }
-
- AssemblyName originalAssembly = new AssemblyName(originalAssemblyName);
- AssemblyName newAssembly = new AssemblyName(newAssemblyName);
-
- // mscorlib will get loaded by the runtime regardless of its string casing or its public key token,
- // so setting the assembly name to mscorlib must always be protected by a demand
- if (string.Equals(newAssembly.Name, s_mscorlibAssemblySimpleName, StringComparison.OrdinalIgnoreCase) ||
- string.Equals(newAssembly.Name, s_mscorlibFileName, StringComparison.OrdinalIgnoreCase))
- {
- return false;
- }
-
- return Compare(originalAssembly.GetPublicKeyToken(), newAssembly.GetPublicKeyToken());
- }
-
public int MemberCount
{
get
@@ -741,22 +702,5 @@ namespace System.Runtime.Serialization
return m_converter.ToString(value);
}
- internal string[] MemberNames
- {
- get
- {
- return m_members;
- }
-
- }
-
- internal object[] MemberValues
- {
- get
- {
- return m_data;
- }
- }
-
}
}
diff --git a/src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkId.cs b/src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkId.cs
deleted file mode 100644
index 0a5e668a92..0000000000
--- a/src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkId.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Purpose: Describe the target framework of the application or AppDomain.
-**
-===========================================================*/
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.Versioning
-{
- // What type of .NET Framework was this application compiled against?
- [FriendAccessAllowed]
- internal enum TargetFrameworkId
- {
- NotYetChecked = 0,
- Unrecognized = 1, // Unknown type, such as a new SKU (like watches or cars)
- Unspecified = 2, // The TargetFrameworkAttribute was created in v4.0. And apps compiled outside VS will not have this attribute.
- NetFramework = 3, // Desktop - Client or Server or ServerCore.
- Portable = 4, // Portable Library v1 Note: We do not expect people to build executables against portable libraries!
- NetCore = 5, // .NET Core = Windows 8 Immersive and Portable Library v2+
- Silverlight = 6, // Silverlight but not the Phone
- Phone = 7, // Windows Phone 7 or higher
- }
-}
diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs
index 2938dd0d92..0811ea1f7f 100644
--- a/src/mscorlib/src/System/RuntimeHandles.cs
+++ b/src/mscorlib/src/System/RuntimeHandles.cs
@@ -89,14 +89,6 @@ namespace System
public static bool operator !=(RuntimeTypeHandle left, object right) { return !left.Equals(right); }
public static bool operator !=(object left, RuntimeTypeHandle right) { return !right.Equals(left); }
-
- internal static RuntimeTypeHandle EmptyHandle
- {
- get
- {
- return new RuntimeTypeHandle(null);
- }
- }
// This is the RuntimeType for the type
@@ -139,11 +131,6 @@ namespace System
m_type = type;
}
- internal bool IsNullHandle()
- {
- return m_type == null;
- }
-
internal static bool IsPrimitive(RuntimeType type)
{
CorElementType corElemType = GetCorElementType(type);
@@ -376,9 +363,6 @@ namespace System
internal extern static bool IsComObject(RuntimeType type, bool isGenericCOM);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static bool IsContextful(RuntimeType type);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static bool IsInterface(RuntimeType type);
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -423,9 +407,6 @@ namespace System
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static bool HasProxyAttribute(RuntimeType type);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static bool IsValueType(RuntimeType type);
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -503,11 +484,6 @@ namespace System
return type;
}
- internal static Type GetTypeByName(string name, ref StackCrawlMark stackMark)
- {
- return GetTypeByName(name, false, false, false, ref stackMark, false);
- }
-
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private extern static void GetTypeByNameUsingCARules(string name, RuntimeModule scope, ObjectHandleOnStack type);
@@ -612,11 +588,6 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static bool HasInstantiation(RuntimeType type);
- internal bool HasInstantiation()
- {
- return HasInstantiation(GetTypeChecked());
- }
-
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private extern static void GetGenericTypeDefinition(RuntimeTypeHandle type, ObjectHandleOnStack retType);
@@ -637,11 +608,6 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static bool IsGenericVariable(RuntimeType type);
- internal bool IsGenericVariable()
- {
- return IsGenericVariable(GetTypeChecked());
- }
-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static int GetGenericVariableIndex(RuntimeType type);
@@ -817,11 +783,6 @@ namespace System
return method;
}
- internal static RuntimeMethodHandle EmptyHandle
- {
- get { return new RuntimeMethodHandle(); }
- }
-
private IRuntimeMethodInfo m_value;
internal RuntimeMethodHandle(IRuntimeMethodInfo method)
@@ -1031,53 +992,12 @@ namespace System
static extern internal uint GetSpecialSecurityFlags(IRuntimeMethodInfo method);
#endregion
-
[DebuggerStepThroughAttribute]
[Diagnostics.DebuggerHidden]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static void SerializationInvoke(IRuntimeMethodInfo method,
Object target, SerializationInfo info, ref StreamingContext context);
- // This returns true if the token is SecurityTransparent:
- // just the token - does not consider including module/type etc.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern bool _IsTokenSecurityTransparent(RuntimeModule module, int metaDataToken);
-
- internal static bool IsTokenSecurityTransparent(Module module, int metaDataToken)
- {
- return _IsTokenSecurityTransparent(module.ModuleHandle.GetRuntimeModule(), metaDataToken);
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool _IsSecurityCritical(IRuntimeMethodInfo method);
-
- internal static bool IsSecurityCritical(IRuntimeMethodInfo method)
- {
- return _IsSecurityCritical(method);
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool _IsSecuritySafeCritical(IRuntimeMethodInfo method);
-
- internal static bool IsSecuritySafeCritical(IRuntimeMethodInfo method)
- {
- return _IsSecuritySafeCritical(method);
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool _IsSecurityTransparent(IRuntimeMethodInfo method);
-
- internal static bool IsSecurityTransparent(IRuntimeMethodInfo method)
- {
- return _IsSecurityTransparent(method);
- }
-
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private extern static void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, bool fAsRuntimeTypeArray);
@@ -1170,17 +1090,6 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static Resolver GetResolver(RuntimeMethodHandleInternal method);
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern void GetCallerType(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retType);
-
- internal static RuntimeType GetCallerType(ref StackCrawlMark stackMark)
- {
- RuntimeType type = null;
- GetCallerType(JitHelpers.GetStackCrawlMarkHandle(ref stackMark), JitHelpers.GetObjectHandleOnStack(ref type));
- return type;
- }
-
[MethodImpl(MethodImplOptions.InternalCall)]
internal extern static MethodBody GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType);
@@ -1202,13 +1111,6 @@ namespace System
// When in doubt, do not use.
internal struct RuntimeFieldHandleInternal
{
- internal static RuntimeFieldHandleInternal EmptyHandle
- {
- get
- {
- return new RuntimeFieldHandleInternal();
- }
- }
internal bool IsNullHandle()
{
@@ -1242,11 +1144,6 @@ namespace System
[StructLayout(LayoutKind.Sequential)]
internal class RuntimeFieldInfoStub : IRuntimeFieldInfo
{
- public RuntimeFieldInfoStub(IntPtr methodHandleValue, object keepalive)
- {
- m_keepalive = keepalive;
- m_fieldHandle = new RuntimeFieldHandleInternal(methodHandleValue);
- }
// These unused variables are used to ensure that this class has the same layout as RuntimeFieldInfo
#pragma warning disable 169
@@ -1367,7 +1264,7 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern Object GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, ref bool domainInitialized);
-
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern Object GetValueDirect(RtFieldInfo field, RuntimeType fieldType, void *pTypedRef, RuntimeType contextType);
@@ -1480,11 +1377,6 @@ namespace System
{
return m_ptr;
}
-
- internal bool IsNullHandle()
- {
- return m_ptr == null;
- }
public override int GetHashCode()
{
@@ -1667,17 +1559,6 @@ namespace System
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
- private extern static void GetAssembly(RuntimeModule handle, ObjectHandleOnStack retAssembly);
-
- internal static RuntimeAssembly GetAssembly(RuntimeModule module)
- {
- RuntimeAssembly retAssembly = null;
- GetAssembly(module.GetNativeHandle(), JitHelpers.GetObjectHandleOnStack(ref retAssembly));
- return retAssembly;
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
internal extern static void GetModuleType(RuntimeModule handle, ObjectHandleOnStack type);
internal static RuntimeType GetModuleType(RuntimeModule module)
diff --git a/src/mscorlib/src/System/Security/AccessControl/Enums.cs b/src/mscorlib/src/System/Security/AccessControl/Enums.cs
index 20f5c5f91a..0a66ec0345 100644
--- a/src/mscorlib/src/System/Security/AccessControl/Enums.cs
+++ b/src/mscorlib/src/System/Security/AccessControl/Enums.cs
@@ -7,69 +7,7 @@ using System.Runtime.InteropServices;
namespace System.Security.AccessControl
{
[Flags]
- public enum InheritanceFlags
- {
- None = 0x00,
- ContainerInherit = 0x01,
- ObjectInherit = 0x02,
- }
-
- [Flags]
- public enum PropagationFlags
- {
- None = 0x00,
- NoPropagateInherit = 0x01,
- InheritOnly = 0x02,
- }
-
- [Flags]
- public enum AuditFlags
- {
- None = 0x00,
- Success = 0x01,
- Failure = 0x02,
- }
-
- [Flags]
- public enum SecurityInfos
- {
- Owner = 0x00000001,
- Group = 0x00000002,
- DiscretionaryAcl = 0x00000004,
- SystemAcl = 0x00000008,
-
- }
-
-
- public enum ResourceType
- {
- Unknown = 0x00,
- FileObject = 0x01,
- Service = 0x02,
- Printer = 0x03,
- RegistryKey = 0x04,
- LMShare = 0x05,
- KernelObject = 0x06,
- WindowObject = 0x07,
- DSObject = 0x08,
- DSObjectAll = 0x09,
- ProviderDefined = 0x0A,
- WmiGuidObject = 0x0B,
- RegistryWow6432Key = 0x0C,
- }
-
- [Flags]
- public enum AccessControlSections {
- None = 0,
- Audit = 0x1,
- Access = 0x2,
- Owner = 0x4,
- Group = 0x8,
- All = 0xF
- }
-
- [Flags]
- public enum AccessControlActions {
+ internal enum AccessControlActions {
None = 0
}
}
diff --git a/src/mscorlib/src/System/Security/BuiltInPermissionSets.cs b/src/mscorlib/src/System/Security/BuiltInPermissionSets.cs
deleted file mode 100644
index 48539574af..0000000000
--- a/src/mscorlib/src/System/Security/BuiltInPermissionSets.cs
+++ /dev/null
@@ -1,255 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-using System.Security.Permissions;
-using Microsoft.Win32;
-
-namespace System.Security
-{
- internal static class BuiltInPermissionSets
- {
- //
- // Raw PermissionSet XML - the built in permission sets are expressed in XML form since they contain
- // permissions from assemblies other than mscorlib.
- //
-
- private static readonly string s_everythingXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""Everything""
- Description = """ + Environment.GetResourceString("Policy_PS_Everything") + @"""
- <IPermission class = ""System.Data.OleDb.OleDbPermission, " + AssemblyRef.SystemData + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Data.SqlClient.SqlClientPermission, " + AssemblyRef.SystemData + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Diagnostics.PerformanceCounterPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Net.DnsPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Net.SocketPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Net.WebPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.DataProtectionPermission, " + AssemblyRef.SystemSecurity + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.EnvironmentPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Diagnostics.EventLogPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.FileDialogPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.FileIOPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.IsolatedStorageFilePermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.KeyContainerPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Drawing.Printing.PrintingPermission, " + AssemblyRef.SystemDrawing + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.ReflectionPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.RegistryPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.SecurityPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""Assertion, UnmanagedCode, Execution, ControlThread, ControlEvidence, ControlPolicy, ControlAppDomain, SerializationFormatter, ControlDomainPolicy, ControlPrincipal, RemotingConfiguration, Infrastructure, BindingRedirects"" />
- <IPermission class = ""System.Security.Permissions.UIPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.StorePermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.TypeDescriptorPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- </PermissionSet>";
-
- private static readonly string s_executionXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""Execution""
- Description = """ + Environment.GetResourceString("Policy_PS_Execution") + @""">
- <IPermission class = ""System.Security.Permissions.SecurityPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""Execution"" />
- </PermissionSet>";
-
- private static readonly string s_fullTrustXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Unrestricted = ""true""
- Name = ""FullTrust""
- Description = """ + Environment.GetResourceString("Policy_PS_FullTrust") + @""" />";
-
- private static readonly string s_internetXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""Internet""
- Description = """ + Environment.GetResourceString("Policy_PS_Internet") + @""">
- <IPermission class = ""System.Drawing.Printing.PrintingPermission, " + AssemblyRef.SystemDrawing + @"""
- version = ""1""
- Level = ""SafePrinting"" />
- <IPermission class = ""System.Security.Permissions.FileDialogPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Access = ""Open"" />
- <IPermission class = ""System.Security.Permissions.IsolatedStorageFilePermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- UserQuota = ""1024000""
- Allowed = ""ApplicationIsolationByUser"" />
- <IPermission class = ""System.Security.Permissions.SecurityPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""Execution"" />
- <IPermission class = ""System.Security.Permissions.UIPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Window = ""SafeTopLevelWindows""
- Clipboard = ""OwnClipboard"" />
- </PermissionSet>";
-
- private static readonly string s_localIntranetXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""LocalIntranet""
- Description = """ + Environment.GetResourceString("Policy_PS_LocalIntranet") + @""" >
- <IPermission class = ""System.Drawing.Printing.PrintingPermission, " + AssemblyRef.SystemDrawing + @"""
- version = ""1""
- Level = ""DefaultPrinting"" />
- <IPermission class = ""System.Net.DnsPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.EnvironmentPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Read = ""USERNAME"" />
- <IPermission class = ""System.Security.Permissions.FileDialogPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- <IPermission class = ""System.Security.Permissions.IsolatedStorageFilePermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Allowed = ""AssemblyIsolationByUser""
- UserQuota = ""9223372036854775807""
- Expiry = ""9223372036854775807""
- Permanent = ""true"" />
- <IPermission class = ""System.Security.Permissions.ReflectionPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""ReflectionEmit, RestrictedMemberAccess"" />
- <IPermission class = ""System.Security.Permissions.SecurityPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""Execution, Assertion, BindingRedirects "" />
- <IPermission class = ""System.Security.Permissions.TypeDescriptorPermission, " + AssemblyRef.System + @"""
- version = ""1""
- Flags = ""RestrictedRegistrationAccess"" />
- <IPermission class = ""System.Security.Permissions.UIPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Unrestricted = ""true"" />
- </PermissionSet>";
-
- private static readonly string s_nothingXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""Nothing""
- Description = """ + Environment.GetResourceString("Policy_PS_Nothing") + @""" />";
-
- private static readonly string s_skipVerificationXml =
- @"<PermissionSet class = ""System.Security.NamedPermissionSet""
- version = ""1""
- Name = ""SkipVerification""
- Description = """ + Environment.GetResourceString("Policy_PS_SkipVerification") + @""">
- <IPermission class = ""System.Security.Permissions.SecurityPermission, " + AssemblyRef.Mscorlib + @"""
- version = ""1""
- Flags = ""SkipVerification"" />
- </PermissionSet>";
-
- //
- // Built in permission set objects
- //
-
- private static NamedPermissionSet s_everything;
- private static NamedPermissionSet s_execution;
- private static NamedPermissionSet s_fullTrust;
- private static NamedPermissionSet s_internet;
- private static NamedPermissionSet s_localIntranet;
- private static NamedPermissionSet s_nothing;
- private static NamedPermissionSet s_skipVerification;
-
- //
- // Standard permission sets
- //
-
- internal static NamedPermissionSet Everything
- {
- get { return GetOrDeserializeExtendablePermissionSet(ref s_everything, s_everythingXml); }
- }
-
- internal static NamedPermissionSet Execution
- {
- get { return GetOrDeserializePermissionSet(ref s_execution, s_executionXml); }
- }
-
- internal static NamedPermissionSet FullTrust
- {
- get { return GetOrDeserializePermissionSet(ref s_fullTrust, s_fullTrustXml); }
- }
-
- internal static NamedPermissionSet Internet
- {
- get { return GetOrDeserializeExtendablePermissionSet(ref s_internet, s_internetXml); }
- }
-
- internal static NamedPermissionSet LocalIntranet
- {
- get { return GetOrDeserializeExtendablePermissionSet(ref s_localIntranet, s_localIntranetXml); }
- }
-
- internal static NamedPermissionSet Nothing
- {
- get { return GetOrDeserializePermissionSet(ref s_nothing, s_nothingXml); }
- }
-
- internal static NamedPermissionSet SkipVerification
- {
- get { return GetOrDeserializePermissionSet(ref s_skipVerification, s_skipVerificationXml); }
- }
-
- //
- // Utility methods to construct the permission set objects from the well known XML and any permission
- // set extensions if necessary
- //
-
- private static NamedPermissionSet GetOrDeserializeExtendablePermissionSet(
- ref NamedPermissionSet permissionSet,
- string permissionSetXml)
- {
- Contract.Requires(!String.IsNullOrEmpty(permissionSetXml));
- return permissionSet.Copy() as NamedPermissionSet;
- }
-
- private static NamedPermissionSet GetOrDeserializePermissionSet(ref NamedPermissionSet permissionSet,
- string permissionSetXml)
- {
- Debug.Assert(!String.IsNullOrEmpty(permissionSetXml));
- return permissionSet.Copy() as NamedPermissionSet;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/CodeAccessPermission.cs b/src/mscorlib/src/System/Security/CodeAccessPermission.cs
index 70504d902e..3dbcb33a8a 100644
--- a/src/mscorlib/src/System/Security/CodeAccessPermission.cs
+++ b/src/mscorlib/src/System/Security/CodeAccessPermission.cs
@@ -19,8 +19,8 @@ namespace System.Security
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- abstract public class CodeAccessPermission
- : IPermission, ISecurityEncodable, IStackWalk
+ internal abstract class CodeAccessPermission
+ : IPermission
{
// Static methods for manipulation of stack
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
@@ -30,28 +30,6 @@ namespace System.Security
SecurityRuntime.RevertAssert(ref stackMark);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public static void RevertDeny()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.RevertDeny(ref stackMark);
- }
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static void RevertPermitOnly()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.RevertPermitOnly(ref stackMark);
- }
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static void RevertAll()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.RevertAll(ref stackMark);
- }
-
//
// Standard implementation of IPermission methods for
// code-access permissions.
@@ -70,20 +48,6 @@ namespace System.Security
}
}
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- internal static void Demand(PermissionType permissionType)
- {
- // The intent of the method is to be an internal mscorlib helper that Demands a specific permissiontype
- // without having to create objects.
- // The security annotation fxcop rule that flags all methods with a Demand() has logic
- // which checks for methods named Demand in types that implement IPermission or IStackWalk.
- Debug.Assert(new StackFrame().GetMethod().Name.Equals("Demand"), "This method needs to be named Demand");
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCallersCaller;
- CodeAccessSecurityEngine.SpecialDemand(permissionType, ref stackMark);
- }
-
// Metadata for this method should be flaged with REQ_SQ so that
// EE can allocate space on the stack frame for FrameSecurityDescriptor
@@ -95,44 +59,6 @@ namespace System.Security
CodeAccessSecurityEngine.Assert(this, ref stackMark);
}
-
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- static internal void Assert(bool allPossible)
- {
- // The intent of the method is to be an internal mscorlib helper that easily asserts for all possible permissions
- // without having to new a PermissionSet.
- // The security annotation fxcop rule that flags all methods with an Assert() has logic
- // which checks for methods named Assert in types that implement IPermission or IStackWalk.
- Debug.Assert(new StackFrame().GetMethod().Name.Equals("Assert"), "This method needs to be named Assert");
-
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.AssertAllPossible(ref stackMark);
- }
-
- // Metadata for this method should be flaged with REQ_SQ so that
- // EE can allocate space on the stack frame for FrameSecurityDescriptor
-
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public void Deny()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- CodeAccessSecurityEngine.Deny(this, ref stackMark);
- }
-
- // Metadata for this method should be flaged with REQ_SQ so that
- // EE can allocate space on the stack frame for FrameSecurityDescriptor
-
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public void PermitOnly()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- CodeAccessSecurityEngine.PermitOnly(this, ref stackMark);
- }
-
// IPermission interfaces
// We provide a default implementation of Union here.
diff --git a/src/mscorlib/src/System/Security/CodeAccessSecurityEngine.cs b/src/mscorlib/src/System/Security/CodeAccessSecurityEngine.cs
index cd4b5fd184..1dd339b6b0 100644
--- a/src/mscorlib/src/System/Security/CodeAccessSecurityEngine.cs
+++ b/src/mscorlib/src/System/Security/CodeAccessSecurityEngine.cs
@@ -53,9 +53,6 @@ namespace System.Security {
internal static SecurityPermission AssertPermission;
internal static PermissionToken AssertPermissionToken;
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void SpecialDemand(PermissionType whatPermission, ref StackCrawlMark stackMark);
-
[System.Diagnostics.Conditional( "_DEBUG" )]
private static void DEBUG_OUT( String str )
{
@@ -330,23 +327,9 @@ namespace System.Security {
{
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern FrameSecurityDescriptor CheckNReturnSO(PermissionToken permToken,
- CodeAccessPermission demand,
- ref StackCrawlMark stackMark,
- int create );
-
internal static void Assert(CodeAccessPermission cap, ref StackCrawlMark stackMark)
{
}
- internal static void Deny(CodeAccessPermission cap, ref StackCrawlMark stackMark)
- {
- }
-
- internal static void PermitOnly(CodeAccessPermission cap, ref StackCrawlMark stackMark)
- {
- }
-
}
}
diff --git a/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs b/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
index 0b482c8316..bf544a5356 100644
--- a/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
+++ b/src/mscorlib/src/System/Security/FrameSecurityDescriptor.cs
@@ -41,18 +41,6 @@ namespace System.Security {
private bool m_assertAllPossible;
#pragma warning disable 169
private bool m_declSecComputed; // set from the VM to indicate that the declarative A/PO/D on this frame has been populated
-#pragma warning restore 169
-
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void IncrementOverridesCount();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void DecrementOverridesCount();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void IncrementAssertCount();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void DecrementAssertCount();
// Default constructor.
@@ -60,102 +48,21 @@ namespace System.Security {
{
//m_flags = 0;
}
- //-----------------------------------------------------------+
- // H E L P E R
- //-----------------------------------------------------------+
-
- private PermissionSet CreateSingletonSet(IPermission perm)
- {
- PermissionSet permSet = new PermissionSet(false);
- permSet.AddPermission(perm.Copy());
- return permSet;
- }
-
- //-----------------------------------------------------------+
- // A S S E R T
- //-----------------------------------------------------------+
-
- internal bool HasImperativeAsserts()
- {
- // we store declarative actions in both fields, so check if they are different
- return (m_assertions != null);
- }
- internal bool HasImperativeDenials()
- {
- // we store declarative actions in both fields, so check if they are different
- return (m_denials != null);
- }
- internal bool HasImperativeRestrictions()
- {
- // we store declarative actions in both fields, so check if they are different
- return (m_restriction != null);
- }
- internal void SetAssert(IPermission perm)
- {
- m_assertions = CreateSingletonSet(perm);
- IncrementAssertCount();
- }
-
- internal void SetAssert(PermissionSet permSet)
- {
- m_assertions = permSet.Copy();
- m_AssertFT = m_AssertFT || m_assertions.IsUnrestricted();
- IncrementAssertCount();
- }
internal PermissionSet GetAssertions(bool fDeclarative)
{
return (fDeclarative) ? m_DeclarativeAssertions : m_assertions;
}
- internal void SetAssertAllPossible()
- {
- m_assertAllPossible = true;
- IncrementAssertCount();
- }
-
internal bool GetAssertAllPossible()
{
return m_assertAllPossible;
}
-
- //-----------------------------------------------------------+
- // D E N Y
- //-----------------------------------------------------------+
-
- internal void SetDeny(IPermission perm)
- {
- m_denials = CreateSingletonSet(perm);
- IncrementOverridesCount();
- }
-
- internal void SetDeny(PermissionSet permSet)
- {
- m_denials = permSet.Copy();
- IncrementOverridesCount();
- }
internal PermissionSet GetDenials(bool fDeclarative)
{
return (fDeclarative) ? m_DeclarativeDenials: m_denials;
}
-
- //-----------------------------------------------------------+
- // R E S T R I C T
- //-----------------------------------------------------------+
-
- internal void SetPermitOnly(IPermission perm)
- {
- m_restriction = CreateSingletonSet(perm);
- IncrementOverridesCount();
- }
-
- internal void SetPermitOnly(PermissionSet permSet)
- {
- // permSet must not be null
- m_restriction = permSet.Copy();
- IncrementOverridesCount();
- }
internal PermissionSet GetPermitOnly(bool fDeclarative)
{
@@ -163,64 +70,6 @@ namespace System.Security {
return (fDeclarative) ? m_DeclarativeRestrictions : m_restriction;
}
- //-----------------------------------------------------------+
- // R E V E R T
- //-----------------------------------------------------------+
-
- internal void RevertAssert()
- {
- if (m_assertions != null)
- {
- m_assertions = null;
- DecrementAssertCount();
- }
-
-
- if (m_DeclarativeAssertions != null)
- {
- m_AssertFT = m_DeclarativeAssertions.IsUnrestricted();
- }
- else
- {
- m_AssertFT = false;
- }
- }
-
- internal void RevertAssertAllPossible()
- {
- if (m_assertAllPossible)
- {
- m_assertAllPossible = false;
- DecrementAssertCount();
- }
- }
-
- internal void RevertDeny()
- {
- if (HasImperativeDenials())
- {
- DecrementOverridesCount();
- m_denials = null;
- }
- }
-
- internal void RevertPermitOnly()
- {
- if (HasImperativeRestrictions())
- {
- DecrementOverridesCount();
- m_restriction= null;;
- }
- }
-
- internal void RevertAll()
- {
- RevertAssert();
- RevertAssertAllPossible();
- RevertDeny();
- RevertPermitOnly();
- }
-
//-----------------------------------------------------------+
// Demand Evaluation
diff --git a/src/mscorlib/src/System/Security/HostProtectionException.cs b/src/mscorlib/src/System/Security/HostProtectionException.cs
deleted file mode 100644
index b08fccd1b3..0000000000
--- a/src/mscorlib/src/System/Security/HostProtectionException.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-/*=============================================================================
-**
-**
-** Purpose: Exception class for HostProtection
-**
-**
-=============================================================================*/
-
-namespace System.Security
-{
- using System.Security;
- using System;
- using System.Runtime.Serialization;
- using System.Security.Permissions;
- using System.Reflection;
- using System.Text;
- using System.Diagnostics.Contracts;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- public class HostProtectionException : SystemException
- {
- private HostProtectionResource m_protected;
- private HostProtectionResource m_demanded;
-
- private const String ProtectedResourcesName = "ProtectedResources";
- private const String DemandedResourcesName = "DemandedResources";
-
- public HostProtectionException() : base()
- {
- m_protected = HostProtectionResource.None;
- m_demanded = HostProtectionResource.None;
- }
-
- public HostProtectionException(string message) : base(message)
- {
- m_protected = HostProtectionResource.None;
- m_demanded = HostProtectionResource.None;
- }
-
- public HostProtectionException(string message, Exception e) : base(message, e)
- {
- m_protected = HostProtectionResource.None;
- m_demanded = HostProtectionResource.None;
- }
-
- protected HostProtectionException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- if (info==null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- m_protected = (HostProtectionResource)info.GetValue(ProtectedResourcesName, typeof(HostProtectionResource));
- m_demanded = (HostProtectionResource)info.GetValue(DemandedResourcesName, typeof(HostProtectionResource));
- }
-
- public HostProtectionException(string message, HostProtectionResource protectedResources, HostProtectionResource demandedResources)
- : base(message)
- {
- SetErrorCode(__HResults.COR_E_HOSTPROTECTION);
- m_protected = protectedResources;
- m_demanded = demandedResources;
- }
-
- // Called from the VM to create a HP Exception
- private HostProtectionException(HostProtectionResource protectedResources, HostProtectionResource demandedResources)
- : base(SecurityException.GetResString("HostProtection_HostProtection"))
- {
- SetErrorCode(__HResults.COR_E_HOSTPROTECTION);
- m_protected = protectedResources;
- m_demanded = demandedResources;
- }
-
-
- public HostProtectionResource ProtectedResources
- {
- get
- {
- return m_protected;
- }
- }
-
- public HostProtectionResource DemandedResources
- {
- get
- {
- return m_demanded;
- }
- }
-
- private String ToStringHelper(String resourceString, Object attr)
- {
- if (attr == null)
- return String.Empty;
- StringBuilder sb = new StringBuilder();
- sb.Append(Environment.NewLine);
- sb.Append(Environment.NewLine);
- sb.Append(Environment.GetResourceString( resourceString ));
- sb.Append(Environment.NewLine);
- sb.Append(attr);
- return sb.ToString();
- }
-
- public override String ToString()
- {
- String protectedResStrValue = ToStringHelper("HostProtection_ProtectedResources", ProtectedResources);
- StringBuilder sb = new StringBuilder();
- sb.Append(base.ToString());
-
- sb.Append(protectedResStrValue);
- sb.Append(ToStringHelper("HostProtection_DemandedResources", DemandedResources));
-
- return sb.ToString();
-
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (info==null)
- throw new ArgumentNullException(nameof(info));
- Contract.EndContractBlock();
-
- base.GetObjectData( info, context );
-
- info.AddValue(ProtectedResourcesName, ProtectedResources, typeof(HostProtectionResource));
- info.AddValue(DemandedResourcesName, DemandedResources, typeof(HostProtectionResource));
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/HostSecurityManager.cs b/src/mscorlib/src/System/Security/HostSecurityManager.cs
deleted file mode 100644
index 53137983d3..0000000000
--- a/src/mscorlib/src/System/Security/HostSecurityManager.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-//
-// A HostSecurityManager gives a hosting application the chance to
-// participate in the security decisions in the AppDomain.
-//
-
-namespace System.Security
-{
- using System.Collections;
- using System.Reflection;
- using System.Security;
- using System.Security.Permissions;
- using System.Security.Policy;
- using System.Runtime.Versioning;
- using System.Diagnostics.Contracts;
-
-
- [Serializable]
- [Flags]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum HostSecurityManagerOptions {
- None = 0x0000,
- HostAppDomainEvidence = 0x0001,
- [Obsolete("AppDomain policy levels are obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- HostPolicyLevel = 0x0002,
- HostAssemblyEvidence = 0x0004,
- HostDetermineApplicationTrust = 0x0008,
- HostResolvePolicy = 0x0010,
- AllFlags = 0x001F
- }
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public class HostSecurityManager {
- public HostSecurityManager () {}
-
- // The host can choose which events he wants to participate in. This property can be set when
- // the host only cares about a subset of the capabilities exposed through the HostSecurityManager.
- public virtual HostSecurityManagerOptions Flags {
- get {
- // We use AllFlags as the default.
- return HostSecurityManagerOptions.AllFlags;
- }
- }
-
- public virtual Evidence ProvideAppDomainEvidence (Evidence inputEvidence) {
- // The default implementation does not modify the input evidence.
- return inputEvidence;
- }
-
- public virtual Evidence ProvideAssemblyEvidence (Assembly loadedAssembly, Evidence inputEvidence) {
- // The default implementation does not modify the input evidence.
- return inputEvidence;
- }
-
- /// <summary>
- /// Determine what types of evidence the host might be able to supply for the AppDomain if requested
- /// </summary>
- /// <returns></returns>
- public virtual Type[] GetHostSuppliedAppDomainEvidenceTypes() {
- return null;
- }
-
- /// <summary>
- /// Determine what types of evidence the host might be able to supply for an assembly if requested
- /// </summary>
- public virtual Type[] GetHostSuppliedAssemblyEvidenceTypes(Assembly assembly) {
- return null;
- }
-
- /// <summary>
- /// Ask the host to supply a specific type of evidence for the AppDomain
- /// </summary>
- public virtual EvidenceBase GenerateAppDomainEvidence(Type evidenceType) {
- return null;
- }
-
- /// <summary>
- /// Ask the host to supply a specific type of evidence for an assembly
- /// </summary>
- public virtual EvidenceBase GenerateAssemblyEvidence(Type evidenceType, Assembly assembly) {
- return null;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/IEvidenceFactory.cs b/src/mscorlib/src/System/Security/IEvidenceFactory.cs
deleted file mode 100644
index 592ab533be..0000000000
--- a/src/mscorlib/src/System/Security/IEvidenceFactory.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security
-{
- [System.Runtime.InteropServices.ComVisible(true)]
- public interface IEvidenceFactory
- {
- }
-}
diff --git a/src/mscorlib/src/System/Security/IPermission.cs b/src/mscorlib/src/System/Security/IPermission.cs
index 5477261fd7..cb866991ec 100644
--- a/src/mscorlib/src/System/Security/IPermission.cs
+++ b/src/mscorlib/src/System/Security/IPermission.cs
@@ -11,7 +11,7 @@ namespace System.Security
{
[System.Runtime.InteropServices.ComVisible(true)]
- public interface IPermission : ISecurityEncodable
+ internal interface IPermission
{
// NOTE: The constants that used to be defined here were moved to
// PermissionsEnum.cs due to CLS restrictions.
diff --git a/src/mscorlib/src/System/Security/ISecurityEncodable.cs b/src/mscorlib/src/System/Security/ISecurityEncodable.cs
deleted file mode 100644
index 689b3e4b5f..0000000000
--- a/src/mscorlib/src/System/Security/ISecurityEncodable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-// All encodable security classes that support encoding need to
-// implement this interface
-//
-
-namespace System.Security
-{
- [System.Runtime.InteropServices.ComVisible(true)]
- public interface ISecurityEncodable
- {
- }
-}
diff --git a/src/mscorlib/src/System/Security/ISecurityPolicyEncodable.cs b/src/mscorlib/src/System/Security/ISecurityPolicyEncodable.cs
deleted file mode 100644
index 567e41e891..0000000000
--- a/src/mscorlib/src/System/Security/ISecurityPolicyEncodable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-// All encodable security classes that support encoding need to
-// implement this interface
-//
-
-namespace System.Security
-{
- [System.Runtime.InteropServices.ComVisible(true)]
- public interface ISecurityPolicyEncodable
- {
- }
-}
diff --git a/src/mscorlib/src/System/Security/IStackWalk.cs b/src/mscorlib/src/System/Security/IStackWalk.cs
deleted file mode 100644
index 902fc35b61..0000000000
--- a/src/mscorlib/src/System/Security/IStackWalk.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security
-{
-
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface IStackWalk
- {
- [DynamicSecurityMethodAttribute()]
- void Assert();
-
- [DynamicSecurityMethodAttribute()]
- void Demand();
-
- [DynamicSecurityMethodAttribute()]
- void Deny();
-
- [DynamicSecurityMethodAttribute()]
- void PermitOnly();
- }
-}
diff --git a/src/mscorlib/src/System/Security/NamedPermissionSet.cs b/src/mscorlib/src/System/Security/NamedPermissionSet.cs
index 1bc166fde8..b139302769 100644
--- a/src/mscorlib/src/System/Security/NamedPermissionSet.cs
+++ b/src/mscorlib/src/System/Security/NamedPermissionSet.cs
@@ -14,7 +14,7 @@ namespace System.Security
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class NamedPermissionSet : PermissionSet
+ internal sealed class NamedPermissionSet : PermissionSet
{
internal static PermissionSet GetBuiltInSet(string name)
{
diff --git a/src/mscorlib/src/System/Security/PermissionListSet.cs b/src/mscorlib/src/System/Security/PermissionListSet.cs
index 75bb07c039..e6996086fc 100644
--- a/src/mscorlib/src/System/Security/PermissionListSet.cs
+++ b/src/mscorlib/src/System/Security/PermissionListSet.cs
@@ -35,110 +35,6 @@ namespace System.Security
private ArrayList m_permSetTriples;
internal PermissionListSet() {}
-
- private void EnsureTriplesListCreated()
- {
- if (m_permSetTriples == null)
- {
- m_permSetTriples = new ArrayList();
- if (m_firstPermSetTriple != null)
- {
- m_permSetTriples.Add(m_firstPermSetTriple);
- m_firstPermSetTriple = null;
- }
- }
- }
-
-
- private void Terminate(PermissionSetTriple currentTriple)
- {
- UpdateTripleListAndCreateNewTriple(currentTriple, null);
- }
-
- private void Terminate(PermissionSetTriple currentTriple, PermissionListSet pls)
- {
- this.UpdatePermissions(currentTriple, pls);
- this.UpdateTripleListAndCreateNewTriple(currentTriple, null);
- }
-
- private bool Update(PermissionSetTriple currentTriple, PermissionListSet pls)
- {
- return this.UpdatePermissions(currentTriple, pls);
- }
-
- private bool Update(PermissionSetTriple currentTriple, FrameSecurityDescriptor fsd)
- {
-
- // check imperative
- bool fHalt = Update2(currentTriple, fsd, false);
- if (!fHalt)
- {
- // then declarative
- fHalt = Update2(currentTriple, fsd, true);
- }
- return fHalt;
- }
-
-
- private bool Update2(PermissionSetTriple currentTriple, FrameSecurityDescriptor fsd, bool fDeclarative)
- {
- // Deny
- PermissionSet deniedPset = fsd.GetDenials(fDeclarative);
- if (deniedPset != null)
- {
- currentTriple.UpdateRefused(deniedPset);
- }
-
- // permit only
- PermissionSet permitOnlyPset = fsd.GetPermitOnly(fDeclarative);
- if (permitOnlyPset != null)
- {
- currentTriple.UpdateGrant(permitOnlyPset);
- }
-
- // Assert all possible
- if (fsd.GetAssertAllPossible())
- {
- // If we have no grant set, it means that the only assembly we've seen on the stack so
- // far is mscorlib. Since mscorlib will always be fully trusted, the grant set of the
- // compressed stack is also FullTrust.
- if (currentTriple.GrantSet == null)
- currentTriple.GrantSet = PermissionSet.s_fullTrust;
-
- UpdateTripleListAndCreateNewTriple(currentTriple, m_permSetTriples);
- currentTriple.GrantSet = PermissionSet.s_fullTrust;
- currentTriple.UpdateAssert(fsd.GetAssertions(fDeclarative));
- return true;
- }
-
- // Assert
- PermissionSet assertPset = fsd.GetAssertions(fDeclarative);
- if (assertPset != null)
- {
- if (assertPset.IsUnrestricted())
- {
- // If we have no grant set, it means that the only assembly we've seen on the stack so
- // far is mscorlib. Since mscorlib will always be fully trusted, the grant set of the
- // compressed stack is also FullTrust.
- if (currentTriple.GrantSet == null)
- currentTriple.GrantSet = PermissionSet.s_fullTrust;
-
- UpdateTripleListAndCreateNewTriple(currentTriple, m_permSetTriples);
- currentTriple.GrantSet = PermissionSet.s_fullTrust;
- currentTriple.UpdateAssert(assertPset);
- return true;
- }
-
- PermissionSetTriple retTriple = currentTriple.UpdateAssert(assertPset);
- if (retTriple != null)
- {
- EnsureTriplesListCreated();
- m_permSetTriples.Add(retTriple);
- }
- }
-
- return false;
- }
private void Update(PermissionSetTriple currentTriple, PermissionSet in_g, PermissionSet in_r)
{
currentTriple.UpdateGrant(in_g);
@@ -152,83 +48,6 @@ namespace System.Security
m_firstPermSetTriple = new PermissionSetTriple();
Update(m_firstPermSetTriple, in_g, null);
}
-
-
- private bool UpdatePermissions(PermissionSetTriple currentTriple, PermissionListSet pls)
- {
- if (pls != null)
- {
- if (pls.m_permSetTriples != null)
- {
- // DCS has an AGR List. So we need to add the AGR List
- UpdateTripleListAndCreateNewTriple(currentTriple,pls.m_permSetTriples);
- }
- else
- {
- // Common case: One AGR set
-
- PermissionSetTriple tmp_psTriple = pls.m_firstPermSetTriple;
- PermissionSetTriple retTriple;
- // First try and update currentTriple. Return value indicates if we can stop construction
- if (currentTriple.Update(tmp_psTriple, out retTriple))
- return true;
- // If we got a non-null retTriple, what it means is that compression failed,
- // and we now have 2 triples to deal with: retTriple and currentTriple.
- // retTriple has to be appended first. then currentTriple.
- if (retTriple != null)
- {
- EnsureTriplesListCreated();
- // we just created a new triple...add the previous one (returned) to the list
- m_permSetTriples.Add(retTriple);
- }
- }
- }
- else
- {
- // pls can be null only outside the loop in CreateCompressedState
- UpdateTripleListAndCreateNewTriple(currentTriple, null);
- }
-
-
- return false;
-
- }
-
-
- private void UpdateTripleListAndCreateNewTriple(PermissionSetTriple currentTriple, ArrayList tripleList)
- {
- if (!currentTriple.IsEmpty())
- {
- if (m_firstPermSetTriple == null && m_permSetTriples == null)
- {
- m_firstPermSetTriple = new PermissionSetTriple(currentTriple);
- }
- else
- {
- EnsureTriplesListCreated();
- m_permSetTriples.Add(new PermissionSetTriple(currentTriple));
- }
- currentTriple.Reset();
- }
- if (tripleList != null)
- {
- EnsureTriplesListCreated();
- m_permSetTriples.AddRange(tripleList);
- }
- }
-
- private static void UpdateArrayList(ArrayList current, ArrayList newList)
- {
- if (newList == null)
- return;
-
- for(int i=0;i < newList.Count; i++)
- {
- if (!current.Contains(newList[i]))
- current.Add(newList[i]);
- }
-
- }
// Private Demand evaluation functions - only called from the VM
internal bool CheckDemandNoThrow(CodeAccessPermission demand)
@@ -255,95 +74,6 @@ namespace System.Security
return m_firstPermSetTriple.CheckSetDemandNoThrow(pSet);
}
- // Demand evauation functions
- internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
- {
- bool bRet = SecurityRuntime.StackContinue;
- if (m_permSetTriples != null)
- {
- for (int i=0; (i < m_permSetTriples.Count && bRet != SecurityRuntime.StackHalt) ; i++)
- {
- PermissionSetTriple psTriple = (PermissionSetTriple)m_permSetTriples[i];
- bRet = psTriple.CheckDemand(demand, permToken, rmh);
- }
- }
- else if (m_firstPermSetTriple != null)
- {
- bRet = m_firstPermSetTriple.CheckDemand(demand, permToken, rmh);
- }
-
- return bRet;
- }
-
- internal bool CheckSetDemand(PermissionSet pset , RuntimeMethodHandleInternal rmh)
- {
- PermissionSet unused;
- CheckSetDemandWithModification(pset, out unused, rmh);
- return SecurityRuntime.StackHalt; // CS demand check always terminates the stackwalk
- }
-
- internal bool CheckSetDemandWithModification(PermissionSet pset, out PermissionSet alteredDemandSet, RuntimeMethodHandleInternal rmh)
- {
- bool bRet = SecurityRuntime.StackContinue;
- PermissionSet demandSet = pset;
- alteredDemandSet = null;
- if (m_permSetTriples != null)
- {
- for (int i=0; (i < m_permSetTriples.Count && bRet != SecurityRuntime.StackHalt) ; i++)
- {
- PermissionSetTriple psTriple = (PermissionSetTriple)m_permSetTriples[i];
- bRet = psTriple.CheckSetDemand(demandSet, out alteredDemandSet, rmh);
- if (alteredDemandSet != null)
- demandSet = alteredDemandSet;
- }
- }
- else if (m_firstPermSetTriple != null)
- {
- bRet = m_firstPermSetTriple.CheckSetDemand(demandSet, out alteredDemandSet, rmh);
- }
-
- return bRet;
- }
-
- /// <summary>
- /// Check to see if the PLS satisfies a demand for the special permissions encoded in flags
- /// </summary>
- /// <param name="flags">set of flags to check (See PermissionType)</param>
- private bool CheckFlags(int flags)
- {
- Debug.Assert(flags != 0, "Invalid permission flag demand");
-
- bool check = true;
-
- if (m_permSetTriples != null)
- {
- for (int i = 0; i < m_permSetTriples.Count && check && flags != 0; i++)
- {
- check &= ((PermissionSetTriple)m_permSetTriples[i]).CheckFlags(ref flags);
- }
- }
- else if (m_firstPermSetTriple != null)
- {
- check = m_firstPermSetTriple.CheckFlags(ref flags);
- }
-
- return check;
- }
-
- /// <summary>
- /// Demand which succeeds if either a set of special permissions or a permission set is granted
- /// to the call stack
- /// </summary>
- /// <param name="flags">set of flags to check (See PermissionType)</param>
- /// <param name="grantSet">alternate permission set to check</param>
- internal void DemandFlagsOrGrantSet(int flags, PermissionSet grantSet)
- {
- if (CheckFlags(flags))
- return;
-
- CheckSetDemand(grantSet, RuntimeMethodHandleInternal.EmptyHandle);
- }
-
}
}
diff --git a/src/mscorlib/src/System/Security/PermissionSet.cs b/src/mscorlib/src/System/Security/PermissionSet.cs
index 4b05969142..f7297229ef 100644
--- a/src/mscorlib/src/System/Security/PermissionSet.cs
+++ b/src/mscorlib/src/System/Security/PermissionSet.cs
@@ -21,18 +21,8 @@ namespace System.Security {
using System.Diagnostics;
using System.Diagnostics.Contracts;
- [Serializable]
- internal enum SpecialPermissionSetFlag
- {
- // These also appear in clr/src/vm/permset.h
- Regular = 0,
- NoSet = 1,
- EmptySet = 2,
- SkipVerification = 3
- }
-
[System.Runtime.InteropServices.ComVisible(true)]
- public class PermissionSet : ISecurityEncodable, ICollection, IStackWalk
+ internal class PermissionSet : ICollection
{
#if _DEBUG
internal static readonly bool debug;
@@ -44,22 +34,6 @@ namespace System.Security {
if (debug) Console.WriteLine(str);
#endif
}
-
- [System.Diagnostics.Conditional( "_DEBUG" )]
- private static void DEBUG_COND_WRITE(bool exp, String str)
- {
- #if _DEBUG
- if (debug && (exp)) Console.WriteLine(str);
- #endif
- }
-
- [System.Diagnostics.Conditional( "_DEBUG" )]
- private static void DEBUG_PRINTSTACK(Exception e)
- {
- #if _DEBUG
- if (debug) Console.WriteLine((e).StackTrace);
- #endif
- }
// These members are accessed from EE using their hardcoded offset.
// Please update the PermissionSetObject in object.h if you make any changes
@@ -186,13 +160,6 @@ namespace System.Security {
array.SetValue(enumerator.Current , index++ );
}
}
-
-
- // private constructor that doesn't create any token based sets
- private PermissionSet( Object trash, Object junk )
- {
- m_Unrestricted = false;
- }
// Returns an object appropriate for synchronizing access to this
@@ -500,12 +467,6 @@ namespace System.Security {
return true;
}
- public bool IsSubsetOf(PermissionSet target)
- {
- IPermission perm;
- return IsSubsetOfHelper(target, IsSubsetOfType.Normal, out perm, false);
- }
-
internal bool CheckDemand(PermissionSet target, out IPermission firstPermThatFailed)
{
return IsSubsetOfHelper(target, IsSubsetOfType.CheckDemand, out firstPermThatFailed, true);
@@ -702,97 +663,6 @@ namespace System.Security {
throw savedException;
}
- public PermissionSet Intersect(PermissionSet other)
- {
- if (other == null || other.FastIsEmpty() || this.FastIsEmpty())
- {
- return null;
- }
-
- int thisMax = this.m_permSet == null ? -1 : this.m_permSet.GetMaxUsedIndex();
- int otherMax = other.m_permSet == null ? -1 : other.m_permSet.GetMaxUsedIndex();
- int minMax = thisMax < otherMax ? thisMax : otherMax;
-
- if (this.IsUnrestricted() && minMax < otherMax)
- {
- minMax = otherMax;
- this.CheckSet();
- }
-
- if (other.IsUnrestricted() && minMax < thisMax)
- {
- minMax = thisMax;
- other.CheckSet();
- }
-
- PermissionSet pset = new PermissionSet( false );
-
- if (minMax > -1)
- {
- pset.m_permSet = new TokenBasedSet();
- }
-
- for (int i = 0; i <= minMax; ++i)
- {
- Object thisObj = this.m_permSet.GetItem( i );
- IPermission thisPerm = thisObj as IPermission;
- Object otherObj = other.m_permSet.GetItem( i );
- IPermission otherPerm = otherObj as IPermission;
-
- if (thisObj == null && otherObj == null)
- continue;
-
- if (thisObj == null)
- {
- if (this.m_Unrestricted)
- {
- if (otherPerm != null)
- {
- PermissionToken token = (PermissionToken)PermissionToken.s_tokenSet.GetItem( i );
- if ((token.m_type & PermissionTokenType.IUnrestricted) != 0)
- {
- pset.m_permSet.SetItem( i, otherPerm.Copy() );
- Debug.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
- }
- }
- }
- }
- else if (otherObj == null)
- {
- if (other.m_Unrestricted)
- {
- if (thisPerm != null)
- {
- PermissionToken token = (PermissionToken)PermissionToken.s_tokenSet.GetItem( i );
- if ((token.m_type & PermissionTokenType.IUnrestricted) != 0)
- {
- pset.m_permSet.SetItem( i, thisPerm.Copy() );
- Debug.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
- }
- }
- }
- }
- else
- {
- IPermission intersectPerm;
- if (thisPerm == null)
- intersectPerm = otherPerm;
- else if(otherPerm == null)
- intersectPerm = thisPerm;
- else
- intersectPerm = thisPerm.Intersect( otherPerm );
- pset.m_permSet.SetItem( i, intersectPerm );
- Debug.Assert( intersectPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" );
- }
- }
-
- pset.m_Unrestricted = this.m_Unrestricted && other.m_Unrestricted;
- if (pset.FastIsEmpty())
- return null;
- else
- return pset;
- }
-
internal void InplaceUnion( PermissionSet other )
{
// Unions the "other" PermissionSet into this one. It can be optimized to do less copies than
@@ -962,45 +832,6 @@ namespace System.Security {
return pset;
}
- // Treating the current permission set as a grant set, and the input set as
- // a set of permissions to be denied, try to cancel out as many permissions
- // from both sets as possible. For a first cut, any granted permission that
- // is a safe subset of the corresponding denied permission can result in
- // that permission being removed from both sides.
-
- internal void MergeDeniedSet(PermissionSet denied)
- {
- if (denied == null || denied.FastIsEmpty() || this.FastIsEmpty())
- return;
-
- m_CheckedForNonCas = false;
-
- // Check for the unrestricted case: FastIsEmpty() will return false if the PSet is unrestricted, but has no items
- if (this.m_permSet == null || denied.m_permSet == null)
- return; //nothing can be removed
-
- int maxIndex = denied.m_permSet.GetMaxUsedIndex() > this.m_permSet.GetMaxUsedIndex() ? this.m_permSet.GetMaxUsedIndex() : denied.m_permSet.GetMaxUsedIndex();
- for (int i = 0; i <= maxIndex; ++i) {
- IPermission deniedPerm = denied.m_permSet.GetItem(i) as IPermission;
- if (deniedPerm == null)
- continue;
-
- IPermission thisPerm = this.m_permSet.GetItem(i) as IPermission;
-
- if (thisPerm == null && !this.m_Unrestricted) {
- denied.m_permSet.SetItem(i, null);
- continue;
- }
-
- if (thisPerm != null && deniedPerm != null) {
- if (thisPerm.IsSubsetOf(deniedPerm)) {
- this.m_permSet.SetItem(i, null);
- denied.m_permSet.SetItem(i, null);
- }
- }
- }
- }
-
// Returns true if perm is contained in this
internal bool Contains(IPermission perm)
{
@@ -1152,29 +983,6 @@ namespace System.Security {
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
SecurityRuntime.Assert(this, ref stackMark);
}
-
- // Metadata for this method should be flaged with REQ_SQ so that
- // EE can allocate space on the stack frame for FrameSecurityDescriptor
-
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- [Obsolete("Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")]
- public void Deny()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.Deny(this, ref stackMark);
- }
-
- // Metadata for this method should be flaged with REQ_SQ so that
- // EE can allocate space on the stack frame for FrameSecurityDescriptor
-
- [DynamicSecurityMethodAttribute()]
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public void PermitOnly()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.PermitOnly(this, ref stackMark);
- }
internal IPermission GetFirstPerm()
{
@@ -1190,13 +998,6 @@ namespace System.Security {
return new PermissionSet(this);
}
- internal PermissionSet CopyWithNoIdentityPermissions()
- {
- // Explicitly make a new PermissionSet, rather than copying, since we may have a
- // ReadOnlyPermissionSet which cannot have identity permissions removed from it in a true copy.
- return new PermissionSet(this);
- }
-
public IEnumerator GetEnumerator()
{
return GetEnumeratorImpl();
@@ -1212,32 +1013,6 @@ namespace System.Security {
return new PermissionSetEnumeratorInternal(this);
}
- private void NormalizePermissionSet()
- {
- // This function guarantees that all the permissions are placed at
- // the proper index within the token based sets. This becomes necessary
- // since these indices are dynamically allocated based on usage order.
-
- PermissionSet permSetTemp = new PermissionSet(false);
-
- permSetTemp.m_Unrestricted = this.m_Unrestricted;
-
- // Move all the normal permissions to the new permission set
-
- if (this.m_permSet != null)
- {
- for (int i = m_permSet.GetStartingIndex(); i <= this.m_permSet.GetMaxUsedIndex(); ++i)
- {
- Object obj = this.m_permSet.GetItem(i);
- IPermission perm = obj as IPermission;
- if (perm != null)
- permSetTemp.SetPermission( perm );
- }
- }
-
- this.m_permSet = permSetTemp.m_permSet;
- }
-
private void DecodeAllPermissions()
{
if (m_permSet == null)
@@ -1449,70 +1224,6 @@ namespace System.Security {
return null;
}
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
- public static void RevertAssert()
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- SecurityRuntime.RevertAssert(ref stackMark);
- }
-
- internal static PermissionSet RemoveRefusedPermissionSet(PermissionSet assertSet, PermissionSet refusedSet, out bool bFailedToCompress)
- {
- Debug.Assert((assertSet == null || !assertSet.IsUnrestricted()), "Cannot be unrestricted here");
- PermissionSet retPs = null;
- bFailedToCompress = false;
- if (assertSet == null)
- return null;
- if (refusedSet != null)
- {
- if (refusedSet.IsUnrestricted())
- return null; // we're refusing everything...cannot assert anything now.
-
- PermissionSetEnumeratorInternal enumerator = new PermissionSetEnumeratorInternal(refusedSet);
- while (enumerator.MoveNext())
- {
- CodeAccessPermission refusedPerm = (CodeAccessPermission)enumerator.Current;
- int i = enumerator.GetCurrentIndex();
- if (refusedPerm != null)
- {
- CodeAccessPermission perm
- = (CodeAccessPermission)assertSet.GetPermission(i);
- try
- {
- if (refusedPerm.Intersect(perm) != null)
- {
- if (refusedPerm.Equals(perm))
- {
- if (retPs == null)
- retPs = assertSet.Copy();
-
- retPs.RemovePermission(i);
- }
- else
- {
- // Asserting a permission, part of which is already denied/refused
- // cannot compress this assert
- bFailedToCompress = true;
- return assertSet;
- }
- }
- }
- catch (ArgumentException)
- {
- // Any exception during removing a refused set from assert set => we play it safe and not assert that perm
- if (retPs == null)
- retPs = assertSet.Copy();
- retPs.RemovePermission(i);
- }
- }
- }
- }
- if (retPs != null)
- return retPs;
- return assertSet;
- }
-
internal static void RemoveAssertedPermissionSet(PermissionSet demandSet, PermissionSet assertSet, out PermissionSet alteredDemandSet)
{
Debug.Assert(!assertSet.IsUnrestricted(), "Cannot call this function if assertSet is unrestricted");
@@ -1544,45 +1255,5 @@ namespace System.Security {
}
return;
}
-
- internal static bool IsIntersectingAssertedPermissions(PermissionSet assertSet1, PermissionSet assertSet2)
- {
- bool isIntersecting = false;
- if (assertSet1 != null && assertSet2 != null)
- {
- PermissionSetEnumeratorInternal enumerator = new PermissionSetEnumeratorInternal(assertSet2);
- while (enumerator.MoveNext())
- {
- CodeAccessPermission perm2 = (CodeAccessPermission)enumerator.Current;
- int i = enumerator.GetCurrentIndex();
- if (perm2 != null)
- {
- CodeAccessPermission perm1
- = (CodeAccessPermission)assertSet1.GetPermission(i);
- try
- {
- if (perm1 != null && !perm1.Equals(perm2))
- {
- isIntersecting = true; // Same type of permission, but with different flags or something - cannot union them
- }
- }
- catch (ArgumentException)
- {
- isIntersecting = true; //assume worst case
- }
- }
- }
- }
- return isIntersecting;
-
- }
-
- // This is a workaround so that SQL can operate under default policy without actually
- // granting permissions in assemblies that they disallow.
-
- internal bool IgnoreTypeLoadFailures
- {
- set { m_ignoreTypeLoadFailures = value; }
- }
}
}
diff --git a/src/mscorlib/src/System/Security/PermissionSetTriple.cs b/src/mscorlib/src/System/Security/PermissionSetTriple.cs
index 56eb22996e..c04103b97c 100644
--- a/src/mscorlib/src/System/Security/PermissionSetTriple.cs
+++ b/src/mscorlib/src/System/Security/PermissionSetTriple.cs
@@ -26,8 +26,6 @@ namespace System.Security
[Serializable]
sealed internal class PermissionSetTriple
{
- static private volatile PermissionToken s_zoneToken;
- static private volatile PermissionToken s_urlToken;
internal PermissionSet AssertSet;
internal PermissionSet GrantSet;
internal PermissionSet RefusedSet;
@@ -35,111 +33,12 @@ namespace System.Security
{
Reset();
}
- internal PermissionSetTriple(PermissionSetTriple triple)
- {
- this.AssertSet = triple.AssertSet;
- this.GrantSet = triple.GrantSet;
- this.RefusedSet = triple.RefusedSet;
- }
internal void Reset()
{
AssertSet = null;
GrantSet = null;
RefusedSet = null;
}
- internal bool IsEmpty()
- {
- return (AssertSet == null && GrantSet == null && RefusedSet == null);
- }
-
- private PermissionToken ZoneToken
- {
- get
- {
- if (s_zoneToken == null)
- s_zoneToken = PermissionToken.GetToken(typeof(ZoneIdentityPermission));
- return s_zoneToken;
- }
- }
- private PermissionToken UrlToken
- {
- get
- {
- if (s_urlToken == null)
- s_urlToken = PermissionToken.GetToken(typeof(UrlIdentityPermission));
- return s_urlToken;
- }
- }
- internal bool Update(PermissionSetTriple psTriple, out PermissionSetTriple retTriple)
- {
- retTriple = null;
- retTriple = UpdateAssert(psTriple.AssertSet);
- // Special case: unrestricted assert. Note: dcs.Assert.IsUnrestricted => dcs.Grant.IsUnrestricted
- if (psTriple.AssertSet != null && psTriple.AssertSet.IsUnrestricted())
- {
- return true; // stop construction
- }
- UpdateGrant(psTriple.GrantSet);
- UpdateRefused(psTriple.RefusedSet);
- return false;
- }
-
- internal PermissionSetTriple UpdateAssert(PermissionSet in_a)
- {
- PermissionSetTriple retTriple = null;
- if (in_a != null)
- {
- Debug.Assert((!in_a.IsUnrestricted() || RefusedSet == null), "Cannot be unrestricted or refused must be null");
- // if we're already asserting in_a, nothing to do
- if (in_a.IsSubsetOf(AssertSet))
- return null;
-
- PermissionSet retPs;
- if (GrantSet != null)
- retPs = in_a.Intersect(GrantSet); // Restrict the assert to what we've already been granted
- else
- {
- GrantSet = new PermissionSet(true);
- retPs = in_a.Copy(); // Currently unrestricted Grant: assert the whole assert set
- }
- bool bFailedToCompress = false;
- // removes anything that is already in the refused set from the assert set
- if (RefusedSet != null)
- {
- retPs = PermissionSet.RemoveRefusedPermissionSet(retPs, RefusedSet, out bFailedToCompress);
- }
- if (!bFailedToCompress)
- bFailedToCompress = PermissionSet.IsIntersectingAssertedPermissions(retPs, AssertSet);
- if (bFailedToCompress)
- {
- retTriple = new PermissionSetTriple(this);
- this.Reset();
- this.GrantSet = retTriple.GrantSet.Copy();
- }
-
- if (AssertSet == null)
- AssertSet = retPs;
- else
- AssertSet.InplaceUnion(retPs);
-
- }
- return retTriple;
- }
- internal void UpdateGrant(PermissionSet in_g, out ZoneIdentityPermission z,out UrlIdentityPermission u)
- {
- z = null;
- u = null;
- if (in_g != null)
- {
- if (GrantSet == null)
- GrantSet = in_g.Copy();
- else
- GrantSet.InplaceIntersect(in_g);
-
- z = (ZoneIdentityPermission)in_g.GetPermission(ZoneToken);
- u = (UrlIdentityPermission)in_g.GetPermission(UrlToken);
- }
- }
internal void UpdateGrant(PermissionSet in_g)
{
@@ -161,74 +60,6 @@ namespace System.Security
RefusedSet.InplaceUnion(in_r);
}
}
-
-
- static bool CheckAssert(PermissionSet pSet, CodeAccessPermission demand, PermissionToken permToken)
- {
- if (pSet != null)
- {
- pSet.CheckDecoded(demand, permToken);
-
- CodeAccessPermission perm = (CodeAccessPermission)pSet.GetPermission(demand);
-
- // If the assert set does contain the demanded permission, halt the stackwalk
-
- try
- {
- if (pSet.IsUnrestricted() || demand.CheckAssert(perm))
- {
- return SecurityRuntime.StackHalt;
- }
- }
- catch (ArgumentException)
- {
- }
- }
- return SecurityRuntime.StackContinue;
- }
-
- static bool CheckAssert(PermissionSet assertPset, PermissionSet demandSet, out PermissionSet newDemandSet)
- {
- newDemandSet = null;
- if (assertPset!= null)
- {
- assertPset.CheckDecoded(demandSet);
- // If this frame asserts a superset of the demand set we're done
-
- if (demandSet.CheckAssertion(assertPset))
- return SecurityRuntime.StackHalt;
- PermissionSet.RemoveAssertedPermissionSet(demandSet, assertPset, out newDemandSet);
- }
- return SecurityRuntime.StackContinue;
- }
-
-
- internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
- {
- if (CheckAssert(AssertSet, demand, permToken) == SecurityRuntime.StackHalt)
- return SecurityRuntime.StackHalt;
-
-#pragma warning disable 618
- CodeAccessSecurityEngine.CheckHelper(GrantSet, RefusedSet, demand, permToken, rmh, null, SecurityAction.Demand, true);
-#pragma warning restore 618
-
- return SecurityRuntime.StackContinue;
- }
- internal bool CheckSetDemand(PermissionSet demandSet , out PermissionSet alteredDemandset, RuntimeMethodHandleInternal rmh)
- {
- alteredDemandset = null;
-
- if (CheckAssert(AssertSet, demandSet, out alteredDemandset) == SecurityRuntime.StackHalt)
- return SecurityRuntime.StackHalt;
- if (alteredDemandset != null)
- demandSet = alteredDemandset; // note that this does not modify demandSet external to this function.
-#pragma warning disable 618
- CodeAccessSecurityEngine.CheckSetHelper(GrantSet, RefusedSet, demandSet, rmh, null, SecurityAction.Demand, true);
-#pragma warning restore 618
-
- return SecurityRuntime.StackContinue;
-
- }
internal bool CheckDemandNoThrow(CodeAccessPermission demand, PermissionToken permToken)
{
@@ -245,25 +76,6 @@ namespace System.Security
return CodeAccessSecurityEngine.CheckSetHelper(GrantSet, RefusedSet, demandSet, RuntimeMethodHandleInternal.EmptyHandle, null, SecurityAction.Demand, false);
#pragma warning restore 618
}
- /// <summary>
- /// Check to see if the triple satisfies a demand for the permission represented by the flag.
- /// </summary>
- /// <remarks>
- /// If the triple asserts for one of the bits in the flags, it is zeroed out.
- /// </remarks>
- /// <param name="flags">set of flags to check (See PermissionType)</param>
- internal bool CheckFlags(ref int flags)
- {
- if (AssertSet != null)
- {
- // remove any permissions which were asserted for
- int assertFlags = SecurityManager.GetSpecialFlags(AssertSet, null);
- if ((flags & assertFlags) != 0)
- flags = flags & ~assertFlags;
- }
-
- return (SecurityManager.GetSpecialFlags(GrantSet, RefusedSet) & flags) == flags;
- }
}
}
diff --git a/src/mscorlib/src/System/Security/PermissionToken.cs b/src/mscorlib/src/System/Security/PermissionToken.cs
index 5c6a322c1c..e767446a25 100644
--- a/src/mscorlib/src/System/Security/PermissionToken.cs
+++ b/src/mscorlib/src/System/Security/PermissionToken.cs
@@ -88,7 +88,7 @@ namespace System.Security
}
[Serializable]
- internal sealed class PermissionToken : ISecurityEncodable
+ internal sealed class PermissionToken
{
private static readonly PermissionTokenFactory s_theTokenFactory;
private const string c_mscorlibName = System.CoreLib.Name;
@@ -96,32 +96,6 @@ namespace System.Security
internal volatile PermissionTokenType m_type;
static internal TokenBasedSet s_tokenSet = new TokenBasedSet();
- internal static bool IsMscorlibClassName (string className) {
- Debug.Assert( c_mscorlibName == ((RuntimeAssembly)Assembly.GetExecutingAssembly()).GetSimpleName(),
- System.CoreLib.Name+" name mismatch" );
-
- // If the class name does not look like a fully qualified name, we cannot simply determine if it's
- // an mscorlib.dll type so we should return true so the type can be matched with the
- // right index in the TokenBasedSet.
- int index = className.IndexOf(',');
- if (index == -1)
- return true;
-
- index = className.LastIndexOf(']');
- if (index == -1)
- index = 0;
-
- // Search for the string 'mscorlib' in the classname. If we find it, we will conservatively assume it's an mscorlib.dll type and load it.
- for (int i = index; i < className.Length; i++) {
- if (className[i] == 's' || className[i] == 'S')
- {
- if (String.Compare(className, i, c_mscorlibName, 0, c_mscorlibName.Length, StringComparison.OrdinalIgnoreCase) == 0)
- return true;
- }
- }
- return false;
- }
-
static PermissionToken()
{
s_theTokenFactory = new PermissionTokenFactory( 4 );
@@ -137,14 +111,6 @@ namespace System.Security
m_type = type;
}
- public static PermissionToken GetToken(Type cls)
- {
- if (cls == null)
- return null;
-
- return s_theTokenFactory.GetToken(cls, null);
- }
-
public static PermissionToken GetToken(IPermission perm)
{
if (perm == null)
@@ -157,27 +123,6 @@ namespace System.Security
else
return s_theTokenFactory.GetToken(perm.GetType(), perm);
}
-
- public static PermissionToken FindTokenByIndex( int i )
- {
- return s_theTokenFactory.FindTokenByIndex( i );
- }
-
- public static bool IsTokenProperlyAssigned( IPermission perm, PermissionToken token )
- {
- PermissionToken heldToken = GetToken( perm );
- if (heldToken.m_index != token.m_index)
- return false;
-
- if (token.m_type != heldToken.m_type)
- return false;
-
- if (perm.GetType().Module.Assembly == Assembly.GetExecutingAssembly() &&
- heldToken.m_index >= BuiltInPermissionIndex.NUM_BUILTIN_NORMAL + BuiltInPermissionIndex.NUM_BUILTIN_UNRESTRICTED)
- return false;
-
- return true;
- }
}
// Package access only
@@ -211,22 +156,6 @@ namespace System.Security
m_indexTable = new Hashtable(size);
}
- internal PermissionToken FindTokenByIndex( int i )
- {
- PermissionToken token;
-
- if (i < BuiltInPermissionIndex.NUM_BUILTIN_NORMAL + BuiltInPermissionIndex.NUM_BUILTIN_UNRESTRICTED)
- {
- token = BuiltInGetToken( i, null, null );
- }
- else
- {
- token = (PermissionToken)m_indexTable[i];
- }
-
- return token;
- }
-
internal PermissionToken GetToken(Type cls, IPermission perm)
{
Debug.Assert( cls != null, "Must pass in valid type" );
@@ -301,34 +230,6 @@ namespace System.Security
return (PermissionToken)tok;
}
- internal PermissionToken GetToken(String typeStr)
- {
- Object tok = null;
- tok = m_tokenTable != null ? m_tokenTable[typeStr] : null; // Assumes asynchronous lookups are safe
- if (tok == null)
- {
- lock (this)
- {
- if (m_tokenTable != null)
- {
- tok = m_tokenTable[typeStr]; // Make sure it wasn't just added
- }
- else
- m_tokenTable = new Hashtable(m_size, 1.0f, new PermissionTokenKeyComparer());
-
- if (tok == null)
- {
- tok = new PermissionToken( m_index++, PermissionTokenType.DontKnow, typeStr );
- m_tokenTable.Add(typeStr, tok);
- m_indexTable.Add(m_index - 1, tok);
- PermissionToken.s_tokenSet.SetItem(((PermissionToken)tok).m_index, tok);
- }
- }
- }
-
- return (PermissionToken)tok;
- }
-
internal PermissionToken BuiltInGetToken( int index, IPermission perm, Type cls )
{
PermissionToken token = Volatile.Read(ref m_builtIn[index]);
diff --git a/src/mscorlib/src/System/Security/Permissions/EnvironmentPermission.cs b/src/mscorlib/src/System/Security/Permissions/EnvironmentPermission.cs
index 567fe513c0..285e8515c0 100644
--- a/src/mscorlib/src/System/Security/Permissions/EnvironmentPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/EnvironmentPermission.cs
@@ -5,7 +5,6 @@
namespace System.Security.Permissions {
using System.Security;
using System;
- using SecurityElement = System.Security.SecurityElement;
using System.Security.Util;
using System.IO;
using System.Globalization;
@@ -14,7 +13,7 @@ namespace System.Security.Permissions {
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum EnvironmentPermissionAccess
+ internal enum EnvironmentPermissionAccess
{
NoAccess = 0x00,
Read = 0x01,
@@ -30,11 +29,6 @@ namespace System.Security.Permissions {
{
}
- public EnvironmentStringExpressionSet( String str )
- : base( true, str, false )
- {
- }
-
protected override StringExpressionSet CreateNewEmpty()
{
return new EnvironmentStringExpressionSet();
@@ -66,7 +60,7 @@ namespace System.Security.Permissions {
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- sealed public class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
+ sealed internal class EnvironmentPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
private StringExpressionSet m_read;
private StringExpressionSet m_write;
@@ -121,34 +115,6 @@ namespace System.Security.Permissions {
}
}
-
- public String GetPathList( EnvironmentPermissionAccess flag )
- {
- VerifyFlag( flag );
- ExclusiveFlag( flag );
-
- if (FlagIsSet( flag, EnvironmentPermissionAccess.Read ))
- {
- if (m_read == null)
- {
- return "";
- }
- return m_read.ToString();
- }
-
- if (FlagIsSet( flag, EnvironmentPermissionAccess.Write ))
- {
- if (m_write == null)
- {
- return "";
- }
- return m_write.ToString();
- }
-
- /* not reached */
-
- return "";
- }
private void VerifyFlag( EnvironmentPermissionAccess flag )
@@ -157,20 +123,6 @@ namespace System.Security.Permissions {
throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)flag));
Contract.EndContractBlock();
}
-
- private void ExclusiveFlag( EnvironmentPermissionAccess flag )
- {
- if (flag == EnvironmentPermissionAccess.NoAccess)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
-
- if (((int)flag & ((int)flag-1)) != 0)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
- Contract.EndContractBlock();
- }
private bool FlagIsSet( EnvironmentPermissionAccess flag, EnvironmentPermissionAccess question )
diff --git a/src/mscorlib/src/System/Security/Permissions/FileDialogPermission.cs b/src/mscorlib/src/System/Security/Permissions/FileDialogPermission.cs
index 98a7d54c68..17182b7d2c 100644
--- a/src/mscorlib/src/System/Security/Permissions/FileDialogPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/FileDialogPermission.cs
@@ -17,7 +17,7 @@ namespace System.Security.Permissions {
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum FileDialogPermissionAccess {
+ internal enum FileDialogPermissionAccess {
None = 0x00,
Open = 0x01,
@@ -30,7 +30,7 @@ namespace System.Security.Permissions {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
+ internal sealed class FileDialogPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
FileDialogPermissionAccess access;
public FileDialogPermission(PermissionState state) {
diff --git a/src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs b/src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs
index 341c26ac22..cd5209fc9e 100644
--- a/src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/FileIOPermission.cs
@@ -20,7 +20,7 @@ namespace System.Security.Permissions
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum FileIOPermissionAccess
+ internal enum FileIOPermissionAccess
{
NoAccess = 0x00,
Read = 0x01,
@@ -32,7 +32,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- sealed public class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
+ internal sealed class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
private FileIOAccess m_read;
private FileIOAccess m_write;
@@ -67,79 +67,6 @@ namespace System.Security.Permissions
String[] pathList = new String[] { path };
AddPathList( access, pathList, false, true, false );
}
-
- public FileIOPermission( FileIOPermissionAccess access, String[] pathList )
- {
- VerifyAccess( access );
-
- AddPathList( access, pathList, false, true, false );
- }
-
- internal FileIOPermission( FileIOPermissionAccess access, String[] pathList, bool checkForDuplicates, bool needFullPath )
- {
- VerifyAccess( access );
-
- AddPathList( access, pathList, checkForDuplicates, needFullPath, true );
- }
-
- public void SetPathList( FileIOPermissionAccess access, String path )
- {
- String[] pathList;
- if(path == null)
- pathList = new String[] {};
- else
- pathList = new String[] { path };
- SetPathList( access, pathList, false );
- }
-
- public void SetPathList( FileIOPermissionAccess access, String[] pathList )
- {
- SetPathList( access, pathList, true );
- }
-
- internal void SetPathList( FileIOPermissionAccess access,
- String[] pathList, bool checkForDuplicates )
- {
- SetPathList( access, AccessControlActions.None, pathList, checkForDuplicates );
- }
-
- internal void SetPathList( FileIOPermissionAccess access, AccessControlActions control, String[] pathList, bool checkForDuplicates )
- {
- VerifyAccess( access );
-
- if ((access & FileIOPermissionAccess.Read) != 0)
- m_read = null;
-
- if ((access & FileIOPermissionAccess.Write) != 0)
- m_write = null;
-
- if ((access & FileIOPermissionAccess.Append) != 0)
- m_append = null;
-
- if ((access & FileIOPermissionAccess.PathDiscovery) != 0)
- m_pathDiscovery = null;
-
- m_viewAcl = null;
- m_changeAcl = null;
- m_unrestricted = false;
-
- AddPathList( access, pathList, checkForDuplicates, true, true );
- }
-
- public void AddPathList( FileIOPermissionAccess access, String path )
- {
- String[] pathList;
- if(path == null)
- pathList = new String[] {};
- else
- pathList = new String[] { path };
- AddPathList( access, pathList, false, true, false );
- }
-
- public void AddPathList( FileIOPermissionAccess access, String[] pathList )
- {
- AddPathList( access, pathList, true, true, true );
- }
internal void AddPathList( FileIOPermissionAccess access, String[] pathListOrig, bool checkForDuplicates, bool needFullPath, bool copyPathList )
{
@@ -219,141 +146,6 @@ namespace System.Security.Permissions
m_pathDiscovery.AddExpressions( pathArrayList, checkForDuplicates);
}
}
-
- public String[] GetPathList( FileIOPermissionAccess access )
- {
- VerifyAccess( access );
- ExclusiveAccess( access );
-
- if (AccessIsSet( access, FileIOPermissionAccess.Read ))
- {
- if (m_read == null)
- {
- return null;
- }
- return m_read.ToStringArray();
- }
-
- if (AccessIsSet( access, FileIOPermissionAccess.Write ))
- {
- if (m_write == null)
- {
- return null;
- }
- return m_write.ToStringArray();
- }
-
- if (AccessIsSet( access, FileIOPermissionAccess.Append ))
- {
- if (m_append == null)
- {
- return null;
- }
- return m_append.ToStringArray();
- }
-
- if (AccessIsSet( access, FileIOPermissionAccess.PathDiscovery ))
- {
- if (m_pathDiscovery == null)
- {
- return null;
- }
- return m_pathDiscovery.ToStringArray();
- }
-
- // not reached
-
- return null;
- }
-
- public FileIOPermissionAccess AllLocalFiles
- {
- get
- {
- if (m_unrestricted)
- return FileIOPermissionAccess.AllAccess;
-
- FileIOPermissionAccess access = FileIOPermissionAccess.NoAccess;
-
- if (m_read != null && m_read.AllLocalFiles)
- {
- access |= FileIOPermissionAccess.Read;
- }
-
- if (m_write != null && m_write.AllLocalFiles)
- {
- access |= FileIOPermissionAccess.Write;
- }
-
- if (m_append != null && m_append.AllLocalFiles)
- {
- access |= FileIOPermissionAccess.Append;
- }
-
- if (m_pathDiscovery != null && m_pathDiscovery.AllLocalFiles)
- {
- access |= FileIOPermissionAccess.PathDiscovery;
- }
-
- return access;
- }
-
- set
- {
- if ((value & FileIOPermissionAccess.Read) != 0)
- {
- if (m_read == null)
- m_read = new FileIOAccess();
-
- m_read.AllLocalFiles = true;
- }
- else
- {
- if (m_read != null)
- m_read.AllLocalFiles = false;
- }
-
- if ((value & FileIOPermissionAccess.Write) != 0)
- {
- if (m_write == null)
- m_write = new FileIOAccess();
-
- m_write.AllLocalFiles = true;
- }
- else
- {
- if (m_write != null)
- m_write.AllLocalFiles = false;
- }
-
- if ((value & FileIOPermissionAccess.Append) != 0)
- {
- if (m_append == null)
- m_append = new FileIOAccess();
-
- m_append.AllLocalFiles = true;
- }
- else
- {
- if (m_append != null)
- m_append.AllLocalFiles = false;
- }
-
- if ((value & FileIOPermissionAccess.PathDiscovery) != 0)
- {
- if (m_pathDiscovery == null)
- m_pathDiscovery = new FileIOAccess( true );
-
- m_pathDiscovery.AllLocalFiles = true;
- }
- else
- {
- if (m_pathDiscovery != null)
- m_pathDiscovery.AllLocalFiles = false;
- }
-
- }
- }
public FileIOPermissionAccess AllFiles
{
@@ -456,20 +248,6 @@ namespace System.Security.Permissions
if ((access & ~FileIOPermissionAccess.AllAccess) != 0)
throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)access));
}
-
- [Pure]
- private static void ExclusiveAccess( FileIOPermissionAccess access )
- {
- if (access == FileIOPermissionAccess.NoAccess)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
-
- if (((int) access & ((int)access-1)) != 0)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
- }
private static void CheckIllegalCharacters(String[] str, bool onlyCheckExtras)
{
@@ -518,12 +296,8 @@ namespace System.Security.Permissions
}
return false;
}
-#endif
- private static bool AccessIsSet( FileIOPermissionAccess access, FileIOPermissionAccess question )
- {
- return (access & question) != 0;
- }
+#endif
private bool IsEmpty()
{
@@ -795,72 +569,6 @@ namespace System.Security.Permissions
// This implementation is only to silence a compiler warning.
return base.GetHashCode();
}
-
- /// <summary>
- /// Call this method if you don't need a the FileIOPermission for anything other than calling Demand() once.
- ///
- /// This method tries to verify full access before allocating a FileIOPermission object.
- /// If full access is there, then we still have to emulate the checks that creating the
- /// FileIOPermission object would have performed.
- ///
- /// IMPORTANT: This method should only be used after calling GetFullPath on the path to verify
- /// </summary>
- internal static void QuickDemand(FileIOPermissionAccess access, string fullPath, bool checkForDuplicates = false, bool needFullPath = false)
- {
- EmulateFileIOPermissionChecks(fullPath);
- }
-
- /// <summary>
- /// Call this method if you don't need a the FileIOPermission for anything other than calling Demand() once.
- ///
- /// This method tries to verify full access before allocating a FileIOPermission object.
- /// If full access is there, then we still have to emulate the checks that creating the
- /// FileIOPermission object would have performed.
- ///
- /// IMPORTANT: This method should only be used after calling GetFullPath on the path to verify
- ///
- /// </summary>
- internal static void QuickDemand(FileIOPermissionAccess access, string[] fullPathList, bool checkForDuplicates = false, bool needFullPath = true)
- {
- foreach (string fullPath in fullPathList)
- {
- EmulateFileIOPermissionChecks(fullPath);
- }
- }
-
- internal static void QuickDemand(PermissionState state)
- {
- // Should be a no-op without CAS
- }
-
- /// <summary>
- /// Perform the additional path checks that would normally happen when creating a FileIOPermission object.
- /// </summary>
- /// <param name="fullPath">A path that has already gone through GetFullPath or Normalize</param>
- internal static void EmulateFileIOPermissionChecks(string fullPath)
- {
- // Callers should have already made checks for invalid path format via normalization. This method will only make the
- // additional checks needed to throw the same exceptions that would normally throw when using FileIOPermission.
- // These checks are done via CheckIllegalCharacters() and StringExpressionSet in AddPathList() above.
-
-#if !PLATFORM_UNIX
- // Checking for colon / invalid characters on device paths blocks legitimate access to objects such as named pipes.
- if (!PathInternal.IsDevice(fullPath))
- {
- // GetFullPath already checks normal invalid path characters. We need to just check additional (wildcard) characters here.
- // (By calling the standard helper we can allow extended paths \\?\ through when the support is enabled.)
- if (PathInternal.HasWildCardCharacters(fullPath))
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPathChars"));
- }
-
- if (PathInternal.HasInvalidVolumeSeparator(fullPath))
- {
- throw new NotSupportedException(Environment.GetResourceString("Argument_PathFormatNotSupported"));
- }
- }
-#endif // !PLATFORM_UNIX
- }
}
[Serializable]
@@ -892,35 +600,6 @@ namespace System.Security.Permissions
m_pathDiscovery = pathDiscovery;
}
- public FileIOAccess( String value )
- {
- if (value == null)
- {
- m_set = new StringExpressionSet( m_ignoreCase, true );
- m_allFiles = false;
- m_allLocalFiles = false;
- }
- else if (value.Length >= m_strAllFiles.Length && String.Compare( m_strAllFiles, value, StringComparison.Ordinal) == 0)
- {
- m_set = new StringExpressionSet( m_ignoreCase, true );
- m_allFiles = true;
- m_allLocalFiles = false;
- }
- else if (value.Length >= m_strAllLocalFiles.Length && String.Compare( m_strAllLocalFiles, 0, value, 0, m_strAllLocalFiles.Length, StringComparison.Ordinal) == 0)
- {
- m_set = new StringExpressionSet( m_ignoreCase, value.Substring( m_strAllLocalFiles.Length ), true );
- m_allFiles = false;
- m_allLocalFiles = true;
- }
- else
- {
- m_set = new StringExpressionSet( m_ignoreCase, value, true );
- m_allFiles = false;
- m_allLocalFiles = false;
- }
- m_pathDiscovery = false;
- }
-
public FileIOAccess( bool allFiles, bool allLocalFiles, bool pathDiscovery )
{
m_set = new StringExpressionSet( m_ignoreCase, true );
@@ -964,27 +643,6 @@ namespace System.Security.Permissions
m_allFiles = value;
}
}
-
- public bool AllLocalFiles
- {
- get
- {
- return m_allLocalFiles;
- }
-
- set
- {
- m_allLocalFiles = value;
- }
- }
-
- public bool PathDiscovery
- {
- set
- {
- m_pathDiscovery = value;
- }
- }
public bool IsEmpty()
{
@@ -1165,13 +823,6 @@ namespace System.Security.Permissions
}
}
}
-
- public String[] ToStringArray()
- {
- // SafeCritical: all string expression sets are constructed with the throwOnRelative bit set, so
- // we're only exposing out the same paths that we took as input.
- return m_set.UnsafeToStringArray();
- }
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
diff --git a/src/mscorlib/src/System/Security/Permissions/GACIdentityPermission.cs b/src/mscorlib/src/System/Security/Permissions/GACIdentityPermission.cs
deleted file mode 100644
index f93f26daa9..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/GACIdentityPermission.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Permissions
-{
- using System;
- using System.Globalization;
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class GacIdentityPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
-#pragma warning disable 618
- public GacIdentityPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public override IPermission CreatePermission()
- {
- return new GacIdentityPermission();
- }
- }
-
-
- [System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- sealed public class GacIdentityPermission : CodeAccessPermission, IBuiltInPermission
- {
- //------------------------------------------------------
- //
- // PUBLIC CONSTRUCTORS
- //
- //------------------------------------------------------
-
- public GacIdentityPermission(PermissionState state)
- {
- if (state != PermissionState.Unrestricted && state != PermissionState.None)
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- public GacIdentityPermission()
- {
- }
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
-
- public override IPermission Copy()
- {
- return new GacIdentityPermission();
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- return false;
- if (!(target is GacIdentityPermission))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- return true;
- }
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
- if (!(target is GacIdentityPermission))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- return this.Copy();
- }
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- return this.Copy();
- if (!(target is GacIdentityPermission))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- return this.Copy();
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return GacIdentityPermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.GacIdentityPermissionIndex;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/HostProtectionPermission.cs b/src/mscorlib/src/System/Security/Permissions/HostProtectionPermission.cs
index c4facbb67e..2288482f35 100644
--- a/src/mscorlib/src/System/Security/Permissions/HostProtectionPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/HostProtectionPermission.cs
@@ -21,7 +21,7 @@ namespace System.Security.Permissions
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum HostProtectionResource
+ internal enum HostProtectionResource
{
None = 0x0,
//--------------------------------
@@ -45,7 +45,7 @@ namespace System.Security.Permissions
// as internal by BCLRewriter so we are simply marking it as FriendAccessAllowed so it stays in the asmmeta.
[System.Runtime.CompilerServices.FriendAccessAllowedAttribute]
#pragma warning disable 618
- sealed public class HostProtectionAttribute : CodeAccessSecurityAttribute
+ sealed internal class HostProtectionAttribute : CodeAccessSecurityAttribute
#pragma warning restore 618
{
private HostProtectionResource m_resources = HostProtectionResource.None;
diff --git a/src/mscorlib/src/System/Security/Permissions/IBuiltInPermission.cs b/src/mscorlib/src/System/Security/Permissions/IBuiltInPermission.cs
index 58b26bd9c4..273ef308d3 100644
--- a/src/mscorlib/src/System/Security/Permissions/IBuiltInPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/IBuiltInPermission.cs
@@ -36,28 +36,4 @@ namespace System.Security.Permissions
internal const int GacIdentityPermissionIndex = 5 + NUM_BUILTIN_UNRESTRICTED;
internal const int KeyContainerPermissionIndex = 6 + NUM_BUILTIN_UNRESTRICTED;
}
-
- [Serializable]
- internal enum BuiltInPermissionFlag
- {
- // Unrestricted permissions
-
- EnvironmentPermission = 0x1,
- FileDialogPermission = 0x2,
- FileIOPermission = 0x4,
- IsolatedStorageFilePermission = 0x8,
- ReflectionPermission = 0x10,
- RegistryPermission = 0x20,
- SecurityPermission = 0x40,
- UIPermission = 0x80,
- PrincipalPermission = 0x100,
-
- // Normal permissions
- PublisherIdentityPermission = 0x200,
- SiteIdentityPermission = 0x400,
- StrongNameIdentityPermission = 0x800,
- UrlIdentityPermission = 0x1000,
- ZoneIdentityPermission = 0x2000,
- KeyContainerPermission = 0x4000,
- }
}
diff --git a/src/mscorlib/src/System/Security/Permissions/IUnrestrictedPermission.cs b/src/mscorlib/src/System/Security/Permissions/IUnrestrictedPermission.cs
index 782df8012c..d66ca4dedd 100644
--- a/src/mscorlib/src/System/Security/Permissions/IUnrestrictedPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/IUnrestrictedPermission.cs
@@ -6,7 +6,7 @@ namespace System.Security.Permissions {
using System;
[System.Runtime.InteropServices.ComVisible(true)]
- public interface IUnrestrictedPermission
+ internal interface IUnrestrictedPermission
{
bool IsUnrestricted();
}
diff --git a/src/mscorlib/src/System/Security/Permissions/IsolatedStorageFilePermission.cs b/src/mscorlib/src/System/Security/Permissions/IsolatedStorageFilePermission.cs
deleted file mode 100644
index 42bc648c72..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/IsolatedStorageFilePermission.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-// Purpose : This permission is used to controls/administer access to
-// IsolatedStorageFile
-//
-
-namespace System.Security.Permissions {
-
- using System.Globalization;
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- sealed public class IsolatedStorageFilePermission : IsolatedStoragePermission, IBuiltInPermission
- {
- public IsolatedStorageFilePermission(PermissionState state)
- : base(state) { }
-
- internal IsolatedStorageFilePermission(IsolatedStorageContainment UsageAllowed,
- long ExpirationDays, bool PermanentData)
- : base(UsageAllowed, ExpirationDays, PermanentData) { }
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- {
- return this.Copy();
- }
- else if (!VerifyType(target))
- {
- throw new
- ArgumentException(
- Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)
- );
- }
-
- IsolatedStorageFilePermission operand = (IsolatedStorageFilePermission)target;
-
- if (this.IsUnrestricted() || operand.IsUnrestricted())
- {
- return new IsolatedStorageFilePermission( PermissionState.Unrestricted );
- }
- else
- {
- IsolatedStorageFilePermission union;
- union = new IsolatedStorageFilePermission( PermissionState.None );
- union.m_userQuota = max(m_userQuota,operand.m_userQuota);
- union.m_machineQuota = max(m_machineQuota,operand.m_machineQuota);
- union.m_expirationDays = max(m_expirationDays,operand.m_expirationDays);
- union.m_permanentData = m_permanentData || operand.m_permanentData;
- union.m_allowed = (IsolatedStorageContainment)max((long)m_allowed,(long)operand.m_allowed);
- return union;
- }
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- {
- return ((m_userQuota == 0) &&
- (m_machineQuota == 0) &&
- (m_expirationDays == 0) &&
- (m_permanentData == false) &&
- (m_allowed == IsolatedStorageContainment.None));
- }
-
- try
- {
- IsolatedStorageFilePermission operand = (IsolatedStorageFilePermission)target;
-
- if (operand.IsUnrestricted())
- return true;
-
- return ((operand.m_userQuota >= m_userQuota) &&
- (operand.m_machineQuota >= m_machineQuota) &&
- (operand.m_expirationDays >= m_expirationDays) &&
- (operand.m_permanentData || !m_permanentData) &&
- (operand.m_allowed >= m_allowed));
- }
- catch (InvalidCastException)
- {
- throw new
- ArgumentException(
- Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)
- );
- }
-
- }
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
- else if (!VerifyType(target))
- {
- throw new
- ArgumentException(
- Environment.GetResourceString("Argument_WrongType", this.GetType().FullName)
- );
- }
-
- IsolatedStorageFilePermission operand = (IsolatedStorageFilePermission)target;
-
- if(operand.IsUnrestricted())
- return Copy();
- else if(IsUnrestricted())
- return target.Copy();
-
- IsolatedStorageFilePermission intersection;
- intersection = new IsolatedStorageFilePermission( PermissionState.None );
- intersection.m_userQuota = min(m_userQuota,operand.m_userQuota);
- intersection.m_machineQuota = min(m_machineQuota,operand.m_machineQuota);
- intersection.m_expirationDays = min(m_expirationDays,operand.m_expirationDays);
- intersection.m_permanentData = m_permanentData && operand.m_permanentData;
- intersection.m_allowed = (IsolatedStorageContainment)min((long)m_allowed,(long)operand.m_allowed);
-
- if ((intersection.m_userQuota == 0) &&
- (intersection.m_machineQuota == 0) &&
- (intersection.m_expirationDays == 0) &&
- (intersection.m_permanentData == false) &&
- (intersection.m_allowed == IsolatedStorageContainment.None))
- return null;
-
- return intersection;
- }
-
- public override IPermission Copy()
- {
- IsolatedStorageFilePermission copy ;
- copy = new IsolatedStorageFilePermission(PermissionState.Unrestricted);
- if(!IsUnrestricted()){
- copy.m_userQuota = m_userQuota;
- copy.m_machineQuota = m_machineQuota;
- copy.m_expirationDays = m_expirationDays;
- copy.m_permanentData = m_permanentData;
- copy.m_allowed = m_allowed;
- }
- return copy;
- }
-
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return IsolatedStorageFilePermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.IsolatedStorageFilePermissionIndex;
- }
- }
-}
-
diff --git a/src/mscorlib/src/System/Security/Permissions/IsolatedStoragePermission.cs b/src/mscorlib/src/System/Security/Permissions/IsolatedStoragePermission.cs
deleted file mode 100644
index f54493fb37..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/IsolatedStoragePermission.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-namespace System.Security.Permissions {
-
- using System;
- using System.IO;
- using System.Security;
- using System.Security.Util;
- using System.Globalization;
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public enum IsolatedStorageContainment {
- None = 0x00,
- DomainIsolationByUser = 0x10,
- ApplicationIsolationByUser = 0x15,
- AssemblyIsolationByUser = 0x20,
- DomainIsolationByMachine = 0x30,
- AssemblyIsolationByMachine = 0x40,
- ApplicationIsolationByMachine = 0x45,
- DomainIsolationByRoamingUser = 0x50,
- AssemblyIsolationByRoamingUser = 0x60,
- ApplicationIsolationByRoamingUser = 0x65,
- AdministerIsolatedStorageByUser = 0x70,
- //AdministerIsolatedStorageByMachine = 0x80,
- UnrestrictedIsolatedStorage = 0xF0
- };
-
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- abstract public class IsolatedStoragePermission
- : CodeAccessPermission, IUnrestrictedPermission
- {
-
- //------------------------------------------------------
- //
- // PRIVATE STATE DATA
- //
- //------------------------------------------------------
-
- /// <internalonly/>
- internal long m_userQuota;
- /// <internalonly/>
- internal long m_machineQuota;
- /// <internalonly/>
- internal long m_expirationDays;
- /// <internalonly/>
- internal bool m_permanentData;
- /// <internalonly/>
- internal IsolatedStorageContainment m_allowed;
-
- //------------------------------------------------------
- //
- // CONSTRUCTORS
- //
- //------------------------------------------------------
-
- protected IsolatedStoragePermission(PermissionState state)
- {
- if (state == PermissionState.Unrestricted)
- {
- m_userQuota = Int64.MaxValue;
- m_machineQuota = Int64.MaxValue;
- m_expirationDays = Int64.MaxValue ;
- m_permanentData = true;
- m_allowed = IsolatedStorageContainment.UnrestrictedIsolatedStorage;
- }
- else if (state == PermissionState.None)
- {
- m_userQuota = 0;
- m_machineQuota = 0;
- m_expirationDays = 0;
- m_permanentData = false;
- m_allowed = IsolatedStorageContainment.None;
- }
- else
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- internal IsolatedStoragePermission(IsolatedStorageContainment UsageAllowed,
- long ExpirationDays, bool PermanentData)
-
- {
- m_userQuota = 0; // typical demand won't include quota
- m_machineQuota = 0; // typical demand won't include quota
- m_expirationDays = ExpirationDays;
- m_permanentData = PermanentData;
- m_allowed = UsageAllowed;
- }
-
- internal IsolatedStoragePermission(IsolatedStorageContainment UsageAllowed,
- long ExpirationDays, bool PermanentData, long UserQuota)
-
- {
- m_machineQuota = 0;
- m_userQuota = UserQuota;
- m_expirationDays = ExpirationDays;
- m_permanentData = PermanentData;
- m_allowed = UsageAllowed;
- }
-
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- // properties
- public long UserQuota {
- set{
- m_userQuota = value;
- }
- get{
- return m_userQuota;
- }
- }
-
-
- public IsolatedStorageContainment UsageAllowed {
- set{
- m_allowed = value;
- }
- get{
- return m_allowed;
- }
- }
-
-
- //------------------------------------------------------
- //
- // CODEACCESSPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- public bool IsUnrestricted()
- {
- return m_allowed == IsolatedStorageContainment.UnrestrictedIsolatedStorage;
- }
-
-
- //------------------------------------------------------
- //
- // INTERNAL METHODS
- //
- //------------------------------------------------------
- internal static long min(long x,long y) {return x>y?y:x;}
- internal static long max(long x,long y) {return x<y?y:x;}
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/PermissionAttributes.cs b/src/mscorlib/src/System/Security/Permissions/PermissionAttributes.cs
index 428a399a99..3db0354019 100644
--- a/src/mscorlib/src/System/Security/Permissions/PermissionAttributes.cs
+++ b/src/mscorlib/src/System/Security/Permissions/PermissionAttributes.cs
@@ -20,7 +20,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
// The csharp compiler requires these types to be public, but they are not used elsewhere.
[Obsolete("SecurityAction is no longer accessible to application code.")]
- public enum SecurityAction
+ internal enum SecurityAction
{
// Demand permission of all caller
Demand = 2,
@@ -59,7 +59,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
// The csharp compiler requires these types to be public, but they are not used elsewhere.
[Obsolete("SecurityAttribute is no longer accessible to application code.")]
- public abstract class SecurityAttribute : System.Attribute
+ internal abstract class SecurityAttribute : System.Attribute
{
/// <internalonly/>
internal SecurityAction m_action;
@@ -71,37 +71,14 @@ namespace System.Security.Permissions
m_action = action;
}
- public SecurityAction Action
- {
- get { return m_action; }
- set { m_action = value; }
- }
-
- public bool Unrestricted
- {
- get { return m_unrestricted; }
- set { m_unrestricted = value; }
- }
-
abstract public IPermission CreatePermission();
-
- internal static unsafe IntPtr FindSecurityAttributeTypeHandle(String typeName)
- {
- PermissionSet.s_fullTrust.Assert();
- Type t = Type.GetType(typeName, false, false);
- if(t == null)
- return IntPtr.Zero;
- IntPtr typeHandle = t.TypeHandle.Value;
- return typeHandle;
- }
}
[Serializable]
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
[System.Runtime.InteropServices.ComVisible(true)]
- // The csharp compiler requires these types to be public, but they are not used elsewhere.
[Obsolete("CodeAccessSecurityAttribute is no longer accessible to application code.")]
- public abstract class CodeAccessSecurityAttribute : SecurityAttribute
+ internal abstract class CodeAccessSecurityAttribute : SecurityAttribute
{
protected CodeAccessSecurityAttribute( SecurityAction action )
: base( action )
@@ -113,303 +90,21 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
#pragma warning disable 618
- sealed public class EnvironmentPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_read = null;
- private String m_write = null;
-
-#pragma warning disable 618
- public EnvironmentPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Read {
- get { return m_read; }
- set { m_read = value; }
- }
-
- public String Write {
- get { return m_write; }
- set { m_write = value; }
- }
-
- public String All {
- get { throw new NotSupportedException( Environment.GetResourceString( "NotSupported_GetMethod" ) ); }
- set { m_write = value; m_read = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new EnvironmentPermission(PermissionState.Unrestricted);
- }
- else
- {
- EnvironmentPermission perm = new EnvironmentPermission(PermissionState.None);
- if (m_read != null)
- perm.SetPathList( EnvironmentPermissionAccess.Read, m_read );
- if (m_write != null)
- perm.SetPathList( EnvironmentPermissionAccess.Write, m_write );
- return perm;
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class FileDialogPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private FileDialogPermissionAccess m_access;
-
-#pragma warning disable 618
- public FileDialogPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public bool Open
- {
- get { return (m_access & FileDialogPermissionAccess.Open) != 0; }
- set { m_access = value ? m_access | FileDialogPermissionAccess.Open : m_access & ~FileDialogPermissionAccess.Open; }
- }
-
- public bool Save
- {
- get { return (m_access & FileDialogPermissionAccess.Save) != 0; }
- set { m_access = value ? m_access | FileDialogPermissionAccess.Save : m_access & ~FileDialogPermissionAccess.Save; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new FileDialogPermission( PermissionState.Unrestricted );
- }
- else
- {
- return new FileDialogPermission( m_access );
- }
- }
- }
-
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class FileIOPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_read = null;
- private String m_write = null;
- private String m_append = null;
- private String m_pathDiscovery = null;
- private String m_viewAccess = null;
- private String m_changeAccess = null;
- [OptionalField(VersionAdded = 2)] private FileIOPermissionAccess m_allLocalFiles = FileIOPermissionAccess.NoAccess;
- [OptionalField(VersionAdded = 2)] private FileIOPermissionAccess m_allFiles = FileIOPermissionAccess.NoAccess;
-
-#pragma warning disable 618
- public FileIOPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Read {
- get { return m_read; }
- set { m_read = value; }
- }
-
- public String Write {
- get { return m_write; }
- set { m_write = value; }
- }
-
- public String Append {
- get { return m_append; }
- set { m_append = value; }
- }
-
- public String PathDiscovery {
- get { return m_pathDiscovery; }
- set { m_pathDiscovery = value; }
- }
-
- public String ViewAccessControl {
- get { return m_viewAccess; }
- set { m_viewAccess = value; }
- }
-
- public String ChangeAccessControl {
- get { return m_changeAccess; }
- set { m_changeAccess = value; }
- }
-
- [Obsolete("Please use the ViewAndModify property instead.")]
- public String All {
- set { m_read = value; m_write = value; m_append = value; m_pathDiscovery = value; }
- get { throw new NotSupportedException( Environment.GetResourceString( "NotSupported_GetMethod" ) ); }
- }
-
- // Read, Write, Append, PathDiscovery, but no ACL-related permissions
- public String ViewAndModify {
- get { throw new NotSupportedException( Environment.GetResourceString( "NotSupported_GetMethod" ) ); }
- set { m_read = value; m_write = value; m_append = value; m_pathDiscovery = value; }
- }
-
- public FileIOPermissionAccess AllFiles {
- get { return m_allFiles; }
- set { m_allFiles = value; }
- }
-
- public FileIOPermissionAccess AllLocalFiles {
- get { return m_allLocalFiles; }
- set { m_allLocalFiles = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else
- {
- FileIOPermission perm = new FileIOPermission(PermissionState.None);
- if (m_read != null)
- perm.SetPathList( FileIOPermissionAccess.Read, m_read );
- if (m_write != null)
- perm.SetPathList( FileIOPermissionAccess.Write, m_write );
- if (m_append != null)
- perm.SetPathList( FileIOPermissionAccess.Append, m_append );
- if (m_pathDiscovery != null)
- perm.SetPathList( FileIOPermissionAccess.PathDiscovery, m_pathDiscovery );
-
- perm.AllFiles = m_allFiles;
- perm.AllLocalFiles = m_allLocalFiles;
- return perm;
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
-#pragma warning disable 618
- public sealed class KeyContainerPermissionAttribute : CodeAccessSecurityAttribute {
-#pragma warning restore 618
- KeyContainerPermissionFlags m_flags = KeyContainerPermissionFlags.NoFlags;
- private string m_keyStore;
- private string m_providerName;
- private int m_providerType = -1;
- private string m_keyContainerName;
- private int m_keySpec = -1;
-
-#pragma warning disable 618
- public KeyContainerPermissionAttribute(SecurityAction action) : base(action) {}
-#pragma warning restore 618
-
- public string KeyStore {
- get { return m_keyStore; }
- set { m_keyStore = value; }
- }
-
- public string ProviderName {
- get { return m_providerName; }
- set { m_providerName = value; }
- }
-
- public int ProviderType {
- get { return m_providerType; }
- set { m_providerType = value; }
- }
-
- public string KeyContainerName {
- get { return m_keyContainerName; }
- set { m_keyContainerName = value; }
- }
-
- public int KeySpec {
- get { return m_keySpec; }
- set { m_keySpec = value; }
- }
-
- public KeyContainerPermissionFlags Flags {
- get { return m_flags; }
- set { m_flags = value; }
- }
-
- public override IPermission CreatePermission() {
- if (m_unrestricted) {
- return new KeyContainerPermission(PermissionState.Unrestricted);
- } else {
- if (KeyContainerPermissionAccessEntry.IsUnrestrictedEntry(m_keyStore, m_providerName, m_providerType, m_keyContainerName, m_keySpec))
- return new KeyContainerPermission(m_flags);
-
- // create a KeyContainerPermission with a single access entry.
- KeyContainerPermission cp = new KeyContainerPermission(KeyContainerPermissionFlags.NoFlags);
- KeyContainerPermissionAccessEntry accessEntry = new KeyContainerPermissionAccessEntry(m_keyStore, m_providerName, m_providerType, m_keyContainerName, m_keySpec, m_flags);
- cp.AccessEntries.Add(accessEntry);
- return cp;
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class ReflectionPermissionAttribute : CodeAccessSecurityAttribute
+ sealed internal class ReflectionPermissionAttribute : CodeAccessSecurityAttribute
#pragma warning restore 618
{
private ReflectionPermissionFlag m_flag = ReflectionPermissionFlag.NoFlags;
-#pragma warning disable 618
- public ReflectionPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
public ReflectionPermissionFlag Flags {
get { return m_flag; }
set { m_flag = value; }
}
- [Obsolete("This API has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
- public bool TypeInformation {
-#pragma warning disable 618
- get { return (m_flag & ReflectionPermissionFlag.TypeInformation) != 0; }
- set { m_flag = value ? m_flag | ReflectionPermissionFlag.TypeInformation : m_flag & ~ReflectionPermissionFlag.TypeInformation; }
-#pragma warning restore 618
- }
-
- public bool MemberAccess {
- get { return (m_flag & ReflectionPermissionFlag.MemberAccess) != 0; }
- set { m_flag = value ? m_flag | ReflectionPermissionFlag.MemberAccess : m_flag & ~ReflectionPermissionFlag.MemberAccess; }
- }
-
- [Obsolete("This permission is no longer used by the CLR.")]
- public bool ReflectionEmit {
#pragma warning disable 618
- get { return (m_flag & ReflectionPermissionFlag.ReflectionEmit) != 0; }
- set { m_flag = value ? m_flag | ReflectionPermissionFlag.ReflectionEmit : m_flag & ~ReflectionPermissionFlag.ReflectionEmit; }
+ public ReflectionPermissionAttribute( SecurityAction action )
#pragma warning restore 618
- }
-
- public bool RestrictedMemberAccess
+ : base( action )
{
- get { return (m_flag & ReflectionPermissionFlag.RestrictedMemberAccess) != 0; }
- set { m_flag = value ? m_flag | ReflectionPermissionFlag.RestrictedMemberAccess : m_flag & ~ReflectionPermissionFlag.RestrictedMemberAccess; }
}
public override IPermission CreatePermission()
@@ -429,292 +124,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
#pragma warning disable 618
- sealed public class RegistryPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_read = null;
- private String m_write = null;
- private String m_create = null;
- private String m_viewAcl = null;
- private String m_changeAcl = null;
-
-#pragma warning disable 618
- public RegistryPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Read {
- get { return m_read; }
- set { m_read = value; }
- }
-
- public String Write {
- get { return m_write; }
- set { m_write = value; }
- }
-
- public String Create {
- get { return m_create; }
- set { m_create = value; }
- }
-
- public String ViewAccessControl {
- get { return m_viewAcl; }
- set { m_viewAcl = value; }
- }
-
- public String ChangeAccessControl {
- get { return m_changeAcl; }
- set { m_changeAcl = value; }
- }
-
- // Read, Write, & Create, but no ACL's
- public String ViewAndModify {
- get { throw new NotSupportedException( Environment.GetResourceString( "NotSupported_GetMethod" ) ); }
- set { m_read = value; m_write = value; m_create = value; }
- }
-
- [Obsolete("Please use the ViewAndModify property instead.")]
- public String All {
- get { throw new NotSupportedException( Environment.GetResourceString( "NotSupported_GetMethod" ) ); }
- set { m_read = value; m_write = value; m_create = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new RegistryPermission( PermissionState.Unrestricted );
- }
- else
- {
- RegistryPermission perm = new RegistryPermission(PermissionState.None);
- if (m_read != null)
- perm.SetPathList( RegistryPermissionAccess.Read, m_read );
- if (m_write != null)
- perm.SetPathList( RegistryPermissionAccess.Write, m_write );
- if (m_create != null)
- perm.SetPathList( RegistryPermissionAccess.Create, m_create );
- return perm;
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class UIPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private UIPermissionWindow m_windowFlag = UIPermissionWindow.NoWindows;
- private UIPermissionClipboard m_clipboardFlag = UIPermissionClipboard.NoClipboard;
-
-#pragma warning disable 618
- public UIPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public UIPermissionWindow Window {
- get { return m_windowFlag; }
- set { m_windowFlag = value; }
- }
-
- public UIPermissionClipboard Clipboard {
- get { return m_clipboardFlag; }
- set { m_clipboardFlag = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new UIPermission( PermissionState.Unrestricted );
- }
- else
- {
- return new UIPermission( m_windowFlag, m_clipboardFlag );
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class ZoneIdentityPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private SecurityZone m_flag = SecurityZone.NoZone;
-
-#pragma warning disable 618
- public ZoneIdentityPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public SecurityZone Zone {
- get { return m_flag; }
- set { m_flag = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new ZoneIdentityPermission(PermissionState.Unrestricted);
- }
- else
- {
- return new ZoneIdentityPermission( m_flag );
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class StrongNameIdentityPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_name = null;
- private String m_version = null;
- private String m_blob = null;
-
-#pragma warning disable 618
- public StrongNameIdentityPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Name
- {
- get { return m_name; }
- set { m_name = value; }
- }
-
- public String Version
- {
- get { return m_version; }
- set { m_version = value; }
- }
-
- public String PublicKey
- {
- get { return m_blob; }
- set { m_blob = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new StrongNameIdentityPermission( PermissionState.Unrestricted );
- }
- else
- {
- if (m_blob == null && m_name == null && m_version == null)
- return new StrongNameIdentityPermission( PermissionState.None );
-
- if (m_blob == null)
- throw new ArgumentException( Environment.GetResourceString("ArgumentNull_Key"));
-
- StrongNamePublicKeyBlob blob = new StrongNamePublicKeyBlob( m_blob );
-
- if (m_version == null || m_version.Equals(String.Empty))
- return new StrongNameIdentityPermission( blob, m_name, null );
- else
- return new StrongNameIdentityPermission( blob, m_name, new Version( m_version ) );
- }
- }
- }
-
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class SiteIdentityPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_site = null;
-
-#pragma warning disable 618
- public SiteIdentityPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Site {
- get { return m_site; }
- set { m_site = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new SiteIdentityPermission( PermissionState.Unrestricted );
- }
- else
- {
- if (m_site == null)
- return new SiteIdentityPermission( PermissionState.None );
-
- return new SiteIdentityPermission( m_site );
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
-#pragma warning disable 618
- [Serializable] sealed public class UrlIdentityPermissionAttribute : CodeAccessSecurityAttribute
-#pragma warning restore 618
- {
- private String m_url = null;
-
-#pragma warning disable 618
- public UrlIdentityPermissionAttribute( SecurityAction action )
-#pragma warning restore 618
- : base( action )
- {
- }
-
- public String Url {
- get { return m_url; }
- set { m_url = value; }
- }
-
- public override IPermission CreatePermission()
- {
- if (m_unrestricted)
- {
- return new UrlIdentityPermission( PermissionState.Unrestricted );
- }
- else
- {
- if (m_url == null)
- return new UrlIdentityPermission( PermissionState.None );
-
- return new UrlIdentityPermission( m_url );
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = true, Inherited = false )]
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
-#pragma warning disable 618
- sealed public class PermissionSetAttribute : CodeAccessSecurityAttribute
+ sealed internal class PermissionSetAttribute : CodeAccessSecurityAttribute
#pragma warning restore 618
{
private String m_file;
@@ -731,31 +141,6 @@ namespace System.Security.Permissions
m_unicode = false;
}
- public String File {
- get { return m_file; }
- set { m_file = value; }
- }
-
- public bool UnicodeEncoded {
- get { return m_unicode; }
- set { m_unicode = value; }
- }
-
- public String Name {
- get { return m_name; }
- set { m_name = value; }
- }
-
- public String XML {
- get { return m_xml; }
- set { m_xml = value; }
- }
-
- public String Hex {
- get { return m_hex; }
- set { m_hex = value; }
- }
-
public override IPermission CreatePermission()
{
return null;
diff --git a/src/mscorlib/src/System/Security/Permissions/PermissionState.cs b/src/mscorlib/src/System/Security/Permissions/PermissionState.cs
index ea0f1a0ac2..de3dbd109c 100644
--- a/src/mscorlib/src/System/Security/Permissions/PermissionState.cs
+++ b/src/mscorlib/src/System/Security/Permissions/PermissionState.cs
@@ -12,7 +12,7 @@ namespace System.Security.Permissions {
using System;
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum PermissionState
+ internal enum PermissionState
{
Unrestricted = 1,
None = 0,
diff --git a/src/mscorlib/src/System/Security/Permissions/ReflectionPermission.cs b/src/mscorlib/src/System/Security/Permissions/ReflectionPermission.cs
index 1c9dd7696c..288febbe01 100644
--- a/src/mscorlib/src/System/Security/Permissions/ReflectionPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/ReflectionPermission.cs
@@ -18,7 +18,7 @@ namespace System.Security.Permissions
[ComVisible(true)]
[Flags]
[Serializable]
- public enum ReflectionPermissionFlag
+ internal enum ReflectionPermissionFlag
{
NoFlags = 0x00,
[Obsolete("This API has been deprecated. http://go.microsoft.com/fwlink/?linkid=14202")]
@@ -34,7 +34,7 @@ namespace System.Security.Permissions
[ComVisible(true)]
[Serializable]
- sealed public class ReflectionPermission
+ sealed internal class ReflectionPermission
: CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
// ReflectionPermissionFlag.AllFlags doesn't contain the new value RestrictedMemberAccess,
diff --git a/src/mscorlib/src/System/Security/Permissions/RegistryPermission.cs b/src/mscorlib/src/System/Security/Permissions/RegistryPermission.cs
index c0c51e94a2..2eb254ed27 100644
--- a/src/mscorlib/src/System/Security/Permissions/RegistryPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/RegistryPermission.cs
@@ -5,7 +5,6 @@
namespace System.Security.Permissions
{
using System;
- using SecurityElement = System.Security.SecurityElement;
using System.Security.AccessControl;
using System.Security.Util;
using System.IO;
@@ -15,7 +14,7 @@ namespace System.Security.Permissions
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum RegistryPermissionAccess
+ internal enum RegistryPermissionAccess
{
NoAccess = 0x00,
Read = 0x01,
@@ -26,7 +25,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- sealed public class RegistryPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
+ sealed internal class RegistryPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
private StringExpressionSet m_read;
private StringExpressionSet m_write;
@@ -107,44 +106,6 @@ namespace System.Security.Permissions
m_create.AddExpressions( pathList );
}
}
-
- public String GetPathList( RegistryPermissionAccess access )
- {
- // SafeCritical: these are registry paths, which means we're not leaking file system information here
- VerifyAccess( access );
- ExclusiveAccess( access );
-
- if ((access & RegistryPermissionAccess.Read) != 0)
- {
- if (m_read == null)
- {
- return "";
- }
- return m_read.UnsafeToString();
- }
-
- if ((access & RegistryPermissionAccess.Write) != 0)
- {
- if (m_write == null)
- {
- return "";
- }
- return m_write.UnsafeToString();
- }
-
- if ((access & RegistryPermissionAccess.Create) != 0)
- {
- if (m_create == null)
- {
- return "";
- }
- return m_create.UnsafeToString();
- }
-
- /* not reached */
-
- return "";
- }
private void VerifyAccess( RegistryPermissionAccess access )
{
@@ -152,19 +113,6 @@ namespace System.Security.Permissions
throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)access));
}
- private void ExclusiveAccess( RegistryPermissionAccess access )
- {
- if (access == RegistryPermissionAccess.NoAccess)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
-
- if (((int) access & ((int)access-1)) != 0)
- {
- throw new ArgumentException( Environment.GetResourceString("Arg_EnumNotSingleFlag") );
- }
- }
-
private bool IsEmpty()
{
return (!m_unrestricted &&
diff --git a/src/mscorlib/src/System/Security/Permissions/SecurityPermission.cs b/src/mscorlib/src/System/Security/Permissions/SecurityPermission.cs
index cf3002989d..b8e4275ef0 100644
--- a/src/mscorlib/src/System/Security/Permissions/SecurityPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/SecurityPermission.cs
@@ -19,9 +19,8 @@ namespace System.Security.Permissions
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- // The csharp compiler requires these types to be public, but they are not used elsewhere.
[Obsolete("SecurityPermissionFlag is no longer accessible to application code.")]
- public enum SecurityPermissionFlag
+ internal enum SecurityPermissionFlag
{
NoFlags = 0x00,
/* The following enum value is used in the EE (ASSERT_PERMISSION in security.cpp)
@@ -46,7 +45,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- sealed public class SecurityPermission
+ sealed internal class SecurityPermission
: CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
#pragma warning disable 618
diff --git a/src/mscorlib/src/System/Security/Permissions/SiteIdentityPermission.cs b/src/mscorlib/src/System/Security/Permissions/SiteIdentityPermission.cs
deleted file mode 100644
index 3b31d37483..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/SiteIdentityPermission.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Permissions
-{
- using System;
- using SiteString = System.Security.Util.SiteString;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Runtime.Serialization;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- sealed public class SiteIdentityPermission : CodeAccessPermission, IBuiltInPermission
- {
- //------------------------------------------------------
- //
- // PRIVATE STATE DATA
- //
- //------------------------------------------------------
- [OptionalField(VersionAdded = 2)]
- private bool m_unrestricted;
- [OptionalField(VersionAdded = 2)]
- private SiteString[] m_sites;
-
- //------------------------------------------------------
- //
- // PUBLIC CONSTRUCTORS
- //
- //------------------------------------------------------
-
-
- public SiteIdentityPermission(PermissionState state)
- {
- if (state == PermissionState.Unrestricted)
- {
- m_unrestricted = true;
- }
- else if (state == PermissionState.None)
- {
- m_unrestricted = false;
- }
- else
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- public SiteIdentityPermission( String site )
- {
- Site = site;
- }
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- public String Site
- {
- set
- {
- m_unrestricted = false;
- m_sites = new SiteString[1];
- m_sites[0] = new SiteString( value );
- }
-
- get
- {
- if(m_sites == null)
- return "";
- if(m_sites.Length == 1)
- return m_sites[0].ToString();
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AmbiguousIdentity"));
- }
- }
-
- //------------------------------------------------------
- //
- // PRIVATE AND PROTECTED HELPERS FOR ACCESSORS AND CONSTRUCTORS
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // CODEACCESSPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
- public override IPermission Copy()
- {
- SiteIdentityPermission perm = new SiteIdentityPermission( PermissionState.None );
- perm.m_unrestricted = this.m_unrestricted;
- if (this.m_sites != null)
- {
- perm.m_sites = new SiteString[this.m_sites.Length];
- int n;
- for(n = 0; n < this.m_sites.Length; n++)
- perm.m_sites[n] = (SiteString)this.m_sites[n].Copy();
- }
- return perm;
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- {
- if(m_unrestricted)
- return false;
- if(m_sites == null)
- return true;
- if(m_sites.Length == 0)
- return true;
- return false;
- }
- SiteIdentityPermission that = target as SiteIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(that.m_unrestricted)
- return true;
- if(m_unrestricted)
- return false;
- if(this.m_sites != null)
- {
- foreach(SiteString ssThis in this.m_sites)
- {
- bool bOK = false;
- if(that.m_sites != null)
- {
- foreach(SiteString ssThat in that.m_sites)
- {
- if(ssThis.IsSubsetOf(ssThat))
- {
- bOK = true;
- break;
- }
- }
- }
- if(!bOK)
- return false;
- }
- }
- return true;
- }
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
- SiteIdentityPermission that = target as SiteIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted && that.m_unrestricted)
- {
- SiteIdentityPermission res = new SiteIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if(this.m_unrestricted)
- return that.Copy();
- if(that.m_unrestricted)
- return this.Copy();
- if(this.m_sites == null || that.m_sites == null || this.m_sites.Length == 0 || that.m_sites.Length == 0)
- return null;
- List<SiteString> alSites = new List<SiteString>();
- foreach(SiteString ssThis in this.m_sites)
- {
- foreach(SiteString ssThat in that.m_sites)
- {
- SiteString ssInt = (SiteString)ssThis.Intersect(ssThat);
- if(ssInt != null)
- alSites.Add(ssInt);
- }
- }
- if(alSites.Count == 0)
- return null;
- SiteIdentityPermission result = new SiteIdentityPermission(PermissionState.None);
- result.m_sites = alSites.ToArray();
- return result;
- }
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- {
- if((this.m_sites == null || this.m_sites.Length == 0) && !this.m_unrestricted)
- return null;
- return this.Copy();
- }
- SiteIdentityPermission that = target as SiteIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted || that.m_unrestricted)
- {
- SiteIdentityPermission res = new SiteIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if (this.m_sites == null || this.m_sites.Length == 0)
- {
- if(that.m_sites == null || that.m_sites.Length == 0)
- return null;
- return that.Copy();
- }
- if(that.m_sites == null || that.m_sites.Length == 0)
- return this.Copy();
- List<SiteString> alSites = new List<SiteString>();
- foreach(SiteString ssThis in this.m_sites)
- alSites.Add(ssThis);
- foreach(SiteString ssThat in that.m_sites)
- {
- bool bDupe = false;
- foreach(SiteString ss in alSites)
- {
- if(ssThat.Equals(ss))
- {
- bDupe = true;
- break;
- }
- }
- if(!bDupe)
- alSites.Add(ssThat);
- }
- SiteIdentityPermission result = new SiteIdentityPermission(PermissionState.None);
- result.m_sites = alSites.ToArray();
- return result;
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return SiteIdentityPermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.SiteIdentityPermissionIndex;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/StrongNameIdentityPermission.cs b/src/mscorlib/src/System/Security/Permissions/StrongNameIdentityPermission.cs
deleted file mode 100644
index f09d84de34..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/StrongNameIdentityPermission.cs
+++ /dev/null
@@ -1,401 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Permissions
-{
- using System;
- using System.Security.Util;
- using System.IO;
- using String = System.String;
- using Version = System.Version;
- using System.Security.Policy;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Diagnostics.Contracts;
-
- // The only difference between this class and System.Security.Policy.StrongName is that this one
- // allows m_name to be null. We should merge this class with System.Security.Policy.StrongName
- [Serializable]
- sealed internal class StrongName2
- {
- public StrongNamePublicKeyBlob m_publicKeyBlob;
- public String m_name;
- public Version m_version;
-
- public StrongName2(StrongNamePublicKeyBlob publicKeyBlob, String name, Version version)
- {
- m_publicKeyBlob = publicKeyBlob;
- m_name = name;
- m_version = version;
- }
-
- public StrongName2 Copy()
- {
- return new StrongName2(m_publicKeyBlob, m_name, m_version);
- }
-
- public bool IsSubsetOf(StrongName2 target)
- {
- // This StrongName2 is a subset of the target if it's public key blob is null no matter what
- if (this.m_publicKeyBlob == null)
- return true;
-
- // Subsets are always false if the public key blobs do not match
- if (!this.m_publicKeyBlob.Equals( target.m_publicKeyBlob ))
- return false;
-
- // We use null in strings to represent the "Anything" state.
- // Therefore, the logic to detect an individual subset is:
- //
- // 1. If the this string is null ("Anything" is a subset of any other).
- // 2. If the this string and target string are the same (equality is sufficient for a subset).
- //
- // The logic is reversed here to discover things that are not subsets.
- if (this.m_name != null)
- {
- if (target.m_name == null || !System.Security.Policy.StrongName.CompareNames( target.m_name, this.m_name ))
- return false;
- }
-
- if ((Object) this.m_version != null)
- {
- if ((Object) target.m_version == null ||
- target.m_version.CompareTo( this.m_version ) != 0)
- {
- return false;
- }
- }
-
- return true;
- }
-
- public StrongName2 Intersect(StrongName2 target)
- {
- if (target.IsSubsetOf( this ))
- return target.Copy();
- else if (this.IsSubsetOf( target ))
- return this.Copy();
- else
- return null;
- }
-
- public bool Equals(StrongName2 target)
- {
- if (!target.IsSubsetOf(this))
- return false;
- if (!this.IsSubsetOf(target))
- return false;
- return true;
- }
- }
-
-
-
-[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable]
- sealed public class StrongNameIdentityPermission : CodeAccessPermission, IBuiltInPermission
- {
- //------------------------------------------------------
- //
- // PRIVATE STATE DATA
- //
- //------------------------------------------------------
-
- private bool m_unrestricted;
- private StrongName2[] m_strongNames;
-
- //------------------------------------------------------
- //
- // PUBLIC CONSTRUCTORS
- //
- //------------------------------------------------------
-
-
- public StrongNameIdentityPermission(PermissionState state)
- {
- if (state == PermissionState.Unrestricted)
- {
- m_unrestricted = true;
- }
- else if (state == PermissionState.None)
- {
- m_unrestricted = false;
- }
- else
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- public StrongNameIdentityPermission( StrongNamePublicKeyBlob blob, String name, Version version )
- {
- if (blob == null)
- throw new ArgumentNullException( nameof(blob) );
- if (name != null && name.Equals( "" ))
- throw new ArgumentException( Environment.GetResourceString( "Argument_EmptyStrongName" ) );
- Contract.EndContractBlock();
- m_unrestricted = false;
- m_strongNames = new StrongName2[1];
- m_strongNames[0] = new StrongName2(blob, name, version);
- }
-
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- public StrongNamePublicKeyBlob PublicKey
- {
- set
- {
- if (value == null)
- throw new ArgumentNullException( nameof(PublicKey) );
- Contract.EndContractBlock();
- m_unrestricted = false;
- if(m_strongNames != null && m_strongNames.Length == 1)
- m_strongNames[0].m_publicKeyBlob = value;
- else
- {
- m_strongNames = new StrongName2[1];
- m_strongNames[0] = new StrongName2(value, "", new Version());
- }
- }
-
- get
- {
- if(m_strongNames == null || m_strongNames.Length == 0)
- return null;
- if(m_strongNames.Length > 1)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AmbiguousIdentity"));
- return m_strongNames[0].m_publicKeyBlob;
- }
- }
-
- public String Name
- {
- set
- {
- if (value != null && value.Length == 0)
- throw new ArgumentException( Environment.GetResourceString("Argument_EmptyName" ));
- Contract.EndContractBlock();
- m_unrestricted = false;
- if(m_strongNames != null && m_strongNames.Length == 1)
- m_strongNames[0].m_name = value;
- else
- {
- m_strongNames = new StrongName2[1];
- m_strongNames[0] = new StrongName2(null, value, new Version());
- }
- }
-
- get
- {
- if(m_strongNames == null || m_strongNames.Length == 0)
- return "";
- if(m_strongNames.Length > 1)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AmbiguousIdentity"));
- return m_strongNames[0].m_name;
- }
- }
-
- public Version Version
- {
- set
- {
- m_unrestricted = false;
- if(m_strongNames != null && m_strongNames.Length == 1)
- m_strongNames[0].m_version = value;
- else
- {
- m_strongNames = new StrongName2[1];
- m_strongNames[0] = new StrongName2(null, "", value);
- }
- }
-
- get
- {
- if(m_strongNames == null || m_strongNames.Length == 0)
- return new Version();
- if(m_strongNames.Length > 1)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AmbiguousIdentity"));
- return m_strongNames[0].m_version;
- }
- }
-
- //------------------------------------------------------
- //
- // PRIVATE AND PROTECTED HELPERS FOR ACCESSORS AND CONSTRUCTORS
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // CODEACCESSPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
-
- public override IPermission Copy()
- {
- StrongNameIdentityPermission perm = new StrongNameIdentityPermission(PermissionState.None);
- perm.m_unrestricted = this.m_unrestricted;
- if(this.m_strongNames != null)
- {
- perm.m_strongNames = new StrongName2[this.m_strongNames.Length];
- int n;
- for(n = 0; n < this.m_strongNames.Length; n++)
- perm.m_strongNames[n] = this.m_strongNames[n].Copy();
- }
- return perm;
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- {
- if(m_unrestricted)
- return false;
- if(m_strongNames == null)
- return true;
- if(m_strongNames.Length == 0)
- return true;
- return false;
- }
- StrongNameIdentityPermission that = target as StrongNameIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(that.m_unrestricted)
- return true;
- if(m_unrestricted)
- return false;
- if(this.m_strongNames != null)
- {
- foreach(StrongName2 snThis in m_strongNames)
- {
- bool bOK = false;
- if(that.m_strongNames != null)
- {
- foreach(StrongName2 snThat in that.m_strongNames)
- {
- if(snThis.IsSubsetOf(snThat))
- {
- bOK = true;
- break;
- }
- }
- }
- if(!bOK)
- return false;
- }
- }
- return true;
- }
-
-
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
- StrongNameIdentityPermission that = target as StrongNameIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted && that.m_unrestricted)
- {
- StrongNameIdentityPermission res = new StrongNameIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if(this.m_unrestricted)
- return that.Copy();
- if(that.m_unrestricted)
- return this.Copy();
- if(this.m_strongNames == null || that.m_strongNames == null || this.m_strongNames.Length == 0 || that.m_strongNames.Length == 0)
- return null;
- List<StrongName2> alStrongNames = new List<StrongName2>();
- foreach(StrongName2 snThis in this.m_strongNames)
- {
- foreach(StrongName2 snThat in that.m_strongNames)
- {
- StrongName2 snInt = (StrongName2)snThis.Intersect(snThat);
- if(snInt != null)
- alStrongNames.Add(snInt);
- }
- }
- if(alStrongNames.Count == 0)
- return null;
- StrongNameIdentityPermission result = new StrongNameIdentityPermission(PermissionState.None);
- result.m_strongNames = alStrongNames.ToArray();
- return result;
- }
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- {
- if((this.m_strongNames == null || this.m_strongNames.Length == 0) && !this.m_unrestricted)
- return null;
- return this.Copy();
- }
- StrongNameIdentityPermission that = target as StrongNameIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted || that.m_unrestricted)
- {
- StrongNameIdentityPermission res = new StrongNameIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if (this.m_strongNames == null || this.m_strongNames.Length == 0)
- {
- if(that.m_strongNames == null || that.m_strongNames.Length == 0)
- return null;
- return that.Copy();
- }
- if(that.m_strongNames == null || that.m_strongNames.Length == 0)
- return this.Copy();
- List<StrongName2> alStrongNames = new List<StrongName2>();
- foreach(StrongName2 snThis in this.m_strongNames)
- alStrongNames.Add(snThis);
- foreach(StrongName2 snThat in that.m_strongNames)
- {
- bool bDupe = false;
- foreach(StrongName2 sn in alStrongNames)
- {
- if(snThat.Equals(sn))
- {
- bDupe = true;
- break;
- }
- }
- if(!bDupe)
- alStrongNames.Add(snThat);
- }
- StrongNameIdentityPermission result = new StrongNameIdentityPermission(PermissionState.None);
- result.m_strongNames = alStrongNames.ToArray();
- return result;
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return StrongNameIdentityPermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.StrongNameIdentityPermissionIndex;
- }
-
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs b/src/mscorlib/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs
index 823eaba938..e3ded7c930 100644
--- a/src/mscorlib/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs
+++ b/src/mscorlib/src/System/Security/Permissions/StrongNamePublicKeyBlob.cs
@@ -9,7 +9,7 @@ namespace System.Security.Permissions
using System.Diagnostics.Contracts;
[System.Runtime.InteropServices.ComVisible(true)]
- [Serializable] sealed public class StrongNamePublicKeyBlob
+ [Serializable] sealed internal class StrongNamePublicKeyBlob
{
internal byte[] PublicKey;
@@ -17,21 +17,6 @@ namespace System.Security.Permissions
{
}
- public StrongNamePublicKeyBlob( byte[] publicKey )
- {
- if (publicKey == null)
- throw new ArgumentNullException( nameof(PublicKey) );
- Contract.EndContractBlock();
-
- this.PublicKey = new byte[publicKey.Length];
- Array.Copy( publicKey, 0, this.PublicKey, 0, publicKey.Length );
- }
-
- internal StrongNamePublicKeyBlob( String publicKey )
- {
- this.PublicKey = Hex.DecodeHexString( publicKey );
- }
-
private static bool CompareArrays( byte[] first, byte[] second )
{
if (first.Length != second.Length)
diff --git a/src/mscorlib/src/System/Security/Permissions/UIPermission.cs b/src/mscorlib/src/System/Security/Permissions/UIPermission.cs
index 7768e97c53..14b2da30b6 100644
--- a/src/mscorlib/src/System/Security/Permissions/UIPermission.cs
+++ b/src/mscorlib/src/System/Security/Permissions/UIPermission.cs
@@ -16,7 +16,7 @@ namespace System.Security.Permissions
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum UIPermissionWindow
+ internal enum UIPermissionWindow
{
// No window use allowed at all.
NoWindows = 0x0,
@@ -34,7 +34,7 @@ namespace System.Security.Permissions
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum UIPermissionClipboard
+ internal enum UIPermissionClipboard
{
// No clipboard access is allowed.
NoClipboard = 0x0,
@@ -50,7 +50,7 @@ namespace System.Security.Permissions
[System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- sealed public class UIPermission
+ sealed internal class UIPermission
: CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission
{
//------------------------------------------------------
@@ -94,57 +94,6 @@ namespace System.Security.Permissions
m_clipboardFlag = clipboardFlag;
}
- public UIPermission(UIPermissionWindow windowFlag )
- {
- VerifyWindowFlag( windowFlag );
-
- m_windowFlag = windowFlag;
- }
-
- public UIPermission(UIPermissionClipboard clipboardFlag )
- {
- VerifyClipboardFlag( clipboardFlag );
-
- m_clipboardFlag = clipboardFlag;
- }
-
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- public UIPermissionWindow Window
- {
- set
- {
- VerifyWindowFlag(value);
-
- m_windowFlag = value;
- }
-
- get
- {
- return m_windowFlag;
- }
- }
-
- public UIPermissionClipboard Clipboard
- {
- set
- {
- VerifyClipboardFlag(value);
-
- m_clipboardFlag = value;
- }
-
- get
- {
- return m_clipboardFlag;
- }
- }
-
//------------------------------------------------------
//
// PRIVATE AND PROTECTED HELPERS FOR ACCESSORS AND CONSTRUCTORS
diff --git a/src/mscorlib/src/System/Security/Permissions/URLIdentityPermission.cs b/src/mscorlib/src/System/Security/Permissions/URLIdentityPermission.cs
deleted file mode 100644
index bac7f7a0d9..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/URLIdentityPermission.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Permissions
-{
- using System;
- using System.Security.Util;
- using System.IO;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Runtime.Serialization;
- using System.Diagnostics.Contracts;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- sealed public class UrlIdentityPermission : CodeAccessPermission, IBuiltInPermission
- {
- //------------------------------------------------------
- //
- // PRIVATE STATE DATA
- //
- //------------------------------------------------------
-
- [OptionalField(VersionAdded = 2)]
- private bool m_unrestricted;
- [OptionalField(VersionAdded = 2)]
- private URLString[] m_urls;
-
- //------------------------------------------------------
- //
- // PUBLIC CONSTRUCTORS
- //
- //------------------------------------------------------
-
-
- public UrlIdentityPermission(PermissionState state)
- {
- if (state == PermissionState.Unrestricted)
- {
- m_unrestricted = true;
- }
- else if (state == PermissionState.None)
- {
- m_unrestricted = false;
- }
- else
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- public UrlIdentityPermission( String site )
- {
- if (site == null)
- throw new ArgumentNullException( nameof(site) );
- Contract.EndContractBlock();
- Url = site;
- }
-
- internal UrlIdentityPermission( URLString site )
- {
- m_unrestricted = false;
- m_urls = new URLString[1];
- m_urls[0] = site;
- }
-
- // Internal function to append all the urls in m_urls to the input originList
- internal void AppendOrigin(ArrayList originList)
- {
- if (m_urls == null)
- originList.Add("");
- else
- {
- int n;
- for(n = 0; n < this.m_urls.Length; n++)
- originList.Add(m_urls[n].ToString());
- }
- }
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- public String Url
- {
- set
- {
- m_unrestricted = false;
- if(value == null || value.Length == 0)
- m_urls = null;
- else
- {
- m_urls = new URLString[1];
- m_urls[0] = new URLString( value );
- }
- }
-
- get
- {
- if(m_urls == null)
- return "";
- if(m_urls.Length == 1)
- return m_urls[0].ToString();
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AmbiguousIdentity"));
- }
- }
-
- //------------------------------------------------------
- //
- // PRIVATE AND PROTECTED HELPERS FOR ACCESSORS AND CONSTRUCTORS
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // CODEACCESSPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
-
- public override IPermission Copy()
- {
- UrlIdentityPermission perm = new UrlIdentityPermission( PermissionState.None );
- perm.m_unrestricted = this.m_unrestricted;
- if (this.m_urls != null)
- {
- perm.m_urls = new URLString[this.m_urls.Length];
- int n;
- for(n = 0; n < this.m_urls.Length; n++)
- perm.m_urls[n] = (URLString)this.m_urls[n].Copy();
- }
- return perm;
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- {
- if(m_unrestricted)
- return false;
- if(m_urls == null)
- return true;
- if(m_urls.Length == 0)
- return true;
- return false;
- }
- UrlIdentityPermission that = target as UrlIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(that.m_unrestricted)
- return true;
- if(m_unrestricted)
- return false;
- if(this.m_urls != null)
- {
- foreach(URLString usThis in this.m_urls)
- {
- bool bOK = false;
- if(that.m_urls != null)
- {
- foreach(URLString usThat in that.m_urls)
- {
- if(usThis.IsSubsetOf(usThat))
- {
- bOK = true;
- break;
- }
- }
- }
- if(!bOK)
- return false;
- }
- }
- return true;
- }
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
- UrlIdentityPermission that = target as UrlIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted && that.m_unrestricted)
- {
- UrlIdentityPermission res = new UrlIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if(this.m_unrestricted)
- return that.Copy();
- if(that.m_unrestricted)
- return this.Copy();
- if(this.m_urls == null || that.m_urls == null || this.m_urls.Length == 0 || that.m_urls.Length == 0)
- return null;
- List<URLString> alUrls = new List<URLString>();
- foreach(URLString usThis in this.m_urls)
- {
- foreach(URLString usThat in that.m_urls)
- {
- URLString usInt = (URLString)usThis.Intersect(usThat);
- if(usInt != null)
- alUrls.Add(usInt);
- }
- }
- if(alUrls.Count == 0)
- return null;
- UrlIdentityPermission result = new UrlIdentityPermission(PermissionState.None);
- result.m_urls = alUrls.ToArray();
- return result;
- }
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- {
- if((this.m_urls == null || this.m_urls.Length == 0) && !this.m_unrestricted)
- return null;
- return this.Copy();
- }
- UrlIdentityPermission that = target as UrlIdentityPermission;
- if(that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- if(this.m_unrestricted || that.m_unrestricted)
- {
- UrlIdentityPermission res = new UrlIdentityPermission(PermissionState.None);
- res.m_unrestricted = true;
- return res;
- }
- if (this.m_urls == null || this.m_urls.Length == 0)
- {
- if(that.m_urls == null || that.m_urls.Length == 0)
- return null;
- return that.Copy();
- }
- if(that.m_urls == null || that.m_urls.Length == 0)
- return this.Copy();
- List<URLString> alUrls = new List<URLString>();
- foreach(URLString usThis in this.m_urls)
- alUrls.Add(usThis);
- foreach(URLString usThat in that.m_urls)
- {
- bool bDupe = false;
- foreach(URLString us in alUrls)
- {
- if(usThat.Equals(us))
- {
- bDupe = true;
- break;
- }
- }
- if(!bDupe)
- alUrls.Add(usThat);
- }
- UrlIdentityPermission result = new UrlIdentityPermission(PermissionState.None);
- result.m_urls = alUrls.ToArray();
- return result;
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return UrlIdentityPermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.UrlIdentityPermissionIndex;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/ZoneIdentityPermission.cs b/src/mscorlib/src/System/Security/Permissions/ZoneIdentityPermission.cs
deleted file mode 100644
index 0a5d83e3e8..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/ZoneIdentityPermission.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-
-namespace System.Security.Permissions
-{
- using System;
- using System.Globalization;
- using System.Runtime.Serialization;
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics.Contracts;
-
- [System.Runtime.InteropServices.ComVisible(true)]
- sealed public class ZoneIdentityPermission : CodeAccessPermission, IBuiltInPermission
- {
- //------------------------------------------------------
- //
- // PRIVATE STATE DATA
- //
- //------------------------------------------------------
-
- // Zone Enum Flag
- // ----- ----- -----
- // NoZone -1 0x00
- // MyComputer 0 0x01 (1 << 0)
- // Intranet 1 0x02 (1 << 1)
- // Trusted 2 0x04 (1 << 2)
- // Internet 3 0x08 (1 << 3)
- // Untrusted 4 0x10 (1 << 4)
-
- private const uint AllZones = 0x1f;
- [OptionalField(VersionAdded = 2)]
- private uint m_zones;
-
- //------------------------------------------------------
- //
- // PUBLIC CONSTRUCTORS
- //
- //------------------------------------------------------
-
- public ZoneIdentityPermission(PermissionState state)
- {
- if (state == PermissionState.Unrestricted)
- {
- m_zones = AllZones;
- }
- else if (state == PermissionState.None)
- {
- m_zones = 0;
- }
- else
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- }
- }
-
- public ZoneIdentityPermission( SecurityZone zone )
- {
- this.SecurityZone = zone;
- }
-
- internal ZoneIdentityPermission( uint zones )
- {
- m_zones = (zones & AllZones);
- }
-
- // Internal function to append all the Zone in this permission to the input ArrayList
- internal void AppendZones(ArrayList zoneList)
- {
- int nEnum = 0;
- uint nFlag;
- for(nFlag = 1; nFlag < AllZones; nFlag <<= 1)
- {
- if((m_zones & nFlag) != 0)
- {
- zoneList.Add((SecurityZone)nEnum);
- }
- nEnum++;
- }
- }
-
- //------------------------------------------------------
- //
- // PUBLIC ACCESSOR METHODS
- //
- //------------------------------------------------------
-
- public SecurityZone SecurityZone
- {
- set
- {
- VerifyZone( value );
- if(value == SecurityZone.NoZone)
- m_zones = 0;
- else
- m_zones = (uint)1 << (int)value;
- }
-
- get
- {
- SecurityZone z = SecurityZone.NoZone;
- int nEnum = 0;
- uint nFlag;
- for(nFlag = 1; nFlag < AllZones; nFlag <<= 1)
- {
- if((m_zones & nFlag) != 0)
- {
- if(z == SecurityZone.NoZone)
- z = (SecurityZone)nEnum;
- else
- return SecurityZone.NoZone;
- }
- nEnum++;
- }
- return z;
- }
- }
-
- //------------------------------------------------------
- //
- // PRIVATE AND PROTECTED HELPERS FOR ACCESSORS AND CONSTRUCTORS
- //
- //------------------------------------------------------
-
- private static void VerifyZone( SecurityZone zone )
- {
- if (zone < SecurityZone.NoZone || zone > SecurityZone.Untrusted)
- {
- throw new ArgumentException( Environment.GetResourceString("Argument_IllegalZone") );
- }
- Contract.EndContractBlock();
- }
-
-
- //------------------------------------------------------
- //
- // CODEACCESSPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
- //------------------------------------------------------
- //
- // IPERMISSION IMPLEMENTATION
- //
- //------------------------------------------------------
-
-
- public override IPermission Copy()
- {
- return new ZoneIdentityPermission(this.m_zones);
- }
-
- public override bool IsSubsetOf(IPermission target)
- {
- if (target == null)
- return this.m_zones == 0;
-
- ZoneIdentityPermission that = target as ZoneIdentityPermission;
- if (that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- return (this.m_zones & that.m_zones) == this.m_zones;
- }
-
- public override IPermission Intersect(IPermission target)
- {
- if (target == null)
- return null;
-
- ZoneIdentityPermission that = target as ZoneIdentityPermission;
- if (that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- uint newZones = this.m_zones & that.m_zones;
- if(newZones == 0)
- return null;
- return new ZoneIdentityPermission(newZones);
- }
-
- public override IPermission Union(IPermission target)
- {
- if (target == null)
- return this.m_zones != 0 ? this.Copy() : null;
-
- ZoneIdentityPermission that = target as ZoneIdentityPermission;
- if (that == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
- return new ZoneIdentityPermission(this.m_zones | that.m_zones);
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex()
- {
- return ZoneIdentityPermission.GetTokenIndex();
- }
-
- internal static int GetTokenIndex()
- {
- return BuiltInPermissionIndex.ZoneIdentityPermissionIndex;
- }
-
- }
-}
diff --git a/src/mscorlib/src/System/Security/Permissions/keycontainerpermission.cs b/src/mscorlib/src/System/Security/Permissions/keycontainerpermission.cs
deleted file mode 100644
index 910ebce2f3..0000000000
--- a/src/mscorlib/src/System/Security/Permissions/keycontainerpermission.cs
+++ /dev/null
@@ -1,621 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Permissions {
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Security.Util;
- using System.Globalization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
-[Serializable]
- [Flags]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum KeyContainerPermissionFlags {
- NoFlags = 0x0000,
-
- Create = 0x0001,
- Open = 0x0002,
- Delete = 0x0004,
-
- Import = 0x0010,
- Export = 0x0020,
-
- Sign = 0x0100,
- Decrypt = 0x0200,
-
- ViewAcl = 0x1000,
- ChangeAcl = 0x2000,
-
- AllFlags = 0x3337
- }
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class KeyContainerPermissionAccessEntry {
- private string m_keyStore;
- private string m_providerName;
- private int m_providerType;
- private string m_keyContainerName;
- private int m_keySpec;
- private KeyContainerPermissionFlags m_flags;
-
- internal KeyContainerPermissionAccessEntry(KeyContainerPermissionAccessEntry accessEntry) :
- this (accessEntry.KeyStore, accessEntry.ProviderName, accessEntry.ProviderType, accessEntry.KeyContainerName,
- accessEntry.KeySpec, accessEntry.Flags) {
- }
-
- public KeyContainerPermissionAccessEntry(string keyContainerName, KeyContainerPermissionFlags flags) :
- this (null, null, -1, keyContainerName, -1, flags) {
- }
-
-
- public KeyContainerPermissionAccessEntry(string keyStore, string providerName, int providerType,
- string keyContainerName, int keySpec, KeyContainerPermissionFlags flags) {
- m_providerName = (providerName == null ? "*" : providerName);
- m_providerType = providerType;
- m_keyContainerName = (keyContainerName == null ? "*" : keyContainerName);
- m_keySpec = keySpec;
- KeyStore = keyStore;
- Flags = flags;
- }
-
- public string KeyStore {
- get {
- return m_keyStore;
- }
- set {
- // Unrestricted entries are invalid; they should not be allowed.
- if (IsUnrestrictedEntry(value, this.ProviderName, this.ProviderType, this.KeyContainerName, this.KeySpec))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidAccessEntry"));
-
- if (value == null) {
- m_keyStore = "*";
- } else {
- if (value != "User" && value != "Machine" && value != "*")
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidKeyStore", value), nameof(value));
- m_keyStore = value;
- }
- }
- }
-
- public string ProviderName {
- get {
- return m_providerName;
- }
- set {
- // Unrestricted entries are invalid; they should not be allowed.
- if (IsUnrestrictedEntry(this.KeyStore, value, this.ProviderType, this.KeyContainerName, this.KeySpec))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidAccessEntry"));
-
- if (value == null)
- m_providerName = "*";
- else
- m_providerName = value;
- }
- }
-
- public int ProviderType {
- get {
- return m_providerType;
- }
- set {
- // Unrestricted entries are invalid; they should not be allowed.
- if (IsUnrestrictedEntry(this.KeyStore, this.ProviderName, value, this.KeyContainerName, this.KeySpec))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidAccessEntry"));
-
- m_providerType = value;
- }
- }
-
- public string KeyContainerName {
- get {
- return m_keyContainerName;
- }
- set {
- // Unrestricted entries are invalid; they should not be allowed.
- if (IsUnrestrictedEntry(this.KeyStore, this.ProviderName, this.ProviderType, value, this.KeySpec))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidAccessEntry"));
-
- if (value == null)
- m_keyContainerName = "*";
- else
- m_keyContainerName = value;
- }
- }
-
- public int KeySpec {
- get {
- return m_keySpec;
- }
- set {
- // Unrestricted entries are invalid; they should not be allowed.
- if (IsUnrestrictedEntry(this.KeyStore, this.ProviderName, this.ProviderType, this.KeyContainerName, value))
- throw new ArgumentException(Environment.GetResourceString("Arg_InvalidAccessEntry"));
-
- m_keySpec = value;
- }
- }
-
- public KeyContainerPermissionFlags Flags {
- get {
- return m_flags;
- }
- set {
- KeyContainerPermission.VerifyFlags(value);
- m_flags = value;
- }
- }
-
- public override bool Equals (Object o) {
- KeyContainerPermissionAccessEntry accessEntry = o as KeyContainerPermissionAccessEntry;
- if (accessEntry == null)
- return false;
-
- if (accessEntry.m_keyStore != m_keyStore) return false;
- if (accessEntry.m_providerName != m_providerName) return false;
- if (accessEntry.m_providerType != m_providerType) return false;
- if (accessEntry.m_keyContainerName != m_keyContainerName) return false;
- if (accessEntry.m_keySpec != m_keySpec) return false;
-
- return true;
- }
-
- public override int GetHashCode () {
- int hash = 0;
-
- hash |= (this.m_keyStore.GetHashCode() & 0x000000FF) << 24;
- hash |= (this.m_providerName.GetHashCode() & 0x000000FF) << 16;
- hash |= (this.m_providerType & 0x0000000F) << 12;
- hash |= (this.m_keyContainerName.GetHashCode() & 0x000000FF) << 4;
- hash |= (this.m_keySpec & 0x0000000F);
-
- return hash;
- }
-
- internal bool IsSubsetOf (KeyContainerPermissionAccessEntry target) {
- if (target.m_keyStore != "*" && this.m_keyStore != target.m_keyStore)
- return false;
- if (target.m_providerName != "*" && this.m_providerName != target.m_providerName)
- return false;
- if (target.m_providerType != -1 && this.m_providerType != target.m_providerType)
- return false;
- if (target.m_keyContainerName != "*" && this.m_keyContainerName != target.m_keyContainerName)
- return false;
- if (target.m_keySpec != -1 && this.m_keySpec != target.m_keySpec)
- return false;
-
- return true;
- }
-
- internal static bool IsUnrestrictedEntry (string keyStore, string providerName, int providerType,
- string keyContainerName, int keySpec) {
- if (keyStore != "*" && keyStore != null) return false;
- if (providerName != "*" && providerName != null) return false;
- if (providerType != -1) return false;
- if (keyContainerName != "*" && keyContainerName != null) return false;
- if (keySpec != -1) return false;
-
- return true;
- }
- }
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class KeyContainerPermissionAccessEntryCollection : ICollection {
- private ArrayList m_list;
- private KeyContainerPermissionFlags m_globalFlags;
-
- private KeyContainerPermissionAccessEntryCollection () {}
- internal KeyContainerPermissionAccessEntryCollection (KeyContainerPermissionFlags globalFlags) {
- m_list = new ArrayList();
- m_globalFlags = globalFlags;
- }
-
- public KeyContainerPermissionAccessEntry this[int index] {
- get {
- if (index < 0)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumNotStarted"));
- if (index >= Count)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- Contract.EndContractBlock();
-
- return (KeyContainerPermissionAccessEntry)m_list[index];
- }
- }
-
- public int Count {
- get {
- return m_list.Count;
- }
- }
-
- public int Add (KeyContainerPermissionAccessEntry accessEntry) {
- if (accessEntry == null)
- throw new ArgumentNullException(nameof(accessEntry));
- Contract.EndContractBlock();
-
- int index = m_list.IndexOf(accessEntry);
- if (index == -1) {
- if (accessEntry.Flags != m_globalFlags) {
- return m_list.Add(accessEntry);
- }
- else
- return -1;
- } else {
- // We pick up the intersection of the 2 flags. This is the secure choice
- // so we are opting for it.
- ((KeyContainerPermissionAccessEntry)m_list[index]).Flags &= accessEntry.Flags;
- return index;
- }
- }
-
- public void Clear () {
- m_list.Clear();
- }
-
- public int IndexOf (KeyContainerPermissionAccessEntry accessEntry) {
- return m_list.IndexOf(accessEntry);
- }
-
- public void Remove (KeyContainerPermissionAccessEntry accessEntry) {
- if (accessEntry == null)
- throw new ArgumentNullException(nameof(accessEntry));
- Contract.EndContractBlock();
- m_list.Remove(accessEntry);
- }
-
- public KeyContainerPermissionAccessEntryEnumerator GetEnumerator () {
- return new KeyContainerPermissionAccessEntryEnumerator(this);
- }
-
- /// <internalonly/>
- IEnumerator IEnumerable.GetEnumerator () {
- return new KeyContainerPermissionAccessEntryEnumerator(this);
- }
-
- /// <internalonly/>
- void ICollection.CopyTo (Array array, int index) {
- if (array == null)
- throw new ArgumentNullException(nameof(array));
- if (array.Rank != 1)
- throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported"));
- if (index < 0 || index >= array.Length)
- throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index"));
- if (index + this.Count > array.Length)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
- Contract.EndContractBlock();
-
- for (int i=0; i < this.Count; i++) {
- array.SetValue(this[i], index);
- index++;
- }
- }
-
- public void CopyTo (KeyContainerPermissionAccessEntry[] array, int index) {
- ((ICollection)this).CopyTo(array, index);
- }
-
- public bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public Object SyncRoot {
- get {
- return this;
- }
- }
- }
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class KeyContainerPermissionAccessEntryEnumerator : IEnumerator {
- private KeyContainerPermissionAccessEntryCollection m_entries;
- private int m_current;
-
- private KeyContainerPermissionAccessEntryEnumerator () {}
- internal KeyContainerPermissionAccessEntryEnumerator (KeyContainerPermissionAccessEntryCollection entries) {
- m_entries = entries;
- m_current = -1;
- }
-
- public KeyContainerPermissionAccessEntry Current {
- get {
- return m_entries[m_current];
- }
- }
-
- /// <internalonly/>
- Object IEnumerator.Current {
- get {
- return (Object) m_entries[m_current];
- }
- }
-
- public bool MoveNext() {
- if (m_current == ((int) m_entries.Count - 1))
- return false;
- m_current++;
- return true;
- }
-
- public void Reset() {
- m_current = -1;
- }
- }
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class KeyContainerPermission : CodeAccessPermission, IUnrestrictedPermission, IBuiltInPermission {
- private KeyContainerPermissionFlags m_flags;
- private KeyContainerPermissionAccessEntryCollection m_accessEntries;
-
- public KeyContainerPermission (PermissionState state) {
- if (state == PermissionState.Unrestricted)
- m_flags = KeyContainerPermissionFlags.AllFlags;
- else if (state == PermissionState.None)
- m_flags = KeyContainerPermissionFlags.NoFlags;
- else
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
- m_accessEntries = new KeyContainerPermissionAccessEntryCollection(m_flags);
- }
-
- public KeyContainerPermission (KeyContainerPermissionFlags flags) {
- VerifyFlags(flags);
- m_flags = flags;
- m_accessEntries = new KeyContainerPermissionAccessEntryCollection(m_flags);
- }
-
- public KeyContainerPermission (KeyContainerPermissionFlags flags, KeyContainerPermissionAccessEntry[] accessList) {
- if (accessList == null)
- throw new ArgumentNullException(nameof(accessList));
- Contract.EndContractBlock();
-
- VerifyFlags(flags);
- m_flags = flags;
- m_accessEntries = new KeyContainerPermissionAccessEntryCollection(m_flags);
- for (int index = 0; index < accessList.Length; index++) {
- m_accessEntries.Add(accessList[index]);
- }
- }
-
- public KeyContainerPermissionFlags Flags {
- get {
- return m_flags;
- }
- }
-
- public KeyContainerPermissionAccessEntryCollection AccessEntries {
- get {
- return m_accessEntries;
- }
- }
-
- public bool IsUnrestricted () {
- if (m_flags != KeyContainerPermissionFlags.AllFlags)
- return false;
-
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- if ((accessEntry.Flags & KeyContainerPermissionFlags.AllFlags) != KeyContainerPermissionFlags.AllFlags)
- return false;
- }
-
- return true;
- }
-
- private bool IsEmpty () {
- if (this.Flags == KeyContainerPermissionFlags.NoFlags) {
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- if (accessEntry.Flags != KeyContainerPermissionFlags.NoFlags)
- return false;
- }
- return true;
- }
- return false;
- }
-
- //
- // IPermission implementation
- //
-
- public override bool IsSubsetOf (IPermission target) {
- if (target == null)
- return IsEmpty();
-
- if (!VerifyType(target))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
-
- KeyContainerPermission operand = (KeyContainerPermission) target;
-
- // since there are containers that are neither in the access list of the source, nor in the
- // access list of the target, the source flags must be a subset of the target flags.
- if ((this.m_flags & operand.m_flags) != this.m_flags)
- return false;
-
- // Any entry in the source should have "applicable" flags in the destination that actually
- // are less restrictive than the flags in the source.
-
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- KeyContainerPermissionFlags targetFlags = GetApplicableFlags(accessEntry, operand);
- if ((accessEntry.Flags & targetFlags) != accessEntry.Flags)
- return false;
- }
-
- // Any entry in the target should have "applicable" flags in the source that actually
- // are more restrictive than the flags in the target.
-
- foreach (KeyContainerPermissionAccessEntry accessEntry in operand.AccessEntries) {
- KeyContainerPermissionFlags sourceFlags = GetApplicableFlags(accessEntry, this);
- if ((sourceFlags & accessEntry.Flags) != sourceFlags)
- return false;
- }
-
- return true;
- }
-
- public override IPermission Intersect (IPermission target) {
- if (target == null)
- return null;
-
- if (!VerifyType(target))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
-
- KeyContainerPermission operand = (KeyContainerPermission) target;
- if (this.IsEmpty() || operand.IsEmpty())
- return null;
-
- KeyContainerPermissionFlags flags_intersect = operand.m_flags & this.m_flags;
- KeyContainerPermission cp = new KeyContainerPermission(flags_intersect);
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- cp.AddAccessEntryAndIntersect(accessEntry, operand);
- }
- foreach (KeyContainerPermissionAccessEntry accessEntry in operand.AccessEntries) {
- cp.AddAccessEntryAndIntersect(accessEntry, this);
- }
- return cp.IsEmpty() ? null : cp;
- }
-
- public override IPermission Union (IPermission target) {
- if (target == null)
- return this.Copy();
-
- if (!VerifyType(target))
- throw new ArgumentException(Environment.GetResourceString("Argument_WrongType", this.GetType().FullName));
-
- KeyContainerPermission operand = (KeyContainerPermission) target;
- if (this.IsUnrestricted() || operand.IsUnrestricted())
- return new KeyContainerPermission(PermissionState.Unrestricted);
-
- KeyContainerPermissionFlags flags_union = (KeyContainerPermissionFlags) (m_flags | operand.m_flags);
- KeyContainerPermission cp = new KeyContainerPermission(flags_union);
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- cp.AddAccessEntryAndUnion(accessEntry, operand);
- }
- foreach (KeyContainerPermissionAccessEntry accessEntry in operand.AccessEntries) {
- cp.AddAccessEntryAndUnion(accessEntry, this);
- }
- return cp.IsEmpty() ? null : cp;
- }
-
- public override IPermission Copy () {
- if (this.IsEmpty())
- return null;
-
- KeyContainerPermission cp = new KeyContainerPermission((KeyContainerPermissionFlags)m_flags);
- foreach (KeyContainerPermissionAccessEntry accessEntry in AccessEntries) {
- cp.AccessEntries.Add(accessEntry);
- }
- return cp;
- }
-
- /// <internalonly/>
- int IBuiltInPermission.GetTokenIndex () {
- return KeyContainerPermission.GetTokenIndex();
- }
-
- //
- // private methods
- //
-
- private void AddAccessEntries(SecurityElement securityElement) {
- if (securityElement.InternalChildren != null && securityElement.InternalChildren.Count != 0) {
- IEnumerator elemEnumerator = securityElement.Children.GetEnumerator();
- while (elemEnumerator.MoveNext()) {
- SecurityElement current = (SecurityElement) elemEnumerator.Current;
- if (current != null) {
- if (String.Equals(current.Tag, "AccessEntry")) {
- int iMax = current.m_lAttributes.Count;
- Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
- string keyStore = null;
- string providerName = null;
- int providerType = -1;
- string keyContainerName = null;
- int keySpec = -1;
- KeyContainerPermissionFlags flags = KeyContainerPermissionFlags.NoFlags;
- for (int i = 0; i < iMax; i += 2) {
- String strAttrName = (String) current.m_lAttributes[i];
- String strAttrValue = (String) current.m_lAttributes[i+1];
- if (String.Equals(strAttrName, "KeyStore"))
- keyStore = strAttrValue;
- if (String.Equals(strAttrName, "ProviderName"))
- providerName = strAttrValue;
- else if (String.Equals(strAttrName, "ProviderType"))
- providerType = Convert.ToInt32(strAttrValue, null);
- else if (String.Equals(strAttrName, "KeyContainerName"))
- keyContainerName = strAttrValue;
- else if (String.Equals(strAttrName, "KeySpec"))
- keySpec = Convert.ToInt32(strAttrValue, null);
- else if (String.Equals(strAttrName, "Flags")) {
- flags = (KeyContainerPermissionFlags) Enum.Parse(typeof(KeyContainerPermissionFlags), strAttrValue);
- }
- }
- KeyContainerPermissionAccessEntry accessEntry = new KeyContainerPermissionAccessEntry(keyStore, providerName, providerType, keyContainerName, keySpec, flags);
- AccessEntries.Add(accessEntry);
- }
- }
- }
- }
- }
-
- private void AddAccessEntryAndUnion (KeyContainerPermissionAccessEntry accessEntry, KeyContainerPermission target) {
- KeyContainerPermissionAccessEntry newAccessEntry = new KeyContainerPermissionAccessEntry(accessEntry);
- newAccessEntry.Flags |= GetApplicableFlags(accessEntry, target);
- AccessEntries.Add(newAccessEntry);
- }
-
- private void AddAccessEntryAndIntersect (KeyContainerPermissionAccessEntry accessEntry, KeyContainerPermission target) {
- KeyContainerPermissionAccessEntry newAccessEntry = new KeyContainerPermissionAccessEntry(accessEntry);
- newAccessEntry.Flags &= GetApplicableFlags(accessEntry, target);
- AccessEntries.Add(newAccessEntry);
- }
-
- //
- // private/internal static methods.
- //
-
- internal static void VerifyFlags (KeyContainerPermissionFlags flags) {
- if ((flags & ~KeyContainerPermissionFlags.AllFlags) != 0)
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)flags));
- Contract.EndContractBlock();
- }
-
- private static KeyContainerPermissionFlags GetApplicableFlags (KeyContainerPermissionAccessEntry accessEntry, KeyContainerPermission target) {
- KeyContainerPermissionFlags flags = KeyContainerPermissionFlags.NoFlags;
- bool applyDefaultFlags = true;
-
- // If the entry exists in the target, return the flag of the target entry.
- int index = target.AccessEntries.IndexOf(accessEntry);
- if (index != -1) {
- flags = ((KeyContainerPermissionAccessEntry)target.AccessEntries[index]).Flags;
- return flags;
- }
-
- // Intersect the flags in all the target entries that apply to the current access entry,
- foreach (KeyContainerPermissionAccessEntry targetAccessEntry in target.AccessEntries) {
- if (accessEntry.IsSubsetOf(targetAccessEntry)) {
- if (applyDefaultFlags == false) {
- flags &= targetAccessEntry.Flags;
- } else {
- flags = targetAccessEntry.Flags;
- applyDefaultFlags = false;
- }
- }
- }
-
- // If no target entry applies to the current entry, the default global flag applies.
- if (applyDefaultFlags)
- flags = target.Flags;
-
- return flags;
- }
-
- private static int GetTokenIndex() {
- return BuiltInPermissionIndex.KeyContainerPermissionIndex;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/ApplicationTrust.cs b/src/mscorlib/src/System/Security/Policy/ApplicationTrust.cs
index 712801a812..917582f480 100644
--- a/src/mscorlib/src/System/Security/Policy/ApplicationTrust.cs
+++ b/src/mscorlib/src/System/Security/Policy/ApplicationTrust.cs
@@ -21,14 +21,8 @@ namespace System.Security.Policy
using System.Diagnostics.Contracts;
[System.Runtime.InteropServices.ComVisible(true)]
- public enum ApplicationVersionMatch {
- MatchExactVersion,
- MatchAllVersions
- }
-
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
- public sealed class ApplicationTrust : EvidenceBase, ISecurityEncodable
+ internal sealed class ApplicationTrust : EvidenceBase
{
private PolicyStatement m_psDefaultGrant;
private IList<StrongName> m_fullTrustAssemblies;
@@ -58,25 +52,6 @@ namespace System.Security.Policy
m_fullTrustAssemblies = new List<StrongName>().AsReadOnly();
}
- public ApplicationTrust(PermissionSet defaultGrantSet, IEnumerable<StrongName> fullTrustAssemblies) {
- if (fullTrustAssemblies == null) {
- throw new ArgumentNullException(nameof(fullTrustAssemblies));
- }
-
- InitDefaultGrantSet(defaultGrantSet);
-
- List<StrongName> fullTrustList = new List<StrongName>();
- foreach (StrongName strongName in fullTrustAssemblies) {
- if (strongName == null) {
- throw new ArgumentException(Environment.GetResourceString("Argument_NullFullTrustAssembly"), nameof(fullTrustAssemblies));
- }
-
- fullTrustList.Add(new StrongName(strongName.PublicKey, strongName.Name, strongName.Version));
- }
-
- m_fullTrustAssemblies = fullTrustList.AsReadOnly();
- }
-
// Sets up the default grant set for all constructors. Extracted to avoid the cost of
// IEnumerable virtual dispatches on startup when there are no fullTrustAssemblies (CoreCLR)
private void InitDefaultGrantSet(PermissionSet defaultGrantSet) {
@@ -107,16 +82,5 @@ namespace System.Security.Policy
}
}
}
-
- public IList<StrongName> FullTrustAssemblies {
- get {
- return m_fullTrustAssemblies;
- }
- }
-
- public override EvidenceBase Clone()
- {
- return base.Clone();
- }
}
}
diff --git a/src/mscorlib/src/System/Security/Policy/Evidence.cs b/src/mscorlib/src/System/Security/Policy/Evidence.cs
index 7894736fa8..783f8de24f 100644
--- a/src/mscorlib/src/System/Security/Policy/Evidence.cs
+++ b/src/mscorlib/src/System/Security/Policy/Evidence.cs
@@ -25,7 +25,7 @@ namespace System.Security.Policy
/// EvidenceTypeDescriptor appropriately.
/// </summary>
[ComVisible(true)]
- public sealed class Evidence
+ internal sealed class Evidence
{
}
}
diff --git a/src/mscorlib/src/System/Security/Policy/EvidenceBase.cs b/src/mscorlib/src/System/Security/Policy/EvidenceBase.cs
index 963edd4e2d..4acf282ab9 100644
--- a/src/mscorlib/src/System/Security/Policy/EvidenceBase.cs
+++ b/src/mscorlib/src/System/Security/Policy/EvidenceBase.cs
@@ -20,136 +20,10 @@ namespace System.Security.Policy
/// </summary>
[ComVisible(true)]
[Serializable]
- public abstract class EvidenceBase
+ internal abstract class EvidenceBase
{
protected EvidenceBase()
{
}
-
- /// <remarks>
- /// Since legacy evidence objects would be cloned by being serialized, the default implementation
- /// of EvidenceBase will do the same.
- /// </remarks>
- public virtual EvidenceBase Clone()
- {
- throw new NotImplementedException();
- }
- }
-
- /// <summary>
- /// Interface for types which wrap Whidbey evidence objects for compatibility with v4 evidence rules
- /// </summary>
- internal interface ILegacyEvidenceAdapter
- {
- object EvidenceObject { get; }
- Type EvidenceType { get; }
- }
-
- /// <summary>
- /// Wrapper class to hold legacy evidence objects which do not derive from EvidenceBase, and allow
- /// them to be held in the Evidence collection which expects to maintain lists of EvidenceBase only
- /// </summary>
- [Serializable]
- internal sealed class LegacyEvidenceWrapper : EvidenceBase, ILegacyEvidenceAdapter
- {
- private object m_legacyEvidence;
-
- internal LegacyEvidenceWrapper(object legacyEvidence)
- {
- Debug.Assert(legacyEvidence != null);
- Debug.Assert(legacyEvidence.GetType() != typeof(EvidenceBase), "Attempt to wrap an EvidenceBase in a LegacyEvidenceWrapper");
- Debug.Assert(legacyEvidence.GetType().IsSerializable, "legacyEvidence.GetType().IsSerializable");
-
- m_legacyEvidence = legacyEvidence;
- }
-
- public object EvidenceObject
- {
- get { return m_legacyEvidence; }
- }
-
- public Type EvidenceType
- {
- get { return m_legacyEvidence.GetType(); }
- }
-
- public override bool Equals(object obj)
- {
- return m_legacyEvidence.Equals(obj);
- }
-
- public override int GetHashCode()
- {
- return m_legacyEvidence.GetHashCode();
- }
-
- public override EvidenceBase Clone()
- {
- return base.Clone();
- }
- }
-
- /// <summary>
- /// Pre-v4 versions of the runtime allow multiple pieces of evidence that all have the same type.
- /// This type wraps those evidence objects into a single type of list, allowing legacy code to continue
- /// to work with the Evidence collection that does not expect multiple evidences of the same type.
- ///
- /// This may not be limited to LegacyEvidenceWrappers, since it's valid for legacy code to add multiple
- /// objects of built-in evidence to an Evidence collection. The built-in evidence now derives from
- /// EvienceObject, so when the legacy code runs on v4, it may end up attempting to add multiple
- /// Hash evidences for intsance.
- /// </summary>
- [Serializable]
- internal sealed class LegacyEvidenceList : EvidenceBase, IEnumerable<EvidenceBase>, ILegacyEvidenceAdapter
- {
- private List<EvidenceBase> m_legacyEvidenceList = new List<EvidenceBase>();
-
- public object EvidenceObject
- {
- get
- {
- // We'll choose the first item in the list to represent us if we're forced to return only
- // one object. This can occur if multiple pieces of evidence are added via the legacy APIs,
- // and then the new APIs are used to retrieve that evidence.
- return m_legacyEvidenceList.Count > 0 ? m_legacyEvidenceList[0] : null;
- }
- }
-
- public Type EvidenceType
- {
- get
- {
- Debug.Assert(m_legacyEvidenceList.Count > 0, "No items in LegacyEvidenceList, cannot tell what type they are");
-
- ILegacyEvidenceAdapter adapter = m_legacyEvidenceList[0] as ILegacyEvidenceAdapter;
- return adapter == null ? m_legacyEvidenceList[0].GetType() : adapter.EvidenceType;
- }
- }
-
- public void Add(EvidenceBase evidence)
- {
- Debug.Assert(evidence != null);
- Debug.Assert(m_legacyEvidenceList.Count == 0 || EvidenceType == evidence.GetType() || (evidence is LegacyEvidenceWrapper && (evidence as LegacyEvidenceWrapper).EvidenceType == EvidenceType),
- "LegacyEvidenceList must be homogeonous");
- Debug.Assert(evidence.GetType() != typeof(LegacyEvidenceList),
- "Attempt to add a legacy evidence list to another legacy evidence list");
-
- m_legacyEvidenceList.Add(evidence);
- }
-
- public IEnumerator<EvidenceBase> GetEnumerator()
- {
- return m_legacyEvidenceList.GetEnumerator();
- }
-
- IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return m_legacyEvidenceList.GetEnumerator();
- }
-
- public override EvidenceBase Clone()
- {
- return base.Clone();
- }
}
}
diff --git a/src/mscorlib/src/System/Security/Policy/EvidenceTypeDescriptor.cs b/src/mscorlib/src/System/Security/Policy/EvidenceTypeDescriptor.cs
deleted file mode 100644
index 8deb145102..0000000000
--- a/src/mscorlib/src/System/Security/Policy/EvidenceTypeDescriptor.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-using System.Runtime.Serialization;
-
-namespace System.Security.Policy
-{
- /// <summary>
- /// Descriptor stored in the Evidence collection to detail the information we have about a type of
- /// evidence. This descriptor also stores any evidence that's been generated of the specific type.
- /// </summary>
- [Serializable]
- internal sealed class EvidenceTypeDescriptor
- {
- [NonSerialized]
- private bool m_hostCanGenerate;
-
- [NonSerialized]
- private bool m_generated;
-
- private EvidenceBase m_hostEvidence;
- private EvidenceBase m_assemblyEvidence;
-
- // EvidenceTypeDescriptors are stored in Evidence indexed by the type they describe, so this
- // information is redundant. We keep it around in checked builds to help debugging, but we can drop
- // it from retial builds.
-#if _DEBUG
- [NonSerialized]
- private Type m_evidenceType;
-#endif // _DEBUG
-
- public EvidenceTypeDescriptor()
- {
- }
-
- /// <summary>
- /// Make a deep copy of a type descriptor
- /// </summary>
- private EvidenceTypeDescriptor(EvidenceTypeDescriptor descriptor)
- {
- Debug.Assert(descriptor != null);
-
- m_hostCanGenerate = descriptor.m_hostCanGenerate;
-
- if (descriptor.m_assemblyEvidence != null)
- {
- m_assemblyEvidence = descriptor.m_assemblyEvidence.Clone() as EvidenceBase;
- }
- if (descriptor.m_hostEvidence != null)
- {
- m_hostEvidence = descriptor.m_hostEvidence.Clone() as EvidenceBase;
- }
-
-#if _DEBUG
- m_evidenceType = descriptor.m_evidenceType;
-#endif // _DEBUG
- }
-
- /// <summary>
- /// Evidence of this type supplied by the assembly
- /// </summary>
- public EvidenceBase AssemblyEvidence
- {
- get { return m_assemblyEvidence; }
-
- set
- {
- Debug.Assert(value != null);
-#if _DEBUG
- Debug.Assert(CheckEvidenceType(value), "Incorrect type of AssemblyEvidence set");
-#endif
- m_assemblyEvidence = value;
- }
- }
-
- /// <summary>
- /// Flag indicating that we've already attempted to generate this type of evidence
- /// </summary>
- public bool Generated
- {
- get { return m_generated; }
-
- set
- {
- Debug.Assert(value, "Attempt to clear the Generated flag");
- m_generated = value;
- }
- }
-
- /// <summary>
- /// Has the HostSecurityManager has told us that it can potentially generate evidence of this type
- /// </summary>
- public bool HostCanGenerate
- {
- get { return m_hostCanGenerate; }
-
- set
- {
- Debug.Assert(value, "Attempt to clear HostCanGenerate flag");
- m_hostCanGenerate = value;
- }
- }
-
- /// <summary>
- /// Evidence of this type supplied by the CLR or the host
- /// </summary>
- public EvidenceBase HostEvidence
- {
- get { return m_hostEvidence; }
-
- set
- {
- Debug.Assert(value != null);
-#if _DEBUG
- Debug.Assert(CheckEvidenceType(value), "Incorrect type of HostEvidence set");
-#endif
- m_hostEvidence = value;
- }
- }
-
-#if _DEBUG
- /// <summary>
- /// Verify that evidence being stored in this descriptor is of the correct type
- /// </summary>
- private bool CheckEvidenceType(EvidenceBase evidence)
- {
- Debug.Assert(evidence != null);
-
- ILegacyEvidenceAdapter legacyAdapter = evidence as ILegacyEvidenceAdapter;
- Type storedType = legacyAdapter == null ? evidence.GetType() : legacyAdapter.EvidenceType;
-
- return m_evidenceType == null || m_evidenceType.IsAssignableFrom(storedType);
- }
-#endif // _DEBUG
-
- /// <summary>
- /// Make a deep copy of this descriptor
- /// </summary>
- public EvidenceTypeDescriptor Clone()
- {
- return new EvidenceTypeDescriptor(this);
- }
-
-#if _DEBUG
- /// <summary>
- /// Set the type that this evidence descriptor refers to.
- /// </summary>
- internal void SetEvidenceType(Type evidenceType)
- {
- Debug.Assert(evidenceType != null);
- Debug.Assert(m_evidenceType == null, "Attempt to reset evidence type");
-
- m_evidenceType = evidenceType;
- }
-#endif // _DEBUG
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/IDelayEvaluatedEvidence.cs b/src/mscorlib/src/System/Security/Policy/IDelayEvaluatedEvidence.cs
deleted file mode 100644
index 8f8c07c9e4..0000000000
--- a/src/mscorlib/src/System/Security/Policy/IDelayEvaluatedEvidence.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-
-namespace System.Security.Policy {
- /// <summary>
- /// Interface for evidence objects that support being "unverified". For instance, StrongName
- /// evidence for a strong name signature which was not yet verified. This interface is used to
- /// keep track of weather or not the evidence object was needed to compute a grant set. If it was,
- /// then we can force verificaiton of the evidence object -- if not we can save time by not doing
- /// any verification on it. (Since we didn't use it for policy resolution, it wouldn't have
- /// mattered if the evidence was not present in the first place).
- /// </summary>
- internal interface IDelayEvaluatedEvidence {
- /// <summary>
- /// Is this evidence object verified yet?
- /// </summary>
- bool IsVerified
- {
- get;
- }
-
- /// <summary>
- /// Was this evidence object used during the course of policy evaluation?
- /// </summary>
- bool WasUsed { get; }
-
- /// <summary>
- /// Mark the object as used
- /// </summary>
- void MarkUsed();
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/IIdentityPermissionFactory.cs b/src/mscorlib/src/System/Security/Policy/IIdentityPermissionFactory.cs
deleted file mode 100644
index a46f39602d..0000000000
--- a/src/mscorlib/src/System/Security/Policy/IIdentityPermissionFactory.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-// All Identities will implement this interface.
-//
-
-namespace System.Security.Policy {
- using System.Runtime.Remoting;
- using System;
- using System.Security.Util;
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface IIdentityPermissionFactory
- {
- IPermission CreateIdentityPermission( Evidence evidence );
- }
-
-}
diff --git a/src/mscorlib/src/System/Security/Policy/IRuntimeEvidenceFactory.cs b/src/mscorlib/src/System/Security/Policy/IRuntimeEvidenceFactory.cs
deleted file mode 100644
index 98467fe367..0000000000
--- a/src/mscorlib/src/System/Security/Policy/IRuntimeEvidenceFactory.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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;
-using System.Collections.Generic;
-
-namespace System.Security.Policy
-{
- /// <summary>
- /// IRuntimeEvidenceFactory is implemented by runtime types which the CLR knows how to delay
- /// generate evidence for. It is used by the Evidence class to get evidence on demand when we first
- /// need it.
- /// </summary>
- internal interface IRuntimeEvidenceFactory
- {
- /// <summary>
- /// Object which the evidence generated by this factory is used for
- /// </summary>
- IEvidenceFactory Target { get; }
-
- /// <summary>
- /// Get the collection of evidence objects supplied by the factory itself, rather than by the
- /// runtime.
- /// </summary>
- IEnumerable<EvidenceBase> GetFactorySuppliedEvidence();
-
- /// <summary>
- /// Generate a specific type of evidence for this object, returning null if the specified type of
- /// evidence cannot be generated.
- /// </summary>
- EvidenceBase GenerateEvidence(Type evidenceType);
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/PolicyException.cs b/src/mscorlib/src/System/Security/Policy/PolicyException.cs
deleted file mode 100644
index 68e87f780d..0000000000
--- a/src/mscorlib/src/System/Security/Policy/PolicyException.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-//
-// Use this class to throw a PolicyException
-//
-
-namespace System.Security.Policy {
-
- using System;
- using System.Runtime.Serialization;
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public class PolicyException : SystemException
- {
- public PolicyException()
-
- : base(Environment.GetResourceString( "Policy_Default" )) {
- HResult = __HResults.CORSEC_E_POLICY_EXCEPTION;
- }
-
- public PolicyException(String message)
-
- : base(message) {
- HResult = __HResults.CORSEC_E_POLICY_EXCEPTION;
- }
-
- public PolicyException(String message, Exception exception)
-
- : base(message, exception) {
- HResult = __HResults.CORSEC_E_POLICY_EXCEPTION;
- }
-
- protected PolicyException(SerializationInfo info, StreamingContext context) : base (info, context) {}
-
- internal PolicyException(String message, int hresult) : base (message)
- {
- HResult = hresult;
- }
-
- internal PolicyException(String message, int hresult, Exception exception) : base (message, exception)
- {
- HResult = hresult;
- }
-
- }
-
-}
diff --git a/src/mscorlib/src/System/Security/Policy/PolicyStatement.cs b/src/mscorlib/src/System/Security/Policy/PolicyStatement.cs
index 9b58ece9f1..6acf7a7988 100644
--- a/src/mscorlib/src/System/Security/Policy/PolicyStatement.cs
+++ b/src/mscorlib/src/System/Security/Policy/PolicyStatement.cs
@@ -20,7 +20,7 @@ namespace System.Security.Policy {
[Serializable]
[Flags]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum PolicyStatementAttribute
+ internal enum PolicyStatementAttribute
{
Nothing = 0x0,
Exclusive = 0x01,
@@ -30,7 +30,7 @@ namespace System.Security.Policy {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- sealed public class PolicyStatement : ISecurityPolicyEncodable, ISecurityEncodable
+ sealed internal class PolicyStatement
{
// The PermissionSet associated with this policy
internal PermissionSet m_permSet;
@@ -64,23 +64,6 @@ namespace System.Security.Policy {
m_attributes = attributes;
}
}
-
- private PolicyStatement( PermissionSet permSet, PolicyStatementAttribute attributes, bool copy )
- {
- if (permSet != null)
- {
- if (copy)
- m_permSet = permSet.Copy();
- else
- m_permSet = permSet;
- }
- else
- {
- m_permSet = new PermissionSet( false );
- }
-
- m_attributes = attributes;
- }
public PermissionSet PermissionSet
{
@@ -107,65 +90,6 @@ namespace System.Security.Policy {
}
}
}
-
- internal void SetPermissionSetNoCopy( PermissionSet permSet )
- {
- m_permSet = permSet;
- }
-
- internal PermissionSet GetPermissionSetNoCopy()
- {
- lock (this)
- {
- return m_permSet;
- }
- }
-
- public PolicyStatementAttribute Attributes
- {
- get
- {
- return m_attributes;
- }
-
- set
- {
- if (ValidProperties( value ))
- {
- m_attributes = value;
- }
- }
- }
-
- public PolicyStatement Copy()
- {
- // The PolicyStatement .ctor will copy the permission set
- return new PolicyStatement(m_permSet, Attributes, true);
- }
-
- public String AttributeString
- {
- get
- {
- StringBuilder sb = new StringBuilder();
-
- bool first = true;
-
- if (GetFlag((int) PolicyStatementAttribute.Exclusive ))
- {
- sb.Append( "Exclusive" );
- first = false;
- }
- if (GetFlag((int) PolicyStatementAttribute.LevelFinal ))
- {
- if (!first)
- sb.Append( " " );
- sb.Append( "LevelFinal" );
- }
-
- return sb.ToString();
- }
- }
private static bool ValidProperties( PolicyStatementAttribute attributes )
{
@@ -178,40 +102,6 @@ namespace System.Security.Policy {
throw new ArgumentException( Environment.GetResourceString( "Argument_InvalidFlag" ) );
}
}
-
- private bool GetFlag( int flag )
- {
- return (flag & (int)m_attributes) != 0;
- }
-
- /// <summary>
- /// Union a child policy statement into this policy statement
- /// </summary>
- internal void InplaceUnion(PolicyStatement childPolicy)
- {
- BCLDebug.Assert(childPolicy != null, "childPolicy != null");
-
- if (((Attributes & childPolicy.Attributes) & PolicyStatementAttribute.Exclusive) == PolicyStatementAttribute.Exclusive)
- {
- throw new PolicyException(Environment.GetResourceString( "Policy_MultipleExclusive" ));
- }
-
- // We need to merge together our grant set and attributes. The result of this merge is
- // dependent upon if we're merging a child marked exclusive or not. If the child is not
- // exclusive, we need to union in its grant set and or in its attributes. However, if the child
- // is exclusive then it is the only code group which should have an effect on the resulting
- // grant set and therefore our grant should be ignored.
- if ((childPolicy.Attributes & PolicyStatementAttribute.Exclusive) == PolicyStatementAttribute.Exclusive)
- {
- m_permSet = childPolicy.GetPermissionSetNoCopy();
- Attributes = childPolicy.Attributes;
- }
- else
- {
- m_permSet.InplaceUnion(childPolicy.GetPermissionSetNoCopy());
- Attributes = Attributes | childPolicy.Attributes;
- }
- }
[System.Runtime.InteropServices.ComVisible(false)]
public override bool Equals( Object obj )
diff --git a/src/mscorlib/src/System/Security/Policy/Site.cs b/src/mscorlib/src/System/Security/Policy/Site.cs
deleted file mode 100644
index 14a95e1666..0000000000
--- a/src/mscorlib/src/System/Security/Policy/Site.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-//
-//
-// Site is an IIdentity representing internet sites.
-//
-
-using System;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
-using System.Globalization;
-using System.Security.Permissions;
-using System.Security.Util;
-
-namespace System.Security.Policy
-{
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class Site : EvidenceBase, IIdentityPermissionFactory
- {
- private SiteString m_name;
-
- public Site(String name)
- {
- if (name == null)
- throw new ArgumentNullException(nameof(name));
- Contract.EndContractBlock();
-
- m_name = new SiteString( name );
- }
-
- private Site(SiteString name)
- {
- Debug.Assert(name != null);
- m_name = name;
- }
-
- public static Site CreateFromUrl( String url )
- {
- return new Site(ParseSiteFromUrl(url));
- }
-
- private static SiteString ParseSiteFromUrl( String name )
- {
- URLString urlString = new URLString( name );
-
- if (String.Compare( urlString.Scheme, "file", StringComparison.OrdinalIgnoreCase) == 0)
- throw new ArgumentException( Environment.GetResourceString( "Argument_InvalidSite" ) );
-
- return new SiteString( new URLString( name ).Host );
- }
-
- public String Name
- {
- get { return m_name.ToString(); }
- }
-
- internal SiteString GetSiteString()
- {
- return m_name;
- }
-
- public IPermission CreateIdentityPermission( Evidence evidence )
- {
- return new SiteIdentityPermission( Name );
- }
-
- public override bool Equals(Object o)
- {
- Site other = o as Site;
- if (other == null)
- {
- return false;
- }
-
- return String.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase);
- }
-
- public override int GetHashCode()
- {
- return Name.GetHashCode();
- }
-
- public override EvidenceBase Clone()
- {
- return new Site(m_name);
- }
-
- public Object Copy()
- {
- return Clone();
- }
-
- // INormalizeForIsolatedStorage is not implemented for startup perf
- // equivalent to INormalizeForIsolatedStorage.Normalize()
- internal Object Normalize()
- {
- return m_name.ToString().ToUpper(CultureInfo.InvariantCulture);
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/StrongName.cs b/src/mscorlib/src/System/Security/Policy/StrongName.cs
index 999b478ba7..41cd000e95 100644
--- a/src/mscorlib/src/System/Security/Policy/StrongName.cs
+++ b/src/mscorlib/src/System/Security/Policy/StrongName.cs
@@ -19,7 +19,7 @@ namespace System.Security.Policy {
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public sealed class StrongName : EvidenceBase, IIdentityPermissionFactory, IDelayEvaluatedEvidence
+ internal sealed class StrongName : EvidenceBase
{
private StrongNamePublicKeyBlob m_publicKeyBlob;
private String m_name;
@@ -35,99 +35,6 @@ namespace System.Security.Policy {
internal StrongName() {}
- public StrongName( StrongNamePublicKeyBlob blob, String name, Version version ) : this(blob, name, version, null)
- {
- }
-
- internal StrongName(StrongNamePublicKeyBlob blob, String name, Version version, Assembly assembly)
- {
- if (name == null)
- throw new ArgumentNullException(nameof(name));
- if (String.IsNullOrEmpty(name))
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyStrongName"));
-
- if (blob == null)
- throw new ArgumentNullException(nameof(blob));
-
- if (version == null)
- throw new ArgumentNullException(nameof(version));
- Contract.EndContractBlock();
-
- RuntimeAssembly rtAssembly = assembly as RuntimeAssembly;
- if (assembly != null && rtAssembly == null)
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly"), nameof(assembly));
-
- m_publicKeyBlob = blob;
- m_name = name;
- m_version = version;
- m_assembly = rtAssembly;
- }
-
- public StrongNamePublicKeyBlob PublicKey
- {
- get
- {
- return m_publicKeyBlob;
- }
- }
-
- public String Name
- {
- get
- {
- return m_name;
- }
- }
-
- public Version Version
- {
- get
- {
- return m_version;
- }
- }
-
- bool IDelayEvaluatedEvidence.IsVerified
- {
- get
- {
- return true;
- }
- }
-
- bool IDelayEvaluatedEvidence.WasUsed
- {
- get { return m_wasUsed; }
- }
-
- void IDelayEvaluatedEvidence.MarkUsed()
- {
- m_wasUsed = true;
- }
-
- internal static bool CompareNames( String asmName, String mcName )
- {
- if (mcName.Length > 0 && mcName[mcName.Length-1] == '*' && mcName.Length - 1 <= asmName.Length)
- return String.Compare( mcName, 0, asmName, 0, mcName.Length - 1, StringComparison.OrdinalIgnoreCase) == 0;
- else
- return String.Compare( mcName, asmName, StringComparison.OrdinalIgnoreCase) == 0;
- }
-
- public IPermission CreateIdentityPermission( Evidence evidence )
- {
- return new StrongNameIdentityPermission( m_publicKeyBlob, m_name, m_version );
- }
-
- public override EvidenceBase Clone()
- {
- return new StrongName(m_publicKeyBlob, m_name, m_version);
- }
-
- public Object Copy()
- {
- return Clone();
- }
-
public override bool Equals( Object o )
{
StrongName that = (o as StrongName);
@@ -152,20 +59,5 @@ namespace System.Security.Policy {
return typeof( StrongName ).GetHashCode();
}
}
-
- // INormalizeForIsolatedStorage is not implemented for startup perf
- // equivalent to INormalizeForIsolatedStorage.Normalize()
- internal Object Normalize()
- {
- MemoryStream ms = new MemoryStream();
- BinaryWriter bw = new BinaryWriter(ms);
-
- bw.Write(m_publicKeyBlob.PublicKey);
- bw.Write(m_version.Major);
- bw.Write(m_name);
-
- ms.Position = 0;
- return ms;
- }
}
}
diff --git a/src/mscorlib/src/System/Security/Policy/URL.cs b/src/mscorlib/src/System/Security/Policy/URL.cs
deleted file mode 100644
index 3541124ac6..0000000000
--- a/src/mscorlib/src/System/Security/Policy/URL.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-//
-//
-// Url is an IIdentity representing url internet sites.
-//
-
-namespace System.Security.Policy {
- using System.IO;
- using System.Security.Util;
- using UrlIdentityPermission = System.Security.Permissions.UrlIdentityPermission;
- using System.Runtime.Serialization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class Url : EvidenceBase, IIdentityPermissionFactory
- {
- private URLString m_url;
-
- internal Url( String name, bool parsed )
- {
- if (name == null)
- throw new ArgumentNullException( nameof(name) );
- Contract.EndContractBlock();
-
- m_url = new URLString( name, parsed );
- }
-
- public Url( String name )
- {
- if (name == null)
- throw new ArgumentNullException( nameof(name) );
- Contract.EndContractBlock();
-
- m_url = new URLString( name );
- }
-
- private Url(Url url)
- {
- Debug.Assert(url != null);
- m_url = url.m_url;
- }
-
- public String Value
- {
- get { return m_url.ToString(); }
- }
-
- internal URLString GetURLString()
- {
- return m_url;
- }
-
- public IPermission CreateIdentityPermission( Evidence evidence )
- {
- return new UrlIdentityPermission( m_url );
- }
-
- public override bool Equals(Object o)
- {
- Url other = o as Url;
- if (other == null)
- {
- return false;
- }
-
- return other.m_url.Equals(m_url);
- }
-
- public override int GetHashCode()
- {
- return this.m_url.GetHashCode();
- }
-
- public override EvidenceBase Clone()
- {
- return new Url(this);
- }
-
- public Object Copy()
- {
- return Clone();
- }
-
- // INormalizeForIsolatedStorage is not implemented for startup perf
- // equivalent to INormalizeForIsolatedStorage.Normalize()
- internal Object Normalize()
- {
- return m_url.NormalizeUrl();
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Policy/Zone.cs b/src/mscorlib/src/System/Security/Policy/Zone.cs
deleted file mode 100644
index a9f5d84aeb..0000000000
--- a/src/mscorlib/src/System/Security/Policy/Zone.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-//
-//
-// Zone is an IIdentity representing Internet/Intranet/MyComputer etc.
-//
-
-namespace System.Security.Policy
-{
- using System.Security.Util;
- using ZoneIdentityPermission = System.Security.Permissions.ZoneIdentityPermission;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Runtime.Versioning;
- using System.Runtime.Serialization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
- [Serializable]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class Zone : EvidenceBase, IIdentityPermissionFactory
- {
- private SecurityZone m_zone;
-
- private static readonly String[] s_names =
- {"MyComputer", "Intranet", "Trusted", "Internet", "Untrusted", "NoZone"};
-
- public Zone(SecurityZone zone)
- {
- if (zone < SecurityZone.NoZone || zone > SecurityZone.Untrusted)
- throw new ArgumentException( Environment.GetResourceString( "Argument_IllegalZone" ) );
- Contract.EndContractBlock();
-
- m_zone = zone;
- }
-
- private Zone(Zone zone)
- {
- Debug.Assert(zone != null);
- m_zone = zone.m_zone;
- }
-
- public IPermission CreateIdentityPermission( Evidence evidence )
- {
- return new ZoneIdentityPermission( SecurityZone );
- }
-
- public SecurityZone SecurityZone
- {
- get
- {
- return m_zone;
- }
- }
-
- public override bool Equals(Object o)
- {
- Zone other = o as Zone;
- if (other == null)
- {
- return false;
- }
-
- return SecurityZone == other.SecurityZone;
- }
-
- public override int GetHashCode()
- {
- return (int)SecurityZone;
- }
-
- public override EvidenceBase Clone()
- {
- return new Zone(this);
- }
-
- public Object Copy()
- {
- return Clone();
- }
-
- // INormalizeForIsolatedStorage is not implemented for startup perf
- // equivalent to INormalizeForIsolatedStorage.Normalize()
- internal Object Normalize()
- {
- return s_names[(int)SecurityZone];
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/SecurityContext.cs b/src/mscorlib/src/System/Security/SecurityContext.cs
index df949575d7..2e978bb04f 100644
--- a/src/mscorlib/src/System/Security/SecurityContext.cs
+++ b/src/mscorlib/src/System/Security/SecurityContext.cs
@@ -29,17 +29,10 @@ namespace System.Security
using System.Diagnostics.Contracts;
// This enum must be kept in sync with the SecurityContextSource enum in the VM
- public enum SecurityContextSource
+ internal enum SecurityContextSource
{
CurrentAppDomain = 0,
CurrentAssembly
}
- internal enum SecurityContextDisableFlow
- {
- Nothing = 0,
- WI = 0x1,
- All = 0x3FFF
- }
-
}
diff --git a/src/mscorlib/src/System/Security/SecurityElement.cs b/src/mscorlib/src/System/Security/SecurityElement.cs
deleted file mode 100644
index f57665b278..0000000000
--- a/src/mscorlib/src/System/Security/SecurityElement.cs
+++ /dev/null
@@ -1,875 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-
-namespace System.Security
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Security.Util;
- using System.Text;
- using System.Globalization;
- using System.IO;
- using System.Security.Permissions;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
- internal enum SecurityElementType
- {
- Regular = 0,
- Format = 1,
- Comment = 2
- }
-
-
- internal interface ISecurityElementFactory
- {
- SecurityElement CreateSecurityElement();
-
- Object Copy();
-
- String GetTag();
-
- String Attribute( String attributeName );
- }
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- sealed public class SecurityElement : ISecurityElementFactory
- {
- internal String m_strTag;
- internal String m_strText;
- private ArrayList m_lChildren;
- internal ArrayList m_lAttributes;
- internal SecurityElementType m_type = SecurityElementType.Regular;
-
- private static readonly char[] s_tagIllegalCharacters = new char[] { ' ', '<', '>' };
- private static readonly char[] s_textIllegalCharacters = new char[] { '<', '>' };
- private static readonly char[] s_valueIllegalCharacters = new char[] { '<', '>', '\"' };
- private const String s_strIndent = " ";
-
- private const int c_AttributesTypical = 4 * 2; // 4 attributes, times 2 strings per attribute
- private const int c_ChildrenTypical = 1;
-
- private static readonly String[] s_escapeStringPairs = new String[]
- {
- // these must be all once character escape sequences or a new escaping algorithm is needed
- "<", "&lt;",
- ">", "&gt;",
- "\"", "&quot;",
- "\'", "&apos;",
- "&", "&amp;"
- };
-
- private static readonly char[] s_escapeChars = new char[] { '<', '>', '\"', '\'', '&' };
-
- //-------------------------- Constructors ---------------------------
-
- internal SecurityElement()
- {
- }
-
-////// ISecurityElementFactory implementation
-
- SecurityElement ISecurityElementFactory.CreateSecurityElement()
- {
- return this;
- }
-
- String ISecurityElementFactory.GetTag()
- {
- return ((SecurityElement)this).Tag;
- }
-
- Object ISecurityElementFactory.Copy()
- {
- return ((SecurityElement)this).Copy();
- }
-
- String ISecurityElementFactory.Attribute( String attributeName )
- {
- return ((SecurityElement)this).Attribute( attributeName );
- }
-
- public SecurityElement( String tag )
- {
- if (tag == null)
- throw new ArgumentNullException( nameof(tag) );
-
- if (!IsValidTag( tag ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementTag" ), tag ) );
- Contract.EndContractBlock();
-
- m_strTag = tag;
- m_strText = null;
- }
-
- public SecurityElement( String tag, String text )
- {
- if (tag == null)
- throw new ArgumentNullException( nameof(tag) );
-
- if (!IsValidTag( tag ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementTag" ), tag ) );
-
- if (text != null && !IsValidText( text ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementText" ), text ) );
- Contract.EndContractBlock();
-
- m_strTag = tag;
- m_strText = text;
- }
-
- //-------------------------- Properties -----------------------------
-
- public String Tag
- {
- [Pure]
- get
- {
- return m_strTag;
- }
-
- set
- {
- if (value == null)
- throw new ArgumentNullException( nameof(Tag) );
-
- if (!IsValidTag( value ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementTag" ), value ) );
- Contract.EndContractBlock();
-
- m_strTag = value;
- }
- }
-
- public Hashtable Attributes
- {
- get
- {
- if (m_lAttributes == null || m_lAttributes.Count == 0)
- {
- return null;
- }
- else
- {
- Hashtable hashtable = new Hashtable( m_lAttributes.Count/2 );
-
- int iMax = m_lAttributes.Count;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- hashtable.Add( m_lAttributes[i], m_lAttributes[i+1]);
- }
-
- return hashtable;
- }
- }
-
- set
- {
- if (value == null || value.Count == 0)
- {
- m_lAttributes = null;
- }
- else
- {
- ArrayList list = new ArrayList(value.Count);
-
- System.Collections.IDictionaryEnumerator enumerator = (System.Collections.IDictionaryEnumerator)value.GetEnumerator();
-
- while (enumerator.MoveNext())
- {
- String attrName = (String)enumerator.Key;
- String attrValue = (String)enumerator.Value;
-
- if (!IsValidAttributeName( attrName ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementName" ), (String)enumerator.Current ) );
-
- if (!IsValidAttributeValue( attrValue ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementValue" ), (String)enumerator.Value ) );
-
- list.Add(attrName);
- list.Add(attrValue);
- }
-
- m_lAttributes = list;
- }
- }
- }
-
- public String Text
- {
- get
- {
- return Unescape( m_strText );
- }
-
- set
- {
- if (value == null)
- {
- m_strText = null;
- }
- else
- {
- if (!IsValidText( value ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementTag" ), value ) );
-
- m_strText = value;
- }
- }
- }
-
- public ArrayList Children
- {
- get
- {
- ConvertSecurityElementFactories();
- return m_lChildren;
- }
-
- set
- {
- if (value != null)
- {
- IEnumerator enumerator = value.GetEnumerator();
-
- while (enumerator.MoveNext())
- {
- if (enumerator.Current == null)
- throw new ArgumentException( Environment.GetResourceString( "ArgumentNull_Child" ) );
- }
- }
-
- m_lChildren = value;
- }
- }
-
- internal void ConvertSecurityElementFactories()
- {
- if (m_lChildren == null)
- return;
-
- for (int i = 0; i < m_lChildren.Count; ++i)
- {
- ISecurityElementFactory iseFactory = m_lChildren[i] as ISecurityElementFactory;
- if (iseFactory != null && !(m_lChildren[i] is SecurityElement))
- m_lChildren[i] = iseFactory.CreateSecurityElement();
- }
- }
-
- internal ArrayList InternalChildren
- {
- get
- {
- // Beware! This array list can contain SecurityElements and other ISecurityElementFactories.
- // If you want to get a consistent SecurityElement view, call get_Children.
- return m_lChildren;
- }
- }
-
- //-------------------------- Public Methods -----------------------------
-
- internal void AddAttributeSafe( String name, String value )
- {
- if (m_lAttributes == null)
- {
- m_lAttributes = new ArrayList( c_AttributesTypical );
- }
- else
- {
- int iMax = m_lAttributes.Count;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- String strAttrName = (String)m_lAttributes[i];
-
- if (String.Equals(strAttrName, name))
- throw new ArgumentException( Environment.GetResourceString( "Argument_AttributeNamesMustBeUnique" ) );
- }
- }
-
- m_lAttributes.Add(name);
- m_lAttributes.Add(value);
- }
-
- public void AddAttribute( String name, String value )
- {
- if (name == null)
- throw new ArgumentNullException( nameof(name) );
-
- if (value == null)
- throw new ArgumentNullException( nameof(value) );
-
- if (!IsValidAttributeName( name ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementName" ), name ) );
-
- if (!IsValidAttributeValue( value ))
- throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "Argument_InvalidElementValue" ), value ) );
- Contract.EndContractBlock();
-
- AddAttributeSafe( name, value );
- }
-
- public void AddChild( SecurityElement child )
- {
- if (child == null)
- throw new ArgumentNullException( nameof(child) );
- Contract.EndContractBlock();
-
- if (m_lChildren == null)
- m_lChildren = new ArrayList( c_ChildrenTypical );
-
- m_lChildren.Add( child );
- }
-
- internal void AddChild( ISecurityElementFactory child )
- {
- if (child == null)
- throw new ArgumentNullException( nameof(child) );
- Contract.EndContractBlock();
-
- if (m_lChildren == null)
- m_lChildren = new ArrayList( c_ChildrenTypical );
-
- m_lChildren.Add( child );
- }
-
- internal void AddChildNoDuplicates( ISecurityElementFactory child )
- {
- if (child == null)
- throw new ArgumentNullException( nameof(child) );
- Contract.EndContractBlock();
-
- if (m_lChildren == null)
- {
- m_lChildren = new ArrayList( c_ChildrenTypical );
- m_lChildren.Add( child );
- }
- else
- {
- for (int i = 0; i < m_lChildren.Count; ++i)
- {
- if (m_lChildren[i] == child)
- return;
- }
- m_lChildren.Add( child );
- }
- }
-
- public bool Equal( SecurityElement other )
- {
- if (other == null)
- return false;
-
- // Check if the tags are the same
- if (!String.Equals(m_strTag, other.m_strTag))
- return false;
-
- // Check if the text is the same
- if (!String.Equals(m_strText, other.m_strText))
- return false;
-
- // Check if the attributes are the same and appear in the same
- // order.
-
- // Maybe we can get away by only checking the number of attributes
- if (m_lAttributes == null || other.m_lAttributes == null)
- {
- if (m_lAttributes != other.m_lAttributes)
- return false;
- }
- else
- {
- int iMax = m_lAttributes.Count;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- if (iMax != other.m_lAttributes.Count)
- return false;
-
- for (int i = 0; i < iMax; i++)
- {
- String lhs = (String)m_lAttributes[i];
- String rhs = (String)other.m_lAttributes[i];
-
- if (!String.Equals(lhs, rhs))
- return false;
- }
- }
-
- // Finally we must check the child and make sure they are
- // equal and in the same order
-
- // Maybe we can get away by only checking the number of children
- if (m_lChildren == null || other.m_lChildren == null)
- {
- if (m_lChildren != other.m_lChildren)
- return false;
- }
- else
- {
- if (m_lChildren.Count != other.m_lChildren.Count)
- return false;
-
- this.ConvertSecurityElementFactories();
- other.ConvertSecurityElementFactories();
-
- // Okay, we'll need to go through each one of them
- IEnumerator lhs = m_lChildren.GetEnumerator();
- IEnumerator rhs = other.m_lChildren.GetEnumerator();
-
- SecurityElement e1, e2;
- while (lhs.MoveNext())
- {
- rhs.MoveNext();
- e1 = (SecurityElement)lhs.Current;
- e2 = (SecurityElement)rhs.Current;
- if (e1 == null || !e1.Equal(e2))
- return false;
- }
- }
- return true;
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public SecurityElement Copy()
- {
- SecurityElement element = new SecurityElement( this.m_strTag, this.m_strText );
- element.m_lChildren = this.m_lChildren == null ? null : new ArrayList( this.m_lChildren );
- element.m_lAttributes = this.m_lAttributes == null ? null : new ArrayList(this.m_lAttributes);
-
- return element;
- }
-
- [Pure]
- public static bool IsValidTag( String tag )
- {
- if (tag == null)
- return false;
-
- return tag.IndexOfAny( s_tagIllegalCharacters ) == -1;
- }
-
- [Pure]
- public static bool IsValidText( String text )
- {
- if (text == null)
- return false;
-
- return text.IndexOfAny( s_textIllegalCharacters ) == -1;
- }
-
- [Pure]
- public static bool IsValidAttributeName( String name )
- {
- return IsValidTag( name );
- }
-
- [Pure]
- public static bool IsValidAttributeValue( String value )
- {
- if (value == null)
- return false;
-
- return value.IndexOfAny( s_valueIllegalCharacters ) == -1;
- }
-
- private static String GetEscapeSequence( char c )
- {
- int iMax = s_escapeStringPairs.Length;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- String strEscSeq = s_escapeStringPairs[i];
- String strEscValue = s_escapeStringPairs[i+1];
-
- if (strEscSeq[0] == c)
- return strEscValue;
- }
-
- Debug.Assert( false, "Unable to find escape sequence for this character" );
- return c.ToString();
- }
-
- public static String Escape( String str )
- {
- if (str == null)
- return null;
-
- StringBuilder sb = null;
-
- int strLen = str.Length;
- int index; // Pointer into the string that indicates the location of the current '&' character
- int newIndex = 0; // Pointer into the string that indicates the start index of the "remaining" string (that still needs to be processed).
-
-
- do
- {
- index = str.IndexOfAny( s_escapeChars, newIndex );
-
- if (index == -1)
- {
- if (sb == null)
- return str;
- else
- {
- sb.Append( str, newIndex, strLen - newIndex );
- return sb.ToString();
- }
- }
- else
- {
- if (sb == null)
- sb = new StringBuilder();
-
- sb.Append( str, newIndex, index - newIndex );
- sb.Append( GetEscapeSequence( str[index] ) );
-
- newIndex = ( index + 1 );
- }
- }
- while (true);
-
- // no normal exit is possible
- }
-
- private static String GetUnescapeSequence( String str, int index, out int newIndex )
- {
- int maxCompareLength = str.Length - index;
-
- int iMax = s_escapeStringPairs.Length;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- String strEscSeq = s_escapeStringPairs[i];
- String strEscValue = s_escapeStringPairs[i+1];
-
- int length = strEscValue.Length;
-
- if (length <= maxCompareLength && String.Compare( strEscValue, 0, str, index, length, StringComparison.Ordinal) == 0)
- {
- newIndex = index + strEscValue.Length;
- return strEscSeq;
- }
- }
-
- newIndex = index + 1;
- return str[index].ToString();
- }
-
-
- private static String Unescape( String str )
- {
- if (str == null)
- return null;
-
- StringBuilder sb = null;
-
- int strLen = str.Length;
- int index; // Pointer into the string that indicates the location of the current '&' character
- int newIndex = 0; // Pointer into the string that indicates the start index of the "remainging" string (that still needs to be processed).
-
- do
- {
- index = str.IndexOf( '&', newIndex );
-
- if (index == -1)
- {
- if (sb == null)
- return str;
- else
- {
- sb.Append( str, newIndex, strLen - newIndex );
- return sb.ToString();
- }
- }
- else
- {
- if (sb == null)
- sb = new StringBuilder();
-
- sb.Append(str, newIndex, index - newIndex);
- sb.Append( GetUnescapeSequence( str, index, out newIndex ) ); // updates the newIndex too
-
- }
- }
- while (true);
-
- // C# reports a warning if I leave this in, but I still kinda want to just in case.
- // Debug.Assert( false, "If you got here, the execution engine or compiler is really confused" );
- // return str;
- }
-
- private delegate void ToStringHelperFunc( Object obj, String str );
-
- private static void ToStringHelperStringBuilder( Object obj, String str )
- {
- ((StringBuilder)obj).Append( str );
- }
-
- public override String ToString ()
- {
- StringBuilder sb = new StringBuilder();
-
- ToString( "", sb, new ToStringHelperFunc( ToStringHelperStringBuilder ) );
-
- return sb.ToString();
- }
-
- private void ToString( String indent, Object obj, ToStringHelperFunc func )
- {
- // First add the indent
-
- // func( obj, indent );
-
- // Add in the opening bracket and the tag.
-
- func( obj, "<" );
-
- switch (m_type)
- {
- case SecurityElementType.Format:
- func( obj, "?" );
- break;
-
- case SecurityElementType.Comment:
- func( obj, "!" );
- break;
-
- default:
- break;
- }
-
- func( obj, m_strTag );
-
- // If there are any attributes, plop those in.
-
- if (m_lAttributes != null && m_lAttributes.Count > 0)
- {
- func( obj, " " );
-
- int iMax = m_lAttributes.Count;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- String strAttrName = (String)m_lAttributes[i];
- String strAttrValue = (String)m_lAttributes[i+1];
-
- func( obj, strAttrName );
- func( obj, "=\"" );
- func( obj, strAttrValue );
- func( obj, "\"" );
-
- if (i != m_lAttributes.Count - 2)
- {
- if (m_type == SecurityElementType.Regular)
- {
- func( obj, Environment.NewLine );
- }
- else
- {
- func( obj, " " );
- }
- }
- }
- }
-
- if (m_strText == null && (m_lChildren == null || m_lChildren.Count == 0))
- {
- // If we are a single tag with no children, just add the end of tag text.
-
- switch (m_type)
- {
- case SecurityElementType.Comment:
- func( obj, ">" );
- break;
-
- case SecurityElementType.Format:
- func( obj, " ?>" );
- break;
-
- default:
- func( obj, "/>" );
- break;
- }
- func( obj, Environment.NewLine );
- }
- else
- {
- // Close the current tag.
-
- func( obj, ">" );
-
- // Output the text
-
- func( obj, m_strText );
-
- // Output any children.
-
- if (m_lChildren != null)
- {
- this.ConvertSecurityElementFactories();
-
- func( obj, Environment.NewLine );
-
- // String childIndent = indent + s_strIndent;
-
- for (int i = 0; i < m_lChildren.Count; ++i)
- {
- ((SecurityElement)m_lChildren[i]).ToString( "", obj, func );
- }
-
- // In the case where we have children, the close tag will not be on the same line as the
- // opening tag, so we need to indent.
-
- // func( obj, indent );
- }
-
- // Output the closing tag
-
- func( obj, "</" );
- func( obj, m_strTag );
- func( obj, ">" );
- func( obj, Environment.NewLine );
- }
- }
-
-
-
- public String Attribute( String name )
- {
- if (name == null)
- throw new ArgumentNullException( nameof(name) );
- Contract.EndContractBlock();
-
- // Note: we don't check for validity here because an
- // if an invalid name is passed we simply won't find it.
-
- if (m_lAttributes == null)
- return null;
-
- // Go through all the attribute and see if we know about
- // the one we are asked for
-
- int iMax = m_lAttributes.Count;
- Debug.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" );
-
- for (int i = 0; i < iMax; i += 2)
- {
- String strAttrName = (String)m_lAttributes[i];
-
- if (String.Equals(strAttrName, name))
- {
- String strAttrValue = (String)m_lAttributes[i+1];
-
- return Unescape(strAttrValue);
- }
- }
-
- // In the case where we didn't find it, we are expected to
- // return null
- return null;
- }
-
- public SecurityElement SearchForChildByTag( String tag )
- {
- // Go through all the children and see if we can
- // find the one are are asked for (matching tags)
-
- if (tag == null)
- throw new ArgumentNullException( nameof(tag) );
- Contract.EndContractBlock();
-
- // Note: we don't check for a valid tag here because
- // an invalid tag simply won't be found.
-
- if (m_lChildren == null)
- return null;
-
- IEnumerator enumerator = m_lChildren.GetEnumerator();
-
- while (enumerator.MoveNext())
- {
- SecurityElement current = (SecurityElement)enumerator.Current;
-
- if (current != null && String.Equals(current.Tag, tag))
- return current;
- }
- return null;
- }
-
- internal String SearchForTextOfLocalName(String strLocalName)
- {
- // Search on each child in order and each
- // child's child, depth-first
-
- if (strLocalName == null)
- throw new ArgumentNullException( nameof(strLocalName) );
- Contract.EndContractBlock();
-
- // Note: we don't check for a valid tag here because
- // an invalid tag simply won't be found.
-
- // First we check this.
-
- if (m_strTag == null) return null;
- if (m_strTag.Equals( strLocalName ) || m_strTag.EndsWith( ":" + strLocalName, StringComparison.Ordinal ))
- return Unescape( m_strText );
- if (m_lChildren == null)
- return null;
-
- IEnumerator enumerator = m_lChildren.GetEnumerator();
-
- while (enumerator.MoveNext())
- {
- String current = ((SecurityElement)enumerator.Current).SearchForTextOfLocalName( strLocalName );
-
- if (current != null)
- return current;
- }
- return null;
- }
-
- public String SearchForTextOfTag( String tag )
- {
- // Search on each child in order and each
- // child's child, depth-first
-
- if (tag == null)
- throw new ArgumentNullException( nameof(tag) );
- Contract.EndContractBlock();
-
- // Note: we don't check for a valid tag here because
- // an invalid tag simply won't be found.
-
- // First we check this.
-
- if (String.Equals(m_strTag, tag))
- return Unescape( m_strText );
- if (m_lChildren == null)
- return null;
-
- IEnumerator enumerator = m_lChildren.GetEnumerator();
-
- this.ConvertSecurityElementFactories();
-
- while (enumerator.MoveNext())
- {
- String current = ((SecurityElement)enumerator.Current).SearchForTextOfTag( tag );
-
- if (current != null)
- return current;
- }
- return null;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/SecurityException.cs b/src/mscorlib/src/System/Security/SecurityException.cs
index b0ad145c6f..353003744e 100644
--- a/src/mscorlib/src/System/Security/SecurityException.cs
+++ b/src/mscorlib/src/System/Security/SecurityException.cs
@@ -63,13 +63,6 @@ namespace System.Security
SetErrorCode(System.__HResults.COR_E_SECURITY);
}
- internal SecurityException(PermissionSet grantedSetObj, PermissionSet refusedSetObj)
- : this(){}
-#pragma warning disable 618
- internal SecurityException(string message, AssemblyName assemblyName, PermissionSet grant, PermissionSet refused, MethodInfo method, SecurityAction action, Object demanded, IPermission permThatFailed, Evidence evidence)
-#pragma warning restore 618
- : this(){}
-
internal SecurityException(string message, Object deny, Object permitOnly, MethodInfo method, Object demanded, IPermission permThatFailed)
: this(){}
@@ -85,22 +78,6 @@ namespace System.Security
return base.ToString();
}
- private bool CanAccessSensitiveInfo()
- {
- bool retVal = false;
- try
- {
-#pragma warning disable 618
- new SecurityPermission(SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.ControlPolicy).Demand();
-#pragma warning restore 618
- retVal = true;
- }
- catch (SecurityException)
- {
- }
- return retVal;
- }
-
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/mscorlib/src/System/Security/SecurityManager.cs b/src/mscorlib/src/System/Security/SecurityManager.cs
index 933fe0be3d..521e678205 100644
--- a/src/mscorlib/src/System/Security/SecurityManager.cs
+++ b/src/mscorlib/src/System/Security/SecurityManager.cs
@@ -14,18 +14,8 @@ namespace System.Security
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
- [Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
- public enum PolicyLevelType
- {
- User = 0,
- Machine = 1,
- Enterprise = 2,
- AppDomain = 3
- }
-
- [System.Runtime.InteropServices.ComVisible(true)]
- static public class SecurityManager
+ static internal class SecurityManager
{
private static int[][] s_BuiltInPermissionIndexMap = {
new int[] { BuiltInPermissionIndex.EnvironmentPermissionIndex, (int) PermissionType.EnvironmentPermission },
@@ -149,9 +139,5 @@ namespace System.Security
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern bool _SetThreadSecurity(bool bThreadSecurity);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- internal static extern void GetGrantedPermissions(ObjectHandleOnStack retGranted, ObjectHandleOnStack retDenied, StackCrawlMarkHandle stackMark);
}
}
diff --git a/src/mscorlib/src/System/Security/SecurityRuntime.cs b/src/mscorlib/src/System/Security/SecurityRuntime.cs
index 76835ffb71..84a169a33b 100644
--- a/src/mscorlib/src/System/Security/SecurityRuntime.cs
+++ b/src/mscorlib/src/System/Security/SecurityRuntime.cs
@@ -20,18 +20,6 @@ namespace System.Security
{
private SecurityRuntime(){}
- // Returns the security object for the caller of the method containing
- // 'stackMark' on its frame.
- //
- // THE RETURNED OBJECT IS THE LIVE RUNTIME OBJECT. BE CAREFUL WITH IT!
- //
- // Internal only, do not doc.
- //
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern
- FrameSecurityDescriptor GetSecurityObjectForFrame(ref StackCrawlMark stackMark,
- bool create);
-
// Constants used to return status to native
internal const bool StackContinue = true;
internal const bool StackHalt = false;
@@ -84,18 +72,6 @@ namespace System.Security
{
}
- internal static void AssertAllPossible(ref StackCrawlMark stackMark)
- {
- }
-
- internal static void Deny(PermissionSet permSet, ref StackCrawlMark stackMark)
- {
- }
-
- internal static void PermitOnly(PermissionSet permSet, ref StackCrawlMark stackMark)
- {
- }
-
//
// Revert API
//
@@ -103,18 +79,6 @@ namespace System.Security
internal static void RevertAssert(ref StackCrawlMark stackMark)
{
}
-
- internal static void RevertDeny(ref StackCrawlMark stackMark)
- {
- }
-
- internal static void RevertPermitOnly(ref StackCrawlMark stackMark)
- {
- }
-
- internal static void RevertAll(ref StackCrawlMark stackMark)
- {
- }
}
}
diff --git a/src/mscorlib/src/System/Security/SecurityZone.cs b/src/mscorlib/src/System/Security/SecurityZone.cs
index a74b637846..6616cdc469 100644
--- a/src/mscorlib/src/System/Security/SecurityZone.cs
+++ b/src/mscorlib/src/System/Security/SecurityZone.cs
@@ -11,19 +11,4 @@ namespace System.Security
{
using System;
using System.Runtime.InteropServices;
-
- // The quick cache code depends on the values in this enumeration. Any change to this enumeration should
- // be reflected in PolicyManager.GenerateQuickCache as well.
- [ComVisible(true)]
- [Serializable]
- public enum SecurityZone
- {
- MyComputer = 0,
- Intranet = 1,
- Trusted = 2,
- Internet = 3,
- Untrusted = 4,
-
- NoZone = -1, // No Zone Information
- }
}
diff --git a/src/mscorlib/src/System/Security/Util/Config.cs b/src/mscorlib/src/System/Security/Util/Config.cs
deleted file mode 100644
index c2dbf6b8fe..0000000000
--- a/src/mscorlib/src/System/Security/Util/Config.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-namespace System.Security.Util {
- using System;
- using System.Security.Util;
- using System.Security.Policy;
- using System.Security.Permissions;
- using System.Collections;
- using System.IO;
- using System.Reflection;
- using System.Globalization;
- using System.Text;
- using System.Threading;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Runtime.Versioning;
-
- // Duplicated in vm\COMSecurityConfig.h
-[Serializable]
-[Flags]
- internal enum QuickCacheEntryType
- {
- FullTrustZoneMyComputer = 0x1000000,
- FullTrustZoneIntranet = 0x2000000,
- FullTrustZoneInternet = 0x4000000,
- FullTrustZoneTrusted = 0x8000000,
- FullTrustZoneUntrusted = 0x10000000,
- FullTrustAll = 0x20000000,
- }
-
- internal static class Config {
- private static volatile string m_machineConfig;
- private static volatile string m_userConfig;
-
- private static void GetFileLocales()
- {
- if (m_machineConfig == null)
- {
- string machineConfig = null;
- GetMachineDirectory(JitHelpers.GetStringHandleOnStack(ref machineConfig));
- m_machineConfig = machineConfig;
- }
- if (m_userConfig == null)
- {
- string userConfig = null;
- GetUserDirectory(JitHelpers.GetStringHandleOnStack(ref userConfig));
- m_userConfig = userConfig;
- }
- }
-
- internal static string MachineDirectory
- {
- get
- {
- GetFileLocales();
- return m_machineConfig;
- }
- }
-
- internal static string UserDirectory
- {
- get
- {
- GetFileLocales();
- return m_userConfig;
- }
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity]
- private static extern void GetMachineDirectory(StringHandleOnStack retDirectory);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity]
- private static extern void GetUserDirectory(StringHandleOnStack retDirectory);
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity]
- internal static extern bool WriteToEventLog(string message);
- }
-}
diff --git a/src/mscorlib/src/System/Security/Util/Hex.cs b/src/mscorlib/src/System/Security/Util/Hex.cs
index 4ca1cf678b..58dc20acbd 100644
--- a/src/mscorlib/src/System/Security/Util/Hex.cs
+++ b/src/mscorlib/src/System/Security/Util/Hex.cs
@@ -38,24 +38,6 @@ namespace System.Security.Util
}
return result;
}
-
- internal static string EncodeHexStringFromInt(byte[] sArray) {
- String result = null;
- if(sArray != null) {
- char[] hexOrder = new char[sArray.Length * 2];
-
- int i = sArray.Length;
- int digit, j=0;
- while (i-- > 0) {
- digit = (sArray[i] & 0xf0) >> 4;
- hexOrder[j++] = HexDigit(digit);
- digit = sArray[i] & 0x0f;
- hexOrder[j++] = HexDigit(digit);
- }
- result = new String(hexOrder);
- }
- return result;
- }
public static int ConvertHexDigit(Char val)
{
@@ -68,59 +50,5 @@ namespace System.Security.Util
else
throw new ArgumentException( Environment.GetResourceString( "ArgumentOutOfRange_Index" ) );
}
-
-
- public static byte[] DecodeHexString(String hexString)
- {
- if (hexString == null)
- throw new ArgumentNullException( nameof(hexString) );
- Contract.EndContractBlock();
-
- bool spaceSkippingMode = false;
-
- int i = 0;
- int length = hexString.Length;
-
- if ((length >= 2) &&
- (hexString[0] == '0') &&
- ( (hexString[1] == 'x') || (hexString[1] == 'X') ))
- {
- length = hexString.Length - 2;
- i = 2;
- }
-
- // Hex strings must always have 2N or (3N - 1) entries.
-
- if (length % 2 != 0 && length % 3 != 2)
- {
- throw new ArgumentException( Environment.GetResourceString( "Argument_InvalidHexFormat" ) );
- }
-
- byte[] sArray;
-
- if (length >=3 && hexString[i + 2] == ' ')
- {
- spaceSkippingMode = true;
-
- // Each hex digit will take three spaces, except the first (hence the plus 1).
- sArray = new byte[length / 3 + 1];
- }
- else
- {
- // Each hex digit will take two spaces
- sArray = new byte[length / 2];
- }
-
- int digit;
- int rawdigit;
- for (int j = 0; i < hexString.Length; i += 2, j++) {
- rawdigit = ConvertHexDigit(hexString[i]);
- digit = ConvertHexDigit(hexString[i+1]);
- sArray[j] = (byte) (digit | (rawdigit << 4));
- if (spaceSkippingMode)
- i++;
- }
- return(sArray);
- }
}
}
diff --git a/src/mscorlib/src/System/Security/Util/StringExpressionSet.cs b/src/mscorlib/src/System/Security/Util/StringExpressionSet.cs
index cc7a15a761..6d48f92c91 100644
--- a/src/mscorlib/src/System/Security/Util/StringExpressionSet.cs
+++ b/src/mscorlib/src/System/Security/Util/StringExpressionSet.cs
@@ -48,11 +48,6 @@ namespace System.Security.Util {
{
}
- public StringExpressionSet( String str )
- : this( true, str, false )
- {
- }
-
public StringExpressionSet( bool ignoreCase, bool throwOnRelative )
: this( ignoreCase, null, throwOnRelative )
{
diff --git a/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs b/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
index 66bc5d65cc..4e85c23333 100644
--- a/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
+++ b/src/mscorlib/src/System/Security/Util/TokenBasedSet.cs
@@ -345,96 +345,5 @@ namespace System.Security.Util
{
return m_cElt == 0;
}
-
- // Used to merge two distinct TokenBasedSets (used currently only in PermissionSet Deserialization)
- internal TokenBasedSet SpecialUnion(TokenBasedSet other)
- {
- // This gets called from PermissionSet.OnDeserialized and it's possible that the TokenBasedSets have
- // not been subjected to VTS callbacks yet
- OnDeserializedInternal();
- TokenBasedSet unionSet = new TokenBasedSet();
- int maxMax;
- if (other != null)
- {
- other.OnDeserializedInternal();
- maxMax = this.GetMaxUsedIndex() > other.GetMaxUsedIndex() ? this.GetMaxUsedIndex() : other.GetMaxUsedIndex();
- }
- else
- maxMax = this.GetMaxUsedIndex();
-
- for (int i = 0; i <= maxMax; ++i)
- {
- Object thisObj = this.GetItem( i );
- IPermission thisPerm = thisObj as IPermission;
-
- Object otherObj = (other != null)?other.GetItem( i ):null;
- IPermission otherPerm = otherObj as IPermission;
-
- if (thisObj == null && otherObj == null)
- continue;
-
- if (thisObj == null)
- {
- PermissionToken token = PermissionToken.GetToken(otherPerm);
-
- if (token == null)
- {
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
- }
-
- unionSet.SetItem(token.m_index, otherPerm);
- }
- else if (otherObj == null)
- {
- PermissionToken token = PermissionToken.GetToken(thisPerm);
- if (token == null)
- {
- throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState"));
- }
- unionSet.SetItem( token.m_index, thisPerm);
- }
- else
- {
- Debug.Assert( (thisObj == null || otherObj == null), "Permission cannot be in both TokenBasedSets" );
- }
- }
- return unionSet;
- }
-
- internal void SpecialSplit(ref TokenBasedSet unrestrictedPermSet, ref TokenBasedSet normalPermSet, bool ignoreTypeLoadFailures)
- {
- int maxIndex = GetMaxUsedIndex();
-
- for (int i = GetStartingIndex(); i <= maxIndex; ++i)
- {
- Object obj = GetItem( i );
- if (obj != null)
- {
- IPermission perm = obj as IPermission;
- PermissionToken token = PermissionToken.GetToken(perm);
-
- if (perm == null || token == null)
- continue;
-
- if (perm is IUnrestrictedPermission)
- {
- // Add to unrestrictedPermSet
- if (unrestrictedPermSet == null)
- unrestrictedPermSet = new TokenBasedSet();
- unrestrictedPermSet.SetItem(token.m_index, perm);
- }
- else
- {
- // Add to normalPermSet
- if (normalPermSet == null)
- normalPermSet = new TokenBasedSet();
- normalPermSet.SetItem(token.m_index, perm);
- }
-
- }
-
- }
-
- }
}
}
diff --git a/src/mscorlib/src/System/Security/Util/URLString.cs b/src/mscorlib/src/System/Security/Util/URLString.cs
index 5f53cbdfe3..11a969a058 100644
--- a/src/mscorlib/src/System/Security/Util/URLString.cs
+++ b/src/mscorlib/src/System/Security/Util/URLString.cs
@@ -367,20 +367,6 @@ namespace System.Security.Util {
return temp;
}
- // This does three things:
- // 1. It makes the following modifications to the start of the string:
- // a. \\?\ and \\?/ => <empty>
- // b. \\.\ and \\./ => <empty>
- // 2. If isFileUrl is true, converts all slashes to front slashes and strips leading
- // front slashes. See comment by code.
- // 3. Throws a PathTooLongException if the length of the resulting URL is >= MAX_PATH.
- // This is done to prevent security issues due to canonicalization truncations.
- // Remove this method when the Path class supports "\\?\"
- internal static string PreProcessForExtendedPathRemoval(string url, bool isFileUrl)
- {
- return PreProcessForExtendedPathRemoval(checkPathLength: true, url: url, isFileUrl: isFileUrl);
- }
-
internal static string PreProcessForExtendedPathRemoval(bool checkPathLength, string url, bool isFileUrl)
{
bool isUncShare = false;
@@ -736,16 +722,6 @@ namespace System.Security.Util {
}
- public String Scheme
- {
- get
- {
- DoDeferredParse();
-
- return m_protocol;
- }
- }
-
public String Host
{
get
@@ -767,19 +743,6 @@ namespace System.Security.Util {
}
}
- public String Port
- {
- get
- {
- DoDeferredParse();
-
- if (m_port == -1)
- return null;
- else
- return m_port.ToString(CultureInfo.InvariantCulture);
- }
- }
-
public String Directory
{
get
@@ -790,52 +753,6 @@ namespace System.Security.Util {
}
}
- /// <summary>
- /// Make a best guess at determining if this is URL refers to a file with a relative path. Since
- /// this is a guess to help out users of UrlMembershipCondition who may accidentally supply a
- /// relative URL, we'd rather err on the side of absolute than relative. (We'd rather accept some
- /// meaningless membership conditions rather than reject meaningful ones).
- ///
- /// In order to be a relative file URL, the URL needs to have a protocol of file, and not be on a
- /// UNC share.
- ///
- /// If both of the above are true, then the heuristics we'll use to detect an absolute URL are:
- /// 1. A host name which is:
- /// a. greater than one character and ends in a colon (representing the drive letter) OR
- /// b. ends with a * (so we match any file with the given prefix if any)
- /// 2. Has a directory name (cannot be simply file://c:)
- /// </summary>
- public bool IsRelativeFileUrl
- {
- get
- {
- DoDeferredParse();
-
- if (String.Equals(m_protocol, "file", StringComparison.OrdinalIgnoreCase) && !m_isUncShare)
- {
-#if !PLATFORM_UNIX
- string host = m_localSite != null ? m_localSite.ToString() : null;
- // If the host name ends with the * character, treat this as an absolute URL since the *
- // could represent the rest of the full path.
- if (host.EndsWith('*'))
- return false;
-#endif // !PLATFORM_UNIX
- string directory = m_directory != null ? m_directory.ToString() : null;
-
-#if !PLATFORM_UNIX
- return host == null || host.Length < 2 || !host.EndsWith(':') ||
- String.IsNullOrEmpty(directory);
-#else
- return String.IsNullOrEmpty(directory);
-#endif // !PLATFORM_UNIX
-
- }
-
- // Since this is not a local URL, it cannot be relative
- return false;
- }
- }
-
public String GetFileName()
{
DoDeferredParse();
@@ -875,81 +792,6 @@ namespace System.Security.Util {
return this.Directory;
#endif // !PLATFORM_UNIX
}
-
-
- public String GetDirectoryName()
- {
- DoDeferredParse();
-
-#if !PLATFORM_UNIX
- if (String.Compare( m_protocol, "file", StringComparison.OrdinalIgnoreCase ) != 0)
- return null;
-
- String intermediateDirectory = this.Directory.Replace( '/', '\\' );
-
- int slashIndex = 0;
- for (int i = intermediateDirectory.Length; i > 0; i--)
- {
- if (intermediateDirectory[i-1] == '\\')
- {
- slashIndex = i;
- break;
- }
- }
-
- String directory = this.Host.Replace( '/', '\\' );
-
- int directorySlashIndex = directory.IndexOf( '\\' );
- if (directorySlashIndex == -1)
- {
- if (directory.Length != 2 ||
- !(directory[1] == ':' || directory[1] == '|'))
- {
- directory = "\\\\" + directory;
- }
- }
- else if (directorySlashIndex > 2 ||
- (directorySlashIndex == 2 && directory[1] != ':' && directory[1] != '|'))
- {
- directory = "\\\\" + directory;
- }
-
- directory += "\\";
-
- if (slashIndex > 0)
- {
- directory += intermediateDirectory.Substring( 0, slashIndex );
- }
-
- return directory;
-#else
- if (String.Compare( m_protocol, "file", StringComparison.OrdinalIgnoreCase) != 0)
- return null;
-
- String directory = this.Directory.ToString();
- int slashIndex = 0;
- for (int i = directory.Length; i > 0; i--)
- {
- if (directory[i-1] == '/')
- {
- slashIndex = i;
- break;
- }
- }
-
- if (slashIndex > 0)
- {
- directory = directory.Substring( 0, slashIndex );
- }
-
- return directory;
-#endif // !PLATFORM_UNIX
- }
-
- public override SiteString Copy()
- {
- return new URLString( m_urlOriginal, m_parsedOriginal );
- }
public override bool IsSubsetOf( SiteString site )
{
@@ -1097,32 +939,6 @@ namespace System.Security.Util {
return true;
}
-
- internal String NormalizeUrl()
- {
- DoDeferredParse();
- StringBuilder builtUrl = StringBuilderCache.Acquire();
-
- if (String.Compare( m_protocol, "file", StringComparison.OrdinalIgnoreCase) == 0)
- {
-#if !PLATFORM_UNIX
- builtUrl = builtUrl.AppendFormat("FILE:///{0}/{1}", m_localSite.ToString(), m_directory.ToString());
-#else
- builtUrl = builtUrl.AppendFormat("FILE:///{0}", m_directory.ToString());
-#endif // !PLATFORM_UNIX
- }
- else
- {
- builtUrl = builtUrl.AppendFormat("{0}://{1}{2}", m_protocol, m_userpass, m_siteString.ToString());
-
- if (m_port != -1)
- builtUrl = builtUrl.AppendFormat("{0}",m_port);
-
- builtUrl = builtUrl.AppendFormat("/{0}", m_directory.ToString());
- }
-
- return StringBuilderCache.GetStringAndRelease(builtUrl).ToUpper(CultureInfo.InvariantCulture);
- }
#if !PLATFORM_UNIX
internal URLString SpecialNormalizeUrl()
diff --git a/src/mscorlib/src/System/Security/Util/XMLUtil.cs b/src/mscorlib/src/System/Security/Util/XMLUtil.cs
deleted file mode 100644
index 3a1aaa3b09..0000000000
--- a/src/mscorlib/src/System/Security/Util/XMLUtil.cs
+++ /dev/null
@@ -1,435 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-** PURPOSE: Helpers for XML input & output
-**
-===========================================================*/
-namespace System.Security.Util {
-
- using System;
- using System.Security;
- using System.Security.Permissions;
- using System.Security.Policy;
- using System.Runtime.InteropServices;
- using System.Runtime.Remoting;
- using System.IO;
- using System.Text;
- using System.Runtime.CompilerServices;
- using PermissionState = System.Security.Permissions.PermissionState;
- using BindingFlags = System.Reflection.BindingFlags;
- using Assembly = System.Reflection.Assembly;
- using System.Threading;
- using System.Globalization;
- using System.Reflection;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
-
- internal static class XMLUtil
- {
- //
- // Warning: Element constructors have side-effects on their
- // third argument.
- //
-
- private const String BuiltInPermission = "System.Security.Permissions.";
-
- public static SecurityElement
- NewPermissionElement (IPermission ip)
- {
- return NewPermissionElement (ip.GetType ().FullName) ;
- }
-
- public static SecurityElement
- NewPermissionElement (String name)
- {
- SecurityElement ecr = new SecurityElement( "Permission" );
- ecr.AddAttribute( "class", name );
- return ecr;
- }
-
- public static void
- AddClassAttribute( SecurityElement element, Type type, String typename )
- {
- // Replace any quotes with apostrophes so that we can include quoted materials
- // within classnames. Notably the assembly name member 'loc' uses a quoted string.
-
- // NOTE: this makes assumptions as to what reflection is expecting for a type string
- // it will need to be updated if reflection changes what it wants.
-
- if ( typename == null )
- typename = type.FullName;
- Debug.Assert( type.FullName.Equals( typename ), "Incorrect class name passed! Was : " + typename + " Shoule be: " + type.FullName);
- element.AddAttribute( "class", typename + ", " + type.Module.Assembly.FullName.Replace( '\"', '\'' ) );
- }
-
- internal static bool ParseElementForAssemblyIdentification(SecurityElement el,
- out String className,
- out String assemblyName, // for example "WindowsBase"
- out String assemblyVersion)
- {
-
- className = null;
- assemblyName = null;
- assemblyVersion = null;
-
- String fullClassName = el.Attribute( "class" );
-
- if (fullClassName == null)
- {
- return false;
- }
- if (fullClassName.IndexOf('\'') >= 0)
- {
- fullClassName = fullClassName.Replace( '\'', '\"' );
- }
-
- int commaIndex = fullClassName.IndexOf( ',' );
- int namespaceClassNameLength;
-
- // If the classname is tagged with assembly information, find where
- // the assembly information begins.
-
- if (commaIndex == -1)
- {
- return false;
- }
-
- namespaceClassNameLength = commaIndex;
- className = fullClassName.Substring(0, namespaceClassNameLength);
- String assemblyFullName = fullClassName.Substring(commaIndex + 1);
- AssemblyName an = new AssemblyName(assemblyFullName);
- assemblyName = an.Name;
- assemblyVersion = an.Version.ToString();
- return true;
- }
- private static bool
- ParseElementForObjectCreation( SecurityElement el,
- String requiredNamespace,
- out String className,
- out int classNameStart,
- out int classNameLength )
- {
- className = null;
- classNameStart = 0;
- classNameLength = 0;
-
- int requiredNamespaceLength = requiredNamespace.Length;
-
- String fullClassName = el.Attribute( "class" );
-
- if (fullClassName == null)
- {
- throw new ArgumentException( Environment.GetResourceString( "Argument_NoClass" ) );
- }
-
- if (fullClassName.IndexOf('\'') >= 0)
- {
- fullClassName = fullClassName.Replace( '\'', '\"' );
- }
-
- if (!PermissionToken.IsMscorlibClassName( fullClassName ))
- {
- return false;
- }
-
- int commaIndex = fullClassName.IndexOf( ',' );
- int namespaceClassNameLength;
-
- // If the classname is tagged with assembly information, find where
- // the assembly information begins.
-
- if (commaIndex == -1)
- {
- namespaceClassNameLength = fullClassName.Length;
- }
- else
- {
- namespaceClassNameLength = commaIndex;
- }
-
- // Only if the length of the class name is greater than the namespace info
- // on our requiredNamespace do we continue
- // with our check.
-
- if (namespaceClassNameLength > requiredNamespaceLength)
- {
- // Make sure we are in the required namespace.
- if (fullClassName.StartsWith(requiredNamespace, StringComparison.Ordinal))
- {
- className = fullClassName;
- classNameLength = namespaceClassNameLength - requiredNamespaceLength;
- classNameStart = requiredNamespaceLength;
- return true;
- }
- }
-
- return false;
- }
-
- public static IPermission
- CreatePermission (SecurityElement el, PermissionState permState, bool ignoreTypeLoadFailures)
- {
- if (el == null || !(el.Tag.Equals("Permission") || el.Tag.Equals("IPermission")) )
- throw new ArgumentException( String.Format( null, Environment.GetResourceString( "Argument_WrongElementType" ), "<Permission>" ) ) ;
- Contract.EndContractBlock();
-
- String className;
- int classNameLength;
- int classNameStart;
-
- if (!ParseElementForObjectCreation( el,
- BuiltInPermission,
- out className,
- out classNameStart,
- out classNameLength ))
- {
- goto USEREFLECTION;
- }
-
- // We have a built in permission, figure out which it is.
-
- // UIPermission
- // FileIOPermission
- // SecurityPermission
- // PrincipalPermission
- // ReflectionPermission
- // FileDialogPermission
- // EnvironmentPermission
- // GacIdentityPermission
- // UrlIdentityPermission
- // SiteIdentityPermission
- // ZoneIdentityPermission
- // KeyContainerPermission
- // UnsafeForHostPermission
- // HostProtectionPermission
- // StrongNameIdentityPermission
- // RegistryPermission
- // PublisherIdentityPermission
-
- switch (classNameLength)
- {
- case 12:
- // UIPermission
- if (String.Compare(className, classNameStart, "UIPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new UIPermission( permState );
- else
- goto USEREFLECTION;
-
- case 16:
- // FileIOPermission
- if (String.Compare(className, classNameStart, "FileIOPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new FileIOPermission( permState );
- else
- goto USEREFLECTION;
-
- case 18:
- // RegistryPermission
- // SecurityPermission
- if (className[classNameStart] == 'R')
- {
- if (String.Compare(className, classNameStart, "RegistryPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new RegistryPermission( permState );
- else
- goto USEREFLECTION;
- }
- else
- {
- if (String.Compare(className, classNameStart, "SecurityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new SecurityPermission( permState );
- else
- goto USEREFLECTION;
- }
- case 20:
- // ReflectionPermission
- // FileDialogPermission
- if (className[classNameStart] == 'R')
- {
- if (String.Compare(className, classNameStart, "ReflectionPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new ReflectionPermission( permState );
- else
- goto USEREFLECTION;
- }
- else
- {
- if (String.Compare(className, classNameStart, "FileDialogPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new FileDialogPermission( permState );
- else
- goto USEREFLECTION;
- }
-
- case 21:
- // EnvironmentPermission
- // UrlIdentityPermission
- // GacIdentityPermission
- if (className[classNameStart] == 'E')
- {
- if (String.Compare(className, classNameStart, "EnvironmentPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new EnvironmentPermission( permState );
- else
- goto USEREFLECTION;
- }
- else if (className[classNameStart] == 'U')
- {
- if (String.Compare(className, classNameStart, "UrlIdentityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new UrlIdentityPermission( permState );
- else
- goto USEREFLECTION;
- }
- else
- {
- if (String.Compare(className, classNameStart, "GacIdentityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new GacIdentityPermission( permState );
- else
- goto USEREFLECTION;
- }
- case 22:
- // SiteIdentityPermission
- // ZoneIdentityPermission
- // KeyContainerPermission
- if (className[classNameStart] == 'S')
- {
- if (String.Compare(className, classNameStart, "SiteIdentityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new SiteIdentityPermission( permState );
- else
- goto USEREFLECTION;
- }
- else if (className[classNameStart] == 'Z')
- {
- if (String.Compare(className, classNameStart, "ZoneIdentityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new ZoneIdentityPermission( permState );
- else
- goto USEREFLECTION;
- }
- else
- {
- if (String.Compare(className, classNameStart, "KeyContainerPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new KeyContainerPermission( permState );
- else
- goto USEREFLECTION;
- }
- case 24:
- // HostProtectionPermission
- if (String.Compare(className, classNameStart, "HostProtectionPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new HostProtectionPermission( permState );
- else
- goto USEREFLECTION;
- case 28:
- // StrongNameIdentityPermission
- if (String.Compare(className, classNameStart, "StrongNameIdentityPermission", 0, classNameLength, StringComparison.Ordinal) == 0)
- return new StrongNameIdentityPermission( permState );
- else
- goto USEREFLECTION;
- default:
- goto USEREFLECTION;
- }
-
-USEREFLECTION:
-
- Object[] objs = new Object[1];
- objs[0] = permState;
-
- Type permClass = null;
- IPermission perm = null;
-
- new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Assert();
- permClass = GetClassFromElement(el, ignoreTypeLoadFailures);
- if (permClass == null)
- return null;
- if (!(typeof(IPermission).IsAssignableFrom(permClass)))
- throw new ArgumentException( Environment.GetResourceString("Argument_NotAPermissionType") );
-
- perm = (IPermission) Activator.CreateInstance(permClass, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, objs, null );
-
- return perm;
- }
-
- internal static Type
- GetClassFromElement (SecurityElement el, bool ignoreTypeLoadFailures)
- {
- String className = el.Attribute( "class" );
-
- if (className == null)
- {
- if (ignoreTypeLoadFailures)
- return null;
- else
- throw new ArgumentException( String.Format( null, Environment.GetResourceString("Argument_InvalidXMLMissingAttr"), "class") );
- }
-
- if (ignoreTypeLoadFailures)
- {
- try
- {
- return Type.GetType(className, false, false);
- }
- catch (SecurityException)
- {
- return null;
- }
- }
- else
- return Type.GetType(className, true, false);
- }
-
- public static bool
- IsPermissionElement (IPermission ip,
- SecurityElement el)
- {
- if (!el.Tag.Equals ("Permission") && !el.Tag.Equals ("IPermission"))
- return false;
-
- return true;
- }
-
- public static bool
- IsUnrestricted (SecurityElement el)
- {
- String sUnrestricted = el.Attribute( "Unrestricted" );
-
- if (sUnrestricted == null)
- return false;
-
- return sUnrestricted.Equals( "true" ) || sUnrestricted.Equals( "TRUE" ) || sUnrestricted.Equals( "True" );
- }
-
-
- public static String BitFieldEnumToString( Type type, Object value )
- {
- int iValue = (int)value;
-
- if (iValue == 0)
- return Enum.GetName( type, 0 );
-
- StringBuilder result = StringBuilderCache.Acquire();
- bool first = true;
- int flag = 0x1;
-
- for (int i = 1; i < 32; ++i)
- {
- if ((flag & iValue) != 0)
- {
- String sFlag = Enum.GetName( type, flag );
-
- if (sFlag == null)
- continue;
-
- if (!first)
- {
- result.Append( ", " );
- }
-
- result.Append( sFlag );
- first = false;
- }
-
- flag = flag << 1;
- }
-
- return StringBuilderCache.GetStringAndRelease(result);
- }
- }
-}
diff --git a/src/mscorlib/src/System/Security/Util/sitestring.cs b/src/mscorlib/src/System/Security/Util/sitestring.cs
index 968e394cd1..ad9699e795 100644
--- a/src/mscorlib/src/System/Security/Util/sitestring.cs
+++ b/src/mscorlib/src/System/Security/Util/sitestring.cs
@@ -25,12 +25,6 @@ namespace System.Security.Util {
m_site = site;
}
- private SiteString(String site, ArrayList separatedSite)
- {
- m_separatedSite = separatedSite;
- m_site = site;
- }
-
private static ArrayList CreateSeparatedSite(String site)
{
if (site == null || site.Length == 0)
@@ -178,12 +172,6 @@ namespace System.Security.Util {
return false;
return this.IsSubsetOf(ss, ignoreCase) && ss.IsSubsetOf(this, ignoreCase);
}
-
-
- public virtual SiteString Copy()
- {
- return new SiteString( m_site, m_separatedSite );
- }
public virtual bool IsSubsetOf( SiteString operand )
{
@@ -241,47 +229,5 @@ namespace System.Security.Util {
else
return true;
}
-
-
-
- public virtual SiteString Intersect( SiteString operand )
- {
- if (operand == null)
- {
- return null;
- }
- else if (this.IsSubsetOf( operand ))
- {
- return this.Copy();
- }
- else if (operand.IsSubsetOf( this ))
- {
- return operand.Copy();
- }
- else
- {
- return null;
- }
- }
-
- public virtual SiteString Union( SiteString operand )
- {
- if (operand == null)
- {
- return this;
- }
- else if (this.IsSubsetOf( operand ))
- {
- return operand.Copy();
- }
- else if (operand.IsSubsetOf( this ))
- {
- return this.Copy();
- }
- else
- {
- return null;
- }
- }
}
}
diff --git a/src/mscorlib/src/System/SharedStatics.cs b/src/mscorlib/src/System/SharedStatics.cs
index cbc5c354a1..d7bd75a11e 100644
--- a/src/mscorlib/src/System/SharedStatics.cs
+++ b/src/mscorlib/src/System/SharedStatics.cs
@@ -36,40 +36,9 @@ namespace System
}
private volatile String _Remoting_Identity_IDGuid;
- public static String Remoting_Identity_IDGuid
- {
- get
- {
- if (_sharedStatics._Remoting_Identity_IDGuid == null)
- {
- bool tookLock = false;
- RuntimeHelpers.PrepareConstrainedRegions();
- try {
- Monitor.Enter(_sharedStatics, ref tookLock);
-
- if (_sharedStatics._Remoting_Identity_IDGuid == null)
- {
- _sharedStatics._Remoting_Identity_IDGuid = Guid.NewGuid().ToString().Replace('-', '_');
- }
- }
- finally {
- if (tookLock)
- Monitor.Exit(_sharedStatics);
- }
- }
-
- Debug.Assert(_sharedStatics._Remoting_Identity_IDGuid != null,
- "_sharedStatics._Remoting_Identity_IDGuid != null");
- return _sharedStatics._Remoting_Identity_IDGuid;
- }
- }
// Note this may not need to be process-wide.
private int _Remoting_Identity_IDSeqNum;
- internal static int Remoting_Identity_GetNextSeqNum()
- {
- return Interlocked.Increment(ref _sharedStatics._Remoting_Identity_IDSeqNum);
- }
// This is the total amount of memory currently "reserved" via
diff --git a/src/mscorlib/src/System/StringComparer.cs b/src/mscorlib/src/System/StringComparer.cs
index 02e8d71d0e..c8cd75e4af 100644
--- a/src/mscorlib/src/System/StringComparer.cs
+++ b/src/mscorlib/src/System/StringComparer.cs
@@ -162,11 +162,6 @@ namespace System {
_ignoreCase = ignoreCase;
}
- internal CultureAwareComparer(CompareInfo compareInfo, bool ignoreCase) {
- _compareInfo = compareInfo;
- _ignoreCase = ignoreCase;
- }
-
public override int Compare(string x, string y) {
if (Object.ReferenceEquals(x, y)) return 0;
if (x == null) return -1;
@@ -211,9 +206,6 @@ namespace System {
}
#if FEATURE_RANDOMIZED_STRING_HASHING
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new CultureAwareRandomizedComparer(_compareInfo, _ignoreCase);
- }
IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
return this;
@@ -222,77 +214,6 @@ namespace System {
}
-#if FEATURE_RANDOMIZED_STRING_HASHING
- internal sealed class CultureAwareRandomizedComparer : StringComparer, IWellKnownStringEqualityComparer {
-
- private CompareInfo _compareInfo;
- private bool _ignoreCase;
- private long _entropy;
-
- internal CultureAwareRandomizedComparer(CompareInfo compareInfo, bool ignoreCase) {
- _compareInfo = compareInfo;
- _ignoreCase = ignoreCase;
- _entropy = HashHelpers.GetEntropy();
- }
-
- public override int Compare(string x, string y) {
- if (Object.ReferenceEquals(x, y)) return 0;
- if (x == null) return -1;
- if (y == null) return 1;
- return _compareInfo.Compare(x, y, _ignoreCase? CompareOptions.IgnoreCase : CompareOptions.None);
- }
-
- public override bool Equals(string x, string y) {
- if (Object.ReferenceEquals(x ,y)) return true;
- if (x == null || y == null) return false;
-
- return (_compareInfo.Compare(x, y, _ignoreCase? CompareOptions.IgnoreCase : CompareOptions.None) == 0);
- }
-
- public override int GetHashCode(string obj) {
- if( obj == null) {
- throw new ArgumentNullException(nameof(obj));
- }
- Contract.EndContractBlock();
-
- CompareOptions options = CompareOptions.None;
-
- if( _ignoreCase) {
- options |= CompareOptions.IgnoreCase;
- }
-
-#if FEATURE_COREFX_GLOBALIZATION
- return _compareInfo.GetHashCodeOfStringCore(obj, options, true, _entropy);
-#else
- return _compareInfo.GetHashCodeOfString(obj, options, true, _entropy);
-#endif
- }
-
- // Equals method for the comparer itself.
- public override bool Equals(Object obj){
- CultureAwareRandomizedComparer comparer = obj as CultureAwareRandomizedComparer;
- if( comparer == null) {
- return false;
- }
- return (this._ignoreCase == comparer._ignoreCase) && (this._compareInfo.Equals(comparer._compareInfo)) && (this._entropy == comparer._entropy);
- }
-
- public override int GetHashCode() {
- int hashCode = _compareInfo.GetHashCode() ;
- return ((_ignoreCase ? (~hashCode) : hashCode) ^ ((int) (_entropy & 0x7FFFFFFF)));
- }
-
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new CultureAwareRandomizedComparer(_compareInfo, _ignoreCase);
- }
-
- // We want to serialize the old comparer.
- IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
- return new CultureAwareComparer(_compareInfo, _ignoreCase);
- }
- }
-#endif
-
// Provide x more optimal implementation of ordinal comparison.
[Serializable]
internal sealed class OrdinalComparer : StringComparer
@@ -360,9 +281,6 @@ namespace System {
}
#if FEATURE_RANDOMIZED_STRING_HASHING
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new OrdinalRandomizedComparer(_ignoreCase);
- }
IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
return this;
@@ -371,89 +289,11 @@ namespace System {
}
-
#if FEATURE_RANDOMIZED_STRING_HASHING
- internal sealed class OrdinalRandomizedComparer : StringComparer, IWellKnownStringEqualityComparer {
- private bool _ignoreCase;
- private long _entropy;
-
- internal OrdinalRandomizedComparer(bool ignoreCase) {
- _ignoreCase = ignoreCase;
- _entropy = HashHelpers.GetEntropy();
- }
-
- public override int Compare(string x, string y) {
- if (Object.ReferenceEquals(x, y)) return 0;
- if (x == null) return -1;
- if (y == null) return 1;
-
- if( _ignoreCase) {
- return String.Compare(x, y, StringComparison.OrdinalIgnoreCase);
- }
-
- return String.CompareOrdinal(x, y);
- }
-
- public override bool Equals(string x, string y) {
- if (Object.ReferenceEquals(x ,y)) return true;
- if (x == null || y == null) return false;
-
- if( _ignoreCase) {
- if( x.Length != y.Length) {
- return false;
- }
- return (String.Compare(x, y, StringComparison.OrdinalIgnoreCase) == 0);
- }
- return x.Equals(y);
- }
-
- public override int GetHashCode(string obj) {
- if( obj == null) {
- throw new ArgumentNullException(nameof(obj));
- }
- Contract.EndContractBlock();
-
- if( _ignoreCase) {
-#if FEATURE_COREFX_GLOBALIZATION
- return CultureInfo.InvariantCulture.CompareInfo.GetHashCodeOfStringCore(obj, CompareOptions.IgnoreCase, true, _entropy);
-#else
- return TextInfo.GetHashCodeOrdinalIgnoreCase(obj, true, _entropy);
-#endif
- }
-
- return String.InternalMarvin32HashString(obj, obj.Length, _entropy);
- }
-
- // Equals method for the comparer itself.
- public override bool Equals(Object obj){
- OrdinalRandomizedComparer comparer = obj as OrdinalRandomizedComparer;
- if( comparer == null) {
- return false;
- }
- return (this._ignoreCase == comparer._ignoreCase) && (this._entropy == comparer._entropy);
- }
-
- public override int GetHashCode() {
- string name = "OrdinalRandomizedComparer";
- int hashCode = name.GetHashCode();
- return ((_ignoreCase ? (~hashCode) : hashCode) ^ ((int) (_entropy & 0x7FFFFFFF)));
- }
-
- IEqualityComparer IWellKnownStringEqualityComparer.GetRandomizedEqualityComparer() {
- return new OrdinalRandomizedComparer(_ignoreCase);
- }
-
- // We want to serialize the old comparer.
- IEqualityComparer IWellKnownStringEqualityComparer.GetEqualityComparerForSerialization() {
- return new OrdinalComparer(_ignoreCase);
- }
- }
// This interface is implemented by string comparers in the framework that can opt into
// randomized hashing behaviors.
internal interface IWellKnownStringEqualityComparer {
- // Get an IEqualityComparer that has the same equality comparision rules as "this" but uses Randomized Hashing.
- IEqualityComparer GetRandomizedEqualityComparer();
// Get an IEqaulityComparer that can be serailzied (e.g., it exists in older versions).
IEqualityComparer GetEqualityComparerForSerialization();
}
diff --git a/src/mscorlib/src/System/Text/DecoderFallback.cs b/src/mscorlib/src/System/Text/DecoderFallback.cs
index 42483a724d..bfd4a2852d 100644
--- a/src/mscorlib/src/System/Text/DecoderFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderFallback.cs
@@ -75,14 +75,6 @@ namespace System.Text
// Maximum number of characters that this instance of this fallback could return
public abstract int MaxCharCount { get; }
-
- internal bool IsMicrosoftBestFitFallback
- {
- get
- {
- return bIsMicrosoftBestFitFallback;
- }
- }
}
diff --git a/src/mscorlib/src/System/Text/Encoding.cs b/src/mscorlib/src/System/Text/Encoding.cs
index dece2e9e71..aa273e2c87 100644
--- a/src/mscorlib/src/System/Text/Encoding.cs
+++ b/src/mscorlib/src/System/Text/Encoding.cs
@@ -1728,20 +1728,6 @@ namespace System.Text
return AddChar(ch,1);
}
-
- internal unsafe bool AddChar(char ch1, char ch2, int numBytes)
- {
- // Need room for 2 chars
- if (chars >= charEnd - 1)
- {
- // Throw maybe
- bytes-=numBytes; // Didn't encode these bytes
- enc.ThrowCharsOverflow(decoder, bytes <= byteStart); // Throw?
- return false; // No throw, but no store either
- }
- return AddChar(ch1, numBytes) && AddChar(ch2, numBytes);
- }
-
internal unsafe void AdjustBytes(int count)
{
bytes += count;
@@ -1755,12 +1741,6 @@ namespace System.Text
}
}
- // Do we have count more bytes?
- internal unsafe bool EvenMoreData(int count)
- {
- return (bytes <= byteEnd - count);
- }
-
// GetNextByte shouldn't be called unless the caller's already checked more data or even more data,
// but we'll double check just to make sure.
internal unsafe byte GetNextByte()
@@ -1788,24 +1768,6 @@ namespace System.Text
return Fallback(byteBuffer);
}
- internal unsafe bool Fallback(byte byte1, byte byte2)
- {
- // Build our buffer
- byte[] byteBuffer = new byte[] { byte1, byte2 };
-
- // Do the fallback and add the data.
- return Fallback(byteBuffer);
- }
-
- internal unsafe bool Fallback(byte byte1, byte byte2, byte byte3, byte byte4)
- {
- // Build our buffer
- byte[] byteBuffer = new byte[] { byte1, byte2, byte3, byte4 };
-
- // Do the fallback and add the data.
- return Fallback(byteBuffer);
- }
-
internal unsafe bool Fallback(byte[] byteBuffer)
{
// Do the fallback and add the data.
@@ -1913,26 +1875,6 @@ namespace System.Text
return (AddByte(b1, 1 + moreBytesExpected) && AddByte(b2, moreBytesExpected));
}
- internal unsafe bool AddByte(byte b1, byte b2, byte b3)
- {
- return AddByte(b1, b2, b3, (int)0);
- }
-
- internal unsafe bool AddByte(byte b1, byte b2, byte b3, int moreBytesExpected)
- {
- return (AddByte(b1, 2 + moreBytesExpected) &&
- AddByte(b2, 1 + moreBytesExpected) &&
- AddByte(b3, moreBytesExpected));
- }
-
- internal unsafe bool AddByte(byte b1, byte b2, byte b3, byte b4)
- {
- return (AddByte(b1, 3) &&
- AddByte(b2, 2) &&
- AddByte(b3, 1) &&
- AddByte(b4, 0));
- }
-
internal unsafe void MovePrevious(bool bThrow)
{
if (fallbackBuffer.bFallingBack)
@@ -1950,12 +1892,6 @@ namespace System.Text
enc.ThrowBytesOverflow(encoder, bytes == byteStart); // Throw? (and reset fallback if not converting)
}
- internal unsafe bool Fallback(char charFallback)
- {
- // Do the fallback
- return fallbackBuffer.InternalFallback(charFallback, ref chars);
- }
-
internal unsafe bool MoreData
{
get
diff --git a/src/mscorlib/src/System/Threading/AsyncLocal.cs b/src/mscorlib/src/System/Threading/AsyncLocal.cs
index 6ed1545ac7..8c4319bd2c 100644
--- a/src/mscorlib/src/System/Threading/AsyncLocal.cs
+++ b/src/mscorlib/src/System/Threading/AsyncLocal.cs
@@ -127,8 +127,6 @@ namespace System.Threading
{
public static IAsyncLocalValueMap Empty { get; } = new EmptyAsyncLocalValueMap();
- public static IAsyncLocalValueMap Create(IAsyncLocal key, object value) => new OneElementAsyncLocalValueMap(key, value);
-
// Instance without any key/value pairs. Used as a singleton/
private sealed class EmptyAsyncLocalValueMap : IAsyncLocalValueMap
{
diff --git a/src/mscorlib/src/System/Threading/EventWaitHandle.cs b/src/mscorlib/src/System/Threading/EventWaitHandle.cs
index 4b1611c6aa..7e2df04c8b 100644
--- a/src/mscorlib/src/System/Threading/EventWaitHandle.cs
+++ b/src/mscorlib/src/System/Threading/EventWaitHandle.cs
@@ -15,10 +15,10 @@
namespace System.Security.AccessControl
{
- public class EventWaitHandleSecurity
+ internal class EventWaitHandleSecurity
{
}
- public enum EventWaitHandleRights
+ internal enum EventWaitHandleRights
{
}
}
@@ -89,7 +89,7 @@ namespace System.Threading
{
}
- public unsafe EventWaitHandle(bool initialState, EventResetMode mode, string name, out bool createdNew, EventWaitHandleSecurity eventSecurity)
+ internal unsafe EventWaitHandle(bool initialState, EventResetMode mode, string name, out bool createdNew, EventWaitHandleSecurity eventSecurity)
{
if(name != null)
{
@@ -146,7 +146,7 @@ namespace System.Threading
return OpenExisting(name, (EventWaitHandleRights)0);
}
- public static EventWaitHandle OpenExisting(string name, EventWaitHandleRights rights)
+ internal static EventWaitHandle OpenExisting(string name, EventWaitHandleRights rights)
{
EventWaitHandle result;
switch (OpenExistingWorker(name, rights, out result))
@@ -171,11 +171,6 @@ namespace System.Threading
return OpenExistingWorker(name, (EventWaitHandleRights)0, out result) == OpenExistingResult.Success;
}
- public static bool TryOpenExisting(string name, EventWaitHandleRights rights, out EventWaitHandle result)
- {
- return OpenExistingWorker(name, rights, out result) == OpenExistingResult.Success;
- }
-
private static OpenExistingResult OpenExistingWorker(string name, EventWaitHandleRights rights, out EventWaitHandle result)
{
#if PLATFORM_UNIX
diff --git a/src/mscorlib/src/System/Threading/IObjectHandle.cs b/src/mscorlib/src/System/Threading/IObjectHandle.cs
deleted file mode 100644
index 464f06e52d..0000000000
--- a/src/mscorlib/src/System/Threading/IObjectHandle.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-**
-**
-** IObjectHandle defines the interface for unwrapping objects.
-** Objects that are marshal by value object can be returned through
-** an indirection allowing the caller to control when the
-** object is loaded into their domain. The caller can unwrap
-** the object from the indirection through this interface.
-**
-**
-===========================================================*/
-namespace System.Runtime.Remoting {
-
- using System;
- using System.Runtime.InteropServices;
-
- [ InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown),
- GuidAttribute("C460E2B4-E199-412a-8456-84DC3E4838C3") ]
- [System.Runtime.InteropServices.ComVisible(true)]
- public interface IObjectHandle {
- // Unwrap the object. Implementers of this interface
- // typically have an indirect referece to another object.
- Object Unwrap();
- }
-}
-
diff --git a/src/mscorlib/src/System/Threading/LockCookie.cs b/src/mscorlib/src/System/Threading/LockCookie.cs
deleted file mode 100644
index c1fbfd828e..0000000000
--- a/src/mscorlib/src/System/Threading/LockCookie.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-//
-/*============================================================
-**
-**
-**
-** Purpose: Defines the lock that implements
-** single-writer/multiple-reader semantics
-**
-**
-===========================================================*/
-
-namespace System.Threading {
-
- using System;
- [System.Runtime.InteropServices.ComVisible(true)]
- public struct LockCookie
- {
- private int _dwFlags;
- private int _dwWriterSeqNum;
- private int _wReaderAndWriterLevel;
- private int _dwThreadID;
-
- public override int GetHashCode()
- {
- return _dwFlags + _dwWriterSeqNum + _wReaderAndWriterLevel + _dwThreadID;
- }
-
- public override bool Equals(Object obj)
- {
- if (obj is LockCookie)
- return Equals((LockCookie)obj);
- else
- return false;
- }
-
- public bool Equals(LockCookie obj)
- {
- return obj._dwFlags == _dwFlags && obj._dwWriterSeqNum == _dwWriterSeqNum &&
- obj._wReaderAndWriterLevel == _wReaderAndWriterLevel && obj._dwThreadID == _dwThreadID;
- }
-
- public static bool operator ==(LockCookie a, LockCookie b)
- {
- return a.Equals(b);
- }
-
- public static bool operator !=(LockCookie a, LockCookie b)
- {
- return !(a == b);
- }
- }
-}
-
diff --git a/src/mscorlib/src/System/Threading/Mutex.cs b/src/mscorlib/src/System/Threading/Mutex.cs
index 31897abc21..ea53a34517 100644
--- a/src/mscorlib/src/System/Threading/Mutex.cs
+++ b/src/mscorlib/src/System/Threading/Mutex.cs
@@ -32,7 +32,7 @@ namespace System.Threading
{
static bool dummyBool;
- public class MutexSecurity
+ internal class MutexSecurity
{
}
@@ -43,7 +43,7 @@ namespace System.Threading
}
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- public unsafe Mutex(bool initiallyOwned, String name, out bool createdNew, MutexSecurity mutexSecurity)
+ internal unsafe Mutex(bool initiallyOwned, String name, out bool createdNew, MutexSecurity mutexSecurity)
{
if (name == string.Empty)
{
@@ -63,25 +63,6 @@ namespace System.Threading
}
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
- internal Mutex(bool initiallyOwned, String name, out bool createdNew, Win32Native.SECURITY_ATTRIBUTES secAttrs)
- {
- if (name == string.Empty)
- {
- // Empty name is treated as an unnamed mutex. Set to null, and we will check for null from now on.
- name = null;
- }
-#if !PLATFORM_UNIX
- if (name != null && System.IO.Path.MaxPath < name.Length)
- {
- throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name));
- }
-#endif
- Contract.EndContractBlock();
-
- CreateMutexWithGuaranteedCleanup(initiallyOwned, name, out createdNew, secAttrs);
- }
-
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
internal void CreateMutexWithGuaranteedCleanup(bool initiallyOwned, String name, out bool createdNew, Win32Native.SECURITY_ATTRIBUTES secAttrs)
{
RuntimeHelpers.CleanupCode cleanupCode = new RuntimeHelpers.CleanupCode(MutexCleanupCode);
@@ -224,11 +205,11 @@ namespace System.Threading
return OpenExisting(name, (MutexRights) 0);
}
- public enum MutexRights
+ internal enum MutexRights
{
}
- public static Mutex OpenExisting(string name, MutexRights rights)
+ internal static Mutex OpenExisting(string name, MutexRights rights)
{
Mutex result;
switch (OpenExistingWorker(name, rights, out result))
@@ -253,11 +234,6 @@ namespace System.Threading
return OpenExistingWorker(name, (MutexRights)0, out result) == OpenExistingResult.Success;
}
- public static bool TryOpenExisting(string name, MutexRights rights, out Mutex result)
- {
- return OpenExistingWorker(name, rights, out result) == OpenExistingResult.Success;
- }
-
private static OpenExistingResult OpenExistingWorker(string name, MutexRights rights, out Mutex result)
{
if (name == null)
diff --git a/src/mscorlib/src/System/Threading/SynchronizationContext.cs b/src/mscorlib/src/System/Threading/SynchronizationContext.cs
index 19f32eebcb..d96525c03f 100644
--- a/src/mscorlib/src/System/Threading/SynchronizationContext.cs
+++ b/src/mscorlib/src/System/Threading/SynchronizationContext.cs
@@ -165,11 +165,6 @@ namespace System.Threading
Thread.CurrentThread.SynchronizationContext = syncContext;
}
- public static void SetThreadStaticContext(SynchronizationContext syncContext)
- {
- Thread.CurrentThread.SynchronizationContext = syncContext;
- }
-
public static SynchronizationContext Current
{
get
diff --git a/src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs b/src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs
index b8155d017e..ef699cecce 100644
--- a/src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs
@@ -27,7 +27,6 @@ namespace Windows.Foundation.Diagnostics
void TraceSynchronousWorkCompletion(CausalityTraceLevel traceLevel, CausalitySource source, CausalitySynchronousWork work);
//These next 2 functions could've been represented as an event except that the EventRegistrationToken wasn't being propagated to WinRT
EventRegistrationToken add_TracingStatusChanged(System.EventHandler<TracingStatusChangedEventArgs> eventHandler);
- void remove_TracingStatusChanged(EventRegistrationToken token);
}
[ComImport]
diff --git a/src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs b/src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs
index 6b9dfbbe37..545bf9a5e5 100644
--- a/src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs
@@ -52,11 +52,6 @@ namespace System.Threading.Tasks
/// <summary>Gets the number of items in the collection.</summary>
/// <remarks>In many implementations, this method will not be thread-safe.</remarks>
int Count { get; }
-
- /// <summary>A thread-safe way to get the number of items in the collection. May synchronize access by locking the provided synchronization object.</summary>
- /// <param name="syncObj">The sync object used to lock</param>
- /// <returns>The collection count</returns>
- int GetCountSafe(object syncObj);
}
/// <summary>
@@ -80,10 +75,6 @@ namespace System.Threading.Tasks
/// <summary>Gets the number of items in the collection.</summary>
int IProducerConsumerQueue<T>.Count { get { return base.Count; } }
-
- /// <summary>A thread-safe way to get the number of items in the collection. May synchronize access by locking the provided synchronization object.</summary>
- /// <remarks>ConcurrentQueue.Count is thread safe, no need to acquire the lock.</remarks>
- int IProducerConsumerQueue<T>.GetCountSafe(object syncObj) { return base.Count; }
}
/// <summary>
@@ -260,143 +251,6 @@ namespace System.Threading.Tasks
return true;
}
- /// <summary>Attempts to peek at an item in the queue.</summary>
- /// <param name="result">The peeked item.</param>
- /// <returns>true if an item could be peeked; otherwise, false.</returns>
- public bool TryPeek(out T result)
- {
- Segment segment = m_head;
- var array = segment.m_array;
- int first = segment.m_state.m_first; // local copy to avoid multiple volatile reads
-
- // Fast path: there's obviously data available in the current segment
- if (first != segment.m_state.m_lastCopy)
- {
- result = array[first];
- return true;
- }
- // Slow path: there may not be data available in the current segment
- else return TryPeekSlow(ref segment, ref array, out result);
- }
-
- /// <summary>Attempts to peek at an item in the queue.</summary>
- /// <param name="array">The array from which the item is peeked.</param>
- /// <param name="segment">The segment from which the item is peeked.</param>
- /// <param name="result">The peeked item.</param>
- /// <returns>true if an item could be peeked; otherwise, false.</returns>
- private bool TryPeekSlow(ref Segment segment, ref T[] array, out T result)
- {
- Contract.Requires(segment != null, "Expected a non-null segment.");
- Contract.Requires(array != null, "Expected a non-null item array.");
-
- if (segment.m_state.m_last != segment.m_state.m_lastCopy)
- {
- segment.m_state.m_lastCopy = segment.m_state.m_last;
- return TryPeek(out result); // will only recur once for this peek operation
- }
-
- if (segment.m_next != null && segment.m_state.m_first == segment.m_state.m_last)
- {
- segment = segment.m_next;
- array = segment.m_array;
- m_head = segment;
- }
-
- var first = segment.m_state.m_first; // local copy to avoid extraneous volatile reads
-
- if (first == segment.m_state.m_last)
- {
- result = default(T);
- return false;
- }
-
- result = array[first];
- return true;
- }
-
- /// <summary>Attempts to dequeue an item from the queue.</summary>
- /// <param name="predicate">The predicate that must return true for the item to be dequeued. If null, all items implicitly return true.</param>
- /// <param name="result">The dequeued item.</param>
- /// <returns>true if an item could be dequeued; otherwise, false.</returns>
- public bool TryDequeueIf(Predicate<T> predicate, out T result)
- {
- Segment segment = m_head;
- var array = segment.m_array;
- int first = segment.m_state.m_first; // local copy to avoid multiple volatile reads
-
- // Fast path: there's obviously data available in the current segment
- if (first != segment.m_state.m_lastCopy)
- {
- result = array[first];
- if (predicate == null || predicate(result))
- {
- array[first] = default(T); // Clear the slot to release the element
- segment.m_state.m_first = (first + 1) & (array.Length - 1);
- return true;
- }
- else
- {
- result = default(T);
- return false;
- }
- }
- // Slow path: there may not be data available in the current segment
- else return TryDequeueIfSlow(predicate, ref segment, ref array, out result);
- }
-
- /// <summary>Attempts to dequeue an item from the queue.</summary>
- /// <param name="predicate">The predicate that must return true for the item to be dequeued. If null, all items implicitly return true.</param>
- /// <param name="array">The array from which the item was dequeued.</param>
- /// <param name="segment">The segment from which the item was dequeued.</param>
- /// <param name="result">The dequeued item.</param>
- /// <returns>true if an item could be dequeued; otherwise, false.</returns>
- private bool TryDequeueIfSlow(Predicate<T> predicate, ref Segment segment, ref T[] array, out T result)
- {
- Contract.Requires(segment != null, "Expected a non-null segment.");
- Contract.Requires(array != null, "Expected a non-null item array.");
-
- if (segment.m_state.m_last != segment.m_state.m_lastCopy)
- {
- segment.m_state.m_lastCopy = segment.m_state.m_last;
- return TryDequeueIf(predicate, out result); // will only recur once for this dequeue operation
- }
-
- if (segment.m_next != null && segment.m_state.m_first == segment.m_state.m_last)
- {
- segment = segment.m_next;
- array = segment.m_array;
- m_head = segment;
- }
-
- var first = segment.m_state.m_first; // local copy to avoid extraneous volatile reads
-
- if (first == segment.m_state.m_last)
- {
- result = default(T);
- return false;
- }
-
- result = array[first];
- if (predicate == null || predicate(result))
- {
- array[first] = default(T); // Clear the slot to release the element
- segment.m_state.m_first = (first + 1) & (segment.m_array.Length - 1);
- segment.m_state.m_lastCopy = segment.m_state.m_last; // Refresh m_lastCopy to ensure that m_first has not passed m_lastCopy
- return true;
- }
- else
- {
- result = default(T);
- return false;
- }
- }
-
- public void Clear()
- {
- T ignored;
- while (TryDequeue(out ignored)) ;
- }
-
/// <summary>Gets whether the collection is currently empty.</summary>
/// <remarks>WARNING: This should not be used concurrently without further vetting.</remarks>
public bool IsEmpty
@@ -452,17 +306,6 @@ namespace System.Threading.Tasks
}
}
- /// <summary>A thread-safe way to get the number of items in the collection. May synchronize access by locking the provided synchronization object.</summary>
- /// <remarks>The Count is not thread safe, so we need to acquire the lock.</remarks>
- int IProducerConsumerQueue<T>.GetCountSafe(object syncObj)
- {
- Debug.Assert(syncObj != null, "The syncObj parameter is null.");
- lock (syncObj)
- {
- return Count;
- }
- }
-
/// <summary>A segment in the queue containing one or more items.</summary>
[StructLayout(LayoutKind.Sequential)]
private sealed class Segment
@@ -520,23 +363,9 @@ namespace System.Threading.Tasks
Contract.Requires(queue != null, "Expected a non-null queue.");
m_queue = queue;
}
-
- /// <summary>Gets the contents of the list.</summary>
- [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
- public T[] Items
- {
- get
- {
- List<T> list = new List<T>();
- foreach (T item in m_queue)
- list.Add(item);
- return list.ToArray();
- }
- }
}
}
-
/// <summary>A placeholder class for common padding constants and eventually routines.</summary>
static class PaddingHelpers
{
diff --git a/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs b/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs
index ef0d4b0e10..def3f687d0 100644
--- a/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs
@@ -61,17 +61,6 @@ namespace System.Threading.Tasks
/// <summary>Prevent external instantiation. All logging should go through the Log instance.</summary>
private TplEtwProvider() { }
- /// <summary>Type of a fork/join operation.</summary>
- public enum ForkJoinOperationType
- {
- /// <summary>Parallel.Invoke.</summary>
- ParallelInvoke=1,
- /// <summary>Parallel.For.</summary>
- ParallelFor=2,
- /// <summary>Parallel.ForEach.</summary>
- ParallelForEach=3
- }
-
/// <summary>Configured behavior of a task wait operation.</summary>
public enum TaskWaitBehavior : int
{
@@ -203,195 +192,6 @@ namespace System.Threading.Tasks
//-----------------------------------------------------------------------------------
//
- // Parallel Events
- //
-
- #region ParallelLoopBegin
- /// <summary>
- /// Denotes the entry point for a Parallel.For or Parallel.ForEach loop
- /// </summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The loop ID.</param>
- /// <param name="OperationType">The kind of fork/join operation.</param>
- /// <param name="InclusiveFrom">The lower bound of the loop.</param>
- /// <param name="ExclusiveTo">The upper bound of the loop.</param>
- [Event(PARALLELLOOPBEGIN_ID, Level = EventLevel.Informational, ActivityOptions=EventActivityOptions.Recursive,
- Task = TplEtwProvider.Tasks.Loop, Opcode = EventOpcode.Start)]
- public void ParallelLoopBegin(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID, ForkJoinOperationType OperationType, // PFX_FORKJOIN_COMMON_EVENT_HEADER
- long InclusiveFrom, long ExclusiveTo)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.Parallel))
- {
- // There is no explicit WriteEvent() overload matching this event's fields. Therefore calling
- // WriteEvent() would hit the "params" overload, which leads to an object allocation every time
- // this event is fired. To prevent that problem we will call WriteEventCore(), which works with
- // a stack based EventData array populated with the event fields.
- unsafe
- {
- EventData* eventPayload = stackalloc EventData[6];
-
- eventPayload[0].Size = sizeof(int);
- eventPayload[0].DataPointer = ((IntPtr) (&OriginatingTaskSchedulerID));
- eventPayload[1].Size = sizeof(int);
- eventPayload[1].DataPointer = ((IntPtr) (&OriginatingTaskID));
- eventPayload[2].Size = sizeof(int);
- eventPayload[2].DataPointer = ((IntPtr) (&ForkJoinContextID));
- eventPayload[3].Size = sizeof(int);
- eventPayload[3].DataPointer = ((IntPtr) (&OperationType));
- eventPayload[4].Size = sizeof(long);
- eventPayload[4].DataPointer = ((IntPtr) (&InclusiveFrom));
- eventPayload[5].Size = sizeof(long);
- eventPayload[5].DataPointer = ((IntPtr) (&ExclusiveTo));
-
- WriteEventCore(PARALLELLOOPBEGIN_ID, 6, eventPayload);
- }
- }
- }
- #endregion
-
- #region ParallelLoopEnd
- /// <summary>
- /// Denotes the end of a Parallel.For or Parallel.ForEach loop.
- /// </summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The loop ID.</param>
- /// <param name="TotalIterations">the total number of iterations processed.</param>
- [Event(PARALLELLOOPEND_ID, Level = EventLevel.Informational, Task = TplEtwProvider.Tasks.Loop, Opcode = EventOpcode.Stop)]
- public void ParallelLoopEnd(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID, long TotalIterations)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.Parallel))
- {
- // There is no explicit WriteEvent() overload matching this event's fields.
- // Therefore calling WriteEvent() would hit the "params" overload, which leads to an object allocation every time this event is fired.
- // To prevent that problem we will call WriteEventCore(), which works with a stack based EventData array populated with the event fields
- unsafe
- {
- EventData* eventPayload = stackalloc EventData[4];
-
- eventPayload[0].Size = sizeof(int);
- eventPayload[0].DataPointer = ((IntPtr) (&OriginatingTaskSchedulerID));
- eventPayload[1].Size = sizeof(int);
- eventPayload[1].DataPointer = ((IntPtr) (&OriginatingTaskID));
- eventPayload[2].Size = sizeof(int);
- eventPayload[2].DataPointer = ((IntPtr) (&ForkJoinContextID));
- eventPayload[3].Size = sizeof(long);
- eventPayload[3].DataPointer = ((IntPtr) (&TotalIterations));
-
- WriteEventCore(PARALLELLOOPEND_ID, 4, eventPayload);
- }
- }
- }
- #endregion
-
- #region ParallelInvokeBegin
- /// <summary>Denotes the entry point for a Parallel.Invoke call.</summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The invoke ID.</param>
- /// <param name="OperationType">The kind of fork/join operation.</param>
- /// <param name="ActionCount">The number of actions being invoked.</param>
- [Event(PARALLELINVOKEBEGIN_ID, Level = EventLevel.Informational, ActivityOptions=EventActivityOptions.Recursive,
- Task = TplEtwProvider.Tasks.Invoke, Opcode = EventOpcode.Start)]
- public void ParallelInvokeBegin(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID, ForkJoinOperationType OperationType, // PFX_FORKJOIN_COMMON_EVENT_HEADER
- int ActionCount)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.Parallel))
- {
- // There is no explicit WriteEvent() overload matching this event's fields.
- // Therefore calling WriteEvent() would hit the "params" overload, which leads to an object allocation every time this event is fired.
- // To prevent that problem we will call WriteEventCore(), which works with a stack based EventData array populated with the event fields
- unsafe
- {
- EventData* eventPayload = stackalloc EventData[5];
-
- eventPayload[0].Size = sizeof(int);
- eventPayload[0].DataPointer = ((IntPtr) (&OriginatingTaskSchedulerID));
- eventPayload[1].Size = sizeof(int);
- eventPayload[1].DataPointer = ((IntPtr) (&OriginatingTaskID));
- eventPayload[2].Size = sizeof(int);
- eventPayload[2].DataPointer = ((IntPtr) (&ForkJoinContextID));
- eventPayload[3].Size = sizeof(int);
- eventPayload[3].DataPointer = ((IntPtr) (&OperationType));
- eventPayload[4].Size = sizeof(int);
- eventPayload[4].DataPointer = ((IntPtr) (&ActionCount));
-
- WriteEventCore(PARALLELINVOKEBEGIN_ID, 5, eventPayload);
- }
- }
- }
- #endregion
-
- #region ParallelInvokeEnd
- /// <summary>
- /// Denotes the exit point for a Parallel.Invoke call.
- /// </summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The invoke ID.</param>
- [Event(PARALLELINVOKEEND_ID, Level = EventLevel.Informational, Task = TplEtwProvider.Tasks.Invoke, Opcode = EventOpcode.Stop)]
- public void ParallelInvokeEnd(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.Parallel))
- {
- WriteEvent(PARALLELINVOKEEND_ID, OriginatingTaskSchedulerID, OriginatingTaskID, ForkJoinContextID);
- }
- }
- #endregion
-
- #region ParallelFork
- /// <summary>
- /// Denotes the start of an individual task that's part of a fork/join context.
- /// Before this event is fired, the start of the new fork/join context will be marked
- /// with another event that declares a unique context ID.
- /// </summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The invoke ID.</param>
- [Event(PARALLELFORK_ID, Level = EventLevel.Verbose, ActivityOptions=EventActivityOptions.Recursive,
- Task = TplEtwProvider.Tasks.ForkJoin, Opcode = EventOpcode.Start)]
- public void ParallelFork(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Verbose, Keywords.Parallel))
- {
- WriteEvent(PARALLELFORK_ID, OriginatingTaskSchedulerID, OriginatingTaskID, ForkJoinContextID);
- }
- }
- #endregion
-
- #region ParallelJoin
- /// <summary>
- /// Denotes the end of an individual task that's part of a fork/join context.
- /// This should match a previous ParallelFork event with a matching "OriginatingTaskID"
- /// </summary>
- /// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
- /// <param name="OriginatingTaskID">The task ID.</param>
- /// <param name="ForkJoinContextID">The invoke ID.</param>
- [Event(PARALLELJOIN_ID, Level = EventLevel.Verbose, Task = TplEtwProvider.Tasks.ForkJoin, Opcode = EventOpcode.Stop)]
- public void ParallelJoin(
- int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
- int ForkJoinContextID)
- {
- if (IsEnabled() && IsEnabled(EventLevel.Verbose, Keywords.Parallel))
- {
- WriteEvent(PARALLELJOIN_ID, OriginatingTaskSchedulerID, OriginatingTaskID, ForkJoinContextID);
- }
- }
- #endregion
-
- //-----------------------------------------------------------------------------------
- //
// Task Events
//
@@ -709,9 +509,6 @@ namespace System.Threading.Tasks
WriteEvent(21, TaskID, Index, Object);
}
- [Event(22, Keywords = Keywords.Debug)]
- public void DebugMessage(string Message) { WriteEvent(22, Message); }
-
[Event(23, Keywords = Keywords.Debug)]
public void DebugFacilityMessage(string Facility, string Message) { WriteEvent(23, Facility, Message); }
diff --git a/src/mscorlib/src/System/Threading/Tasks/Task.cs b/src/mscorlib/src/System/Threading/Tasks/Task.cs
index af3b7cf5cd..2f505512e2 100644
--- a/src/mscorlib/src/System/Threading/Tasks/Task.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/Task.cs
@@ -1670,15 +1670,6 @@ namespace System.Threading.Tasks
get { return (Options & (TaskCreationOptions)InternalTaskOptions.ChildReplica) != 0; }
}
- internal int ActiveChildCount
- {
- get
- {
- var props = Volatile.Read(ref m_contingentProperties);
- return props != null ? props.m_completionCountdown - 1 : 0;
- }
- }
-
/// <summary>
/// The property formerly known as IsFaulted.
/// </summary>
@@ -1756,17 +1747,6 @@ namespace System.Threading.Tasks
return capturedContext.CreateCopy();
}
-
-#if DEBUG
- /// <summary>
- /// Retrieves an identifier for the task.
- /// </summary>
- internal int InternalId
- {
- get { return GetHashCode(); }
- }
-#endif
-
/////////////
// methods
@@ -5193,49 +5173,6 @@ namespace System.Threading.Tasks
}
/// <summary>
- /// Internal WaitAll implementation which is meant to be used with small number of tasks,
- /// optimized for Parallel.Invoke and other structured primitives.
- /// </summary>
- internal static void FastWaitAll(Task[] tasks)
- {
- Contract.Requires(tasks != null);
-
- List<Exception> exceptions = null;
-
- // Collects incomplete tasks in "waitedOnTaskList" and their cooperative events in "cooperativeEventList"
- for (int i = tasks.Length - 1; i >= 0; i--)
- {
- if (!tasks[i].IsCompleted)
- {
- // Just attempting to inline here... result doesn't matter.
- // We'll do a second pass to do actual wait on each task, and to aggregate their exceptions.
- // If the task is inlined here, it will register as IsCompleted in the second pass
- // and will just give us the exception.
- tasks[i].WrappedTryRunInline();
- }
- }
-
- // Wait on the tasks.
- for (int i = tasks.Length - 1; i >= 0; i--)
- {
- var task = tasks[i];
- task.SpinThenBlockingWait(Timeout.Infinite, default(CancellationToken));
- AddExceptionsForCompletedTask(ref exceptions, task);
-
- // Note that unlike other wait code paths, we do not check
- // task.NotifyDebuggerOfWaitCompletionIfNecessary() here, because this method is currently
- // only used from contexts where the tasks couldn't have that bit set, namely
- // Parallel.Invoke. If that ever changes, such checks should be added here.
- }
-
- // If one or more threw exceptions, aggregate them.
- if (exceptions != null)
- {
- ThrowHelper.ThrowAggregateException(exceptions);
- }
- }
-
- /// <summary>
/// This internal function is only meant to be called by WaitAll()
/// If the completed task is canceled or it has other exceptions, here we will add those
/// into the passed in exception list (which will be lazily initialized here).
diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs b/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs
index 320f704f09..c2a63eed6b 100644
--- a/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs
@@ -203,22 +203,6 @@ namespace System.Threading.Tasks
return rval;
}
- /// <summary>Attempts to transition the underlying task to the faulted state.</summary>
- /// <param name="exceptions">The collection of exception dispatch infos to bind to this task.</param>
- /// <returns>True if the operation was successful; otherwise, false.</returns>
- /// <remarks>Unlike the public methods, this method doesn't currently validate that its arguments are correct.</remarks>
- internal bool TrySetException(IEnumerable<ExceptionDispatchInfo> exceptions)
- {
- Debug.Assert(exceptions != null);
-#if DEBUG
- foreach(var edi in exceptions) Debug.Assert(edi != null, "Contents must be non-null");
-#endif
-
- bool rval = m_task.TrySetException(exceptions);
- if (!rval && !m_task.IsCompleted) SpinUntilCompleted();
- return rval;
- }
-
/// <summary>
/// Transitions the underlying
/// <see cref="T:System.Threading.Tasks.Task{TResult}"/> into the
diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs b/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs
index 45817dab23..ee1112a93f 100644
--- a/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs
@@ -149,23 +149,6 @@ namespace System.Threading.Tasks
/// Add an exception to the holder. This will ensure the holder is
/// in the proper state (handled/unhandled) depending on the list's contents.
/// </summary>
- /// <param name="exceptionObject">
- /// An exception object (either an Exception, an ExceptionDispatchInfo,
- /// an IEnumerable{Exception}, or an IEnumerable{ExceptionDispatchInfo})
- /// to add to the list.
- /// </param>
- /// <remarks>
- /// Must be called under lock.
- /// </remarks>
- internal void Add(object exceptionObject)
- {
- Add(exceptionObject, representsCancellation: false);
- }
-
- /// <summary>
- /// Add an exception to the holder. This will ensure the holder is
- /// in the proper state (handled/unhandled) depending on the list's contents.
- /// </summary>
/// <param name="representsCancellation">
/// Whether the exception represents a cancellation request (true) or a fault (false).
/// </param>
diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs
index 37ce042fc9..0c9bff2c2f 100644
--- a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs
+++ b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs
@@ -400,15 +400,6 @@ namespace System.Threading.Tasks
InternalTaskOptions.None, ref stackMark);
}
- // Internal version includes InternalTaskOptions for Parallel.Invoke() support.
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var have to be marked non-inlineable
- internal Task StartNew(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions, InternalTaskOptions internalOptions, TaskScheduler scheduler)
- {
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return Task.InternalStartNew(
- Task.InternalCurrentIfAttached(creationOptions), action, null, cancellationToken, scheduler, creationOptions, internalOptions, ref stackMark);
- }
-
/// <summary>
/// Creates and starts a <see cref="T:System.Threading.Tasks.Task">Task</see>.
diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs
index 8a50f46222..bfa47f7c27 100644
--- a/src/mscorlib/src/System/Threading/Thread.cs
+++ b/src/mscorlib/src/System/Threading/Thread.cs
@@ -179,7 +179,7 @@ namespace System.Threading {
SetStartHelper((Delegate)start,0); //0 will setup Thread with default stackSize
}
- public Thread(ThreadStart start, int maxStackSize) {
+ internal Thread(ThreadStart start, int maxStackSize) {
if (start == null) {
throw new ArgumentNullException(nameof(start));
}
@@ -196,7 +196,7 @@ namespace System.Threading {
SetStartHelper((Delegate)start, 0);
}
- public Thread(ParameterizedThreadStart start, int maxStackSize) {
+ internal Thread(ParameterizedThreadStart start, int maxStackSize) {
if (start == null) {
throw new ArgumentNullException(nameof(start));
}
@@ -313,40 +313,6 @@ namespace System.Threading {
internal extern static IntPtr InternalGetCurrentThread();
/*=========================================================================
- ** Raises a ThreadAbortException in the thread, which usually
- ** results in the thread's death. The ThreadAbortException is a special
- ** exception that is not catchable. The finally clauses of all try
- ** statements will be executed before the thread dies. This includes the
- ** finally that a thread might be executing at the moment the Abort is raised.
- ** The thread is not stopped immediately--you must Join on the
- ** thread to guarantee it has stopped.
- ** It is possible for a thread to do an unbounded amount of computation in
- ** the finally's and thus indefinitely delay the threads death.
- ** If Abort() is called on a thread that has not been started, the thread
- ** will abort when Start() is called.
- ** If Abort is called twice on the same thread, a DuplicateThreadAbort
- ** exception is thrown.
- =========================================================================*/
- public void Abort()
- {
- AbortInternal();
- }
-
- // Internal helper (since we can't place security demands on
- // ecalls/fcalls).
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void AbortInternal();
-
- public bool Join(TimeSpan timeout)
- {
- long tm = (long)timeout.TotalMilliseconds;
- if (tm < -1 || tm > (long) Int32.MaxValue)
- throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1"));
-
- return Join((int)tm);
- }
-
- /*=========================================================================
** Suspends the current thread for timeout milliseconds. If timeout == 0,
** forces the thread to give up the remainer of its timeslice. If timeout
** == Timeout.Infinite, no timeout will occur.
@@ -394,7 +360,7 @@ namespace System.Threading {
private static extern bool YieldInternal();
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- public static new bool Yield()
+ internal static new bool Yield()
{
return YieldInternal();
}
@@ -424,10 +390,6 @@ namespace System.Threading {
}
}
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- private static extern ulong GetProcessDefaultStackSize();
-
/*=========================================================================
** PRIVATE Sets the IThreadable interface for the thread. Assumes that
** start != null.
@@ -450,33 +412,6 @@ namespace System.Threading {
private extern void InternalFinalize();
#if FEATURE_COMINTEROP_APARTMENT_SUPPORT
- /*=========================================================================
- ** An unstarted thread can be marked to indicate that it will host a
- ** single-threaded or multi-threaded apartment.
- **
- ** Exceptions: ArgumentException if state is not a valid apartment state
- ** (ApartmentSTA or ApartmentMTA).
- =========================================================================*/
- [Obsolete("The ApartmentState property has been deprecated. Use GetApartmentState, SetApartmentState or TrySetApartmentState instead.", false)]
- public ApartmentState ApartmentState
- {
- get
- {
- return (ApartmentState)GetApartmentStateNative();
- }
-
- set
- {
- SetApartmentStateNative((int)value, true);
- }
- }
-
- public void SetApartmentState(ApartmentState state)
- {
- bool result = SetApartmentStateHelper(state, true);
- if (!result)
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ApartmentStateSwitchFailed"));
- }
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern void StartupSetApartmentStateInternal();
@@ -670,7 +605,7 @@ namespace System.Threading {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern AppDomain GetFastDomainInternal();
- public static AppDomain GetDomain()
+ internal static AppDomain GetDomain()
{
Contract.Ensures(Contract.Result<AppDomain>() != null);
@@ -714,43 +649,9 @@ namespace System.Threading {
[SuppressUnmanagedCodeSecurity]
private static extern void InformThreadNameChange(ThreadHandle t, String name, int len);
- internal Object AbortReason {
- get {
- object result = null;
- try
- {
- result = GetAbortReason();
- }
- catch (Exception e)
- {
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ExceptionStateCrossAppDomain"), e);
- }
- return result;
- }
- set { SetAbortReason(value); }
- }
-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void MemoryBarrier();
- // Helper function to set the AbortReason for a thread abort.
- // Checks that they're not alredy set, and then atomically updates
- // the reason info (object + ADID).
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern void SetAbortReason(Object o);
-
- // Helper function to retrieve the AbortReason from a thread
- // abort. Will perform cross-AppDomain marshalling if the object
- // lives in a different AppDomain from the requester.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern Object GetAbortReason();
-
- // Helper function to clear the AbortReason. Takes care of
- // AppDomain related cleanup if required.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern void ClearAbortReason();
-
-
} // End of class Thread
// declaring a local var of this enum type and passing it by ref into a function that needs to do a
diff --git a/src/mscorlib/src/System/Threading/ThreadAbortException.cs b/src/mscorlib/src/System/Threading/ThreadAbortException.cs
index 09ad4e1bd6..1b5443e19a 100644
--- a/src/mscorlib/src/System/Threading/ThreadAbortException.cs
+++ b/src/mscorlib/src/System/Threading/ThreadAbortException.cs
@@ -36,10 +36,5 @@ namespace System.Threading
: base(info, context)
{
}
-
- public Object ExceptionState
- {
- get {return Thread.CurrentThread.AbortReason;}
- }
}
}
diff --git a/src/mscorlib/src/System/Threading/Timer.cs b/src/mscorlib/src/System/Threading/Timer.cs
index 5bfefccad2..a2b437857c 100644
--- a/src/mscorlib/src/System/Threading/Timer.cs
+++ b/src/mscorlib/src/System/Threading/Timer.cs
@@ -221,83 +221,6 @@ namespace System.Threading
volatile int m_pauseTicks = 0; // Time when Pause was called
- internal void Pause()
- {
- lock(this)
- {
- // Delete the native timer so that no timers are fired in the Pause zone
- if(m_appDomainTimer != null && !m_appDomainTimer.IsInvalid)
- {
- m_appDomainTimer.Dispose();
- m_appDomainTimer = null;
- m_isAppDomainTimerScheduled = false;
- m_pauseTicks = TickCount;
- }
- }
- }
-
- internal void Resume()
- {
- //
- // Update timers to adjust their due-time to accomodate Pause/Resume
- //
- lock (this)
- {
- // prevent ThreadAbort while updating state
- try { }
- finally
- {
- int pauseTicks = m_pauseTicks;
- m_pauseTicks = 0; // Set this to 0 so that now timers can be scheduled
-
- int resumedTicks = TickCount;
- int pauseDuration = resumedTicks - pauseTicks;
-
- bool haveTimerToSchedule = false;
- uint nextAppDomainTimerDuration = uint.MaxValue;
-
- TimerQueueTimer timer = m_timers;
- while (timer != null)
- {
- Debug.Assert(timer.m_dueTime != Timeout.UnsignedInfinite);
- Debug.Assert(resumedTicks >= timer.m_startTicks);
-
- uint elapsed; // How much of the timer dueTime has already elapsed
-
- // Timers started before the paused event has to be sufficiently delayed to accomodate
- // for the Pause time. However, timers started after the Paused event shouldnt be adjusted.
- // E.g. ones created by the app in its Activated event should fire when it was designated.
- // The Resumed event which is where this routine is executing is after this Activated and hence
- // shouldn't delay this timer
-
- if(timer.m_startTicks <= pauseTicks)
- elapsed = (uint)(pauseTicks - timer.m_startTicks);
- else
- elapsed = (uint)(resumedTicks - timer.m_startTicks);
-
- // Handling the corner cases where a Timer was already due by the time Resume is happening,
- // We shouldn't delay those timers.
- // Example is a timer started in App's Activated event with a very small duration
- timer.m_dueTime = (timer.m_dueTime > elapsed) ? timer.m_dueTime - elapsed : 0;;
- timer.m_startTicks = resumedTicks; // re-baseline
-
- if (timer.m_dueTime < nextAppDomainTimerDuration)
- {
- haveTimerToSchedule = true;
- nextAppDomainTimerDuration = timer.m_dueTime;
- }
-
- timer = timer.m_next;
- }
-
- if (haveTimerToSchedule)
- {
- EnsureAppDomainTimerFiresBy(nextAppDomainTimerDuration);
- }
- }
- }
- }
-
//
// Fire any timers that have expired, and update the native timer to schedule the rest of them.
@@ -855,16 +778,6 @@ namespace System.Threading
m_timer = new TimerHolder(new TimerQueueTimer(callback, state, dueTime, period, ref stackMark));
}
-
- internal static void Pause()
- {
- TimerQueue.Instance.Pause();
- }
-
- internal static void Resume()
- {
- TimerQueue.Instance.Resume();
- }
public bool Change(int dueTime, int period)
{
diff --git a/src/mscorlib/src/System/Type.cs b/src/mscorlib/src/System/Type.cs
index bced4d0b1a..30ddb29df5 100644
--- a/src/mscorlib/src/System/Type.cs
+++ b/src/mscorlib/src/System/Type.cs
@@ -675,16 +675,6 @@ namespace System
return GetPropertyImpl(name,Type.DefaultLookup,null,returnType,null,null);
}
- internal PropertyInfo GetProperty(String name, BindingFlags bindingAttr, Type returnType)
- {
- if (name == null)
- throw new ArgumentNullException(nameof(name));
- if (returnType == null)
- throw new ArgumentNullException(nameof(returnType));
- Contract.EndContractBlock();
- return GetPropertyImpl(name, bindingAttr, null, returnType, null, null);
- }
-
public PropertyInfo GetProperty(String name)
{
if (name == null)
@@ -1228,11 +1218,6 @@ namespace System
[Pure]
get {return IsMarshalByRefImpl();}
}
-
- internal bool HasProxyAttribute {
- [Pure]
- get {return HasProxyAttributeImpl();}
- }
// Protected routine to determine if this class represents a value class
// The default implementation of IsValueTypeImpl never returns true for non-runtime types.
@@ -1296,12 +1281,6 @@ namespace System
return false;
}
- internal virtual bool HasProxyAttributeImpl()
- {
- // We will override this in RuntimeType
- return false;
- }
-
[Pure]
abstract public Type GetElementType();
diff --git a/src/mscorlib/src/System/Variant.cs b/src/mscorlib/src/System/Variant.cs
index 2a9593cf42..509650b8fc 100644
--- a/src/mscorlib/src/System/Variant.cs
+++ b/src/mscorlib/src/System/Variant.cs
@@ -334,21 +334,6 @@ namespace System {
m_flags |= ((int)vt << VTBitShift);
}
-
- unsafe public Variant(void* voidPointer,Type pointerType) {
- if (pointerType == null)
- throw new ArgumentNullException(nameof(pointerType));
- if (!pointerType.IsPointer)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"),nameof(pointerType));
- Contract.EndContractBlock();
-
- m_objref = pointerType;
- m_flags=CV_PTR;
- m_data1=(int)voidPointer;
- m_data2=0;
-
- }
-
//This is a family-only accessor for the CVType.
//This is never to be exposed externally.
internal int CVType {
diff --git a/src/mscorlib/src/System/__ComObject.cs b/src/mscorlib/src/System/__ComObject.cs
index 9f9bac6084..5bb5a2e7d1 100644
--- a/src/mscorlib/src/System/__ComObject.cs
+++ b/src/mscorlib/src/System/__ComObject.cs
@@ -58,12 +58,6 @@ namespace System
return base.ToString();
}
-
- internal IntPtr GetIUnknown(out bool fIsURTAggregated)
- {
- fIsURTAggregated = !GetType().IsDefined(typeof(ComImportAttribute), false);
- return System.Runtime.InteropServices.Marshal.GetIUnknownForObject(this);
- }
//====================================================================
// This method retrieves the data associated with the specified
diff --git a/src/mscorlib/src/mscorlib.Friends.cs b/src/mscorlib/src/mscorlib.Friends.cs
index e55d043c6c..0e57812638 100644
--- a/src/mscorlib/src/mscorlib.Friends.cs
+++ b/src/mscorlib/src/mscorlib.Friends.cs
@@ -10,14 +10,8 @@ using System.Runtime.CompilerServices;
// AssemblyAttributes.cspp model for the other build types at a future point in time.
// Depends on things like SuppressUnmanagedCodeAttribute and WindowsRuntimeImportAttribute
-[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime, PublicKey=" + _InternalsVisibleToKeys.EcmaPublicKeyFull, AllInternalsVisible=false)]
+[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime, PublicKey=00000000000000000400000000000000", AllInternalsVisible=false)]
// Depends on WindowsRuntimeImportAttribute
-[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime.UI.Xaml, PublicKey=" + _InternalsVisibleToKeys.EcmaPublicKeyFull, AllInternalsVisible=false)]
-
-internal class _InternalsVisibleToKeys
-{
- // Token = b77a5c561934e089
- internal const string EcmaPublicKeyFull = "00000000000000000400000000000000";
-}
+[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime.UI.Xaml, PublicKey=00000000000000000400000000000000", AllInternalsVisible=false)]
diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h
index 25e29e0755..7d45befe5c 100644
--- a/src/vm/ecalllist.h
+++ b/src/vm/ecalllist.h
@@ -283,7 +283,6 @@ FCFuncStart(gEnvironmentFuncs)
FCFuncElement("get_HasShutdownStarted", SystemNative::HasShutdownStarted)
QCFuncElement("GetProcessorCount", SystemNative::GetProcessorCount)
#ifndef FEATURE_CORECLR
- QCFuncElement("GetWorkingSet", SystemNative::GetWorkingSet)
FCFuncElement("nativeGetEnvironmentVariable", SystemNative::_GetEnvironmentVariable)
FCFuncElement("GetCompatibilityFlag", SystemNative::_GetCompatibilityFlag)
QCFuncElement("GetCommandLine", SystemNative::_GetCommandLine)
@@ -296,9 +295,6 @@ FCFuncStart(gEnvironmentFuncs)
QCFuncElement("WinRTSupported", SystemNative::WinRTSupported)
#endif // FEATURE_COMINTEROP
FCFuncElementSig("FailFast", &gsig_SM_Str_RetVoid, SystemNative::FailFast)
-#ifndef FEATURE_CORECLR
- FCFuncElementSig("FailFast", &gsig_SM_Str_Uint_RetVoid, SystemNative::FailFastWithExitCode)
-#endif
FCFuncElementSig("FailFast", &gsig_SM_Str_Exception_RetVoid, SystemNative::FailFastWithException)
#ifndef FEATURE_CORECLR
QCFuncElement("GetIsCLRHosted", SystemNative::IsCLRHosted)
@@ -308,17 +304,9 @@ FCFuncEnd()
FCFuncStart(gRuntimeEnvironmentFuncs)
FCFuncElement("GetModuleFileName", SystemNative::_GetModuleFileName)
- FCFuncElement("GetRuntimeDirectoryImpl", SystemNative::GetRuntimeDirectory)
-#ifdef FEATURE_FUSION
- FCFuncElement("GetDeveloperPath", SystemNative::GetDeveloperPath)
- FCFuncElement("GetHostBindingFile", SystemNative::GetHostBindingFile)
-#endif // FEATURE_FUSION
#ifndef FEATURE_CORECLR
QCFuncElement("_GetSystemVersion", SystemNative::_GetSystemVersion)
#endif
-#if defined(FEATURE_CLASSIC_COMINTEROP) && !defined(FEATURE_CORECLR)
- QCFuncElement("GetRuntimeInterfaceImpl", SystemNative::GetRuntimeInterfaceImpl)
-#endif
FCFuncEnd()
FCFuncStart(gSerializationFuncs)
@@ -604,18 +592,8 @@ FCFuncStart(gCOMModuleBuilderFuncs)
QCFuncElement("GetMemberRefOfMethodInfo", COMModule::GetMemberRefOfMethodInfo)
QCFuncElement("GetMemberRefOfFieldInfo", COMModule::GetMemberRefOfFieldInfo)
QCFuncElement("GetMemberRefFromSignature", COMModule::GetMemberRefFromSignature)
-#ifndef FEATURE_CORECLR
- QCFuncElement("SetModuleName", COMModule::SetModuleName)
- QCFuncElement("PreSavePEFile", COMDynamicWrite::PreSavePEFile)
- QCFuncElement("SavePEFile", COMDynamicWrite::SavePEFile)
- QCFuncElement("AddResource", COMDynamicWrite::AddResource)
-#endif
QCFuncElement("GetArrayMethodToken", COMModule::GetArrayMethodToken)
QCFuncElement("SetFieldRVAContent", COMModule::SetFieldRVAContent)
-#ifndef FEATURE_CORECLR
- QCFuncElement("DefineNativeResourceFile", COMDynamicWrite::DefineNativeResourceFile)
- QCFuncElement("DefineNativeResourceBytes", COMDynamicWrite::DefineNativeResourceBytes)
-#endif // FEATURE_CORECLR
FCFuncEnd()
FCFuncStart(gCOMModuleHandleFuncs)
@@ -674,10 +652,6 @@ FCFuncStart(gCOMClassWriter)
QCFuncElement("SetFieldLayoutOffset", COMDynamicWrite::SetFieldLayoutOffset)
QCFuncElement("SetClassLayout", COMDynamicWrite::SetClassLayout)
QCFuncElement("SetParamInfo", COMDynamicWrite::SetParamInfo)
-#ifndef FEATURE_CORECLR
- QCFuncElement("SetPInvokeData", COMDynamicWrite::SetPInvokeData)
- QCFuncElement("SetFieldMarshal", COMDynamicWrite::SetFieldMarshal)
-#endif // FEATURE_CORECLR
QCFuncElement("SetConstantValue", COMDynamicWrite::SetConstantValue)
QCFuncElement("DefineCustomAttribute", COMDynamicWrite::DefineCustomAttribute)
#ifndef FEATURE_CORECLR
@@ -702,9 +676,7 @@ FCFuncEnd()
#ifdef FEATURE_CAS_POLICY
FCFuncStart(gCodeAccessSecurityEngineFuncs)
- FCFuncElement("SpecialDemand", SecurityStackWalk::FcallSpecialDemand)
FCFuncElement("Check", SecurityStackWalk::Check)
- FCFuncElement("CheckNReturnSO", SecurityStackWalk::CheckNReturnSO)
FCFuncElement("GetZoneAndOriginInternal", SecurityStackWalk::GetZoneAndOrigin)
#ifdef FEATURE_COMPRESSEDSTACK
FCFuncElement("QuickCheckForAllDemands", SecurityStackWalk::FCallQuickCheckForAllDemands)
@@ -744,9 +716,6 @@ FCFuncEnd()
FCFuncStart(gCOMSecurityManagerFuncs)
QCFuncElement("IsSameType", SecurityPolicy::IsSameType)
FCFuncElement("_SetThreadSecurity", SecurityPolicy::SetThreadSecurity)
-#ifdef FEATURE_CAS_POLICY
- QCFuncElement("GetGrantedPermissions", SecurityPolicy::GetGrantedPermissions)
-#endif
FCFuncEnd()
FCFuncStart(gCOMSecurityContextFuncs)
@@ -777,12 +746,6 @@ FCFuncStart(gCOMUrlStringFuncs)
QCFuncElement("GetDeviceName", SecurityPolicy::GetDeviceName)
FCFuncEnd()
-#ifdef FEATURE_CAS_POLICY
-FCFuncStart(gCOMSecurityRuntimeFuncs)
- FCFuncElement("GetSecurityObjectForFrame", SecurityRuntime::GetSecurityObjectForFrame)
-FCFuncEnd()
-#endif // FEATURE_CAS_POLICY
-
#ifdef FEATURE_X509
FCFuncStart(gX509CertificateFuncs)
@@ -1077,7 +1040,6 @@ FCFuncStart(gAssemblyFuncs)
#endif
FCFuncElement("nLoadImage", AssemblyNative::LoadImage)
#ifndef FEATURE_CORECLR
- FCFuncElement("nLoadFile", AssemblyNative::LoadFile)
QCFuncElement("LoadModule", AssemblyNative::LoadModule)
#endif // FEATURE_CORECLR
QCFuncElement("GetType", AssemblyNative::GetType)
@@ -1088,9 +1050,6 @@ FCFuncStart(gAssemblyFuncs)
QCFuncElement("GetModules", AssemblyNative::GetModules)
QCFuncElement("GetModule", AssemblyNative::GetModule)
FCFuncElement("GetReferencedAssemblies", AssemblyNative::GetReferencedAssemblies)
-#ifndef FEATURE_CORECLR
- QCFuncElement("GetForwardedTypes", AssemblyNative::GetForwardedTypes)
-#endif // FEATURE_CORECLR
QCFuncElement("GetExportedTypes", AssemblyNative::GetExportedTypes)
FCFuncElement("GetManifestResourceNames", AssemblyNative::GetManifestResourceNames)
QCFuncElement("GetEntryPoint", AssemblyNative::GetEntryPoint)
@@ -1100,29 +1059,20 @@ FCFuncStart(gAssemblyFuncs)
QCFuncElement("IsAllSecuritySafeCritical", AssemblyNative::IsAllSecuritySafeCritical)
QCFuncElement("IsAllPublicAreaSecuritySafeCritical", AssemblyNative::IsAllPublicAreaSecuritySafeCritical)
QCFuncElement("GetGrantSet", AssemblyNative::GetGrantSet)
- FCFuncElement("IsGlobalAssemblyCache", AssemblyNative::IsGlobalAssemblyCache)
#endif // !FEATURE_CORECLR
#ifdef FEATURE_CAS_POLICY
QCFuncElement("GetEvidence", SecurityPolicy::GetEvidence)
#endif // FEATURE_CAS_POLICY
QCFuncElement("GetImageRuntimeVersion", AssemblyNative::GetImageRuntimeVersion)
FCFuncElement("IsReflectionOnly", AssemblyNative::IsReflectionOnly)
-#ifndef FEATURE_CORECLR
- QCFuncElement("GetHostContext", AssemblyNative::GetHostContext)
-#endif
#ifdef FEATURE_CAS_POLICY
QCFuncElement("GetIsStrongNameVerified", AssemblyNative::IsStrongNameVerified)
- QCFuncElement("GetRawBytes", AssemblyNative::GetRawBytes)
#endif // FEATURE_CAS_POLICY
FCFuncElement("GetManifestModule", AssemblyHandle::GetManifestModule)
FCFuncElement("GetToken", AssemblyHandle::GetToken)
#ifdef FEATURE_APTCA
FCFuncElement("AptcaCheck", AssemblyHandle::AptcaCheck)
#endif // FEATURE_APTCA
-#ifdef FEATURE_APPX
- QCFuncElement("nIsDesignerBindingContext", AssemblyNative::IsDesignerBindingContext)
-#endif
-
FCFuncEnd()
#ifdef FEATURE_CORECLR
@@ -1137,7 +1087,6 @@ FCFuncStart(gAssemblyLoadContextFuncs)
QCFuncElement("LoadFromPath", AssemblyNative::LoadFromPath)
QCFuncElement("GetLoadedAssembliesInternal", AssemblyNative::GetLoadedAssembliesInternal)
QCFuncElement("InternalLoadUnmanagedDllFromPath", AssemblyNative::InternalLoadUnmanagedDllFromPath)
- QCFuncElement("OverrideDefaultAssemblyLoadContextForCurrentDomain", AssemblyNative::OverrideDefaultAssemblyLoadContextForCurrentDomain)
QCFuncElement("CanUseAppPathAssemblyLoadContextInCurrentDomain", AssemblyNative::CanUseAppPathAssemblyLoadContextInCurrentDomain)
QCFuncElement("LoadFromStream", AssemblyNative::LoadFromStream)
FCFuncElement("nGetFileInformation", AssemblyNameNative::GetFileInformation)
@@ -1415,11 +1364,6 @@ FCFuncStart(gDecimalFuncs)
FCFuncElement("FCallAddSub", COMDecimal::DoAddSubThrow)
FCFuncElement("FCallMultiply", COMDecimal::DoMultiplyThrow)
FCFuncElement("FCallDivide", COMDecimal::DoDivideThrow)
-#ifndef FEATURE_CORECLR
- FCFuncElement("FCallAddSubOverflowed", COMDecimal::DoAddSub)
- FCFuncElement("FCallMultiplyOverflowed", COMDecimal::DoMultiply)
- FCFuncElement("FCallDivideOverflowed", COMDecimal::DoDivide)
-#endif // FEATURE_CORECLR
FCFuncElement("FCallCompare", COMDecimal::DoCompare)
FCFuncElement("FCallFloor", COMDecimal::DoFloor)
FCFuncElement("GetHashCode", COMDecimal::GetHashCode)
@@ -1460,9 +1404,6 @@ FCFuncStart(gEncodingTableFuncs)
FCFuncElement("GetNumEncodingItems", COMNlsInfo::nativeGetNumEncodingItems)
FCFuncElement("GetEncodingData", COMNlsInfo::nativeGetEncodingTableDataPointer)
FCFuncElement("GetCodePageData", COMNlsInfo::nativeGetCodePageTableDataPointer)
-#if FEATURE_CODEPAGES_FILE
- FCFuncElement("nativeCreateOpenFileMapping", COMNlsInfo::nativeCreateOpenFileMapping)
-#endif
FCFuncEnd()
FCFuncStart(gCalendarDataFuncs)
@@ -1487,9 +1428,6 @@ FCFuncStart(gCultureInfoFuncs)
FCFuncElement("nativeGetLocaleInfoEx", COMNlsInfo::nativeGetLocaleInfoEx)
FCFuncElement("nativeGetLocaleInfoExInt", COMNlsInfo::nativeGetLocaleInfoExInt)
-#ifndef FEATURE_CORECLR
- FCFuncElement("nativeSetThreadLocale", COMNlsInfo::nativeSetThreadLocale)
-#endif
QCFuncElement("InternalGetUserDefaultUILanguage", COMNlsInfo::InternalGetUserDefaultUILanguage)
QCFuncElement("InternalGetSystemDefaultUILanguage", COMNlsInfo::InternalGetSystemDefaultUILanguage)
// Added but disabled from desktop in .NET 4.0, stayed disabled in .NET 4.5
@@ -2021,9 +1959,6 @@ FCFuncStart(gGCHandleFuncs)
FCFuncElement("InternalCompareExchange", MarshalNative::GCHandleInternalCompareExchange)
FCFuncElement("InternalAddrOfPinnedObject", MarshalNative::GCHandleInternalAddrOfPinnedObject)
FCFuncElement("InternalCheckDomain", MarshalNative::GCHandleInternalCheckDomain)
-#ifndef FEATURE_CORECLR
- FCFuncElement("InternalGetHandleType", MarshalNative::GCHandleInternalGetHandleType)
-#endif
FCFuncEnd()
#ifndef FEATURE_CORECLR