Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / SmuggledIUnknown.cs / 1305376 / SmuggledIUnknown.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Remoting.Services; internal sealed class SmuggledIUnknown : SafeHandle { internal SmuggledIUnknown() : base(IntPtr.Zero, true) { } internal SmuggledIUnknown(object unknown) : this() { RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { base.handle = Marshal.GetIUnknownForObject(unknown); } } public override bool IsInvalid { get { return (IsClosed || (IntPtr.Zero == base.handle)); } } public object Smuggle() { object comObject; RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { comObject = EnterpriseServicesHelper.WrapIUnknownWithComObject(base.handle); GC.KeepAlive(this); } return comObject; } override protected bool ReleaseHandle() { if (base.handle != IntPtr.Zero) { Marshal.Release(base.handle); base.handle = IntPtr.Zero; } return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StorageModelBuildProvider.cs
- LockRenewalTask.cs
- HttpTransportBindingElement.cs
- ObjectDataSourceSelectingEventArgs.cs
- TypeElement.cs
- Int32Animation.cs
- ProjectionAnalyzer.cs
- DateTime.cs
- ActivationArguments.cs
- HandlerBase.cs
- TextElementAutomationPeer.cs
- srgsitem.cs
- RuntimeUtils.cs
- AutoGeneratedFieldProperties.cs
- ReaderWriterLockWrapper.cs
- ResourcesChangeInfo.cs
- ConsumerConnectionPoint.cs
- SiteMapNode.cs
- CustomError.cs
- SoapHelper.cs
- SqlUdtInfo.cs
- NavigateEvent.cs
- Types.cs
- MessageRpc.cs
- HuffmanTree.cs
- DateTimeOffset.cs
- DataBinder.cs
- SHA256Cng.cs
- StrokeCollection2.cs
- ButtonStandardAdapter.cs
- ParameterToken.cs
- DetailsViewDeleteEventArgs.cs
- PointCollection.cs
- SqlClientMetaDataCollectionNames.cs
- SqlServer2KCompatibilityCheck.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- GridViewCommandEventArgs.cs
- PropertyChangedEventManager.cs
- PolyQuadraticBezierSegment.cs
- SendMailErrorEventArgs.cs
- LineBreak.cs
- EnvelopedPkcs7.cs
- ContactManager.cs
- XmlAttributeCollection.cs
- DesignBindingValueUIHandler.cs
- MatrixKeyFrameCollection.cs
- TimeSpanValidator.cs
- ClientFormsIdentity.cs
- TableStyle.cs
- GorillaCodec.cs
- GridViewRowEventArgs.cs
- ellipse.cs
- ToolStripItemDataObject.cs
- ComplexLine.cs
- StringAnimationUsingKeyFrames.cs
- InstanceCollisionException.cs
- EmissiveMaterial.cs
- DataGridColumn.cs
- ExpressionBinding.cs
- HttpContextServiceHost.cs
- ActivityExecutor.cs
- CompletedAsyncResult.cs
- RotateTransform.cs
- ColumnHeaderCollectionEditor.cs
- FixedTextPointer.cs
- TextTreeTextElementNode.cs
- InstancePersistenceCommand.cs
- ServicesUtilities.cs
- MergeFilterQuery.cs
- DocumentAutomationPeer.cs
- DrawingContextDrawingContextWalker.cs
- WebConfigurationHost.cs
- AsymmetricKeyExchangeFormatter.cs
- BufferedWebEventProvider.cs
- KeyFrames.cs
- BaseCodeDomTreeGenerator.cs
- ManifestSignatureInformation.cs
- SafeViewOfFileHandle.cs
- InstanceNameConverter.cs
- DecoratedNameAttribute.cs
- TreeViewHitTestInfo.cs
- TaskCanceledException.cs
- ElementMarkupObject.cs
- CustomLineCap.cs
- HttpCapabilitiesEvaluator.cs
- SafeCryptContextHandle.cs
- PrintingPermissionAttribute.cs
- HtmlTableCell.cs
- ReturnValue.cs
- DSACryptoServiceProvider.cs
- RegisteredDisposeScript.cs
- InstanceStoreQueryResult.cs
- TableLayoutSettings.cs
- ItemPager.cs
- Method.cs
- BitmapEffectInputConnector.cs
- DataServiceProviderMethods.cs
- NodeInfo.cs
- SystemSounds.cs
- _SslSessionsCache.cs