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
- Metadata.cs
- EntityDataSourceWizardForm.cs
- DrawingContext.cs
- PathFigureCollection.cs
- DataGridView.cs
- NativeObjectSecurity.cs
- BufferedOutputStream.cs
- PerfCounters.cs
- DecimalSumAggregationOperator.cs
- ProxyWebPartManager.cs
- Size3D.cs
- PageParser.cs
- Misc.cs
- HwndSource.cs
- ScriptBehaviorDescriptor.cs
- WebConfigurationManager.cs
- ProgressBar.cs
- UnitControl.cs
- PageCatalogPart.cs
- DynamicMethod.cs
- ReadOnlyDictionary.cs
- CustomValidator.cs
- MergeFilterQuery.cs
- WindowsListViewItemStartMenu.cs
- TimeoutValidationAttribute.cs
- UserControlAutomationPeer.cs
- WSDualHttpBinding.cs
- SmtpNetworkElement.cs
- ExtensionFile.cs
- CalendarBlackoutDatesCollection.cs
- ClientBuildManager.cs
- JsonQueryStringConverter.cs
- RelationshipFixer.cs
- _TLSstream.cs
- XPathDocumentIterator.cs
- XmlBoundElement.cs
- PixelFormats.cs
- TypeElement.cs
- GPStream.cs
- X509SecurityTokenAuthenticator.cs
- EdmComplexTypeAttribute.cs
- Image.cs
- Pkcs9Attribute.cs
- FactoryGenerator.cs
- AssertSection.cs
- IncrementalReadDecoders.cs
- HasRunnableWorkflowEvent.cs
- URLIdentityPermission.cs
- UnmanagedMemoryStreamWrapper.cs
- PipeStream.cs
- ApplicationGesture.cs
- UdpAnnouncementEndpoint.cs
- RowUpdatedEventArgs.cs
- ByteStream.cs
- DataGridViewImageCell.cs
- IdentityReference.cs
- hresults.cs
- HttpMethodConstraint.cs
- OracleDateTime.cs
- XmlBinaryReader.cs
- parserscommon.cs
- FactoryGenerator.cs
- Label.cs
- TypeConverter.cs
- AttributeExtensions.cs
- VisualTreeHelper.cs
- WebPartAuthorizationEventArgs.cs
- UnsafeNativeMethods.cs
- ConfigurationManagerInternalFactory.cs
- RtfControls.cs
- ColumnCollection.cs
- PersistencePipeline.cs
- Delegate.cs
- FontNamesConverter.cs
- ConfigXmlSignificantWhitespace.cs
- WindowsAltTab.cs
- XamlWriter.cs
- XPathNodeIterator.cs
- Clipboard.cs
- AssemblyInfo.cs
- TypeReference.cs
- Application.cs
- ButtonBaseAdapter.cs
- PasswordPropertyTextAttribute.cs
- InstanceDataCollection.cs
- UTF32Encoding.cs
- ComboBox.cs
- BaseTemplateBuildProvider.cs
- DistributedTransactionPermission.cs
- QueryStringParameter.cs
- ClientUrlResolverWrapper.cs
- ActivityUtilities.cs
- TextElementAutomationPeer.cs
- Set.cs
- baseshape.cs
- ProtocolsConfigurationHandler.cs
- EncoderReplacementFallback.cs
- PropertyEntry.cs
- TemplateControlBuildProvider.cs
- TemplateBamlTreeBuilder.cs