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
- BindMarkupExtensionSerializer.cs
- Rijndael.cs
- SessionEndingCancelEventArgs.cs
- PageRouteHandler.cs
- TransactionProtocol.cs
- TraceHandlerErrorFormatter.cs
- HtmlImage.cs
- UpdatePanel.cs
- PointCollection.cs
- ErrorTableItemStyle.cs
- ColumnCollection.cs
- Base64Decoder.cs
- SequenceDesignerAccessibleObject.cs
- XhtmlBasicLiteralTextAdapter.cs
- ProofTokenCryptoHandle.cs
- EmptyQuery.cs
- TextFormatterImp.cs
- Zone.cs
- ConfigurationManager.cs
- InvalidCastException.cs
- QueryPageSettingsEventArgs.cs
- WindowHideOrCloseTracker.cs
- Unit.cs
- SecurityChannelFactory.cs
- CheckBoxPopupAdapter.cs
- CmsUtils.cs
- SyndicationSerializer.cs
- IndicCharClassifier.cs
- streamingZipPartStream.cs
- odbcmetadatacollectionnames.cs
- SimpleWorkerRequest.cs
- TracePayload.cs
- CultureTableRecord.cs
- Descriptor.cs
- ClonableStack.cs
- XmlSchemaAttributeGroup.cs
- Rule.cs
- StdValidatorsAndConverters.cs
- QilScopedVisitor.cs
- TreePrinter.cs
- DataBoundControl.cs
- DefaultPropertyAttribute.cs
- DoubleStorage.cs
- ArcSegment.cs
- AttachedPropertyBrowsableAttribute.cs
- PartialClassGenerationTaskInternal.cs
- GridViewDeletedEventArgs.cs
- PropertyTabAttribute.cs
- CardSpaceException.cs
- _Events.cs
- DaylightTime.cs
- LocalValueEnumerator.cs
- WebBrowserSiteBase.cs
- ConfigurationSectionGroup.cs
- XmlEnumAttribute.cs
- StyleXamlParser.cs
- XmlAttributes.cs
- webbrowsersite.cs
- SessionKeyExpiredException.cs
- MouseGestureConverter.cs
- HttpRequest.cs
- WindowsStatic.cs
- PageRanges.cs
- ConstNode.cs
- PagerStyle.cs
- DBDataPermission.cs
- MarkupWriter.cs
- UniqueEventHelper.cs
- Point3DCollectionValueSerializer.cs
- WorkflowQueue.cs
- EditorAttributeInfo.cs
- UpdatePanelTriggerCollection.cs
- GridViewDeletedEventArgs.cs
- HttpModuleActionCollection.cs
- AllMembershipCondition.cs
- TextBreakpoint.cs
- ConnectionPoolManager.cs
- ProxyHwnd.cs
- AnnotationResource.cs
- SQLConvert.cs
- SqlCacheDependencyDatabaseCollection.cs
- COMException.cs
- _UncName.cs
- MultiPageTextView.cs
- Hashtable.cs
- CachingHintValidation.cs
- VisualStyleRenderer.cs
- BitmapEffect.cs
- SetterBase.cs
- XmlSerializerFactory.cs
- WindowsNonControl.cs
- QilBinary.cs
- ListViewItemMouseHoverEvent.cs
- Util.cs
- EdmMember.cs
- SelectionRange.cs
- ComponentChangedEvent.cs
- unsafenativemethodsother.cs
- AccessorTable.cs
- RC2CryptoServiceProvider.cs