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
- OracleCommandBuilder.cs
- CurrencyWrapper.cs
- CharacterBuffer.cs
- _CommandStream.cs
- DescendentsWalkerBase.cs
- DataSvcMapFileSerializer.cs
- PartialClassGenerationTask.cs
- TreeViewEvent.cs
- Matrix3DStack.cs
- AtomicFile.cs
- BamlLocalizabilityResolver.cs
- AssociationTypeEmitter.cs
- CollectionEditVerbManager.cs
- TabItemAutomationPeer.cs
- GlyphCache.cs
- SelectedDatesCollection.cs
- TransformCollection.cs
- StylusCaptureWithinProperty.cs
- MenuItemStyleCollection.cs
- ApplicationSecurityInfo.cs
- DataGridCell.cs
- NotificationContext.cs
- XmlNodeChangedEventArgs.cs
- DataGrid.cs
- TrackingMemoryStreamFactory.cs
- TemplateParser.cs
- MenuEventArgs.cs
- SslStream.cs
- SqlDataSourceSummaryPanel.cs
- SmtpCommands.cs
- SQLBinary.cs
- RemotingConfigParser.cs
- SliderAutomationPeer.cs
- Expression.cs
- InputLanguage.cs
- RelationshipNavigation.cs
- QfeChecker.cs
- RecognizerBase.cs
- XamlSerializerUtil.cs
- EntityFrameworkVersions.cs
- GlyphingCache.cs
- Pkcs9Attribute.cs
- LeaseManager.cs
- HttpRequestBase.cs
- Size.cs
- PathHelper.cs
- RepeaterItemCollection.cs
- ComplexPropertyEntry.cs
- SQLByteStorage.cs
- SHA1CryptoServiceProvider.cs
- DrawingServices.cs
- SafeLocalMemHandle.cs
- CurrentChangingEventManager.cs
- PaintValueEventArgs.cs
- SingleAnimationUsingKeyFrames.cs
- XmlWriterSettings.cs
- ObjectDataSource.cs
- RuleEngine.cs
- ArcSegment.cs
- Graph.cs
- Quad.cs
- ClientRolePrincipal.cs
- List.cs
- RightsManagementEncryptionTransform.cs
- login.cs
- CompiledQueryCacheEntry.cs
- Quaternion.cs
- ProvidePropertyAttribute.cs
- AssemblyBuilderData.cs
- FontStretches.cs
- ListChangedEventArgs.cs
- TwoPhaseCommit.cs
- WindowsEditBoxRange.cs
- WorkItem.cs
- BitFlagsGenerator.cs
- MoveSizeWinEventHandler.cs
- DBBindings.cs
- LexicalChunk.cs
- NativeMethodsOther.cs
- RawStylusInputReport.cs
- SchemaMapping.cs
- ConsumerConnectionPointCollection.cs
- Cell.cs
- ColorTransformHelper.cs
- Matrix3DValueSerializer.cs
- RelationshipConverter.cs
- PenThreadPool.cs
- ConfigurationManagerInternalFactory.cs
- DataBinding.cs
- GridViewPageEventArgs.cs
- DecoderExceptionFallback.cs
- SiteMap.cs
- EdmItemError.cs
- ISO2022Encoding.cs
- _ScatterGatherBuffers.cs
- OperationInfoBase.cs
- FormsAuthenticationCredentials.cs
- PasswordBox.cs
- SByteConverter.cs
- MtomMessageEncodingElement.cs