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
- OptimisticConcurrencyException.cs
- _ServiceNameStore.cs
- XmlDocumentFragment.cs
- UniqueEventHelper.cs
- DependencyPropertyConverter.cs
- SQLBytesStorage.cs
- SelectedDatesCollection.cs
- WindowsPrincipal.cs
- SpecularMaterial.cs
- BaseCodeDomTreeGenerator.cs
- TdsParserHelperClasses.cs
- DelegateBodyWriter.cs
- DataViewSettingCollection.cs
- _ShellExpression.cs
- DigestComparer.cs
- Console.cs
- ACL.cs
- EdmScalarPropertyAttribute.cs
- DragEventArgs.cs
- NativeMethods.cs
- SourceChangedEventArgs.cs
- NamespaceTable.cs
- remotingproxy.cs
- BamlLocalizationDictionary.cs
- AddInDeploymentState.cs
- BoundField.cs
- FlowDocumentPaginator.cs
- PageAsyncTaskManager.cs
- HtmlControl.cs
- OleDbConnection.cs
- ExecutionContext.cs
- Quaternion.cs
- MatchingStyle.cs
- HighlightVisual.cs
- DataGridViewComboBoxEditingControl.cs
- NameValueFileSectionHandler.cs
- TextTreeTextNode.cs
- ItemsPresenter.cs
- ETagAttribute.cs
- WSHttpTransportSecurityElement.cs
- AccessText.cs
- __Filters.cs
- QueryableDataSourceEditData.cs
- TextLine.cs
- SymbolPair.cs
- OdbcReferenceCollection.cs
- HttpChannelHelper.cs
- Int64Animation.cs
- webbrowsersite.cs
- _ContextAwareResult.cs
- SQLSingleStorage.cs
- WpfPayload.cs
- AuthenticationService.cs
- InheritedPropertyChangedEventArgs.cs
- TypeBuilder.cs
- CriticalFinalizerObject.cs
- PeerResolver.cs
- TypeSystem.cs
- MailAddressCollection.cs
- DelegateSerializationHolder.cs
- NotifyInputEventArgs.cs
- DataTemplate.cs
- FrameworkElement.cs
- Imaging.cs
- Transform.cs
- SiteMapDataSourceView.cs
- BitmapCacheBrush.cs
- LicenseProviderAttribute.cs
- GridViewRow.cs
- _emptywebproxy.cs
- ComponentDispatcher.cs
- WindowsServiceElement.cs
- StoreUtilities.cs
- MembershipValidatePasswordEventArgs.cs
- XmlCompatibilityReader.cs
- DebugHandleTracker.cs
- ConfigXmlAttribute.cs
- ServiceModelSecurityTokenRequirement.cs
- XmlAttributeOverrides.cs
- ArcSegment.cs
- CodeNamespaceImportCollection.cs
- PageThemeBuildProvider.cs
- TypeViewSchema.cs
- XamlSerializerUtil.cs
- Int64.cs
- MexTcpBindingElement.cs
- UidPropertyAttribute.cs
- WebUtil.cs
- NavigateEvent.cs
- ProcessHostConfigUtils.cs
- errorpatternmatcher.cs
- XmlName.cs
- IndentedWriter.cs
- SmuggledIUnknown.cs
- PtsCache.cs
- WebPartDescription.cs
- Merger.cs
- GroupBox.cs
- SessionParameter.cs
- ValueType.cs