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
- ContextBase.cs
- DataGridView.cs
- ProviderException.cs
- UnmanagedMemoryAccessor.cs
- httpstaticobjectscollection.cs
- HttpVersion.cs
- Validator.cs
- DataGrid.cs
- Reference.cs
- DataSourceGeneratorException.cs
- ExtensionWindowHeader.cs
- LicenseContext.cs
- BufferedGraphicsManager.cs
- ProjectionPath.cs
- ADMembershipUser.cs
- FocusManager.cs
- Int64.cs
- MenuItemAutomationPeer.cs
- ExtensionSimplifierMarkupObject.cs
- HttpApplication.cs
- EdmEntityTypeAttribute.cs
- Number.cs
- Rect3DConverter.cs
- QilBinary.cs
- LocalizableAttribute.cs
- CopyOnWriteList.cs
- DataGridViewElement.cs
- NamespaceInfo.cs
- AddingNewEventArgs.cs
- IdentityReference.cs
- XmlSignificantWhitespace.cs
- HelpProvider.cs
- DbParameterCollectionHelper.cs
- Internal.cs
- LocalIdKeyIdentifierClause.cs
- Vector.cs
- IgnoreFileBuildProvider.cs
- TypeBinaryExpression.cs
- BasicExpandProvider.cs
- PageEventArgs.cs
- ByteAnimation.cs
- SmtpReplyReader.cs
- TagNameToTypeMapper.cs
- NetworkCredential.cs
- PageParserFilter.cs
- Point3D.cs
- BinaryNode.cs
- PlaceHolder.cs
- JoinTreeNode.cs
- Pts.cs
- DropShadowEffect.cs
- CompilationPass2TaskInternal.cs
- PeerInvitationResponse.cs
- HashMembershipCondition.cs
- TraceHandlerErrorFormatter.cs
- Object.cs
- SqlCacheDependency.cs
- EdmError.cs
- WmlImageAdapter.cs
- IdnElement.cs
- SoapRpcServiceAttribute.cs
- ContainerUtilities.cs
- XMLSyntaxException.cs
- SafeLocalMemHandle.cs
- WorkflowMarkupSerializationProvider.cs
- Thread.cs
- FrugalList.cs
- UpDownEvent.cs
- BinaryFormatterWriter.cs
- GridViewItemAutomationPeer.cs
- XmlNamespaceDeclarationsAttribute.cs
- VisualStyleElement.cs
- UnorderedHashRepartitionStream.cs
- M3DUtil.cs
- OracleDataAdapter.cs
- ItemsPanelTemplate.cs
- ContentPropertyAttribute.cs
- StringDictionary.cs
- TrustSection.cs
- AnimationTimeline.cs
- MultiBinding.cs
- SoapIgnoreAttribute.cs
- BezierSegment.cs
- FeatureAttribute.cs
- ConsumerConnectionPoint.cs
- PreProcessor.cs
- TraceHandlerErrorFormatter.cs
- ArgumentException.cs
- PeerUnsafeNativeCryptMethods.cs
- OperationResponse.cs
- GlyphTypeface.cs
- PropertyKey.cs
- PropertyNames.cs
- FrameworkElement.cs
- OleDbTransaction.cs
- ConfigurationSection.cs
- Table.cs
- DataObjectSettingDataEventArgs.cs
- Light.cs
- DeviceContext.cs