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
- LayoutEditorPart.cs
- CompiledELinqQueryState.cs
- SqlDataSourceCache.cs
- ReflectionUtil.cs
- EUCJPEncoding.cs
- TailCallAnalyzer.cs
- TriggerAction.cs
- TextPattern.cs
- ZoneButton.cs
- QueryableFilterRepeater.cs
- UriParserTemplates.cs
- SystemFonts.cs
- PageAsyncTaskManager.cs
- DataViewListener.cs
- mediaeventargs.cs
- AppSecurityManager.cs
- XmlnsCompatibleWithAttribute.cs
- KeyProperty.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- TreeViewDataItemAutomationPeer.cs
- ResourcePermissionBase.cs
- ToolStripStatusLabel.cs
- WpfPayload.cs
- VisualBrush.cs
- SQLGuid.cs
- XmlSerializerNamespaces.cs
- SimpleHandlerFactory.cs
- ImageFormatConverter.cs
- TextViewSelectionProcessor.cs
- HeaderUtility.cs
- XmlILOptimizerVisitor.cs
- ColorAnimationUsingKeyFrames.cs
- ValueUnavailableException.cs
- IssuedTokenParametersEndpointAddressElement.cs
- DataServiceQuery.cs
- MatrixUtil.cs
- BatchServiceHost.cs
- _OverlappedAsyncResult.cs
- UnsafeNativeMethods.cs
- ParameterSubsegment.cs
- EventWaitHandleSecurity.cs
- DummyDataSource.cs
- LambdaCompiler.Logical.cs
- TextElementEnumerator.cs
- BinaryObjectInfo.cs
- ReflectionHelper.cs
- CorrelationValidator.cs
- OracleParameter.cs
- InkCanvasSelection.cs
- WindowsTitleBar.cs
- TextLineResult.cs
- HtmlInputImage.cs
- ConfigurationManagerHelper.cs
- WorkflowItemsPresenter.cs
- HierarchicalDataTemplate.cs
- SerTrace.cs
- DbReferenceCollection.cs
- ServiceOperationWrapper.cs
- Ops.cs
- entitydatasourceentitysetnameconverter.cs
- ActionFrame.cs
- NullRuntimeConfig.cs
- AccessViolationException.cs
- DataBoundControlAdapter.cs
- DbDataReader.cs
- AvtEvent.cs
- EmptyEnumerator.cs
- FeatureSupport.cs
- ColorConverter.cs
- VectorValueSerializer.cs
- GcHandle.cs
- IDataContractSurrogate.cs
- SubtreeProcessor.cs
- ReturnValue.cs
- _ListenerRequestStream.cs
- OperationInfo.cs
- CompilerWrapper.cs
- WebScriptMetadataMessageEncoderFactory.cs
- ContainerControl.cs
- ApplicationSecurityManager.cs
- DbDataReader.cs
- CodeIdentifier.cs
- DataView.cs
- Table.cs
- Keyboard.cs
- EntityDataSourceSelectingEventArgs.cs
- PermissionToken.cs
- HttpRequest.cs
- PeerName.cs
- WeakKeyDictionary.cs
- ContextProperty.cs
- HtmlContainerControl.cs
- ColumnResult.cs
- SubclassTypeValidator.cs
- PartialArray.cs
- SqlServices.cs
- BoundsDrawingContextWalker.cs
- keycontainerpermission.cs
- BuildProviderCollection.cs
- SerialReceived.cs