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
- SevenBitStream.cs
- Selection.cs
- DbDeleteCommandTree.cs
- BufferBuilder.cs
- ResourceDescriptionAttribute.cs
- MetadataCollection.cs
- cryptoapiTransform.cs
- InstanceNotReadyException.cs
- ServiceMoniker.cs
- UrlPath.cs
- PhysicalAddress.cs
- SamlAuthorizationDecisionStatement.cs
- ItemsPanelTemplate.cs
- x509utils.cs
- HtmlInputRadioButton.cs
- ProtocolInformationWriter.cs
- DirectoryInfo.cs
- SafeWaitHandle.cs
- ResourcePermissionBase.cs
- backend.cs
- ExpressionDumper.cs
- ResourceAttributes.cs
- ErrorsHelper.cs
- ThumbAutomationPeer.cs
- XmlAnyElementAttributes.cs
- Scene3D.cs
- SchemaElementLookUpTable.cs
- EntityClassGenerator.cs
- ClientFormsAuthenticationCredentials.cs
- MasterPageCodeDomTreeGenerator.cs
- OleAutBinder.cs
- SafeProcessHandle.cs
- CodeTypeDeclaration.cs
- DefaultShape.cs
- ResourceIDHelper.cs
- CodeAssignStatement.cs
- FontStyle.cs
- SecurityChannel.cs
- Int32CAMarshaler.cs
- NamedPermissionSet.cs
- ComEventsHelper.cs
- ReceiveSecurityHeader.cs
- GeneratedContractType.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- SrgsGrammar.cs
- XmlWellformedWriterHelpers.cs
- WebPartConnectionsDisconnectVerb.cs
- SingleStorage.cs
- ValueOfAction.cs
- Util.cs
- DoubleLinkListEnumerator.cs
- DeviceFiltersSection.cs
- LinearGradientBrush.cs
- SqlConnectionFactory.cs
- LogManagementAsyncResult.cs
- TypeNameConverter.cs
- ExportFileRequest.cs
- DBConcurrencyException.cs
- ValueTypeFixupInfo.cs
- GifBitmapEncoder.cs
- UserNameSecurityTokenProvider.cs
- TextEndOfLine.cs
- webeventbuffer.cs
- SafeCertificateContext.cs
- GroupDescription.cs
- ReservationNotFoundException.cs
- FontDriver.cs
- TextParagraphProperties.cs
- CopyCodeAction.cs
- ListCollectionView.cs
- Types.cs
- FuncTypeConverter.cs
- FunctionDescription.cs
- HttpChannelListener.cs
- SwitchExpression.cs
- EventItfInfo.cs
- Site.cs
- BulletDecorator.cs
- TreeViewBindingsEditorForm.cs
- DocComment.cs
- SettingsSavedEventArgs.cs
- Helper.cs
- storepermissionattribute.cs
- ListViewGroupCollectionEditor.cs
- PostBackTrigger.cs
- ProcessProtocolHandler.cs
- TdsParameterSetter.cs
- DrawListViewSubItemEventArgs.cs
- JavaScriptString.cs
- HtmlTernaryTree.cs
- ManualResetEvent.cs
- PkcsMisc.cs
- InheritanceContextHelper.cs
- ConsoleKeyInfo.cs
- SEHException.cs
- RecommendedAsConfigurableAttribute.cs
- Version.cs
- DesignerProperties.cs
- PreProcessor.cs
- MethodCallTranslator.cs