Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / Remoting / EnterpriseServicesHelper.cs / 1305376 / 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 \\
//---------------------------------------------------------\\
//----------------------------------------------------------\\
[System.Security.SecurityCritical] // auto-generated_required
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class EnterpriseServicesHelper
{
[System.Security.SecurityCritical] // auto-generated_required
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;
}
[System.Security.SecurityCritical] // auto-generated_required
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 \\
//---------------------------------------------------------\\
//----------------------------------------------------------\\
[System.Security.SecurityCritical] // auto-generated_required
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class EnterpriseServicesHelper
{
[System.Security.SecurityCritical] // auto-generated_required
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;
}
[System.Security.SecurityCritical] // auto-generated_required
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
- FlagsAttribute.cs
- LogicalExpressionTypeConverter.cs
- ObjectAnimationBase.cs
- Stack.cs
- BamlReader.cs
- HiddenField.cs
- SQLInt16.cs
- WebPartMenu.cs
- WorkerRequest.cs
- SQLConvert.cs
- DesignerTextBoxAdapter.cs
- HandoffBehavior.cs
- BevelBitmapEffect.cs
- StructuralType.cs
- MouseGesture.cs
- OracleConnection.cs
- UTF7Encoding.cs
- HostProtectionException.cs
- ListenerSessionConnectionReader.cs
- DataBinder.cs
- EventEntry.cs
- ListMarkerLine.cs
- PrinterResolution.cs
- XmlReader.cs
- ActiveXSerializer.cs
- TimeSpanValidatorAttribute.cs
- AncestorChangedEventArgs.cs
- ResourceAssociationSetEnd.cs
- RuleSettingsCollection.cs
- ProxyManager.cs
- CodeConditionStatement.cs
- PaperSource.cs
- ConnectorRouter.cs
- ProcessHostFactoryHelper.cs
- AttributeAction.cs
- ListManagerBindingsCollection.cs
- FastPropertyAccessor.cs
- Base64Stream.cs
- FixedNode.cs
- PageAdapter.cs
- QilScopedVisitor.cs
- XmlSerializableReader.cs
- EnvironmentPermission.cs
- ExclusiveTcpListener.cs
- TextParagraphView.cs
- QilScopedVisitor.cs
- VariableQuery.cs
- _SslSessionsCache.cs
- TextEditorTables.cs
- ResourcePart.cs
- TextModifierScope.cs
- RefType.cs
- DataGridViewImageColumn.cs
- XamlTreeBuilderBamlRecordWriter.cs
- RawStylusSystemGestureInputReport.cs
- RSAProtectedConfigurationProvider.cs
- SparseMemoryStream.cs
- SafeSecurityHelper.cs
- Classification.cs
- VirtualizingPanel.cs
- HtmlWindowCollection.cs
- OwnerDrawPropertyBag.cs
- ObjectDataSourceDisposingEventArgs.cs
- HttpModuleAction.cs
- XslNumber.cs
- ContractMapping.cs
- ConfigurationManagerInternal.cs
- IncrementalCompileAnalyzer.cs
- ValueOfAction.cs
- XamlTypeMapperSchemaContext.cs
- MappedMetaModel.cs
- FrugalList.cs
- DoubleCollectionValueSerializer.cs
- DefaultDiscoveryService.cs
- CodeGroup.cs
- DesignerCapabilities.cs
- DbProviderManifest.cs
- BrowsableAttribute.cs
- SettingsAttributes.cs
- UnsafeCollabNativeMethods.cs
- RedirectionProxy.cs
- HostingEnvironmentSection.cs
- WriteableBitmap.cs
- PageAction.cs
- Int16KeyFrameCollection.cs
- DecoderBestFitFallback.cs
- SendKeys.cs
- CommandDesigner.cs
- XmlHierarchicalDataSourceView.cs
- ValueTypeFixupInfo.cs
- TypeInfo.cs
- ToggleProviderWrapper.cs
- TreeViewItemAutomationPeer.cs
- LicenseContext.cs
- ComplexTypeEmitter.cs
- ViewPort3D.cs
- DeleteWorkflowOwnerCommand.cs
- PropertyDescriptorCollection.cs
- bindurihelper.cs
- SettingsProviderCollection.cs