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
- ResourceDescriptionAttribute.cs
- ArgumentValidation.cs
- XPathArrayIterator.cs
- DBParameter.cs
- InvokeWebServiceDesigner.cs
- localization.cs
- EventInfo.cs
- TypedReference.cs
- PropertyCollection.cs
- Variable.cs
- SinglePhaseEnlistment.cs
- TableCellsCollectionEditor.cs
- DbFunctionCommandTree.cs
- AtomPub10ServiceDocumentFormatter.cs
- ConditionalAttribute.cs
- XamlGridLengthSerializer.cs
- JsonFormatReaderGenerator.cs
- PersonalizationStateInfoCollection.cs
- ClientSettingsStore.cs
- ComplexBindingPropertiesAttribute.cs
- XPathDocumentNavigator.cs
- sqlnorm.cs
- InfiniteTimeSpanConverter.cs
- EventLogInternal.cs
- AdornerLayer.cs
- util.cs
- VarInfo.cs
- KeyGestureValueSerializer.cs
- Sql8ExpressionRewriter.cs
- EpmContentDeSerializerBase.cs
- AssemblyInfo.cs
- FrameworkElementFactory.cs
- WebConfigurationManager.cs
- ConfigXmlComment.cs
- StandardCommands.cs
- MdiWindowListItemConverter.cs
- FontSourceCollection.cs
- OdbcError.cs
- GiveFeedbackEventArgs.cs
- MailBnfHelper.cs
- SQLGuid.cs
- DropDownList.cs
- BasicCellRelation.cs
- ConfigurationPermission.cs
- ToolStripDropDownClosingEventArgs.cs
- MessageQueueEnumerator.cs
- TrackingCondition.cs
- StaticExtensionConverter.cs
- ProcessModelInfo.cs
- CommandDevice.cs
- TransformGroup.cs
- DataGridBoolColumn.cs
- FloatUtil.cs
- CharAnimationBase.cs
- ObjectViewQueryResultData.cs
- DataGridViewSelectedRowCollection.cs
- SafeNativeMethods.cs
- ClientSideProviderDescription.cs
- DbProviderFactories.cs
- NameValueFileSectionHandler.cs
- UserInitiatedNavigationPermission.cs
- HMACMD5.cs
- IChannel.cs
- Cloud.cs
- WindowsFont.cs
- ProxyWebPartConnectionCollection.cs
- TdsParserStaticMethods.cs
- EventProviderWriter.cs
- Walker.cs
- CapiNative.cs
- ClockGroup.cs
- TypeSystemProvider.cs
- ResourceAttributes.cs
- HashJoinQueryOperatorEnumerator.cs
- DateTimeFormat.cs
- DesignerObjectListAdapter.cs
- ErrorRuntimeConfig.cs
- FrameworkElementFactoryMarkupObject.cs
- XPathNodeList.cs
- CodeExpressionStatement.cs
- Int16Storage.cs
- LinqDataSourceUpdateEventArgs.cs
- MenuRendererStandards.cs
- DeviceFilterDictionary.cs
- DataBoundControlAdapter.cs
- HatchBrush.cs
- TableSectionStyle.cs
- Win32.cs
- PageSettings.cs
- FormsAuthenticationTicket.cs
- JavaScriptObjectDeserializer.cs
- UInt32.cs
- PathStreamGeometryContext.cs
- ImageListStreamer.cs
- DataGridViewSortCompareEventArgs.cs
- FontCacheLogic.cs
- ListComponentEditorPage.cs
- SingleSelectRootGridEntry.cs
- HtmlTableCell.cs
- WindowsFormsHostPropertyMap.cs