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
- xamlnodes.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- MarkupCompilePass1.cs
- UniqueConstraint.cs
- SpeechRecognizer.cs
- OleDbPermission.cs
- FixedSOMLineRanges.cs
- ConstantExpression.cs
- CacheDependency.cs
- Drawing.cs
- Pkcs7Recipient.cs
- ViewLoader.cs
- DataRecordInternal.cs
- AuditLog.cs
- UiaCoreApi.cs
- ListSourceHelper.cs
- BindingCompleteEventArgs.cs
- CommandManager.cs
- StyleCollection.cs
- Comparer.cs
- PreviewKeyDownEventArgs.cs
- MenuScrollingVisibilityConverter.cs
- DataGridViewTextBoxEditingControl.cs
- JobStaple.cs
- AliasedExpr.cs
- ImageDrawing.cs
- ParameterCollection.cs
- PrintingPermission.cs
- FusionWrap.cs
- PageClientProxyGenerator.cs
- ButtonStandardAdapter.cs
- MetadataCache.cs
- storepermissionattribute.cs
- AssemblyBuilder.cs
- PrinterUnitConvert.cs
- SmtpClient.cs
- XmlILIndex.cs
- _Connection.cs
- Page.cs
- ServiceMoniker.cs
- BamlResourceSerializer.cs
- GradientStop.cs
- TableLayoutPanel.cs
- EntityDataSourceQueryBuilder.cs
- AuthorizationRuleCollection.cs
- PolicyManager.cs
- IssuanceTokenProviderState.cs
- Listbox.cs
- SymbolResolver.cs
- DataException.cs
- MinMaxParagraphWidth.cs
- BufferedStream.cs
- Quaternion.cs
- SortQuery.cs
- QilStrConcat.cs
- SchemaCollectionPreprocessor.cs
- TextTreeInsertUndoUnit.cs
- StateBag.cs
- MetaTableHelper.cs
- SettingsAttributeDictionary.cs
- CompilerInfo.cs
- XmlReader.cs
- isolationinterop.cs
- SerialStream.cs
- CustomActivityDesigner.cs
- SolidColorBrush.cs
- EventProviderTraceListener.cs
- TypeToStringValueConverter.cs
- NativeCppClassAttribute.cs
- PrimaryKeyTypeConverter.cs
- PageAsyncTaskManager.cs
- _Win32.cs
- XmlHierarchyData.cs
- XmlNamespaceDeclarationsAttribute.cs
- ChannelDispatcherBase.cs
- TimeSpanSecondsConverter.cs
- ContextMenuStripGroup.cs
- OdbcEnvironmentHandle.cs
- ListParaClient.cs
- AppSettingsExpressionBuilder.cs
- EdmRelationshipRoleAttribute.cs
- Transform3DCollection.cs
- TextEditorSpelling.cs
- SignerInfo.cs
- Int32Animation.cs
- httpstaticobjectscollection.cs
- xmlglyphRunInfo.cs
- PermissionSetEnumerator.cs
- DataGridViewColumnCollectionEditor.cs
- TraceSection.cs
- BulletedList.cs
- FamilyCollection.cs
- MappingSource.cs
- InputReportEventArgs.cs
- RequestTimeoutManager.cs
- GC.cs
- SerTrace.cs
- OdbcParameterCollection.cs
- SqlUserDefinedAggregateAttribute.cs
- D3DImage.cs