Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- GrammarBuilderPhrase.cs
- SecondaryIndexDefinition.cs
- ReturnEventArgs.cs
- ModuleBuilder.cs
- ValidatorCompatibilityHelper.cs
- Localizer.cs
- Row.cs
- CheckBoxFlatAdapter.cs
- GACMembershipCondition.cs
- CodeRemoveEventStatement.cs
- QilReplaceVisitor.cs
- TreeViewDesigner.cs
- AutomationPeer.cs
- DispatcherObject.cs
- HttpListenerException.cs
- Blend.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- Parameter.cs
- SqlConnectionHelper.cs
- LayoutTableCell.cs
- DefaultTraceListener.cs
- path.cs
- DataGridLinkButton.cs
- MultilineStringConverter.cs
- TabPanel.cs
- ObjectContextServiceProvider.cs
- ColorTransform.cs
- SHA1CryptoServiceProvider.cs
- QuadraticEase.cs
- Pair.cs
- PathSegment.cs
- SequentialWorkflowRootDesigner.cs
- DataGridViewRowPostPaintEventArgs.cs
- wgx_exports.cs
- FixedSOMLineRanges.cs
- HMACSHA512.cs
- RelationshipFixer.cs
- WebPartEditorOkVerb.cs
- MetadataSection.cs
- RelationshipWrapper.cs
- DoubleKeyFrameCollection.cs
- TypeNameConverter.cs
- FieldDescriptor.cs
- odbcmetadatacolumnnames.cs
- MessageQuerySet.cs
- VisualStyleInformation.cs
- XmlCharType.cs
- MergeFilterQuery.cs
- TextWriter.cs
- SiteMap.cs
- AutomationPropertyInfo.cs
- storepermissionattribute.cs
- CapabilitiesPattern.cs
- ToolbarAUtomationPeer.cs
- SiteMapProvider.cs
- Bitmap.cs
- Condition.cs
- ToolStripHighContrastRenderer.cs
- WebPartConnectionCollection.cs
- ProtectedConfigurationProviderCollection.cs
- XmlNamespaceManager.cs
- Opcode.cs
- TrustSection.cs
- CommandHelper.cs
- DbReferenceCollection.cs
- TransformPattern.cs
- SplineQuaternionKeyFrame.cs
- WorkflowElementDialog.cs
- DebugTraceHelper.cs
- GestureRecognizer.cs
- CLRBindingWorker.cs
- ConfigUtil.cs
- unsafeIndexingFilterStream.cs
- HtmlLiteralTextAdapter.cs
- VirtualizedItemProviderWrapper.cs
- ExpressionBuilder.cs
- StdRegProviderWrapper.cs
- GrammarBuilderWildcard.cs
- Block.cs
- Pen.cs
- AuthenticateEventArgs.cs
- XmlSerializerNamespaces.cs
- NativeMethods.cs
- FontFamilyConverter.cs
- ReadOnlyTernaryTree.cs
- ToolboxBitmapAttribute.cs
- SchemaNotation.cs
- GACIdentityPermission.cs
- SQLMembershipProvider.cs
- RangeBaseAutomationPeer.cs
- OperationCanceledException.cs
- BindingMAnagerBase.cs
- RemotingClientProxy.cs
- Font.cs
- Facet.cs
- SafeWaitHandle.cs
- ModifierKeysValueSerializer.cs
- GetBrowserTokenRequest.cs
- SettingsProperty.cs
- InputReportEventArgs.cs