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
- CodeSubDirectory.cs
- DoubleAnimationUsingPath.cs
- DataStreams.cs
- EntityUtil.cs
- DataGridViewCellValidatingEventArgs.cs
- ByteRangeDownloader.cs
- DataServiceHostFactory.cs
- webeventbuffer.cs
- RelationshipEndMember.cs
- XmlILIndex.cs
- messageonlyhwndwrapper.cs
- HttpListenerContext.cs
- PkcsMisc.cs
- XmlChoiceIdentifierAttribute.cs
- BulletedListEventArgs.cs
- ToolboxCategoryItems.cs
- StateRuntime.cs
- DescendentsWalker.cs
- XmlSchemaDatatype.cs
- AdapterDictionary.cs
- HostProtectionPermission.cs
- TracedNativeMethods.cs
- CommandBindingCollection.cs
- Process.cs
- PriorityBindingExpression.cs
- OdbcCommandBuilder.cs
- EditorAttributeInfo.cs
- Win32Native.cs
- ListItemViewAttribute.cs
- Array.cs
- ActivityBuilderHelper.cs
- CreateUserWizard.cs
- URI.cs
- MultipleViewPatternIdentifiers.cs
- GridViewRowEventArgs.cs
- ScrollProperties.cs
- Color.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- PackagePart.cs
- Helpers.cs
- RightsManagementInformation.cs
- DrawingBrush.cs
- PageAdapter.cs
- oledbmetadatacolumnnames.cs
- RecordManager.cs
- SqlFlattener.cs
- ProfileSettingsCollection.cs
- NonParentingControl.cs
- WorkflowQueueInfo.cs
- SourceInterpreter.cs
- InitializationEventAttribute.cs
- OleDbTransaction.cs
- OperationFormatUse.cs
- NullableConverter.cs
- ClipboardProcessor.cs
- WmfPlaceableFileHeader.cs
- DataKeyCollection.cs
- WsdlInspector.cs
- DocumentXmlWriter.cs
- TreeNodeSelectionProcessor.cs
- EtwTrace.cs
- SubclassTypeValidator.cs
- CfgRule.cs
- SQLMoneyStorage.cs
- IApplicationTrustManager.cs
- DataRowChangeEvent.cs
- ItemsPanelTemplate.cs
- TextFormatterHost.cs
- Profiler.cs
- Instrumentation.cs
- GZipDecoder.cs
- Automation.cs
- TextRunTypographyProperties.cs
- CommonDialog.cs
- CommonObjectSecurity.cs
- EditModeSwitchButton.cs
- XPathQilFactory.cs
- ObjectPropertyMapping.cs
- HttpContextWrapper.cs
- PtsContext.cs
- Calendar.cs
- ControlDesigner.cs
- CellRelation.cs
- InvokePatternIdentifiers.cs
- CommonGetThemePartSize.cs
- MemoryMappedFileSecurity.cs
- ToolStripButton.cs
- SqlBooleanMismatchVisitor.cs
- StorageSetMapping.cs
- BaseInfoTable.cs
- XmlSortKey.cs
- DirectionalLight.cs
- HeaderElement.cs
- FixedSOMPageElement.cs
- Connection.cs
- MethodRental.cs
- MappingModelBuildProvider.cs
- ProcessModelInfo.cs
- NamespaceExpr.cs
- lengthconverter.cs