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
- KeyValueConfigurationCollection.cs
- WindowsHyperlink.cs
- VectorConverter.cs
- ServiceOperationViewControl.cs
- SqlBulkCopy.cs
- ControlValuePropertyAttribute.cs
- PersonalizationProvider.cs
- ScopeElement.cs
- BinaryObjectInfo.cs
- TransformerInfo.cs
- IDispatchConstantAttribute.cs
- _ConnectStream.cs
- XsltException.cs
- TreeView.cs
- StringExpressionSet.cs
- ClientScriptItem.cs
- BuildManager.cs
- LayoutInformation.cs
- TextBox.cs
- ObjectDataSourceDisposingEventArgs.cs
- _ScatterGatherBuffers.cs
- COAUTHIDENTITY.cs
- DateTimeConverter.cs
- BoundColumn.cs
- TimerElapsedEvenArgs.cs
- ProcessThread.cs
- SoapSchemaMember.cs
- RegionInfo.cs
- ExecutionContext.cs
- CompoundFileReference.cs
- BindableTemplateBuilder.cs
- BindingOperations.cs
- BaseTemplateCodeDomTreeGenerator.cs
- WebScriptMetadataInstanceContextProvider.cs
- RepeaterItemCollection.cs
- SerializationInfo.cs
- TextElement.cs
- QilTypeChecker.cs
- SQLGuid.cs
- TypedReference.cs
- GridItemCollection.cs
- SwitchLevelAttribute.cs
- TextMetrics.cs
- CheckBoxRenderer.cs
- ServiceHostingEnvironmentSection.cs
- ModelItemDictionary.cs
- RightsManagementInformation.cs
- DateTimeConverter2.cs
- EntityDataSourceDataSelection.cs
- DiscreteKeyFrames.cs
- SnapshotChangeTrackingStrategy.cs
- HttpProtocolImporter.cs
- Model3DGroup.cs
- SynchronizationHandlesCodeDomSerializer.cs
- PrtCap_Builder.cs
- Substitution.cs
- XmlArrayItemAttributes.cs
- Attributes.cs
- PropertyInformationCollection.cs
- RepeatBehaviorConverter.cs
- XmlAnyElementAttribute.cs
- XmlSchemaProviderAttribute.cs
- HandlerBase.cs
- ToolStrip.cs
- GlyphCache.cs
- TimelineGroup.cs
- followingquery.cs
- AttributeQuery.cs
- RootBuilder.cs
- StaticContext.cs
- SubqueryRules.cs
- BindingExpressionUncommonField.cs
- CanonicalFontFamilyReference.cs
- UnsafeNativeMethodsMilCoreApi.cs
- CryptographicAttribute.cs
- CustomValidator.cs
- QueryCorrelationInitializer.cs
- MatrixAnimationUsingPath.cs
- ScrollBarRenderer.cs
- ModelUIElement3D.cs
- CookieParameter.cs
- EmptyCollection.cs
- ServiceDurableInstanceContextProvider.cs
- ACE.cs
- BitVec.cs
- SmtpAuthenticationManager.cs
- XmlDocumentFragment.cs
- HostUtils.cs
- BoolExpr.cs
- RequestQueryProcessor.cs
- ColorTransformHelper.cs
- DataObjectPastingEventArgs.cs
- CallContext.cs
- DefaultParameterValueAttribute.cs
- Preprocessor.cs
- BuildProviderCollection.cs
- ObjectListGeneralPage.cs
- XamlWriter.cs
- SystemWebExtensionsSectionGroup.cs
- CompilationRelaxations.cs