Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Log / System / IO / Log / SmuggledIUnknown.cs / 1 / 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.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebResourceAttribute.cs
- DelegateSerializationHolder.cs
- MultipartContentParser.cs
- DataSourceXmlSerializer.cs
- SoapFormatExtensions.cs
- Pkcs7Recipient.cs
- ConfigurationCollectionAttribute.cs
- UnmanagedBitmapWrapper.cs
- PropertyCollection.cs
- SQLInt64Storage.cs
- XmlSchemaInclude.cs
- ValidationEventArgs.cs
- log.cs
- UserControlAutomationPeer.cs
- DatePickerDateValidationErrorEventArgs.cs
- EntityRecordInfo.cs
- CookielessHelper.cs
- PinnedBufferMemoryStream.cs
- SmiMetaDataProperty.cs
- Single.cs
- RangeValuePatternIdentifiers.cs
- JsonGlobals.cs
- DataControlCommands.cs
- NavigationProperty.cs
- TreeNode.cs
- DataGridRowDetailsEventArgs.cs
- RecognitionEventArgs.cs
- XmlSchemaChoice.cs
- SetterBaseCollection.cs
- DoubleLink.cs
- Size.cs
- WebControl.cs
- TypeResolvingOptions.cs
- ButtonColumn.cs
- XmlUtf8RawTextWriter.cs
- Version.cs
- DataGridViewHeaderCell.cs
- EditorPartCollection.cs
- FileCodeGroup.cs
- ConfigXmlAttribute.cs
- httpapplicationstate.cs
- OciLobLocator.cs
- Events.cs
- EventLogConfiguration.cs
- EventSource.cs
- ValidatingReaderNodeData.cs
- VisualProxy.cs
- SimpleTypeResolver.cs
- HMACSHA384.cs
- OneToOneMappingSerializer.cs
- EventSinkActivity.cs
- KeyedCollection.cs
- ImmutableObjectAttribute.cs
- BooleanStorage.cs
- Attribute.cs
- PerformanceCounterPermission.cs
- _PooledStream.cs
- CodeLabeledStatement.cs
- AppDomainUnloadedException.cs
- ListControl.cs
- XmlSchemaAttribute.cs
- SignatureToken.cs
- StreamWithDictionary.cs
- NavigationFailedEventArgs.cs
- Border.cs
- TreeViewImageKeyConverter.cs
- BackgroundWorker.cs
- XLinq.cs
- ParameterReplacerVisitor.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- DropShadowBitmapEffect.cs
- QueryTaskGroupState.cs
- AlphabetConverter.cs
- CodeEntryPointMethod.cs
- OperationContractGenerationContext.cs
- FormClosingEvent.cs
- StreamReader.cs
- NativeMethods.cs
- RegexCharClass.cs
- WinFormsComponentEditor.cs
- UpdatePanelControlTrigger.cs
- ConnectionManagementSection.cs
- TextTreeFixupNode.cs
- XmlSchemaInclude.cs
- WindowsListView.cs
- CloseSequenceResponse.cs
- FieldNameLookup.cs
- PersonalizationStateQuery.cs
- KeyFrames.cs
- MenuItemAutomationPeer.cs
- RequestDescription.cs
- CommonXSendMessage.cs
- UnhandledExceptionEventArgs.cs
- XmlMemberMapping.cs
- DataTable.cs
- ConfigurationStrings.cs
- _SpnDictionary.cs
- TextBoxRenderer.cs
- ServiceObjectContainer.cs
- DataList.cs