Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / NetworkInformation / SafeCancelMibChangeNotify.cs / 1305376 / SafeCancelMibChangeNotify.cs
using System; using System.Security; using Microsoft.Win32.SafeHandles; namespace System.Net.NetworkInformation { // This class guarantees that any in-progress notifications will be canceled before the AppDomain gets unloaded. // CancelMibChangeNotify2 guarantees that after it returns, the callback will NEVER be called. It may block // for a small amount of time if the callback is currently in progress, which is fine (and, intentional). [SuppressUnmanagedCodeSecurity] internal class SafeCancelMibChangeNotify : SafeHandleZeroOrMinusOneIsInvalid { public SafeCancelMibChangeNotify() : base(true) { } protected override bool ReleaseHandle() { uint err = UnsafeNetInfoNativeMethods.CancelMibChangeNotify2(base.handle); base.handle = IntPtr.Zero; return (err == UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Security; using Microsoft.Win32.SafeHandles; namespace System.Net.NetworkInformation { // This class guarantees that any in-progress notifications will be canceled before the AppDomain gets unloaded. // CancelMibChangeNotify2 guarantees that after it returns, the callback will NEVER be called. It may block // for a small amount of time if the callback is currently in progress, which is fine (and, intentional). [SuppressUnmanagedCodeSecurity] internal class SafeCancelMibChangeNotify : SafeHandleZeroOrMinusOneIsInvalid { public SafeCancelMibChangeNotify() : base(true) { } protected override bool ReleaseHandle() { uint err = UnsafeNetInfoNativeMethods.CancelMibChangeNotify2(base.handle); base.handle = IntPtr.Zero; return (err == UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PositiveTimeSpanValidatorAttribute.cs
- Console.cs
- XmlSerializerSection.cs
- FrugalMap.cs
- SqlExpressionNullability.cs
- UserControl.cs
- ObjectAssociationEndMapping.cs
- ChannelSinkStacks.cs
- QuadraticBezierSegment.cs
- ECDiffieHellman.cs
- SystemInfo.cs
- LogLogRecordHeader.cs
- Gdiplus.cs
- CompositeFontFamily.cs
- WebPartsPersonalizationAuthorization.cs
- externdll.cs
- LayoutSettings.cs
- TextReader.cs
- Int64Converter.cs
- Quaternion.cs
- SettingsBase.cs
- NativeMethods.cs
- CookieProtection.cs
- HttpDictionary.cs
- GlobalItem.cs
- HebrewCalendar.cs
- WebPartEventArgs.cs
- UriTemplatePathSegment.cs
- MailHeaderInfo.cs
- ResourceContainer.cs
- AlignmentXValidation.cs
- SourceFileInfo.cs
- ResourceDictionaryCollection.cs
- MobileErrorInfo.cs
- TypeSystem.cs
- CheckBoxRenderer.cs
- Empty.cs
- ProviderCollection.cs
- DataSourceCacheDurationConverter.cs
- SortKey.cs
- BamlWriter.cs
- TypedTableBase.cs
- MeshGeometry3D.cs
- Condition.cs
- Point4D.cs
- SynchronizedPool.cs
- QueueProcessor.cs
- InertiaExpansionBehavior.cs
- NotifyParentPropertyAttribute.cs
- DataGridViewRowPrePaintEventArgs.cs
- EventLogPermissionEntry.cs
- PermissionRequestEvidence.cs
- StyleTypedPropertyAttribute.cs
- Propagator.cs
- ToolStripDropDownItemDesigner.cs
- BooleanFacetDescriptionElement.cs
- HatchBrush.cs
- ToolboxItemAttribute.cs
- SqlCrossApplyToCrossJoin.cs
- StylusButtonEventArgs.cs
- DayRenderEvent.cs
- SchemaLookupTable.cs
- ContentType.cs
- GridPatternIdentifiers.cs
- DataListItemEventArgs.cs
- smtpconnection.cs
- Sentence.cs
- RegexCode.cs
- PointKeyFrameCollection.cs
- LineServices.cs
- XmlToDatasetMap.cs
- IssuanceLicense.cs
- TreeNodeStyleCollection.cs
- OracleFactory.cs
- CustomError.cs
- RootProfilePropertySettingsCollection.cs
- StringValidatorAttribute.cs
- ToolStripProgressBar.cs
- LinqDataSourceDisposeEventArgs.cs
- SemaphoreFullException.cs
- XamlTypeMapper.cs
- TraceEventCache.cs
- HotCommands.cs
- ProvidersHelper.cs
- FormsAuthenticationUserCollection.cs
- ColorTransform.cs
- TemplateAction.cs
- SqlRetyper.cs
- WindowsListViewScroll.cs
- TextElementEnumerator.cs
- JpegBitmapEncoder.cs
- OdbcException.cs
- connectionpool.cs
- JsonReader.cs
- DSASignatureDeformatter.cs
- LinkLabelLinkClickedEvent.cs
- PolygonHotSpot.cs
- Figure.cs
- CssClassPropertyAttribute.cs
- ManualResetEvent.cs