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
- ConsoleKeyInfo.cs
- DataGridViewLinkColumn.cs
- DirectoryInfo.cs
- UrlPropertyAttribute.cs
- FullTextState.cs
- FunctionCommandText.cs
- CustomCategoryAttribute.cs
- DateTimeOffset.cs
- DataStreams.cs
- WebEncodingValidator.cs
- VerbConverter.cs
- EditorZoneBase.cs
- BitmapCodecInfo.cs
- SecurityCriticalDataForSet.cs
- RSACryptoServiceProvider.cs
- TypeBuilder.cs
- ToolStripPanelSelectionBehavior.cs
- Variable.cs
- LinkUtilities.cs
- SchemaImporterExtensionsSection.cs
- ManagedIStream.cs
- SafeNativeMethodsOther.cs
- PageContent.cs
- UnsafeNativeMethods.cs
- WebPartCollection.cs
- SqlClientPermission.cs
- WmpBitmapEncoder.cs
- SymbolMethod.cs
- HtmlElementEventArgs.cs
- StringUtil.cs
- DateTimeOffsetStorage.cs
- FileDialogPermission.cs
- WindowsAuthenticationEventArgs.cs
- DispatcherHookEventArgs.cs
- ActiveDocumentEvent.cs
- DoWorkEventArgs.cs
- securitymgrsite.cs
- SingleAnimationUsingKeyFrames.cs
- CodeTryCatchFinallyStatement.cs
- ResourceDictionaryCollection.cs
- ExpressionConverter.cs
- Exception.cs
- ServiceOperationListItem.cs
- QuotedStringWriteStateInfo.cs
- InkPresenter.cs
- _SingleItemRequestCache.cs
- XmlSchemaSimpleType.cs
- TimeoutException.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- sitestring.cs
- ShapeTypeface.cs
- RadialGradientBrush.cs
- CLRBindingWorker.cs
- SevenBitStream.cs
- PasswordPropertyTextAttribute.cs
- BorderGapMaskConverter.cs
- DataGridViewCellParsingEventArgs.cs
- BitmapInitialize.cs
- ErrorTableItemStyle.cs
- DataTrigger.cs
- MailDefinition.cs
- EditCommandColumn.cs
- GenericUriParser.cs
- DesignerVerbCollection.cs
- ElementAction.cs
- GPPOINTF.cs
- EventListenerClientSide.cs
- UIElementAutomationPeer.cs
- Model3DCollection.cs
- ResourcesGenerator.cs
- PerspectiveCamera.cs
- LockRecursionException.cs
- EncoderExceptionFallback.cs
- SSmlParser.cs
- DataGridViewImageCell.cs
- ConfigurationSettings.cs
- GridViewSelectEventArgs.cs
- ListQueryResults.cs
- UnhandledExceptionEventArgs.cs
- EntityDataSource.cs
- ReferentialConstraint.cs
- UIPropertyMetadata.cs
- EntityContainer.cs
- ContentPlaceHolder.cs
- ChildDocumentBlock.cs
- BitmapEffectvisualstate.cs
- TableColumnCollectionInternal.cs
- ResourceDisplayNameAttribute.cs
- PrintController.cs
- ResourceProperty.cs
- XmlSchemaAttribute.cs
- SharedPersonalizationStateInfo.cs
- InvalidDataException.cs
- DbParameterCollection.cs
- WasEndpointConfigContainer.cs
- CodeGenerator.cs
- ProcessThreadCollection.cs
- XmlWhitespace.cs
- XamlRtfConverter.cs
- WinFormsSecurity.cs