Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / SafeIUnknown.cs / 1 / SafeIUnknown.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.Tools.ServiceModel.WsatConfig { using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.ConstrainedExecution; using System.Security.Permissions; // Keep an interface pointer that will not be used in a SafeHandle derived so // that it will be properly released. internal sealed class SafeIUnknown : SafeHandle { // This constructor is called by ComInterop [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal SafeIUnknown() : base(IntPtr.Zero, true) { } // This constructor is called by ComInterop [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal SafeIUnknown(IntPtr unknown) : base(IntPtr.Zero, true) { RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { base.handle = unknown; } } public override bool IsInvalid { get { return (IsClosed || (IntPtr.Zero == base.handle)); } } override protected bool ReleaseHandle() { // NOTE: The SafeHandle class guarantees this will be called exactly once. IntPtr ptr = base.handle; base.handle = IntPtr.Zero; if (IntPtr.Zero != ptr) { Marshal.Release(ptr); } return true; } } } // 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
- DataServiceProcessingPipelineEventArgs.cs
- HtmlElement.cs
- OracleLob.cs
- DropDownButton.cs
- ReaderWriterLock.cs
- WmpBitmapDecoder.cs
- DelegateSerializationHolder.cs
- TextBox.cs
- InternalBase.cs
- ValueTable.cs
- TextDecorations.cs
- WindowsScrollBar.cs
- QueryCacheKey.cs
- ListItemParagraph.cs
- Overlapped.cs
- WebServiceData.cs
- AjaxFrameworkAssemblyAttribute.cs
- CompositeCollection.cs
- ProgressPage.cs
- SelectionItemProviderWrapper.cs
- Vector3D.cs
- SslStreamSecurityElement.cs
- StandardBindingOptionalReliableSessionElement.cs
- DataIdProcessor.cs
- ComboBox.cs
- LeaseManager.cs
- PerfCounterSection.cs
- Viewport3DVisual.cs
- ExpressionParser.cs
- Adorner.cs
- XmlSchemaGroupRef.cs
- FixedSOMPage.cs
- ProfilePropertyNameValidator.cs
- SchemaMerger.cs
- MexHttpBindingCollectionElement.cs
- AccessDataSourceView.cs
- LocalFileSettingsProvider.cs
- HwndSourceKeyboardInputSite.cs
- Label.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SecurityPermission.cs
- BaseResourcesBuildProvider.cs
- ListViewUpdateEventArgs.cs
- TextTreeTextElementNode.cs
- XmlQueryType.cs
- CodeGenerator.cs
- AbstractSvcMapFileLoader.cs
- DeferredElementTreeState.cs
- ASCIIEncoding.cs
- ComplexObject.cs
- AlternationConverter.cs
- FormsAuthenticationEventArgs.cs
- SecurityDocument.cs
- SocketConnection.cs
- RevocationPoint.cs
- FixedMaxHeap.cs
- DataComponentNameHandler.cs
- ADRoleFactoryConfiguration.cs
- AccessViolationException.cs
- DataGridViewCellParsingEventArgs.cs
- ErrorsHelper.cs
- RenderCapability.cs
- PropertyItem.cs
- ContractMapping.cs
- DPTypeDescriptorContext.cs
- SessionStateUtil.cs
- MLangCodePageEncoding.cs
- EnumConverter.cs
- KnownBoxes.cs
- InstanceData.cs
- TypefaceMap.cs
- ProgressPage.cs
- UriTemplateLiteralQueryValue.cs
- NativeMethodsCLR.cs
- OrderingInfo.cs
- ObjectStateManager.cs
- CFGGrammar.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ClientSideProviderDescription.cs
- DrawingBrush.cs
- VisualBasicImportReference.cs
- StorageAssociationTypeMapping.cs
- HiddenFieldDesigner.cs
- TargetControlTypeCache.cs
- SinglePhaseEnlistment.cs
- WebBrowserHelper.cs
- XmlILTrace.cs
- ConvertEvent.cs
- HuffmanTree.cs
- Buffer.cs
- InstanceOwner.cs
- StringArrayConverter.cs
- XmlTextReaderImplHelpers.cs
- IndicFontClient.cs
- ToolStripDropTargetManager.cs
- CodeCastExpression.cs
- PagerSettings.cs
- ThicknessConverter.cs
- QualificationDataAttribute.cs
- PropertyEntry.cs