summaryrefslogtreecommitdiff
path: root/src/mscorlib/src
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2017-04-13 14:17:19 +0900
commita56e30c8d33048216567753d9d3fefc2152af8ac (patch)
tree7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/src
parent4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff)
downloadcoreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2
coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/mscorlib/src')
-rw-r--r--src/mscorlib/src/Internal/Console.cs (renamed from src/mscorlib/src/System/LowLevelConsole.cs)29
-rw-r--r--src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs12
-rw-r--r--src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs2
-rw-r--r--src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs72
-rw-r--r--src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs16
-rw-r--r--src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs38
-rw-r--r--src/mscorlib/src/Interop/Windows/Normaliz/Interop.Normalization.cs24
-rw-r--r--src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs131
-rw-r--r--src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs43
-rw-r--r--src/mscorlib/src/Microsoft/Win32/Registry.cs133
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryKey.cs1290
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs26
-rw-r--r--src/mscorlib/src/Microsoft/Win32/RegistryView.cs19
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFindHandle.cs5
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs10
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs29
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs4
-rw-r--r--src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs42
-rw-r--r--src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs26
-rw-r--r--src/mscorlib/src/Microsoft/Win32/Win32Native.cs516
-rw-r--r--src/mscorlib/src/System.Private.CoreLib.txt2235
-rw-r--r--src/mscorlib/src/System/Action.cs35
-rw-r--r--src/mscorlib/src/System/Activator.cs133
-rw-r--r--src/mscorlib/src/System/AggregateException.cs25
-rw-r--r--src/mscorlib/src/System/AppContext/AppContext.cs28
-rw-r--r--src/mscorlib/src/System/AppContext/AppContextDefaultValues.Defaults.cs1
-rw-r--r--src/mscorlib/src/System/AppContext/AppContextSwitches.cs6
-rw-r--r--src/mscorlib/src/System/AppDomain.cs490
-rw-r--r--src/mscorlib/src/System/AppDomainAttributes.cs18
-rw-r--r--src/mscorlib/src/System/AppDomainManager.cs31
-rw-r--r--src/mscorlib/src/System/AppDomainSetup.cs401
-rw-r--r--src/mscorlib/src/System/AppDomainUnloadedException.cs18
-rw-r--r--src/mscorlib/src/System/ApplicationException.cs56
-rw-r--r--src/mscorlib/src/System/ArgIterator.cs42
-rw-r--r--src/mscorlib/src/System/ArgumentException.cs97
-rw-r--r--src/mscorlib/src/System/ArgumentNullException.cs53
-rw-r--r--src/mscorlib/src/System/ArgumentOutOfRangeException.cs101
-rw-r--r--src/mscorlib/src/System/ArithmeticException.cs51
-rw-r--r--src/mscorlib/src/System/Array.cs1052
-rw-r--r--src/mscorlib/src/System/ArraySegment.cs178
-rw-r--r--src/mscorlib/src/System/ArrayTypeMismatchException.cs51
-rw-r--r--src/mscorlib/src/System/AsyncCallback.cs17
-rw-r--r--src/mscorlib/src/System/Attribute.cs204
-rw-r--r--src/mscorlib/src/System/AttributeTargets.cs36
-rw-r--r--src/mscorlib/src/System/AttributeUsageAttribute.cs56
-rw-r--r--src/mscorlib/src/System/BCLDebug.cs195
-rw-r--r--src/mscorlib/src/System/BadImageFormatException.cs87
-rw-r--r--src/mscorlib/src/System/BitConverter.cs462
-rw-r--r--src/mscorlib/src/System/Boolean.cs351
-rw-r--r--src/mscorlib/src/System/Buffer.cs485
-rw-r--r--src/mscorlib/src/System/Buffers/ArrayPoolEventSource.cs78
-rw-r--r--src/mscorlib/src/System/Byte.cs185
-rw-r--r--src/mscorlib/src/System/CLRConfig.cs17
-rw-r--r--src/mscorlib/src/System/CLSCompliantAttribute.cs34
-rw-r--r--src/mscorlib/src/System/Char.cs1000
-rw-r--r--src/mscorlib/src/System/CharEnumerator.cs81
-rw-r--r--src/mscorlib/src/System/Collections/ArrayList.cs453
-rw-r--r--src/mscorlib/src/System/Collections/CollectionBase.cs199
-rw-r--r--src/mscorlib/src/System/Collections/Comparer.cs64
-rw-r--r--src/mscorlib/src/System/Collections/CompatibleComparer.cs44
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentDictionary.cs10
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs6
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs18
-rw-r--r--src/mscorlib/src/System/Collections/Concurrent/IProducerConsumerCollection.cs2
-rw-r--r--src/mscorlib/src/System/Collections/DictionaryEntry.cs62
-rw-r--r--src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs182
-rw-r--r--src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs113
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Comparer.cs127
-rw-r--r--src/mscorlib/src/System/Collections/Generic/ComparerHelpers.cs210
-rw-r--r--src/mscorlib/src/System/Collections/Generic/DebugView.cs120
-rw-r--r--src/mscorlib/src/System/Collections/Generic/Dictionary.cs1060
-rw-r--r--src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs290
-rw-r--r--src/mscorlib/src/System/Collections/Generic/ICollection.cs52
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IComparer.cs30
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IDictionary.cs58
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IEnumerable.cs38
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IEnumerator.cs35
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IEqualityComparer.cs19
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IList.cs54
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IReadOnlyCollection.cs34
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IReadOnlyDictionary.cs29
-rw-r--r--src/mscorlib/src/System/Collections/Generic/IReadOnlyList.cs34
-rw-r--r--src/mscorlib/src/System/Collections/Generic/KeyNotFoundException.cs44
-rw-r--r--src/mscorlib/src/System/Collections/Generic/KeyValuePair.cs74
-rw-r--r--src/mscorlib/src/System/Collections/Generic/List.cs754
-rw-r--r--src/mscorlib/src/System/Collections/Hashtable.cs970
-rw-r--r--src/mscorlib/src/System/Collections/ICollection.cs80
-rw-r--r--src/mscorlib/src/System/Collections/IComparer.cs31
-rw-r--r--src/mscorlib/src/System/Collections/IDictionary.cs68
-rw-r--r--src/mscorlib/src/System/Collections/IDictionaryEnumerator.cs78
-rw-r--r--src/mscorlib/src/System/Collections/IEnumerable.cs33
-rw-r--r--src/mscorlib/src/System/Collections/IEnumerator.cs52
-rw-r--r--src/mscorlib/src/System/Collections/IEqualityComparer.cs26
-rw-r--r--src/mscorlib/src/System/Collections/IHashCodeProvider.cs12
-rw-r--r--src/mscorlib/src/System/Collections/IList.cs70
-rw-r--r--src/mscorlib/src/System/Collections/IStructuralComparable.cs11
-rw-r--r--src/mscorlib/src/System/Collections/IStructuralEquatable.cs10
-rw-r--r--src/mscorlib/src/System/Collections/ListDictionaryInternal.cs404
-rw-r--r--src/mscorlib/src/System/Collections/ObjectModel/Collection.cs303
-rw-r--r--src/mscorlib/src/System/Collections/ObjectModel/KeyedCollection.cs244
-rw-r--r--src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyCollection.cs196
-rw-r--r--src/mscorlib/src/System/Collections/ObjectModel/ReadOnlyDictionary.cs371
-rw-r--r--src/mscorlib/src/System/Collections/StructuralComparisons.cs89
-rw-r--r--src/mscorlib/src/System/ComponentModel/EditorBrowsableAttribute.cs48
-rw-r--r--src/mscorlib/src/System/Configuration/Assemblies/AssemblyHashAlgorithm.cs28
-rw-r--r--src/mscorlib/src/System/Configuration/Assemblies/AssemblyVersionCompatibility.cs23
-rw-r--r--src/mscorlib/src/System/Convert.cs2703
-rw-r--r--src/mscorlib/src/System/Currency.cs39
-rw-r--r--src/mscorlib/src/System/CurrentSystemTimeZone.Cache.cs35
-rw-r--r--src/mscorlib/src/System/CurrentTimeZone.cs214
-rw-r--r--src/mscorlib/src/System/DBNull.cs119
-rw-r--r--src/mscorlib/src/System/DataMisalignedException.cs39
-rw-r--r--src/mscorlib/src/System/DateTime.CoreCLR.cs29
-rw-r--r--src/mscorlib/src/System/DateTime.cs1360
-rw-r--r--src/mscorlib/src/System/DateTimeKind.cs17
-rw-r--r--src/mscorlib/src/System/DateTimeOffset.cs830
-rw-r--r--src/mscorlib/src/System/DayOfWeek.cs27
-rw-r--r--src/mscorlib/src/System/Decimal.cs883
-rw-r--r--src/mscorlib/src/System/DefaultBinder.CanConvert.cs30
-rw-r--r--src/mscorlib/src/System/DefaultBinder.cs1162
-rw-r--r--src/mscorlib/src/System/Delegate.cs220
-rw-r--r--src/mscorlib/src/System/DelegateSerializationHolder.cs48
-rw-r--r--src/mscorlib/src/System/Diagnostics/Assert.cs45
-rw-r--r--src/mscorlib/src/System/Diagnostics/AssertFilter.cs37
-rw-r--r--src/mscorlib/src/System/Diagnostics/AssertFilters.cs33
-rw-r--r--src/mscorlib/src/System/Diagnostics/CodeAnalysis/SuppressMessageAttribute.cs76
-rw-r--r--src/mscorlib/src/System/Diagnostics/ConditionalAttribute.cs25
-rw-r--r--src/mscorlib/src/System/Diagnostics/Contracts/Contracts.cs48
-rw-r--r--src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs59
-rw-r--r--src/mscorlib/src/System/Diagnostics/Debug.Unix.cs95
-rw-r--r--src/mscorlib/src/System/Diagnostics/Debug.Windows.cs63
-rw-r--r--src/mscorlib/src/System/Diagnostics/Debugger.cs21
-rw-r--r--src/mscorlib/src/System/Diagnostics/DebuggerAttributes.cs110
-rw-r--r--src/mscorlib/src/System/Diagnostics/EditAndContinueHelper.cs11
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs665
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventActivityOptions.cs39
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventCounter.cs436
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventDescriptor.cs195
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventProvider.cs1207
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs6912
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventSourceException.cs53
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs16
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs239
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/StubEnvironment.cs373
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/ArrayTypeInfo.cs63
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/ConcurrentSet.cs127
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/ConcurrentSetItem.cs25
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/DataCollector.cs318
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EmptyStruct.cs17
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EnumHelper.cs30
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EnumerableTypeInfo.cs64
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventDataAttribute.cs146
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventFieldAttribute.cs76
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventFieldFormat.cs130
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventIgnoreAttribute.cs25
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventPayload.cs155
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventSourceActivity.cs321
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/EventSourceOptions.cs130
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/FieldMetadata.cs231
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/InvokeTypeInfo.cs96
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/NameInfo.cs79
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyAnalysis.cs39
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyValue.cs252
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleEventTypes.cs39
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/SimpleTypeInfos.cs297
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/Statics.cs727
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingDataCollector.cs104
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingDataType.cs349
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingEventSource.cs890
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingEventTraits.cs28
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingEventTypes.cs262
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingMetadataCollector.cs370
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TraceLoggingTypeInfo.cs209
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/TypeAnalysis.cs103
-rw-r--r--src/mscorlib/src/System/Diagnostics/Eventing/Winmeta.cs196
-rw-r--r--src/mscorlib/src/System/Diagnostics/ICustomDebuggerNotification.cs8
-rw-r--r--src/mscorlib/src/System/Diagnostics/LogSwitch.cs90
-rw-r--r--src/mscorlib/src/System/Diagnostics/LoggingLevels.cs61
-rw-r--r--src/mscorlib/src/System/Diagnostics/Stackframe.cs104
-rw-r--r--src/mscorlib/src/System/Diagnostics/Stacktrace.cs224
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymDocumentWriter.cs11
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/ISymWriter.cs33
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs24
-rw-r--r--src/mscorlib/src/System/Diagnostics/SymbolStore/Token.cs25
-rw-r--r--src/mscorlib/src/System/Diagnostics/log.cs80
-rw-r--r--src/mscorlib/src/System/DivideByZeroException.cs41
-rw-r--r--src/mscorlib/src/System/DllNotFoundException.cs42
-rw-r--r--src/mscorlib/src/System/Double.cs226
-rw-r--r--src/mscorlib/src/System/DuplicateWaitObjectException.cs65
-rw-r--r--src/mscorlib/src/System/Empty.cs27
-rw-r--r--src/mscorlib/src/System/EntryPointNotFoundException.cs42
-rw-r--r--src/mscorlib/src/System/Enum.cs208
-rw-r--r--src/mscorlib/src/System/Environment.cs476
-rw-r--r--src/mscorlib/src/System/EventHandler.cs14
-rw-r--r--src/mscorlib/src/System/Exception.cs267
-rw-r--r--src/mscorlib/src/System/ExecutionEngineException.cs47
-rw-r--r--src/mscorlib/src/System/FieldAccessException.cs39
-rw-r--r--src/mscorlib/src/System/FlagsAttribute.cs22
-rw-r--r--src/mscorlib/src/System/FormatException.cs41
-rw-r--r--src/mscorlib/src/System/FormattableString.cs81
-rw-r--r--src/mscorlib/src/System/GC.cs167
-rw-r--r--src/mscorlib/src/System/Globalization/BidiCategory.cs9
-rw-r--r--src/mscorlib/src/System/Globalization/Calendar.cs297
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarAlgorithmType.cs19
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarData.Unix.cs339
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarData.Windows.cs502
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarData.cs274
-rw-r--r--src/mscorlib/src/System/Globalization/CalendarWeekRule.cs19
-rw-r--r--src/mscorlib/src/System/Globalization/CalendricalCalculationsHelper.cs414
-rw-r--r--src/mscorlib/src/System/Globalization/CharUnicodeInfo.cs360
-rw-r--r--src/mscorlib/src/System/Globalization/CharUnicodeInfoData.cs1247
-rw-r--r--src/mscorlib/src/System/Globalization/ChineseLunisolarCalendar.cs397
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.Invariant.cs238
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs439
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs486
-rw-r--r--src/mscorlib/src/System/Globalization/CompareInfo.cs897
-rw-r--r--src/mscorlib/src/System/Globalization/CultureData.Unix.cs431
-rw-r--r--src/mscorlib/src/System/Globalization/CultureData.Windows.cs830
-rw-r--r--src/mscorlib/src/System/Globalization/CultureData.cs2503
-rw-r--r--src/mscorlib/src/System/Globalization/CultureInfo.Unix.cs128
-rw-r--r--src/mscorlib/src/System/Globalization/CultureInfo.Windows.cs278
-rw-r--r--src/mscorlib/src/System/Globalization/CultureInfo.cs1357
-rw-r--r--src/mscorlib/src/System/Globalization/CultureNotFoundException.cs129
-rw-r--r--src/mscorlib/src/System/Globalization/CultureTypes.cs30
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeFormat.cs1130
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeFormatInfo.cs2858
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeFormatInfoScanner.cs747
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeParse.cs5035
-rw-r--r--src/mscorlib/src/System/Globalization/DateTimeStyles.cs49
-rw-r--r--src/mscorlib/src/System/Globalization/DaylightTime.cs63
-rw-r--r--src/mscorlib/src/System/Globalization/DigitShapes.cs21
-rw-r--r--src/mscorlib/src/System/Globalization/EastAsianLunisolarCalendar.cs643
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingDataItem.Unix.cs2
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingDataItem.cs77
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingTable.Unix.cs4
-rw-r--r--src/mscorlib/src/System/Globalization/EncodingTable.cs134
-rw-r--r--src/mscorlib/src/System/Globalization/GlobalizationAssembly.cs52
-rw-r--r--src/mscorlib/src/System/Globalization/GlobalizationMode.Unix.cs24
-rw-r--r--src/mscorlib/src/System/Globalization/GlobalizationMode.Windows.cs (renamed from src/mscorlib/src/System/EventArgs.cs)13
-rw-r--r--src/mscorlib/src/System/Globalization/GlobalizationMode.cs12
-rw-r--r--src/mscorlib/src/System/Globalization/GregorianCalendar.cs266
-rw-r--r--src/mscorlib/src/System/Globalization/GregorianCalendarHelper.cs419
-rw-r--r--src/mscorlib/src/System/Globalization/GregorianCalendarTypes.cs17
-rw-r--r--src/mscorlib/src/System/Globalization/HebrewCalendar.cs1084
-rw-r--r--src/mscorlib/src/System/Globalization/HebrewNumber.cs403
-rw-r--r--src/mscorlib/src/System/Globalization/HijriCalendar.Unix.cs (renamed from src/mscorlib/src/System/Runtime/CompilerServices/CallerFilePathAttribute.cs)12
-rw-r--r--src/mscorlib/src/System/Globalization/HijriCalendar.Win32.cs83
-rw-r--r--src/mscorlib/src/System/Globalization/HijriCalendar.WinRT.cs (renamed from src/mscorlib/src/System/Runtime/CompilerServices/CallerLineNumberAttribute.cs)11
-rw-r--r--src/mscorlib/src/System/Globalization/HijriCalendar.cs716
-rw-r--r--src/mscorlib/src/System/Globalization/IdnMapping.Unix.cs142
-rw-r--r--src/mscorlib/src/System/Globalization/IdnMapping.Windows.cs121
-rw-r--r--src/mscorlib/src/System/Globalization/IdnMapping.cs929
-rw-r--r--src/mscorlib/src/System/Globalization/JapaneseCalendar.Unix.cs96
-rw-r--r--src/mscorlib/src/System/Globalization/JapaneseCalendar.Win32.cs209
-rw-r--r--src/mscorlib/src/System/Globalization/JapaneseCalendar.WinRT.cs62
-rw-r--r--src/mscorlib/src/System/Globalization/JapaneseCalendar.cs581
-rw-r--r--src/mscorlib/src/System/Globalization/JapaneseLunisolarCalendar.cs293
-rw-r--r--src/mscorlib/src/System/Globalization/JulianCalendar.cs436
-rw-r--r--src/mscorlib/src/System/Globalization/KoreanCalendar.cs259
-rw-r--r--src/mscorlib/src/System/Globalization/KoreanLunisolarCalendar.cs1334
-rw-r--r--src/mscorlib/src/System/Globalization/NumberFormatInfo.cs542
-rw-r--r--src/mscorlib/src/System/Globalization/NumberStyles.cs66
-rw-r--r--src/mscorlib/src/System/Globalization/PersianCalendar.cs578
-rw-r--r--src/mscorlib/src/System/Globalization/RegionInfo.cs201
-rw-r--r--src/mscorlib/src/System/Globalization/SortKey.cs109
-rw-r--r--src/mscorlib/src/System/Globalization/SortVersion.cs102
-rw-r--r--src/mscorlib/src/System/Globalization/StringInfo.cs240
-rw-r--r--src/mscorlib/src/System/Globalization/Tables/charinfo.nlpbin36992 -> 0 bytes
-rw-r--r--src/mscorlib/src/System/Globalization/TaiwanCalendar.cs256
-rw-r--r--src/mscorlib/src/System/Globalization/TaiwanLunisolarCalendar.cs330
-rw-r--r--src/mscorlib/src/System/Globalization/TextElementEnumerator.cs136
-rw-r--r--src/mscorlib/src/System/Globalization/TextInfo.Unix.cs117
-rw-r--r--src/mscorlib/src/System/Globalization/TextInfo.Windows.cs113
-rw-r--r--src/mscorlib/src/System/Globalization/TextInfo.cs860
-rw-r--r--src/mscorlib/src/System/Globalization/ThaiBuddhistCalendar.cs219
-rw-r--r--src/mscorlib/src/System/Globalization/TimeSpanFormat.cs246
-rw-r--r--src/mscorlib/src/System/Globalization/TimeSpanParse.cs1074
-rw-r--r--src/mscorlib/src/System/Globalization/TimeSpanStyles.cs12
-rw-r--r--src/mscorlib/src/System/Globalization/UmAlQuraCalendar.cs850
-rw-r--r--src/mscorlib/src/System/Globalization/UnicodeCategory.cs78
-rw-r--r--src/mscorlib/src/System/Guid.cs873
-rw-r--r--src/mscorlib/src/System/HResults.cs236
-rw-r--r--src/mscorlib/src/System/IAppDomainPauseManager.cs22
-rw-r--r--src/mscorlib/src/System/IAsyncResult.cs30
-rw-r--r--src/mscorlib/src/System/ICloneable.cs28
-rw-r--r--src/mscorlib/src/System/IComparable.cs37
-rw-r--r--src/mscorlib/src/System/IConvertible.cs63
-rw-r--r--src/mscorlib/src/System/ICustomFormatter.cs24
-rw-r--r--src/mscorlib/src/System/IDisposable.cs60
-rw-r--r--src/mscorlib/src/System/IEquatable.cs14
-rw-r--r--src/mscorlib/src/System/IFormatProvider.cs23
-rw-r--r--src/mscorlib/src/System/IFormattable.cs15
-rw-r--r--src/mscorlib/src/System/IO/BinaryReader.cs347
-rw-r--r--src/mscorlib/src/System/IO/BinaryWriter.cs211
-rw-r--r--src/mscorlib/src/System/IO/Directory.cs28
-rw-r--r--src/mscorlib/src/System/IO/DirectoryNotFoundException.cs45
-rw-r--r--src/mscorlib/src/System/IO/DriveNotFoundException.cs29
-rw-r--r--src/mscorlib/src/System/IO/EndOfStreamException.cs42
-rw-r--r--src/mscorlib/src/System/IO/File.cs81
-rw-r--r--src/mscorlib/src/System/IO/FileAccess.cs41
-rw-r--r--src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs43
-rw-r--r--src/mscorlib/src/System/IO/FileLoadException.cs175
-rw-r--r--src/mscorlib/src/System/IO/FileMode.cs53
-rw-r--r--src/mscorlib/src/System/IO/FileNotFoundException.CoreCLR.cs20
-rw-r--r--src/mscorlib/src/System/IO/FileNotFoundException.cs157
-rw-r--r--src/mscorlib/src/System/IO/FileOptions.cs46
-rw-r--r--src/mscorlib/src/System/IO/FileShare.cs59
-rw-r--r--src/mscorlib/src/System/IO/IOException.cs46
-rw-r--r--src/mscorlib/src/System/IO/MemoryStream.cs393
-rw-r--r--src/mscorlib/src/System/IO/PathTooLongException.cs43
-rw-r--r--src/mscorlib/src/System/IO/PinnedBufferMemoryStream.cs17
-rw-r--r--src/mscorlib/src/System/IO/SearchOption.cs5
-rw-r--r--src/mscorlib/src/System/IO/SeekOrigin.cs31
-rw-r--r--src/mscorlib/src/System/IO/Stream.cs355
-rw-r--r--src/mscorlib/src/System/IO/StreamHelpers.CopyValidation.cs46
-rw-r--r--src/mscorlib/src/System/IO/StreamReader.cs249
-rw-r--r--src/mscorlib/src/System/IO/TextReader.cs32
-rw-r--r--src/mscorlib/src/System/IO/UnmanagedMemoryAccessor.cs1132
-rw-r--r--src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs481
-rw-r--r--src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs153
-rw-r--r--src/mscorlib/src/System/IO/__Error.cs196
-rw-r--r--src/mscorlib/src/System/IO/__HResults.cs7
-rw-r--r--src/mscorlib/src/System/IObserver.cs13
-rw-r--r--src/mscorlib/src/System/IProgress.cs15
-rw-r--r--src/mscorlib/src/System/IServiceObjectProvider.cs16
-rw-r--r--src/mscorlib/src/System/IndexOutOfRangeException.cs41
-rw-r--r--src/mscorlib/src/System/InsufficientExecutionStackException.cs32
-rw-r--r--src/mscorlib/src/System/InsufficientMemoryException.cs37
-rw-r--r--src/mscorlib/src/System/Int16.cs220
-rw-r--r--src/mscorlib/src/System/Int32.cs153
-rw-r--r--src/mscorlib/src/System/Int64.cs151
-rw-r--r--src/mscorlib/src/System/IntPtr.cs100
-rw-r--r--src/mscorlib/src/System/Internal.cs49
-rw-r--r--src/mscorlib/src/System/InvalidCastException.cs44
-rw-r--r--src/mscorlib/src/System/InvalidOperationException.cs42
-rw-r--r--src/mscorlib/src/System/InvalidProgramException.cs41
-rw-r--r--src/mscorlib/src/System/InvalidTimeZoneException.cs28
-rw-r--r--src/mscorlib/src/System/Lazy.cs506
-rw-r--r--src/mscorlib/src/System/MarshalByRefObject.cs30
-rw-r--r--src/mscorlib/src/System/Math.cs921
-rw-r--r--src/mscorlib/src/System/MathF.cs38
-rw-r--r--src/mscorlib/src/System/MemberAccessException.cs48
-rw-r--r--src/mscorlib/src/System/MethodAccessException.cs39
-rw-r--r--src/mscorlib/src/System/MissingFieldException.cs71
-rw-r--r--src/mscorlib/src/System/MissingMemberException.cs96
-rw-r--r--src/mscorlib/src/System/MissingMethodException.cs65
-rw-r--r--src/mscorlib/src/System/MulticastDelegate.cs176
-rw-r--r--src/mscorlib/src/System/MulticastNotSupportedException.cs37
-rw-r--r--src/mscorlib/src/System/NonSerializedAttribute.cs19
-rw-r--r--src/mscorlib/src/System/NotFiniteNumberException.cs71
-rw-r--r--src/mscorlib/src/System/NotImplementedException.cs40
-rw-r--r--src/mscorlib/src/System/NotSupportedException.cs41
-rw-r--r--src/mscorlib/src/System/NullReferenceException.cs41
-rw-r--r--src/mscorlib/src/System/Nullable.cs105
-rw-r--r--src/mscorlib/src/System/Number.cs782
-rw-r--r--src/mscorlib/src/System/Object.cs320
-rw-r--r--src/mscorlib/src/System/ObjectDisposedException.cs82
-rw-r--r--src/mscorlib/src/System/ObsoleteAttribute.cs61
-rw-r--r--src/mscorlib/src/System/OleAutBinder.cs28
-rw-r--r--src/mscorlib/src/System/OperatingSystem.cs91
-rw-r--r--src/mscorlib/src/System/OperationCanceledException.cs44
-rw-r--r--src/mscorlib/src/System/OutOfMemoryException.cs40
-rw-r--r--src/mscorlib/src/System/OverflowException.cs41
-rw-r--r--src/mscorlib/src/System/ParamArrayAttribute.cs21
-rw-r--r--src/mscorlib/src/System/ParamsArray.cs81
-rw-r--r--src/mscorlib/src/System/ParseNumbers.cs71
-rw-r--r--src/mscorlib/src/System/PlatformID.cs18
-rw-r--r--src/mscorlib/src/System/PlatformNotSupportedException.cs41
-rw-r--r--src/mscorlib/src/System/Progress.cs105
-rw-r--r--src/mscorlib/src/System/Random.cs249
-rw-r--r--src/mscorlib/src/System/RankException.cs42
-rw-r--r--src/mscorlib/src/System/ReadOnlySpan.cs31
-rw-r--r--src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs41
-rw-r--r--src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs211
-rw-r--r--src/mscorlib/src/System/Reflection/AssemblyAttributes.cs387
-rw-r--r--src/mscorlib/src/System/Reflection/AssemblyName.cs191
-rw-r--r--src/mscorlib/src/System/Reflection/AssemblyNameFlags.cs53
-rw-r--r--src/mscorlib/src/System/Reflection/Associates.cs35
-rw-r--r--src/mscorlib/src/System/Reflection/Binder.cs49
-rw-r--r--src/mscorlib/src/System/Reflection/BindingFlags.cs63
-rw-r--r--src/mscorlib/src/System/Reflection/CallingConventions.cs28
-rw-r--r--src/mscorlib/src/System/Reflection/ConstructorInfo.CoreCLR.cs (renamed from src/mscorlib/src/System/MidpointRounding.cs)7
-rw-r--r--src/mscorlib/src/System/Reflection/CustomAttribute.cs166
-rw-r--r--src/mscorlib/src/System/Reflection/CustomAttributeExtensions.cs1
-rw-r--r--src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs37
-rw-r--r--src/mscorlib/src/System/Reflection/DefaultMemberAttribute.cs39
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AQNBuilder.cs18
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs155
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs5
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs126
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs92
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs88
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs126
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs484
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs223
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EventBuilder.cs54
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/EventToken.cs37
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs77
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FieldToken.cs34
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/FlowControl.cs30
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs55
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs774
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ISymWrapperCore.cs188
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/Label.cs38
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/LocalBuilder.cs44
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs304
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs28
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/MethodToken.cs30
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs267
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs36
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/OpCodes.cs5063
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/Opcode.cs271
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/OpcodeType.cs24
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/OperandType.cs48
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PEFileKinds.cs10
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ParameterBuilder.cs93
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ParameterToken.cs36
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs130
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/PropertyToken.cs34
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs308
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SignatureToken.cs36
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/StackBehaviour.cs68
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/StringToken.cs46
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SymbolMethod.cs66
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/SymbolType.cs269
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs614
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs60
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/TypeToken.cs40
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs56
-rw-r--r--src/mscorlib/src/System/Reflection/EventAttributes.cs29
-rw-r--r--src/mscorlib/src/System/Reflection/EventInfo.cs401
-rw-r--r--src/mscorlib/src/System/Reflection/ExceptionHandlingClause.cs93
-rw-r--r--src/mscorlib/src/System/Reflection/FieldAttributes.cs42
-rw-r--r--src/mscorlib/src/System/Reflection/FieldInfo.CoreCLR.cs35
-rw-r--r--src/mscorlib/src/System/Reflection/FieldInfo.cs862
-rw-r--r--src/mscorlib/src/System/Reflection/GenericParameterAttributes.cs22
-rw-r--r--src/mscorlib/src/System/Reflection/ICustomAttributeProvider.cs33
-rw-r--r--src/mscorlib/src/System/Reflection/INVOCATION_FLAGS.cs38
-rw-r--r--src/mscorlib/src/System/Reflection/IReflect.cs116
-rw-r--r--src/mscorlib/src/System/Reflection/IReflectableType.cs20
-rw-r--r--src/mscorlib/src/System/Reflection/InterfaceMapping.cs22
-rw-r--r--src/mscorlib/src/System/Reflection/IntrospectionExtensions.cs28
-rw-r--r--src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs39
-rw-r--r--src/mscorlib/src/System/Reflection/LoaderAllocator.cs11
-rw-r--r--src/mscorlib/src/System/Reflection/LocalVariableInfo.cs40
-rw-r--r--src/mscorlib/src/System/Reflection/ManifestResourceInfo.cs65
-rw-r--r--src/mscorlib/src/System/Reflection/MdConstant.cs35
-rw-r--r--src/mscorlib/src/System/Reflection/MdFieldInfo.cs141
-rw-r--r--src/mscorlib/src/System/Reflection/MdImport.cs476
-rw-r--r--src/mscorlib/src/System/Reflection/MemberFilter.cs18
-rw-r--r--src/mscorlib/src/System/Reflection/MemberInfo.Internal.cs (renamed from src/mscorlib/src/System/IObservable.cs)6
-rw-r--r--src/mscorlib/src/System/Reflection/MemberInfo.cs113
-rw-r--r--src/mscorlib/src/System/Reflection/MemberInfoSerializationHolder.cs285
-rw-r--r--src/mscorlib/src/System/Reflection/MemberSerializationStringGenerator.cs39
-rw-r--r--src/mscorlib/src/System/Reflection/MemberTypes.cs33
-rw-r--r--src/mscorlib/src/System/Reflection/MethodAttributes.cs55
-rw-r--r--src/mscorlib/src/System/Reflection/MethodBase.CoreCLR.cs157
-rw-r--r--src/mscorlib/src/System/Reflection/MethodBase.cs330
-rw-r--r--src/mscorlib/src/System/Reflection/MethodBody.cs136
-rw-r--r--src/mscorlib/src/System/Reflection/MethodImplAttributes.cs43
-rw-r--r--src/mscorlib/src/System/Reflection/Missing.cs35
-rw-r--r--src/mscorlib/src/System/Reflection/Module.cs1120
-rw-r--r--src/mscorlib/src/System/Reflection/ObfuscateAssemblyAttribute.cs45
-rw-r--r--src/mscorlib/src/System/Reflection/ObfuscationAttribute.cs74
-rw-r--r--src/mscorlib/src/System/Reflection/ParameterAttributes.cs35
-rw-r--r--src/mscorlib/src/System/Reflection/ParameterModifier.cs45
-rw-r--r--src/mscorlib/src/System/Reflection/Pointer.cs75
-rw-r--r--src/mscorlib/src/System/Reflection/PropertyAttributes.cs32
-rw-r--r--src/mscorlib/src/System/Reflection/ReflectionContext.cs36
-rw-r--r--src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs72
-rw-r--r--src/mscorlib/src/System/Reflection/ResourceAttributes.cs23
-rw-r--r--src/mscorlib/src/System/Reflection/RtFieldInfo.cs390
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeAssembly.cs (renamed from src/mscorlib/src/System/Reflection/Assembly.cs)987
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs (renamed from src/mscorlib/src/System/Reflection/ConstructorInfo.cs)267
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs220
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs136
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs (renamed from src/mscorlib/src/System/Reflection/MethodInfo.cs)333
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeModule.cs602
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs (renamed from src/mscorlib/src/System/Reflection/ParameterInfo.cs)259
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs (renamed from src/mscorlib/src/System/Reflection/PropertyInfo.cs)252
-rw-r--r--src/mscorlib/src/System/Reflection/RuntimeReflectionExtensions.cs88
-rw-r--r--src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs95
-rw-r--r--src/mscorlib/src/System/Reflection/TargetException.cs37
-rw-r--r--src/mscorlib/src/System/Reflection/TargetInvocationException.cs46
-rw-r--r--src/mscorlib/src/System/Reflection/TargetParameterCountException.cs40
-rw-r--r--src/mscorlib/src/System/Reflection/TypeAttributes.cs64
-rw-r--r--src/mscorlib/src/System/Reflection/TypeDelegator.cs257
-rw-r--r--src/mscorlib/src/System/Reflection/TypeFilter.cs18
-rw-r--r--src/mscorlib/src/System/Reflection/TypeInfo.cs194
-rw-r--r--src/mscorlib/src/System/Reflection/__Filters.cs67
-rw-r--r--src/mscorlib/src/System/ResId.cs156
-rw-r--r--src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs16
-rw-r--r--src/mscorlib/src/System/Resources/IResourceGroveler.cs16
-rw-r--r--src/mscorlib/src/System/Resources/IResourceReader.cs30
-rw-r--r--src/mscorlib/src/System/Resources/LooselyLinkedResourceReference.cs6
-rw-r--r--src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs57
-rw-r--r--src/mscorlib/src/System/Resources/MissingManifestResourceException.cs41
-rw-r--r--src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs55
-rw-r--r--src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs64
-rw-r--r--src/mscorlib/src/System/Resources/ResourceFallbackManager.cs172
-rw-r--r--src/mscorlib/src/System/Resources/ResourceManager.cs396
-rw-r--r--src/mscorlib/src/System/Resources/ResourceReader.cs671
-rw-r--r--src/mscorlib/src/System/Resources/ResourceSet.cs62
-rw-r--r--src/mscorlib/src/System/Resources/ResourceTypeCode.cs57
-rw-r--r--src/mscorlib/src/System/Resources/RuntimeResourceSet.cs122
-rw-r--r--src/mscorlib/src/System/Resources/SatelliteContractVersionAttribute.cs38
-rw-r--r--src/mscorlib/src/System/Resources/UltimateResourceFallbackLocation.cs28
-rw-r--r--src/mscorlib/src/System/Resources/__FastResourceComparer.cs36
-rw-r--r--src/mscorlib/src/System/Resources/__HResults.cs3
-rw-r--r--src/mscorlib/src/System/RtType.cs980
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/AccessedThroughPropertyAttribute.cs30
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/AssemblySettingAttributes.cs94
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs112
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/AsyncStateMachineAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CallerMemberNameAttribute.cs17
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CompilationRelaxations.cs50
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CompilerGeneratedAttribute.cs16
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CompilerGlobalScopeAttribute.cs26
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CompilerMarshalOverride.cs23
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/CustomConstantAttribute.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DateTimeConstantAttribute.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DecimalConstantAttribute.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DisablePrivateReflectionAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/DiscardableAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ExtensionAttribute.cs13
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/FixedAddressValueTypeAttribute.cs14
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/FixedBufferAttribute.cs43
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/FormattableStringFactory.cs58
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/FriendAccessAllowedAttribute.cs (renamed from src/mscorlib/src/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs)36
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/IAsyncStateMachine.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ICastable.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/INotifyCompletion.cs39
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ITuple.cs22
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/IndexerNameAttribute.cs16
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/IsVolatile.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/IteratorStateMachineAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/MethodImplAttribute.cs61
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/ReferenceAssemblyAttribute.cs39
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/RuntimeCompatibilityAttribute.cs48
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs32
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/SpecialNameAttribute.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/StateMachineAttribute.cs20
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/SuppressIldasmAttribute.cs19
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/SuppressMergeCheckAttribute.cs23
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TaskAwaiter.cs26
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs57
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TypeDependencyAttribute.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedFromAttribute.cs35
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/TypeForwardedToAttribute.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/Unsafe.cs61
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/UnsafeValueTypeAttribute.cs14
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/YieldAwaitable.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs28
-rw-r--r--src/mscorlib/src/System/Runtime/ExceptionServices/CorruptingExceptionCommon.cs7
-rw-r--r--src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs13
-rw-r--r--src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs36
-rw-r--r--src/mscorlib/src/System/Runtime/GcSettings.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ArrayWithOffset.cs36
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Attributes.cs188
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/BStrWrapper.cs13
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/COMException.cs60
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/CallingConvention.cs21
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/CharSet.cs23
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs220
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsInfo.cs50
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs100
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComEventsSink.cs104
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComMemberType.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IBindCtx.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IConnectionPoint.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IConnectionPointContainer.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IEnumConnectionPoints.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IEnumConnections.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IEnumMoniker.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IEnumString.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IEnumVARIANT.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IMoniker.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IPersistFile.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IRunningObjectTable.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/IStream.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeComp.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs230
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeInfo2.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ComTypes/ITypeLib2.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs224
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs15
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/DispatchWrapper.cs13
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs15
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Expando/IExpando.cs9
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs77
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/GCHandleCookieTable.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs18
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/HandleRef.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ICustomAdapter.cs9
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ICustomFactory.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ICustomMarshaler.cs15
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ICustomQueryInterface.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/ITypeLibConverter.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs38
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/LayoutKind.cs17
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs458
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs38
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/NativeCallableAttribute.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs64
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/PInvokeMap.cs60
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs45
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs40
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeBuffer.cs67
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs515
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/UnknownWrapper.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/VariantWrapper.cs11
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/Attributes.cs5
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs12
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIKeyValuePairImpl.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs210
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIReferenceImpl.cs55
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs48
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs20
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs24
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EnumeratorToIteratorAdapter.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IClosable.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomProperty.cs30
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs126
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IIterable.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMap.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IPropertyValue.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs7
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVector.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IteratorToEnumeratorAdapter.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorViewAdapter.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs6
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs4
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/PropertyValue.cs24
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/RuntimeClass.cs48
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs8
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeBufferHelper.cs41
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs249
-rw-r--r--src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs65
-rw-r--r--src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs161
-rw-r--r--src/mscorlib/src/System/Runtime/MemoryFailPoint.cs180
-rw-r--r--src/mscorlib/src/System/Runtime/Reliability/PrePrepareMethodAttribute.cs7
-rw-r--r--src/mscorlib/src/System/Runtime/Reliability/ReliabilityContractAttribute.cs67
-rw-r--r--src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs10
-rw-r--r--src/mscorlib/src/System/Runtime/RuntimeImports.cs35
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs121
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs75
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs22
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs39
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs27
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs30
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs240
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs59
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs44
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs41
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs145
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs72
-rw-r--r--src/mscorlib/src/System/Runtime/Versioning/NonVersionableAttribute.cs33
-rw-r--r--src/mscorlib/src/System/Runtime/Versioning/TargetFrameworkAttribute.cs45
-rw-r--r--src/mscorlib/src/System/RuntimeArgumentHandle.cs9
-rw-r--r--src/mscorlib/src/System/RuntimeHandles.cs380
-rw-r--r--src/mscorlib/src/System/SByte.cs218
-rw-r--r--src/mscorlib/src/System/Security/Attributes.cs199
-rw-r--r--src/mscorlib/src/System/Security/DynamicSecurityMethodAttribute.cs21
-rw-r--r--src/mscorlib/src/System/Security/SecurityException.cs110
-rw-r--r--src/mscorlib/src/System/Security/SecurityState.cs25
-rw-r--r--src/mscorlib/src/System/Security/Util/URLString.cs138
-rw-r--r--src/mscorlib/src/System/Security/VerificationException.cs32
-rw-r--r--src/mscorlib/src/System/SerializableAttribute.cs24
-rw-r--r--src/mscorlib/src/System/SharedStatics.cs34
-rw-r--r--src/mscorlib/src/System/Single.cs220
-rw-r--r--src/mscorlib/src/System/Span.cs587
-rw-r--r--src/mscorlib/src/System/StackOverflowException.cs41
-rw-r--r--src/mscorlib/src/System/String.Comparison.cs383
-rw-r--r--src/mscorlib/src/System/String.Manipulation.cs634
-rw-r--r--src/mscorlib/src/System/String.Searching.cs180
-rw-r--r--src/mscorlib/src/System/String.cs408
-rw-r--r--src/mscorlib/src/System/StringComparer.cs300
-rw-r--r--src/mscorlib/src/System/StringComparison.cs29
-rw-r--r--src/mscorlib/src/System/StringFreezingAttribute.cs25
-rw-r--r--src/mscorlib/src/System/StringSplitOptions.cs13
-rw-r--r--src/mscorlib/src/System/StubHelpers.cs289
-rw-r--r--src/mscorlib/src/System/SystemException.cs32
-rw-r--r--src/mscorlib/src/System/Text/ASCIIEncoding.cs757
-rw-r--r--src/mscorlib/src/System/Text/Decoder.cs338
-rw-r--r--src/mscorlib/src/System/Text/DecoderBestFitFallback.cs33
-rw-r--r--src/mscorlib/src/System/Text/DecoderExceptionFallback.cs28
-rw-r--r--src/mscorlib/src/System/Text/DecoderFallback.cs41
-rw-r--r--src/mscorlib/src/System/Text/DecoderNLS.cs87
-rw-r--r--src/mscorlib/src/System/Text/DecoderReplacementFallback.cs30
-rw-r--r--src/mscorlib/src/System/Text/Encoder.cs332
-rw-r--r--src/mscorlib/src/System/Text/EncoderBestFitFallback.cs39
-rw-r--r--src/mscorlib/src/System/Text/EncoderExceptionFallback.cs46
-rw-r--r--src/mscorlib/src/System/Text/EncoderFallback.cs30
-rw-r--r--src/mscorlib/src/System/Text/EncoderNLS.cs86
-rw-r--r--src/mscorlib/src/System/Text/EncoderReplacementFallback.cs44
-rw-r--r--src/mscorlib/src/System/Text/Encoding.cs428
-rw-r--r--src/mscorlib/src/System/Text/EncodingForwarder.cs329
-rw-r--r--src/mscorlib/src/System/Text/EncodingInfo.cs74
-rw-r--r--src/mscorlib/src/System/Text/EncodingNLS.cs125
-rw-r--r--src/mscorlib/src/System/Text/EncodingProvider.cs136
-rw-r--r--src/mscorlib/src/System/Text/Latin1Encoding.cs62
-rw-r--r--src/mscorlib/src/System/Text/Normalization.Unix.cs25
-rw-r--r--src/mscorlib/src/System/Text/Normalization.Windows.cs272
-rw-r--r--src/mscorlib/src/System/Text/Normalization.cs29
-rw-r--r--src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs48
-rw-r--r--src/mscorlib/src/System/Text/StringBuilder.cs2286
-rw-r--r--src/mscorlib/src/System/Text/StringBuilderCache.cs5
-rw-r--r--src/mscorlib/src/System/Text/UTF32Encoding.cs1003
-rw-r--r--src/mscorlib/src/System/Text/UTF7Encoding.cs372
-rw-r--r--src/mscorlib/src/System/Text/UTF8Encoding.cs2286
-rw-r--r--src/mscorlib/src/System/Text/UnicodeEncoding.cs1826
-rw-r--r--src/mscorlib/src/System/ThreadAttributes.cs28
-rw-r--r--src/mscorlib/src/System/ThreadStaticAttribute.cs28
-rw-r--r--src/mscorlib/src/System/Threading/AbandonedMutexException.cs85
-rw-r--r--src/mscorlib/src/System/Threading/ApartmentState.cs27
-rw-r--r--src/mscorlib/src/System/Threading/AsyncLocal.cs487
-rw-r--r--src/mscorlib/src/System/Threading/AutoResetEvent.cs24
-rw-r--r--src/mscorlib/src/System/Threading/CancellationToken.cs32
-rw-r--r--src/mscorlib/src/System/Threading/CancellationTokenRegistration.cs6
-rw-r--r--src/mscorlib/src/System/Threading/CancellationTokenSource.cs48
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs319
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs52
-rw-r--r--src/mscorlib/src/System/Threading/ClrThreadPoolPreAllocatedOverlapped.cs105
-rw-r--r--src/mscorlib/src/System/Threading/CountdownEvent.cs589
-rw-r--r--src/mscorlib/src/System/Threading/EventResetMode.cs26
-rw-r--r--src/mscorlib/src/System/Threading/EventWaitHandle.cs59
-rw-r--r--src/mscorlib/src/System/Threading/ExecutionContext.cs380
-rw-r--r--src/mscorlib/src/System/Threading/Interlocked.cs45
-rw-r--r--src/mscorlib/src/System/Threading/LazyInitializer.cs131
-rw-r--r--src/mscorlib/src/System/Threading/LockRecursionException.cs30
-rw-r--r--src/mscorlib/src/System/Threading/ManualResetEvent.cs24
-rw-r--r--src/mscorlib/src/System/Threading/ManualResetEventSlim.cs16
-rw-r--r--src/mscorlib/src/System/Threading/Monitor.cs35
-rw-r--r--src/mscorlib/src/System/Threading/Mutex.cs92
-rw-r--r--src/mscorlib/src/System/Threading/Overlapped.cs100
-rw-r--r--src/mscorlib/src/System/Threading/ParameterizedThreadStart.cs23
-rw-r--r--src/mscorlib/src/System/Threading/ReaderWriterLockSlim.cs1311
-rw-r--r--src/mscorlib/src/System/Threading/Semaphore.cs32
-rw-r--r--src/mscorlib/src/System/Threading/SemaphoreFullException.cs27
-rw-r--r--src/mscorlib/src/System/Threading/SemaphoreSlim.cs37
-rw-r--r--src/mscorlib/src/System/Threading/SendOrPostCallback.cs16
-rw-r--r--src/mscorlib/src/System/Threading/SpinWait.cs59
-rw-r--r--src/mscorlib/src/System/Threading/SynchronizationContext.cs46
-rw-r--r--src/mscorlib/src/System/Threading/SynchronizationLockException.cs43
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/AsyncCausalityTracer.cs34
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/ConcurrentExclusiveSchedulerPair.cs30
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/FutureFactory.cs39
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/IAsyncCausalityTracerStatics.cs10
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/ProducerConsumerQueues.cs14
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs196
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/Task.cs511
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskCanceledException.cs93
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskCompletionSource.cs8
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs33
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs38
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs73
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs75
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskSchedulerException.cs81
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/TaskToApm.cs6
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs24
-rw-r--r--src/mscorlib/src/System/Threading/Tasks/future.cs43
-rw-r--r--src/mscorlib/src/System/Threading/Thread.cs251
-rw-r--r--src/mscorlib/src/System/Threading/ThreadAbortException.cs39
-rw-r--r--src/mscorlib/src/System/Threading/ThreadInterruptedException.cs41
-rw-r--r--src/mscorlib/src/System/Threading/ThreadLocal.cs23
-rw-r--r--src/mscorlib/src/System/Threading/ThreadPool.cs259
-rw-r--r--src/mscorlib/src/System/Threading/ThreadPriority.cs31
-rw-r--r--src/mscorlib/src/System/Threading/ThreadStart.cs23
-rw-r--r--src/mscorlib/src/System/Threading/ThreadStartException.cs37
-rw-r--r--src/mscorlib/src/System/Threading/ThreadState.cs35
-rw-r--r--src/mscorlib/src/System/Threading/ThreadStateException.cs40
-rw-r--r--src/mscorlib/src/System/Threading/Timeout.cs19
-rw-r--r--src/mscorlib/src/System/Threading/Timer.cs159
-rw-r--r--src/mscorlib/src/System/Threading/Volatile.cs53
-rw-r--r--src/mscorlib/src/System/Threading/WaitHandle.cs203
-rw-r--r--src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs36
-rw-r--r--src/mscorlib/src/System/ThrowHelper.cs311
-rw-r--r--src/mscorlib/src/System/TimeSpan.cs302
-rw-r--r--src/mscorlib/src/System/TimeZone.cs246
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.AdjustmentRule.cs20
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs62
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.TransitionTime.cs16
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.Unix.cs68
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.Win32.cs38
-rw-r--r--src/mscorlib/src/System/TimeZoneInfo.cs74
-rw-r--r--src/mscorlib/src/System/TimeZoneNotFoundException.cs28
-rw-r--r--src/mscorlib/src/System/TimeoutException.cs41
-rw-r--r--src/mscorlib/src/System/Tuple.cs28
-rw-r--r--src/mscorlib/src/System/TupleExtensions.cs930
-rw-r--r--src/mscorlib/src/System/Type.CoreCLR.cs206
-rw-r--r--src/mscorlib/src/System/Type.cs1764
-rw-r--r--src/mscorlib/src/System/TypeAccessException.cs34
-rw-r--r--src/mscorlib/src/System/TypeCode.cs48
-rw-r--r--src/mscorlib/src/System/TypeInitializationException.cs79
-rw-r--r--src/mscorlib/src/System/TypeLoadException.cs106
-rw-r--r--src/mscorlib/src/System/TypeNameParser.cs19
-rw-r--r--src/mscorlib/src/System/TypeUnloadedException.cs42
-rw-r--r--src/mscorlib/src/System/TypedReference.cs49
-rw-r--r--src/mscorlib/src/System/UInt16.cs180
-rw-r--r--src/mscorlib/src/System/UInt32.cs148
-rw-r--r--src/mscorlib/src/System/UInt64.cs156
-rw-r--r--src/mscorlib/src/System/UIntPtr.cs80
-rw-r--r--src/mscorlib/src/System/UnauthorizedAccessException.cs45
-rw-r--r--src/mscorlib/src/System/UnhandledExceptionEventArgs.cs29
-rw-r--r--src/mscorlib/src/System/UnhandledExceptionEventHandler.cs9
-rw-r--r--src/mscorlib/src/System/UnitySerializationHolder.cs357
-rw-r--r--src/mscorlib/src/System/ValueTuple.cs2324
-rw-r--r--src/mscorlib/src/System/ValueType.cs38
-rw-r--r--src/mscorlib/src/System/Variant.cs395
-rw-r--r--src/mscorlib/src/System/Version.cs448
-rw-r--r--src/mscorlib/src/System/Void.cs17
-rw-r--r--src/mscorlib/src/System/WeakReference.cs63
-rw-r--r--src/mscorlib/src/System/WeakReferenceOfT.cs25
-rw-r--r--src/mscorlib/src/System/XmlIgnoreMemberAttribute.cs21
-rw-r--r--src/mscorlib/src/System/__ComObject.cs36
-rw-r--r--src/mscorlib/src/System/__Filters.cs155
-rw-r--r--src/mscorlib/src/System/__HResults.cs153
-rw-r--r--src/mscorlib/src/mscorlib.Friends.cs8
839 files changed, 44653 insertions, 111397 deletions
diff --git a/src/mscorlib/src/System/LowLevelConsole.cs b/src/mscorlib/src/Internal/Console.cs
index 29e69185ac..a2a323fa13 100644
--- a/src/mscorlib/src/System/LowLevelConsole.cs
+++ b/src/mscorlib/src/Internal/Console.cs
@@ -2,19 +2,20 @@
// 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.Text;
using System.Security;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
-namespace System
+namespace Internal
{
//
// Simple limited console class for internal printf-style debugging in System.Private.CoreLib
// and low-level tests that want to call System.Private.CoreLib directly
//
- public static class LowLevelConsole
+ public static class Console
{
private static readonly SafeFileHandle _outputHandle =
new SafeFileHandle(Win32Native.GetStdHandle(Win32Native.STD_OUTPUT_HANDLE), false);
@@ -23,7 +24,7 @@ namespace System
{
byte[] bytes = Encoding.UTF8.GetBytes(s);
- fixed (byte * pBytes = bytes)
+ fixed (byte* pBytes = bytes)
{
int bytesWritten;
Win32Native.WriteFile(_outputHandle, pBytes, bytes.Length, out bytesWritten, IntPtr.Zero);
@@ -39,27 +40,5 @@ namespace System
{
Write(Environment.NewLine);
}
- }
-
- //
- // Internal wrapper with the regular name for convenience. Note that it cannot be public to avoid colliding
- // with the full Console type.
- //
- internal static class Console
- {
- public static void Write(string s)
- {
- LowLevelConsole.Write(s);
- }
-
- public static void WriteLine(string s)
- {
- LowLevelConsole.WriteLine(s);
- }
-
- public static void WriteLine()
- {
- LowLevelConsole.WriteLine();
- }
}
}
diff --git a/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
index b22310eacb..b5a56b8633 100644
--- a/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
+++ b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
@@ -4,6 +4,8 @@
using System;
using System.Collections;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
namespace Internal.Runtime.Augments
{
@@ -16,7 +18,6 @@ namespace Internal.Runtime.Augments
public static void FailFast(string message, Exception error) => Environment.FailFast(message, error);
public static string[] GetCommandLineArgs() => Environment.GetCommandLineArgs();
public static bool HasShutdownStarted => Environment.HasShutdownStarted;
- public static string StackTrace => Environment.StackTrace;
public static int TickCount => Environment.TickCount;
public static string GetEnvironmentVariable(string variable) => Environment.GetEnvironmentVariable(variable);
public static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target) => Environment.GetEnvironmentVariable(variable, target);
@@ -24,5 +25,14 @@ namespace Internal.Runtime.Augments
public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target) => Environment.GetEnvironmentVariables(target);
public static void SetEnvironmentVariable(string variable, string value) => Environment.SetEnvironmentVariable(variable, value);
public static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target) => Environment.SetEnvironmentVariable(variable, value, target);
+
+ public static string StackTrace
+ {
+ [MethodImpl(MethodImplOptions.NoInlining)] // Prevent inlining from affecting where the stacktrace starts
+ get
+ {
+ return new StackTrace(1 /* skip this one frame */, true).ToString(System.Diagnostics.StackTrace.TraceFormat.Normal);
+ }
+ }
}
}
diff --git a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
index 58eff98dec..605f974da0 100644
--- a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
+++ b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
@@ -15,7 +15,7 @@ namespace Internal.Runtime.Augments
{
public class RuntimeThread : CriticalFinalizerObject
{
- internal RuntimeThread() {}
+ internal RuntimeThread() { }
public static RuntimeThread Create(ThreadStart start) => new Thread(start);
public static RuntimeThread Create(ThreadStart start, int maxStackSize) => new Thread(start, maxStackSize);
diff --git a/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs b/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
new file mode 100644
index 0000000000..fe14560a3a
--- /dev/null
+++ b/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
@@ -0,0 +1,72 @@
+// 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.Globalization;
+using System.Runtime.InteropServices;
+using System.Security;
+
+internal static partial class Interop
+{
+ internal static partial class GlobalizationInterop
+ {
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortHandle")]
+ internal unsafe static extern ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CloseSortHandle")]
+ internal unsafe static extern void CloseSortHandle(IntPtr handle);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")]
+ internal unsafe static extern int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")]
+ internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")]
+ internal unsafe static extern int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")]
+ internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")]
+ internal unsafe static extern int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options);
+
+ [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareStringOrdinalIgnoreCase")]
+ internal unsafe static extern int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len);
+
+ [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetSortVersion")]
+ internal static extern int GetSortVersion();
+
+ internal class SafeSortHandle : SafeHandle
+ {
+ private SafeSortHandle() :
+ base(IntPtr.Zero, true)
+ {
+ }
+
+ public override bool IsInvalid
+ {
+ get { return handle == IntPtr.Zero; }
+ }
+
+ protected override bool ReleaseHandle()
+ {
+ Debug.Assert(!GlobalizationMode.Invariant);
+
+ CloseSortHandle(handle);
+ SetHandle(IntPtr.Zero);
+ return true;
+ }
+ }
+ }
+}
diff --git a/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs b/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs
new file mode 100644
index 0000000000..c690884145
--- /dev/null
+++ b/src/mscorlib/src/Interop/Unix/System.Globalization.Native/Interop.ICU.cs
@@ -0,0 +1,16 @@
+// 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;
+using System.Runtime.CompilerServices;
+
+internal static partial class Interop
+{
+ internal static partial class GlobalizationInterop
+ {
+ [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_LoadICU")]
+ internal static extern int LoadICU();
+ }
+}
diff --git a/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs
new file mode 100644
index 0000000000..cad457d915
--- /dev/null
+++ b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Idna.cs
@@ -0,0 +1,38 @@
+// 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;
+
+internal partial class Interop
+{
+ internal partial class Normaliz
+ {
+ //
+ // Idn APIs
+ //
+
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern int IdnToAscii(
+ uint dwFlags,
+ IntPtr lpUnicodeCharStr,
+ int cchUnicodeChar,
+ [System.Runtime.InteropServices.OutAttribute()]
+ IntPtr lpASCIICharStr,
+ int cchASCIIChar);
+
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern int IdnToUnicode(
+ uint dwFlags,
+ IntPtr lpASCIICharStr,
+ int cchASCIIChar,
+ [System.Runtime.InteropServices.OutAttribute()]
+ IntPtr lpUnicodeCharStr,
+ int cchUnicodeChar);
+
+ internal const int IDN_ALLOW_UNASSIGNED = 0x1;
+ internal const int IDN_USE_STD3_ASCII_RULES = 0x2;
+ internal const int ERROR_INVALID_NAME = 123;
+ }
+}
diff --git a/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Normalization.cs b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Normalization.cs
new file mode 100644
index 0000000000..3e49f1f64c
--- /dev/null
+++ b/src/mscorlib/src/Interop/Windows/Normaliz/Interop.Normalization.cs
@@ -0,0 +1,24 @@
+// 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;
+
+internal partial class Interop
+{
+ internal partial class Normaliz
+ {
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern bool IsNormalizedString(int normForm, string source, int length);
+
+ [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern int NormalizeString(
+ int normForm,
+ string source,
+ int sourceLength,
+ [System.Runtime.InteropServices.OutAttribute()]
+ char[] destination,
+ int destinationLength);
+ }
+}
diff --git a/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs b/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs
new file mode 100644
index 0000000000..2bb349d670
--- /dev/null
+++ b/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs
@@ -0,0 +1,131 @@
+// 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;
+
+internal static partial class Interop
+{
+ internal static unsafe partial class Kernel32
+ {
+ internal const int LOCALE_NAME_MAX_LENGTH = 85;
+ internal const uint LOCALE_ALLOW_NEUTRAL_NAMES = 0x08000000; // Flag to allow returning neutral names/lcids for name conversion
+ internal const uint LOCALE_SUPPLEMENTAL = 0x00000002;
+ internal const uint LOCALE_REPLACEMENT = 0x00000008;
+ internal const uint LOCALE_NEUTRALDATA = 0x00000010;
+ internal const uint LOCALE_SPECIFICDATA = 0x00000020;
+ internal const int COMPARE_STRING = 0x0001;
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static unsafe int LCIDToLocaleName(int locale, char *pLocaleName, int cchName, uint dwFlags);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static int LocaleNameToLCID(string lpName, uint dwFlags);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static unsafe int LCMapStringEx(
+ string lpLocaleName,
+ uint dwMapFlags,
+ char* lpSrcStr,
+ int cchSrc,
+ void* lpDestStr,
+ int cchDest,
+ void* lpVersionInformation,
+ void* lpReserved,
+ IntPtr sortHandle);
+
+ [DllImport("kernel32.dll", EntryPoint = "FindNLSStringEx")]
+ internal extern static unsafe int FindNLSStringEx(
+ char* lpLocaleName,
+ uint dwFindNLSStringFlags,
+ char* lpStringSource,
+ int cchSource,
+ char* lpStringValue,
+ int cchValue,
+ int* pcchFound,
+ void* lpVersionInformation,
+ void* lpReserved,
+ IntPtr sortHandle);
+
+ [DllImport("kernel32.dll", EntryPoint = "CompareStringEx")]
+ internal extern static unsafe int CompareStringEx(
+ char* lpLocaleName,
+ uint dwCmpFlags,
+ char* lpString1,
+ int cchCount1,
+ char* lpString2,
+ int cchCount2,
+ void* lpVersionInformation,
+ void* lpReserved,
+ IntPtr lParam);
+
+ [DllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")]
+ internal extern static unsafe int CompareStringOrdinal(
+ char* lpString1,
+ int cchCount1,
+ char* lpString2,
+ int cchCount2,
+ bool bIgnoreCase);
+
+ [DllImport("kernel32.dll", EntryPoint = "FindStringOrdinal")]
+ internal extern static unsafe int FindStringOrdinal(
+ uint dwFindStringOrdinalFlags,
+ char* lpStringSource,
+ int cchSource,
+ char* lpStringValue,
+ int cchValue,
+ int bIgnoreCase);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static unsafe bool IsNLSDefinedString(
+ int Function,
+ uint dwFlags,
+ IntPtr lpVersionInformation,
+ char* lpString,
+ int cchStr);
+
+ [DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
+ internal static extern bool GetUserPreferredUILanguages(uint dwFlags, out uint pulNumLanguages, char [] pwszLanguagesBuffer, ref uint pcchLanguagesBuffer);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, IntPtr lpLCData, int cchData);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, IntPtr lParam, IntPtr reserved);
+
+ internal delegate BOOL EnumLocalesProcEx(IntPtr lpLocaleString, uint dwFlags, IntPtr lParam);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, IntPtr lParam);
+
+ internal delegate BOOL EnumTimeFormatsProcEx(IntPtr lpTimeFormatString, IntPtr lParam);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, IntPtr lParam);
+
+ internal delegate BOOL EnumCalendarInfoProcExEx(IntPtr lpCalendarInfoString, uint Calendar, IntPtr lpReserved, IntPtr lParam);
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct NlsVersionInfoEx
+ {
+ internal int dwNLSVersionInfoSize;
+ internal int dwNLSVersion;
+ internal int dwDefinedVersion;
+ internal int dwEffectiveId;
+ internal Guid guidCustomVersion;
+ }
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
+ internal extern static unsafe bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation);
+ }
+}
diff --git a/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs b/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs
index 6c2c6e9630..93138e6e16 100644
--- a/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs
+++ b/src/mscorlib/src/Microsoft/Win32/OAVariantLib.cs
@@ -12,8 +12,9 @@
**
**
===========================================================*/
-namespace Microsoft.Win32 {
-
+
+namespace Microsoft.Win32
+{
using System;
using System.Diagnostics.Contracts;
using System.Reflection;
@@ -31,8 +32,8 @@ namespace Microsoft.Win32 {
public const int NoUserOverride = 0x04;
public const int CalendarHijri = 0x08;
public const int LocalBool = 0x10;
-
- internal static readonly Type [] ClassTypes = {
+
+ internal static readonly Type[] ClassTypes = {
typeof(Empty),
typeof(void),
typeof(Boolean),
@@ -58,12 +59,12 @@ namespace Microsoft.Win32 {
typeof(DBNull),
};
- // Keep these numbers in sync w/ the above array.
- private const int CV_OBJECT=0x12;
-
+ // Keep these numbers in sync w/ the above array.
+ private const int CV_OBJECT = 0x12;
+
#endregion
-
+
#region Internal Methods
/**
@@ -79,43 +80,45 @@ namespace Microsoft.Win32 {
throw new ArgumentNullException(nameof(targetClass));
if (culture == null)
throw new ArgumentNullException(nameof(culture));
- Variant result = new Variant ();
- ChangeTypeEx(ref result, ref source,
+ Variant result = new Variant();
+ ChangeTypeEx(ref result, ref source,
#if FEATURE_USE_LCID
- culture.LCID,
+ culture.LCID,
#else
// @CORESYSTODO: what does CoreSystem expect for this argument?
0,
#endif
targetClass.TypeHandle.Value, GetCVTypeFromClass(targetClass), options);
return result;
- }
+ }
#endregion
#region Private Helpers
- private static int GetCVTypeFromClass(Type ctype)
+ private static int GetCVTypeFromClass(Type ctype)
{
Contract.Requires(ctype != null);
#if _DEBUG
BCLDebug.Assert(ClassTypes[CV_OBJECT] == typeof(Object), "OAVariantLib::ClassTypes[CV_OBJECT] == Object.class");
#endif
-
- int cvtype=-1;
- for (int i=0; i<ClassTypes.Length; i++) {
- if (ctype.Equals(ClassTypes[i])) {
- cvtype=i;
+
+ int cvtype = -1;
+ for (int i = 0; i < ClassTypes.Length; i++)
+ {
+ if (ctype.Equals(ClassTypes[i]))
+ {
+ cvtype = i;
break;
}
}
-
+
// OleAut Binder works better if unrecognized
// types were changed to Object. So don't throw here.
if (cvtype == -1)
cvtype = CV_OBJECT;
-
+
return cvtype;
}
diff --git a/src/mscorlib/src/Microsoft/Win32/Registry.cs b/src/mscorlib/src/Microsoft/Win32/Registry.cs
index bf4f73949a..aa2dd9b396 100644
--- a/src/mscorlib/src/Microsoft/Win32/Registry.cs
+++ b/src/mscorlib/src/Microsoft/Win32/Registry.cs
@@ -2,133 +2,12 @@
// 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 {
- using System;
- using System.Runtime.InteropServices;
- using System.Runtime.Versioning;
-
- /**
- * Registry encapsulation. Contains members representing all top level system
- * keys.
- *
- * @security(checkClassLinking=on)
- */
- //This class contains only static members and does not need to be serializable.
- internal static class Registry {
- static Registry()
- {
- }
-
- /**
- * Current User Key.
- *
- * This key should be used as the root for all user specific settings.
- */
- public static readonly RegistryKey CurrentUser = RegistryKey.GetBaseKey(RegistryKey.HKEY_CURRENT_USER);
-
- /**
- * Local Machine Key.
- *
- * This key should be used as the root for all machine specific settings.
- */
- public static readonly RegistryKey LocalMachine = RegistryKey.GetBaseKey(RegistryKey.HKEY_LOCAL_MACHINE);
-
- /**
- * Classes Root Key.
- *
- * This is the root key of class information.
- */
- public static readonly RegistryKey ClassesRoot = RegistryKey.GetBaseKey(RegistryKey.HKEY_CLASSES_ROOT);
-
- /**
- * Users Root Key.
- *
- * This is the root of users.
- */
- public static readonly RegistryKey Users = RegistryKey.GetBaseKey(RegistryKey.HKEY_USERS);
-
- /**
- * Performance Root Key.
- *
- * This is where dynamic performance data is stored on NT.
- */
- public static readonly RegistryKey PerformanceData = RegistryKey.GetBaseKey(RegistryKey.HKEY_PERFORMANCE_DATA);
-
- /**
- * Current Config Root Key.
- *
- * This is where current configuration information is stored.
- */
- public static readonly RegistryKey CurrentConfig = RegistryKey.GetBaseKey(RegistryKey.HKEY_CURRENT_CONFIG);
-
- //
- // Following function will parse a keyName and returns the basekey for it.
- // It will also store the subkey name in the out parameter.
- // If the keyName is not valid, we will throw ArgumentException.
- // The return value shouldn't be null.
- //
- private static RegistryKey GetBaseKeyFromKeyName(string keyName, out string subKeyName) {
- if( keyName == null) {
- throw new ArgumentNullException(nameof(keyName));
- }
-
- string basekeyName;
- int i = keyName.IndexOf('\\');
- if( i != -1) {
- basekeyName = keyName.Substring(0, i).ToUpper(System.Globalization.CultureInfo.InvariantCulture);
- }
- else {
- basekeyName = keyName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
- }
- RegistryKey basekey = null;
-
- switch(basekeyName) {
- case "HKEY_CURRENT_USER":
- basekey = Registry.CurrentUser;
- break;
- case "HKEY_LOCAL_MACHINE":
- basekey = Registry.LocalMachine;
- break;
- case "HKEY_CLASSES_ROOT":
- basekey = Registry.ClassesRoot;
- break;
- case "HKEY_USERS":
- basekey = Registry.Users;
- break;
- case "HKEY_PERFORMANCE_DATA":
- basekey = Registry.PerformanceData;
- break;
- case "HKEY_CURRENT_CONFIG":
- basekey = Registry.CurrentConfig;
- break;
- default:
- throw new ArgumentException(Environment.GetResourceString("Arg_RegInvalidKeyName", nameof(keyName)));
- }
- if( i == -1 || i == keyName.Length) {
- subKeyName = string.Empty;
- }
- else {
- subKeyName = keyName.Substring(i + 1, keyName.Length - i - 1);
- }
- return basekey;
- }
-
- public static object GetValue(string keyName, string valueName, object defaultValue ) {
- string subKeyName;
- RegistryKey basekey = GetBaseKeyFromKeyName(keyName, out subKeyName);
- BCLDebug.Assert(basekey != null, "basekey can't be null.");
- RegistryKey key = basekey.OpenSubKey(subKeyName);
- if(key == null) { // if the key doesn't exist, do nothing
- return null;
- }
- try {
- return key.GetValue(valueName, defaultValue);
- }
- finally {
- key.Close();
- }
- }
+namespace Microsoft.Win32
+{
+ internal static class Registry
+ {
+ public static readonly RegistryKey CurrentUser = RegistryKey.CurrentUser;
+ public static readonly RegistryKey LocalMachine = RegistryKey.LocalMachine;
}
}
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
index f82b276059..e39b95903e 100644
--- a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
+++ b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
@@ -2,28 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
-/*
- Note on transaction support:
- Eventually we will want to add support for NT's transactions to our
- RegistryKey API's (possibly Whidbey M3?). When we do this, here's
- the list of API's we need to make transaction-aware:
-
- RegCreateKeyEx
- RegDeleteKey
- RegDeleteValue
- RegEnumKeyEx
- RegEnumValue
- RegOpenKeyEx
- RegQueryInfoKey
- RegQueryValueEx
- RegSetValueEx
-
- We can ignore RegConnectRegistry (remote registry access doesn't yet have
- transaction support) and RegFlushKey. RegCloseKey doesn't require any
- additional work. .
- */
-
/*
Note on ACL support:
The key thing to note about ACL's is you set them on a kernel object like a
@@ -48,70 +26,41 @@
*/
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.Buffers;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
namespace Microsoft.Win32
{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Security;
- using System.Text;
- using System.Threading;
- using System.IO;
- using System.Runtime.Remoting;
- using System.Runtime.InteropServices;
- using Microsoft.Win32.SafeHandles;
- using System.Runtime.Versioning;
- using System.Globalization;
- using System.Diagnostics.Contracts;
- using System.Diagnostics.CodeAnalysis;
-
/**
* Registry encapsulation. To get an instance of a RegistryKey use the
* Registry class's static members then call OpenSubKey.
- *
- * @see Registry
- * @security(checkDllCalls=off)
- * @security(checkClassLinking=on)
*/
- internal sealed class RegistryKey : MarshalByRefObject, IDisposable
+ internal sealed class RegistryKey : MarshalByRefObject, IDisposable
{
+ // Use the public Registry.CurrentUser
+ internal static readonly RegistryKey CurrentUser =
+ GetBaseKey(new IntPtr(unchecked((int)0x80000001)), "HKEY_CURRENT_USER");
+
+ // Use the public Registry.LocalMachine
+ internal static readonly RegistryKey LocalMachine =
+ GetBaseKey(new IntPtr(unchecked((int)0x80000002)), "HKEY_LOCAL_MACHINE");
// We could use const here, if C# supported ELEMENT_TYPE_I fully.
- internal static readonly IntPtr HKEY_CLASSES_ROOT = new IntPtr(unchecked((int)0x80000000));
- internal static readonly IntPtr HKEY_CURRENT_USER = new IntPtr(unchecked((int)0x80000001));
- internal static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(unchecked((int)0x80000002));
- internal static readonly IntPtr HKEY_USERS = new IntPtr(unchecked((int)0x80000003));
- internal static readonly IntPtr HKEY_PERFORMANCE_DATA = new IntPtr(unchecked((int)0x80000004));
- internal static readonly IntPtr HKEY_CURRENT_CONFIG = new IntPtr(unchecked((int)0x80000005));
-
- // Dirty indicates that we have munged data that should be potentially
- // written to disk.
- //
- private const int STATE_DIRTY = 0x0001;
+ private static readonly IntPtr HKEY_CURRENT_USER = new IntPtr(unchecked((int)0x80000001));
+ private static readonly IntPtr HKEY_LOCAL_MACHINE = new IntPtr(unchecked((int)0x80000002));
// SystemKey indicates that this is a "SYSTEMKEY" and shouldn't be "opened"
// or "closed".
//
- private const int STATE_SYSTEMKEY = 0x0002;
+ private const int STATE_SYSTEMKEY = 0x0002;
// Access
//
- private const int STATE_WRITEACCESS = 0x0004;
-
- // Indicates if this key is for HKEY_PERFORMANCE_DATA
- private const int STATE_PERF_DATA = 0x0008;
-
- // Names of keys. This array must be in the same order as the HKEY values listed above.
- //
- private static readonly String[] hkeyNames = new String[] {
- "HKEY_CLASSES_ROOT",
- "HKEY_CURRENT_USER",
- "HKEY_LOCAL_MACHINE",
- "HKEY_USERS",
- "HKEY_PERFORMANCE_DATA",
- "HKEY_CURRENT_CONFIG",
- };
+ private const int STATE_WRITEACCESS = 0x0004;
// MSDN defines the following limits for registry key names & values:
// Key Name: 255 characters
@@ -122,30 +71,7 @@ namespace Microsoft.Win32
private volatile SafeRegistryHandle hkey = null;
private volatile int state = 0;
- private volatile String keyName;
- private volatile bool remoteKey = false;
- private volatile RegistryKeyPermissionCheck checkMode;
- private volatile RegistryView regView = RegistryView.Default;
-
- /**
- * RegistryInternalCheck values. Useful only for CheckPermission
- */
- private enum RegistryInternalCheck {
- CheckSubKeyWritePermission = 0,
- CheckSubKeyReadPermission = 1,
- CheckSubKeyCreatePermission = 2,
- CheckSubTreeReadPermission = 3,
- CheckSubTreeWritePermission = 4,
- CheckSubTreeReadWritePermission = 5,
- CheckValueWritePermission = 6,
- CheckValueCreatePermission = 7,
- CheckValueReadPermission = 8,
- CheckKeyReadPermission = 9,
- CheckSubTreePermission = 10,
- CheckOpenSubKeyWithWritablePermission = 11,
- CheckOpenSubKeyPermission = 12
- };
-
+ private volatile string keyName;
/**
* Creates a RegistryKey.
@@ -156,37 +82,32 @@ namespace Microsoft.Win32
* The remoteKey flag when set to true indicates that we are dealing with registry entries
* on a remote machine and requires the program making these calls to have full trust.
*/
- private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey, bool remoteKey, bool isPerfData, RegistryView view) {
+ private RegistryKey(SafeRegistryHandle hkey, bool writable, bool systemkey)
+ {
this.hkey = hkey;
- this.keyName = "";
- this.remoteKey = remoteKey;
- this.regView = view;
- if (systemkey) {
- this.state |= STATE_SYSTEMKEY;
+ keyName = "";
+ if (systemkey)
+ {
+ state |= STATE_SYSTEMKEY;
}
- if (writable) {
- this.state |= STATE_WRITEACCESS;
+ if (writable)
+ {
+ state |= STATE_WRITEACCESS;
}
- if (isPerfData)
- this.state |= STATE_PERF_DATA;
- ValidateKeyView(view);
- }
-
- /**
- * Closes this key, flushes it to disk if the contents have been modified.
- */
- public void Close() {
- Dispose(true);
}
- private void Dispose(bool disposing) {
- if (hkey != null) {
-
- if (!IsSystemKey()) {
- try {
+ private void Dispose(bool disposing)
+ {
+ if (hkey != null)
+ {
+ if (!IsSystemKey())
+ {
+ try
+ {
hkey.Dispose();
}
- catch (IOException){
+ catch (IOException)
+ {
// we don't really care if the handle is invalid at this point
}
finally
@@ -194,20 +115,6 @@ namespace Microsoft.Win32
hkey = null;
}
}
- else if (disposing && IsPerfDataKey()) {
- // System keys should never be closed. However, we want to call RegCloseKey
- // on HKEY_PERFORMANCE_DATA when called from PerformanceCounter.CloseSharedResources
- // (i.e. when disposing is true) so that we release the PERFLIB cache and cause it
- // to be refreshed (by re-reading the registry) when accessed subsequently.
- // This is the only way we can see the just installed perf counter.
- // NOTE: since HKEY_PERFORMANCE_DATA is process wide, there is inherent race condition in closing
- // the key asynchronously. While Vista is smart enough to rebuild the PERFLIB resources
- // in this situation the down level OSes are not. We have a small window between
- // the dispose below and usage elsewhere (other threads). This is By Design.
- // This is less of an issue when OS > NT5 (i.e Vista & higher), we can close the perfkey
- // (to release & refresh PERFLIB resources) and the OS will rebuild PERFLIB as necessary.
- SafeRegistryHandle.RegCloseKey(RegistryKey.HKEY_PERFORMANCE_DATA);
- }
}
}
@@ -216,278 +123,199 @@ namespace Microsoft.Win32
Dispose(true);
}
- public void DeleteValue(String name, bool throwOnMissingValue) {
+ public void DeleteValue(string name, bool throwOnMissingValue)
+ {
EnsureWriteable();
- CheckPermission(RegistryInternalCheck.CheckValueWritePermission, name, false, RegistryKeyPermissionCheck.Default);
int errorCode = Win32Native.RegDeleteValue(hkey, name);
-
+
//
- // From windows 2003 server, if the name is too long we will get error code ERROR_FILENAME_EXCED_RANGE
+ // From windows 2003 server, if the name is too long we will get error code ERROR_FILENAME_EXCED_RANGE
// This still means the name doesn't exist. We need to be consistent with previous OS.
//
- if (errorCode == Win32Native.ERROR_FILE_NOT_FOUND || errorCode == Win32Native.ERROR_FILENAME_EXCED_RANGE) {
- if (throwOnMissingValue) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyValueAbsent);
+ if (errorCode == Win32Native.ERROR_FILE_NOT_FOUND || errorCode == Win32Native.ERROR_FILENAME_EXCED_RANGE)
+ {
+ if (throwOnMissingValue)
+ {
+ ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSubKeyValueAbsent);
}
+
// Otherwise, just return giving no indication to the user.
// (For compatibility)
}
+
// We really should throw an exception here if errorCode was bad,
// but we can't for compatibility reasons.
- BCLDebug.Correctness(errorCode == 0, "RegDeleteValue failed. Here's your error code: "+errorCode);
- }
-
- /**
- * Retrieves a new RegistryKey that represents the requested key. Valid
- * values are:
- *
- * 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.
- *
- * @return the RegistryKey requested.
- */
- internal static RegistryKey GetBaseKey(IntPtr hKey) {
- return GetBaseKey(hKey, RegistryView.Default);
+ Debug.Assert(errorCode == 0, "RegDeleteValue failed. Here's your error code: " + errorCode);
}
- internal static RegistryKey GetBaseKey(IntPtr hKey, RegistryView view) {
-
- int index = ((int)hKey) & 0x0FFFFFFF;
- BCLDebug.Assert(index >= 0 && index < hkeyNames.Length, "index is out of range!");
- BCLDebug.Assert((((int)hKey) & 0xFFFFFFF0) == 0x80000000, "Invalid hkey value!");
-
- bool isPerf = hKey == HKEY_PERFORMANCE_DATA;
- // only mark the SafeHandle as ownsHandle if the key is HKEY_PERFORMANCE_DATA.
- SafeRegistryHandle srh = new SafeRegistryHandle(hKey, isPerf);
+ private static RegistryKey GetBaseKey(IntPtr hKey, string keyName)
+ {
+ SafeRegistryHandle srh = new SafeRegistryHandle(hKey, ownsHandle: false);
- RegistryKey key = new RegistryKey(srh, true, true,false, isPerf, view);
- key.checkMode = RegistryKeyPermissionCheck.Default;
- key.keyName = hkeyNames[index];
+ RegistryKey key = new RegistryKey(srh, true, true);
+ key.keyName = keyName;
return key;
}
- /**
- * Retrieves a subkey. If readonly is <b>true</b>, then the subkey is opened with
- * read-only access.
- *
- * @param name Name or path of subkey to open.
- * @param readonly Set to <b>true</b> if you only need readonly access.
- *
- * @return the Subkey requested, or <b>null</b> if the operation failed.
- */
- public RegistryKey OpenSubKey(string name, bool writable ) {
+ /// <summary>
+ /// Retrieves a subkey or null if the operation failed.
+ /// </summary>
+ /// <param name="writable">True to open writable, otherwise opens the key read-only.</param>
+ public RegistryKey OpenSubKey(string name, bool writable)
+ {
ValidateKeyName(name);
EnsureNotDisposed();
- name = FixupName(name); // Fixup multiple slashes to a single slash
- CheckPermission(RegistryInternalCheck.CheckOpenSubKeyWithWritablePermission, name, writable, RegistryKeyPermissionCheck.Default);
SafeRegistryHandle result = null;
int ret = Win32Native.RegOpenKeyEx(hkey,
name,
0,
- GetRegistryKeyAccess(writable) | (int)regView,
+ writable ? Win32Native.KEY_READ | Win32Native.KEY_WRITE : Win32Native.KEY_READ,
out result);
- if (ret == 0 && !result.IsInvalid) {
- RegistryKey key = new RegistryKey(result, writable, false, remoteKey, false, regView);
- key.checkMode = GetSubKeyPermissonCheck(writable);
+ if (ret == 0 && !result.IsInvalid)
+ {
+ RegistryKey key = new RegistryKey(result, writable, false);
key.keyName = keyName + "\\" + name;
return key;
}
// Return null if we didn't find the key.
- if (ret == Win32Native.ERROR_ACCESS_DENIED || ret == Win32Native.ERROR_BAD_IMPERSONATION_LEVEL) {
+ if (ret == Win32Native.ERROR_ACCESS_DENIED || ret == Win32Native.ERROR_BAD_IMPERSONATION_LEVEL)
+ {
// We need to throw SecurityException here for compatibility reasons,
// although UnauthorizedAccessException will make more sense.
ThrowHelper.ThrowSecurityException(ExceptionResource.Security_RegistryPermission);
}
-
- return null;
- }
-
- // This required no security checks. This is to get around the Deleting SubKeys which only require
- // write permission. They call OpenSubKey which required read. Now instead call this function w/o security checks
- internal RegistryKey InternalOpenSubKey(String name, bool writable) {
- ValidateKeyName(name);
- EnsureNotDisposed();
- SafeRegistryHandle result = null;
- int ret = Win32Native.RegOpenKeyEx(hkey,
- name,
- 0,
- GetRegistryKeyAccess(writable) | (int)regView,
- out result);
-
- if (ret == 0 && !result.IsInvalid) {
- RegistryKey key = new RegistryKey(result, writable, false, remoteKey, false, regView);
- key.keyName = keyName + "\\" + name;
- return key;
- }
return null;
}
- /**
- * Returns a subkey with read only permissions.
- *
- * @param name Name or path of subkey to open.
- *
- * @return the Subkey requested, or <b>null</b> if the operation failed.
- */
- public RegistryKey OpenSubKey(String name) {
- return OpenSubKey(name, false);
- }
-
- internal int InternalSubKeyCount() {
- EnsureNotDisposed();
-
- int subkeys = 0;
- int junk = 0;
- int ret = Win32Native.RegQueryInfoKey(hkey,
- null,
- null,
- IntPtr.Zero,
- ref subkeys, // subkeys
- null,
- null,
- ref junk, // values
- null,
- null,
- null,
- null);
-
- if (ret != 0)
- Win32Error(ret, null);
- return subkeys;
- }
-
- /**
- * Retrieves an array of strings containing all the subkey names.
- *
- * @return all subkey names.
- */
- public String[] GetSubKeyNames() {
- CheckPermission(RegistryInternalCheck.CheckKeyReadPermission, null, false, RegistryKeyPermissionCheck.Default);
- return InternalGetSubKeyNames();
- }
-
- internal unsafe String[] InternalGetSubKeyNames() {
+ /// <summary>
+ /// Retrieves an array of strings containing all the subkey names.
+ /// </summary>
+ public string[] GetSubKeyNames()
+ {
EnsureNotDisposed();
- int subkeys = InternalSubKeyCount();
- String[] names = new String[subkeys]; // Returns 0-length array if empty.
- if (subkeys > 0) {
- char[] name = new char[MaxKeyLength + 1];
-
- int namelen;
+ var names = new List<string>();
+ char[] name = ArrayPool<char>.Shared.Rent(MaxKeyLength + 1);
- fixed (char *namePtr = &name[0])
+ try
+ {
+ int result;
+ int nameLength = name.Length;
+
+ while ((result = Win32Native.RegEnumKeyEx(
+ hkey,
+ names.Count,
+ name,
+ ref nameLength,
+ null,
+ null,
+ null,
+ null)) != Interop.Errors.ERROR_NO_MORE_ITEMS)
{
- for (int i=0; i<subkeys; i++) {
- namelen = name.Length; // Don't remove this. The API's doesn't work if this is not properly initialised.
- int ret = Win32Native.RegEnumKeyEx(hkey,
- i,
- namePtr,
- ref namelen,
- null,
- null,
- null,
- null);
- if (ret != 0)
- Win32Error(ret, null);
- names[i] = new String(namePtr);
+ switch (result)
+ {
+ case Interop.Errors.ERROR_SUCCESS:
+ names.Add(new string(name, 0, nameLength));
+ nameLength = name.Length;
+ break;
+ default:
+ // Throw the error
+ Win32Error(result, null);
+ break;
}
}
}
+ finally
+ {
+ ArrayPool<char>.Shared.Return(name);
+ }
- return names;
+ return names.ToArray();
}
- internal int InternalValueCount() {
- EnsureNotDisposed();
- int values = 0;
- int junk = 0;
- int ret = Win32Native.RegQueryInfoKey(hkey,
- null,
- null,
- IntPtr.Zero,
- ref junk, // subkeys
- null,
- null,
- ref values, // values
- null,
- null,
- null,
- null);
- if (ret != 0)
- Win32Error(ret, null);
- return values;
- }
-
- /**
- * Retrieves an array of strings containing all the value names.
- *
- * @return all value names.
- */
- public unsafe String[] GetValueNames() {
- CheckPermission(RegistryInternalCheck.CheckKeyReadPermission, null, false, RegistryKeyPermissionCheck.Default);
+ /// <summary>
+ /// Retrieves an array of strings containing all the value names.
+ /// </summary>
+ public unsafe string[] GetValueNames()
+ {
EnsureNotDisposed();
+ var names = new List<string>();
- int values = InternalValueCount();
- String[] names = new String[values];
+ // Names in the registry aren't usually very long, although they can go to as large
+ // as 16383 characters (MaxValueLength).
+ //
+ // Every call to RegEnumValue will allocate another buffer to get the data from
+ // NtEnumerateValueKey before copying it back out to our passed in buffer. This can
+ // add up quickly- we'll try to keep the memory pressure low and grow the buffer
+ // only if needed.
- if (values > 0) {
- char[] name = new char[MaxValueLength + 1];
- int namelen;
+ char[] name = ArrayPool<char>.Shared.Rent(100);
- fixed (char *namePtr = &name[0])
+ try
+ {
+ int result;
+ int nameLength = name.Length;
+
+ while ((result = Win32Native.RegEnumValue(
+ hkey,
+ names.Count,
+ name,
+ ref nameLength,
+ IntPtr.Zero,
+ null,
+ null,
+ null)) != Interop.Errors.ERROR_NO_MORE_ITEMS)
{
- for (int i=0; i<values; i++) {
- namelen = name.Length;
-
- int ret = Win32Native.RegEnumValue(hkey,
- i,
- namePtr,
- ref namelen,
- IntPtr.Zero,
- null,
- null,
- null);
-
- if (ret != 0) {
- // ignore ERROR_MORE_DATA if we're querying HKEY_PERFORMANCE_DATA
- if (!(IsPerfDataKey() && ret == Win32Native.ERROR_MORE_DATA))
- Win32Error(ret, null);
- }
-
- names[i] = new String(namePtr);
+ switch (result)
+ {
+ // The size is only ever reported back correctly in the case
+ // of ERROR_SUCCESS. It will almost always be changed, however.
+ case Interop.Errors.ERROR_SUCCESS:
+ names.Add(new string(name, 0, nameLength));
+ break;
+ case Interop.Errors.ERROR_MORE_DATA:
+ if (IsPerfDataKey())
+ {
+ // Enumerating the values for Perf keys always returns
+ // ERROR_MORE_DATA, but has a valid name. Buffer does need
+ // to be big enough however. 8 characters is the largest
+ // known name. The size isn't returned, but the string is
+ // null terminated.
+ fixed (char* c = &name[0])
+ {
+ names.Add(new string(c));
+ }
+ }
+ else
+ {
+ char[] oldName = name;
+ int oldLength = oldName.Length;
+ name = null;
+ ArrayPool<char>.Shared.Return(oldName);
+ name = ArrayPool<char>.Shared.Rent(checked(oldLength * 2));
+ }
+ break;
+ default:
+ // Throw the error
+ Win32Error(result, null);
+ break;
}
+
+ // Always set the name length back to the buffer size
+ nameLength = name.Length;
}
}
+ finally
+ {
+ if (name != null)
+ ArrayPool<char>.Shared.Return(name);
+ }
- return names;
- }
-
- /**
- * Retrieves the specified value. <b>null</b> is returned if the value
- * doesn't exist.
- *
- * Note that <var>name</var> can be null or "", at which point the
- * unnamed or default value of this Registry key is returned, if any.
- *
- * @param name Name of value to retrieve.
- *
- * @return the data associated with the value.
- */
- public Object GetValue(String name) {
- CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
- return InternalGetValue(name, null, false, true);
+ return names.ToArray();
}
/**
@@ -505,426 +333,257 @@ namespace Microsoft.Win32
*
* @return the data associated with the value.
*/
- public Object GetValue(String name, Object defaultValue) {
- CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
- return InternalGetValue(name, defaultValue, false, true);
- }
-
- public Object GetValue(String name, Object defaultValue, RegistryValueOptions options) {
- if( options < RegistryValueOptions.None || options > RegistryValueOptions.DoNotExpandEnvironmentNames) {
- throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)options), nameof(options));
- }
- bool doNotExpand = (options == RegistryValueOptions.DoNotExpandEnvironmentNames);
- CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
- return InternalGetValue(name, defaultValue, doNotExpand, true);
- }
-
- internal Object InternalGetValue(String name, Object defaultValue, bool doNotExpand, bool checkSecurity) {
- if (checkSecurity) {
- // Name can be null! It's the most common use of RegQueryValueEx
- EnsureNotDisposed();
- }
+ public object GetValue(string name, object defaultValue = null, bool doNotExpand = false)
+ {
+ EnsureNotDisposed();
- Object data = defaultValue;
+ object data = defaultValue;
int type = 0;
int datasize = 0;
int ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, (byte[])null, ref datasize);
- if (ret != 0) {
- if (IsPerfDataKey()) {
- int size = 65000;
- int sizeInput = size;
-
- int r;
- byte[] blob = new byte[size];
- while (Win32Native.ERROR_MORE_DATA == (r = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref sizeInput))) {
- if (size == Int32.MaxValue) {
- // ERROR_MORE_DATA was returned however we cannot increase the buffer size beyond Int32.MaxValue
- Win32Error(r, name);
- }
- else if (size > (Int32.MaxValue / 2)) {
- // at this point in the loop "size * 2" would cause an overflow
- size = Int32.MaxValue;
- }
- else {
- size *= 2;
- }
- sizeInput = size;
- blob = new byte[size];
- }
- if (r != 0)
- Win32Error(r, name);
- return blob;
- }
- else {
- // For stuff like ERROR_FILE_NOT_FOUND, we want to return null (data).
- // Some OS's returned ERROR_MORE_DATA even in success cases, so we
- // want to continue on through the function.
- if (ret != Win32Native.ERROR_MORE_DATA)
- return data;
- }
+ if (ret != 0)
+ {
+ // For stuff like ERROR_FILE_NOT_FOUND, we want to return null (data).
+ // Some OS's returned ERROR_MORE_DATA even in success cases, so we
+ // want to continue on through the function.
+ if (ret != Win32Native.ERROR_MORE_DATA)
+ return data;
}
- if (datasize < 0) {
+ if (datasize < 0)
+ {
// unexpected code path
- BCLDebug.Assert(false, "[InternalGetValue] RegQueryValue returned ERROR_SUCCESS but gave a negative datasize");
+ Debug.Assert(false, "[InternalGetValue] RegQueryValue returned ERROR_SUCCESS but gave a negative datasize");
datasize = 0;
}
+ switch (type)
+ {
+ case Win32Native.REG_NONE:
+ case Win32Native.REG_DWORD_BIG_ENDIAN:
+ case Win32Native.REG_BINARY:
+ {
+ byte[] blob = new byte[datasize];
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
+ data = blob;
+ }
+ break;
+ case Win32Native.REG_QWORD:
+ { // also REG_QWORD_LITTLE_ENDIAN
+ if (datasize > 8)
+ {
+ // prevent an AV in the edge case that datasize is larger than sizeof(long)
+ goto case Win32Native.REG_BINARY;
+ }
+ long blob = 0;
+ Debug.Assert(datasize == 8, "datasize==8");
+ // Here, datasize must be 8 when calling this
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize);
- switch (type) {
- case Win32Native.REG_NONE:
- case Win32Native.REG_DWORD_BIG_ENDIAN:
- case Win32Native.REG_BINARY: {
- byte[] blob = new byte[datasize];
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
- data = blob;
- }
- break;
- case Win32Native.REG_QWORD:
- { // also REG_QWORD_LITTLE_ENDIAN
- if (datasize > 8) {
- // prevent an AV in the edge case that datasize is larger than sizeof(long)
- goto case Win32Native.REG_BINARY;
- }
- long blob = 0;
- BCLDebug.Assert(datasize==8, "datasize==8");
- // Here, datasize must be 8 when calling this
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize);
-
- data = blob;
- }
- break;
- case Win32Native.REG_DWORD:
- { // also REG_DWORD_LITTLE_ENDIAN
- if (datasize > 4) {
- // prevent an AV in the edge case that datasize is larger than sizeof(int)
- goto case Win32Native.REG_QWORD;
- }
- int blob = 0;
- BCLDebug.Assert(datasize==4, "datasize==4");
- // Here, datasize must be four when calling this
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize);
-
- data = blob;
- }
- break;
-
- case Win32Native.REG_SZ:
- {
- if (datasize % 2 == 1) {
- // handle the case where the registry contains an odd-byte length (corrupt data?)
- try {
- datasize = checked(datasize + 1);
- }
- catch (OverflowException e) {
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
- }
- }
- char[] blob = new char[datasize/2];
-
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
- if (blob.Length > 0 && blob[blob.Length - 1] == (char)0) {
- data = new String(blob, 0, blob.Length - 1);
- }
- else {
- // in the very unlikely case the data is missing null termination,
- // pass in the whole char[] to prevent truncating a character
- data = new String(blob);
- }
- }
- break;
-
- case Win32Native.REG_EXPAND_SZ:
- {
- if (datasize % 2 == 1) {
- // handle the case where the registry contains an odd-byte length (corrupt data?)
- try {
- datasize = checked(datasize + 1);
- }
- catch (OverflowException e) {
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
- }
- }
- char[] blob = new char[datasize/2];
-
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
-
- if (blob.Length > 0 && blob[blob.Length - 1] == (char)0) {
- data = new String(blob, 0, blob.Length - 1);
- }
- else {
- // in the very unlikely case the data is missing null termination,
- // pass in the whole char[] to prevent truncating a character
- data = new String(blob);
- }
-
- if (!doNotExpand)
- data = Environment.ExpandEnvironmentVariables((String)data);
- }
- break;
- case Win32Native.REG_MULTI_SZ:
- {
- if (datasize % 2 == 1) {
- // handle the case where the registry contains an odd-byte length (corrupt data?)
- try {
- datasize = checked(datasize + 1);
- }
- catch (OverflowException e) {
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
- }
- }
- char[] blob = new char[datasize/2];
-
- ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
-
- // make sure the string is null terminated before processing the data
- if (blob.Length > 0 && blob[blob.Length - 1] != (char)0) {
- try {
- char[] newBlob = new char[checked(blob.Length + 1)];
- for (int i = 0; i < blob.Length; i++) {
- newBlob[i] = blob[i];
- }
- newBlob[newBlob.Length - 1] = (char)0;
- blob = newBlob;
- }
- catch (OverflowException e) {
- throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e);
- }
- blob[blob.Length - 1] = (char)0;
- }
-
-
- IList<String> strings = new List<String>();
- int cur = 0;
- int len = blob.Length;
-
- while (ret == 0 && cur < len) {
- int nextNull = cur;
- while (nextNull < len && blob[nextNull] != (char)0) {
- nextNull++;
- }
-
- if (nextNull < len) {
- BCLDebug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0");
- if (nextNull-cur > 0) {
- strings.Add(new String(blob, cur, nextNull-cur));
- }
- else {
- // we found an empty string. But if we're at the end of the data,
- // it's just the extra null terminator.
- if (nextNull != len-1)
- strings.Add(String.Empty);
- }
- }
- else {
- strings.Add(new String(blob, cur, len-cur));
- }
- cur = nextNull+1;
- }
-
- data = new String[strings.Count];
- strings.CopyTo((String[])data, 0);
- }
- break;
- case Win32Native.REG_LINK:
- default:
- break;
- }
-
- return data;
- }
-
- private bool IsSystemKey() {
- return (this.state & STATE_SYSTEMKEY) != 0;
- }
-
- private bool IsWritable() {
- return (this.state & STATE_WRITEACCESS) != 0;
- }
-
- private bool IsPerfDataKey() {
- return (this.state & STATE_PERF_DATA) != 0;
- }
-
- private void SetDirty() {
- this.state |= STATE_DIRTY;
- }
-
- /**
- * Sets the specified value.
- *
- * @param name Name of value to store data in.
- * @param value Data to store.
- */
- public void SetValue(String name, Object value) {
- SetValue(name, value, RegistryValueKind.Unknown);
- }
-
- public unsafe void SetValue(String name, Object value, RegistryValueKind valueKind) {
- if (value==null)
- ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
+ data = blob;
+ }
+ break;
+ case Win32Native.REG_DWORD:
+ { // also REG_DWORD_LITTLE_ENDIAN
+ if (datasize > 4)
+ {
+ // prevent an AV in the edge case that datasize is larger than sizeof(int)
+ goto case Win32Native.REG_QWORD;
+ }
+ int blob = 0;
+ Debug.Assert(datasize == 4, "datasize==4");
+ // Here, datasize must be four when calling this
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, ref blob, ref datasize);
- if (name != null && name.Length > MaxValueLength) {
- throw new ArgumentException(Environment.GetResourceString("Arg_RegValStrLenBug"));
- }
+ data = blob;
+ }
+ break;
- if (!Enum.IsDefined(typeof(RegistryValueKind), valueKind))
- throw new ArgumentException(Environment.GetResourceString("Arg_RegBadKeyKind"), nameof(valueKind));
+ case Win32Native.REG_SZ:
+ {
+ if (datasize % 2 == 1)
+ {
+ // handle the case where the registry contains an odd-byte length (corrupt data?)
+ try
+ {
+ datasize = checked(datasize + 1);
+ }
+ catch (OverflowException e)
+ {
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
+ }
+ }
+ char[] blob = new char[datasize / 2];
- EnsureWriteable();
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
+ if (blob.Length > 0 && blob[blob.Length - 1] == (char)0)
+ {
+ data = new string(blob, 0, blob.Length - 1);
+ }
+ else
+ {
+ // in the very unlikely case the data is missing null termination,
+ // pass in the whole char[] to prevent truncating a character
+ data = new string(blob);
+ }
+ }
+ break;
- if (!remoteKey && ContainsRegistryValue(name)) { // Existing key
- CheckPermission(RegistryInternalCheck.CheckValueWritePermission, name, false, RegistryKeyPermissionCheck.Default);
- }
- else { // Creating a new value
- CheckPermission(RegistryInternalCheck.CheckValueCreatePermission, name, false, RegistryKeyPermissionCheck.Default);
- }
+ case Win32Native.REG_EXPAND_SZ:
+ {
+ if (datasize % 2 == 1)
+ {
+ // handle the case where the registry contains an odd-byte length (corrupt data?)
+ try
+ {
+ datasize = checked(datasize + 1);
+ }
+ catch (OverflowException e)
+ {
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
+ }
+ }
+ char[] blob = new char[datasize / 2];
- if (valueKind == RegistryValueKind.Unknown) {
- // this is to maintain compatibility with the old way of autodetecting the type.
- // SetValue(string, object) will come through this codepath.
- valueKind = CalculateValueKind(value);
- }
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
- int ret = 0;
- try {
- switch (valueKind) {
- case RegistryValueKind.ExpandString:
- case RegistryValueKind.String:
+ if (blob.Length > 0 && blob[blob.Length - 1] == (char)0)
{
- String data = value.ToString();
- ret = Win32Native.RegSetValueEx(hkey,
- name,
- 0,
- valueKind,
- data,
- checked(data.Length * 2 + 2));
- break;
+ data = new string(blob, 0, blob.Length - 1);
+ }
+ else
+ {
+ // in the very unlikely case the data is missing null termination,
+ // pass in the whole char[] to prevent truncating a character
+ data = new string(blob);
}
- case RegistryValueKind.MultiString:
+ if (!doNotExpand)
+ data = Environment.ExpandEnvironmentVariables((string)data);
+ }
+ break;
+ case Win32Native.REG_MULTI_SZ:
+ {
+ if (datasize % 2 == 1)
{
- // Other thread might modify the input array after we calculate the buffer length.
- // Make a copy of the input array to be safe.
- string[] dataStrings = (string[])(((string[])value).Clone());
- int sizeInBytes = 0;
-
- // First determine the size of the array
- //
- for (int i=0; i<dataStrings.Length; i++) {
- if (dataStrings[i] == null) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSetStrArrNull);
- }
- sizeInBytes = checked(sizeInBytes + (dataStrings[i].Length+1) * 2);
- }
- sizeInBytes = checked(sizeInBytes + 2);
-
- byte[] basePtr = new byte[sizeInBytes];
- fixed(byte* b = basePtr) {
- IntPtr currentPtr = new IntPtr( (void *) b);
-
- // Write out the strings...
- //
- for (int i=0; i<dataStrings.Length; i++) {
- // Assumes that the Strings are always null terminated.
- String.InternalCopy(dataStrings[i],currentPtr,(checked(dataStrings[i].Length*2)));
- currentPtr = new IntPtr((long)currentPtr + (checked(dataStrings[i].Length*2)));
- *(char*)(currentPtr.ToPointer()) = '\0';
- currentPtr = new IntPtr((long)currentPtr + 2);
- }
-
- *(char*)(currentPtr.ToPointer()) = '\0';
- currentPtr = new IntPtr((long)currentPtr + 2);
-
- ret = Win32Native.RegSetValueEx(hkey,
- name,
- 0,
- RegistryValueKind.MultiString,
- basePtr,
- sizeInBytes);
+ // handle the case where the registry contains an odd-byte length (corrupt data?)
+ try
+ {
+ datasize = checked(datasize + 1);
+ }
+ catch (OverflowException e)
+ {
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
}
- break;
}
+ char[] blob = new char[datasize / 2];
- case RegistryValueKind.None:
- case RegistryValueKind.Binary:
- byte[] dataBytes = (byte[]) value;
- ret = Win32Native.RegSetValueEx(hkey,
- name,
- 0,
- (valueKind == RegistryValueKind.None ? Win32Native.REG_NONE: RegistryValueKind.Binary),
- dataBytes,
- dataBytes.Length);
- break;
-
- case RegistryValueKind.DWord:
+ ret = Win32Native.RegQueryValueEx(hkey, name, null, ref type, blob, ref datasize);
+
+ // make sure the string is null terminated before processing the data
+ if (blob.Length > 0 && blob[blob.Length - 1] != (char)0)
{
- // We need to use Convert here because we could have a boxed type cannot be
- // unboxed and cast at the same time. I.e. ((int)(object)(short) 5) will fail.
- int data = Convert.ToInt32(value, System.Globalization.CultureInfo.InvariantCulture);
-
- ret = Win32Native.RegSetValueEx(hkey,
- name,
- 0,
- RegistryValueKind.DWord,
- ref data,
- 4);
- break;
+ try
+ {
+ char[] newBlob = new char[checked(blob.Length + 1)];
+ for (int i = 0; i < blob.Length; i++)
+ {
+ newBlob[i] = blob[i];
+ }
+ newBlob[newBlob.Length - 1] = (char)0;
+ blob = newBlob;
+ }
+ catch (OverflowException e)
+ {
+ throw new IOException(SR.Arg_RegGetOverflowBug, e);
+ }
+ blob[blob.Length - 1] = (char)0;
}
- case RegistryValueKind.QWord:
+ IList<string> strings = new List<string>();
+ int cur = 0;
+ int len = blob.Length;
+
+ while (ret == 0 && cur < len)
{
- long data = Convert.ToInt64(value, System.Globalization.CultureInfo.InvariantCulture);
-
- ret = Win32Native.RegSetValueEx(hkey,
- name,
- 0,
- RegistryValueKind.QWord,
- ref data,
- 8);
- break;
+ int nextNull = cur;
+ while (nextNull < len && blob[nextNull] != (char)0)
+ {
+ nextNull++;
+ }
+
+ if (nextNull < len)
+ {
+ Debug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0");
+ if (nextNull - cur > 0)
+ {
+ strings.Add(new string(blob, cur, nextNull - cur));
+ }
+ else
+ {
+ // we found an empty string. But if we're at the end of the data,
+ // it's just the extra null terminator.
+ if (nextNull != len - 1)
+ strings.Add(string.Empty);
+ }
+ }
+ else
+ {
+ strings.Add(new string(blob, cur, len - cur));
+ }
+ cur = nextNull + 1;
}
- }
- }
- catch (OverflowException) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSetMismatchedKind);
- }
- catch (InvalidOperationException) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSetMismatchedKind);
- }
- catch (FormatException) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSetMismatchedKind);
- }
- catch (InvalidCastException) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegSetMismatchedKind);
- }
- if (ret == 0) {
- SetDirty();
+ data = new string[strings.Count];
+ strings.CopyTo((string[])data, 0);
+ }
+ break;
+ case Win32Native.REG_LINK:
+ default:
+ break;
}
- else
- Win32Error(ret, null);
+ return data;
+ }
+
+ private bool IsSystemKey()
+ {
+ return (state & STATE_SYSTEMKEY) != 0;
}
- private RegistryValueKind CalculateValueKind(Object value) {
- // This logic matches what used to be in SetValue(string name, object value) in the v1.0 and v1.1 days.
- // Even though we could add detection for an int64 in here, we want to maintain compatibility with the
- // old behavior.
- if (value is Int32)
- return RegistryValueKind.DWord;
- else if (value is Array) {
- if (value is byte[])
- return RegistryValueKind.Binary;
- else if (value is String[])
- return RegistryValueKind.MultiString;
- else
- throw new ArgumentException(Environment.GetResourceString("Arg_RegSetBadArrType", value.GetType().Name));
+ private bool IsWritable()
+ {
+ return (state & STATE_WRITEACCESS) != 0;
+ }
+
+ private bool IsPerfDataKey()
+ {
+ return false;
+ }
+
+ public unsafe void SetStringValue(string name, string value)
+ {
+ if (value == null)
+ ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
+
+ if (name != null && name.Length > MaxValueLength)
+ {
+ throw new ArgumentException(SR.Arg_RegValStrLenBug);
}
- else
- return RegistryValueKind.String;
+
+ EnsureWriteable();
+
+ int result = Win32Native.RegSetValueEx(hkey,
+ name,
+ 0,
+ RegistryValueKind.String,
+ value,
+ checked(value.Length * 2 + 2));
+
+ if (result != 0)
+ Win32Error(result, null);
}
/**
@@ -932,7 +591,8 @@ namespace Microsoft.Win32
*
* @return a string representing the key.
*/
- public override String ToString() {
+ public override string ToString()
+ {
EnsureNotDisposed();
return keyName;
}
@@ -944,164 +604,51 @@ namespace Microsoft.Win32
* error, and depending on the error, insert a string into the message
* gotten from the ResourceManager.
*/
- internal void Win32Error(int errorCode, String str) {
- switch (errorCode) {
+ internal void Win32Error(int errorCode, string str)
+ {
+ switch (errorCode)
+ {
case Win32Native.ERROR_ACCESS_DENIED:
if (str != null)
- throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_RegistryKeyGeneric_Key", str));
+ throw new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_RegistryKeyGeneric_Key, str));
else
throw new UnauthorizedAccessException();
-
- case Win32Native.ERROR_INVALID_HANDLE:
- /**
- * For normal RegistryKey instances we dispose the SafeRegHandle and throw IOException.
- * However, for HKEY_PERFORMANCE_DATA (on a local or remote machine) we avoid disposing the
- * SafeRegHandle and only throw the IOException. This is to workaround reentrancy issues
- * in PerformanceCounter.NextValue() where the API could throw {NullReference, ObjectDisposed, ArgumentNull}Exception
- * on reentrant calls because of this error code path in RegistryKey
- *
- * Normally we'd make our caller synchronize access to a shared RegistryKey instead of doing something like this,
- * however we shipped PerformanceCounter.NextValue() un-synchronized in v2.0RTM and customers have taken a dependency on
- * this behavior (being able to simultaneously query multiple remote-machine counters on multiple threads, instead of
- * having serialized access).
- */
- if (!IsPerfDataKey()) {
- this.hkey.SetHandleAsInvalid();
- this.hkey = null;
- }
- goto default;
-
case Win32Native.ERROR_FILE_NOT_FOUND:
- throw new IOException(Environment.GetResourceString("Arg_RegKeyNotFound"), errorCode);
+ throw new IOException(SR.Arg_RegKeyNotFound, errorCode);
default:
throw new IOException(Win32Native.GetMessage(errorCode), errorCode);
}
}
- internal static String FixupName(String name)
- {
- BCLDebug.Assert(name!=null,"[FixupName]name!=null");
- if (name.IndexOf('\\') == -1)
- return name;
-
- StringBuilder sb = new StringBuilder(name);
- FixupPath(sb);
- int temp = sb.Length - 1;
- if (temp >= 0 && sb[temp] == '\\') // Remove trailing slash
- sb.Length = temp;
- return sb.ToString();
- }
-
-
- private static void FixupPath(StringBuilder path)
+ private void EnsureNotDisposed()
{
- Contract.Requires(path != null);
- int length = path.Length;
- bool fixup = false;
- char markerChar = (char)0xFFFF;
-
- int i = 1;
- while (i < length - 1)
- {
- if (path[i] == '\\')
- {
- i++;
- while (i < length)
- {
- if (path[i] == '\\')
- {
- path[i] = markerChar;
- i++;
- fixup = true;
- }
- else
- break;
- }
-
- }
- i++;
- }
-
- if (fixup)
+ if (hkey == null)
{
- i = 0;
- int j = 0;
- while (i < length)
- {
- if(path[i] == markerChar)
- {
- i++;
- continue;
- }
- path[j] = path[i];
- i++;
- j++;
- }
- path.Length += j - i;
- }
-
- }
-
- private void CheckPermission(RegistryInternalCheck check, string item, bool subKeyWritable, RegistryKeyPermissionCheck subKeyCheck)
- {
- // TODO: Cleanup
- }
-
- private bool ContainsRegistryValue(string name) {
- int type = 0;
- int datasize = 0;
- int retval = Win32Native.RegQueryValueEx(hkey, name, null, ref type, (byte[])null, ref datasize);
- return retval == 0;
- }
-
- private void EnsureNotDisposed(){
- if (hkey == null) {
ThrowHelper.ThrowObjectDisposedException(keyName, ExceptionResource.ObjectDisposed_RegKeyClosed);
}
}
- private void EnsureWriteable() {
+ private void EnsureWriteable()
+ {
EnsureNotDisposed();
- if (!IsWritable()) {
+ if (!IsWritable())
+ {
ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource.UnauthorizedAccess_RegistryNoWrite);
}
}
- static int GetRegistryKeyAccess(bool isWritable) {
- int winAccess;
- if (!isWritable) {
- winAccess = Win32Native.KEY_READ;
- }
- else {
- winAccess = Win32Native.KEY_READ | Win32Native.KEY_WRITE;
- }
-
- return winAccess;
- }
-
- private RegistryKeyPermissionCheck GetSubKeyPermissonCheck(bool subkeyWritable) {
- if( checkMode == RegistryKeyPermissionCheck.Default) {
- return checkMode;
- }
-
- if(subkeyWritable) {
- return RegistryKeyPermissionCheck.ReadWriteSubTree;
- }
- else {
- return RegistryKeyPermissionCheck.ReadSubTree;
- }
- }
-
- static private void ValidateKeyName(string name) {
- Contract.Ensures(name != null);
- if (name == null) {
+ static private void ValidateKeyName(string name)
+ {
+ if (name == null)
+ {
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.name);
}
int nextSlash = name.IndexOf("\\", StringComparison.OrdinalIgnoreCase);
int current = 0;
- while (nextSlash != -1) {
+ while (nextSlash != -1)
+ {
if ((nextSlash - current) > MaxKeyLength)
ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyStrLenBug);
@@ -1111,32 +658,11 @@ namespace Microsoft.Win32
if ((name.Length - current) > MaxKeyLength)
ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyStrLenBug);
-
- }
-
- static private void ValidateKeyView(RegistryView view) {
- if (view != RegistryView.Default && view != RegistryView.Registry32 && view != RegistryView.Registry64) {
- ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidRegistryViewCheck, ExceptionArgument.view);
- }
}
// Win32 constants for error handling
private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
- private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
+ private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
}
-
- [Flags]
- internal enum RegistryValueOptions {
- None = 0,
- DoNotExpandEnvironmentNames = 1
- }
-
- // the name for this API is meant to mimic FileMode, which has similar values
-
- internal enum RegistryKeyPermissionCheck {
- Default = 0,
- ReadSubTree = 1,
- ReadWriteSubTree = 2
- }
}
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs b/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
index 5e22275332..90c880b278 100644
--- a/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
+++ b/src/mscorlib/src/Microsoft/Win32/RegistryValueKind.cs
@@ -2,17 +2,21 @@
// 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
+{
+ internal enum RegistryValueKind
+ {
+ String = Win32Native.REG_SZ,
+ ExpandString = Win32Native.REG_EXPAND_SZ,
+ Binary = Win32Native.REG_BINARY,
+ DWord = Win32Native.REG_DWORD,
+ MultiString = Win32Native.REG_MULTI_SZ,
+ QWord = Win32Native.REG_QWORD,
+ Unknown = 0,
-namespace Microsoft.Win32 {
- internal enum RegistryValueKind {
- String = Win32Native.REG_SZ,
- ExpandString = Win32Native.REG_EXPAND_SZ,
- Binary = Win32Native.REG_BINARY,
- DWord = Win32Native.REG_DWORD,
- MultiString = Win32Native.REG_MULTI_SZ,
- QWord = Win32Native.REG_QWORD,
- Unknown = 0, // REG_NONE is defined as zero but BCL
- None = unchecked((int)0xFFFFFFFF), // mistakingly overrode this value.
- } // Now instead of using Win32Native.REG_NONE we use "-1" and play games internally.
+ // REG_NONE is defined as zero but BCL, mistakingly overrode this value.
+ // Now instead of using Win32Native.REG_NONE we use "-1" and play games internally.
+ None = unchecked((int)0xFFFFFFFF),
+ }
}
diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryView.cs b/src/mscorlib/src/Microsoft/Win32/RegistryView.cs
deleted file mode 100644
index 302a603e0c..0000000000
--- a/src/mscorlib/src/Microsoft/Win32/RegistryView.cs
+++ /dev/null
@@ -1,19 +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.RegistryView
-//
-// ======================================================================================
-namespace Microsoft.Win32 {
- using System;
-
- 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/SafeFindHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFindHandle.cs
index 89ea22b855..d7d833d35d 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFindHandle.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeFindHandle.cs
@@ -18,10 +18,11 @@ using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using Microsoft.Win32;
-namespace Microsoft.Win32.SafeHandles {
+namespace Microsoft.Win32.SafeHandles
+{
internal sealed class SafeFindHandle : SafeHandleZeroOrMinusOneIsInvalid
{
- internal SafeFindHandle() : base(true) {}
+ internal SafeFindHandle() : base(true) { }
override protected bool ReleaseHandle()
{
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs
index 603558c51a..256f611463 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeLibraryHandle.cs
@@ -2,11 +2,13 @@
// 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 {
- using Microsoft.Win32.SafeHandles;
+using Microsoft.Win32.SafeHandles;
- sealed internal class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid {
- internal SafeLibraryHandle() : base(true) {}
+namespace Microsoft.Win32
+{
+ sealed internal class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid
+ {
+ internal SafeLibraryHandle() : base(true) { }
override protected bool ReleaseHandle()
{
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
index a1e5bc4263..1215000ec5 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs
@@ -2,28 +2,23 @@
// 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.SafeHandles.SafeRegistryHandle
-//
-// ======================================================================================
-namespace Microsoft.Win32.SafeHandles {
- using System;
- using System.Security;
- using System.Runtime.InteropServices;
- using System.Runtime.CompilerServices;
- using System.Runtime.ConstrainedExecution;
- using System.Runtime.Versioning;
+using System;
+using System.Security;
+using System.Runtime.InteropServices;
- internal sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid {
- internal SafeRegistryHandle() : base(true) {}
+namespace Microsoft.Win32.SafeHandles
+{
+ internal sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid
+ {
+ internal SafeRegistryHandle() : base(true) { }
- public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) {
+ public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle)
+ {
SetHandle(preexistingHandle);
}
- override protected bool ReleaseHandle() {
+ override protected bool ReleaseHandle()
+ {
return (RegCloseKey(handle) == Win32Native.ERROR_SUCCESS);
}
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs
index 0ebcd5c09e..1141e6d027 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeWaitHandle.cs
@@ -21,8 +21,8 @@ using System.Runtime.Versioning;
using Microsoft.Win32;
using System.Threading;
-namespace Microsoft.Win32.SafeHandles {
-
+namespace Microsoft.Win32.SafeHandles
+{
public sealed class SafeWaitHandle : SafeHandleZeroOrMinusOneIsInvalid
{
// Called by P/Invoke marshaler
diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
index 62418131f3..8a7f591dfc 100644
--- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
+++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/Win32SafeHandles.cs
@@ -13,17 +13,17 @@
//
//
+using System;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Runtime.ConstrainedExecution;
+
namespace Microsoft.Win32.SafeHandles
{
- using System;
- using System.Runtime.InteropServices;
- using System.Runtime.CompilerServices;
- using System.Runtime.ConstrainedExecution;
-
// Class of safe handle which uses 0 or -1 as an invalid handle.
public abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
{
- protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
+ protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base(IntPtr.Zero, ownsHandle)
{
}
@@ -33,7 +33,8 @@ namespace Microsoft.Win32.SafeHandles
throw new NotImplementedException();
}
- public override bool IsInvalid {
+ public override bool IsInvalid
+ {
get { return handle.IsNull() || handle == new IntPtr(-1); }
}
}
@@ -41,7 +42,7 @@ namespace Microsoft.Win32.SafeHandles
// Class of safe handle which uses only -1 as an invalid handle.
public abstract class SafeHandleMinusOneIsInvalid : SafeHandle
{
- protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base(new IntPtr(-1), ownsHandle)
+ protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base(new IntPtr(-1), ownsHandle)
{
}
@@ -51,31 +52,8 @@ namespace Microsoft.Win32.SafeHandles
throw new NotImplementedException();
}
- public override bool IsInvalid {
- get { return handle == new IntPtr(-1); }
- }
- }
-
- // Class of critical handle which uses 0 or -1 as an invalid handle.
- public abstract class CriticalHandleZeroOrMinusOneIsInvalid : CriticalHandle
- {
- protected CriticalHandleZeroOrMinusOneIsInvalid() : base(IntPtr.Zero)
- {
- }
-
- public override bool IsInvalid {
- get { return handle.IsNull() || handle == new IntPtr(-1); }
- }
- }
-
- // Class of critical handle which uses only -1 as an invalid handle.
- public abstract class CriticalHandleMinusOneIsInvalid : CriticalHandle
- {
- protected CriticalHandleMinusOneIsInvalid() : base(new IntPtr(-1))
+ public override bool IsInvalid
{
- }
-
- public override bool IsInvalid {
get { return handle == new IntPtr(-1); }
}
}
diff --git a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
index 6e37b9c878..1b835d5dd1 100644
--- a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
+++ b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs
@@ -2,7 +2,8 @@
// 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 {
+namespace Microsoft.Win32
+{
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
using System;
@@ -16,12 +17,12 @@ namespace Microsoft.Win32 {
using System.Diagnostics.Tracing;
[SuppressUnmanagedCodeSecurityAttribute()]
- internal static class UnsafeNativeMethods {
-
- [DllImport(Win32Native.KERNEL32, EntryPoint="GetTimeZoneInformation", SetLastError = true, ExactSpelling = true)]
+ internal static class UnsafeNativeMethods
+ {
+ [DllImport(Win32Native.KERNEL32, EntryPoint = "GetTimeZoneInformation", SetLastError = true, ExactSpelling = true)]
internal static extern int GetTimeZoneInformation(out Win32Native.TimeZoneInformation lpTimeZoneInformation);
- [DllImport(Win32Native.KERNEL32, EntryPoint="GetDynamicTimeZoneInformation", SetLastError = true, ExactSpelling = true)]
+ [DllImport(Win32Native.KERNEL32, EntryPoint = "GetDynamicTimeZoneInformation", SetLastError = true, ExactSpelling = true)]
internal static extern int GetDynamicTimeZoneInformation(out Win32Native.DynamicTimeZoneInformation lpDynamicTimeZoneInformation);
//
@@ -35,7 +36,7 @@ namespace Microsoft.Win32 {
// PULONGLONG pululEnumerator
// );
//
- [DllImport(Win32Native.KERNEL32, EntryPoint="GetFileMUIPath", SetLastError = true, ExactSpelling = true)]
+ [DllImport(Win32Native.KERNEL32, EntryPoint = "GetFileMUIPath", SetLastError = true, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool GetFileMUIPath(
int flags,
@@ -50,13 +51,13 @@ namespace Microsoft.Win32 {
ref Int64 enumerator);
- [DllImport(Win32Native.USER32, EntryPoint="LoadStringW", SetLastError=true, CharSet=CharSet.Unicode, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
+ [DllImport(Win32Native.USER32, EntryPoint = "LoadStringW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
internal static extern int LoadString(SafeLibraryHandle handle, int id, [Out] StringBuilder buffer, int bufferLength);
- [DllImport(Win32Native.KERNEL32, CharSet=System.Runtime.InteropServices.CharSet.Unicode, SetLastError=true)]
- internal static extern SafeLibraryHandle LoadLibraryEx(string libFilename, IntPtr reserved, int flags);
-
- [DllImport(Win32Native.KERNEL32, CharSet=System.Runtime.InteropServices.CharSet.Unicode)]
+ [DllImport(Win32Native.KERNEL32, CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)]
+ internal static extern SafeLibraryHandle LoadLibraryEx(string libFilename, IntPtr reserved, int flags);
+
+ [DllImport(Win32Native.KERNEL32, CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool FreeLibrary(IntPtr hModule);
@@ -245,14 +246,13 @@ namespace Microsoft.Win32 {
void* OutBuffer,
int OutBufferSize,
ref int ReturnLength);
-
}
#if FEATURE_COMINTEROP
[DllImport("combase.dll", PreserveSig = true)]
internal static extern int RoGetActivationFactory(
[MarshalAs(UnmanagedType.HString)] string activatableClassId,
[In] ref Guid iid,
- [Out,MarshalAs(UnmanagedType.IInspectable)] out Object factory);
+ [Out, MarshalAs(UnmanagedType.IInspectable)] out Object factory);
#endif
}
diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
index b081b16ca1..8543bc8a99 100644
--- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
+++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs
@@ -87,7 +87,8 @@
* in your DllImportAttribute.
*/
-namespace Microsoft.Win32 {
+namespace Microsoft.Win32
+{
using System;
using System.Security;
using System.Text;
@@ -103,7 +104,7 @@ namespace Microsoft.Win32 {
using BOOL = System.Int32;
using DWORD = System.UInt32;
using ULONG = System.UInt32;
-
+
/**
* Win32 encapsulation for MSCORLIB.
*/
@@ -111,49 +112,49 @@ namespace Microsoft.Win32 {
// global declaration on the class.
[SuppressUnmanagedCodeSecurityAttribute()]
- internal static class Win32Native {
-
- internal const int KEY_QUERY_VALUE = 0x0001;
- internal const int KEY_SET_VALUE = 0x0002;
- internal const int KEY_CREATE_SUB_KEY = 0x0004;
+ internal static class Win32Native
+ {
+ internal const int KEY_QUERY_VALUE = 0x0001;
+ internal const int KEY_SET_VALUE = 0x0002;
+ internal const int KEY_CREATE_SUB_KEY = 0x0004;
internal const int KEY_ENUMERATE_SUB_KEYS = 0x0008;
- internal const int KEY_NOTIFY = 0x0010;
- internal const int KEY_CREATE_LINK = 0x0020;
- internal const int KEY_READ =((STANDARD_RIGHTS_READ |
- KEY_QUERY_VALUE |
- KEY_ENUMERATE_SUB_KEYS |
- KEY_NOTIFY)
- &
+ internal const int KEY_NOTIFY = 0x0010;
+ internal const int KEY_CREATE_LINK = 0x0020;
+ internal const int KEY_READ = ((STANDARD_RIGHTS_READ |
+ KEY_QUERY_VALUE |
+ KEY_ENUMERATE_SUB_KEYS |
+ KEY_NOTIFY)
+ &
(~SYNCHRONIZE));
-
- internal const int KEY_WRITE =((STANDARD_RIGHTS_WRITE |
- KEY_SET_VALUE |
- KEY_CREATE_SUB_KEY)
- &
+
+ internal const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE |
+ KEY_SET_VALUE |
+ KEY_CREATE_SUB_KEY)
+ &
(~SYNCHRONIZE));
- internal const int KEY_WOW64_64KEY = 0x0100; //
- internal const int KEY_WOW64_32KEY = 0x0200; //
- internal const int REG_OPTION_NON_VOLATILE= 0x0000; // (default) keys are persisted beyond reboot/unload
- internal const int REG_OPTION_VOLATILE = 0x0001; // All keys created by the function are volatile
+ internal const int KEY_WOW64_64KEY = 0x0100; //
+ internal const int KEY_WOW64_32KEY = 0x0200; //
+ internal const int REG_OPTION_NON_VOLATILE = 0x0000; // (default) keys are persisted beyond reboot/unload
+ internal const int REG_OPTION_VOLATILE = 0x0001; // All keys created by the function are volatile
internal const int REG_OPTION_CREATE_LINK = 0x0002; // They key is a symbolic link
internal const int REG_OPTION_BACKUP_RESTORE = 0x0004; // Use SE_BACKUP_NAME process special privileges
- internal const int REG_NONE = 0; // No value type
- internal const int REG_SZ = 1; // Unicode nul terminated string
- internal const int REG_EXPAND_SZ = 2; // Unicode nul terminated string
+ internal const int REG_NONE = 0; // No value type
+ internal const int REG_SZ = 1; // Unicode nul terminated string
+ internal const int REG_EXPAND_SZ = 2; // Unicode nul terminated string
// (with environment variable references)
- internal const int REG_BINARY = 3; // Free form binary
- internal const int REG_DWORD = 4; // 32-bit number
- internal const int REG_DWORD_LITTLE_ENDIAN = 4; // 32-bit number (same as REG_DWORD)
- internal const int REG_DWORD_BIG_ENDIAN = 5; // 32-bit number
- internal const int REG_LINK = 6; // Symbolic Link (unicode)
- internal const int REG_MULTI_SZ = 7; // Multiple Unicode strings
- internal const int REG_RESOURCE_LIST = 8; // Resource list in the resource map
- internal const int REG_FULL_RESOURCE_DESCRIPTOR = 9; // Resource list in the hardware description
- internal const int REG_RESOURCE_REQUIREMENTS_LIST = 10;
- internal const int REG_QWORD = 11; // 64-bit number
-
- internal const int HWND_BROADCAST = 0xffff;
- internal const int WM_SETTINGCHANGE = 0x001A;
+ internal const int REG_BINARY = 3; // Free form binary
+ internal const int REG_DWORD = 4; // 32-bit number
+ internal const int REG_DWORD_LITTLE_ENDIAN = 4; // 32-bit number (same as REG_DWORD)
+ internal const int REG_DWORD_BIG_ENDIAN = 5; // 32-bit number
+ internal const int REG_LINK = 6; // Symbolic Link (unicode)
+ internal const int REG_MULTI_SZ = 7; // Multiple Unicode strings
+ internal const int REG_RESOURCE_LIST = 8; // Resource list in the resource map
+ internal const int REG_FULL_RESOURCE_DESCRIPTOR = 9; // Resource list in the hardware description
+ internal const int REG_RESOURCE_REQUIREMENTS_LIST = 10;
+ internal const int REG_QWORD = 11; // 64-bit number
+
+ internal const int HWND_BROADCAST = 0xffff;
+ internal const int WM_SETTINGCHANGE = 0x001A;
// TimeZone
internal const int TIME_ZONE_ID_INVALID = -1;
@@ -174,7 +175,8 @@ namespace Microsoft.Win32 {
internal const int LOAD_STRING_MAX_LENGTH = 500;
[StructLayout(LayoutKind.Sequential)]
- internal struct SystemTime {
+ internal struct SystemTime
+ {
[MarshalAs(UnmanagedType.U2)]
public short Year;
[MarshalAs(UnmanagedType.U2)]
@@ -194,7 +196,8 @@ namespace Microsoft.Win32 {
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- internal struct TimeZoneInformation {
+ internal struct TimeZoneInformation
+ {
[MarshalAs(UnmanagedType.I4)]
public Int32 Bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
@@ -208,7 +211,8 @@ namespace Microsoft.Win32 {
[MarshalAs(UnmanagedType.I4)]
public Int32 DaylightBias;
- public TimeZoneInformation(Win32Native.DynamicTimeZoneInformation dtzi) {
+ public TimeZoneInformation(Win32Native.DynamicTimeZoneInformation dtzi)
+ {
Bias = dtzi.Bias;
StandardName = dtzi.StandardName;
StandardDate = dtzi.StandardDate;
@@ -221,7 +225,8 @@ namespace Microsoft.Win32 {
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- internal struct DynamicTimeZoneInformation {
+ internal struct DynamicTimeZoneInformation
+ {
[MarshalAs(UnmanagedType.I4)]
public Int32 Bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
@@ -242,7 +247,8 @@ namespace Microsoft.Win32 {
[StructLayout(LayoutKind.Sequential)]
- internal struct RegistryTimeZoneInformation {
+ internal struct RegistryTimeZoneInformation
+ {
[MarshalAs(UnmanagedType.I4)]
public Int32 Bias;
[MarshalAs(UnmanagedType.I4)]
@@ -252,7 +258,8 @@ namespace Microsoft.Win32 {
public SystemTime StandardDate;
public SystemTime DaylightDate;
- public RegistryTimeZoneInformation(Win32Native.TimeZoneInformation tzi) {
+ public RegistryTimeZoneInformation(Win32Native.TimeZoneInformation tzi)
+ {
Bias = tzi.Bias;
StandardDate = tzi.StandardDate;
StandardBias = tzi.StandardBias;
@@ -260,7 +267,8 @@ namespace Microsoft.Win32 {
DaylightBias = tzi.DaylightBias;
}
- public RegistryTimeZoneInformation(Byte[] bytes) {
+ public RegistryTimeZoneInformation(Byte[] bytes)
+ {
//
// typedef struct _REG_TZI_FORMAT {
// [00-03] LONG Bias;
@@ -286,8 +294,9 @@ namespace Microsoft.Win32 {
// [42-43] WORD wMilliseconds;
// } REG_TZI_FORMAT;
//
- if (bytes == null || bytes.Length != 44) {
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidREG_TZI_FORMAT"), nameof(bytes));
+ if (bytes == null || bytes.Length != 44)
+ {
+ throw new ArgumentException(SR.Argument_InvalidREG_TZI_FORMAT, nameof(bytes));
}
Bias = BitConverter.ToInt32(bytes, 0);
StandardBias = BitConverter.ToInt32(bytes, 4);
@@ -317,12 +326,12 @@ namespace Microsoft.Win32 {
// Win32 ACL-related constants:
- internal const int READ_CONTROL = 0x00020000;
- internal const int SYNCHRONIZE = 0x00100000;
+ internal const int READ_CONTROL = 0x00020000;
+ internal const int SYNCHRONIZE = 0x00100000;
+
+ internal const int STANDARD_RIGHTS_READ = READ_CONTROL;
+ internal const int STANDARD_RIGHTS_WRITE = READ_CONTROL;
- internal const int STANDARD_RIGHTS_READ = READ_CONTROL;
- internal const int STANDARD_RIGHTS_WRITE = READ_CONTROL;
-
// STANDARD_RIGHTS_REQUIRED (0x000F0000L)
// SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
@@ -332,18 +341,20 @@ namespace Microsoft.Win32 {
// Note that you may need to specify the SYNCHRONIZE bit as well
// to be able to open a synchronization primitive.
internal const int SEMAPHORE_MODIFY_STATE = 0x00000002;
- internal const int EVENT_MODIFY_STATE = 0x00000002;
- internal const int MUTEX_MODIFY_STATE = 0x00000001;
- internal const int MUTEX_ALL_ACCESS = 0x001F0001;
+ internal const int EVENT_MODIFY_STATE = 0x00000002;
+ internal const int MUTEX_MODIFY_STATE = 0x00000001;
+ internal const int MUTEX_ALL_ACCESS = 0x001F0001;
- internal const int LMEM_FIXED = 0x0000;
+ internal const int LMEM_FIXED = 0x0000;
internal const int LMEM_ZEROINIT = 0x0040;
- internal const int LPTR = (LMEM_FIXED | LMEM_ZEROINIT);
+ internal const int LPTR = (LMEM_FIXED | LMEM_ZEROINIT);
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- internal class OSVERSIONINFO {
- internal OSVERSIONINFO() {
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal class OSVERSIONINFO
+ {
+ internal OSVERSIONINFO()
+ {
OSVersionInfoSize = (int)Marshal.SizeOf(this);
}
@@ -353,14 +364,15 @@ namespace Microsoft.Win32 {
internal int MinorVersion = 0;
internal int BuildNumber = 0;
internal int PlatformId = 0;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
internal String CSDVersion = null;
}
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- internal class OSVERSIONINFOEX {
-
- public OSVERSIONINFOEX() {
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal class OSVERSIONINFOEX
+ {
+ public OSVERSIONINFOEX()
+ {
OSVersionInfoSize = (int)Marshal.SizeOf(this);
}
@@ -370,26 +382,28 @@ namespace Microsoft.Win32 {
internal int MinorVersion = 0;
internal int BuildNumber = 0;
internal int PlatformId = 0;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
internal string CSDVersion = null;
internal ushort ServicePackMajor = 0;
internal ushort ServicePackMinor = 0;
internal short SuiteMask = 0;
internal byte ProductType = 0;
- internal byte Reserved = 0;
+ internal byte Reserved = 0;
}
[StructLayout(LayoutKind.Sequential)]
- internal class SECURITY_ATTRIBUTES {
+ internal class SECURITY_ATTRIBUTES
+ {
internal int nLength = 0;
// don't remove null, or this field will disappear in bcl.small
- internal unsafe byte * pSecurityDescriptor = null;
+ internal unsafe byte* pSecurityDescriptor = null;
internal int bInheritHandle = 0;
}
[Serializable]
[StructLayout(LayoutKind.Sequential)]
- internal struct WIN32_FILE_ATTRIBUTE_DATA {
+ internal struct WIN32_FILE_ATTRIBUTE_DATA
+ {
internal int fileAttributes;
internal uint ftCreationTimeLow;
internal uint ftCreationTimeHigh;
@@ -400,22 +414,24 @@ namespace Microsoft.Win32 {
internal int fileSizeHigh;
internal int fileSizeLow;
- internal void PopulateFrom(WIN32_FIND_DATA findData) {
+ internal void PopulateFrom(WIN32_FIND_DATA findData)
+ {
// Copy the information to data
- fileAttributes = findData.dwFileAttributes;
- ftCreationTimeLow = findData.ftCreationTime_dwLowDateTime;
- ftCreationTimeHigh = findData.ftCreationTime_dwHighDateTime;
- ftLastAccessTimeLow = findData.ftLastAccessTime_dwLowDateTime;
- ftLastAccessTimeHigh = findData.ftLastAccessTime_dwHighDateTime;
- ftLastWriteTimeLow = findData.ftLastWriteTime_dwLowDateTime;
- ftLastWriteTimeHigh = findData.ftLastWriteTime_dwHighDateTime;
- fileSizeHigh = findData.nFileSizeHigh;
- fileSizeLow = findData.nFileSizeLow;
+ fileAttributes = findData.dwFileAttributes;
+ ftCreationTimeLow = findData.ftCreationTime_dwLowDateTime;
+ ftCreationTimeHigh = findData.ftCreationTime_dwHighDateTime;
+ ftLastAccessTimeLow = findData.ftLastAccessTime_dwLowDateTime;
+ ftLastAccessTimeHigh = findData.ftLastAccessTime_dwHighDateTime;
+ ftLastWriteTimeLow = findData.ftLastWriteTime_dwLowDateTime;
+ ftLastWriteTimeHigh = findData.ftLastWriteTime_dwHighDateTime;
+ fileSizeHigh = findData.nFileSizeHigh;
+ fileSizeLow = findData.nFileSizeLow;
}
}
[StructLayout(LayoutKind.Sequential)]
- internal struct MEMORYSTATUSEX {
+ internal struct MEMORYSTATUSEX
+ {
// The length field must be set to the size of this data structure.
internal int length;
internal int memoryLoad;
@@ -429,7 +445,8 @@ namespace Microsoft.Win32 {
}
[StructLayout(LayoutKind.Sequential)]
- internal unsafe struct MEMORY_BASIC_INFORMATION {
+ internal unsafe struct MEMORY_BASIC_INFORMATION
+ {
internal void* BaseAddress;
internal void* AllocationBase;
internal uint AllocationProtect;
@@ -441,10 +458,10 @@ namespace Microsoft.Win32 {
#if !FEATURE_PAL
internal const String KERNEL32 = "kernel32.dll";
- internal const String USER32 = "user32.dll";
- internal const String OLE32 = "ole32.dll";
+ internal const String USER32 = "user32.dll";
+ internal const String OLE32 = "ole32.dll";
internal const String OLEAUT32 = "oleaut32.dll";
- internal const String NTDLL = "ntdll.dll";
+ internal const String NTDLL = "ntdll.dll";
#else //FEATURE_PAL
internal const String KERNEL32 = "libcoreclr";
internal const String USER32 = "libcoreclr";
@@ -453,40 +470,43 @@ namespace Microsoft.Win32 {
internal const String NTDLL = "libcoreclr";
#endif //FEATURE_PAL
internal const String ADVAPI32 = "advapi32.dll";
- internal const String SHELL32 = "shell32.dll";
- internal const String SHIM = "mscoree.dll";
- internal const String CRYPT32 = "crypt32.dll";
- internal const String SECUR32 = "secur32.dll";
+ internal const String SHELL32 = "shell32.dll";
+ internal const String SHIM = "mscoree.dll";
+ internal const String CRYPT32 = "crypt32.dll";
+ internal const String SECUR32 = "secur32.dll";
internal const String MSCORWKS = "coreclr.dll";
// From WinBase.h
internal const int SEM_FAILCRITICALERRORS = 1;
- [DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=true)]
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, BestFitMapping = true)]
internal static extern int FormatMessage(int dwFlags, IntPtr lpSource,
int dwMessageId, int dwLanguageId, [Out]StringBuilder lpBuffer,
int nSize, IntPtr va_list_arguments);
// Gets an error message for a Win32 error code.
- internal static String GetMessage(int errorCode) {
+ internal static String GetMessage(int errorCode)
+ {
StringBuilder sb = StringBuilderCache.Acquire(512);
int result = Win32Native.FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY,
IntPtr.Zero, errorCode, 0, sb, sb.Capacity, IntPtr.Zero);
- if (result != 0) {
+ if (result != 0)
+ {
// result is the # of characters copied to the StringBuilder.
return StringBuilderCache.GetStringAndRelease(sb);
}
- else {
+ else
+ {
StringBuilderCache.Release(sb);
- return Environment.GetResourceString("UnknownError_Num", errorCode);
+ return SR.Format(SR.UnknownError_Num, errorCode);
}
}
- [DllImport(KERNEL32, EntryPoint="LocalAlloc")]
+ [DllImport(KERNEL32, EntryPoint = "LocalAlloc")]
internal static extern IntPtr LocalAlloc_NoSafeHandle(int uFlags, UIntPtr sizetdwBytes);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern IntPtr LocalFree(IntPtr handle);
// MSDN says the length is a SIZE_T.
@@ -499,25 +519,25 @@ namespace Microsoft.Win32 {
return GlobalMemoryStatusExNative(ref buffer);
}
- [DllImport(KERNEL32, SetLastError=true, EntryPoint="GlobalMemoryStatusEx")]
+ [DllImport(KERNEL32, SetLastError = true, EntryPoint = "GlobalMemoryStatusEx")]
private static extern bool GlobalMemoryStatusExNative([In, Out] ref MEMORYSTATUSEX buffer);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
unsafe internal static extern UIntPtr VirtualQuery(void* address, ref MEMORY_BASIC_INFORMATION buffer, UIntPtr sizeOfBuffer);
// VirtualAlloc should generally be avoided, but is needed in
// the MemoryFailPoint implementation (within a CER) to increase the
// size of the page file, ignoring any host memory allocators.
- [DllImport(KERNEL32, SetLastError=true)]
- unsafe internal static extern void * VirtualAlloc(void* address, UIntPtr numBytes, int commitOrReserve, int pageProtectionMode);
+ [DllImport(KERNEL32, SetLastError = true)]
+ unsafe internal static extern void* VirtualAlloc(void* address, UIntPtr numBytes, int commitOrReserve, int pageProtectionMode);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
unsafe internal static extern bool VirtualFree(void* address, UIntPtr numBytes, int pageFreeMode);
- [DllImport(KERNEL32, CharSet=CharSet.Ansi, ExactSpelling=true, EntryPoint="lstrlenA")]
+ [DllImport(KERNEL32, CharSet = CharSet.Ansi, ExactSpelling = true, EntryPoint = "lstrlenA")]
internal static extern int lstrlenA(IntPtr ptr);
- [DllImport(KERNEL32, CharSet=CharSet.Unicode, ExactSpelling=true, EntryPoint="lstrlenW")]
+ [DllImport(KERNEL32, CharSet = CharSet.Unicode, ExactSpelling = true, EntryPoint = "lstrlenW")]
internal static extern int lstrlenW(IntPtr ptr);
[DllImport(Win32Native.OLEAUT32, CharSet = CharSet.Unicode)]
@@ -538,31 +558,31 @@ namespace Microsoft.Win32 {
#endif
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern bool SetEvent(SafeWaitHandle handle);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern bool ResetEvent(SafeWaitHandle handle);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern SafeWaitHandle CreateEvent(SECURITY_ATTRIBUTES lpSecurityAttributes, bool isManualReset, bool initialState, String name);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern SafeWaitHandle OpenEvent(/* DWORD */ int desiredAccess, bool inheritHandle, String name);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern SafeWaitHandle CreateMutex(SECURITY_ATTRIBUTES lpSecurityAttributes, bool initialOwner, String name);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern SafeWaitHandle OpenMutex(/* DWORD */ int desiredAccess, bool inheritHandle, String name);
-
- [DllImport(KERNEL32, SetLastError=true)]
+
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern bool ReleaseMutex(SafeWaitHandle handle);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern bool CloseHandle(IntPtr handle);
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static unsafe extern int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero);
[DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
@@ -576,13 +596,13 @@ namespace Microsoft.Win32 {
internal static extern SafeWaitHandle OpenSemaphore(/* DWORD */ int desiredAccess, bool inheritHandle, String name);
// Will be in winnls.h
- internal const int FIND_STARTSWITH = 0x00100000; // see if value is at the beginning of source
- internal const int FIND_ENDSWITH = 0x00200000; // see if value is at the end of source
- internal const int FIND_FROMSTART = 0x00400000; // look for value in source, starting at the beginning
- internal const int FIND_FROMEND = 0x00800000; // look for value in source, starting at the end
+ internal const int FIND_STARTSWITH = 0x00100000; // see if value is at the beginning of source
+ internal const int FIND_ENDSWITH = 0x00200000; // see if value is at the end of source
+ internal const int FIND_FROMSTART = 0x00400000; // look for value in source, starting at the beginning
+ internal const int FIND_FROMEND = 0x00800000; // look for value in source, starting at the end
[StructLayout(LayoutKind.Sequential)]
- internal struct NlsVersionInfoEx
+ internal struct NlsVersionInfoEx
{
internal int dwNLSVersionInfoSize;
internal int dwNLSVersion;
@@ -591,7 +611,7 @@ namespace Microsoft.Win32 {
internal Guid guidCustomVersion;
}
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]
internal static extern int GetSystemDirectory([Out]StringBuilder sb, int length);
internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // WinBase.h
@@ -601,7 +621,7 @@ namespace Microsoft.Win32 {
internal const int STD_OUTPUT_HANDLE = -11;
internal const int STD_ERROR_HANDLE = -12;
- [DllImport(KERNEL32, SetLastError=true)]
+ [DllImport(KERNEL32, SetLastError = true)]
internal static extern IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one!
// From wincon.h
@@ -621,32 +641,32 @@ namespace Microsoft.Win32 {
internal const int REPLACEFILE_IGNORE_MERGE_ERRORS = 0x2;
private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
- private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
+ private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000;
internal const uint FILE_MAP_WRITE = 0x0002;
internal const uint FILE_MAP_READ = 0x0004;
// Constants from WinNT.h
- internal const int FILE_ATTRIBUTE_READONLY = 0x00000001;
- internal const int FILE_ATTRIBUTE_DIRECTORY = 0x00000010;
+ internal const int FILE_ATTRIBUTE_READONLY = 0x00000001;
+ internal const int FILE_ATTRIBUTE_DIRECTORY = 0x00000010;
internal const int FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400;
internal const int IO_REPARSE_TAG_MOUNT_POINT = unchecked((int)0xA0000003);
internal const int PAGE_READWRITE = 0x04;
- internal const int MEM_COMMIT = 0x1000;
- internal const int MEM_RESERVE = 0x2000;
- internal const int MEM_RELEASE = 0x8000;
- internal const int MEM_FREE = 0x10000;
+ internal const int MEM_COMMIT = 0x1000;
+ internal const int MEM_RESERVE = 0x2000;
+ internal const int MEM_RELEASE = 0x8000;
+ internal const int MEM_FREE = 0x10000;
// Error codes from WinError.h
internal const int ERROR_SUCCESS = 0x0;
internal const int ERROR_INVALID_FUNCTION = 0x1;
internal const int ERROR_FILE_NOT_FOUND = 0x2;
internal const int ERROR_PATH_NOT_FOUND = 0x3;
- internal const int ERROR_ACCESS_DENIED = 0x5;
+ internal const int ERROR_ACCESS_DENIED = 0x5;
internal const int ERROR_INVALID_HANDLE = 0x6;
internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8;
internal const int ERROR_INVALID_DATA = 0xd;
@@ -699,10 +719,10 @@ namespace Microsoft.Win32 {
internal const uint STATUS_INSUFFICIENT_RESOURCES = 0xC000009A;
internal const uint STATUS_ACCESS_DENIED = 0xC0000022;
- internal const int INVALID_FILE_SIZE = -1;
+ internal const int INVALID_FILE_SIZE = -1;
// From WinStatus.h
- internal const int STATUS_ACCOUNT_RESTRICTION = unchecked((int) 0xC000006E);
+ internal const int STATUS_ACCOUNT_RESTRICTION = unchecked((int)0xC000006E);
// Use this to translate error codes like the above into HRESULTs like
// 0x80070006 for ERROR_INVALID_HANDLE
@@ -714,12 +734,13 @@ namespace Microsoft.Win32 {
// Win32 Structs in N/Direct style
[Serializable]
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
[BestFitMapping(false)]
- internal class WIN32_FIND_DATA {
- internal int dwFileAttributes = 0;
+ internal class WIN32_FIND_DATA
+ {
+ internal int dwFileAttributes = 0;
// ftCreationTime was a by-value FILETIME structure
- internal uint ftCreationTime_dwLowDateTime = 0 ;
+ internal uint ftCreationTime_dwLowDateTime = 0;
internal uint ftCreationTime_dwHighDateTime = 0;
// ftLastAccessTime was a by-value FILETIME structure
internal uint ftLastAccessTime_dwLowDateTime = 0;
@@ -727,24 +748,24 @@ namespace Microsoft.Win32 {
// ftLastWriteTime was a by-value FILETIME structure
internal uint ftLastWriteTime_dwLowDateTime = 0;
internal uint ftLastWriteTime_dwHighDateTime = 0;
- internal int nFileSizeHigh = 0;
- internal int nFileSizeLow = 0;
+ internal int nFileSizeHigh = 0;
+ internal int nFileSizeLow = 0;
// If the file attributes' reparse point flag is set, then
// dwReserved0 is the file tag (aka reparse tag) for the
// reparse point. Use this to figure out whether something is
// a volume mount point or a symbolic link.
- internal int dwReserved0 = 0;
- internal int dwReserved1 = 0;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)]
- internal String cFileName = null;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst=14)]
- internal String cAlternateFileName = null;
+ internal int dwReserved0 = 0;
+ internal int dwReserved1 = 0;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
+ internal String cFileName = null;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
+ internal String cAlternateFileName = null;
}
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [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)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern bool FindNextFile(
SafeFindHandle hndFindFile,
[In, Out, MarshalAs(UnmanagedType.LPStruct)]
@@ -756,13 +777,13 @@ namespace Microsoft.Win32 {
[DllImport(KERNEL32, SetLastError = true, ExactSpelling = true)]
internal static extern uint GetCurrentDirectoryW(uint nBufferLength, char[] lpBuffer);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern bool GetFileAttributesEx(String name, int fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation);
- [DllImport(KERNEL32, SetLastError=true, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(KERNEL32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern bool SetCurrentDirectory(String path);
- [DllImport(KERNEL32, SetLastError=false, EntryPoint="SetErrorMode", ExactSpelling=true)]
+ [DllImport(KERNEL32, SetLastError = false, EntryPoint = "SetErrorMode", ExactSpelling = true)]
private static extern int SetErrorMode_VistaAndOlder(int newMode);
// RTM versions of Win7 and Windows Server 2008 R2
@@ -779,24 +800,21 @@ 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);
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]
internal static extern bool SetEnvironmentVariable(string lpName, string lpValue);
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
+
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]
internal static extern int GetEnvironmentVariable(string lpName, [Out]StringBuilder lpValue, int size);
- [DllImport(KERNEL32, CharSet=CharSet.Unicode)]
- internal static unsafe extern char * GetEnvironmentStrings();
+ [DllImport(KERNEL32, CharSet = CharSet.Unicode)]
+ internal static unsafe extern char* GetEnvironmentStrings();
- [DllImport(KERNEL32, CharSet=CharSet.Unicode)]
- internal static unsafe extern bool FreeEnvironmentStrings(char * pStrings);
+ [DllImport(KERNEL32, CharSet = CharSet.Unicode)]
+ internal static unsafe extern bool FreeEnvironmentStrings(char* pStrings);
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true)]
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true)]
internal static extern uint GetCurrentProcessId();
- [DllImport(KERNEL32, CharSet=CharSet.Auto, BestFitMapping=false)]
- internal extern static int GetComputerName([Out]StringBuilder nameBuffer, ref int bufferSize);
-
[DllImport(OLE32)]
internal extern static int CoCreateGuid(out Guid guid);
@@ -810,148 +828,150 @@ namespace Microsoft.Win32 {
internal static extern IntPtr CoTaskMemRealloc(IntPtr pv, UIntPtr cb);
#if FEATURE_WIN32_REGISTRY
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegDeleteValue(SafeRegistryHandle hKey, String lpValueName);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal unsafe static extern int RegEnumKeyEx(SafeRegistryHandle hKey, int dwIndex,
- char *lpName, ref int lpcbName, int[] lpReserved,
+ char[] lpName, ref int lpcbName, int[] lpReserved,
[Out]StringBuilder lpClass, int[] lpcbClass,
long[] lpftLastWriteTime);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal unsafe static extern int RegEnumValue(SafeRegistryHandle hKey, int dwIndex,
- char *lpValueName, ref int lpcbValueName,
+ char[] lpValueName, ref int lpcbValueName,
IntPtr lpReserved_MustBeZero, int[] lpType, byte[] lpData,
int[] lpcbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [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)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegQueryInfoKey(SafeRegistryHandle hKey, [Out]StringBuilder lpClass,
int[] lpcbClass, IntPtr lpReserved_MustBeZero, ref int lpcSubKeys,
int[] lpcbMaxSubKeyLen, int[] lpcbMaxClassLen,
ref int lpcValues, int[] lpcbMaxValueNameLen,
int[] lpcbMaxValueLen, int[] lpcbSecurityDescriptor,
int[] lpftLastWriteTime);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegQueryValueEx(SafeRegistryHandle hKey, String lpValueName,
int[] lpReserved, ref int lpType, [Out] byte[] lpData,
ref int lpcbData);
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegQueryValueEx(SafeRegistryHandle hKey, String lpValueName,
int[] lpReserved, ref int lpType, ref int lpData,
ref int lpcbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegQueryValueEx(SafeRegistryHandle hKey, String lpValueName,
int[] lpReserved, ref int lpType, ref long lpData,
ref int lpcbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegQueryValueEx(SafeRegistryHandle hKey, String lpValueName,
- int[] lpReserved, ref int lpType, [Out] char[] lpData,
+ int[] lpReserved, ref int lpType, [Out] char[] lpData,
ref int lpcbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegSetValueEx(SafeRegistryHandle hKey, String lpValueName,
int Reserved, RegistryValueKind dwType, byte[] lpData, int cbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegSetValueEx(SafeRegistryHandle hKey, String lpValueName,
int Reserved, RegistryValueKind dwType, ref int lpData, int cbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegSetValueEx(SafeRegistryHandle hKey, String lpValueName,
int Reserved, RegistryValueKind dwType, ref long lpData, int cbData);
-
- [DllImport(ADVAPI32, CharSet=CharSet.Auto, BestFitMapping=false)]
+
+ [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)]
internal static extern int RegSetValueEx(SafeRegistryHandle hKey, String lpValueName,
int Reserved, RegistryValueKind dwType, String lpData, int cbData);
#endif // FEATURE_WIN32_REGISTRY
-
- [DllImport(KERNEL32, CharSet=CharSet.Auto, SetLastError=true, BestFitMapping=false)]
+
+ [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]
internal static extern int ExpandEnvironmentStrings(String lpSrc, [Out]StringBuilder lpDst, int nSize);
[DllImport(KERNEL32)]
internal static extern IntPtr LocalReAlloc(IntPtr handle, IntPtr sizetcbBytes, int uFlags);
- internal const int SHGFP_TYPE_CURRENT = 0; // the current (user) folder path setting
- internal const int UOI_FLAGS = 1;
- internal const int WSF_VISIBLE = 1;
+ internal const int SHGFP_TYPE_CURRENT = 0; // the current (user) folder path setting
+ internal const int UOI_FLAGS = 1;
+ internal const int WSF_VISIBLE = 1;
// .NET Framework 4.0 and newer - all versions of windows ||| \public\sdk\inc\shlobj.h
- internal const int CSIDL_FLAG_CREATE = 0x8000; // force folder creation in SHGetFolderPath
- internal const int CSIDL_FLAG_DONT_VERIFY = 0x4000; // return an unverified folder path
- internal const int CSIDL_ADMINTOOLS = 0x0030; // <user name>\Start Menu\Programs\Administrative Tools
- internal const int CSIDL_CDBURN_AREA = 0x003b; // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
- internal const int CSIDL_COMMON_ADMINTOOLS = 0x002f; // All Users\Start Menu\Programs\Administrative Tools
- internal const int CSIDL_COMMON_DOCUMENTS = 0x002e; // All Users\Documents
- internal const int CSIDL_COMMON_MUSIC = 0x0035; // All Users\My Music
- internal const int CSIDL_COMMON_OEM_LINKS = 0x003a; // Links to All Users OEM specific apps
- internal const int CSIDL_COMMON_PICTURES = 0x0036; // All Users\My Pictures
- internal const int CSIDL_COMMON_STARTMENU = 0x0016; // All Users\Start Menu
- internal const int CSIDL_COMMON_PROGRAMS = 0X0017; // All Users\Start Menu\Programs
- internal const int CSIDL_COMMON_STARTUP = 0x0018; // All Users\Startup
- internal const int CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019; // All Users\Desktop
- internal const int CSIDL_COMMON_TEMPLATES = 0x002d; // All Users\Templates
- internal const int CSIDL_COMMON_VIDEO = 0x0037; // All Users\My Video
- internal const int CSIDL_FONTS = 0x0014; // windows\fonts
- internal const int CSIDL_MYVIDEO = 0x000e; // "My Videos" folder
- internal const int CSIDL_NETHOOD = 0x0013; // %APPDATA%\Microsoft\Windows\Network Shortcuts
- internal const int CSIDL_PRINTHOOD = 0x001b; // %APPDATA%\Microsoft\Windows\Printer Shortcuts
- internal const int CSIDL_PROFILE = 0x0028; // %USERPROFILE% (%SystemDrive%\Users\%USERNAME%)
- internal const int CSIDL_PROGRAM_FILES_COMMONX86 = 0x002c; // x86 Program Files\Common on RISC
- internal const int CSIDL_PROGRAM_FILESX86 = 0x002a; // x86 C:\Program Files on RISC
- internal const int CSIDL_RESOURCES = 0x0038; // %windir%\Resources
- internal const int CSIDL_RESOURCES_LOCALIZED = 0x0039; // %windir%\resources\0409 (code page)
- internal const int CSIDL_SYSTEMX86 = 0x0029; // %windir%\system32
- internal const int CSIDL_WINDOWS = 0x0024; // GetWindowsDirectory()
+ internal const int CSIDL_FLAG_CREATE = 0x8000; // force folder creation in SHGetFolderPath
+ internal const int CSIDL_FLAG_DONT_VERIFY = 0x4000; // return an unverified folder path
+ internal const int CSIDL_ADMINTOOLS = 0x0030; // <user name>\Start Menu\Programs\Administrative Tools
+ internal const int CSIDL_CDBURN_AREA = 0x003b; // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
+ internal const int CSIDL_COMMON_ADMINTOOLS = 0x002f; // All Users\Start Menu\Programs\Administrative Tools
+ internal const int CSIDL_COMMON_DOCUMENTS = 0x002e; // All Users\Documents
+ internal const int CSIDL_COMMON_MUSIC = 0x0035; // All Users\My Music
+ internal const int CSIDL_COMMON_OEM_LINKS = 0x003a; // Links to All Users OEM specific apps
+ internal const int CSIDL_COMMON_PICTURES = 0x0036; // All Users\My Pictures
+ internal const int CSIDL_COMMON_STARTMENU = 0x0016; // All Users\Start Menu
+ internal const int CSIDL_COMMON_PROGRAMS = 0X0017; // All Users\Start Menu\Programs
+ internal const int CSIDL_COMMON_STARTUP = 0x0018; // All Users\Startup
+ internal const int CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019; // All Users\Desktop
+ internal const int CSIDL_COMMON_TEMPLATES = 0x002d; // All Users\Templates
+ internal const int CSIDL_COMMON_VIDEO = 0x0037; // All Users\My Video
+ internal const int CSIDL_FONTS = 0x0014; // windows\fonts
+ internal const int CSIDL_MYVIDEO = 0x000e; // "My Videos" folder
+ internal const int CSIDL_NETHOOD = 0x0013; // %APPDATA%\Microsoft\Windows\Network Shortcuts
+ internal const int CSIDL_PRINTHOOD = 0x001b; // %APPDATA%\Microsoft\Windows\Printer Shortcuts
+ internal const int CSIDL_PROFILE = 0x0028; // %USERPROFILE% (%SystemDrive%\Users\%USERNAME%)
+ internal const int CSIDL_PROGRAM_FILES_COMMONX86 = 0x002c; // x86 Program Files\Common on RISC
+ internal const int CSIDL_PROGRAM_FILESX86 = 0x002a; // x86 C:\Program Files on RISC
+ internal const int CSIDL_RESOURCES = 0x0038; // %windir%\Resources
+ internal const int CSIDL_RESOURCES_LOCALIZED = 0x0039; // %windir%\resources\0409 (code page)
+ internal const int CSIDL_SYSTEMX86 = 0x0029; // %windir%\system32
+ internal const int CSIDL_WINDOWS = 0x0024; // GetWindowsDirectory()
// .NET Framework 3.5 and earlier - all versions of windows
- internal const int CSIDL_APPDATA = 0x001a;
- internal const int CSIDL_COMMON_APPDATA = 0x0023;
- internal const int CSIDL_LOCAL_APPDATA = 0x001c;
- internal const int CSIDL_COOKIES = 0x0021;
- internal const int CSIDL_FAVORITES = 0x0006;
- internal const int CSIDL_HISTORY = 0x0022;
- internal const int CSIDL_INTERNET_CACHE = 0x0020;
- internal const int CSIDL_PROGRAMS = 0x0002;
- internal const int CSIDL_RECENT = 0x0008;
- internal const int CSIDL_SENDTO = 0x0009;
- internal const int CSIDL_STARTMENU = 0x000b;
- internal const int CSIDL_STARTUP = 0x0007;
- internal const int CSIDL_SYSTEM = 0x0025;
- internal const int CSIDL_TEMPLATES = 0x0015;
- internal const int CSIDL_DESKTOPDIRECTORY = 0x0010;
- internal const int CSIDL_PERSONAL = 0x0005;
- internal const int CSIDL_PROGRAM_FILES = 0x0026;
- internal const int CSIDL_PROGRAM_FILES_COMMON = 0x002b;
- internal const int CSIDL_DESKTOP = 0x0000;
- internal const int CSIDL_DRIVES = 0x0011;
- internal const int CSIDL_MYMUSIC = 0x000d;
- internal const int CSIDL_MYPICTURES = 0x0027;
+ internal const int CSIDL_APPDATA = 0x001a;
+ internal const int CSIDL_COMMON_APPDATA = 0x0023;
+ internal const int CSIDL_LOCAL_APPDATA = 0x001c;
+ internal const int CSIDL_COOKIES = 0x0021;
+ internal const int CSIDL_FAVORITES = 0x0006;
+ internal const int CSIDL_HISTORY = 0x0022;
+ internal const int CSIDL_INTERNET_CACHE = 0x0020;
+ internal const int CSIDL_PROGRAMS = 0x0002;
+ internal const int CSIDL_RECENT = 0x0008;
+ internal const int CSIDL_SENDTO = 0x0009;
+ internal const int CSIDL_STARTMENU = 0x000b;
+ internal const int CSIDL_STARTUP = 0x0007;
+ internal const int CSIDL_SYSTEM = 0x0025;
+ internal const int CSIDL_TEMPLATES = 0x0015;
+ internal const int CSIDL_DESKTOPDIRECTORY = 0x0010;
+ internal const int CSIDL_PERSONAL = 0x0005;
+ internal const int CSIDL_PROGRAM_FILES = 0x0026;
+ internal const int CSIDL_PROGRAM_FILES_COMMON = 0x002b;
+ internal const int CSIDL_DESKTOP = 0x0000;
+ internal const int CSIDL_DRIVES = 0x0011;
+ internal const int CSIDL_MYMUSIC = 0x000d;
+ internal const int CSIDL_MYPICTURES = 0x0027;
internal const int NameSamCompatible = 2;
- [DllImport(USER32, SetLastError=true, BestFitMapping=false)]
+ [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, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal extern static bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime);
-#if FEATURE_PAL
- [DllImport(KERNEL32, EntryPoint = "PAL_Random")]
- internal extern static bool Random(bool bStrong,
- [Out, MarshalAs(UnmanagedType.LPArray)] byte[] buffer, int length);
-#else
- private const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002;
-#endif
+ internal const byte VER_GREATER_EQUAL = 0x3;
+ internal const uint VER_MAJORVERSION = 0x0000002;
+ internal const uint VER_MINORVERSION = 0x0000001;
+ internal const uint VER_SERVICEPACKMAJOR = 0x0000020;
+ internal const uint VER_SERVICEPACKMINOR = 0x0000010;
+ [DllImport("kernel32.dll")]
+ internal static extern bool VerifyVersionInfoW([In, Out] OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask);
+ [DllImport("kernel32.dll")]
+ internal static extern ulong VerSetConditionMask(ulong dwlConditionMask, uint dwTypeBitMask, byte dwConditionMask);
}
}
diff --git a/src/mscorlib/src/System.Private.CoreLib.txt b/src/mscorlib/src/System.Private.CoreLib.txt
deleted file mode 100644
index b4e9e297d9..0000000000
--- a/src/mscorlib/src/System.Private.CoreLib.txt
+++ /dev/null
@@ -1,2235 +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.
-
-; These are the managed resources for mscorlib.dll.
-; See those first three bytes in the file? This is in UTF-8. Leave the
-; Unicode byte order mark (U+FEFF) written in UTF-8 at the start of this file.
-
-; For resource info, see the ResourceManager documentation and the ResGen tool,
-; which is a managed app using ResourceWriter.
-; ResGen now supports limited preprocessing of txt files, you can use
-; #if SYMBOL and #if !SYMBOL to control what sets of resources are included in
-; the resulting resources.
-
-; The naming scheme is: [Namespace.] ExceptionName _ Reason
-; We'll suppress "System." where possible.
-; Examples:
-; Argument_Null
-; Reflection.TargetInvokation_someReason
-
-; Usage Notes:
-; * Keep exceptions in alphabetical order by package
-; * A single space may exist on either side of the equal sign.
-; * Follow the naming conventions.
-; * Any lines starting with a '#' or ';' are ignored
-; * Equal signs aren't legal characters for keys, but may occur in values.
-; * Correctly punctuate all sentences. Most resources should end in a period.
-; Remember, your mother will probably read some of these messages.
-; * You may use " (quote), \n and \t. Use \\ for a single '\' character.
-; * String inserts work. i.e., BadNumber_File = Wrong number in file "{0}".
-
-; Real words, used by code like Environment.StackTrace
-#if INCLUDE_RUNTIME
-Word_At = at
-StackTrace_InFileLineNumber = in {0}:line {1}
-UnknownError_Num = Unknown error "{0}".
-AllocatedFrom = Allocated from:
-
-; Note this one is special, used as a divider between stack traces!
-Exception_EndOfInnerExceptionStack = --- End of inner exception stack trace ---
-Exception_WasThrown = Exception of type '{0}' was thrown.
-
-; The following are used in the implementation of ExceptionDispatchInfo
-Exception_EndStackTraceFromPreviousThrow = --- End of stack trace from previous location where exception was thrown ---
-
-Arg_ParamName_Name = Parameter name: {0}
-ArgumentOutOfRange_ActualValue = Actual value was {0}.
-
-NoDebugResources = [{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version={2}&File={3}&Key={4}
-#endif // INCLUDE_RUNTIME
-
-#if INCLUDE_DEBUG
-
-; For code contracts
-AssumptionFailed = Assumption failed.
-AssumptionFailed_Cnd = Assumption failed: {0}
-AssertionFailed = Assertion failed.
-AssertionFailed_Cnd = Assertion failed: {0}
-PreconditionFailed = Precondition failed.
-PreconditionFailed_Cnd = Precondition failed: {0}
-PostconditionFailed = Postcondition failed.
-PostconditionFailed_Cnd = Postcondition failed: {0}
-PostconditionOnExceptionFailed = Postcondition failed after throwing an exception.
-PostconditionOnExceptionFailed_Cnd = Postcondition failed after throwing an exception: {0}
-InvariantFailed = Invariant failed.
-InvariantFailed_Cnd = Invariant failed: {0}
-MustUseCCRewrite = An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.
-
-; Identity Reference Library
-#if FEATURE_IDENTITY_REFERENCE
-IdentityReference_IdentityNotMapped = Some or all identity references could not be translated.
-IdentityReference_MustBeIdentityReference = The targetType parameter must be of IdentityReference type.
-IdentityReference_AccountNameTooLong = Account name is too long.
-IdentityReference_DomainNameTooLong = Domain name is too long.
-IdentityReference_InvalidNumberOfSubauthorities = The number of sub-authorities must not exceed {0}.
-IdentityReference_IdentifierAuthorityTooLarge = The size of the identifier authority must not exceed 6 bytes.
-IdentityReference_InvalidSidRevision = SIDs with revision other than '1' are not supported.
-IdentityReference_CannotCreateLogonIdsSid = Well-known SIDs of type LogonIdsSid cannot be created.
-IdentityReference_DomainSidRequired = The domainSid parameter must be specified for creating well-known SID of type {0}.
-IdentityReference_NotAWindowsDomain = The domainSid parameter is not a valid Windows domain SID.
-#endif // FEATURE_IDENTITY_REFERENCE
-
-; AccessException
-Acc_CreateGeneric = Cannot create a type for which Type.ContainsGenericParameters is true.
-Acc_CreateAbst = Cannot create an abstract class.
-Acc_CreateInterface = Cannot create an instance of an interface.
-Acc_NotClassInit = Type initializer was not callable.
-Acc_CreateGenericEx = Cannot create an instance of {0} because Type.ContainsGenericParameters is true.
-Acc_CreateArgIterator = Cannot dynamically create an instance of ArgIterator.
-Acc_CreateAbstEx = Cannot create an instance of {0} because it is an abstract class.
-Acc_CreateInterfaceEx = Cannot create an instance of {0} because it is an interface.
-Acc_CreateVoid = Cannot dynamically create an instance of System.Void.
-Acc_ReadOnly = Cannot set a constant field.
-Acc_RvaStatic = SkipVerification permission is needed to modify an image-based (RVA) static field.
-Access_Void = Cannot create an instance of void.
-
-; ArgumentException
-Arg_TypedReference_Null = The TypedReference must be initialized.
-Argument_AddingDuplicate__ = Item has already been added. Key in dictionary: '{0}' Key being added: '{1}'
-Argument_AddingDuplicate = An item with the same key has already been added.
-Argument_AddingDuplicateWithKey = An item with the same key has already been added. Key: {0}
-Argument_MethodDeclaringTypeGenericLcg = Method '{0}' has a generic declaring type '{1}'. Explicitly provide the declaring type to GetTokenFor.
-Argument_MethodDeclaringTypeGeneric = Cannot resolve method {0} because the declaring type of the method handle {1} is generic. Explicitly provide the declaring type to GetMethodFromHandle.
-Argument_FieldDeclaringTypeGeneric = Cannot resolve field {0} because the declaring type of the field handle {1} is generic. Explicitly provide the declaring type to GetFieldFromHandle.
-Argument_ApplicationTrustShouldHaveIdentity = An ApplicationTrust must have an application identity before it can be persisted.
-Argument_ConversionOverflow = Conversion buffer overflow.
-Argument_CodepageNotSupported = {0} is not a supported code page.
-Argument_CultureNotSupported = Culture is not supported.
-Argument_CultureInvalidIdentifier = {0} is an invalid culture identifier.
-Argument_OneOfCulturesNotSupported = Culture name {0} or {1} is not supported.
-Argument_CultureIetfNotSupported = Culture IETF Name {0} is not a recognized IETF name.
-Argument_CultureIsNeutral = Culture ID {0} (0x{0:X4}) is a neutral culture; a region cannot be created from it.
-Argument_InvalidNeutralRegionName = The region name {0} should not correspond to neutral culture; a specific culture name is required.
-Argument_InvalidGenericInstArray = Generic arguments must be provided for each generic parameter and each generic argument must be a RuntimeType.
-Argument_GenericArgsCount = The number of generic arguments provided doesn't equal the arity of the generic type definition.
-Argument_CultureInvalidFormat = Culture '{0}' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.
-Argument_CompareOptionOrdinal = CompareOption.Ordinal cannot be used with other options.
-Argument_CustomCultureCannotBePassedByNumber = Customized cultures cannot be passed by LCID, only by name.
-Argument_EncodingConversionOverflowChars = The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'.
-Argument_EncodingConversionOverflowBytes = The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'.
-Argument_EncoderFallbackNotEmpty = Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'.
-Argument_EmptyFileName = Empty file name is not legal.
-Argument_EmptyPath = Empty path name is not legal.
-Argument_EmptyName = Empty name is not legal.
-Argument_ImplementIComparable = At least one object must implement IComparable.
-Argument_InvalidType = The type of arguments passed into generic comparer methods is invalid.
-Argument_InvalidTypeForCA=Cannot build type parameter for custom attribute with a type that does not support the AssemblyQualifiedName property. The type instance supplied was of type '{0}'.
-Argument_IllegalEnvVarName = Environment variable name cannot contain equal character.
-Argument_IllegalAppId = Application identity does not have same number of components as manifest paths.
-Argument_IllegalAppBase = The application base specified is not valid.
-Argument_UnableToParseManifest = Unexpected error while parsing the specified manifest.
-Argument_IllegalAppIdMismatch = Application identity does not match identities in manifests.
-Argument_InvalidAppId = Invalid identity: no deployment or application identity specified.
-Argument_InvalidGenericArg = The generic type parameter was not valid
-Argument_InvalidArrayLength = Length of the array must be {0}.
-Argument_InvalidArrayType = Target array type is not compatible with the type of items in the collection.
-Argument_InvalidAppendMode = Append access can be requested only in write-only mode.
-Argument_InvalidEnumValue = The value '{0}' is not valid for this usage of the type {1}.
-Argument_EnumIsNotIntOrShort = The underlying type of enum argument must be Int32 or Int16.
-Argument_InvalidEnum = The Enum type should contain one and only one instance field.
-Argument_InvalidKeyStore = '{0}' is not a valid KeyStore name.
-Argument_InvalidFileMode&AccessCombo = Combining FileMode: {0} with FileAccess: {1} is invalid.
-Argument_InvalidFileMode&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid.
-Argument_InvalidFileModeTruncate&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid. FileMode.Truncate is valid only when used with FileSystemRights.Write.
-Argument_InvalidFlag = Value of flags is invalid.
-Argument_InvalidAnyFlag = No flags can be set.
-Argument_InvalidHandle = The handle is invalid.
-Argument_InvalidRegistryKeyPermissionCheck = The specified RegistryKeyPermissionCheck value is invalid.
-Argument_InvalidRegistryOptionsCheck = The specified RegistryOptions value is invalid.
-Argument_InvalidRegistryViewCheck = The specified RegistryView value is invalid.
-Argument_InvalidSubPath = The directory specified, '{0}', is not a subdirectory of '{1}'.
-Argument_NoRegionInvariantCulture = There is no region associated with the Invariant Culture (Culture ID: 0x7F).
-Argument_ResultCalendarRange = The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.
-Argument_ResultIslamicCalendarRange = The date is out of the supported range for the Islamic calendar. The date should be greater than July 18th, 622 AD (Gregorian date).
-Argument_NeverValidGenericArgument = The type '{0}' may not be used as a type argument.
-Argument_NotEnoughGenArguments = The type or method has {1} generic parameter(s), but {0} generic argument(s) were provided. A generic argument must be provided for each generic parameter.
-Argument_NullFullTrustAssembly = A null StrongName was found in the full trust assembly list.
-Argument_GenConstraintViolation = GenericArguments[{0}], '{1}', on '{2}' violates the constraint of type '{3}'.
-Argument_InvalidToken = Token {0:x} is not valid in the scope of module {1}.
-Argument_InvalidTypeToken = Token {0:x} is not a valid Type token.
-Argument_ResolveType = Token {0:x} is not a valid Type token in the scope of module {1}.
-Argument_ResolveMethod = Token {0:x} is not a valid MethodBase token in the scope of module {1}.
-Argument_ResolveField = Token {0:x} is not a valid FieldInfo token in the scope of module {1}.
-Argument_ResolveMember = Token {0:x} is not a valid MemberInfo token in the scope of module {1}.
-Argument_ResolveString = Token {0:x} is not a valid string token in the scope of module {1}.
-Argument_ResolveModuleType = Token {0} resolves to the special module type representing this module.
-Argument_ResolveMethodHandle = Type handle '{0}' and method handle with declaring type '{1}' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase.
-Argument_ResolveFieldHandle = Type handle '{0}' and field handle with declaring type '{1}' are incompatible. Get RuntimeFieldHandle and declaring RuntimeTypeHandle off the same FieldInfo.
-Argument_ResourceScopeWrongDirection = Resource type in the ResourceScope enum is going from a more restrictive resource type to a more general one. From: "{0}" To: "{1}"
-Argument_BadResourceScopeTypeBits = Unknown value for the ResourceScope: {0} Too many resource type bits may be set.
-Argument_BadResourceScopeVisibilityBits = Unknown value for the ResourceScope: {0} Too many resource visibility bits may be set.
-Argument_WaitHandleNameTooLong = The name can be no more than {0} characters in length.
-Argument_EnumTypeDoesNotMatch = The argument type, '{0}', is not the same as the enum type '{1}'.
-InvalidOperation_MethodBuilderBaked = The signature of the MethodBuilder can no longer be modified because an operation on the MethodBuilder caused the methodDef token to be created. For example, a call to SetCustomAttribute requires the methodDef token to emit the CustomAttribute token.
-InvalidOperation_GenericParametersAlreadySet = The generic parameters are already defined on this MethodBuilder.
-Arg_AccessException = Cannot access member.
-Arg_AppDomainUnloadedException = Attempted to access an unloaded AppDomain.
-Arg_ApplicationException = Error in the application.
-Arg_ArgumentOutOfRangeException = Specified argument was out of the range of valid values.
-Arg_ArithmeticException = Overflow or underflow in the arithmetic operation.
-Arg_ArrayLengthsDiffer = Array lengths must be the same.
-Arg_ArrayPlusOffTooSmall = Destination array is not long enough to copy all the items in the collection. Check array index and length.
-Arg_ArrayTypeMismatchException = Attempted to access an element as a type incompatible with the array.
-Arg_BadDecimal = Read an invalid decimal value from the buffer.
-Arg_BadImageFormatException = Format of the executable (.exe) or library (.dll) is invalid.
-Argument_BadImageFormatExceptionResolve = A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context.
-Arg_BufferTooSmall = Not enough space available in the buffer.
-Arg_CATypeResolutionFailed = Failed to resolve type from string "{0}" which was embedded in custom attribute blob.
-Arg_CannotHaveNegativeValue = String cannot contain a minus sign if the base is not 10.
-Arg_CannotUnloadAppDomainException = Attempt to unload the AppDomain failed.
-Arg_CannotMixComparisonInfrastructure = The usage of IKeyComparer and IHashCodeProvider/IComparer interfaces cannot be mixed; use one or the other.
-Arg_ContextMarshalException = Attempted to marshal an object across a context boundary.
-Arg_DataMisalignedException = A datatype misalignment was detected in a load or store instruction.
-Arg_DevicesNotSupported = FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\\\.\\" in the path.
-Arg_DuplicateWaitObjectException = Duplicate objects in argument.
-Arg_EntryPointNotFoundException = Entry point was not found.
-Arg_DllNotFoundException = Dll was not found.
-Arg_ExecutionEngineException = Internal error in the runtime.
-Arg_FieldAccessException = Attempted to access a field that is not accessible by the caller.
-Arg_FileIsDirectory_Name = The target file "{0}" is a directory, not a file.
-Arg_FormatException = One of the identified items was in an invalid format.
-Arg_IndexOutOfRangeException = Index was outside the bounds of the array.
-Arg_InsufficientExecutionStackException = Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.
-Arg_InvalidCastException = Specified cast is not valid.
-Arg_InvalidOperationException = Operation is not valid due to the current state of the object.
-Arg_CorruptedCustomCultureFile = The file of the custom culture {0} is corrupt. Try to unregister this culture.
-Arg_InvokeMember = InvokeMember can be used only for COM objects.
-Arg_InvalidNeutralResourcesLanguage_Asm_Culture = The NeutralResourcesLanguageAttribute on the assembly "{0}" specifies an invalid culture name: "{1}".
-Arg_InvalidNeutralResourcesLanguage_FallbackLoc = The NeutralResourcesLanguageAttribute specifies an invalid or unrecognized ultimate resource fallback location: "{0}".
-Arg_InvalidSatelliteContract_Asm_Ver = Satellite contract version attribute on the assembly '{0}' specifies an invalid version: {1}.
-Arg_MethodAccessException = Attempt to access the method failed.
-Arg_MethodAccessException_WithMethodName = Attempt to access the method "{0}" on type "{1}" failed.
-Arg_MethodAccessException_WithCaller = Attempt by security transparent method '{0}' to access security critical method '{1}' failed.
-Arg_MissingFieldException = Attempted to access a non-existing field.
-Arg_MissingMemberException = Attempted to access a missing member.
-Arg_MissingMethodException = Attempted to access a missing method.
-Arg_MulticastNotSupportedException = Attempted to add multiple callbacks to a delegate that does not support multicast.
-Arg_NotFiniteNumberException = Number encountered was not a finite quantity.
-Arg_NotSupportedException = Specified method is not supported.
-Arg_UnboundGenParam = Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.
-Arg_UnboundGenField = Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.
-Arg_NotGenericParameter = Method may only be called on a Type for which Type.IsGenericParameter is true.
-Arg_GenericParameter = Method must be called on a Type for which Type.IsGenericParameter is false.
-Arg_NotGenericTypeDefinition = {0} is not a GenericTypeDefinition. MakeGenericType may only be called on a type for which Type.IsGenericTypeDefinition is true.
-Arg_NotGenericMethodDefinition = {0} is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.
-Arg_BadLiteralFormat = Encountered an invalid type for a default value.
-Arg_MissingActivationArguments = The AppDomainSetup must specify the activation arguments for this call.
-Argument_BadParameterTypeForCAB = Cannot emit a CustomAttribute with argument of type {0}.
-Argument_InvalidMemberForNamedArgument = The member must be either a field or a property.
-Argument_InvalidTypeName = The name of the type is invalid.
-
-; Note - don't change the NullReferenceException default message. This was
-; negotiated carefully with the VB team to avoid saying "null" or "nothing".
-Arg_NullReferenceException = Object reference not set to an instance of an object.
-
-Arg_AccessViolationException = Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
-Arg_OverflowException = Arithmetic operation resulted in an overflow.
-Arg_PathGlobalRoot = Paths that begin with \\\\?\\GlobalRoot are internal to the kernel and should not be opened by managed applications.
-Arg_PathIllegal = The path is not of a legal form.
-Arg_PathIllegalUNC = The UNC path should be of the form \\\\server\\share.
-Arg_RankException = Attempted to operate on an array with the incorrect number of dimensions.
-Arg_RankMultiDimNotSupported = Only single dimensional arrays are supported for the requested action.
-Arg_NonZeroLowerBound = The lower bound of target array must be zero.
-Arg_RegSubKeyValueAbsent = No value exists with that name.
-Arg_ResourceFileUnsupportedVersion = The ResourceReader class does not know how to read this version of .resources files. Expected version: {0} This file: {1}
-Arg_ResourceNameNotExist = The specified resource name "{0}" does not exist in the resource file.
-Arg_SecurityException = Security error.
-Arg_SerializationException = Serialization error.
-Arg_StackOverflowException = Operation caused a stack overflow.
-Arg_SurrogatesNotAllowedAsSingleChar = Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead.
-Arg_SynchronizationLockException = Object synchronization method was called from an unsynchronized block of code.
-Arg_RWLockRestoreException = ReaderWriterLock.RestoreLock was called without releasing all locks acquired since the call to ReleaseLock.
-Arg_SystemException = System error.
-Arg_TimeoutException = The operation has timed out.
-Arg_UnauthorizedAccessException = Attempted to perform an unauthorized operation.
-Arg_ArgumentException = Value does not fall within the expected range.
-Arg_DirectoryNotFoundException = Attempted to access a path that is not on the disk.
-Arg_DriveNotFoundException = Attempted to access a drive that is not available.
-Arg_EndOfStreamException = Attempted to read past the end of the stream.
-Arg_HexStyleNotSupported = The number style AllowHexSpecifier is not supported on floating point data types.
-Arg_IOException = I/O error occurred.
-Arg_InvalidHexStyle = With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.
-Arg_KeyNotFound = The given key was not present in the dictionary.
-Argument_InvalidNumberStyles = An undefined NumberStyles value is being used.
-Argument_InvalidDateTimeStyles = An undefined DateTimeStyles value is being used.
-Argument_InvalidTimeSpanStyles = An undefined TimeSpanStyles value is being used.
-Argument_DateTimeOffsetInvalidDateTimeStyles = The DateTimeStyles value 'NoCurrentDateDefault' is not allowed when parsing DateTimeOffset.
-Argument_NativeResourceAlreadyDefined = Native resource has already been defined.
-Argument_BadObjRef = Invalid ObjRef provided to '{0}'.
-Argument_InvalidCultureName = Culture name '{0}' is not supported.
-Argument_NameTooLong = The name '{0}' is too long to be a Culture or Region name, which is limited to {1} characters.
-Argument_NameContainsInvalidCharacters = The name '{0}' contains characters that are not valid for a Culture or Region.
-Argument_InvalidRegionName = Region name '{0}' is not supported.
-Argument_CannotCreateTypedReference = Cannot use function evaluation to create a TypedReference object.
-Arg_ArrayZeroError = Array must not be of length zero.
-Arg_BogusIComparer = Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: '{0}'.
-Arg_CreatInstAccess = Cannot specify both CreateInstance and another access type.
-Arg_CryptographyException = Error occurred during a cryptographic operation.
-Arg_DateTimeRange = Combination of arguments to the DateTime constructor is out of the legal range.
-Arg_DecBitCtor = Decimal byte array constructor requires an array of length four containing valid decimal bytes.
-Arg_DlgtTargMeth = Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.
-Arg_DlgtTypeMis = Delegates must be of the same type.
-Arg_DlgtNullInst = Delegate to an instance method cannot have null 'this'.
-Arg_DllInitFailure = One machine may not have remote administration enabled, or both machines may not be running the remote registry service.
-Arg_EmptyArray = Array may not be empty.
-Arg_EmptyOrNullArray = Array may not be empty or null.
-Arg_EmptyCollection = Collection must not be empty.
-Arg_EmptyOrNullString = String may not be empty or null.
-Argument_ItemNotExist = The specified item does not exist in this KeyedCollection.
-Argument_EncodingNotSupported = '{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
-Argument_FallbackBufferNotEmpty = Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer.
-Argument_InvalidCodePageConversionIndex = Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page.
-Argument_InvalidCodePageBytesIndex = Unable to translate bytes {0} at index {1} from specified code page to Unicode.
-Argument_RecursiveFallback = Recursive fallback not allowed for character \\u{0:X4}.
-Argument_RecursiveFallbackBytes = Recursive fallback not allowed for bytes {0}.
-Arg_EnumAndObjectMustBeSameType = Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'.
-Arg_EnumIllegalVal = Illegal enum value: {0}.
-Arg_EnumNotSingleFlag = Must set exactly one flag.
-Arg_EnumAtLeastOneFlag = Must set at least one flag.
-Arg_EnumUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object must be a String. Type passed in was '{0}'; the enum underlying type was '{1}'.
-Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object. Type passed in was '{0}'; the enum underlying type was '{1}'.
-Arg_EnumMustHaveUnderlyingValueField = All enums must have an underlying value__ field.
-Arg_COMAccess = Must specify property Set or Get or method call for a COM Object.
-Arg_COMPropSetPut = Only one of the following binding flags can be set: BindingFlags.SetProperty, BindingFlags.PutDispProperty, BindingFlags.PutRefDispProperty.
-Arg_FldSetGet = Cannot specify both Get and Set on a field.
-Arg_PropSetGet = Cannot specify both Get and Set on a property.
-Arg_CannotBeNaN = TimeSpan does not accept floating point Not-a-Number values.
-Arg_FldGetPropSet = Cannot specify both GetField and SetProperty.
-Arg_FldSetPropGet = Cannot specify both SetField and GetProperty.
-Arg_FldSetInvoke = Cannot specify Set on a Field and Invoke on a method.
-Arg_FldGetArgErr = No arguments can be provided to Get a field value.
-Arg_FldSetArgErr = Only the field value can be specified to set a field value.
-Arg_GetMethNotFnd = Property Get method was not found.
-Arg_GuidArrayCtor = Byte array for GUID must be exactly {0} bytes long.
-Arg_HandleNotAsync = Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O).
-Arg_HandleNotSync = Handle does not support synchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened asynchronously (that is, it was opened explicitly for overlapped I/O).
-Arg_HTCapacityOverflow = Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.
-Arg_IndexMustBeInt = All indexes must be of type Int32.
-Arg_InvalidConsoleColor = The ConsoleColor enum value was not defined on that enum. Please use a defined color from the enum.
-Arg_InvalidFileAttrs = Invalid File or Directory attributes value.
-Arg_InvalidHandle = Invalid handle.
-Arg_InvalidTypeInSignature = The signature Type array contains some invalid type (i.e. null, void)
-Arg_InvalidTypeInRetType = The return Type contains some invalid type (i.e. null, ByRef)
-Arg_EHClauseNotFilter = This ExceptionHandlingClause is not a filter.
-Arg_EHClauseNotClause = This ExceptionHandlingClause is not a clause.
-Arg_ReflectionOnlyCA = It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead.
-Arg_ReflectionOnlyInvoke = It is illegal to invoke a method on a Type loaded via ReflectionOnlyGetType.
-Arg_ReflectionOnlyField = It is illegal to get or set the value on a field on a Type loaded via ReflectionOnlyGetType.
-Arg_MemberInfoNullModule = The Module object containing the member cannot be null.
-Arg_ParameterInfoNullMember = The MemberInfo object defining the parameter cannot be null.
-Arg_ParameterInfoNullModule = The Module object containing the parameter cannot be null.
-Arg_AssemblyNullModule = The manifest module of the assembly cannot be null.
-Arg_LongerThanSrcArray = Source array was not long enough. Check the source index, length, and the array's lower bounds.
-Arg_LongerThanDestArray = Destination array was not long enough. Check the destination index, length, and the array's lower bounds.
-Arg_LowerBoundsMustMatch = The arrays' lower bounds must be identical.
-Arg_MustBeBoolean = Object must be of type Boolean.
-Arg_MustBeByte = Object must be of type Byte.
-Arg_MustBeChar = Object must be of type Char.
-Arg_MustBeDateTime = Object must be of type DateTime.
-Arg_MustBeDateTimeOffset = Object must be of type DateTimeOffset.
-Arg_MustBeDecimal = Object must be of type Decimal.
-Arg_MustBeDelegate = Type must derive from Delegate.
-Arg_MustBeDouble = Object must be of type Double.
-Arg_MustBeDriveLetterOrRootDir = Object must be a root directory ("C:\\") or a drive letter ("C").
-Arg_MustBeEnum = Type provided must be an Enum.
-Arg_MustBeEnumBaseTypeOrEnum = The value passed in must be an enum base or an underlying type for an enum, such as an Int32.
-Arg_MustBeGuid = Object must be of type GUID.
-Arg_MustBeIdentityReferenceType = Type must be an IdentityReference, such as NTAccount or SecurityIdentifier.
-Arg_MustBeInterface = Type passed must be an interface.
-Arg_MustBeInt16 = Object must be of type Int16.
-Arg_MustBeInt32 = Object must be of type Int32.
-Arg_MustBeInt64 = Object must be of type Int64.
-Arg_MustBePrimArray = Object must be an array of primitives.
-Arg_MustBePointer = Type must be a Pointer.
-Arg_MustBeStatic = Method must be a static method.
-Arg_MustBeString = Object must be of type String.
-Arg_MustBeStringPtrNotAtom = The pointer passed in as a String must not be in the bottom 64K of the process's address space.
-Arg_MustBeSByte = Object must be of type SByte.
-Arg_MustBeSingle = Object must be of type Single.
-Arg_MustBeTimeSpan = Object must be of type TimeSpan.
-Arg_MustBeType = Type must be a type provided by the runtime.
-Arg_MustBeUInt16 = Object must be of type UInt16.
-Arg_MustBeUInt32 = Object must be of type UInt32.
-Arg_MustBeUInt64 = Object must be of type UInt64.
-Arg_MustBeVersion = Object must be of type Version.
-Arg_MustBeTrue = Argument must be true.
-Arg_MustAllBeRuntimeType = At least one type argument is not a runtime type.
-Arg_NamedParamNull = Named parameter value must not be null.
-Arg_NamedParamTooBig = Named parameter array cannot be bigger than argument array.
-Arg_Need1DArray = Array was not a one-dimensional array.
-Arg_Need2DArray = Array was not a two-dimensional array.
-Arg_Need3DArray = Array was not a three-dimensional array.
-Arg_NeedAtLeast1Rank = Must provide at least one rank.
-Arg_NoDefCTor = No parameterless constructor defined for this object.
-Arg_BitArrayTypeUnsupported = Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].
-Arg_DivideByZero = Attempted to divide by zero.
-Arg_NoAccessSpec = Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty).
-Arg_NoStaticVirtual = Method cannot be both static and virtual.
-Arg_NotFoundIFace = Interface not found.
-Arg_ObjObjEx = Object of type '{0}' cannot be converted to type '{1}'.
-Arg_ObjObj = Object type cannot be converted to target type.
-Arg_FieldDeclTarget = Field '{0}' defined on type '{1}' is not a field on the target object which is of type '{2}'.
-Arg_OleAutDateInvalid = Not a legal OleAut date.
-Arg_OleAutDateScale = OleAut date did not convert to a DateTime correctly.
-Arg_PlatformNotSupported = Operation is not supported on this platform.
-Arg_PlatformSecureString = SecureString is only supported on Windows 2000 SP3 and higher platforms.
-Arg_ParmCnt = Parameter count mismatch.
-Arg_ParmArraySize = Must specify one or more parameters.
-Arg_Path2IsRooted = Second path fragment must not be a drive or UNC name.
-Arg_PathIsVolume = Path must not be a drive.
-Arg_PrimWiden = Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.
-Arg_NullIndex = Arrays indexes must be set to an object instance.
-Arg_VarMissNull = Missing parameter does not have a default value.
-Arg_PropSetInvoke = Cannot specify Set on a property and Invoke on a method.
-Arg_PropNotFound = Could not find the specified property.
-Arg_RankIndices = Indices length does not match the array rank.
-Arg_RanksAndBounds = Number of lengths and lowerBounds must match.
-Arg_RegSubKeyAbsent = Cannot delete a subkey tree because the subkey does not exist.
-Arg_RemoveArgNotFound = Cannot remove the specified item because it was not found in the specified Collection.
-Arg_RegKeyDelHive = Cannot delete a registry hive's subtree.
-Arg_RegKeyNoRemoteConnect = No remote connection to '{0}' while trying to read the registry.
-Arg_RegKeyOutOfRange = Registry HKEY was out of the legal range.
-Arg_RegKeyNotFound = The specified registry key does not exist.
-Arg_RegKeyStrLenBug = Registry key names should not be greater than 255 characters.
-Arg_RegValStrLenBug = Registry value names should not be greater than 16,383 characters.
-Arg_RegBadKeyKind = The specified RegistryValueKind is an invalid value.
-Arg_RegGetOverflowBug = RegistryKey.GetValue does not allow a String that has a length greater than Int32.MaxValue.
-Arg_RegSetMismatchedKind = The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.
-Arg_RegSetBadArrType = RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported.
-Arg_RegSetStrArrNull = RegistryKey.SetValue does not allow a String[] that contains a null String reference.
-Arg_RegInvalidKeyName = Registry key name must start with a valid base key name.
-Arg_ResMgrNotResSet = Type parameter must refer to a subclass of ResourceSet.
-Arg_SetMethNotFnd = Property set method not found.
-Arg_TypeRefPrimitve = TypedReferences cannot be redefined as primitives.
-Arg_UnknownTypeCode = Unknown TypeCode value.
-Arg_VersionString = Version string portion was too short or too long.
-Arg_NoITypeInfo = Specified TypeInfo was invalid because it did not support the ITypeInfo interface.
-Arg_NoITypeLib = Specified TypeLib was invalid because it did not support the ITypeLib interface.
-Arg_NoImporterCallback = Specified type library importer callback was invalid because it did not support the ITypeLibImporterNotifySink interface.
-Arg_ImporterLoadFailure = The type library importer encountered an error during type verification. Try importing without class members.
-Arg_InvalidBase = Invalid Base.
-Arg_EnumValueNotFound = Requested value '{0}' was not found.
-Arg_EnumLitValueNotFound = Literal value was not found.
-Arg_MustContainEnumInfo = Must specify valid information for parsing in the string.
-Arg_InvalidSearchPattern = Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b".
-Arg_NegativeArgCount = Argument count must not be negative.
-Arg_InvalidAccessEntry = Specified access entry is invalid because it is unrestricted. The global flags should be specified instead.
-Arg_InvalidFileName = Specified file name was invalid.
-Arg_InvalidFileExtension = Specified file extension was not a valid extension.
-Arg_COMException = Error HRESULT E_FAIL has been returned from a call to a COM component.
-Arg_ExternalException = External component has thrown an exception.
-Arg_InvalidComObjectException = Attempt has been made to use a COM object that does not have a backing class factory.
-Arg_InvalidOleVariantTypeException = Specified OLE variant was invalid.
-Arg_MarshalDirectiveException = Marshaling directives are invalid.
-Arg_MarshalAsAnyRestriction = AsAny cannot be used on return types, ByRef parameters, ArrayWithOffset, or parameters passed from unmanaged to managed.
-Arg_NDirectBadObject = No PInvoke conversion exists for value passed to Object-typed parameter.
-Arg_SafeArrayTypeMismatchException = Specified array was not of the expected type.
-Arg_VTableCallsNotSupportedException = Attempted to make an early bound call on a COM dispatch-only interface.
-Arg_SafeArrayRankMismatchException = Specified array was not of the expected rank.
-Arg_AmbiguousMatchException = Ambiguous match found.
-Arg_CustomAttributeFormatException = Binary format of the specified custom attribute was invalid.
-Arg_InvalidFilterCriteriaException = Specified filter criteria was invalid.
-Arg_TypeLoadNullStr = A null or zero length string does not represent a valid Type.
-Arg_TargetInvocationException = Exception has been thrown by the target of an invocation.
-Arg_TargetParameterCountException = Number of parameters specified does not match the expected number.
-Arg_TypeAccessException = Attempt to access the type failed.
-Arg_TypeLoadException = Failure has occurred while loading a type.
-Arg_TypeUnloadedException = Type had been unloaded.
-Arg_ThreadStateException = Thread was in an invalid state for the operation being executed.
-Arg_ThreadStartException = Thread failed to start.
-Arg_WrongAsyncResult = IAsyncResult object did not come from the corresponding async method on this type.
-Arg_WrongType = The value "{0}" is not of type "{1}" and cannot be used in this generic collection.
-Argument_InvalidArgumentForComparison = Type of argument is not compatible with the generic comparer.
-Argument_ALSInvalidCapacity = Specified capacity must not be less than the current capacity.
-Argument_ALSInvalidSlot = Specified slot number was invalid.
-Argument_IdnIllegalName = Decoded string is not a valid IDN name.
-Argument_IdnBadBidi = Left to right characters may not be mixed with right to left characters in IDN labels.
-Argument_IdnBadLabelSize = IDN labels must be between 1 and 63 characters long.
-Argument_IdnBadNameSize = IDN names must be between 1 and {0} characters long.
-Argument_IdnBadPunycode = Invalid IDN encoded string.
-Argument_IdnBadStd3 = Label contains character '{0}' not allowed with UseStd3AsciiRules
-Arg_InvalidANSIString = The ANSI string passed in could not be converted from the default ANSI code page to Unicode.
-Arg_InvalidUTF8String = The UTF8 string passed in could not be converted to Unicode.
-Argument_InvalidCharSequence = Invalid Unicode code point found at index {0}.
-Argument_InvalidCharSequenceNoIndex = String contains invalid Unicode code points.
-Argument_InvalidCalendar = Not a valid calendar for the given culture.
-Argument_InvalidNormalizationForm = Invalid or unsupported normalization form.
-Argument_InvalidPathChars = Illegal characters in path.
-Argument_InvalidOffLen = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
-Argument_InvalidSeekOrigin = Invalid seek origin.
-Argument_SeekOverflow = The specified seek offset '{0}' would result in a negative Stream position.
-Argument_InvalidUnity = Invalid Unity type.
-Argument_LongEnvVarName = Environment variable name cannot contain 1024 or more characters.
-Argument_LongEnvVarValue = Environment variable name or value is too long.
-Argument_StringFirstCharIsZero = The first char in the string is the null character.
-Argument_OnlyMscorlib = Only mscorlib's assembly is valid.
-Argument_PathEmpty = Path cannot be the empty string or all whitespace.
-Argument_PathFormatNotSupported = The given path's format is not supported.
-Argument_PathUriFormatNotSupported = URI formats are not supported.
-Argument_TypeNameTooLong = Type name was too long. The fully qualified type name must be less than 1,024 characters.
-Argument_StreamNotReadable = Stream was not readable.
-Argument_StreamNotWritable = Stream was not writable.
-Argument_InvalidNumberOfMembers = MemberData contains an invalid number of members.
-Argument_InvalidValue = Value was invalid.
-Argument_InvalidKey = Key was invalid.
-Argument_MinMaxValue = '{0}' cannot be greater than {1}.
-Argument_InvalidGroupSize = Every element in the value array should be between one and nine, except for the last element, which can be zero.
-Argument_MustHaveAttributeBaseClass = Type passed in must be derived from System.Attribute or System.Attribute itself.
-Argument_NoUninitializedStrings = Uninitialized Strings cannot be created.
-Argument_UnequalMembers = Supplied MemberInfo does not match the expected type.
-Argument_BadFormatSpecifier = Format specifier was invalid.
-Argument_InvalidHighSurrogate = Found a high surrogate char without a following low surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.
-Argument_InvalidLowSurrogate = Found a low surrogate char without a preceding high surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.
-Argument_UnmatchingSymScope = Non-matching symbol scope.
-Argument_NotInExceptionBlock = Not currently in an exception block.
-Argument_BadExceptionCodeGen = Incorrect code generation for exception block.
-Argument_NotExceptionType = Does not extend Exception.
-Argument_DuplicateResourceName = Duplicate resource name within an assembly.
-Argument_BadPersistableModuleInTransientAssembly = Cannot have a persistable module in a transient assembly.
-Argument_InvalidPermissionState = Invalid permission state.
-Argument_UnrestrictedIdentityPermission = Identity permissions cannot be unrestricted.
-Argument_WrongType = Operation on type '{0}' attempted with target of incorrect type.
-Argument_IllegalZone = Illegal security permission zone specified.
-Argument_HasToBeArrayClass = Must be an array type.
-Argument_InvalidDirectory = Invalid directory, '{0}'.
-Argument_DataLengthDifferent = Parameters 'members' and 'data' must have the same length.
-Argument_SigIsFinalized = Completed signature cannot be modified.
-Argument_ArraysInvalid = Array or pointer types are not valid.
-Argument_GenericsInvalid = Generic types are not valid.
-Argument_LargeInteger = Integer or token was too large to be encoded.
-Argument_BadSigFormat = Incorrect signature format.
-Argument_UnmatchedMethodForLocal = Local passed in does not belong to this ILGenerator.
-Argument_DuplicateName = Tried to add NamedPermissionSet with non-unique name.
-Argument_InvalidXMLElement = Invalid XML. Missing required tag <{0}> for type '{1}'.
-Argument_InvalidXMLMissingAttr = Invalid XML. Missing required attribute '{0}'.
-Argument_CannotGetTypeTokenForByRef = Cannot get TypeToken for a ByRef type.
-Argument_NotASimpleNativeType = The UnmanagedType passed to DefineUnmanagedMarshal is not a simple type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, UnmanagedType.CustomMarshaler.
-Argument_NotACustomMarshaler = Not a custom marshal.
-Argument_NoUnmanagedElementCount = Unmanaged marshal does not have ElementCount.
-Argument_NoNestedMarshal = Only LPArray or SafeArray has nested unmanaged marshal.
-Argument_InvalidXML = Invalid Xml.
-Argument_NoUnderlyingCCW = The object has no underlying COM data associated with it.
-Argument_BadFieldType = Bad field type in defining field.
-Argument_InvalidXMLBadVersion = Invalid Xml - can only parse elements of version one.
-Argument_NotAPermissionElement = 'elem' was not a permission element.
-Argument_NPMSInvalidName = Name can be neither null nor empty.
-Argument_InvalidElementTag = Invalid element tag '{0}'.
-Argument_InvalidElementText = Invalid element text '{0}'.
-Argument_InvalidElementName = Invalid element name '{0}'.
-Argument_InvalidElementValue = Invalid element value '{0}'.
-Argument_AttributeNamesMustBeUnique = Attribute names must be unique.
-Argument_InvalidHexFormat = Improperly formatted hex string.
-Argument_InvalidSite = Invalid site.
-Argument_InterfaceMap = 'this' type cannot be an interface itself.
-Argument_ArrayGetInterfaceMap = Interface maps for generic interfaces on arrays cannot be retrieved.
-Argument_InvalidName = Invalid name.
-Argument_InvalidDirectoryOnUrl = Invalid directory on URL.
-Argument_InvalidUrl = Invalid URL.
-Argument_InvalidKindOfTypeForCA = This type cannot be represented as a custom attribute.
-Argument_MustSupplyContainer = When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied.
-Argument_MustSupplyParent = When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied.
-Argument_NoClass = Element does not specify a class.
-Argument_WrongElementType = '{0}' element required.
-Argument_UnableToGeneratePermissionSet = Unable to generate permission set; input XML may be malformed.
-Argument_NoEra = No Era was supplied.
-Argument_AssemblyAlreadyFullTrust = Assembly was already fully trusted.
-Argument_AssemblyNotFullTrust = Assembly was not fully trusted.
-Argument_AssemblyWinMD = Assembly must not be a Windows Runtime assembly.
-Argument_MemberAndArray = Cannot supply both a MemberInfo and an Array to indicate the parent of a value type.
-Argument_ObjNotComObject = The object's type must be __ComObject or derived from __ComObject.
-Argument_ObjIsWinRTObject = The object's type must not be a Windows Runtime type.
-Argument_TypeNotComObject = The type must be __ComObject or be derived from __ComObject.
-Argument_TypeIsWinRTType = The type must not be a Windows Runtime type.
-Argument_CantCallSecObjFunc = Cannot evaluate a security function.
-Argument_StructMustNotBeValueClass = The structure must not be a value class.
-Argument_NoSpecificCulture = Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG.
-Argument_InvalidResourceCultureName = The given culture name '{0}' cannot be used to locate a resource file. Resource filenames must consist of only letters, numbers, hyphens or underscores.
-Argument_InvalidParamInfo = Invalid type for ParameterInfo member in Attribute class.
-Argument_EmptyDecString = Decimal separator cannot be the empty string.
-Argument_OffsetOfFieldNotFound = Field passed in is not a marshaled member of the type '{0}'.
-Argument_EmptyStrongName = StrongName cannot have an empty string for the assembly name.
-Argument_NotSerializable = Argument passed in is not serializable.
-Argument_EmptyApplicationName = ApplicationId cannot have an empty string for the name.
-Argument_NoDomainManager = The domain manager specified by the host could not be instantiated.
-Argument_NoMain = Main entry point not defined.
-Argument_InvalidDateTimeKind = Invalid DateTimeKind value.
-Argument_ConflictingDateTimeStyles = The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together.
-Argument_ConflictingDateTimeRoundtripStyles = The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, AssumeUniversal or AdjustToUniversal.
-Argument_InvalidDigitSubstitution = The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None.
-Argument_InvalidNativeDigitCount = The NativeDigits array must contain exactly ten members.
-Argument_InvalidNativeDigitValue = Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.
-ArgumentException_InvalidAceBinaryForm = The binary form of an ACE object is invalid.
-ArgumentException_InvalidAclBinaryForm = The binary form of an ACL object is invalid.
-ArgumentException_InvalidSDSddlForm = The SDDL form of a security descriptor object is invalid.
-Argument_InvalidSafeHandle = The SafeHandle is invalid.
-Argument_CannotPrepareAbstract = Abstract methods cannot be prepared.
-Argument_ArrayTooLarge = The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.
-Argument_RelativeUrlMembershipCondition = UrlMembershipCondition requires an absolute URL.
-Argument_EmptyWaithandleArray = Waithandle array may not be empty.
-Argument_InvalidSafeBufferOffLen = Offset and length were greater than the size of the SafeBuffer.
-Argument_NotEnoughBytesToRead = There are not enough bytes remaining in the accessor to read at this position.
-Argument_NotEnoughBytesToWrite = There are not enough bytes remaining in the accessor to write at this position.
-Argument_OffsetAndLengthOutOfBounds = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
-Argument_OffsetAndCapacityOutOfBounds = Offset and capacity were greater than the size of the view.
-Argument_UnmanagedMemAccessorWrapAround = The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space.
-Argument_UnrecognizedLoaderOptimization = Unrecognized LOADER_OPTIMIZATION property value. Supported values may include "SingleDomain", "MultiDomain", "MultiDomainHost", and "NotSpecified".
-ArgumentException_NotAllCustomSortingFuncsDefined = Implementations of all the NLS functions must be provided.
-ArgumentException_MinSortingVersion = The runtime does not support a version of "{0}" less than {1}.
-Argument_PreAllocatedAlreadyAllocated = 'preAllocated' is already in use.
-Argument_NativeOverlappedWrongBoundHandle = 'overlapped' was not allocated by this ThreadPoolBoundHandle instance.
-Argument_NativeOverlappedAlreadyFree = 'overlapped' has already been freed.
-Argument_AlreadyBoundOrSyncHandle = 'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O.
-Argument_InvalidTypeWithPointersNotSupported = Cannot use type '{0}'. Only value types without pointers or references are supported.
-Argument_DestinationTooShort = Destination is too short.
-
-;
-; =====================================================
-; Reflection Emit resource strings
-Arugment_EmitMixedContext1 = Type '{0}' was loaded in the ReflectionOnly context but the AssemblyBuilder was not created as AssemblyBuilderAccess.ReflectionOnly.
-Arugment_EmitMixedContext2 = Type '{0}' was not loaded in the ReflectionOnly context but the AssemblyBuilder was created as AssemblyBuilderAccess.ReflectionOnly.
-Argument_BadSizeForData = Data size must be > 0 and < 0x3f0000
-Argument_InvalidLabel = Invalid Label.
-Argument_RedefinedLabel = Label multiply defined.
-Argument_UnclosedExceptionBlock = The IL Generator cannot be used while there are unclosed exceptions.
-Argument_MissingDefaultConstructor = was missing default constructor.
-Argument_TooManyFinallyClause = Exception blocks may have at most one finally clause.
-Argument_NotInTheSameModuleBuilder = The argument passed in was not from the same ModuleBuilder.
-Argument_BadCurrentLocalVariable = Bad current local variable for setting symbol information.
-Argument_DuplicateModuleName = Duplicate dynamic module name within an assembly.
-Argument_DuplicateTypeName = Duplicate type name within an assembly.
-Argument_InvalidAssemblyName = Assembly names may not begin with whitespace or contain the characters '/', or '\\' or ':'.
-Argument_InvalidGenericInstantiation = The given generic instantiation was invalid.
-Argument_DuplicatedFileName = Duplicate file names.
-Argument_GlobalFunctionHasToBeStatic = Global members must be static.
-Argument_BadPInvokeOnInterface = PInvoke methods cannot exist on interfaces.
-Argument_BadPInvokeMethod = PInvoke methods must be static and native and cannot be abstract.
-Argument_MethodRedefined = Method has been already defined.
-Argument_BadTypeAttrAbstractNFinal = Bad type attributes. A type cannot be both abstract and final.
-Argument_BadTypeAttrNestedVisibilityOnNonNestedType = Bad type attributes. Nested visibility flag set on a non-nested type.
-Argument_BadTypeAttrNonNestedVisibilityNestedType = Bad type attributes. Non-nested visibility flag set on a nested type.
-Argument_BadTypeAttrInvalidLayout = Bad type attributes. Invalid layout attribute specified.
-Argument_BadTypeAttrReservedBitsSet = Bad type attributes. Reserved bits set on the type.
-Argument_BadFieldSig = Field signatures do not have return types.
-Argument_ShouldOnlySetVisibilityFlags = Should only set visibility flags when creating EnumBuilder.
-Argument_BadNestedTypeFlags = Visibility of interfaces must be one of the following: NestedAssembly, NestedFamANDAssem, NestedFamily, NestedFamORAssem, NestedPrivate or NestedPublic.
-Argument_ShouldNotSpecifyExceptionType = Should not specify exception type for catch clause for filter block.
-Argument_BadLabel = Bad label in ILGenerator.
-Argument_BadLabelContent = Bad label content in ILGenerator.
-Argument_EmitWriteLineType = EmitWriteLine does not support this field or local type.
-Argument_ConstantNull = Null is not a valid constant value for this type.
-Argument_ConstantDoesntMatch = Constant does not match the defined type.
-Argument_ConstantNotSupported = {0} is not a supported constant type.
-Argument_BadConstructor = Cannot have private or static constructor.
-Argument_BadConstructorCallConv = Constructor must have standard calling convention.
-Argument_BadPropertyForConstructorBuilder = Property must be on the same type of the given ConstructorInfo.
-Argument_NotAWritableProperty = Not a writable property.
-Argument_BadFieldForConstructorBuilder = Field must be on the same type of the given ConstructorInfo.
-Argument_BadAttributeOnInterfaceMethod = Interface method must be abstract and virtual.
-ArgumentException_BadMethodImplBody = MethodOverride's body must be from this type.
-Argument_BadParameterCountsForConstructor = Parameter count does not match passed in argument value count.
-Argument_BadParameterTypeForConstructor = Passed in argument value at index {0} does not match the parameter type.
-Argument_BadTypeInCustomAttribute = An invalid type was used as a custom attribute constructor argument, field or property.
-Argument_DateTimeBadBinaryData = The binary data must result in a DateTime with ticks between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-Argument_VerStringTooLong = The unmanaged Version information is too large to persist.
-Argument_UnknownUnmanagedCallConv = Unknown unmanaged calling convention for function signature.
-Argument_BadConstantValue = Bad default value.
-Argument_IllegalName = Illegal name.
-Argument_cvtres_NotFound = Cannot find cvtres.exe
-Argument_BadCAForUnmngRSC = Bad '{0}' while generating unmanaged resource information.
-Argument_MustBeInterfaceMethod = The MemberInfo must be an interface method.
-Argument_CORDBBadVarArgCallConv = Cannot evaluate a VarArgs function.
-Argument_CORDBBadMethod = Cannot find the method on the object instance.
-Argument_InvalidOpCodeOnDynamicMethod = Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods.
-Argument_InvalidTypeForDynamicMethod = Invalid type owner for DynamicMethod.
-Argument_NeedGenericMethodDefinition = Method must represent a generic method definition on a generic type definition.
-Argument_MethodNeedGenericDeclaringType = The specified method cannot be dynamic or global and must be declared on a generic type definition.
-Argument_ConstructorNeedGenericDeclaringType = The specified constructor must be declared on a generic type definition.
-Argument_FieldNeedGenericDeclaringType = The specified field must be declared on a generic type definition.
-Argument_InvalidMethodDeclaringType = The specified method must be declared on the generic type definition of the specified type.
-Argument_InvalidConstructorDeclaringType = The specified constructor must be declared on the generic type definition of the specified type.
-Argument_InvalidFieldDeclaringType = The specified field must be declared on the generic type definition of the specified type.
-Argument_NeedNonGenericType = The specified Type must not be a generic type definition.
-Argument_MustBeTypeBuilder = 'type' must contain a TypeBuilder as a generic argument.
-Argument_CannotSetParentToInterface = Cannot set parent to an interface.
-Argument_MismatchedArrays = Two arrays, {0} and {1}, must be of the same size.
-Argument_NeedNonGenericObject = The specified object must not be an instance of a generic type.
-Argument_NeedStructWithNoRefs = The specified Type must be a struct containing no references.
-Argument_NotMethodCallOpcode = The specified opcode cannot be passed to EmitCall.
-
-; =====================================================
-;
-Argument_ModuleAlreadyLoaded = The specified module has already been loaded.
-Argument_MustHaveLayoutOrBeBlittable = The specified structure must be blittable or have layout information.
-Argument_NotSimpleFileName = The filename must not include a path specification.
-Argument_TypeMustBeVisibleFromCom = The specified type must be visible from COM.
-Argument_TypeMustBeComCreatable = The type must be creatable from COM.
-Argument_TypeMustNotBeComImport = The type must not be imported from COM.
-Argument_PolicyFileDoesNotExist = The requested policy file does not exist.
-Argument_NonNullObjAndCtx = Either obj or ctx must be null.
-Argument_NoModuleFileExtension = Module file name '{0}' must have file extension.
-Argument_TypeDoesNotContainMethod = Type does not contain the given method.
-Argument_StringZeroLength = String cannot be of zero length.
-Argument_MustBeString = String is too long or has invalid contents.
-Argument_AbsolutePathRequired = Absolute path information is required.
-Argument_ManifestFileDoesNotExist = The specified manifest file does not exist.
-Argument_MustBeRuntimeType = Type must be a runtime Type object.
-Argument_TypeNotValid = The Type object is not valid.
-Argument_MustBeRuntimeMethodInfo = MethodInfo must be a runtime MethodInfo object.
-Argument_MustBeRuntimeFieldInfo = FieldInfo must be a runtime FieldInfo object.
-Argument_InvalidFieldInfo = The FieldInfo object is not valid.
-Argument_InvalidConstructorInfo = The ConstructorInfo object is not valid.
-Argument_MustBeRuntimeAssembly = Assembly must be a runtime Assembly object.
-Argument_MustBeRuntimeModule = Module must be a runtime Module object.
-Argument_MustBeRuntimeParameterInfo = ParameterInfo must be a runtime ParameterInfo object.
-Argument_InvalidParameterInfo = The ParameterInfo object is not valid.
-Argument_MustBeRuntimeReflectionObject = The object must be a runtime Reflection object.
-Argument_InvalidMarshalByRefObject = The MarshalByRefObject is not valid.
-Argument_TypedReferenceInvalidField = Field in TypedReferences cannot be static or init only.
-Argument_HandleLeak = Cannot pass a GCHandle across AppDomains.
-Argument_ArgumentZero = Argument cannot be zero.
-Argument_ImproperType = Improper types in collection.
-Argument_NotAMembershipCondition = The type does not implement IMembershipCondition
-Argument_NotAPermissionType = The type does not implement IPermission
-Argument_NotACodeGroupType = The type does not inherit from CodeGroup
-Argument_NotATP = Type must be a TransparentProxy
-Argument_AlreadyACCW = The object already has a CCW associated with it.
-Argument_OffsetLocalMismatch = The UTC Offset of the local dateTime parameter does not match the offset argument.
-Argument_OffsetUtcMismatch = The UTC Offset for Utc DateTime instances must be 0.
-Argument_UTCOutOfRange = The UTC time represented when the offset is applied must be between year 0 and 10,000.
-Argument_OffsetOutOfRange = Offset must be within plus or minus 14 hours.
-Argument_OffsetPrecision = Offset must be specified in whole minutes.
-Argument_FlagNotSupported = One or more flags are not supported.
-Argument_MustBeFalse = Argument must be initialized to false
-Argument_ToExclusiveLessThanFromExclusive = fromInclusive must be less than or equal to toExclusive.
-Argument_FrameworkNameTooShort=FrameworkName cannot have less than two components or more than three components.
-Argument_FrameworkNameInvalid=FrameworkName is invalid.
-Argument_FrameworkNameMissingVersion=FrameworkName version component is missing.
-#if FEATURE_COMINTEROP
-Argument_TypeNotActivatableViaWindowsRuntime = Type '{0}' does not have an activation factory because it is not activatable by Windows Runtime.
-Argument_WinRTSystemRuntimeType = Cannot marshal type '{0}' to Windows Runtime. Only 'System.RuntimeType' is supported.
-Argument_Unexpected_TypeSource = Unexpected TypeKind when marshaling Windows.Foundation.TypeName.
-#endif // FEATURE_COMINTEROP
-
-; ArgumentNullException
-ArgumentNull_Array = Array cannot be null.
-ArgumentNull_ArrayValue = Found a null value within an array.
-ArgumentNull_ArrayElement = At least one element in the specified array was null.
-ArgumentNull_Assembly = Assembly cannot be null.
-ArgumentNull_AssemblyName = AssemblyName cannot be null.
-ArgumentNull_AssemblyNameName = AssemblyName.Name cannot be null or an empty string.
-ArgumentNull_Buffer = Buffer cannot be null.
-ArgumentNull_Collection = Collection cannot be null.
-ArgumentNull_CultureInfo = CultureInfo cannot be null.
-ArgumentNull_Dictionary = Dictionary cannot be null.
-ArgumentNull_FileName = File name cannot be null.
-ArgumentNull_Key = Key cannot be null.
-ArgumentNull_Graph = Object Graph cannot be null.
-ArgumentNull_Path = Path cannot be null.
-ArgumentNull_Stream = Stream cannot be null.
-ArgumentNull_String = String reference not set to an instance of a String.
-ArgumentNull_Type = Type cannot be null.
-ArgumentNull_Obj = Object cannot be null.
-ArgumentNull_GUID = GUID cannot be null.
-ArgumentNull_NullMember = Member at position {0} was null.
-ArgumentNull_Generic = Value cannot be null.
-ArgumentNull_WithParamName = Parameter '{0}' cannot be null.
-ArgumentNull_Child = Cannot have a null child.
-ArgumentNull_SafeHandle = SafeHandle cannot be null.
-ArgumentNull_CriticalHandle = CriticalHandle cannot be null.
-ArgumentNull_TypedRefType = Type in TypedReference cannot be null.
-ArgumentNull_ApplicationTrust = The application trust cannot be null.
-ArgumentNull_TypeRequiredByResourceScope = The type parameter cannot be null when scoping the resource's visibility to Private or Assembly.
-ArgumentNull_Waithandles = The waitHandles parameter cannot be null.
-
-; ArgumentOutOfRangeException
-ArgumentOutOfRange_AddressSpace = The number of bytes cannot exceed the virtual address space on a 32 bit machine.
-ArgumentOutOfRange_ArrayLB = Number was less than the array's lower bound in the first dimension.
-ArgumentOutOfRange_ArrayLBAndLength = Higher indices will exceed Int32.MaxValue because of large lower bound and/or length.
-ArgumentOutOfRange_ArrayLength = The length of the array must be between {0} and {1}, inclusive.
-ArgumentOutOfRange_ArrayLengthMultiple = The length of the array must be a multiple of {0}.
-ArgumentOutOfRange_ArrayListInsert = Insertion index was out of range. Must be non-negative and less than or equal to size.
-ArgumentOutOfRange_ArrayTooSmall = Destination array is not long enough to copy all the required data. Check array length and offset.
-ArgumentOutOfRange_BeepFrequency = Console.Beep's frequency must be between {0} and {1}.
-ArgumentOutOfRange_BiggerThanCollection = Larger than collection size.
-ArgumentOutOfRange_Bounds_Lower_Upper = Argument must be between {0} and {1}.
-ArgumentOutOfRange_Count = Count must be positive and count must refer to a location within the string/array/collection.
-ArgumentOutOfRange_CalendarRange = Specified time is not supported in this calendar. It should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.
-ArgumentOutOfRange_ConsoleBufferBoundaries = The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
-ArgumentOutOfRange_ConsoleBufferLessThanWindowSize = The console buffer size must not be less than the current size and position of the console window, nor greater than or equal to Int16.MaxValue.
-ArgumentOutOfRange_ConsoleWindowBufferSize = The new console window size would force the console buffer size to be too large.
-ArgumentOutOfRange_ConsoleTitleTooLong = The console title is too long.
-ArgumentOutOfRange_ConsoleWindowPos = The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative.
-ArgumentOutOfRange_ConsoleWindowSize_Size = The value must be less than the console's current maximum window size of {0} in that dimension. Note that this value depends on screen resolution and the console font.
-ArgumentOutOfRange_ConsoleKey = Console key values must be between 0 and 255.
-ArgumentOutOfRange_CursorSize = The cursor size is invalid. It must be a percentage between 1 and 100.
-ArgumentOutOfRange_BadYearMonthDay = Year, Month, and Day parameters describe an un-representable DateTime.
-ArgumentOutOfRange_BadHourMinuteSecond = Hour, Minute, and Second parameters describe an un-representable DateTime.
-ArgumentOutOfRange_DateArithmetic = The added or subtracted value results in an un-representable DateTime.
-ArgumentOutOfRange_DateTimeBadMonths = Months value must be between +/-120000.
-ArgumentOutOfRange_DateTimeBadYears = Years value must be between +/-10000.
-ArgumentOutOfRange_DateTimeBadTicks = Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-ArgumentOutOfRange_Day = Day must be between 1 and {0} for month {1}.
-ArgumentOutOfRange_DecimalRound = Decimal can only round to between 0 and 28 digits of precision.
-ArgumentOutOfRange_DecimalScale = Decimal's scale value must be between 0 and 28, inclusive.
-ArgumentOutOfRange_Era = Time value was out of era range.
-ArgumentOutOfRange_Enum = Enum value was out of legal range.
-ArgumentOutOfRange_FileLengthTooBig = Specified file length was too large for the file system.
-ArgumentOutOfRange_FileTimeInvalid = Not a valid Win32 FileTime.
-ArgumentOutOfRange_GetByteCountOverflow = Too many characters. The resulting number of bytes is larger than what can be returned as an int.
-ArgumentOutOfRange_GetCharCountOverflow = Too many bytes. The resulting number of chars is larger than what can be returned as an int.
-ArgumentOutOfRange_HashtableLoadFactor = Load factor needs to be between 0.1 and 1.0.
-ArgumentOutOfRange_HugeArrayNotSupported = Arrays larger than 2GB are not supported.
-ArgumentOutOfRange_InvalidHighSurrogate = A valid high surrogate character is between 0xd800 and 0xdbff, inclusive.
-ArgumentOutOfRange_InvalidLowSurrogate = A valid low surrogate character is between 0xdc00 and 0xdfff, inclusive.
-ArgumentOutOfRange_InvalidEraValue = Era value was not valid.
-ArgumentOutOfRange_InvalidUserDefinedAceType = User-defined ACEs must not have a well-known ACE type.
-ArgumentOutOfRange_InvalidUTF32 = A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff).
-ArgumentOutOfRange_Index = Index was out of range. Must be non-negative and less than the size of the collection.
-ArgumentOutOfRange_IndexString = Index was out of range. Must be non-negative and less than the length of the string.
-ArgumentOutOfRange_StreamLength = Stream length must be non-negative and less than 2^31 - 1 - origin.
-ArgumentOutOfRange_LessEqualToIntegerMaxVal = Argument must be less than or equal to 2^31 - 1 milliseconds.
-ArgumentOutOfRange_Month = Month must be between one and twelve.
-ArgumentOutOfRange_MustBeNonNegInt32 = Value must be non-negative and less than or equal to Int32.MaxValue.
-ArgumentOutOfRange_NeedNonNegNum = Non-negative number required.
-ArgumentOutOfRange_NeedNonNegOrNegative1 = Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
-ArgumentOutOfRange_NeedPosNum = Positive number required.
-ArgumentOutOfRange_NegativeCapacity = Capacity must be positive.
-ArgumentOutOfRange_NegativeCount = Count cannot be less than zero.
-ArgumentOutOfRange_NegativeLength = Length cannot be less than zero.
-ArgumentOutOfRange_NegFileSize = Length must be non-negative.
-ArgumentOutOfRange_ObjectID = objectID cannot be less than or equal to zero.
-ArgumentOutOfRange_SmallCapacity = capacity was less than the current size.
-ArgumentOutOfRange_QueueGrowFactor = Queue grow factor must be between {0} and {1}.
-ArgumentOutOfRange_RoundingDigits = Rounding digits must be between 0 and 15, inclusive.
-ArgumentOutOfRange_StartIndex = StartIndex cannot be less than zero.
-ArgumentOutOfRange_MustBePositive = '{0}' must be greater than zero.
-ArgumentOutOfRange_MustBeNonNegNum = '{0}' must be non-negative.
-ArgumentOutOfRange_LengthGreaterThanCapacity = The length cannot be greater than the capacity.
-ArgumentOutOfRange_ListInsert = Index must be within the bounds of the List.
-ArgumentOutOfRange_StartIndexLessThanLength = startIndex must be less than length of string.
-ArgumentOutOfRange_StartIndexLargerThanLength = startIndex cannot be larger than length of string.
-ArgumentOutOfRange_EndIndexStartIndex = endIndex cannot be greater than startIndex.
-ArgumentOutOfRange_IndexCount = Index and count must refer to a location within the string.
-ArgumentOutOfRange_IndexCountBuffer = Index and count must refer to a location within the buffer.
-ArgumentOutOfRange_IndexLength = Index and length must refer to a location within the string.
-ArgumentOutOfRange_InvalidThreshold = The specified threshold for creating dictionary is out of range.
-ArgumentOutOfRange_Capacity = Capacity exceeds maximum capacity.
-ArgumentOutOfRange_Length = The specified length exceeds maximum capacity of SecureString.
-ArgumentOutOfRange_LengthTooLarge = The specified length exceeds the maximum value of {0}.
-ArgumentOutOfRange_SmallMaxCapacity = MaxCapacity must be one or greater.
-ArgumentOutOfRange_GenericPositive = Value must be positive.
-ArgumentOutOfRange_Range = Valid values are between {0} and {1}, inclusive.
-ArgumentOutOfRange_AddValue = Value to add was out of range.
-ArgumentOutOfRange_OffsetLength = Offset and length must refer to a position in the string.
-ArgumentOutOfRange_OffsetOut = Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.
-ArgumentOutOfRange_PartialWCHAR = Pointer startIndex and length do not refer to a valid string.
-ArgumentOutOfRange_ParamSequence = The specified parameter index is not in range.
-ArgumentOutOfRange_Version = Version's parameters must be greater than or equal to zero.
-ArgumentOutOfRange_TimeoutTooLarge = Time-out interval must be less than 2^32-2.
-ArgumentOutOfRange_UIntPtrMax-1 = The length of the buffer must be less than the maximum UIntPtr value for your platform.
-ArgumentOutOfRange_UnmanagedMemStreamLength = UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress.
-ArgumentOutOfRange_UnmanagedMemStreamWrapAround = The UnmanagedMemoryStream capacity would wrap around the high end of the address space.
-ArgumentOutOfRange_PeriodTooLarge = Period must be less than 2^32-2.
-ArgumentOutOfRange_Year = Year must be between 1 and 9999.
-ArgumentOutOfRange_BinaryReaderFillBuffer = The number of bytes requested does not fit into BinaryReader's internal buffer.
-ArgumentOutOfRange_PositionLessThanCapacityRequired = The position may not be greater or equal to the capacity of the accessor.
-
-; ArithmeticException
-Arithmetic_NaN = Function does not accept floating point Not-a-Number values.
-
-; ArrayTypeMismatchException
-ArrayTypeMismatch_CantAssignType = Source array type cannot be assigned to destination array type.
-ArrayTypeMismatch_ConstrainedCopy = Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array.
-
-; BadImageFormatException
-BadImageFormat_ResType&SerBlobMismatch = The type serialized in the .resources file was not the same type that the .resources file said it contained. Expected '{0}' but read '{1}'.
-BadImageFormat_ResourcesIndexTooLong = Corrupt .resources file. String for name index '{0}' extends past the end of the file.
-BadImageFormat_ResourcesNameTooLong = Corrupt .resources file. Resource name extends past the end of the file.
-BadImageFormat_ResourcesNameInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into name section.
-BadImageFormat_ResourcesHeaderCorrupted = Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file.
-BadImageFormat_ResourceNameCorrupted = Corrupt .resources file. A resource name extends past the end of the stream.
-BadImageFormat_ResourceNameCorrupted_NameIndex = Corrupt .resources file. The resource name for name index {0} extends past the end of the stream.
-BadImageFormat_ResourceDataLengthInvalid = Corrupt .resources file. The specified data length '{0}' is not a valid position in the stream.
-BadImageFormat_TypeMismatch = Corrupt .resources file. The specified type doesn't match the available data in the stream.
-BadImageFormat_InvalidType = Corrupt .resources file. The specified type doesn't exist.
-BadImageFormat_ResourcesIndexInvalid = Corrupt .resources file. The resource index '{0}' is outside the valid range.
-BadImageFormat_StreamPositionInvalid = Corrupt .resources file. The specified position '{0}' is not a valid position in the stream.
-BadImageFormat_ResourcesDataInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into data section.
-BadImageFormat_NegativeStringLength = Corrupt .resources file. String length must be non-negative.
-BadImageFormat_ParameterSignatureMismatch = The parameters and the signature of the method don't match.
-
-; Cryptography
-; These strings still appear in bcl.small but should go away eventually
-Cryptography_CSSM_Error = Error 0x{0} from the operating system security framework: '{1}'.
-Cryptography_CSSM_Error_Unknown = Error 0x{0} from the operating system security framework.
-Cryptography_InvalidDSASignatureSize = Length of the DSA signature was not 40 bytes.
-Cryptography_InvalidHandle = {0} is an invalid handle.
-Cryptography_InvalidOID = Object identifier (OID) is unknown.
-Cryptography_OAEPDecoding = Error occurred while decoding OAEP padding.
-Cryptography_PasswordDerivedBytes_InvalidIV = The Initialization vector should have the same length as the algorithm block size in bytes.
-Cryptography_SSE_InvalidDataSize = Length of the data to encrypt is invalid.
-Cryptography_X509_ExportFailed = The certificate export operation failed.
-Cryptography_X509_InvalidContentType = Invalid content type.
-Cryptography_CryptoStream_FlushFinalBlockTwice = FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once.
-Cryptography_HashKeySet = Hash key cannot be changed after the first write to the stream.
-Cryptography_HashNotYetFinalized = Hash must be finalized before the hash value is retrieved.
-Cryptography_InsufficientBuffer = Input buffer contains insufficient data.
-Cryptography_InvalidBlockSize = Specified block size is not valid for this algorithm.
-Cryptography_InvalidCipherMode = Specified cipher mode is not valid for this algorithm.
-Cryptography_InvalidIVSize = Specified initialization vector (IV) does not match the block size for this algorithm.
-Cryptography_InvalidKeySize = Specified key is not a valid size for this algorithm.
-Cryptography_PasswordDerivedBytes_FewBytesSalt = Salt is not at least eight bytes.
-Cryptography_PKCS7_InvalidPadding = Padding is invalid and cannot be removed.
-Cryptography_UnknownHashAlgorithm='{0}' is not a known hash algorithm.
-
-; EventSource
-EventSource_ToString = EventSource({0}, {1})
-EventSource_EventSourceGuidInUse = An instance of EventSource with Guid {0} already exists.
-EventSource_KeywordNeedPowerOfTwo = Value {0} for keyword {1} needs to be a power of 2.
-EventSource_UndefinedKeyword = Use of undefined keyword value {0} for event {1}.
-EventSource_UnsupportedEventTypeInManifest = Unsupported type {0} in event source.
-EventSource_ListenerNotFound = Listener not found.
-EventSource_ListenerCreatedInsideCallback = Creating an EventListener inside a EventListener callback.
-EventSource_AttributeOnNonVoid = Event attribute placed on method {0} which does not return 'void'.
-EventSource_NeedPositiveId = Event IDs must be positive integers.
-EventSource_ReservedOpcode = Opcode values less than 11 are reserved for system use.
-EventSource_ReservedKeywords = Keywords values larger than 0x0000100000000000 are reserved for system use
-EventSource_PayloadTooBig=The payload for a single event is too large.
-EventSource_NoFreeBuffers=No Free Buffers available from the operating system (e.g. event rate too fast).
-EventSource_NullInput=Null passed as a event argument.
-EventSource_TooManyArgs=Too many arguments.
-EventSource_SessionIdError=Bit position in AllKeywords ({0}) must equal the command argument named "EtwSessionKeyword" ({1}).
-EventSource_EnumKindMismatch = The type of {0} is not expected in {1}.
-EventSource_MismatchIdToWriteEvent = Event {0} is givien event ID {1} but {2} was passed to WriteEvent.
-EventSource_EventIdReused = Event {0} has ID {1} which is already in use.
-EventSource_EventNameReused = Event name {0} used more than once. If you wish to overload a method, the overloaded method should have a NonEvent attribute.
-EventSource_UndefinedChannel = Use of undefined channel value {0} for event {1}.
-EventSource_UndefinedOpcode = Use of undefined opcode value {0} for event {1}.
-ArgumentOutOfRange_MaxArgExceeded = The total number of parameters must not exceed {0}.
-ArgumentOutOfRange_MaxStringsExceeded = The number of String parameters must not exceed {0}.
-ArgumentOutOfRange_NeedValidId = The ID parameter must be in the range {0} through {1}.
-EventSource_NeedGuid = The Guid of an EventSource must be non zero.
-EventSource_NeedName = The name of an EventSource must not be null.
-EventSource_EtwAlreadyRegistered = The provider has already been registered with the operating system.
-EventSource_ListenerWriteFailure = An error occurred when writing to a listener.
-EventSource_TypeMustDeriveFromEventSource = Event source types must derive from EventSource.
-EventSource_TypeMustBeSealedOrAbstract = Event source types must be sealed or abstract.
-EventSource_TaskOpcodePairReused = Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}).
-EventSource_EventMustHaveTaskIfNonDefaultOpcode = Event {0} (with ID {1}) has a non-default opcode but not a task.
-EventSource_EventNameDoesNotEqualTaskPlusOpcode = Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode.
-EventSource_PeriodIllegalInProviderName = Period character ('.') is illegal in an ETW provider name ({0}).
-EventSource_IllegalOpcodeValue = Opcode {0} has a value of {1} which is outside the legal range (11-238).
-EventSource_OpcodeCollision = Opcodes {0} and {1} are defined with the same value ({2}).
-EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the legal range (1-65535).
-EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}).
-EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).
-EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}).
-EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254).
-EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}.
-EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider.
-EventSource_DuplicateStringKey = Multiple definitions for string "{0}".
-EventSource_EventWithAdminChannelMustHaveMessage = Event {0} specifies an Admin channel {1}. It must specify a Message property.
-EventSource_UnsupportedMessageProperty = Event {0} specifies an illegal or unsupported formatting message ("{1}").
-EventSource_AbstractMustNotDeclareKTOC = Abstract event source must not declare {0} nested type.
-EventSource_AbstractMustNotDeclareEventMethods = Abstract event source must not declare event methods ({0} with ID {1}).
-EventSource_EventMustNotBeExplicitImplementation = Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation.
-EventSource_EventParametersMismatch = Event {0} was called with {1} argument(s), but it is defined with {2} parameter(s).
-EventSource_InvalidCommand = Invalid command value.
-EventSource_InvalidEventFormat = Can't specify both etw event format flags.
-EventSource_AddScalarOutOfRange = Getting out of bounds during scalar addition.
-EventSource_PinArrayOutOfRange = Pins are out of range.
-EventSource_DataDescriptorsOutOfRange = Data descriptors are out of range.
-EventSource_NotSupportedArrayOfNil = Arrays of Nil are not supported.
-EventSource_NotSupportedArrayOfBinary = Arrays of Binary are not supported.
-EventSource_NotSupportedArrayOfNullTerminatedString = Arrays of null-terminated string are not supported.
-EventSource_TooManyFields = Too many fields in structure.
-EventSource_RecursiveTypeDefinition = Recursive type definition is not supported.
-EventSource_NotSupportedEnumType = Enum type {0} underlying type {1} is not supported for serialization.
-EventSource_NonCompliantTypeError = The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType.
-EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not supported.
-EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group
-EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported
-EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix.
-EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.
-EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.
-
-; ExecutionEngineException
-ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions.
-ExecutionEngine_MissingSecurityDescriptor = Unable to retrieve security descriptor for this frame.
-
-;;ExecutionContext
-ExecutionContext_UndoFailed = Undo operation on a component context threw an exception
-ExecutionContext_ExceptionInAsyncLocalNotification = An exception was not handled in an AsyncLocal<T> notification callback.
-
-
-; FieldAccessException
-FieldAccess_InitOnly = InitOnly (aka ReadOnly) fields can only be initialized in the type/instance constructor.
-
-; FormatException
-Format_AttributeUsage = Duplicate AttributeUsageAttribute found on attribute type {0}.
-Format_Bad7BitInt32 = Too many bytes in what should have been a 7 bit encoded Int32.
-Format_BadBase = Invalid digits for the specified base.
-Format_BadBase64Char = The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
-Format_BadBase64CharArrayLength = Invalid length for a Base-64 char array or string.
-Format_BadBoolean = String was not recognized as a valid Boolean.
-Format_BadDateTime = String was not recognized as a valid DateTime.
-Format_BadDateTimeCalendar = The DateTime represented by the string is not supported in calendar {0}.
-Format_BadDayOfWeek = String was not recognized as a valid DateTime because the day of week was incorrect.
-Format_DateOutOfRange = The DateTime represented by the string is out of range.
-Format_BadDatePattern = Could not determine the order of year, month, and date from '{0}'.
-Format_BadFormatSpecifier = Format specifier was invalid.
-Format_BadTimeSpan = String was not recognized as a valid TimeSpan.
-Format_BadQuote = Cannot find a matching quote character for the character '{0}'.
-Format_EmptyInputString = Input string was either empty or contained only whitespace.
-Format_ExtraJunkAtEnd = Additional non-parsable characters are at the end of the string.
-Format_GuidBrace = Expected {0xdddddddd, etc}.
-Format_GuidComma = Could not find a comma, or the length between the previous token and the comma was zero (i.e., '0x,'etc.).
-Format_GuidBraceAfterLastNumber = Could not find a brace, or the length between the previous token and the brace was zero (i.e., '0x,'etc.).
-Format_GuidDashes = Dashes are in the wrong position for GUID parsing.
-Format_GuidEndBrace = Could not find the ending brace.
-Format_GuidHexPrefix = Expected hex 0x in '{0}'.
-Format_GuidInvLen = Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
-Format_GuidInvalidChar = Guid string should only contain hexadecimal characters.
-Format_GuidUnrecognized = Unrecognized Guid format.
-Format_InvalidEnumFormatSpecification = Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".
-Format_InvalidGuidFormatSpecification = Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x".
-Format_InvalidString = Input string was not in a correct format.
-Format_IndexOutOfRange = Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
-Format_UnknowDateTimeWord = The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}.
-Format_NeedSingleChar = String must be exactly one character long.
-Format_NoParsibleDigits = Could not find any recognizable digits.
-Format_RepeatDateTimePattern = DateTime pattern '{0}' appears more than once with different values.
-Format_StringZeroLength = String cannot have zero length.
-Format_TwoTimeZoneSpecifiers = The String being parsed cannot contain two TimeZone specifiers.
-Format_UTCOutOfRange= The UTC representation of the date falls outside the year range 1-9999.
-Format_OffsetOutOfRange=The time zone offset must be within plus or minus 14 hours.
-Format_MissingIncompleteDate=There must be at least a partial date with a year present in the input.
-
-; IndexOutOfRangeException
-IndexOutOfRange_ArrayRankIndex = Array does not have that many dimensions.
-IndexOutOfRange_IORaceCondition = Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
-IndexOutOfRange_UMSPosition = Unmanaged memory stream position was beyond the capacity of the stream.
-
-; InsufficientMemoryException
-InsufficientMemory_MemFailPoint = Insufficient available memory to meet the expected demands of an operation at this time. Please try again later.
-InsufficientMemory_MemFailPoint_TooBig = Insufficient memory to meet the expected demands of an operation, and this system is likely to never satisfy this request. If this is a 32 bit system, consider booting in 3 GB mode.
-InsufficientMemory_MemFailPoint_VAFrag = Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later.
-
-
-; InvalidCastException
-InvalidCast_DBNull = Object cannot be cast to DBNull.
-InvalidCast_DownCastArrayElement = At least one element in the source array could not be cast down to the destination array type.
-InvalidCast_Empty = Object cannot be cast to Empty.
-InvalidCast_FromDBNull = Object cannot be cast from DBNull to other types.
-InvalidCast_FromTo = Invalid cast from '{0}' to '{1}'.
-InvalidCast_IConvertible = Object must implement IConvertible.
-InvalidCast_OATypeMismatch = OleAut reported a type mismatch.
-InvalidCast_StoreArrayElement = Object cannot be stored in an array of this type.
-InvalidCast_CannotCoerceByRefVariant = Object cannot be coerced to the original type of the ByRef VARIANT it was obtained from.
-InvalidCast_CannotCastNullToValueType = Null object cannot be converted to a value type.
-#if FEATURE_COMINTEROP
-InvalidCast_WinRTIPropertyValueElement = Object in an IPropertyValue is of type '{0}', which cannot be converted to a '{1}'.
-InvalidCast_WinRTIPropertyValueCoersion = Object in an IPropertyValue is of type '{0}' with value '{1}', which cannot be converted to a '{2}'.
-InvalidCast_WinRTIPropertyValueArrayCoersion = Object in an IPropertyValue is of type '{0}' which cannot be convereted to a '{1}' due to array element '{2}': {3}.
-#endif // FEATURE_COMINTEROP
-
-; InvalidOperationException
-InvalidOperation_ActivationArgsAppTrustMismatch = The activation arguments and application trust for the AppDomain must correspond to the same application identity.
-InvalidOperation_AddContextFrozen = Attempted to add properties to a frozen context.
-InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase = This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter.
-InvalidOperation_CantCancelCtrlBreak = Applications may not prevent control-break from terminating their process.
-InvalidOperation_CalledTwice = The method cannot be called twice on the same instance.
-InvalidOperation_CollectionCorrupted = A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.
-InvalidOperation_CriticalTransparentAreMutuallyExclusive = SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time.
-InvalidOperation_ExceptionStateCrossAppDomain = Thread.ExceptionState cannot access an ExceptionState from a different AppDomain.
-InvalidOperation_DebuggerLaunchFailed = Debugger unable to launch.
-InvalidOperation_ApartmentStateSwitchFailed = Failed to set the specified COM apartment state.
-InvalidOperation_EmptyQueue = Queue empty.
-InvalidOperation_EmptyStack = Stack empty.
-InvalidOperation_CannotRemoveFromStackOrQueue = Removal is an invalid operation for Stack or Queue.
-InvalidOperation_EnumEnded = Enumeration already finished.
-InvalidOperation_EnumFailedVersion = Collection was modified; enumeration operation may not execute.
-InvalidOperation_EnumNotStarted = Enumeration has not started. Call MoveNext.
-InvalidOperation_EnumOpCantHappen = Enumeration has either not started or has already finished.
-InvalidOperation_ModifyRONumFmtInfo = Unable to modify a read-only NumberFormatInfo object.
-InvalidOperation_MustBeSameThread = This operation must take place on the same thread on which the object was created.
-InvalidOperation_MustRevertPrivilege = Must revert the privilege prior to attempting this operation.
-InvalidOperation_ReadOnly = Instance is read-only.
-InvalidOperation_RegRemoveSubKey = Registry key has subkeys and recursive removes are not supported by this method.
-InvalidOperation_IComparerFailed = Failed to compare two elements in the array.
-InvalidOperation_InternalState = Invalid internal state.
-InvalidOperation_DuplicatePropertyName = Another property by this name already exists.
-InvalidOperation_NotCurrentDomain = You can only define a dynamic assembly on the current AppDomain.
-InvalidOperation_ContextAlreadyFrozen = Context is already frozen.
-InvalidOperation_WriteOnce = This property has already been set and cannot be modified.
-InvalidOperation_MethodBaked = Type definition of the method is complete.
-InvalidOperation_MethodHasBody = Method already has a body.
-InvalidOperation_ModificationOfNonCanonicalAcl = This access control list is not in canonical form and therefore cannot be modified.
-InvalidOperation_Method = This method is not supported by the current object.
-InvalidOperation_NativeOverlappedReused = NativeOverlapped cannot be reused for multiple operations.
-InvalidOperation_NotADebugModule = Not a debug ModuleBuilder.
-InvalidOperation_NoMultiModuleAssembly = You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.
-InvalidOperation_OpenLocalVariableScope = Local variable scope was not properly closed.
-InvalidOperation_SetVolumeLabelFailed = Volume labels can only be set for writable local volumes.
-InvalidOperation_SetData = An additional permission should not be supplied for setting loader information.
-InvalidOperation_SetData_OnlyOnce = SetData can only be used to set the value of a given name once.
-InvalidOperation_SetData_OnlyLocationURI = SetData cannot be used to set the value for '{0}'.
-InvalidOperation_TypeHasBeenCreated = Unable to change after type has been created.
-InvalidOperation_TypeNotCreated = Type has not been created.
-InvalidOperation_NoUnderlyingTypeOnEnum = Underlying type information on enumeration is not specified.
-InvalidOperation_ResMgrBadResSet_Type = '{0}': ResourceSet derived classes must provide a constructor that takes a String file name and a constructor that takes a Stream.
-InvalidOperation_AssemblyHasBeenSaved = Assembly '{0}' has been saved.
-InvalidOperation_ModuleHasBeenSaved = Module '{0}' has been saved.
-InvalidOperation_CannotAlterAssembly = Unable to alter assembly information.
-InvalidOperation_BadTransientModuleReference = Unable to make a reference to a transient module from a non-transient module.
-InvalidOperation_BadILGeneratorUsage = ILGenerator usage is invalid.
-InvalidOperation_BadInstructionOrIndexOutOfBound = MSIL instruction is invalid or index is out of bounds.
-InvalidOperation_ShouldNotHaveMethodBody = Method body should not exist.
-InvalidOperation_EntryMethodNotDefinedInAssembly = Entry method is not defined in the same assembly.
-InvalidOperation_CantSaveTransientAssembly = Cannot save a transient assembly.
-InvalidOperation_BadResourceContainer = Unable to add resource to transient module or transient assembly.
-InvalidOperation_CantInstantiateAbstractClass = Instances of abstract classes cannot be created.
-InvalidOperation_CantInstantiateFunctionPointer = Instances of function pointers cannot be created.
-InvalidOperation_BadTypeAttributesNotAbstract = Type must be declared abstract if any of its methods are abstract.
-InvalidOperation_BadInterfaceNotAbstract = Interface must be declared abstract.
-InvalidOperation_ConstructorNotAllowedOnInterface = Interface cannot have constructors.
-InvalidOperation_BadMethodBody = Method '{0}' cannot have a method body.
-InvalidOperation_MetaDataError = Metadata operation failed.
-InvalidOperation_BadEmptyMethodBody = Method '{0}' does not have a method body.
-InvalidOperation_EndInvokeCalledMultiple = EndInvoke can only be called once for each asynchronous operation.
-InvalidOperation_EndReadCalledMultiple = EndRead can only be called once for each asynchronous operation.
-InvalidOperation_EndWriteCalledMultiple = EndWrite can only be called once for each asynchronous operation.
-InvalidOperation_AsmLoadedForReflectionOnly = Assembly has been loaded as ReflectionOnly. This API requires an assembly capable of execution.
-InvalidOperation_NoAsmName = Assembly does not have an assembly name. In order to be registered for use by COM, an assembly must have a valid assembly name.
-InvalidOperation_NoAsmCodeBase = Assembly does not have a code base.
-InvalidOperation_HandleIsNotInitialized = Handle is not initialized.
-InvalidOperation_HandleIsNotPinned = Handle is not pinned.
-InvalidOperation_SlotHasBeenFreed = LocalDataStoreSlot storage has been freed.
-InvalidOperation_GlobalsHaveBeenCreated = Type definition of the global function has been completed.
-InvalidOperation_NotAVarArgCallingConvention = Calling convention must be VarArgs.
-InvalidOperation_CannotImportGlobalFromDifferentModule = Unable to import a global method or field from a different module.
-InvalidOperation_NonStaticComRegFunction = COM register function must be static.
-InvalidOperation_NonStaticComUnRegFunction = COM unregister function must be static.
-InvalidOperation_InvalidComRegFunctionSig = COM register function must have a System.Type parameter and a void return type.
-InvalidOperation_InvalidComUnRegFunctionSig = COM unregister function must have a System.Type parameter and a void return type.
-InvalidOperation_MultipleComRegFunctions = Type '{0}' has more than one COM registration function.
-InvalidOperation_MultipleComUnRegFunctions = Type '{0}' has more than one COM unregistration function.
-InvalidOperation_MustCallInitialize = You must call Initialize on this object instance before using it.
-InvalidOperation_MustLockForReadOrWrite = Object must be locked for read or write.
-InvalidOperation_MustLockForWrite = Object must be locked for read.
-InvalidOperation_NoValue = Nullable object must have a value.
-InvalidOperation_ResourceNotStream_Name = Resource '{0}' was not a Stream - call GetObject instead.
-InvalidOperation_ResourceNotString_Name = Resource '{0}' was not a String - call GetObject instead.
-InvalidOperation_ResourceNotString_Type = Resource was of type '{0}' instead of String - call GetObject instead.
-InvalidOperation_ResourceWriterSaved = The resource writer has already been closed and cannot be edited.
-InvalidOperation_UnderlyingArrayListChanged = This range in the underlying list is invalid. A possible cause is that elements were removed.
-InvalidOperation_AnonymousCannotImpersonate = An anonymous identity cannot perform an impersonation.
-InvalidOperation_DefaultConstructorILGen = Unable to access ILGenerator on a constructor created with DefineDefaultConstructor.
-InvalidOperation_DefaultConstructorDefineBody = The method body of the default constructor cannot be changed.
-InvalidOperation_ComputerName = Computer name could not be obtained.
-InvalidOperation_MismatchedAsyncResult = The IAsyncResult object provided does not match this delegate.
-InvalidOperation_PIAMustBeStrongNamed = Primary interop assemblies must be strongly named.
-InvalidOperation_HashInsertFailed = Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously.
-InvalidOperation_UnknownEnumType = Unknown enum type.
-InvalidOperation_GetVersion = OSVersion's call to GetVersionEx failed.
-InvalidOperation_DateTimeParsing = Internal Error in DateTime and Calendar operations.
-InvalidOperation_UserDomainName = UserDomainName native call failed.
-InvalidOperation_WaitOnTransparentProxy = Cannot wait on a transparent proxy.
-InvalidOperation_NoPublicAddMethod = Cannot add the event handler since no public add method exists for the event.
-InvalidOperation_NoPublicRemoveMethod = Cannot remove the event handler since no public remove method exists for the event.
-InvalidOperation_NotSupportedOnWinRTEvent = Adding or removing event handlers dynamically is not supported on WinRT events.
-InvalidOperation_ConsoleKeyAvailableOnFile = Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.
-InvalidOperation_ConsoleReadKeyOnFile = Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
-InvalidOperation_ThreadWrongThreadStart = The thread was created with a ThreadStart delegate that does not accept a parameter.
-InvalidOperation_ThreadAPIsNotSupported = Use CompressedStack.(Capture/Run) or ExecutionContext.(Capture/Run) APIs instead.
-InvalidOperation_NotNewCaptureContext = Cannot apply a context that has been marshaled across AppDomains, that was not acquired through a Capture operation or that has already been the argument to a Set call.
-InvalidOperation_NullContext = Cannot call Set on a null context
-InvalidOperation_CannotCopyUsedContext = Only newly captured contexts can be copied
-InvalidOperation_CannotUseSwitcherOtherThread = Undo operation must be performed on the thread where the corresponding context was Set.
-InvalidOperation_SwitcherCtxMismatch = The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).
-InvalidOperation_CannotOverrideSetWithoutRevert = Must override both HostExecutionContextManager.SetHostExecutionContext and HostExecutionContextManager.Revert.
-InvalidOperation_CannotUseAFCOtherThread = AsyncFlowControl object must be used on the thread where it was created.
-InvalidOperation_CannotRestoreUnsupressedFlow = Cannot restore context flow when it is not suppressed.
-InvalidOperation_CannotSupressFlowMultipleTimes = Context flow is already suppressed.
-InvalidOperation_CannotUseAFCMultiple = AsyncFlowControl object can be used only once to call Undo().
-InvalidOperation_AsyncFlowCtrlCtxMismatch = AsyncFlowControl objects can be used to restore flow only on a Context that had its flow suppressed.
-InvalidOperation_TimeoutsNotSupported = Timeouts are not supported on this stream.
-InvalidOperation_Overlapped_Pack = Cannot pack a packed Overlapped again.
-InvalidOperation_OnlyValidForDS = Adding ACEs with Object Flags and Object GUIDs is only valid for directory-object ACLs.
-InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.
-InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndWrite was called multiple times with the same IAsyncResult.
-InvalidOperation_WrongAsyncResultOrEndCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or the End method was called multiple times with the same IAsyncResult.
-InvalidOperation_NoSecurityDescriptor = The object does not contain a security descriptor.
-InvalidOperation_NotAllowedInReflectionOnly = The requested operation is invalid in the ReflectionOnly context.
-InvalidOperation_NotAllowedInDynamicMethod = The requested operation is invalid for DynamicMethod.
-InvalidOperation_PropertyInfoNotAvailable = This API does not support PropertyInfo tokens.
-InvalidOperation_EventInfoNotAvailable = This API does not support EventInfo tokens.
-InvalidOperation_UnexpectedWin32Error = Unexpected error when calling an operating system function. The returned error code is 0x{0:x}.
-InvalidOperation_AssertTransparentCode = Cannot perform CAS Asserts in Security Transparent methods
-InvalidOperation_NullModuleHandle = The requested operation is invalid when called on a null ModuleHandle.
-InvalidOperation_NotWithConcurrentGC = This API is not available when the concurrent GC is enabled.
-InvalidOperation_WithoutARM = This API is not available when AppDomain Resource Monitoring is not turned on.
-InvalidOperation_NotGenericType = This operation is only valid on generic types.
-InvalidOperation_TypeCannotBeBoxed = The given type cannot be boxed.
-InvalidOperation_HostModifiedSecurityState = The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.
-InvalidOperation_StrongNameKeyPairRequired = A strong name key pair is required to emit a strong-named dynamic assembly.
-#if FEATURE_COMINTEROP
-InvalidOperation_EventTokenTableRequiresDelegate = Type '{0}' is not a delegate type. EventTokenTable may only be used with delegate types.
-#endif // FEATURE_COMINTEROP
-InvalidOperation_NullArray = The underlying array is null.
-;system.security.claims
-InvalidOperation_ClaimCannotBeRemoved = The Claim '{0}' was not able to be removed. It is either not part of this Identity or it is a claim that is owned by the Principal that contains this Identity. For example, the Principal will own the claim when creating a GenericPrincipal with roles. The roles will be exposed through the Identity that is passed in the constructor, but not actually owned by the Identity. Similar logic exists for a RolePrincipal.
-InvalidOperationException_ActorGraphCircular = Actor cannot be set so that circular directed graph will exist chaining the subjects together.
-InvalidOperation_AsyncIOInProgress = The stream is currently in use by a previous operation on the stream.
-InvalidOperation_APIInvalidForCurrentContext = The API '{0}' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information.
-
-; InvalidProgramException
-InvalidProgram_Default = Common Language Runtime detected an invalid program.
-
-; Isolated Storage
-#if FEATURE_ISOSTORE
-IsolatedStorage_AssemblyMissingIdentity = Unable to determine assembly of the caller.
-IsolatedStorage_ApplicationMissingIdentity = Unable to determine application identity of the caller.
-IsolatedStorage_DomainMissingIdentity = Unable to determine domain of the caller.
-IsolatedStorage_AssemblyGrantSet = Unable to determine granted permission for assembly.
-IsolatedStorage_DomainGrantSet = Unable to determine granted permission for domain.
-IsolatedStorage_ApplicationGrantSet = Unable to determine granted permission for application.
-IsolatedStorage_Init = Initialization failed.
-IsolatedStorage_ApplicationNoEvidence = Unable to determine identity of application.
-IsolatedStorage_AssemblyNoEvidence = Unable to determine identity of assembly.
-IsolatedStorage_DomainNoEvidence = Unable to determine the identity of domain.
-IsolatedStorage_DeleteDirectories = Unable to delete; directory or files in the directory could be in use.
-IsolatedStorage_DeleteFile = Unable to delete file.
-IsolatedStorage_CreateDirectory = Unable to create directory.
-IsolatedStorage_DeleteDirectory = Unable to delete, directory not empty or does not exist.
-IsolatedStorage_Operation_ISFS = Operation not permitted on IsolatedStorageFileStream.
-IsolatedStorage_Operation = Operation not permitted.
-IsolatedStorage_Path = Path must be a valid file name.
-IsolatedStorage_FileOpenMode = Invalid mode, see System.IO.FileMode.
-IsolatedStorage_SeekOrigin = Invalid origin, see System.IO.SeekOrigin.
-IsolatedStorage_Scope_U_R_M = Invalid scope, expected User, User|Roaming or Machine.
-IsolatedStorage_Scope_Invalid = Invalid scope.
-IsolatedStorage_Exception = An error occurred while accessing IsolatedStorage.
-IsolatedStorage_QuotaIsUndefined = {0} is not defined for this store. An operation was performed that requires access to {0}. Stores obtained using enumeration APIs do not have a well-defined {0}, since partial evidence is used to open the store.
-IsolatedStorage_CurrentSizeUndefined = Current size cannot be determined for this store.
-IsolatedStorage_DomainUndefined = Domain cannot be determined on an Assembly or Application store.
-IsolatedStorage_ApplicationUndefined = Application cannot be determined on an Assembly or Domain store.
-IsolatedStorage_AssemblyUndefined = Assembly cannot be determined for an Application store.
-IsolatedStorage_StoreNotOpen = Store must be open for this operation.
-IsolatedStorage_OldQuotaLarger = The new quota must be larger than the old quota.
-IsolatedStorage_UsageWillExceedQuota = There is not enough free space to perform the operation.
-IsolatedStorage_NotValidOnDesktop = The Site scope is currently not supported.
-IsolatedStorage_OnlyIncreaseUserApplicationStore = Increasing the quota of this scope is not supported. Only the user application scope’s quota can be increased.
-#endif // FEATURE_ISOSTORE
-
-; Verification Exception
-Verification_Exception = Operation could destabilize the runtime.
-
-; IL stub marshaler exceptions
-Marshaler_StringTooLong = Marshaler restriction: Excessively long string.
-
-; Missing (General)
-MissingConstructor_Name = Constructor on type '{0}' not found.
-MissingField = Field not found.
-MissingField_Name = Field '{0}' not found.
-MissingMember = Member not found.
-MissingMember_Name = Member '{0}' not found.
-MissingMethod_Name = Method '{0}' not found.
-MissingModule = Module '{0}' not found.
-MissingType = Type '{0}' not found.
-
-; MissingManifestResourceException
-Arg_MissingManifestResourceException = Unable to find manifest resource.
-MissingManifestResource_LooselyLinked = Could not find a manifest resource entry called "{0}" in assembly "{1}". Please check spelling, capitalization, and build rules to ensure "{0}" is being linked into the assembly.
-MissingManifestResource_NoNeutralAsm = Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "{0}" was correctly embedded or linked into assembly "{1}" at compile time, or that all the satellite assemblies required are loadable and fully signed.
-MissingManifestResource_NoNeutralDisk = Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
-MissingManifestResource_MultipleBlobs = A case-insensitive lookup for resource file "{0}" in assembly "{1}" found multiple entries. Remove the duplicates or specify the exact case.
-MissingManifestResource_ResWFileNotLoaded = Unable to load resources for resource file "{0}" in package "{1}".
-MissingManifestResource_NoPRIresources = Unable to open Package Resource Index.
-
-; MissingMember
-MissingMemberTypeRef = FieldInfo does not match the target Type.
-MissingMemberNestErr = TypedReference can only be made on nested value Types.
-
-; MissingSatelliteAssemblyException
-MissingSatelliteAssembly_Default = Resource lookup fell back to the ultimate fallback resources in a satellite assembly, but that satellite either was not found or could not be loaded. Please consider reinstalling or repairing the application.
-MissingSatelliteAssembly_Culture_Name = The satellite assembly named "{1}" for fallback culture "{0}" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.
-
-; MulticastNotSupportedException
-Multicast_Combine = Delegates that are not of type MulticastDelegate may not be combined.
-
-; NotImplementedException
-Arg_NotImplementedException = The method or operation is not implemented.
-NotImplemented_ResourcesLongerThan2^63 = Resource files longer than 2^63 bytes are not currently implemented.
-
-; NotSupportedException
-NotSupported_NYI = This feature is not currently implemented.
-NotSupported_AbstractNonCLS = This non-CLS method is not implemented.
-NotSupported_ChangeType = ChangeType operation is not supported.
-NotSupported_ByRefLike = Cannot create boxed ByRef-like values.
-NotSupported_ByRefLike[] = Cannot create arrays of ByRef-like values.
-NotSupported_OpenType = Cannot create arrays of open type.
-NotSupported_DBNullSerial = Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.
-NotSupported_DelegateSerHolderSerial = DelegateSerializationHolder objects are designed to represent a delegate during serialization and are not serializable themselves.
-NotSupported_DelegateCreationFromPT = Application code cannot use Activator.CreateInstance to create types that derive from System.Delegate. Delegate.CreateDelegate can be used instead.
-NotSupported_EncryptionNeedsNTFS = File encryption support only works on NTFS partitions.
-NotSupported_FileStreamOnNonFiles = FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.
-NotSupported_FixedSizeCollection = Collection was of a fixed size.
-NotSupported_KeyCollectionSet = Mutating a key collection derived from a dictionary is not allowed.
-NotSupported_ValueCollectionSet = Mutating a value collection derived from a dictionary is not allowed.
-NotSupported_MemStreamNotExpandable = Memory stream is not expandable.
-NotSupported_ObsoleteResourcesFile = Found an obsolete .resources file in assembly '{0}'. Rebuild that .resources file then rebuild that assembly.
-NotSupported_OleAutBadVarType = The given Variant type is not supported by this OleAut function.
-NotSupported_PopulateData = This Surrogate does not support PopulateData().
-NotSupported_ReadOnlyCollection = Collection is read-only.
-NotSupported_RangeCollection = The specified operation is not supported on Ranges.
-NotSupported_SortedListNestedWrite = This operation is not supported on SortedList nested types because they require modifying the original SortedList.
-NotSupported_SubclassOverride = Derived classes must provide an implementation.
-NotSupported_TypeCannotDeserialized = Direct deserialization of type '{0}' is not supported.
-NotSupported_UnreadableStream = Stream does not support reading.
-NotSupported_UnseekableStream = Stream does not support seeking.
-NotSupported_UnwritableStream = Stream does not support writing.
-NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed = Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.
-NotSupported_Method = Method is not supported.
-NotSupported_Constructor = Object cannot be created through this constructor.
-NotSupported_DynamicModule = The invoked member is not supported in a dynamic module.
-NotSupported_TypeNotYetCreated = The invoked member is not supported before the type is created.
-NotSupported_SymbolMethod = Not supported in an array method of a type definition that is not complete.
-NotSupported_NotDynamicModule = The MethodRental.SwapMethodBody method can only be called to swap the method body of a method in a dynamic module.
-NotSupported_DynamicAssembly = The invoked member is not supported in a dynamic assembly.
-NotSupported_NotAllTypesAreBaked = Type '{0}' was not completed.
-NotSupported_CannotSaveModuleIndividually = Unable to save a ModuleBuilder if it was created underneath an AssemblyBuilder. Call Save on the AssemblyBuilder instead.
-NotSupported_MaxWaitHandles = The number of WaitHandles must be less than or equal to 64.
-NotSupported_IllegalOneByteBranch = Illegal one-byte branch at position: {0}. Requested branch was: {1}.
-NotSupported_OutputStreamUsingTypeBuilder = Output streams do not support TypeBuilders.
-NotSupported_ValueClassCM = Custom marshalers for value types are not currently supported.
-NotSupported_Void[] = Arrays of System.Void are not supported.
-NotSupported_NoParentDefaultConstructor = Parent does not have a default constructor. The default constructor must be explicitly defined.
-NotSupported_NonReflectedType = Not supported in a non-reflected type.
-NotSupported_GlobalFunctionNotBaked = The type definition of the global function is not completed.
-NotSupported_SecurityPermissionUnion = Union is not implemented.
-NotSupported_UnitySerHolder = The UnitySerializationHolder object is designed to transmit information about other types and is not serializable itself.
-NotSupported_UnknownTypeCode = TypeCode '{0}' was not valid.
-NotSupported_WaitAllSTAThread = WaitAll for multiple handles on a STA thread is not supported.
-NotSupported_SignalAndWaitSTAThread = SignalAndWait on a STA thread is not supported.
-NotSupported_CreateInstanceWithTypeBuilder = CreateInstance cannot be used with an object of type TypeBuilder.
-NotSupported_NonUrlAttrOnMBR = UrlAttribute is the only attribute supported for MarshalByRefObject.
-NotSupported_ActivAttrOnNonMBR = Activation Attributes are not supported for types not deriving from MarshalByRefObject.
-NotSupported_ActivAttr = Activation Attributes are not supported.
-NotSupported_ActivForCom = Activation Attributes not supported for COM Objects.
-NotSupported_NoCodepageData = No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
-NotSupported_CodePage50229 = The ISO-2022-CN Encoding (Code page 50229) is not supported.
-NotSupported_DynamicAssemblyNoRunAccess = Cannot execute code on a dynamic assembly without run access.
-NotSupported_IDispInvokeDefaultMemberWithNamedArgs = Invoking default method with named arguments is not supported.
-NotSupported_Type = Type is not supported.
-NotSupported_GetMethod = The 'get' method is not supported on this property.
-NotSupported_SetMethod = The 'set' method is not supported on this property.
-NotSupported_DeclarativeUnion = Declarative unionizing of these permissions is not supported.
-NotSupported_StringComparison = The string comparison type passed in is currently not supported.
-NotSupported_WrongResourceReader_Type = This .resources file should not be read with this reader. The resource reader type is "{0}".
-NotSupported_MustBeModuleBuilder = Module argument must be a ModuleBuilder.
-NotSupported_CallToVarArg = Vararg calling convention not supported.
-NotSupported_TooManyArgs = Stack size too deep. Possibly too many arguments.
-NotSupported_DeclSecVarArg = Assert, Deny, and PermitOnly are not supported on methods with a Vararg calling convention.
-NotSupported_AmbiguousIdentity = The operation is ambiguous because the permission represents multiple identities.
-NotSupported_DynamicMethodFlags = Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported
-NotSupported_GlobalMethodSerialization = Serialization of global methods (including implicit serialization via the use of asynchronous delegates) is not supported.
-NotSupported_InComparableType = A type must implement IComparable<T> or IComparable to support comparison.
-NotSupported_ManagedActivation = Cannot create uninitialized instances of types requiring managed activation.
-NotSupported_ByRefReturn = ByRef return value not supported in reflection invocation.
-NotSupported_DelegateMarshalToWrongDomain = Delegates cannot be marshaled from native code into a domain other than their home domain.
-NotSupported_ResourceObjectSerialization = Cannot read resources that depend on serialization.
-NotSupported_One = The arithmetic type '{0}' cannot represent the number one.
-NotSupported_Zero = The arithmetic type '{0}' cannot represent the number zero.
-NotSupported_MaxValue = The arithmetic type '{0}' does not have a maximum value.
-NotSupported_MinValue = The arithmetic type '{0}' does not have a minimum value.
-NotSupported_PositiveInfinity = The arithmetic type '{0}' cannot represent positive infinity.
-NotSupported_NegativeInfinity = The arithmetic type '{0}' cannot represent negative infinity.
-NotSupported_UmsSafeBuffer = This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer.
-NotSupported_Reading = Accessor does not support reading.
-NotSupported_Writing = Accessor does not support writing.
-NotSupported_UnsafePointer = This accessor was created with a SafeBuffer; use the SafeBuffer to gain access to the pointer.
-NotSupported_CollectibleCOM = COM Interop is not supported for collectible types.
-NotSupported_CollectibleAssemblyResolve = Resolving to a collectible assembly is not supported.
-NotSupported_CollectibleBoundNonCollectible = A non-collectible assembly may not reference a collectible assembly.
-NotSupported_CollectibleDelegateMarshal = Delegate marshaling for types within collectible assemblies is not supported.
-NotSupported_NonStaticMethod = Non-static methods with NativeCallableAttribute are not supported.
-NotSupported_NativeCallableTarget = Methods with NativeCallableAttribute cannot be used as delegate target.
-NotSupported_GenericMethod = Generic methods with NativeCallableAttribute are not supported.
-NotSupported_NonBlittableTypes = Non-blittable parameter types are not supported for NativeCallable methods.
-
-NotSupported_UserDllImport = DllImport cannot be used on user-defined methods.
-NotSupported_UserCOM = COM Interop is not supported for user-defined types.
-
-#if FEATURE_APPX
-NotSupported_AppX = {0} is not supported in AppX.
-LoadOfFxAssemblyNotSupported_AppX = {0} of .NET Framework assemblies is not supported in AppX.
-#endif
-#if FEATURE_COMINTEROP
-NotSupported_WinRT_PartialTrust = Windows Runtime is not supported in partial trust.
-#endif // FEATURE_COMINTEROP
-; ReflectionTypeLoadException
-ReflectionTypeLoad_LoadFailed = Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
-#if FEATURE_COMINTEROP
-NotSupported_PIAInAppxProcess = A Primary Interop Assembly is not supported in AppX.
-#endif
-NotSupported_AssemblyLoadCodeBase = Assembly.Load with a Codebase is not supported.
-NotSupported_AssemblyLoadFromHash = Assembly.LoadFrom with hashValue is not supported.
-NotSupported_CannotCallEqualsOnSpan = Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.
-NotSupported_CannotCallGetHashCodeOnSpan = GetHashCode() on Span and ReadOnlySpan is not supported.
-NotSupported_ReflectionOnlyLoad = Assembly.ReflectionOnlyLoad is not supported.
-NotSupported_ReflectionOnlyGetType = Type.ReflectionOnlyGetType is not supported.
-
-; TypeLoadException
-TypeLoad_ResolveType = Could not resolve type '{0}'.
-TypeLoad_ResolveTypeFromAssembly = Could not resolve type '{0}' in assembly '{1}'.
-TypeLoad_ResolveNestedType = Could not resolve nested type '{0}' in type "{1}'.
-FileNotFound_ResolveAssembly = Could not resolve assembly '{0}'.
-
-; NullReferenceException
-NullReference_This = The pointer for this method was null.
-
-; ObjectDisposedException
-ObjectDisposed_Generic = Cannot access a disposed object.
-ObjectDisposed_FileClosed = Cannot access a closed file.
-ObjectDisposed_ObjectName_Name = Object name: '{0}'.
-ObjectDisposed_ReaderClosed = Cannot read from a closed TextReader.
-ObjectDisposed_ResourceSet = Cannot access a closed resource set.
-ObjectDisposed_RegKeyClosed = Cannot access a closed registry key.
-ObjectDisposed_StreamClosed = Cannot access a closed Stream.
-ObjectDisposed_WriterClosed = Cannot write to a closed TextWriter.
-ObjectDisposed_ViewAccessorClosed = Cannot access a closed accessor.
-
-; OperationCanceledException
-OperationCanceled = The operation was canceled.
-
-; OutOfMemoryException
-OutOfMemory_GCHandleMDA = The GCHandle MDA has run out of available cookies.
-
-; OverflowException
-Overflow_Byte = Value was either too large or too small for an unsigned byte.
-Overflow_Char = Value was either too large or too small for a character.
-Overflow_Currency = Value was either too large or too small for a Currency.
-Overflow_Decimal = Value was either too large or too small for a Decimal.
-Overflow_Int16 = Value was either too large or too small for an Int16.
-Overflow_Int32 = Value was either too large or too small for an Int32.
-Overflow_Int64 = Value was either too large or too small for an Int64.
-Overflow_NegateTwosCompNum = Negating the minimum value of a twos complement number is invalid.
-Overflow_NegativeUnsigned = The string was being parsed as an unsigned number and could not have a negative sign.
-Overflow_SByte = Value was either too large or too small for a signed byte.
-Overflow_Single = Value was either too large or too small for a Single.
-Overflow_Double = Value was either too large or too small for a Double.
-Overflow_TimeSpanTooLong = TimeSpan overflowed because the duration is too long.
-Overflow_TimeSpanElementTooLarge = The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits.
-Overflow_Duration = The duration cannot be returned for TimeSpan.MinValue because the absolute value of TimeSpan.MinValue exceeds the value of TimeSpan.MaxValue.
-Overflow_UInt16 = Value was either too large or too small for a UInt16.
-Overflow_UInt32 = Value was either too large or too small for a UInt32.
-Overflow_UInt64 = Value was either too large or too small for a UInt64.
-
-; PlatformNotsupportedException
-PlatformNotSupported_RequiresLonghorn = This operation is only supported on Windows Vista and above.
-PlatformNotSupported_RequiresNT = This operation is only supported on Windows 2000, Windows XP, and higher.
-PlatformNotSupported_RequiresW2kSP3 = This operation is only supported on Windows 2000 SP3 or later operating systems.
-#if FEATURE_COMINTEROP
-PlatformNotSupported_WinRT = Windows Runtime is not supported on this operating system.
-#endif // FEATURE_COMINTEROP
-
-; PolicyException
-; This still appears in bcl.small but should go away eventually
-Policy_Default = Error occurred while performing a policy operation.
-Policy_CannotLoadSemiTrustAssembliesDuringInit = All assemblies loaded as part of AppDomain initialization must be fully trusted.
-Policy_SaveNotFileBased = PolicyLevel object not based on a file cannot be saved.
-Policy_AppTrustMustGrantAppRequest = ApplicationTrust grant set does not contain ActivationContext's minimum request set.
-
-Error_SecurityPolicyFileParse = Error occurred while parsing the '{0}' policy level. The default policy level was used instead.
-Error_SecurityPolicyFileParseEx = Error '{1}' occurred while parsing the '{0}' policy level. The default policy level was used instead.
-
-; RankException
-Rank_MultiDimNotSupported = Only single dimension arrays are supported here.
-Rank_MustMatch = The specified arrays must have the same number of dimensions.
-
-; TypeInitializationException
-TypeInitialization_Default = Type constructor threw an exception.
-TypeInitialization_Type = The type initializer for '{0}' threw an exception.
-
-; TypeLoadException
-
-
-;
-; Reflection exceptions
-;
-RtType.InvalidCaller = Caller is not a friend.
-
-;CustomAttributeFormatException
-RFLCT.InvalidPropFail = '{0}' property specified was not found.
-RFLCT.InvalidFieldFail = '{0}' field specified was not found.
-
-;InvalidFilterCriteriaException
-RFLCT.FltCritString = A String must be provided for the filter criteria.
-RFLCT.FltCritInt = An Int32 must be provided for the filter criteria.
-
-; TargetException
-RFLCT.Targ_ITargMismatch = Object does not match target type.
-RFLCT.Targ_StatMethReqTarg = Non-static method requires a target.
-RFLCT.Targ_StatFldReqTarg = Non-static field requires a target.
-
-;AmbiguousMatchException
-RFLCT.Ambiguous = Ambiguous match found.
-RFLCT.AmbigCust = Multiple custom attributes of the same type found.
-
-;
-; Remoting exceptions
-;
-Remoting_AppDomainUnloaded_ThreadUnwound = The application domain in which the thread was running has been unloaded.
-Remoting_AppDomainUnloaded = The target application domain has been unloaded.
-Remoting_CantRemotePointerType = Pointer types cannot be passed in a remote call.
-Remoting_TypeCantBeRemoted = The given type cannot be passed in a remote call.
-Remoting_Delegate_TooManyTargets = The delegate must have only one target.
-Remoting_InvalidContext = The context is not valid.
-Remoting_InvalidValueTypeFieldAccess = An attempt was made to calculate the address of a value type field on a remote object. This was likely caused by an attempt to directly get or set the value of a field within this embedded value type. Avoid this and instead provide and use access methods for each field in the object that will be accessed remotely.
-Remoting_Message_BadRetValOrOutArg = Bad return value or out-argument inside the return message.
-Remoting_NonPublicOrStaticCantBeCalledRemotely = Permission denied: cannot call non-public or static methods remotely.
-Remoting_Proxy_ProxyTypeIsNotMBR = classToProxy argument must derive from MarshalByRef type.
-Remoting_TP_NonNull = The transparent proxy field of a real proxy must be null.
-
-; Resources exceptions
-;
-Resources_StreamNotValid = Stream is not a valid resource file.
-ResourceReaderIsClosed = ResourceReader is closed.
-
-; RuntimeWrappedException
-RuntimeWrappedException = An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.
-
-; UnauthorizedAccessException
-UnauthorizedAccess_MemStreamBuffer = MemoryStream's internal buffer cannot be accessed.
-UnauthorizedAccess_IODenied_Path = Access to the path '{0}' is denied.
-UnauthorizedAccess_IODenied_NoPathName = Access to the path is denied.
-UnauthorizedAccess_RegistryKeyGeneric_Key = Access to the registry key '{0}' is denied.
-UnauthorizedAccess_RegistryNoWrite = Cannot write to the registry key.
-UnauthorizedAccess_SystemDomain = Cannot execute an assembly in the system domain.
-
-;
-; Security exceptions
-;
-
-;SecurityException
-; These still appear in bcl.small but should go away eventually
-Security_Generic = Request for the permission of type '{0}' failed.
-Security_GenericNoType = Request failed.
-Security_NoAPTCA = That assembly does not allow partially trusted callers.
-Security_RegistryPermission = Requested registry access is not allowed.
-Security_MustRevertOverride = Stack walk modifier must be reverted before another modification of the same type can be performed.
-
-;
-; HostProtection exceptions
-;
-
-HostProtection_HostProtection = Attempted to perform an operation that was forbidden by the CLR host.
-HostProtection_ProtectedResources = The protected resources (only available with full trust) were:
-HostProtection_DemandedResources = The demanded resources were:
-
-;
-; IO exceptions
-;
-
-; EOFException
-IO.EOF_ReadBeyondEOF = Unable to read beyond the end of the stream.
-
-; FileNotFoundException
-IO.FileNotFound = Unable to find the specified file.
-IO.FileNotFound_FileName = Could not find file '{0}'.
-IO.FileName_Name = File name: '{0}'
-IO.FileLoad = Could not load the specified file.
-
-; IOException
-IO.IO_AlreadyExists_Name = Cannot create "{0}" because a file or directory with the same name already exists.
-IO.IO_BindHandleFailed = BindHandle for ThreadPool failed on this handle.
-IO.IO_FileExists_Name = The file '{0}' already exists.
-IO.IO_FileStreamHandlePosition = The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss.
-IO.IO_FileTooLong2GB = The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.
-IO.IO_FileTooLongOrHandleNotSync = IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations.
-IO.IO_FixedCapacity = Unable to expand length of this stream beyond its capacity.
-IO.IO_InvalidStringLen_Len = BinaryReader encountered an invalid string length of {0} characters.
-IO.IO_NoConsole = There is no console.
-IO.IO_NoPermissionToDirectoryName = <Path discovery permission to the specified directory was denied.>
-IO.IO_SeekBeforeBegin = An attempt was made to move the position before the beginning of the stream.
-IO.IO_SeekAppendOverwrite = Unable seek backward to overwrite data that previously existed in a file opened in Append mode.
-IO.IO_SetLengthAppendTruncate = Unable to truncate data that previously existed in a file opened in Append mode.
-IO.IO_SharingViolation_File = The process cannot access the file '{0}' because it is being used by another process.
-IO.IO_SharingViolation_NoFileName = The process cannot access the file because it is being used by another process.
-IO.IO_StreamTooLong = Stream was too long.
-IO.IO_CannotCreateDirectory = The specified directory '{0}' cannot be created.
-IO.IO_SourceDestMustBeDifferent = Source and destination path must be different.
-IO.IO_SourceDestMustHaveSameRoot = Source and destination path must have identical roots. Move will not work across volumes.
-
-; DirectoryNotFoundException
-IO.DriveNotFound_Drive = Could not find the drive '{0}'. The drive might not be ready or might not be mapped.
-IO.PathNotFound_Path = Could not find a part of the path '{0}'.
-IO.PathNotFound_NoPathName = Could not find a part of the path.
-
-; PathTooLongException
-IO.PathTooLong = The specified file name or path is too long, or a component of the specified path is too long.
-
-; SecurityException
-FileSecurityState_OperationNotPermitted = File operation not permitted. Access to path '{0}' is denied.
-
-; PrivilegeNotHeldException
-PrivilegeNotHeld_Default = The process does not possess some privilege required for this operation.
-PrivilegeNotHeld_Named = The process does not possess the '{0}' privilege which is required for this operation.
-
-; General strings used in the IO package
-IO_UnknownFileName = [Unknown]
-IO_StreamWriterBufferedDataLost = A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2}
-IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled = callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).
-
-;
-; Serialization Exceptions
-;
-; SerializationException
-Serialization_InvalidData=An error occurred while deserializing the object. The serialized data is corrupt.
-Serialization_InvalidPtrValue = An IntPtr or UIntPtr with an eight byte value cannot be deserialized on a machine with a four byte word size.
-Serialization_MemberTypeNotRecognized = Unknown member type.
-Serialization_InsufficientState = Insufficient state to return the real object.
-Serialization_InvalidFieldState = Object fields may not be properly initialized.
-Serialization_MissField = Field {0} is missing.
-Serialization_NullSignature = The method signature cannot be null.
-Serialization_UnknownMember = Cannot get the member '{0}'.
-Serialization_InsufficientDeserializationState = Insufficient state to deserialize the object. Missing field '{0}'. More information is needed.
-Serialization_UnableToFindModule = The given module {0} cannot be found within the assembly {1}.
-Serialization_InvalidOnDeser = OnDeserialization method was called while the object was not being deserialized.
-Serialization_MissingKeys = The Keys for this Hashtable are missing.
-Serialization_MissingValues = The values for this dictionary are missing.
-Serialization_NullKey = One of the serialized keys is null.
-Serialization_KeyValueDifferentSizes = The keys and values arrays have different sizes.
-Serialization_SameNameTwice = Cannot add the same member twice to a SerializationInfo object.
-Serialization_BadParameterInfo = Non existent ParameterInfo. Position bigger than member's parameters length.
-Serialization_NoParameterInfo = Serialized member does not have a ParameterInfo.
-Serialization_NotFound = Member '{0}' was not found.
-Serialization_StringBuilderMaxCapacity = The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length.
-Serialization_StringBuilderCapacity = The serialized Capacity property of StringBuilder must be positive, less than or equal to MaxCapacity and greater than or equal to the String length.
-Serialization_InvalidDelegateType = Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.
-Serialization_OptionalFieldVersionValue = Version value must be positive.
-Serialization_MissingDateTimeData = Invalid serialized DateTime data. Unable to find 'ticks' or 'dateData'.
-Serialization_DateTimeTicksOutOfRange = Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
-; The following serialization exception messages appear in native resources too (mscorrc.rc)
-Serialization_MemberOutOfRange = The deserialized value of the member "{0}" in the class "{1}" is out of range.
-
-#if FEATURE_SERIALIZATION
-Serialization_NoID = Object has never been assigned an objectID.
-Serialization_UnknownMemberInfo = Only FieldInfo, PropertyInfo, and SerializationMemberInfo are recognized.
-Serialization_UnableToFixup = Cannot perform fixup.
-Serialization_NoType = Object does not specify a type.
-Serialization_ValueTypeFixup = ValueType fixup on Arrays is not implemented.
-Serialization_PartialValueTypeFixup = Fixing up a partially available ValueType chain is not implemented.
-Serialization_InvalidID = Object specifies an invalid ID.
-Serialization_DuplicateSelector = Selector is already on the list of checked selectors.
-Serialization_NoBaseType = Object does not specify a base type.
-Serialization_ArrayNoLength = Array does not specify a length.
-Serialization_CannotGetType = Cannot get the type '{0}'.
-Serialization_AssemblyNotFound = Unable to find assembly '{0}'.
-Serialization_ArrayInvalidLength = Array specifies an invalid length.
-Serialization_MalformedArray = The array information in the stream is invalid.
-Serialization_MultipleMembers = Cannot resolve multiple members with the same name.
-Serialization_ObjectUsedBeforeDeserCallback = An object was used before its deserialization callback ran, which may break higher-level consistency guarantees in the application.
-Serialization_RegisterTwice = An object cannot be registered twice.
-Serialization_IdTooSmall = Object IDs must be greater than zero.
-Serialization_TooManyReferences = The implementation of the IObjectReference interface returns too many nested references to other objects that implement IObjectReference.
-Serialization_NotISer = The given object does not implement the ISerializable interface.
-Serialization_MissingKeyValuePairs = The KeyValuePairs for this Dictionary are missing.
-Serialization_SurrogateCycleInArgument = Selector contained a cycle.
-Serialization_SurrogateCycle = Adding selector will introduce a cycle.
-Serialization_NeverSeen = A fixup is registered to the object with ID {0}, but the object does not appear in the graph.
-Serialization_IORIncomplete = The object with ID {0} implements the IObjectReference interface for which all dependencies cannot be resolved. The likely cause is two instances of IObjectReference that have a mutual dependency on each other.
-Serialization_NotCyclicallyReferenceableSurrogate = {0}.SetObjectData returns a value that is neither null nor equal to the first parameter. Such Surrogates cannot be part of cyclical reference.
-Serialization_ObjectNotSupplied = The object with ID {0} was referenced in a fixup but does not exist.
-Serialization_TooManyElements = The internal array cannot expand to greater than Int32.MaxValue elements.
-Serialization_InvalidType = Only system-provided types can be passed to the GetUninitializedObject method. '{0}' is not a valid instance of a type.
-Serialization_MissingObject = The object with ID {0} was referenced in a fixup but has not been registered.
-Serialization_InvalidFixupType = A member fixup was registered for an object which implements ISerializable or has a surrogate. In this situation, a delayed fixup must be used.
-Serialization_InvalidFixupDiscovered = A fixup on an object implementing ISerializable or having a surrogate was discovered for an object which does not have a SerializationInfo available.
-Serialization_InvalidFormat = The input stream is not a valid binary format. The starting contents (in bytes) are: {0} ...
-Serialization_ParentChildIdentical = The ID of the containing object cannot be the same as the object ID.
-Serialization_IncorrectNumberOfFixups = The ObjectManager found an invalid number of fixups. This usually indicates a problem in the Formatter.
-; The following serialization exception messages appear in native resources too (mscorrc.rc)
-Serialization_NonSerType = Type '{0}' in Assembly '{1}' is not marked as serializable.
-Serialization_ConstructorNotFound = The constructor to deserialize an object of type '{0}' was not found.
-
-; SerializationException used by Formatters
-Serialization_ArrayType = Invalid array type '{0}'.
-Serialization_ArrayTypeObject = Array element type is Object, 'dt' attribute is null.
-Serialization_Assembly = No assembly information is available for object on the wire, '{0}'.
-Serialization_AssemblyId = No assembly ID for object type '{0}'.
-Serialization_BinaryHeader = Binary stream '{0}' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.
-Serialization_CrossAppDomainError = Cross-AppDomain BinaryFormatter error; expected '{0}' but received '{1}'.
-Serialization_CorruptedStream = Invalid BinaryFormatter stream.
-Serialization_HeaderReflection = Header reflection error: number of value members: {0}.
-Serialization_ISerializableTypes = Types not available for ISerializable object '{0}'.
-Serialization_ISerializableMemberInfo = MemberInfo requested for ISerializable type.
-Serialization_MBRAsMBV = Type {0} must be marshaled by reference in this context.
-Serialization_Map = No map for object '{0}'.
-Serialization_MemberInfo = MemberInfo cannot be obtained for ISerialized Object '{0}'.
-Serialization_Method = Invalid MethodCall or MethodReturn stream format.
-Serialization_MissingMember = Member '{0}' in class '{1}' is not present in the serialized stream and is not marked with {2}.
-Serialization_NoMemberInfo = No MemberInfo for Object {0}.
-Serialization_ObjNoID = Object {0} has never been assigned an objectID.
-Serialization_ObjectTypeEnum = Invalid ObjectTypeEnum {0}.
-Serialization_ParseError = Parse error. Current element is not compatible with the next element, {0}.
-Serialization_SerMemberInfo = MemberInfo type {0} cannot be serialized.
-Serialization_Stream = Attempting to deserialize an empty stream.
-Serialization_StreamEnd = End of Stream encountered before parsing was completed.
-Serialization_TopObject = No top object.
-Serialization_TopObjectInstantiate = Top object cannot be instantiated for element '{0}'.
-Serialization_TypeCode = Invalid type code in stream '{0}'.
-Serialization_TypeExpected = Invalid expected type.
-Serialization_TypeMissing = Type is missing for member of type Object '{0}'.
-Serialization_TypeRead = Invalid read type request '{0}'.
-Serialization_TypeSecurity = Type {0} and the types derived from it (such as {1}) are not permitted to be deserialized at this security level.
-Serialization_TypeWrite = Invalid write type request '{0}'.
-Serialization_XMLElement = Invalid element '{0}'.
-Serialization_Security = Because of security restrictions, the type {0} cannot be accessed.
-Serialization_TypeLoadFailure = Unable to load type {0} required for deserialization.
-Serialization_RequireFullTrust = A type '{0}' that is defined in a partially trusted assembly cannot be type forwarded from an assembly with a different Public Key Token or without a public key token. To fix this, please either turn on unsafeTypeForwarding flag in the configuration file or remove the TypeForwardedFrom attribute.
-; The following serialization exception messages appear in native resources too (mscorrc.rc)
-Serialization_TypeResolved = Type is not resolved for member '{0}'.
-Serialization_MemberOutOfRange = The deserialized value of the member "{0}" in the class "{1}" is out of range.
-#endif // FEATURE_SERIALIZATION
-
-;
-; StringBuilder Exceptions
-;
-Arg_LongerThanSrcString = Source string was not long enough. Check sourceIndex and count.
-
-
-;
-; System.Threading
-;
-
-;
-; Thread Exceptions
-;
-ThreadState_NoAbortRequested = Unable to reset abort because no abort was requested.
-Threading.WaitHandleTooManyPosts = The WaitHandle cannot be signaled because it would exceed its maximum count.
-;
-; WaitHandleCannotBeOpenedException
-;
-Threading.WaitHandleCannotBeOpenedException = No handle of the given name exists.
-Threading.WaitHandleCannotBeOpenedException_InvalidHandle = A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name.
-
-;
-; AbandonedMutexException
-;
-Threading.AbandonedMutexException = The wait completed due to an abandoned mutex.
-
-; AggregateException
-AggregateException_ctor_DefaultMessage=One or more errors occurred.
-AggregateException_ctor_InnerExceptionNull=An element of innerExceptions was null.
-AggregateException_DeserializationFailure=The serialization stream contains no inner exceptions.
-AggregateException_ToString={0}{1}---> (Inner Exception #{2}) {3}{4}{5}
-
-; Cancellation
-CancellationToken_CreateLinkedToken_TokensIsEmpty=No tokens were supplied.
-CancellationTokenSource_Disposed=The CancellationTokenSource has been disposed.
-CancellationToken_SourceDisposed=The CancellationTokenSource associated with this CancellationToken has been disposed.
-
-; Exceptions shared by all concurrent collection
-ConcurrentCollection_SyncRoot_NotSupported=The SyncRoot property may not be used for the synchronization of concurrent collections.
-
-; Exceptions shared by ConcurrentStack and ConcurrentQueue
-ConcurrentStackQueue_OnDeserialization_NoData=The serialization stream contains no elements.
-
-; ConcurrentStack<T>
-ConcurrentStack_PushPopRange_StartOutOfRange=The startIndex argument must be greater than or equal to zero.
-ConcurrentStack_PushPopRange_CountOutOfRange=The count argument must be greater than or equal to zero.
-ConcurrentStack_PushPopRange_InvalidCount=The sum of the startIndex and count arguments must be less than or equal to the collection's Count.
-
-; ConcurrentDictionary<TKey, TValue>
-ConcurrentDictionary_ItemKeyIsNull=TKey is a reference type and item.Key is null.
-ConcurrentDictionary_SourceContainsDuplicateKeys=The source argument contains duplicate keys.
-ConcurrentDictionary_IndexIsNegative=The index argument is less than zero.
-ConcurrentDictionary_ConcurrencyLevelMustBePositive=The concurrencyLevel argument must be positive.
-ConcurrentDictionary_CapacityMustNotBeNegative=The capacity argument must be greater than or equal to zero.
-ConcurrentDictionary_ArrayNotLargeEnough=The index is equal to or greater than the length of the array, or the number of elements in the dictionary is greater than the available space from index to the end of the destination array.
-ConcurrentDictionary_ArrayIncorrectType=The array is multidimensional, or the type parameter for the set cannot be cast automatically to the type of the destination array.
-ConcurrentDictionary_KeyAlreadyExisted=The key already existed in the dictionary.
-ConcurrentDictionary_TypeOfKeyIncorrect=The key was of an incorrect type for this dictionary.
-ConcurrentDictionary_TypeOfValueIncorrect=The value was of an incorrect type for this dictionary.
-
-; Partitioner
-Partitioner_DynamicPartitionsNotSupported=Dynamic partitions are not supported by this partitioner.
-
-; OrderablePartitioner
-OrderablePartitioner_GetPartitions_WrongNumberOfPartitions=GetPartitions returned an incorrect number of partitions.
-
-; PartitionerStatic
-PartitionerStatic_CurrentCalledBeforeMoveNext=MoveNext must be called at least once before calling Current.
-PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed=Can not call GetEnumerator on partitions after the source enumerable is disposed
-
-; CDSCollectionETWBCLProvider events
-event_ConcurrentStack_FastPushFailed=Push to ConcurrentStack spun {0} time(s).
-event_ConcurrentStack_FastPopFailed=Pop from ConcurrentStack spun {0} time(s).
-event_ConcurrentDictionary_AcquiringAllLocks=ConcurrentDictionary acquiring all locks on {0} bucket(s).
-event_ConcurrentBag_TryTakeSteals=ConcurrentBag stealing in TryTake.
-event_ConcurrentBag_TryPeekSteals=ConcurrentBag stealing in TryPeek.
-
-; CountdownEvent
-CountdownEvent_Decrement_BelowZero=Invalid attempt made to decrement the event's count below zero.
-CountdownEvent_Increment_AlreadyZero=The event is already signaled and cannot be incremented.
-CountdownEvent_Increment_AlreadyMax=The increment operation would cause the CurrentCount to overflow.
-
-; Parallel
-Parallel_Invoke_ActionNull=One of the actions was null.
-Parallel_ForEach_OrderedPartitionerKeysNotNormalized=This method requires the use of an OrderedPartitioner with the KeysNormalized property set to true.
-Parallel_ForEach_PartitionerNotDynamic=The Partitioner used here must support dynamic partitioning.
-Parallel_ForEach_PartitionerReturnedNull=The Partitioner used here returned a null partitioner source.
-Parallel_ForEach_NullEnumerator=The Partitioner source returned a null enumerator.
-
-; Semaphore
-Argument_SemaphoreInitialMaximum=The initial count for the semaphore must be greater than or equal to zero and less than the maximum count.
-
-; SemaphoreFullException
-Threading_SemaphoreFullException=Adding the specified count to the semaphore would cause it to exceed its maximum count.
-
-; Lazy
-Lazy_ctor_ValueSelectorNull=The valueSelector argument is null.
-Lazy_ctor_InfoNull=The info argument is null.
-Lazy_ctor_deserialization_ValueInvalid=The Value cannot be null.
-Lazy_ctor_ModeInvalid=The mode argument specifies an invalid value.
-Lazy_CreateValue_NoParameterlessCtorForT=The lazily-initialized type does not have a public, parameterless constructor.
-Lazy_StaticInit_InvalidOperation=ValueFactory returned null.
-Lazy_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance.
-Lazy_ToString_ValueNotCreated=Value is not created.
-
-
-;ThreadLocal
-ThreadLocal_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance.
-ThreadLocal_Disposed=The ThreadLocal object has been disposed.
-ThreadLocal_ValuesNotAvailable=The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true.
-
-; SemaphoreSlim
-SemaphoreSlim_ctor_InitialCountWrong=The initialCount argument must be non-negative and less than or equal to the maximumCount.
-SemaphoreSlim_ctor_MaxCountWrong=The maximumCount argument must be a positive number. If a maximum is not required, use the constructor without a maxCount parameter.
-SemaphoreSlim_Wait_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive.
-SemaphoreSlim_Release_CountWrong=The releaseCount argument must be greater than zero.
-SemaphoreSlim_Disposed=The semaphore has been disposed.
-
-; ManualResetEventSlim
-ManualResetEventSlim_ctor_SpinCountOutOfRange=The spinCount argument must be in the range 0 to {0}, inclusive.
-ManualResetEventSlim_ctor_TooManyWaiters=There are too many threads currently waiting on the event. A maximum of {0} waiting threads are supported.
-ManualResetEventSlim_Disposed=The event has been disposed.
-
-; SpinLock
-SpinLock_TryEnter_ArgumentOutOfRange=The timeout must be a value between -1 and Int32.MaxValue, inclusive.
-SpinLock_TryEnter_LockRecursionException=The calling thread already holds the lock.
-SpinLock_TryReliableEnter_ArgumentException=The tookLock argument must be set to false before calling this method.
-SpinLock_Exit_SynchronizationLockException=The calling thread does not hold the lock.
-SpinLock_IsHeldByCurrentThread=Thread tracking is disabled.
-
-; SpinWait
-SpinWait_SpinUntil_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive.
-SpinWait_SpinUntil_ArgumentNull=The condition argument is null.
-
-; CdsSyncEtwBCLProvider events
-event_SpinLock_FastPathFailed=SpinLock beginning to spin.
-event_SpinWait_NextSpinWillYield=Next spin will yield.
-event_Barrier_PhaseFinished=Barrier finishing phase {1}.
-
-#if PLATFORM_UNIX
-; Unix threading
-PlatformNotSupported_NamedSynchronizationPrimitives=The named version of this synchronization primitive is not supported on this platform.
-PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll=Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.
-#endif
-
-;
-; System.Threading.Tasks
-;
-
-; AsyncMethodBuilder
-AsyncMethodBuilder_InstanceNotInitialized=The builder was not properly initialized.
-
-; TaskAwaiter and YieldAwaitable
-AwaitableAwaiter_InstanceNotInitialized=The awaitable or awaiter was not properly initialized.
-TaskAwaiter_TaskNotCompleted=The awaited task has not yet completed.
-
-; Task<T>
-TaskT_SetException_HasAnInitializer=A task's Exception may only be set directly if the task was created without a function.
-TaskT_TransitionToFinal_AlreadyCompleted=An attempt was made to transition a task to a final state when it had already completed.
-TaskT_ctor_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating for a Task<TResult>.
-TaskT_DebuggerNoResult={Not yet computed}
-
-; Task
-Task_ctor_LRandSR=(Internal)An attempt was made to create a LongRunning SelfReplicating task.
-Task_ThrowIfDisposed=The task has been disposed.
-Task_Dispose_NotCompleted=A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).
-Task_Start_Promise=Start may not be called on a promise-style task.
-Task_Start_AlreadyStarted=Start may not be called on a task that was already started.
-Task_Start_TaskCompleted=Start may not be called on a task that has completed.
-Task_Start_ContinuationTask=Start may not be called on a continuation task.
-Task_RunSynchronously_AlreadyStarted=RunSynchronously may not be called on a task that was already started.
-Task_RunSynchronously_TaskCompleted=RunSynchronously may not be called on a task that has already completed.
-Task_RunSynchronously_Promise=RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.
-Task_RunSynchronously_Continuation=RunSynchronously may not be called on a continuation task.
-Task_ContinueWith_NotOnAnything=The specified TaskContinuationOptions excluded all continuation kinds.
-Task_ContinueWith_ESandLR=The specified TaskContinuationOptions combined LongRunning and ExecuteSynchronously. Synchronous continuations should not be long running.
-Task_MultiTaskContinuation_NullTask=The tasks argument included a null value.
-Task_MultiTaskContinuation_FireOptions=It is invalid to exclude specific continuation kinds for continuations off of multiple tasks.
-Task_MultiTaskContinuation_EmptyTaskList=The tasks argument contains no tasks.
-Task_FromAsync_TaskManagerShutDown=FromAsync was called with a TaskManager that had already shut down.
-Task_FromAsync_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating in calls to FromAsync.
-Task_FromAsync_LongRunning=It is invalid to specify TaskCreationOptions.LongRunning in calls to FromAsync.
-Task_FromAsync_PreferFairness=It is invalid to specify TaskCreationOptions.PreferFairness in calls to FromAsync.
-Task_WaitMulti_NullTask=The tasks array included at least one null element.
-Task_Delay_InvalidMillisecondsDelay=The value needs to be either -1 (signifying an infinite timeout), 0 or a positive integer.
-Task_Delay_InvalidDelay=The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0 or a positive integer less than or equal to Int32.MaxValue.
-
-; TaskCanceledException
-TaskCanceledException_ctor_DefaultMessage=A task was canceled.
-
-;TaskCompletionSource<T>
-TaskCompletionSourceT_TrySetException_NullException=The exceptions collection included at least one null element.
-TaskCompletionSourceT_TrySetException_NoExceptions=The exceptions collection was empty.
-
-;TaskExceptionHolder
-TaskExceptionHolder_UnknownExceptionType=(Internal)Expected an Exception or an IEnumerable<Exception>
-TaskExceptionHolder_UnhandledException=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
-
-; TaskScheduler
-TaskScheduler_ExecuteTask_TaskAlreadyExecuted=ExecuteTask may not be called for a task which was already executed.
-TaskScheduler_ExecuteTask_WrongTaskScheduler=ExecuteTask may not be called for a task which was previously queued to a different TaskScheduler.
-TaskScheduler_InconsistentStateAfterTryExecuteTaskInline=The TryExecuteTaskInline call to the underlying scheduler succeeded, but the task body was not invoked.
-TaskScheduler_FromCurrentSynchronizationContext_NoCurrent=The current SynchronizationContext may not be used as a TaskScheduler.
-
-; TaskSchedulerException
-TaskSchedulerException_ctor_DefaultMessage=An exception was thrown by a TaskScheduler.
-
-;
-; ParallelState ( used in Parallel.For(), Parallel.ForEach() )
-ParallelState_Break_InvalidOperationException_BreakAfterStop=Break was called after Stop was called.
-ParallelState_Stop_InvalidOperationException_StopAfterBreak=Stop was called after Break was called.
-ParallelState_NotSupportedException_UnsupportedMethod=This method is not supported.
-
-;
-; TPLETWProvider events
-event_ParallelLoopBegin=Beginning {3} loop {2} from Task {1}.
-event_ParallelLoopEnd=Ending loop {2} after {3} iterations.
-event_ParallelInvokeBegin=Beginning ParallelInvoke {2} from Task {1} for {4} actions.
-event_ParallelInvokeEnd=Ending ParallelInvoke {2}.
-event_ParallelFork=Task {1} entering fork/join {2}.
-event_ParallelJoin=Task {1} leaving fork/join {2}.
-event_TaskScheduled=Task {2} scheduled to TaskScheduler {0}.
-event_TaskStarted=Task {2} executing.
-event_TaskCompleted=Task {2} completed.
-event_TaskWaitBegin=Beginning wait ({3}) on Task {2}.
-event_TaskWaitEnd=Ending wait on Task {2}.
-
-
-;
-; Weak Reference Exception
-;
-WeakReference_NoLongerValid = The weak reference is no longer valid.
-
-
-;
-; Interop Exceptions
-;
-Interop.COM_TypeMismatch = Type mismatch between source and destination types.
-Interop_Marshal_Unmappable_Char = Cannot marshal: Encountered unmappable character.
-
-;
-; Loader Exceptions
-;
-Loader_InvalidPath = Relative path must be a string that contains the substring, "..", or does not contain a root directory.
-Loader_Name = Name:
-Loader_NoContextPolicies = There are no context policies.
-Loader_ContextPolicies = Context Policies:
-
-;
-; AppDomain Exceptions
-AppDomain_RequireApplicationName = ApplicationName must be set before the DynamicBase can be set.
-AppDomain_AppBaseNotSet = The ApplicationBase must be set before retrieving this property.
-AppDomain_BindingModelIsLocked = Binding model is already locked for the AppDomain and cannot be reset.
-Argument_CustomAssemblyLoadContextRequestedNameMismatch = Resolved assembly's simple name should be the same as of the requested assembly.
-
-;
-; XMLSyntaxExceptions
-XMLSyntax_UnexpectedEndOfFile = Unexpected end of file.
-XMLSyntax_ExpectedCloseBracket = Expected > character.
-XMLSyntax_ExpectedSlashOrString = Expected / character or string.
-XMLSyntax_UnexpectedCloseBracket = Unexpected > character.
-XMLSyntax_SyntaxError = Invalid syntax on line {0}.
-XMLSyntax_SyntaxErrorEx = Invalid syntax on line {0} - '{1}'.
-XMLSyntax_InvalidSyntax = Invalid syntax.
-XML_Syntax_InvalidSyntaxInFile = Invalid XML in file '{0}' near element '{1}'.
-XMLSyntax_InvalidSyntaxSatAssemTag = Invalid XML in file "{0}" near element "{1}". The <satelliteassemblies> section only supports <assembly> tags.
-XMLSyntax_InvalidSyntaxSatAssemTagBadAttr = Invalid XML in file "{0}" near "{1}" and "{2}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.
-XMLSyntax_InvalidSyntaxSatAssemTagNoAttr = Invalid XML in file "{0}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.
-
-; MembershipConditions
-StrongName_ToString = StrongName - {0}{1}{2}
-StrongName_Name = name = {0}
-StrongName_Version = version = {0}
-Site_ToString = Site
-Publisher_ToString = Publisher
-Hash_ToString = Hash - {0} = {1}
-ApplicationDirectory_ToString = ApplicationDirectory
-Zone_ToString = Zone - {0}
-All_ToString = All code
-Url_ToString = Url
-GAC_ToString = GAC
-
-; Interop non exception strings.
-TypeLibConverter_ImportedTypeLibProductName = Assembly imported from type library '{0}'.
-
-;
-; begin System.TimeZoneInfo ArgumentException's
-;
-Argument_AdjustmentRulesNoNulls = The AdjustmentRule array cannot contain null elements.
-Argument_AdjustmentRulesOutOfOrder = The elements of the AdjustmentRule array must be in chronological order and must not overlap.
-Argument_AdjustmentRulesAmbiguousOverlap = The elements of the AdjustmentRule array must not contain ambiguous time periods that extend beyond the DateStart or DateEnd properties of the element.
-Argument_AdjustmentRulesrDaylightSavingTimeOverlap = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap adjacent elements in such a way as to cause invalid or ambiguous time periods.
-Argument_AdjustmentRulesrDaylightSavingTimeOverlapNonRuleRange = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap the DateStart or DateEnd properties in such a way as to cause invalid or ambiguous time periods.
-Argument_AdjustmentRulesInvalidOverlap = The elements of the AdjustmentRule array must not contain invalid time periods that extend beyond the DateStart or DateEnd properties of the element.
-Argument_ConvertMismatch = The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local.
-Argument_DateTimeHasTimeOfDay = The supplied DateTime includes a TimeOfDay setting. This is not supported.
-Argument_DateTimeIsInvalid = The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid.
-Argument_DateTimeIsNotAmbiguous = The supplied DateTime is not in an ambiguous time range.
-Argument_DateTimeOffsetIsNotAmbiguous = The supplied DateTimeOffset is not in an ambiguous time range.
-Argument_DateTimeKindMustBeUnspecifiedOrUtc = The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified or DateTimeKind.Utc.
-Argument_DateTimeHasTicks = The supplied DateTime must have the Year, Month, and Day properties set to 1. The time cannot be specified more precisely than whole milliseconds.
-Argument_InvalidId = The specified ID parameter '{0}' is not supported.
-Argument_InvalidSerializedString = The specified serialized string '{0}' is not supported.
-Argument_InvalidREG_TZI_FORMAT = The REG_TZI_FORMAT structure is corrupt.
-Argument_OutOfOrderDateTimes = The DateStart property must come before the DateEnd property.
-Argument_TimeSpanHasSeconds = The TimeSpan parameter cannot be specified more precisely than whole minutes.
-Argument_TimeZoneInfoBadTZif = The tzfile does not begin with the magic characters 'TZif'. Please verify that the file is not corrupt.
-Argument_TimeZoneInfoInvalidTZif = The TZif data structure is corrupt.
-Argument_TransitionTimesAreIdentical = The DaylightTransitionStart property must not equal the DaylightTransitionEnd property.
-;
-; begin System.TimeZoneInfo ArgumentOutOfRangeException's
-;
-ArgumentOutOfRange_DayParam = The Day parameter must be in the range 1 through 31.
-ArgumentOutOfRange_DayOfWeek = The DayOfWeek enumeration must be in the range 0 through 6.
-ArgumentOutOfRange_MonthParam = The Month parameter must be in the range 1 through 12.
-ArgumentOutOfRange_UtcOffset = The TimeSpan parameter must be within plus or minus 14.0 hours.
-ArgumentOutOfRange_UtcOffsetAndDaylightDelta = The sum of the BaseUtcOffset and DaylightDelta properties must within plus or minus 14.0 hours.
-ArgumentOutOfRange_Week = The Week parameter must be in the range 1 through 5.
-;
-; begin System.TimeZoneInfo InvalidTimeZoneException's
-;
-InvalidTimeZone_InvalidRegistryData = The time zone ID '{0}' was found on the local computer, but the registry information was corrupt.
-InvalidTimeZone_InvalidFileData = The time zone ID '{0}' was found on the local computer, but the file at '{1}' was corrupt.
-InvalidTimeZone_InvalidWin32APIData = The Local time zone was found on the local computer, but the data was corrupt.
-InvalidTimeZone_NoTTInfoStructures = There are no ttinfo structures in the tzfile. At least one ttinfo structure is required in order to construct a TimeZoneInfo object.
-InvalidTimeZone_UnparseablePosixMDateString = '{0}' is not a valid POSIX-TZ-environment-variable MDate rule. A valid rule has the format 'Mm.w.d'.
-InvalidTimeZone_JulianDayNotSupported = Julian dates in POSIX strings are unsupported.
-;
-; begin System.TimeZoneInfo SecurityException's
-;
-Security_CannotReadRegistryData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the registry information.
-Security_CannotReadFileData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file.
-;
-; begin System.TimeZoneInfo SerializationException's
-;
-Serialization_CorruptField = The value of the field '{0}' is invalid. The serialized data is corrupt.
-Serialization_InvalidEscapeSequence = The serialized data contained an invalid escape sequence '\\{0}'.
-;
-; begin System.TimeZoneInfo TimeZoneNotFoundException's
-;
-TimeZoneNotFound_MissingData = The time zone ID '{0}' was not found on the local computer.
-;
-; end System.TimeZoneInfo
-;
-
-
-; Tuple
-ArgumentException_TupleIncorrectType=Argument must be of type {0}.
-ArgumentException_TupleNonIComparableElement=The tuple contains an element of type {0} which does not implement the IComparable interface.
-ArgumentException_TupleLastArgumentNotATuple=The last element of an eight element tuple must be a Tuple.
-ArgumentException_OtherNotArrayOfCorrectLength=Object is not a array with the same number of elements as the array to compare it to.
-
-; WinRT collection adapters
-Argument_IndexOutOfArrayBounds=The specified index is out of bounds of the specified array.
-Argument_InsufficientSpaceToCopyCollection=The specified space is not sufficient to copy the elements from this Collection.
-ArgumentOutOfRange_IndexLargerThanMaxValue=This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1).
-ArgumentOutOfRange_IndexOutOfRange=The specified index is outside the current index range of this collection.
-InvalidOperation_CollectionBackingListTooLarge=The collection backing this List contains too many elements.
-InvalidOperation_CollectionBackingDictionaryTooLarge=The collection backing this Dictionary contains too many elements.
-InvalidOperation_CannotRemoveLastFromEmptyCollection=Cannot remove the last element from an empty collection.
-
-; Buffers
-ArgumentException_BufferNotFromPool=The buffer is not associated with this pool and may not be returned to it.
-
-;------------------
-; Encoding names:
-;
-;Total items: 147
-;
-Globalization.cp_1200 = Unicode
-Globalization.cp_1201 = Unicode (Big-Endian)
-Globalization.cp_65001 = Unicode (UTF-8)
-Globalization.cp_65000 = Unicode (UTF-7)
-Globalization.cp_12000 = Unicode (UTF-32)
-Globalization.cp_12001 = Unicode (UTF-32 Big-Endian)
-Globalization.cp_20127 = US-ASCII
-Globalization.cp_28591 = Western European (ISO)
-
-#if FEATURE_NON_UNICODE_CODE_PAGES
-Globalization.cp_37 = IBM EBCDIC (US-Canada)
-Globalization.cp_437 = OEM United States
-Globalization.cp_500 = IBM EBCDIC (International)
-Globalization.cp_708 = Arabic (ASMO 708)
-Globalization.cp_720 = Arabic (DOS)
-Globalization.cp_737 = Greek (DOS)
-Globalization.cp_775 = Baltic (DOS)
-Globalization.cp_850 = Western European (DOS)
-Globalization.cp_852 = Central European (DOS)
-Globalization.cp_855 = OEM Cyrillic
-Globalization.cp_857 = Turkish (DOS)
-Globalization.cp_858 = OEM Multilingual Latin I
-Globalization.cp_860 = Portuguese (DOS)
-Globalization.cp_861 = Icelandic (DOS)
-Globalization.cp_862 = Hebrew (DOS)
-Globalization.cp_863 = French Canadian (DOS)
-Globalization.cp_864 = Arabic (864)
-Globalization.cp_865 = Nordic (DOS)
-Globalization.cp_866 = Cyrillic (DOS)
-Globalization.cp_869 = Greek, Modern (DOS)
-Globalization.cp_870 = IBM EBCDIC (Multilingual Latin-2)
-Globalization.cp_874 = Thai (Windows)
-Globalization.cp_875 = IBM EBCDIC (Greek Modern)
-Globalization.cp_932 = Japanese (Shift-JIS)
-Globalization.cp_936 = Chinese Simplified (GB2312)
-Globalization.cp_949 = Korean
-Globalization.cp_950 = Chinese Traditional (Big5)
-Globalization.cp_1026 = IBM EBCDIC (Turkish Latin-5)
-Globalization.cp_1047 = IBM Latin-1
-Globalization.cp_1140 = IBM EBCDIC (US-Canada-Euro)
-Globalization.cp_1141 = IBM EBCDIC (Germany-Euro)
-Globalization.cp_1142 = IBM EBCDIC (Denmark-Norway-Euro)
-Globalization.cp_1143 = IBM EBCDIC (Finland-Sweden-Euro)
-Globalization.cp_1144 = IBM EBCDIC (Italy-Euro)
-Globalization.cp_1145 = IBM EBCDIC (Spain-Euro)
-Globalization.cp_1146 = IBM EBCDIC (UK-Euro)
-Globalization.cp_1147 = IBM EBCDIC (France-Euro)
-Globalization.cp_1148 = IBM EBCDIC (International-Euro)
-Globalization.cp_1149 = IBM EBCDIC (Icelandic-Euro)
-Globalization.cp_1250 = Central European (Windows)
-Globalization.cp_1251 = Cyrillic (Windows)
-Globalization.cp_1252 = Western European (Windows)
-Globalization.cp_1253 = Greek (Windows)
-Globalization.cp_1254 = Turkish (Windows)
-Globalization.cp_1255 = Hebrew (Windows)
-Globalization.cp_1256 = Arabic (Windows)
-Globalization.cp_1257 = Baltic (Windows)
-Globalization.cp_1258 = Vietnamese (Windows)
-Globalization.cp_1361 = Korean (Johab)
-Globalization.cp_10000 = Western European (Mac)
-Globalization.cp_10001 = Japanese (Mac)
-Globalization.cp_10002 = Chinese Traditional (Mac)
-Globalization.cp_10003 = Korean (Mac)
-Globalization.cp_10004 = Arabic (Mac)
-Globalization.cp_10005 = Hebrew (Mac)
-Globalization.cp_10006 = Greek (Mac)
-Globalization.cp_10007 = Cyrillic (Mac)
-Globalization.cp_10008 = Chinese Simplified (Mac)
-Globalization.cp_10010 = Romanian (Mac)
-Globalization.cp_10017 = Ukrainian (Mac)
-Globalization.cp_10021 = Thai (Mac)
-Globalization.cp_10029 = Central European (Mac)
-Globalization.cp_10079 = Icelandic (Mac)
-Globalization.cp_10081 = Turkish (Mac)
-Globalization.cp_10082 = Croatian (Mac)
-Globalization.cp_20000 = Chinese Traditional (CNS)
-Globalization.cp_20001 = TCA Taiwan
-Globalization.cp_20002 = Chinese Traditional (Eten)
-Globalization.cp_20003 = IBM5550 Taiwan
-Globalization.cp_20004 = TeleText Taiwan
-Globalization.cp_20005 = Wang Taiwan
-Globalization.cp_20105 = Western European (IA5)
-Globalization.cp_20106 = German (IA5)
-Globalization.cp_20107 = Swedish (IA5)
-Globalization.cp_20108 = Norwegian (IA5)
-Globalization.cp_20261 = T.61
-Globalization.cp_20269 = ISO-6937
-Globalization.cp_20273 = IBM EBCDIC (Germany)
-Globalization.cp_20277 = IBM EBCDIC (Denmark-Norway)
-Globalization.cp_20278 = IBM EBCDIC (Finland-Sweden)
-Globalization.cp_20280 = IBM EBCDIC (Italy)
-Globalization.cp_20284 = IBM EBCDIC (Spain)
-Globalization.cp_20285 = IBM EBCDIC (UK)
-Globalization.cp_20290 = IBM EBCDIC (Japanese katakana)
-Globalization.cp_20297 = IBM EBCDIC (France)
-Globalization.cp_20420 = IBM EBCDIC (Arabic)
-Globalization.cp_20423 = IBM EBCDIC (Greek)
-Globalization.cp_20424 = IBM EBCDIC (Hebrew)
-Globalization.cp_20833 = IBM EBCDIC (Korean Extended)
-Globalization.cp_20838 = IBM EBCDIC (Thai)
-Globalization.cp_20866 = Cyrillic (KOI8-R)
-Globalization.cp_20871 = IBM EBCDIC (Icelandic)
-Globalization.cp_20880 = IBM EBCDIC (Cyrillic Russian)
-Globalization.cp_20905 = IBM EBCDIC (Turkish)
-Globalization.cp_20924 = IBM Latin-1
-Globalization.cp_20932 = Japanese (JIS 0208-1990 and 0212-1990)
-Globalization.cp_20936 = Chinese Simplified (GB2312-80)
-Globalization.cp_20949 = Korean Wansung
-Globalization.cp_21025 = IBM EBCDIC (Cyrillic Serbian-Bulgarian)
-Globalization.cp_21027 = Ext Alpha Lowercase
-Globalization.cp_21866 = Cyrillic (KOI8-U)
-Globalization.cp_28592 = Central European (ISO)
-Globalization.cp_28593 = Latin 3 (ISO)
-Globalization.cp_28594 = Baltic (ISO)
-Globalization.cp_28595 = Cyrillic (ISO)
-Globalization.cp_28596 = Arabic (ISO)
-Globalization.cp_28597 = Greek (ISO)
-Globalization.cp_28598 = Hebrew (ISO-Visual)
-Globalization.cp_28599 = Turkish (ISO)
-Globalization.cp_28603 = Estonian (ISO)
-Globalization.cp_28605 = Latin 9 (ISO)
-Globalization.cp_29001 = Europa
-Globalization.cp_38598 = Hebrew (ISO-Logical)
-Globalization.cp_50000 = User Defined
-Globalization.cp_50220 = Japanese (JIS)
-Globalization.cp_50221 = Japanese (JIS-Allow 1 byte Kana)
-Globalization.cp_50222 = Japanese (JIS-Allow 1 byte Kana - SO/SI)
-Globalization.cp_50225 = Korean (ISO)
-Globalization.cp_50227 = Chinese Simplified (ISO-2022)
-Globalization.cp_50229 = Chinese Traditional (ISO-2022)
-Globalization.cp_50930 = IBM EBCDIC (Japanese and Japanese Katakana)
-Globalization.cp_50931 = IBM EBCDIC (Japanese and US-Canada)
-Globalization.cp_50933 = IBM EBCDIC (Korean and Korean Extended)
-Globalization.cp_50935 = IBM EBCDIC (Simplified Chinese)
-Globalization.cp_50937 = IBM EBCDIC (Traditional Chinese)
-Globalization.cp_50939 = IBM EBCDIC (Japanese and Japanese-Latin)
-Globalization.cp_51932 = Japanese (EUC)
-Globalization.cp_51936 = Chinese Simplified (EUC)
-Globalization.cp_51949 = Korean (EUC)
-Globalization.cp_52936 = Chinese Simplified (HZ)
-Globalization.cp_54936 = Chinese Simplified (GB18030)
-Globalization.cp_57002 = ISCII Devanagari
-Globalization.cp_57003 = ISCII Bengali
-Globalization.cp_57004 = ISCII Tamil
-Globalization.cp_57005 = ISCII Telugu
-Globalization.cp_57006 = ISCII Assamese
-Globalization.cp_57007 = ISCII Oriya
-Globalization.cp_57008 = ISCII Kannada
-Globalization.cp_57009 = ISCII Malayalam
-Globalization.cp_57010 = ISCII Gujarati
-Globalization.cp_57011 = ISCII Punjabi
-#endif // FEATURE_NON_UNICODE_CODE_PAGES
-#endif // INCLUDE_DEBUG
-
-;------------------
-
-; ValueTuple
-ArgumentException_ValueTupleIncorrectType=Argument must be of type {0}.
-ArgumentException_ValueTupleLastArgumentNotAValueTuple=The last element of an eight element ValueTuple must be a ValueTuple.
diff --git a/src/mscorlib/src/System/Action.cs b/src/mscorlib/src/System/Action.cs
deleted file mode 100644
index 23c7e93194..0000000000
--- a/src/mscorlib/src/System/Action.cs
+++ /dev/null
@@ -1,35 +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
-{
- public delegate void Action<in T>(T obj);
-
- public delegate void Action();
- public delegate void Action<in T1,in T2>(T1 arg1, T2 arg2);
- public delegate void Action<in T1,in T2,in T3>(T1 arg1, T2 arg2, T3 arg3);
- public delegate void Action<in T1,in T2,in T3,in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- public delegate TResult Func<out TResult>();
- public delegate TResult Func<in T, out TResult>(T arg);
- public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
- public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
- public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- public delegate void Action<in T1,in T2,in T3,in T4,in T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
- public delegate void Action<in T1,in T2,in T3,in T4,in T5,in T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
- public delegate void Action<in T1,in T2,in T3,in T4,in T5,in T6,in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
- public delegate void Action<in T1,in T2,in T3,in T4,in T5,in T6,in T7,in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
- public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-
- public delegate int Comparison<in T>(T x, T y);
-
- public delegate TOutput Converter<in TInput, out TOutput>(TInput input);
-
- public delegate bool Predicate<in T>(T obj);
-}
diff --git a/src/mscorlib/src/System/Activator.cs b/src/mscorlib/src/System/Activator.cs
index 323fbba9cc..34c6ea5874 100644
--- a/src/mscorlib/src/System/Activator.cs
+++ b/src/mscorlib/src/System/Activator.cs
@@ -11,8 +11,9 @@
//
//
//
-namespace System {
+namespace System
+{
using System;
using System.Reflection;
using System.Runtime.Remoting;
@@ -29,9 +30,9 @@ namespace System {
// Only statics, does not need to be marked with the serializable attribute
public sealed class Activator
{
- internal const int LookupMask = 0x000000FF;
- internal const BindingFlags ConLookup = (BindingFlags) (BindingFlags.Instance | BindingFlags.Public);
- internal const BindingFlags ConstructorDefault= BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance;
+ internal const int LookupMask = 0x000000FF;
+ internal const BindingFlags ConLookup = (BindingFlags)(BindingFlags.Instance | BindingFlags.Public);
+ internal const BindingFlags ConstructorDefault = BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance;
// This class only contains statics, so hide the worthless constructor
private Activator()
@@ -47,12 +48,12 @@ namespace System {
BindingFlags bindingAttr,
Binder binder,
Object[] args,
- CultureInfo culture)
+ CultureInfo culture)
{
return CreateInstance(type, bindingAttr, binder, args, culture, null);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public Object CreateInstance(Type type,
BindingFlags bindingAttr,
Binder binder,
@@ -65,23 +66,24 @@ namespace System {
Contract.EndContractBlock();
if (type is System.Reflection.Emit.TypeBuilder)
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_CreateInstanceWithTypeBuilder"));
+ throw new NotSupportedException(SR.NotSupported_CreateInstanceWithTypeBuilder);
// If they didn't specify a lookup, then we will provide the default lookup.
- if ((bindingAttr & (BindingFlags) LookupMask) == 0)
+ if ((bindingAttr & (BindingFlags)LookupMask) == 0)
bindingAttr |= Activator.ConstructorDefault;
- if (activationAttributes != null && activationAttributes.Length > 0){
- throw new PlatformNotSupportedException(Environment.GetResourceString("NotSupported_ActivAttr" ));
+ if (activationAttributes != null && activationAttributes.Length > 0)
+ {
+ throw new PlatformNotSupportedException(SR.NotSupported_ActivAttr);
}
RuntimeType rt = type.UnderlyingSystemType as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(type));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
- return rt.CreateInstanceImpl(bindingAttr,binder,args,culture,activationAttributes, ref stackMark);
+ return rt.CreateInstanceImpl(bindingAttr, binder, args, culture, activationAttributes, ref stackMark);
}
static public Object CreateInstance(Type type, params Object[] args)
@@ -98,14 +100,14 @@ namespace System {
Object[] args,
Object[] activationAttributes)
{
- return CreateInstance(type,
- Activator.ConstructorDefault,
- null,
- args,
- null,
- activationAttributes);
+ return CreateInstance(type,
+ Activator.ConstructorDefault,
+ null,
+ args,
+ null,
+ activationAttributes);
}
-
+
static public Object CreateInstance(Type type)
{
return Activator.CreateInstance(type, false);
@@ -116,13 +118,13 @@ namespace System {
* types to be created remotely without having to load the type locally.
*/
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public ObjectHandle CreateInstance(String assemblyName,
String typeName)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return CreateInstance(assemblyName,
- typeName,
+ typeName,
false,
Activator.ConstructorDefault,
null,
@@ -133,15 +135,15 @@ namespace System {
ref stackMark);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public ObjectHandle CreateInstance(String assemblyName,
String typeName,
Object[] activationAttributes)
-
+
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return CreateInstance(assemblyName,
- typeName,
+ typeName,
false,
Activator.ConstructorDefault,
null,
@@ -151,8 +153,8 @@ namespace System {
null,
ref stackMark);
}
-
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public Object CreateInstance(Type type, bool nonPublic)
{
if ((object)type == null)
@@ -162,13 +164,13 @@ namespace System {
RuntimeType rt = type.UnderlyingSystemType as RuntimeType;
if (rt == null)
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type));
+ throw new ArgumentException(SR.Arg_MustBeType, nameof(type));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return rt.CreateInstanceDefaultCtor(!nonPublic, false, true, ref stackMark);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
static public T CreateInstance<T>()
{
RuntimeType rt = typeof(T) as RuntimeType;
@@ -176,7 +178,7 @@ namespace System {
// This is a workaround to maintain compatibility with V2. Without this we would throw a NotSupportedException for void[].
// Array, Ref, and Pointer types don't have default constructors.
if (rt.HasElementType)
- throw new MissingMethodException(Environment.GetResourceString("Arg_NoDefCTor"));
+ throw new MissingMethodException(SR.Arg_NoDefCTor);
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
@@ -186,7 +188,7 @@ namespace System {
static public ObjectHandle CreateInstanceFrom(String assemblyFile,
String typeName)
-
+
{
return CreateInstanceFrom(assemblyFile, typeName, null);
}
@@ -194,10 +196,10 @@ namespace System {
static public ObjectHandle CreateInstanceFrom(String assemblyFile,
String typeName,
Object[] activationAttributes)
-
+
{
return CreateInstanceFrom(assemblyFile,
- typeName,
+ typeName,
false,
Activator.ConstructorDefault,
null,
@@ -206,7 +208,7 @@ namespace System {
activationAttributes);
}
- [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
+ [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
public static ObjectHandle CreateInstance(string assemblyName,
string typeName,
bool ignoreCase,
@@ -229,10 +231,10 @@ namespace System {
ref stackMark);
}
- static internal ObjectHandle CreateInstance(String assemblyString,
- String typeName,
+ static internal ObjectHandle CreateInstance(String assemblyString,
+ String typeName,
bool ignoreCase,
- BindingFlags bindingAttr,
+ BindingFlags bindingAttr,
Binder binder,
Object[] args,
CultureInfo culture,
@@ -242,18 +244,26 @@ namespace System {
{
Type type = null;
Assembly assembly = null;
- if (assemblyString == null) {
+ if (assemblyString == null)
+ {
assembly = RuntimeAssembly.GetExecutingAssembly(ref stackMark);
- } else {
+ }
+ else
+ {
RuntimeAssembly assemblyFromResolveEvent;
AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, false /*forIntrospection*/, out assemblyFromResolveEvent);
- if (assemblyFromResolveEvent != null) {
+ if (assemblyFromResolveEvent != null)
+ {
// Assembly was resolved via AssemblyResolve event
assembly = assemblyFromResolveEvent;
- } else if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime) {
+ }
+ else if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime)
+ {
// WinRT type - we have to use Type.GetType
type = Type.GetType(typeName + ", " + assemblyString, true /*throwOnError*/, ignoreCase);
- } else {
+ }
+ else
+ {
// Classic managed type
assembly = RuntimeAssembly.InternalLoadAssemblyName(
assemblyName, securityInfo, null, ref stackMark,
@@ -261,14 +271,15 @@ namespace System {
}
}
- if (type == null) {
+ if (type == null)
+ {
// It's classic managed type (not WinRT type)
Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyString);
- if(assembly == null) return null;
+ if (assembly == null) return null;
type = assembly.GetType(typeName, true /*throwOnError*/, ignoreCase);
}
-
+
Object o = Activator.CreateInstance(type,
bindingAttr,
binder,
@@ -277,9 +288,10 @@ namespace System {
activationAttributes);
Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if(o == null)
+ if (o == null)
return null;
- else {
+ else
+ {
ObjectHandle Handle = new ObjectHandle(o);
return Handle;
}
@@ -306,9 +318,9 @@ namespace System {
}
private static ObjectHandle CreateInstanceFromInternal(String assemblyFile,
- String typeName,
+ String typeName,
bool ignoreCase,
- BindingFlags bindingAttr,
+ BindingFlags bindingAttr,
Binder binder,
Object[] args,
CultureInfo culture,
@@ -319,7 +331,7 @@ namespace System {
Assembly assembly = Assembly.LoadFrom(assemblyFile, securityInfo);
#pragma warning restore 618
Type t = assembly.GetType(typeName, true, ignoreCase);
-
+
Object o = Activator.CreateInstance(t,
bindingAttr,
binder,
@@ -328,9 +340,10 @@ namespace System {
activationAttributes);
Log(o != null, "CreateInstanceFrom:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if(o == null)
+ if (o == null)
return null;
- else {
+ else
+ {
ObjectHandle Handle = new ObjectHandle(o);
return Handle;
}
@@ -343,30 +356,29 @@ namespace System {
typeName,
null,
AssemblyHashAlgorithm.None);
-
}
-
+
public static ObjectHandle CreateComInstanceFrom(String assemblyName,
String typeName,
- byte[] hashValue,
+ byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm)
{
Assembly assembly = Assembly.LoadFrom(assemblyName, hashValue, hashAlgorithm);
Type t = assembly.GetType(typeName, true, false);
- Object[] Attr = t.GetCustomAttributes(typeof(ComVisibleAttribute),false);
+ Object[] Attr = t.GetCustomAttributes(typeof(ComVisibleAttribute), false);
if (Attr.Length > 0)
{
if (((ComVisibleAttribute)Attr[0]).Value == false)
- throw new TypeLoadException(Environment.GetResourceString( "Argument_TypeMustBeVisibleFromCom" ));
+ throw new TypeLoadException(SR.Argument_TypeMustBeVisibleFromCom);
}
Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyName);
- if(assembly == null) return null;
+ if (assembly == null) return null;
+
-
Object o = Activator.CreateInstance(t,
Activator.ConstructorDefault,
null,
@@ -375,9 +387,10 @@ namespace System {
null);
Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName);
- if(o == null)
+ if (o == null)
return null;
- else {
+ else
+ {
ObjectHandle Handle = new ObjectHandle(o);
return Handle;
}
diff --git a/src/mscorlib/src/System/AggregateException.cs b/src/mscorlib/src/System/AggregateException.cs
index c0f21229ed..22bc323215 100644
--- a/src/mscorlib/src/System/AggregateException.cs
+++ b/src/mscorlib/src/System/AggregateException.cs
@@ -23,7 +23,6 @@ using System.Threading;
namespace System
{
-
/// <summary>Represents one or more errors that occur during application execution.</summary>
/// <remarks>
/// <see cref="AggregateException"/> is used to consolidate multiple failures into a single, throwable
@@ -33,14 +32,13 @@ namespace System
[DebuggerDisplay("Count = {InnerExceptionCount}")]
public class AggregateException : Exception
{
-
private ReadOnlyCollection<Exception> m_innerExceptions; // Complete set of exceptions.
/// <summary>
/// Initializes a new instance of the <see cref="AggregateException"/> class.
/// </summary>
public AggregateException()
- : base(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"))
+ : base(SR.AggregateException_ctor_DefaultMessage)
{
m_innerExceptions = new ReadOnlyCollection<Exception>(new Exception[0]);
}
@@ -85,7 +83,7 @@ namespace System
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is
/// null.</exception>
public AggregateException(IEnumerable<Exception> innerExceptions) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptions)
{
}
@@ -99,7 +97,7 @@ namespace System
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is
/// null.</exception>
public AggregateException(params Exception[] innerExceptions) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptions)
{
}
@@ -163,7 +161,7 @@ namespace System
if (exceptionsCopy[i] == null)
{
- throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull"));
+ throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull);
}
}
@@ -182,7 +180,7 @@ namespace System
/// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptionInfos"/> is
/// null.</exception>
internal AggregateException(IEnumerable<ExceptionDispatchInfo> innerExceptionInfos) :
- this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptionInfos)
+ this(SR.AggregateException_ctor_DefaultMessage, innerExceptionInfos)
{
}
@@ -202,9 +200,9 @@ namespace System
internal AggregateException(string message, IEnumerable<ExceptionDispatchInfo> innerExceptionInfos)
// If it's already an IList, pass that along (a defensive copy will be made in the delegated ctor). If it's null, just pass along
// null typed correctly. Otherwise, create an IList from the enumerable and pass that along.
- : this(message, innerExceptionInfos as IList<ExceptionDispatchInfo> ??
- (innerExceptionInfos == null ?
- (List<ExceptionDispatchInfo>)null :
+ : this(message, innerExceptionInfos as IList<ExceptionDispatchInfo> ??
+ (innerExceptionInfos == null ?
+ (List<ExceptionDispatchInfo>)null :
new List<ExceptionDispatchInfo>(innerExceptionInfos)))
{
}
@@ -242,7 +240,7 @@ namespace System
if (exceptionsCopy[i] == null)
{
- throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull"));
+ throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull);
}
}
@@ -269,7 +267,7 @@ namespace System
Exception[] innerExceptions = info.GetValue("InnerExceptions", typeof(Exception[])) as Exception[];
if (innerExceptions == null)
{
- throw new SerializationException(Environment.GetResourceString("AggregateException_DeserializationFailure"));
+ throw new SerializationException(SR.AggregateException_DeserializationFailure);
}
m_innerExceptions = new ReadOnlyCollection<Exception>(innerExceptions);
@@ -468,7 +466,7 @@ namespace System
{
text = String.Format(
CultureInfo.InvariantCulture,
- Environment.GetResourceString("AggregateException_ToString"),
+ SR.AggregateException_ToString,
text, Environment.NewLine, i, m_innerExceptions[i].ToString(), "<---", Environment.NewLine);
}
@@ -492,5 +490,4 @@ namespace System
}
}
}
-
}
diff --git a/src/mscorlib/src/System/AppContext/AppContext.cs b/src/mscorlib/src/System/AppContext/AppContext.cs
index 5a3b732fa8..7c7e74f19b 100644
--- a/src/mscorlib/src/System/AppContext/AppContext.cs
+++ b/src/mscorlib/src/System/AppContext/AppContext.cs
@@ -35,7 +35,7 @@ namespace System
{
// The value of APP_CONTEXT_BASE_DIRECTORY key has to be a string and it is not allowed to be any other type.
// Otherwise the caller will get invalid cast exception
- return (string) AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") ?? AppDomain.CurrentDomain.BaseDirectory;
+ return (string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY") ?? AppDomain.CurrentDomain.BaseDirectory;
}
}
@@ -72,16 +72,16 @@ namespace System
}
public static event System.EventHandler<System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs> FirstChanceException
- {
- add
- {
- AppDomain.CurrentDomain.FirstChanceException += value;
- }
- remove
- {
- AppDomain.CurrentDomain.FirstChanceException -= value;
- }
- }
+ {
+ add
+ {
+ AppDomain.CurrentDomain.FirstChanceException += value;
+ }
+ remove
+ {
+ AppDomain.CurrentDomain.FirstChanceException -= value;
+ }
+ }
public static event System.EventHandler ProcessExit;
internal static event System.EventHandler Unloading;
@@ -116,7 +116,7 @@ namespace System
if (switchName == null)
throw new ArgumentNullException(nameof(switchName));
if (switchName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName));
// By default, the switch is not enabled.
isEnabled = false;
@@ -144,7 +144,7 @@ namespace System
}
// We get the value of isEnabled from the value that we stored in the dictionary
- isEnabled = (switchValue & SwitchValueState.HasTrueValue) == SwitchValueState.HasTrueValue;
+ isEnabled = (switchValue & SwitchValueState.HasTrueValue) == SwitchValueState.HasTrueValue;
// 2. The switch has a valid value AND we have checked for overrides
if ((switchValue & SwitchValueState.HasLookedForOverride) == SwitchValueState.HasLookedForOverride)
@@ -212,7 +212,7 @@ namespace System
if (switchName == null)
throw new ArgumentNullException(nameof(switchName));
if (switchName.Length == 0)
- throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName));
+ throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName));
SwitchValueState switchValue = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue)
| SwitchValueState.HasLookedForOverride;
diff --git a/src/mscorlib/src/System/AppContext/AppContextDefaultValues.Defaults.cs b/src/mscorlib/src/System/AppContext/AppContextDefaultValues.Defaults.cs
index 52bdf9d427..ddecf18646 100644
--- a/src/mscorlib/src/System/AppContext/AppContextDefaultValues.Defaults.cs
+++ b/src/mscorlib/src/System/AppContext/AppContextDefaultValues.Defaults.cs
@@ -8,7 +8,6 @@ namespace System
{
internal static partial class AppContextDefaultValues
{
-
internal static readonly string SwitchNoAsyncCurrentCulture = "Switch.System.Globalization.NoAsyncCurrentCulture";
internal static readonly string SwitchThrowExceptionIfDisposedCancellationTokenSource = "Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource";
internal static readonly string SwitchPreserveEventListnerObjectIdentity = "Switch.System.Diagnostics.EventSource.PreserveEventListnerObjectIdentity";
diff --git a/src/mscorlib/src/System/AppContext/AppContextSwitches.cs b/src/mscorlib/src/System/AppContext/AppContextSwitches.cs
index 5fdd2bc1e6..03b535bda2 100644
--- a/src/mscorlib/src/System/AppContext/AppContextSwitches.cs
+++ b/src/mscorlib/src/System/AppContext/AppContextSwitches.cs
@@ -2,11 +2,11 @@
// 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.CompilerServices;
+
namespace System
{
- using System;
- using System.Runtime.CompilerServices;
-
internal static class AppContextSwitches
{
private static int _noAsyncCurrentCulture;
diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs
index c6987392d5..7d2f2ceaf8 100644
--- a/src/mscorlib/src/System/AppDomain.cs
+++ b/src/mscorlib/src/System/AppDomain.cs
@@ -37,59 +37,6 @@ namespace System
using System.Diagnostics.Contracts;
using System.Runtime.ExceptionServices;
- public class ResolveEventArgs : EventArgs
- {
- private String _Name;
- private Assembly _RequestingAssembly;
-
- public String Name {
- get {
- return _Name;
- }
- }
-
- public Assembly RequestingAssembly
- {
- get
- {
- return _RequestingAssembly;
- }
- }
-
- public ResolveEventArgs(String name)
- {
- _Name = name;
- }
-
- public ResolveEventArgs(String name, Assembly requestingAssembly)
- {
- _Name = name;
- _RequestingAssembly = requestingAssembly;
- }
- }
-
- public class AssemblyLoadEventArgs : EventArgs
- {
- private Assembly _LoadedAssembly;
-
- public Assembly LoadedAssembly {
- get {
- return _LoadedAssembly;
- }
- }
-
- public AssemblyLoadEventArgs(Assembly loadedAssembly)
- {
- _LoadedAssembly = loadedAssembly;
- }
- }
-
- [Serializable]
- public delegate Assembly ResolveEventHandler(Object sender, ResolveEventArgs args);
-
- [Serializable]
- public delegate void AssemblyLoadEventHandler(Object sender, AssemblyLoadEventArgs args);
-
[Serializable]
internal delegate void AppDomainInitializer(string[] args);
@@ -106,62 +53,61 @@ namespace System
internal AppDomainInitializerInfo(AppDomainInitializer init)
{
- Info=null;
- if (init==null)
+ Info = null;
+ if (init == null)
return;
List<ItemInfo> itemInfo = new List<ItemInfo>();
List<AppDomainInitializer> nestedDelegates = new List<AppDomainInitializer>();
nestedDelegates.Add(init);
- int idx=0;
-
- while (nestedDelegates.Count>idx)
+ int idx = 0;
+
+ while (nestedDelegates.Count > idx)
{
AppDomainInitializer curr = nestedDelegates[idx++];
- Delegate[] list= curr.GetInvocationList();
- for (int i=0;i<list.Length;i++)
+ Delegate[] list = curr.GetInvocationList();
+ for (int i = 0; i < list.Length; i++)
{
- if (!list[i].Method.IsStatic)
+ if (!list[i].Method.IsStatic)
{
- if(list[i].Target==null)
+ if (list[i].Target == null)
continue;
-
+
AppDomainInitializer nested = list[i].Target as AppDomainInitializer;
- if (nested!=null)
+ if (nested != null)
nestedDelegates.Add(nested);
else
- throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStatic"),
- list[i].Method.ReflectedType.FullName+"::"+list[i].Method.Name);
+ throw new ArgumentException(SR.Arg_MustBeStatic,
+ list[i].Method.ReflectedType.FullName + "::" + list[i].Method.Name);
}
else
{
- ItemInfo info=new ItemInfo();
- info.TargetTypeAssembly=list[i].Method.ReflectedType.Module.Assembly.FullName;
- info.TargetTypeName=list[i].Method.ReflectedType.FullName;
- info.MethodName=list[i].Method.Name;
+ ItemInfo info = new ItemInfo();
+ info.TargetTypeAssembly = list[i].Method.ReflectedType.Module.Assembly.FullName;
+ info.TargetTypeName = list[i].Method.ReflectedType.FullName;
+ info.MethodName = list[i].Method.Name;
itemInfo.Add(info);
}
-
}
}
- Info = itemInfo.ToArray();
+ Info = itemInfo.ToArray();
}
-
+
internal AppDomainInitializer Unwrap()
{
- if (Info==null)
+ if (Info == null)
return null;
- AppDomainInitializer retVal=null;
- for (int i=0;i<Info.Length;i++)
+ AppDomainInitializer retVal = null;
+ for (int i = 0; i < Info.Length; i++)
{
- Assembly assembly=Assembly.Load(Info[i].TargetTypeAssembly);
- AppDomainInitializer newVal=(AppDomainInitializer)Delegate.CreateDelegate(typeof(AppDomainInitializer),
+ Assembly assembly = Assembly.Load(Info[i].TargetTypeAssembly);
+ AppDomainInitializer newVal = (AppDomainInitializer)Delegate.CreateDelegate(typeof(AppDomainInitializer),
assembly.GetType(Info[i].TargetTypeName),
Info[i].MethodName);
- if(retVal==null)
- retVal=newVal;
+ if (retVal == null)
+ retVal = newVal;
else
- retVal+=newVal;
+ retVal += newVal;
}
return retVal;
}
@@ -176,10 +122,10 @@ namespace System
private AppDomainManager _domainManager;
private Dictionary<String, Object> _LocalStore;
- private AppDomainSetup _FusionStore;
- private Evidence _SecurityIdentity;
+ private AppDomainSetup _FusionStore;
+ private Evidence _SecurityIdentity;
#pragma warning disable 169
- private Object[] _Policies; // Called from the VM.
+ private Object[] _Policies; // Called from the VM.
#pragma warning restore 169
public event AssemblyLoadEventHandler AssemblyLoad;
@@ -246,30 +192,27 @@ namespace System
}
}
-#if FEATURE_REFLECTION_ONLY_LOAD
- public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
-#endif // FEATURE_REFLECTION_ONLY
private ApplicationTrust _applicationTrust;
- private EventHandler _processExit;
+ private EventHandler _processExit;
- private EventHandler _domainUnload;
+ private EventHandler _domainUnload;
private UnhandledExceptionEventHandler _unhandledException;
// The compat flags are set at domain creation time to indicate that the given breaking
// changes (named in the strings) should not be used in this domain. We only use the
// keys, the vhe values are ignored.
- private Dictionary<String, object> _compatFlags;
+ private Dictionary<String, object> _compatFlags;
// Delegate that will hold references to FirstChance exception notifications
private EventHandler<FirstChanceExceptionEventArgs> _firstChanceException;
- private IntPtr _pDomain; // this is an unmanaged pointer (AppDomain * m_pDomain)` used from the VM.
+ private IntPtr _pDomain; // this is an unmanaged pointer (AppDomain * m_pDomain)` used from the VM.
- private bool _HasSetPolicy;
- private bool _IsFastFullTrustDomain; // quick check to see if the AppDomain is fully trusted and homogenous
- private bool _compatFlagsInitialized;
+ private bool _HasSetPolicy;
+ private bool _IsFastFullTrustDomain; // quick check to see if the AppDomain is fully trusted and homogenous
+ private bool _compatFlagsInitialized;
internal const String TargetFrameworkNameAppCompatSetting = "TargetFrameworkName";
@@ -282,16 +225,12 @@ namespace System
[Flags]
private enum APPX_FLAGS
{
- APPX_FLAGS_INITIALIZED = 0x01,
-
- APPX_FLAGS_APPX_MODEL = 0x02,
- APPX_FLAGS_APPX_DESIGN_MODE = 0x04,
- APPX_FLAGS_APPX_NGEN = 0x08,
- APPX_FLAGS_APPX_MASK = APPX_FLAGS_APPX_MODEL |
- APPX_FLAGS_APPX_DESIGN_MODE |
- APPX_FLAGS_APPX_NGEN,
+ APPX_FLAGS_INITIALIZED = 0x01,
- APPX_FLAGS_API_CHECK = 0x10,
+ APPX_FLAGS_APPX_MODEL = 0x02,
+ APPX_FLAGS_APPX_DESIGN_MODE = 0x04,
+ APPX_FLAGS_APPX_MASK = APPX_FLAGS_APPX_MODEL |
+ APPX_FLAGS_APPX_DESIGN_MODE,
}
private static APPX_FLAGS Flags
@@ -305,22 +244,6 @@ namespace System
return s_flags;
}
}
-
- internal static bool ProfileAPICheck
- {
- get
- {
- return (Flags & APPX_FLAGS.APPX_FLAGS_API_CHECK) != 0;
- }
- }
-
- internal static bool IsAppXNGen
- {
- get
- {
- return (Flags & APPX_FLAGS.APPX_FLAGS_APPX_NGEN) != 0;
- }
- }
#endif // FEATURE_APPX
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -361,7 +284,7 @@ namespace System
// uninitialized object through remoting, etc.
if (_pDomain.IsNull())
{
- throw new InvalidOperationException(Environment.GetResourceString("Argument_InvalidHandle"));
+ throw new InvalidOperationException(SR.Argument_InvalidHandle);
}
return new AppDomainHandle(_pDomain);
@@ -417,20 +340,20 @@ namespace System
}
catch (FileNotFoundException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
catch (SecurityException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
catch (TypeLoadException e)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e);
+ throw new TypeLoadException(SR.Argument_NoDomainManager, e);
}
if (_domainManager == null)
{
- throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"));
+ throw new TypeLoadException(SR.Argument_NoDomainManager);
}
// If this domain was not created by a managed call to CreateDomain, then the AppDomainSetup
@@ -463,7 +386,7 @@ namespace System
private void InitializeCompatibilityFlags()
{
AppDomainSetup adSetup = FusionStore;
-
+
// set up shim flags regardless of whether we create a DomainManager in this method.
if (adSetup.GetCompatibilityFlags() != null)
{
@@ -521,7 +444,7 @@ namespace System
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFrom"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFrom"));
#endif
}
@@ -533,7 +456,7 @@ namespace System
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFile"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFile"));
#endif
}
@@ -545,7 +468,7 @@ namespace System
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.ReflectionOnlyLoad"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.ReflectionOnlyLoad"));
#endif
}
@@ -557,7 +480,7 @@ namespace System
{
#if FEATURE_APPX
if (IsAppXModel())
- throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.Load(byte[], ...)"));
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.Load(byte[], ...)"));
#endif
}
@@ -603,17 +526,20 @@ namespace System
bool runtimeSuppliedHomogenousGrant = false;
ApplicationTrust appTrust = adSetup.ApplicationTrust;
- if (appTrust != null) {
+ if (appTrust != null)
+ {
SetupDomainSecurityForHomogeneousDomain(appTrust, runtimeSuppliedHomogenousGrant);
}
- else if (_IsFastFullTrustDomain) {
+ else if (_IsFastFullTrustDomain)
+ {
SetSecurityHomogeneousFlag(GetNativeHandle(), runtimeSuppliedHomogenousGrant);
}
// Get the evidence supplied for the domain. If no evidence was supplied, it means that we want
// to use the default evidence creation strategy for this domain
Evidence newAppDomainEvidence = (providedSecurityInfo != null ? providedSecurityInfo : creatorsSecurityInfo);
- if (newAppDomainEvidence == null && generateDefaultEvidence) {
+ if (newAppDomainEvidence == null && generateDefaultEvidence)
+ {
newAppDomainEvidence = new Evidence();
}
@@ -650,63 +576,18 @@ namespace System
runtimeSuppliedHomogenousGrantSet);
}
- public AppDomainManager DomainManager {
- get {
- return _domainManager;
- }
- }
-
-#if FEATURE_REFLECTION_ONLY_LOAD
- private Assembly ResolveAssemblyForIntrospection(Object sender, ResolveEventArgs args)
- {
- Contract.Requires(args != null);
- return Assembly.ReflectionOnlyLoad(ApplyPolicy(args.Name));
- }
-
- // Helper class for method code:EnableResolveAssembliesForIntrospection
- private class NamespaceResolverForIntrospection
+ public AppDomainManager DomainManager
{
- private IEnumerable<string> _packageGraphFilePaths;
- public NamespaceResolverForIntrospection(IEnumerable<string> packageGraphFilePaths)
- {
- _packageGraphFilePaths = packageGraphFilePaths;
- }
-
- public void ResolveNamespace(
- object sender,
- System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs args)
+ get
{
- Contract.Requires(args != null);
-
- IEnumerable<string> fileNames = System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ResolveNamespace(
- args.NamespaceName,
- null, // windowsSdkFilePath ... Use OS installed .winmd files
- _packageGraphFilePaths);
- foreach (string fileName in fileNames)
- {
- args.ResolvedAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(fileName));
- }
+ return _domainManager;
}
}
-
- // Called only by native function code:ValidateWorker
- private void EnableResolveAssembliesForIntrospection(string verifiedFileDirectory)
- {
- CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(ResolveAssemblyForIntrospection);
-
- string[] packageGraphFilePaths = null;
- if (verifiedFileDirectory != null)
- packageGraphFilePaths = new string[] { verifiedFileDirectory };
- NamespaceResolverForIntrospection namespaceResolver = new NamespaceResolverForIntrospection(packageGraphFilePaths);
-
- System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve +=
- new EventHandler<System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs>(namespaceResolver.ResolveNamespace);
- }
-#endif // FEATURE_REFLECTION_ONLY_LOAD
+
public ObjectHandle CreateInstance(String assemblyName,
String typeName)
-
+
{
// jit does not check for that, so we should do it ...
if (this == null)
@@ -722,7 +603,8 @@ namespace System
public static AppDomain CurrentDomain
{
- get {
+ get
+ {
Contract.Ensures(Contract.Result<AppDomain>() != null);
return Thread.GetDomain();
}
@@ -730,7 +612,8 @@ namespace System
public String BaseDirectory
{
- get {
+ get
+ {
return FusionStore.ApplicationBase;
}
}
@@ -740,26 +623,29 @@ namespace System
StringBuilder sb = StringBuilderCache.Acquire();
String fn = nGetFriendlyName();
- if (fn != null) {
- sb.Append(Environment.GetResourceString("Loader_Name") + fn);
+ if (fn != null)
+ {
+ sb.Append(SR.Loader_Name + fn);
sb.Append(Environment.NewLine);
}
- if(_Policies == null || _Policies.Length == 0)
- sb.Append(Environment.GetResourceString("Loader_NoContextPolicies")
+ if (_Policies == null || _Policies.Length == 0)
+ sb.Append(SR.Loader_NoContextPolicies
+ Environment.NewLine);
- else {
- sb.Append(Environment.GetResourceString("Loader_ContextPolicies")
+ else
+ {
+ sb.Append(SR.Loader_ContextPolicies
+ Environment.NewLine);
- for(int i = 0;i < _Policies.Length; i++) {
+ for (int i = 0; i < _Policies.Length; i++)
+ {
sb.Append(_Policies[i]);
sb.Append(Environment.NewLine);
}
}
-
+
return StringBuilderCache.GetStringAndRelease(sb);
}
-
+
// this is true when we've removed the handles etc so really can't do anything
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern bool IsUnloadingForcedFinalize();
@@ -772,22 +658,25 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void PublishAnonymouslyHostedDynamicMethodsAssembly(RuntimeAssembly assemblyHandle);
- public void SetData (string name, object data) {
+ public void SetData(string name, object data)
+ {
if (name == null)
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
// SetData should only be used to set values that don't already exist.
object currentVal;
- lock (((ICollection)LocalStore).SyncRoot) {
+ lock (((ICollection)LocalStore).SyncRoot)
+ {
LocalStore.TryGetValue(name, out currentVal);
}
if (currentVal != null)
{
- throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_SetData_OnlyOnce"));
+ throw new InvalidOperationException(SR.InvalidOperation_SetData_OnlyOnce);
}
- lock (((ICollection)LocalStore).SyncRoot) {
+ lock (((ICollection)LocalStore).SyncRoot)
+ {
LocalStore[name] = data;
}
}
@@ -795,19 +684,20 @@ namespace System
[Pure]
public Object GetData(string name)
{
- if(name == null)
+ if (name == null)
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
int key = AppDomainSetup.Locate(name);
- if(key == -1)
+ if (key == -1)
{
- if(name.Equals(AppDomainSetup.LoaderOptimizationKey))
+ if (name.Equals(AppDomainSetup.LoaderOptimizationKey))
return FusionStore.LoaderOptimization;
- else
+ else
{
object data;
- lock (((ICollection)LocalStore).SyncRoot) {
+ lock (((ICollection)LocalStore).SyncRoot)
+ {
LocalStore.TryGetValue(name, out data);
}
if (data == null)
@@ -815,27 +705,30 @@ namespace System
return data;
}
}
- else {
+ else
+ {
// Be sure to call these properties, not Value, so
// that the appropriate permission demand will be done
- switch(key) {
- case (int) AppDomainSetup.LoaderInformation.ApplicationBaseValue:
- return FusionStore.ApplicationBase;
- case (int) AppDomainSetup.LoaderInformation.ApplicationNameValue:
- return FusionStore.ApplicationName;
- default:
- Debug.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()");
- return null;
+ switch (key)
+ {
+ case (int)AppDomainSetup.LoaderInformation.ApplicationBaseValue:
+ return FusionStore.ApplicationBase;
+ case (int)AppDomainSetup.LoaderInformation.ApplicationNameValue:
+ return FusionStore.ApplicationName;
+ default:
+ Debug.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()");
+ return null;
}
}
}
-
+
[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread. http://go.microsoft.com/fwlink/?linkid=14202", false)]
[DllImport(Microsoft.Win32.Win32Native.KERNEL32)]
public static extern int GetCurrentThreadId();
- private AppDomain() {
- throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_Constructor));
+ private AppDomain()
+ {
+ throw new NotSupportedException(SR.GetResourceString(ResId.NotSupported_Constructor));
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -866,13 +759,13 @@ namespace System
if (value != null)
{
RuntimeHelpers.PrepareContractedDelegate(value);
- lock(this)
+ lock (this)
_processExit += value;
}
}
remove
{
- lock(this)
+ lock (this)
_processExit -= value;
}
}
@@ -885,13 +778,13 @@ namespace System
if (value != null)
{
RuntimeHelpers.PrepareContractedDelegate(value);
- lock(this)
+ lock (this)
_domainUnload += value;
}
}
remove
{
- lock(this)
+ lock (this)
_domainUnload -= value;
}
}
@@ -904,13 +797,13 @@ namespace System
if (value != null)
{
RuntimeHelpers.PrepareContractedDelegate(value);
- lock(this)
+ lock (this)
_unhandledException += value;
}
}
remove
{
- lock(this)
+ lock (this)
_unhandledException -= value;
}
}
@@ -926,13 +819,13 @@ namespace System
if (value != null)
{
RuntimeHelpers.PrepareContractedDelegate(value);
- lock(this)
+ lock (this)
_firstChanceException += value;
}
}
remove
{
- lock(this)
+ lock (this)
_firstChanceException -= value;
}
}
@@ -940,22 +833,24 @@ namespace System
private void OnAssemblyLoadEvent(RuntimeAssembly LoadedAssembly)
{
AssemblyLoadEventHandler eventHandler = AssemblyLoad;
- if (eventHandler != null) {
+ if (eventHandler != null)
+ {
AssemblyLoadEventArgs ea = new AssemblyLoadEventArgs(LoadedAssembly);
eventHandler(this, ea);
}
}
-
+
// This method is called by the VM.
private RuntimeAssembly OnResourceResolveEvent(RuntimeAssembly assembly, String resourceName)
{
ResolveEventHandler eventHandler = _ResourceResolve;
- if ( eventHandler == null)
+ if (eventHandler == null)
return null;
Delegate[] ds = eventHandler.GetInvocationList();
int len = ds.Length;
- for (int i = 0; i < len; i++) {
+ for (int i = 0; i < len; i++)
+ {
Assembly asm = ((ResolveEventHandler)ds[i])(this, new ResolveEventArgs(resourceName, assembly));
RuntimeAssembly ret = GetRuntimeAssembly(asm);
if (ret != null)
@@ -964,7 +859,7 @@ namespace System
return null;
}
-
+
// This method is called by the VM
private RuntimeAssembly OnTypeResolveEvent(RuntimeAssembly assembly, String typeName)
{
@@ -974,7 +869,8 @@ namespace System
Delegate[] ds = eventHandler.GetInvocationList();
int len = ds.Length;
- for (int i = 0; i < len; i++) {
+ for (int i = 0; i < len; i++)
+ {
Assembly asm = ((ResolveEventHandler)ds[i])(this, new ResolveEventArgs(typeName, assembly));
RuntimeAssembly ret = GetRuntimeAssembly(asm);
if (ret != null)
@@ -996,13 +892,14 @@ namespace System
Delegate[] ds = eventHandler.GetInvocationList();
int len = ds.Length;
- for (int i = 0; i < len; i++) {
+ for (int i = 0; i < len; i++)
+ {
Assembly asm = ((ResolveEventHandler)ds[i])(this, new ResolveEventArgs(assemblyFullName, assembly));
RuntimeAssembly ret = GetRuntimeAssembly(asm);
if (ret != null)
return ret;
}
-
+
return null;
}
@@ -1016,8 +913,9 @@ namespace System
internal AppDomainSetup FusionStore
{
- get {
- Debug.Assert(_FusionStore != null,
+ get
+ {
+ Debug.Assert(_FusionStore != null,
"Fusion store has not been correctly setup in this domain");
return _FusionStore;
}
@@ -1041,10 +939,12 @@ namespace System
private Dictionary<String, Object> LocalStore
{
- get {
+ get
+ {
if (_LocalStore != null)
return _LocalStore;
- else {
+ else
+ {
_LocalStore = new Dictionary<String, Object>();
return _LocalStore;
}
@@ -1061,7 +961,7 @@ namespace System
if (info.ApplicationBase == null)
{
- info.SetupDefaults(RuntimeEnvironment.GetModuleFileName(), imageLocationAlreadyNormalized : true);
+ info.SetupDefaults(RuntimeEnvironment.GetModuleFileName(), imageLocationAlreadyNormalized: true);
}
nCreateContext();
@@ -1074,11 +974,11 @@ namespace System
private static void RunInitializer(AppDomainSetup setup)
{
- if (setup.AppDomainInitializer!=null)
+ if (setup.AppDomainInitializer != null)
{
- string[] args=null;
- if (setup.AppDomainInitializerArguments!=null)
- args=(string[])setup.AppDomainInitializerArguments.Clone();
+ string[] args = null;
+ if (setup.AppDomainInitializerArguments != null)
+ args = (string[])setup.AppDomainInitializerArguments.Clone();
setup.AppDomainInitializer(args);
}
}
@@ -1101,8 +1001,8 @@ namespace System
bool generateDefaultEvidence = false;
AppDomainInitializerInfo initializerInfo = null;
- if (setup!=null && setup.AppDomainInitializer!=null)
- initializerInfo=new AppDomainInitializerInfo(setup.AppDomainInitializer);
+ if (setup != null && setup.AppDomainInitializer != null)
+ initializerInfo = new AppDomainInitializerInfo(setup.AppDomainInitializer);
// will travel x-Ad, drop non-agile data
AppDomainSetup newSetup = new AppDomainSetup(setup, false);
@@ -1115,63 +1015,61 @@ namespace System
// System.AppDomainManager.CreateDomain() and add the flags to the AppDomainSetup
List<String> compatList = new List<String>();
- if(propertyNames!=null && propertyValues != null)
+ if (propertyNames != null && propertyValues != null)
{
- for (int i=0; i<propertyNames.Length; i++)
+ for (int i = 0; i < propertyNames.Length; i++)
{
- if(String.Compare(propertyNames[i], "AppDomainCompatSwitch", StringComparison.OrdinalIgnoreCase) == 0)
+ if (String.Compare(propertyNames[i], "AppDomainCompatSwitch", StringComparison.OrdinalIgnoreCase) == 0)
{
compatList.Add(propertyValues[i]);
propertyNames[i] = null;
propertyValues[i] = null;
}
-
}
-
+
if (compatList.Count > 0)
{
newSetup.SetCompatibilitySwitches(compatList);
}
}
- return new Object[]
+ return new Object[]
{
- friendlyName,
- newSetup,
- parentSecurityDescriptor,
+ friendlyName,
+ newSetup,
+ parentSecurityDescriptor,
generateDefaultEvidence,
serializedEvidence,
initializerInfo,
sandboxName,
propertyNames,
propertyValues
- };
+ };
} // PrepareDataForSetup
- [MethodImplAttribute(MethodImplOptions.NoInlining)]
private static Object Setup(Object arg)
{
Contract.Requires(arg != null && arg is Object[]);
Contract.Requires(((Object[])arg).Length >= 8);
- Object[] args=(Object[])arg;
- String friendlyName = (String)args[0];
- AppDomainSetup setup = (AppDomainSetup)args[1];
- IntPtr parentSecurityDescriptor = (IntPtr)args[2];
- bool generateDefaultEvidence = (bool)args[3];
- byte[] serializedEvidence = (byte[])args[4];
- AppDomainInitializerInfo initializerInfo = (AppDomainInitializerInfo)args[5];
- string sandboxName = (string)args[6];
- string[] propertyNames = (string[])args[7]; // can contain null elements
- string[] propertyValues = (string[])args[8]; // can contain null elements
+ Object[] args = (Object[])arg;
+ String friendlyName = (String)args[0];
+ AppDomainSetup setup = (AppDomainSetup)args[1];
+ IntPtr parentSecurityDescriptor = (IntPtr)args[2];
+ bool generateDefaultEvidence = (bool)args[3];
+ byte[] serializedEvidence = (byte[])args[4];
+ AppDomainInitializerInfo initializerInfo = (AppDomainInitializerInfo)args[5];
+ string sandboxName = (string)args[6];
+ string[] propertyNames = (string[])args[7]; // can contain null elements
+ string[] propertyValues = (string[])args[8]; // can contain null elements
// extract evidence
Evidence providedSecurityInfo = null;
Evidence creatorsSecurityInfo = null;
AppDomain ad = AppDomain.CurrentDomain;
- AppDomainSetup newSetup=new AppDomainSetup(setup,false);
+ AppDomainSetup newSetup = new AppDomainSetup(setup, false);
- if(propertyNames!=null && propertyValues != null)
+ if (propertyNames != null && propertyValues != null)
{
for (int i = 0; i < propertyNames.Length; i++)
{
@@ -1190,55 +1088,55 @@ namespace System
}
}
- for (int i=0; i<propertyNames.Length; i++)
+ for (int i = 0; i < propertyNames.Length; i++)
{
- if(propertyNames[i]=="APPBASE") // make sure in sync with Fusion
+ if (propertyNames[i] == "APPBASE") // make sure in sync with Fusion
{
- if(propertyValues[i]==null)
+ if (propertyValues[i] == null)
throw new ArgumentNullException("APPBASE");
if (PathInternal.IsPartiallyQualified(propertyValues[i]))
- throw new ArgumentException( Environment.GetResourceString( "Argument_AbsolutePathRequired" ) );
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired);
newSetup.ApplicationBase = NormalizePath(propertyValues[i], fullCheck: true);
}
- else if(propertyNames[i]=="LOADER_OPTIMIZATION")
+ else if (propertyNames[i] == "LOADER_OPTIMIZATION")
{
- if(propertyValues[i]==null)
+ if (propertyValues[i] == null)
throw new ArgumentNullException("LOADER_OPTIMIZATION");
- switch(propertyValues[i])
+ switch (propertyValues[i])
{
- case "SingleDomain": newSetup.LoaderOptimization=LoaderOptimization.SingleDomain;break;
- case "MultiDomain": newSetup.LoaderOptimization=LoaderOptimization.MultiDomain;break;
- case "MultiDomainHost": newSetup.LoaderOptimization=LoaderOptimization.MultiDomainHost;break;
- case "NotSpecified": newSetup.LoaderOptimization=LoaderOptimization.NotSpecified;break;
- default: throw new ArgumentException(Environment.GetResourceString("Argument_UnrecognizedLoaderOptimization"), "LOADER_OPTIMIZATION");
+ case "SingleDomain": newSetup.LoaderOptimization = LoaderOptimization.SingleDomain; break;
+ case "MultiDomain": newSetup.LoaderOptimization = LoaderOptimization.MultiDomain; break;
+ case "MultiDomainHost": newSetup.LoaderOptimization = LoaderOptimization.MultiDomainHost; break;
+ case "NotSpecified": newSetup.LoaderOptimization = LoaderOptimization.NotSpecified; break;
+ default: throw new ArgumentException(SR.Argument_UnrecognizedLoaderOptimization, "LOADER_OPTIMIZATION");
}
}
- else if(propertyNames[i]=="TRUSTED_PLATFORM_ASSEMBLIES" ||
- propertyNames[i]=="PLATFORM_RESOURCE_ROOTS" ||
- propertyNames[i]=="APP_PATHS" ||
- propertyNames[i]=="APP_NI_PATHS")
+ else if (propertyNames[i] == "TRUSTED_PLATFORM_ASSEMBLIES" ||
+ propertyNames[i] == "PLATFORM_RESOURCE_ROOTS" ||
+ propertyNames[i] == "APP_PATHS" ||
+ propertyNames[i] == "APP_NI_PATHS")
{
string values = propertyValues[i];
- if(values == null)
+ if (values == null)
throw new ArgumentNullException(propertyNames[i]);
ad.SetData(propertyNames[i], NormalizeAppPaths(values));
}
- else if(propertyNames[i]!= null)
+ else if (propertyNames[i] != null)
{
- ad.SetData(propertyNames[i],propertyValues[i]); // just propagate
+ ad.SetData(propertyNames[i], propertyValues[i]); // just propagate
}
}
}
ad.SetupFusionStore(newSetup, null); // makes FusionStore a ref to newSetup
-
+
// technically, we don't need this, newSetup refers to the same object as FusionStore
// but it's confusing since it isn't immediately obvious whether we have a ref or a copy
- AppDomainSetup adSetup = ad.FusionStore;
+ AppDomainSetup adSetup = ad.FusionStore;
adSetup.InternalSetApplicationTrust(sandboxName);
@@ -1264,10 +1162,10 @@ namespace System
generateDefaultEvidence,
parentSecurityDescriptor,
true);
-
+
// can load user code now
- if(initializerInfo!=null)
- adSetup.AppDomainInitializer=initializerInfo.Unwrap();
+ if (initializerInfo != null)
+ adSetup.AppDomainInitializer = initializerInfo.Unwrap();
RunInitializer(adSetup);
return null;
@@ -1299,7 +1197,7 @@ namespace System
continue;
if (PathInternal.IsPartiallyQualified(path))
- throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"));
+ throw new ArgumentException(SR.Argument_AbsolutePathRequired);
string appPath = NormalizePath(path, fullCheck: true);
sb.Append(appPath);
@@ -1329,7 +1227,7 @@ namespace System
// (eg. one thread doing a com call and another doing attach for IJW)
lock (this)
{
- if(_FusionStore == null)
+ if (_FusionStore == null)
{
AppDomainSetup setup = new AppDomainSetup();
@@ -1349,7 +1247,6 @@ namespace System
JitHelpers.GetObjectHandleOnStack(ref stackEvidence),
creatorsSecurityDescriptor,
publishAppDomain);
-
}
[SuppressUnmanagedCodeSecurity]
@@ -1372,8 +1269,9 @@ namespace System
public AppDomainSetup SetupInformation
{
- get {
- return new AppDomainSetup(FusionStore,true);
+ get
+ {
+ return new AppDomainSetup(FusionStore, true);
}
}
@@ -1382,7 +1280,7 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern String GetOrInternString(String str);
-
+
[SuppressUnmanagedCodeSecurity]
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
private static extern void GetGrantSet(AppDomainHandle domain, ObjectHandleOnStack retGrantSet);
@@ -1407,14 +1305,14 @@ namespace System
public Int32 Id
{
- get {
+ get
+ {
return GetId();
}
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern Int32 GetId();
-
}
/// <summary>
diff --git a/src/mscorlib/src/System/AppDomainAttributes.cs b/src/mscorlib/src/System/AppDomainAttributes.cs
index 960f9c1cac..deb43eadf9 100644
--- a/src/mscorlib/src/System/AppDomainAttributes.cs
+++ b/src/mscorlib/src/System/AppDomainAttributes.cs
@@ -11,19 +11,19 @@
**
=============================================================================*/
-namespace System {
-
+namespace System
+{
[Serializable]
- internal enum LoaderOptimization
+ internal enum LoaderOptimization
{
- NotSpecified = 0,
- SingleDomain = 1,
- MultiDomain = 2,
- MultiDomainHost = 3,
+ NotSpecified = 0,
+ SingleDomain = 1,
+ MultiDomain = 2,
+ MultiDomainHost = 3,
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- DomainMask = 3,
+ DomainMask = 3,
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. http://go.microsoft.com/fwlink/?linkid=14202")]
- DisallowBindings = 4
+ DisallowBindings = 4
}
}
diff --git a/src/mscorlib/src/System/AppDomainManager.cs b/src/mscorlib/src/System/AppDomainManager.cs
index bd2faa0110..830de29c16 100644
--- a/src/mscorlib/src/System/AppDomainManager.cs
+++ b/src/mscorlib/src/System/AppDomainManager.cs
@@ -8,18 +8,18 @@
// participate in the creation and control the settings of new AppDomains.
//
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Security;
+using System.Runtime.InteropServices;
+
namespace System
{
- using System.Reflection;
- using System.Runtime.CompilerServices;
- using System.Security;
- using System.Runtime.InteropServices;
-
internal class AppDomainManager : MarshalByRefObject
{
- public AppDomainManager () {}
+ public AppDomainManager() { }
- public virtual void InitializeNewDomain (AppDomainSetup appDomainInfo)
+ public virtual void InitializeNewDomain(AppDomainSetup appDomainInfo)
{
// By default, InitializeNewDomain does nothing. AppDomain.CreateAppDomainManager relies on this fact.
}
@@ -28,8 +28,10 @@ namespace System
private static extern void GetEntryAssembly(ObjectHandleOnStack retAssembly);
private Assembly m_entryAssembly = null;
- public virtual Assembly EntryAssembly {
- get {
+ public virtual Assembly EntryAssembly
+ {
+ get
+ {
// The default AppDomainManager sets the EntryAssembly depending on whether the
// AppDomain is a manifest application domain or not. In the first case, we parse
// the application manifest to find out the entry point assembly and return that assembly.
@@ -46,15 +48,12 @@ namespace System
}
}
- internal static AppDomainManager CurrentAppDomainManager {
- get {
+ internal static AppDomainManager CurrentAppDomainManager
+ {
+ get
+ {
return AppDomain.CurrentDomain.DomainManager;
}
}
-
- public virtual bool CheckSecuritySettings (SecurityState state)
- {
- return false;
- }
}
}
diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs
index 0d19ad237f..142b8a05f7 100644
--- a/src/mscorlib/src/System/AppDomainSetup.cs
+++ b/src/mscorlib/src/System/AppDomainSetup.cs
@@ -4,15 +4,12 @@
/*=============================================================================
**
-** Class: AppDomainSetup
**
** Purpose: Defines the settings that the loader uses to find assemblies in an
** AppDomain
**
-** Date: Dec 22, 2000
**
=============================================================================*/
-
namespace System
{
using System.Text;
@@ -34,49 +31,29 @@ namespace System
// If you add a new value, add the corresponding property
// to AppDomain.GetData() and SetData()'s switch statements,
// as well as fusionsetup.h.
- ApplicationBaseValue = 0, // LOADER_APPLICATION_BASE
- ConfigurationFileValue = 1, // LOADER_CONFIGURATION_BASE
- DynamicBaseValue = 2, // LOADER_DYNAMIC_BASE
- DevPathValue = 3, // LOADER_DEVPATH
- ApplicationNameValue = 4, // LOADER_APPLICATION_NAME
- PrivateBinPathValue = 5, // LOADER_PRIVATE_PATH
- PrivateBinPathProbeValue = 6, // LOADER_PRIVATE_BIN_PATH_PROBE
- ShadowCopyDirectoriesValue = 7, // LOADER_SHADOW_COPY_DIRECTORIES
- ShadowCopyFilesValue = 8, // LOADER_SHADOW_COPY_FILES
- CachePathValue = 9, // LOADER_CACHE_PATH
- LicenseFileValue = 10, // LOADER_LICENSE_FILE
- DisallowPublisherPolicyValue = 11, // LOADER_DISALLOW_PUBLISHER_POLICY
- DisallowCodeDownloadValue = 12, // LOADER_DISALLOW_CODE_DOWNLOAD
+ ApplicationBaseValue = 0, // LOADER_APPLICATION_BASE
+ ConfigurationFileValue = 1, // LOADER_CONFIGURATION_BASE
+ DynamicBaseValue = 2, // LOADER_DYNAMIC_BASE
+ DevPathValue = 3, // LOADER_DEVPATH
+ ApplicationNameValue = 4, // LOADER_APPLICATION_NAME
+ PrivateBinPathValue = 5, // LOADER_PRIVATE_PATH
+ PrivateBinPathProbeValue = 6, // LOADER_PRIVATE_BIN_PATH_PROBE
+ ShadowCopyDirectoriesValue = 7, // LOADER_SHADOW_COPY_DIRECTORIES
+ ShadowCopyFilesValue = 8, // LOADER_SHADOW_COPY_FILES
+ CachePathValue = 9, // LOADER_CACHE_PATH
+ LicenseFileValue = 10, // LOADER_LICENSE_FILE
+ DisallowPublisherPolicyValue = 11, // LOADER_DISALLOW_PUBLISHER_POLICY
+ DisallowCodeDownloadValue = 12, // LOADER_DISALLOW_CODE_DOWNLOAD
DisallowBindingRedirectsValue = 13, // LOADER_DISALLOW_BINDING_REDIRECTS
- DisallowAppBaseProbingValue = 14, // LOADER_DISALLOW_APPBASE_PROBING
- ConfigurationBytesValue = 15, // LOADER_CONFIGURATION_BYTES
- LoaderMaximum = 18 // LOADER_MAXIMUM
+ DisallowAppBaseProbingValue = 14, // LOADER_DISALLOW_APPBASE_PROBING
+ 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";
- private const string APPENV_RELATIVEPATH = "RELPATH";
- private const string MACHINE_CONFIGURATION_FILE = "config\\machine.config";
- private const string ACTAG_HOST_CONFIG_FILE = "HOST_CONFIG";
-
- // Constants from fusionpriv.h
- private const string ACTAG_APP_CONFIG_FILE = "APP_CONFIG_FILE";
- private const string ACTAG_MACHINE_CONFIG = "MACHINE_CONFIG";
+
private const string ACTAG_APP_BASE_URL = "APPBASE";
- private const string ACTAG_APP_NAME = "APP_NAME";
- private const string ACTAG_BINPATH_PROBE_ONLY = "BINPATH_PROBE_ONLY";
- private const string ACTAG_APP_CACHE_BASE = "CACHE_BASE";
- private const string ACTAG_DEV_PATH = "DEV_PATH";
- private const string ACTAG_APP_DYNAMIC_BASE = "DYNAMIC_BASE";
- private const string ACTAG_FORCE_CACHE_INSTALL = "FORCE_CACHE_INSTALL";
- private const string ACTAG_APP_PRIVATE_BINPATH = "PRIVATE_BINPATH";
- private const string ACTAG_APP_SHADOW_COPY_DIRS = "SHADOW_COPY_DIRS";
- private const string ACTAG_DISALLOW_APPLYPUBLISHERPOLICY = "DISALLOW_APP";
- private const string ACTAG_CODE_DOWNLOAD_DISABLED = "CODE_DOWNLOAD_DISABLED";
- private const string ACTAG_DISALLOW_APP_BINDING_REDIRECTS = "DISALLOW_APP_REDIRECTS";
- private const string ACTAG_DISALLOW_APP_BASE_PROBING = "DISALLOW_APP_BASE_PROBING";
- private const string ACTAG_APP_CONFIG_BLOB = "APP_CONFIG_BLOB";
// This class has an unmanaged representation so be aware you will need to make edits in vm\object.h if you change the order
// of these fields or add new ones.
@@ -87,7 +64,7 @@ namespace System
private String _AppBase; // for compat with v1.1
#pragma warning restore 169
[OptionalField(VersionAdded = 2)]
- private AppDomainInitializer _AppDomainInitializer;
+ private AppDomainInitializer _AppDomainInitializer;
[OptionalField(VersionAdded = 2)]
private string[] _AppDomainInitializerArguments;
@@ -125,7 +102,8 @@ namespace System
internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
{
string[] mine = Value;
- if(copy != null) {
+ if (copy != null)
+ {
string[] other = copy.Value;
int mineSize = _Entries.Length;
int otherSize = other.Length;
@@ -152,7 +130,7 @@ namespace System
else
_AppDomainInitializer = null;
- _ConfigurationBytes = copy.GetConfigurationBytes();
+ _ConfigurationBytes = null;
#if FEATURE_COMINTEROP
_DisableInterfaceCache = copy._DisableInterfaceCache;
#endif // FEATURE_COMINTEROP
@@ -171,7 +149,7 @@ namespace System
#endif
}
- else
+ else
_LoaderOptimization = LoaderOptimization.NotSpecified;
}
@@ -180,39 +158,37 @@ namespace System
_LoaderOptimization = LoaderOptimization.NotSpecified;
}
- internal void SetupDefaults(string imageLocation, bool imageLocationAlreadyNormalized = false) {
- char[] sep = {'\\', '/'};
+ internal void SetupDefaults(string imageLocation, bool imageLocationAlreadyNormalized = false)
+ {
+ char[] sep = { '\\', '/' };
int i = imageLocation.LastIndexOfAny(sep);
- if (i == -1) {
+ if (i == -1)
+ {
ApplicationName = imageLocation;
}
- else {
- ApplicationName = imageLocation.Substring(i+1);
- string appBase = imageLocation.Substring(0, i+1);
+ else
+ {
+ ApplicationName = imageLocation.Substring(i + 1);
+ string appBase = imageLocation.Substring(0, i + 1);
if (imageLocationAlreadyNormalized)
- Value[(int) LoaderInformation.ApplicationBaseValue] = appBase;
- else
+ Value[(int)LoaderInformation.ApplicationBaseValue] = appBase;
+ else
ApplicationBase = appBase;
}
- ConfigurationFile = ApplicationName + AppDomainSetup.ConfigurationExtension;
}
internal string[] Value
{
- get {
- if( _Entries == null)
+ get
+ {
+ if (_Entries == null)
_Entries = new String[(int)LoaderInformation.LoaderMaximum];
return _Entries;
}
}
- internal String GetUnsecureApplicationBase()
- {
- return Value[(int) LoaderInformation.ApplicationBaseValue];
- }
-
public string AppDomainManagerAssembly
{
get { return _AppDomainManagerAssembly; }
@@ -228,233 +204,17 @@ namespace System
public String ApplicationBase
{
[Pure]
- get {
- return VerifyDir(GetUnsecureApplicationBase(), false);
- }
-
- set {
- Value[(int) LoaderInformation.ApplicationBaseValue] = NormalizePath(value, false);
- }
- }
-
- private String NormalizePath(String path, bool useAppBase)
- {
- if(path == null)
- return null;
-
- // If we add very long file name support ("\\?\") to the Path class then this is unnecesary,
- // but we do not plan on doing this for now.
-
- // Long path checks can be quirked, and as loading default quirks too early in the setup of an AppDomain is risky
- // we'll avoid checking path lengths- we'll still fail at MAX_PATH later if we're !useAppBase when we call Path's
- // NormalizePath.
- if (!useAppBase)
- path = Security.Util.URLString.PreProcessForExtendedPathRemoval(
- checkPathLength: false,
- url: path,
- isFileUrl: false);
-
-
- int len = path.Length;
- if (len == 0)
- return null;
-
-#if !PLATFORM_UNIX
- bool UNCpath = false;
-#endif // !PLATFORM_UNIX
-
- if ((len > 7) &&
- (String.Compare( path, 0, "file:", 0, 5, StringComparison.OrdinalIgnoreCase) == 0)) {
- int trim;
-
- if (path[6] == '\\') {
- if ((path[7] == '\\') || (path[7] == '/')) {
-
- // Don't allow "file:\\\\", because we can't tell the difference
- // with it for "file:\\" + "\\server" and "file:\\\" + "\localpath"
- if ( (len > 8) &&
- ((path[8] == '\\') || (path[8] == '/')) )
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPathChars"));
-
- // file:\\\ means local path
- else
-#if !PLATFORM_UNIX
- trim = 8;
-#else
- // For Unix platform, trim the first 7 charcaters only.
- // Trimming the first 8 characters will cause
- // the root path separator to be trimmed away,
- // and the absolute local path becomes a relative local path.
- trim = 7;
-#endif // !PLATFORM_UNIX
- }
-
- // file:\\ means remote server
- else {
- trim = 5;
-#if !PLATFORM_UNIX
- UNCpath = true;