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
- AsymmetricSecurityProtocol.cs
- QueueProcessor.cs
- Debug.cs
- XmlHierarchyData.cs
- DataObject.cs
- OutOfMemoryException.cs
- FontSourceCollection.cs
- RemotingClientProxy.cs
- DPTypeDescriptorContext.cs
- UnsafeNativeMethods.cs
- SimpleExpression.cs
- EmbeddedMailObjectsCollection.cs
- Utility.cs
- MSHTMLHost.cs
- CodeTypeParameterCollection.cs
- ByteKeyFrameCollection.cs
- InfoCardClaimCollection.cs
- ConnectionManagementSection.cs
- DbDeleteCommandTree.cs
- FieldToken.cs
- PlainXmlDeserializer.cs
- mactripleDES.cs
- MergeFailedEvent.cs
- XmlQueryCardinality.cs
- SafeEventLogWriteHandle.cs
- XmlWellformedWriter.cs
- ImpersonateTokenRef.cs
- XmlRawWriterWrapper.cs
- DataGridViewHeaderCell.cs
- Token.cs
- ExpressionHelper.cs
- ApplicationFileParser.cs
- DispatcherHooks.cs
- TransformDescriptor.cs
- GroupDescription.cs
- TypeBuilderInstantiation.cs
- ApplicationInfo.cs
- XmlDataCollection.cs
- WsdlBuildProvider.cs
- DataRelationCollection.cs
- DrawingCollection.cs
- AuthorizationPolicyTypeElement.cs
- WindowsToolbarAsMenu.cs
- CurrencyWrapper.cs
- AuthenticationModulesSection.cs
- MappingException.cs
- SystemResourceKey.cs
- SerializationSectionGroup.cs
- SerializerProvider.cs
- HeaderUtility.cs
- SafeFileMappingHandle.cs
- DataGridTablesFactory.cs
- BlockCollection.cs
- ConnectionsZone.cs
- HijriCalendar.cs
- ECDiffieHellmanCngPublicKey.cs
- DataListGeneralPage.cs
- HtmlShimManager.cs
- Selection.cs
- Button.cs
- Transform3D.cs
- ManagedFilter.cs
- EntityWrapper.cs
- XmlSchemaGroup.cs
- GlyphingCache.cs
- ListMarkerLine.cs
- securitycriticaldataClass.cs
- ClientSponsor.cs
- RoutingChannelExtension.cs
- DiagnosticSection.cs
- CodeRegionDirective.cs
- ValidatedControlConverter.cs
- HostProtectionPermission.cs
- XmlSchemaValidationException.cs
- FixUp.cs
- FontInfo.cs
- ReadOnlyCollectionBase.cs
- ExpressionReplacer.cs
- SourceFileInfo.cs
- System.Data.OracleClient_BID.cs
- ControlUtil.cs
- DataGridViewSelectedColumnCollection.cs
- AuthorizationRuleCollection.cs
- Tuple.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- SerializationHelper.cs
- SHA256.cs
- Stroke.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EntityCommand.cs
- ToolStripGrip.cs
- Matrix.cs
- DbConnectionStringBuilder.cs
- OrderedDictionaryStateHelper.cs
- ButtonBaseAdapter.cs
- HtmlTableRow.cs
- OutputCacheProfile.cs
- SHA1CryptoServiceProvider.cs
- UrlMappingsSection.cs
- SapiInterop.cs