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
- wgx_exports.cs
- ConfigurationStrings.cs
- DBBindings.cs
- TraceHandler.cs
- PrintEvent.cs
- DynamicRenderer.cs
- RubberbandSelector.cs
- MessageEncoder.cs
- MethodMessage.cs
- Resources.Designer.cs
- WindowsProgressbar.cs
- DetailsViewDeleteEventArgs.cs
- SqlConnectionHelper.cs
- WebPartCancelEventArgs.cs
- DiscoveryProxy.cs
- ThicknessAnimation.cs
- NotFiniteNumberException.cs
- DispatcherProcessingDisabled.cs
- BuildResultCache.cs
- AliasedExpr.cs
- ManifestResourceInfo.cs
- PageBreakRecord.cs
- ToolStripGripRenderEventArgs.cs
- ExpressionBinding.cs
- ReachDocumentSequenceSerializerAsync.cs
- ProcessRequestAsyncResult.cs
- regiisutil.cs
- XmlTypeMapping.cs
- ArrayElementGridEntry.cs
- ValidationErrorEventArgs.cs
- Compilation.cs
- RenderTargetBitmap.cs
- ReadOnlyAttribute.cs
- ConfigurationManager.cs
- GridViewCommandEventArgs.cs
- QilFactory.cs
- ModuleElement.cs
- ContentTextAutomationPeer.cs
- ConnectionsZone.cs
- ConfigurationSectionCollection.cs
- AttributeSetAction.cs
- CalendarTable.cs
- ForeignKeyConstraint.cs
- WindowsGrip.cs
- SynchronizationContextHelper.cs
- ActivityCodeGenerator.cs
- UInt16.cs
- ExpressionEditorAttribute.cs
- arclist.cs
- _IPv6Address.cs
- TranslateTransform3D.cs
- GlyphingCache.cs
- Button.cs
- PseudoWebRequest.cs
- CompositeDuplexBindingElementImporter.cs
- AssemblyInfo.cs
- ClientUtils.cs
- SafeCryptContextHandle.cs
- XPathChildIterator.cs
- ListMarkerSourceInfo.cs
- TableCellCollection.cs
- MetadataItemSerializer.cs
- ConfigurationSectionGroup.cs
- Shape.cs
- DataGridViewLayoutData.cs
- FaultFormatter.cs
- MemberPathMap.cs
- HandlerMappingMemo.cs
- SamlAdvice.cs
- StreamInfo.cs
- TreeViewDesigner.cs
- SHA384.cs
- FormatSettings.cs
- DecoderExceptionFallback.cs
- HitTestFilterBehavior.cs
- EditingMode.cs
- NotifyInputEventArgs.cs
- NavigationFailedEventArgs.cs
- XMLUtil.cs
- OleDbMetaDataFactory.cs
- AuthenticationService.cs
- OleDbConnectionInternal.cs
- Point3DKeyFrameCollection.cs
- PlatformCulture.cs
- DataGridItemAutomationPeer.cs
- TableDesigner.cs
- BitmapEffectDrawing.cs
- NumberSubstitution.cs
- ZoneMembershipCondition.cs
- TextTreeTextBlock.cs
- filewebrequest.cs
- SessionIDManager.cs
- SingleAnimationUsingKeyFrames.cs
- HttpCapabilitiesBase.cs
- PropertyGridCommands.cs
- JsonEncodingStreamWrapper.cs
- XmlAttributeCache.cs
- ByteAnimation.cs
- MailSettingsSection.cs
- DataGridDetailsPresenterAutomationPeer.cs