Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- HttpDebugHandler.cs
- exports.cs
- IItemContainerGenerator.cs
- ProfileGroupSettingsCollection.cs
- SettingsProperty.cs
- sitestring.cs
- TcpChannelHelper.cs
- Stack.cs
- AssemblyBuilder.cs
- FrameworkElement.cs
- Floater.cs
- CellIdBoolean.cs
- HMACMD5.cs
- FastPropertyAccessor.cs
- ValidationPropertyAttribute.cs
- ListControl.cs
- BitmapEffectOutputConnector.cs
- SqlEnums.cs
- ContentType.cs
- InkCanvasFeedbackAdorner.cs
- Rect3D.cs
- PageEventArgs.cs
- TextRenderer.cs
- SizeChangedEventArgs.cs
- TextUtf8RawTextWriter.cs
- TrimSurroundingWhitespaceAttribute.cs
- sqlnorm.cs
- PointValueSerializer.cs
- DataPointer.cs
- AutoGeneratedFieldProperties.cs
- DSACryptoServiceProvider.cs
- WaitForChangedResult.cs
- RectKeyFrameCollection.cs
- ChoiceConverter.cs
- PropertyEmitterBase.cs
- Control.cs
- SessionStateUtil.cs
- WebPartActionVerb.cs
- InvalidOperationException.cs
- ExpressionTable.cs
- GAC.cs
- LongTypeConverter.cs
- CodeArrayCreateExpression.cs
- UpdateProgress.cs
- CodeSnippetExpression.cs
- LinkedList.cs
- TokenBasedSet.cs
- ToggleProviderWrapper.cs
- TraceContextRecord.cs
- BaseTemplateCodeDomTreeGenerator.cs
- _Semaphore.cs
- AVElementHelper.cs
- BinaryFormatterWriter.cs
- IdentityManager.cs
- MatrixAnimationUsingPath.cs
- GetFileNameResult.cs
- DashStyle.cs
- XmlSchemaValidationException.cs
- SqlBuilder.cs
- CheckPair.cs
- PackWebResponse.cs
- Int32AnimationBase.cs
- DependencyPropertyKind.cs
- WebZone.cs
- ClientBuildManager.cs
- MetadataArtifactLoaderCompositeFile.cs
- DSACryptoServiceProvider.cs
- SqlInfoMessageEvent.cs
- LightweightCodeGenerator.cs
- XmlSerializerAssemblyAttribute.cs
- CodeCompileUnit.cs
- FormViewDeleteEventArgs.cs
- ScriptIgnoreAttribute.cs
- CommandLibraryHelper.cs
- AdornerPresentationContext.cs
- TextParentUndoUnit.cs
- DocumentEventArgs.cs
- BoundPropertyEntry.cs
- VarRemapper.cs
- DelegateArgumentValue.cs
- SmiEventStream.cs
- GatewayDefinition.cs
- RegexReplacement.cs
- URLIdentityPermission.cs
- MsmqTransportSecurity.cs
- MetadataSet.cs
- SafeEventLogReadHandle.cs
- TemplateXamlParser.cs
- OrderedDictionaryStateHelper.cs
- RewritingValidator.cs
- SByteStorage.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- PackageProperties.cs
- CategoryNameCollection.cs
- XmlCharCheckingReader.cs
- InstanceKeyView.cs
- Variant.cs
- DirectionalLight.cs
- DrawingCollection.cs
- CompressionTransform.cs