Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / mda.cs / 1305376 / mda.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System.Runtime.CompilerServices; using System.Runtime.Versioning; namespace System { #if MDA_SUPPORTED internal static class Mda { internal static class StreamWriterBufferedDataLost { // State: 0 (not queried); 1 (enabled); 2 (disabled) private static int _enabledState; private static int _captureAllocatedCallStackState; internal static bool Enabled { [System.Security.SecuritySafeCritical] // auto-generated get { if (_enabledState == 0) { if (Mda.IsStreamWriterBufferedDataLostEnabled()) _enabledState = 1; else _enabledState = 2; } return (_enabledState == 1); } } internal static bool CaptureAllocatedCallStack { [System.Security.SecuritySafeCritical] // auto-generated get { if (_captureAllocatedCallStackState == 0) { if (Mda.IsStreamWriterBufferedDataLostCaptureAllocatedCallStack()) _captureAllocatedCallStackState = 1; else _captureAllocatedCallStackState = 2; } return (_captureAllocatedCallStackState == 1); } } [System.Security.SecuritySafeCritical] // auto-generated internal static void ReportError(String text) { Mda.ReportStreamWriterBufferedDataLost(text); } } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ReportStreamWriterBufferedDataLost(String text); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsStreamWriterBufferedDataLostEnabled(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsStreamWriterBufferedDataLostCaptureAllocatedCallStack(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void MemberInfoCacheCreation(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void DateTimeInvalidLocalFormat(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsInvalidGCHandleCookieProbeEnabled(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void FireInvalidGCHandleCookieProbe(IntPtr cookie); [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ReportErrorSafeHandleRelease(Exception ex); } #endif } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System.Runtime.CompilerServices; using System.Runtime.Versioning; namespace System { #if MDA_SUPPORTED internal static class Mda { internal static class StreamWriterBufferedDataLost { // State: 0 (not queried); 1 (enabled); 2 (disabled) private static int _enabledState; private static int _captureAllocatedCallStackState; internal static bool Enabled { [System.Security.SecuritySafeCritical] // auto-generated get { if (_enabledState == 0) { if (Mda.IsStreamWriterBufferedDataLostEnabled()) _enabledState = 1; else _enabledState = 2; } return (_enabledState == 1); } } internal static bool CaptureAllocatedCallStack { [System.Security.SecuritySafeCritical] // auto-generated get { if (_captureAllocatedCallStackState == 0) { if (Mda.IsStreamWriterBufferedDataLostCaptureAllocatedCallStack()) _captureAllocatedCallStackState = 1; else _captureAllocatedCallStackState = 2; } return (_captureAllocatedCallStackState == 1); } } [System.Security.SecuritySafeCritical] // auto-generated internal static void ReportError(String text) { Mda.ReportStreamWriterBufferedDataLost(text); } } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ReportStreamWriterBufferedDataLost(String text); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsStreamWriterBufferedDataLostEnabled(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsStreamWriterBufferedDataLostCaptureAllocatedCallStack(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void MemberInfoCacheCreation(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void DateTimeInvalidLocalFormat(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsInvalidGCHandleCookieProbeEnabled(); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void FireInvalidGCHandleCookieProbe(IntPtr cookie); [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ReportErrorSafeHandleRelease(Exception ex); } #endif } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegexWriter.cs
- EmptyEnumerable.cs
- XmlDocumentSerializer.cs
- HMACSHA1.cs
- FontStyles.cs
- ImageSourceConverter.cs
- FirstQueryOperator.cs
- QueryContinueDragEvent.cs
- TextParentUndoUnit.cs
- Timer.cs
- DbConnectionStringCommon.cs
- XamlWriterExtensions.cs
- CustomError.cs
- EmulateRecognizeCompletedEventArgs.cs
- ArrayElementGridEntry.cs
- CreateUserWizard.cs
- InteropAutomationProvider.cs
- OSFeature.cs
- CngAlgorithm.cs
- NavigationProperty.cs
- SqlBuilder.cs
- ControlTemplate.cs
- NamedPipeTransportElement.cs
- PackagePartCollection.cs
- SoapTypeAttribute.cs
- OuterGlowBitmapEffect.cs
- HotSpotCollection.cs
- FileDialog.cs
- RoutedPropertyChangedEventArgs.cs
- ReachUIElementCollectionSerializerAsync.cs
- Frame.cs
- TextElementEnumerator.cs
- ActivityPreviewDesigner.cs
- RemotingConfigParser.cs
- XmlNamespaceDeclarationsAttribute.cs
- HandlerFactoryWrapper.cs
- DeflateStream.cs
- safelinkcollection.cs
- AspNetCompatibilityRequirementsMode.cs
- CapabilitiesUse.cs
- RotateTransform.cs
- XmlHierarchyData.cs
- SystemSounds.cs
- ClientTarget.cs
- XmlSchemaObject.cs
- Rotation3DKeyFrameCollection.cs
- TimersDescriptionAttribute.cs
- TableProviderWrapper.cs
- PositiveTimeSpanValidator.cs
- CapiNative.cs
- StringCollectionEditor.cs
- QueueNameHelper.cs
- UnsafeNativeMethods.cs
- TracedNativeMethods.cs
- ErrorWebPart.cs
- References.cs
- AsymmetricSignatureDeformatter.cs
- SqlBuilder.cs
- RestClientProxyHandler.cs
- DecimalAverageAggregationOperator.cs
- Popup.cs
- DefaultAsyncDataDispatcher.cs
- HeaderedItemsControl.cs
- _UriTypeConverter.cs
- Point3DCollection.cs
- ListChangedEventArgs.cs
- XmlAttributes.cs
- Parallel.cs
- SoapFault.cs
- XmlSchemaValidationException.cs
- Pool.cs
- CloudCollection.cs
- MailAddressCollection.cs
- BaseEntityWrapper.cs
- Faults.cs
- UpdatePanel.cs
- RuntimeHandles.cs
- BindingListCollectionView.cs
- CompensationExtension.cs
- UnknownBitmapDecoder.cs
- DocumentOrderComparer.cs
- NativeWindow.cs
- OracleDataReader.cs
- ItemChangedEventArgs.cs
- DBConcurrencyException.cs
- dataobject.cs
- DataObjectSettingDataEventArgs.cs
- ScriptingJsonSerializationSection.cs
- OdbcTransaction.cs
- InternalConfigEventArgs.cs
- EncodingNLS.cs
- DataColumnMappingCollection.cs
- sqlcontext.cs
- PopOutPanel.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- Stacktrace.cs
- ConstantExpression.cs
- CalendarDayButton.cs
- LZCodec.cs
- ModelItemImpl.cs