Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Event.cs
- OracleSqlParser.cs
- ScriptControlManager.cs
- ScrollChrome.cs
- InternalBufferOverflowException.cs
- XamlValidatingReader.cs
- PixelShader.cs
- Point.cs
- WCFServiceClientProxyGenerator.cs
- StringFreezingAttribute.cs
- AssemblyAttributesGoHere.cs
- FileDialogPermission.cs
- CodeIdentifiers.cs
- XamlHostingConfiguration.cs
- ImageField.cs
- PropertyItem.cs
- Compiler.cs
- IdentityValidationException.cs
- EdmError.cs
- Preprocessor.cs
- EventToken.cs
- ManipulationLogic.cs
- ProjectedSlot.cs
- BufferBuilder.cs
- HttpConfigurationContext.cs
- DefaultSection.cs
- PeerNameRecordCollection.cs
- UmAlQuraCalendar.cs
- ConfigurationStrings.cs
- DeviceSpecificDialogCachedState.cs
- SByte.cs
- BinaryFormatterWriter.cs
- ParserContext.cs
- SimpleRecyclingCache.cs
- EventLogPermissionEntryCollection.cs
- WebRequestModuleElementCollection.cs
- ConfigsHelper.cs
- DataServiceRequest.cs
- CombinedGeometry.cs
- DayRenderEvent.cs
- ClientBuildManager.cs
- VisualStyleRenderer.cs
- ChangeInterceptorAttribute.cs
- BitmapMetadataBlob.cs
- X509Chain.cs
- OpenFileDialog.cs
- ObjectContext.cs
- TemplateAction.cs
- ExponentialEase.cs
- Package.cs
- DataRow.cs
- HtmlMeta.cs
- RuntimeCompatibilityAttribute.cs
- CompilerGeneratedAttribute.cs
- JoinTreeNode.cs
- ADConnectionHelper.cs
- TemplateXamlParser.cs
- ComponentManagerBroker.cs
- ArrayList.cs
- DLinqAssociationProvider.cs
- GAC.cs
- HMACSHA512.cs
- SqlErrorCollection.cs
- SQLByte.cs
- FileDetails.cs
- BoundPropertyEntry.cs
- InteropBitmapSource.cs
- QilXmlWriter.cs
- MetadataUtil.cs
- AsymmetricSignatureDeformatter.cs
- SelectiveScrollingGrid.cs
- TakeQueryOptionExpression.cs
- BooleanFunctions.cs
- ToolConsole.cs
- AsyncCompletedEventArgs.cs
- UserControlFileEditor.cs
- DoubleAnimationUsingPath.cs
- ErrorFormatterPage.cs
- EventsTab.cs
- ValidatingPropertiesEventArgs.cs
- DataProtection.cs
- NavigationExpr.cs
- TextElementCollectionHelper.cs
- CodeVariableReferenceExpression.cs
- HtmlForm.cs
- SocketAddress.cs
- TextStore.cs
- ContentElement.cs
- DataGridColumnHeaderAutomationPeer.cs
- Enlistment.cs
- EntityType.cs
- XmlSerializationWriter.cs
- Int32Rect.cs
- ToolboxComponentsCreatingEventArgs.cs
- TimeManager.cs
- FixedSOMFixedBlock.cs
- Style.cs
- EntityDataSourceSelectingEventArgs.cs
- IisTraceWebEventProvider.cs
- CallContext.cs