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
- XMLDiffLoader.cs
- ParameterModifier.cs
- DataGrid.cs
- OdbcParameterCollection.cs
- XamlToRtfParser.cs
- ContainerUIElement3D.cs
- StorageRoot.cs
- LogAppendAsyncResult.cs
- RoleBoolean.cs
- SoapSchemaMember.cs
- Rotation3DAnimation.cs
- SoapAttributeAttribute.cs
- HtmlGenericControl.cs
- QuaternionAnimationUsingKeyFrames.cs
- RadioButtonFlatAdapter.cs
- SigningCredentials.cs
- Rect3D.cs
- LicenseException.cs
- ReaderOutput.cs
- MouseEvent.cs
- ObjectConverter.cs
- Socket.cs
- Canvas.cs
- DataGridTable.cs
- UshortList2.cs
- CodeAccessPermission.cs
- DbProviderFactoriesConfigurationHandler.cs
- IPPacketInformation.cs
- DesignerActionListCollection.cs
- SerializationEventsCache.cs
- RegisteredScript.cs
- EmptyReadOnlyDictionaryInternal.cs
- MenuCommands.cs
- IisTraceWebEventProvider.cs
- MDIWindowDialog.cs
- DbReferenceCollection.cs
- HelloOperation11AsyncResult.cs
- TemplateKeyConverter.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Vector3DKeyFrameCollection.cs
- IsolatedStoragePermission.cs
- RuleValidation.cs
- WebPartConnectionsCancelEventArgs.cs
- SoapAttributeOverrides.cs
- CacheEntry.cs
- Pair.cs
- CodeArgumentReferenceExpression.cs
- ResourceReferenceExpression.cs
- CategoryGridEntry.cs
- Int64Storage.cs
- MD5CryptoServiceProvider.cs
- AudioSignalProblemOccurredEventArgs.cs
- SqlDataRecord.cs
- PostBackTrigger.cs
- WebPartMenuStyle.cs
- TableItemStyle.cs
- DoubleStorage.cs
- TargetException.cs
- OpenFileDialog.cs
- HtmlElementEventArgs.cs
- PackWebRequest.cs
- StatusBarDrawItemEvent.cs
- OrderingQueryOperator.cs
- AnonymousIdentificationModule.cs
- ObjectPersistData.cs
- PictureBoxDesigner.cs
- grammarelement.cs
- InputLanguageProfileNotifySink.cs
- SemanticKeyElement.cs
- MetadataItemSerializer.cs
- FileLogRecordHeader.cs
- CustomWebEventKey.cs
- SizeAnimation.cs
- FileVersion.cs
- SwitchElementsCollection.cs
- C14NUtil.cs
- EntityConnection.cs
- Win32.cs
- SystemWebCachingSectionGroup.cs
- ListSourceHelper.cs
- PermissionSet.cs
- UndoEngine.cs
- DictionaryCustomTypeDescriptor.cs
- FixedHyperLink.cs
- TextTreeUndo.cs
- RangeValidator.cs
- ServiceRoute.cs
- GroupPartitionExpr.cs
- SessionStateModule.cs
- MediaCommands.cs
- MutexSecurity.cs
- SiteOfOriginContainer.cs
- XMLSyntaxException.cs
- VerificationException.cs
- CodeAttributeDeclaration.cs
- Image.cs
- TableRowsCollectionEditor.cs
- ParameterCollection.cs
- ProfileSettings.cs
- WsdlImporter.cs