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
- SessionPageStateSection.cs
- SqlDataReaderSmi.cs
- IsolatedStorageFilePermission.cs
- HttpCookieCollection.cs
- ServiceAuthorizationElement.cs
- FixedTextPointer.cs
- Enum.cs
- GifBitmapEncoder.cs
- GZipDecoder.cs
- WebControl.cs
- CqlGenerator.cs
- PageBuildProvider.cs
- SqlBooleanMismatchVisitor.cs
- CodePropertyReferenceExpression.cs
- PartialCachingAttribute.cs
- DefaultEventAttribute.cs
- MediaContext.cs
- ExtenderProvidedPropertyAttribute.cs
- TCEAdapterGenerator.cs
- ConnectionPoint.cs
- UidManager.cs
- EncoderBestFitFallback.cs
- InternalPermissions.cs
- WindowsHyperlink.cs
- SamlSecurityTokenAuthenticator.cs
- IconConverter.cs
- WebDisplayNameAttribute.cs
- XamlReaderHelper.cs
- FlowDecisionLabelFeature.cs
- DataRowExtensions.cs
- KeyboardEventArgs.cs
- UnsafeNativeMethods.cs
- EmptyWorkItem.cs
- SelectionProcessor.cs
- RectIndependentAnimationStorage.cs
- Rect3DConverter.cs
- StateItem.cs
- CommandBindingCollection.cs
- GAC.cs
- ImplicitInputBrush.cs
- TextEditorDragDrop.cs
- AbandonedMutexException.cs
- MediaTimeline.cs
- FileDialog.cs
- WindowsToolbarAsMenu.cs
- PackageFilter.cs
- DispatchWrapper.cs
- SynthesizerStateChangedEventArgs.cs
- PanelDesigner.cs
- ControlsConfig.cs
- Selection.cs
- CommandValueSerializer.cs
- MsmqActivation.cs
- TableDesigner.cs
- MarshalDirectiveException.cs
- FixedSOMTableRow.cs
- GeneralTransform3DGroup.cs
- TextEditorCopyPaste.cs
- ClientTarget.cs
- CodeMemberProperty.cs
- TextTreeUndoUnit.cs
- PropertyChangedEventManager.cs
- ListViewInsertEventArgs.cs
- TraceData.cs
- ThicknessKeyFrameCollection.cs
- PageContent.cs
- StylusButtonEventArgs.cs
- SymbolEqualComparer.cs
- ThousandthOfEmRealPoints.cs
- DiagnosticsConfigurationHandler.cs
- FrameSecurityDescriptor.cs
- RadioButtonRenderer.cs
- FrameworkElementFactory.cs
- TypeBuilder.cs
- OrderedHashRepartitionEnumerator.cs
- OdbcCommand.cs
- UInt64Converter.cs
- QilLoop.cs
- ReadWriteObjectLock.cs
- WindowsListViewItemStartMenu.cs
- JavascriptCallbackResponseProperty.cs
- SHA256Managed.cs
- LogicalChannel.cs
- NavigationService.cs
- DynamicVirtualDiscoSearcher.cs
- LogRecordSequence.cs
- InputGestureCollection.cs
- SmtpSection.cs
- ImageListUtils.cs
- FollowerQueueCreator.cs
- SrgsRulesCollection.cs
- SqlNode.cs
- MultiBindingExpression.cs
- HttpBrowserCapabilitiesBase.cs
- SizeFConverter.cs
- RemoteDebugger.cs
- EventSourceCreationData.cs
- MessageQueueTransaction.cs
- RecognizerInfo.cs
- ExtensionDataReader.cs