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
- MetricEntry.cs
- ApplicationHost.cs
- LinqDataSourceHelper.cs
- KeyBinding.cs
- Crypto.cs
- SettingsSection.cs
- IsolatedStorageFile.cs
- XmlProcessingInstruction.cs
- DetailsViewUpdateEventArgs.cs
- ComponentResourceManager.cs
- Polyline.cs
- TreeNode.cs
- EdmItemCollection.cs
- EventArgs.cs
- DataSourceCacheDurationConverter.cs
- DragCompletedEventArgs.cs
- StreamGeometryContext.cs
- WeakRefEnumerator.cs
- GradientBrush.cs
- DocumentGridContextMenu.cs
- IListConverters.cs
- SerialReceived.cs
- BStrWrapper.cs
- ExceptionUtil.cs
- StylusOverProperty.cs
- UTF7Encoding.cs
- Compiler.cs
- ApplicationServiceManager.cs
- ImageEditor.cs
- GroupBox.cs
- Canonicalizers.cs
- Help.cs
- SqlMultiplexer.cs
- CodeDelegateCreateExpression.cs
- TokenBasedSet.cs
- DBCommand.cs
- PropertyTabChangedEvent.cs
- Part.cs
- ImageClickEventArgs.cs
- RepeaterItemCollection.cs
- ToolStripItemRenderEventArgs.cs
- Pkcs7Recipient.cs
- DbConnectionPoolIdentity.cs
- HwndAppCommandInputProvider.cs
- DataSourceConverter.cs
- Part.cs
- NameScope.cs
- BufferModeSettings.cs
- XPathDescendantIterator.cs
- CodeTypeMember.cs
- XhtmlBasicControlAdapter.cs
- ThicknessKeyFrameCollection.cs
- SystemIPGlobalProperties.cs
- SystemIPInterfaceStatistics.cs
- BuiltInExpr.cs
- ValuePatternIdentifiers.cs
- BindingWorker.cs
- DataTableReader.cs
- CannotUnloadAppDomainException.cs
- EnumBuilder.cs
- DataGridItemEventArgs.cs
- bindurihelper.cs
- TypeListConverter.cs
- Dictionary.cs
- ReaderWriterLock.cs
- ByteConverter.cs
- HistoryEventArgs.cs
- SignatureToken.cs
- ComponentCache.cs
- ModelService.cs
- CodeSnippetTypeMember.cs
- DataGridViewImageColumn.cs
- DocumentApplicationJournalEntry.cs
- Vector3D.cs
- Stack.cs
- FlowDocumentPageViewerAutomationPeer.cs
- PowerModeChangedEventArgs.cs
- XmlILAnnotation.cs
- SourceLocation.cs
- IsolationInterop.cs
- ForeignConstraint.cs
- BuildManagerHost.cs
- Token.cs
- EventLogException.cs
- HostingPreferredMapPath.cs
- PhysicalOps.cs
- PriorityChain.cs
- EventsTab.cs
- BamlMapTable.cs
- RelationshipConstraintValidator.cs
- SettingsSection.cs
- HtmlTableCell.cs
- TraceUtility.cs
- CompModHelpers.cs
- SafePEFileHandle.cs
- BuildResultCache.cs
- ColorTransformHelper.cs
- WasNotInstalledException.cs
- XmlSchemaExternal.cs
- AlgoModule.cs