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
- EntitySqlQueryState.cs
- QueryAccessibilityHelpEvent.cs
- TcpPortSharing.cs
- SessionState.cs
- X509Extension.cs
- CryptoKeySecurity.cs
- RenderData.cs
- Package.cs
- SqlTriggerAttribute.cs
- BehaviorEditorPart.cs
- ListView.cs
- Int16Converter.cs
- httpapplicationstate.cs
- SimpleWebHandlerParser.cs
- RawAppCommandInputReport.cs
- StreamProxy.cs
- PathTooLongException.cs
- DataControlFieldCell.cs
- HelpInfo.cs
- CustomErrorCollection.cs
- SoapObjectReader.cs
- TextSelection.cs
- PartialTrustHelpers.cs
- DBCSCodePageEncoding.cs
- CharacterHit.cs
- EventEntry.cs
- PathFigure.cs
- ClientConfigPaths.cs
- ExceptionRoutedEventArgs.cs
- MemberMemberBinding.cs
- MarkupExtensionParser.cs
- TableLayoutStyle.cs
- TimeSpanOrInfiniteConverter.cs
- IncrementalHitTester.cs
- FixedDocumentPaginator.cs
- AutomationIdentifierGuids.cs
- EditorZoneBase.cs
- CookieProtection.cs
- XmlDocumentType.cs
- TypeConverter.cs
- PointHitTestResult.cs
- LoadedEvent.cs
- BuildResultCache.cs
- IList.cs
- StructuredTypeEmitter.cs
- Buffer.cs
- DateTimeFormat.cs
- TypedDataSourceCodeGenerator.cs
- Viewport2DVisual3D.cs
- DesignSurfaceManager.cs
- HashHelper.cs
- FormatException.cs
- RuleSetBrowserDialog.cs
- Block.cs
- WindowCollection.cs
- StringKeyFrameCollection.cs
- DBNull.cs
- Aggregates.cs
- CalendarDay.cs
- WorkflowMarkupSerializationProvider.cs
- GroupDescription.cs
- DbMetaDataFactory.cs
- SchemaTypeEmitter.cs
- BrowserCapabilitiesCompiler.cs
- Switch.cs
- BackgroundWorker.cs
- DescendantOverDescendantQuery.cs
- DbConnectionFactory.cs
- NetworkCredential.cs
- MdiWindowListStrip.cs
- EntityCommandDefinition.cs
- IndentedTextWriter.cs
- TablePattern.cs
- TraceUtils.cs
- EventDescriptorCollection.cs
- ColorContext.cs
- infer.cs
- TableLayoutSettingsTypeConverter.cs
- MatrixTransform.cs
- EdmConstants.cs
- InvalidProgramException.cs
- Config.cs
- TrackingStringDictionary.cs
- XmlSerializerFactory.cs
- AudienceUriMode.cs
- UnsafeNativeMethods.cs
- ElementMarkupObject.cs
- XmlNodeChangedEventManager.cs
- SpecialNameAttribute.cs
- DataGridCell.cs
- DataGridTextColumn.cs
- InvalidWMPVersionException.cs
- TimeoutValidationAttribute.cs
- SafeFileHandle.cs
- ToolBarOverflowPanel.cs
- StandardOleMarshalObject.cs
- WebBrowserNavigatingEventHandler.cs
- DataShape.cs
- XmlAnyAttributeAttribute.cs
- UriWriter.cs