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
- FilteredReadOnlyMetadataCollection.cs
- KnownIds.cs
- LZCodec.cs
- ObjectTag.cs
- ErrorFormatterPage.cs
- StreamInfo.cs
- ToolboxDataAttribute.cs
- PanelStyle.cs
- DataList.cs
- ImageCodecInfoPrivate.cs
- SQLMoney.cs
- ApplicationException.cs
- ProcessThreadCollection.cs
- Calendar.cs
- ConnectionPointCookie.cs
- ReachSerializer.cs
- WebEventTraceProvider.cs
- Component.cs
- ZipIOExtraFieldPaddingElement.cs
- Transform.cs
- ValueType.cs
- SQLInt32.cs
- IDataContractSurrogate.cs
- EasingKeyFrames.cs
- FontStyles.cs
- InstalledFontCollection.cs
- SchemaComplexType.cs
- Helper.cs
- OdbcUtils.cs
- EntityDataSourceContainerNameConverter.cs
- WebBrowser.cs
- LiteralControl.cs
- TextTreeText.cs
- XmlSecureResolver.cs
- WsdlInspector.cs
- CalculatedColumn.cs
- DictionaryTraceRecord.cs
- AmbientProperties.cs
- _SecureChannel.cs
- ListViewTableRow.cs
- ValidatorCompatibilityHelper.cs
- LinqToSqlWrapper.cs
- SiteMap.cs
- AuthorizationRule.cs
- ResourceDictionary.cs
- GuidConverter.cs
- SyndicationDeserializer.cs
- CookieParameter.cs
- BufferedWebEventProvider.cs
- XmlSchemaAttributeGroupRef.cs
- NavigationPropertyEmitter.cs
- OdbcRowUpdatingEvent.cs
- DatagridviewDisplayedBandsData.cs
- IdentityHolder.cs
- GraphicsContainer.cs
- AppSettingsExpressionBuilder.cs
- MultiSelector.cs
- sortedlist.cs
- InsufficientMemoryException.cs
- WebPartMenu.cs
- CodeNamespace.cs
- DigestComparer.cs
- ParserExtension.cs
- DataBoundControl.cs
- CompoundFileStorageReference.cs
- CodeCompiler.cs
- TreeNode.cs
- FixedTextView.cs
- ParentUndoUnit.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Script.cs
- ClockController.cs
- Range.cs
- OdbcParameterCollection.cs
- MetadataResolver.cs
- RangeContentEnumerator.cs
- DocumentXPathNavigator.cs
- compensatingcollection.cs
- BindingList.cs
- ListViewTableRow.cs
- ContentDefinition.cs
- CollectionDataContractAttribute.cs
- ServiceBehaviorElement.cs
- OleDbMetaDataFactory.cs
- TraceData.cs
- ExternalFile.cs
- ModelTreeEnumerator.cs
- BasePropertyDescriptor.cs
- EnumMemberAttribute.cs
- SqlEnums.cs
- EditorPartChrome.cs
- ObjectCacheHost.cs
- ErrorInfoXmlDocument.cs
- DynamicPropertyReader.cs
- XmlMapping.cs
- ChtmlFormAdapter.cs
- UrlMappingsModule.cs
- PageBorderless.cs
- UndoUnit.cs
- ACL.cs