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
- AdPostCacheSubstitution.cs
- ClientRuntimeConfig.cs
- ElementHostAutomationPeer.cs
- TypedDataSetSchemaImporterExtension.cs
- ProfileEventArgs.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TextEditorParagraphs.cs
- AnnotationAuthorChangedEventArgs.cs
- XmlConvert.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SerializableAuthorizationContext.cs
- MaskedTextBoxDesignerActionList.cs
- ColorPalette.cs
- ImageEditor.cs
- Soap12FormatExtensions.cs
- UMPAttributes.cs
- ToolBarButton.cs
- WebBrowserContainer.cs
- Switch.cs
- PrintDialog.cs
- TimeSpanStorage.cs
- ToolStripStatusLabel.cs
- WebBrowserHelper.cs
- DnsPermission.cs
- Misc.cs
- WindowsPrincipal.cs
- MetaDataInfo.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- WebProxyScriptElement.cs
- loginstatus.cs
- Psha1DerivedKeyGenerator.cs
- DSASignatureFormatter.cs
- ProjectionAnalyzer.cs
- VisualTarget.cs
- FrameworkContentElement.cs
- WebPartActionVerb.cs
- BitmapEffectInputConnector.cs
- XmlSchemaNotation.cs
- InstanceData.cs
- ImplicitInputBrush.cs
- DependencyPropertyValueSerializer.cs
- Pair.cs
- XPathNode.cs
- InheritanceContextChangedEventManager.cs
- BorderGapMaskConverter.cs
- LinqDataView.cs
- TypefaceCollection.cs
- Base64Encoding.cs
- Property.cs
- TrackingMemoryStream.cs
- StorageTypeMapping.cs
- Timeline.cs
- ServicePoint.cs
- LinkArea.cs
- ProcessModelInfo.cs
- XPathParser.cs
- DataServiceQueryOfT.cs
- NullableIntSumAggregationOperator.cs
- FillErrorEventArgs.cs
- PolicyDesigner.cs
- PagePropertiesChangingEventArgs.cs
- DayRenderEvent.cs
- DataTableTypeConverter.cs
- DesignOnlyAttribute.cs
- CompleteWizardStep.cs
- BuildProviderUtils.cs
- FilterRepeater.cs
- WmlControlAdapter.cs
- ExceptionRoutedEventArgs.cs
- ValidatingPropertiesEventArgs.cs
- BitmapPalettes.cs
- GenericTextProperties.cs
- PageCodeDomTreeGenerator.cs
- TextMetrics.cs
- EventLogPermissionEntry.cs
- StackBuilderSink.cs
- OnOperation.cs
- DataStorage.cs
- CompiledQueryCacheEntry.cs
- CompareValidator.cs
- WrappedReader.cs
- OleDbConnectionInternal.cs
- PropertyGrid.cs
- AuthenticateEventArgs.cs
- DependencyPropertyValueSerializer.cs
- StorageAssociationTypeMapping.cs
- RowsCopiedEventArgs.cs
- Schema.cs
- AspNetSynchronizationContext.cs
- FontStyle.cs
- GeneratedView.cs
- ScriptingWebServicesSectionGroup.cs
- WindowsImpersonationContext.cs
- SystemPens.cs
- SMSvcHost.cs
- ComponentEvent.cs
- CaretElement.cs
- DirectoryRedirect.cs
- DefaultPropertyAttribute.cs
- OdbcConnectionStringbuilder.cs