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
- RequestQueryParser.cs
- EntryIndex.cs
- PrivateFontCollection.cs
- RadioButtonStandardAdapter.cs
- DataServiceQueryProvider.cs
- SqlCommandBuilder.cs
- DrawingGroup.cs
- XsltInput.cs
- UnknownBitmapEncoder.cs
- RegularExpressionValidator.cs
- ScaleTransform.cs
- ExpandedWrapper.cs
- PkcsUtils.cs
- WebPartChrome.cs
- IndependentlyAnimatedPropertyMetadata.cs
- SaveFileDialog.cs
- TextProperties.cs
- AnyReturnReader.cs
- WindowsBrush.cs
- StatusCommandUI.cs
- JsonReader.cs
- UiaCoreApi.cs
- WhitespaceRuleLookup.cs
- ThrowHelper.cs
- XamlTemplateSerializer.cs
- UMPAttributes.cs
- SimplePropertyEntry.cs
- MetaData.cs
- DataGridTable.cs
- Visual3D.cs
- DefaultAssemblyResolver.cs
- UnauthorizedAccessException.cs
- UpdateExpressionVisitor.cs
- AffineTransform3D.cs
- SessionParameter.cs
- ResourcePermissionBaseEntry.cs
- OracleMonthSpan.cs
- RegexCharClass.cs
- ConstraintStruct.cs
- SByte.cs
- CharacterString.cs
- ImageCodecInfoPrivate.cs
- TextSpanModifier.cs
- ValidatorCompatibilityHelper.cs
- MouseCaptureWithinProperty.cs
- StrongNameUtility.cs
- DesignerActionList.cs
- ListBox.cs
- DataRelation.cs
- LinkConverter.cs
- PackageStore.cs
- PointUtil.cs
- XmlSchema.cs
- QueryTaskGroupState.cs
- AsymmetricSignatureFormatter.cs
- RawStylusInputReport.cs
- TextDecorationCollectionConverter.cs
- XmlDataSourceNodeDescriptor.cs
- XmlSchemaImporter.cs
- FormViewDeletedEventArgs.cs
- WindowsClaimSet.cs
- oledbmetadatacolumnnames.cs
- DiffuseMaterial.cs
- RoleGroupCollection.cs
- FontStyles.cs
- DataTableExtensions.cs
- ToolStripItemDataObject.cs
- OleDbPropertySetGuid.cs
- WindowsListBox.cs
- FreezableCollection.cs
- XmlSignatureManifest.cs
- EntityException.cs
- ManagementOperationWatcher.cs
- HMACMD5.cs
- RegistrySecurity.cs
- MsmqIntegrationProcessProtocolHandler.cs
- SecurityAttributeGenerationHelper.cs
- TextEffect.cs
- UseLicense.cs
- MemberMaps.cs
- AbandonedMutexException.cs
- TemplateContentLoader.cs
- HScrollBar.cs
- AstNode.cs
- CharacterBuffer.cs
- DateTimeConverter2.cs
- LocalizationComments.cs
- MetabaseSettings.cs
- MissingMethodException.cs
- EntitySetBaseCollection.cs
- XmlnsCompatibleWithAttribute.cs
- ReturnValue.cs
- PixelFormats.cs
- ContextMenuAutomationPeer.cs
- QuaternionAnimation.cs
- SwitchAttribute.cs
- CodeGotoStatement.cs
- WindowsFormsHost.cs
- EdmItemCollection.cs
- COM2IProvidePropertyBuilderHandler.cs