Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Runtime / Remoting / EnterpriseServicesHelper.cs / 1 / EnterpriseServicesHelper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** File: ComponentServices.cs ** ** ** Purpose: Defines the general purpose ComponentServices ** ** ===========================================================*/ namespace System.Runtime.Remoting.Services { using System; using System.Reflection; using System.Runtime.Remoting.Activation; using System.Runtime.Remoting.Proxies; using System.Runtime.Remoting.Messaging; using System.Text; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Runtime.InteropServices; //---------------------------------------------------------\\ //---------------------------------------------------------\\ // internal sealed class ComponentServices \\ //---------------------------------------------------------\\ //----------------------------------------------------------\\ [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class EnterpriseServicesHelper { [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static Object WrapIUnknownWithComObject(IntPtr punk) { return Marshal.InternalWrapIUnknownWithComObject(punk); } [System.Runtime.InteropServices.ComVisible(true)] public static IConstructionReturnMessage CreateConstructionReturnMessage(IConstructionCallMessage ctorMsg, MarshalByRefObject retObj) { IConstructionReturnMessage ctorRetMsg = null; // Create the return message ctorRetMsg = new ConstructorReturnMessage(retObj, null, 0, null, ctorMsg); // NOTE: WE ALLOW ONLY DEFAULT CTORs on SERVICEDCOMPONENTS return ctorRetMsg; } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp) { Object oldtp = oldcp.GetTransparentProxy(); Object newtp = newcp.GetTransparentProxy(); IntPtr oldcontextId = RemotingServices.GetServerContextForProxy(oldtp); IntPtr newcontextId = RemotingServices.GetServerContextForProxy(newtp); // switch the CCW from oldtp to new tp Marshal.InternalSwitchCCW(oldtp, newtp); } }; } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** File: ComponentServices.cs ** ** ** Purpose: Defines the general purpose ComponentServices ** ** ===========================================================*/ namespace System.Runtime.Remoting.Services { using System; using System.Reflection; using System.Runtime.Remoting.Activation; using System.Runtime.Remoting.Proxies; using System.Runtime.Remoting.Messaging; using System.Text; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Runtime.InteropServices; //---------------------------------------------------------\\ //---------------------------------------------------------\\ // internal sealed class ComponentServices \\ //---------------------------------------------------------\\ //----------------------------------------------------------\\ [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class EnterpriseServicesHelper { [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static Object WrapIUnknownWithComObject(IntPtr punk) { return Marshal.InternalWrapIUnknownWithComObject(punk); } [System.Runtime.InteropServices.ComVisible(true)] public static IConstructionReturnMessage CreateConstructionReturnMessage(IConstructionCallMessage ctorMsg, MarshalByRefObject retObj) { IConstructionReturnMessage ctorRetMsg = null; // Create the return message ctorRetMsg = new ConstructorReturnMessage(retObj, null, 0, null, ctorMsg); // NOTE: WE ALLOW ONLY DEFAULT CTORs on SERVICEDCOMPONENTS return ctorRetMsg; } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp) { Object oldtp = oldcp.GetTransparentProxy(); Object newtp = newcp.GetTransparentProxy(); IntPtr oldcontextId = RemotingServices.GetServerContextForProxy(oldtp); IntPtr newcontextId = RemotingServices.GetServerContextForProxy(newtp); // switch the CCW from oldtp to new tp Marshal.InternalSwitchCCW(oldtp, newtp); } }; } // 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
- System.Data_BID.cs
- GenerateHelper.cs
- SkinBuilder.cs
- NoClickablePointException.cs
- ChildrenQuery.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SymbolTable.cs
- StopStoryboard.cs
- QuotedStringFormatReader.cs
- Executor.cs
- Listbox.cs
- CheckBoxField.cs
- WpfPayload.cs
- FileChangeNotifier.cs
- CommonProperties.cs
- Win32PrintDialog.cs
- _HTTPDateParse.cs
- HashSetEqualityComparer.cs
- DataSourceControlBuilder.cs
- IIS7WorkerRequest.cs
- Base64Encoder.cs
- SHA384Managed.cs
- DataQuery.cs
- ProxyWebPart.cs
- PublisherMembershipCondition.cs
- ToolStripManager.cs
- SerializerWriterEventHandlers.cs
- Helpers.cs
- StringOutput.cs
- PackageRelationship.cs
- FileVersionInfo.cs
- Compiler.cs
- SQLInt16.cs
- ScaleTransform3D.cs
- AccessDataSource.cs
- SHA1CryptoServiceProvider.cs
- relpropertyhelper.cs
- _ContextAwareResult.cs
- HandlerBase.cs
- GeometryHitTestResult.cs
- EntityConnection.cs
- InfoCardSchemas.cs
- AssociationType.cs
- WebServiceTypeData.cs
- ScriptReference.cs
- ServiceBehaviorAttribute.cs
- XmlSchemaAttributeGroup.cs
- EnvelopedSignatureTransform.cs
- SymbolMethod.cs
- TextEmbeddedObject.cs
- HttpListenerRequest.cs
- HttpBindingExtension.cs
- HotSpotCollection.cs
- QuaternionAnimation.cs
- Int16Animation.cs
- AdPostCacheSubstitution.cs
- NeutralResourcesLanguageAttribute.cs
- Paragraph.cs
- controlskin.cs
- X509Extension.cs
- StringAnimationUsingKeyFrames.cs
- CheckBox.cs
- QueryOperationResponseOfT.cs
- NullToBooleanConverter.cs
- ToolStripContentPanel.cs
- SerializationInfoEnumerator.cs
- ExecutedRoutedEventArgs.cs
- ContentOnlyMessage.cs
- EntityProviderServices.cs
- IdentityReference.cs
- WebBrowsableAttribute.cs
- WebHttpElement.cs
- WorkflowItemsPresenter.cs
- SqlServer2KCompatibilityAnnotation.cs
- IncrementalCompileAnalyzer.cs
- DataGridViewAdvancedBorderStyle.cs
- WebBrowserDocumentCompletedEventHandler.cs
- TreeNode.cs
- Trace.cs
- Listbox.cs
- TableRow.cs
- UserControl.cs
- CodeCompileUnit.cs
- ComponentRenameEvent.cs
- ColorAnimationUsingKeyFrames.cs
- ScriptRegistrationManager.cs
- CookieHandler.cs
- LassoSelectionBehavior.cs
- NotifyParentPropertyAttribute.cs
- StateMachineAction.cs
- SBCSCodePageEncoding.cs
- SkinBuilder.cs
- OutOfMemoryException.cs
- DiscardableAttribute.cs
- ColorTranslator.cs
- FrameAutomationPeer.cs
- BaseCollection.cs
- BaseDataListPage.cs
- DbReferenceCollection.cs
- PersonalizationProviderHelper.cs