This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,56 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Activation;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
namespace System.Runtime.Remoting.Services
{
/// <summary>Provides APIs that are needed for communication and operation with unmanaged classes outside of the <see cref="T:System.AppDomain" />. This class cannot be inherited.</summary>
// Token: 0x02000435 RID: 1077
[ComVisible(true)]
public sealed class EnterpriseServicesHelper
{
/// <summary>Constructs a <see cref="T:System.Runtime.Remoting.Messaging.ReturnMessage" /> from the specified <see cref="T:System.Runtime.Remoting.Activation.IConstructionCallMessage" />.</summary>
/// <returns>A <see cref="T:System.Runtime.Remoting.Activation.IConstructionReturnMessage" /> returned from the construction call that is specified in the <paramref name="ctorMsg" /> parameter.</returns>
/// <param name="ctorMsg">A construction call to the object from which the new <see cref="T:System.Runtime.Remoting.Messaging.ReturnMessage" /> instance is returning. </param>
/// <param name="retObj">A <see cref="T:System.Runtime.Remoting.ObjRef" /> that represents the object that is constructed with the construction call in <paramref name="ctorMsg" />. </param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029A7 RID: 10663 RVA: 0x00085F78 File Offset: 0x00084178
[ComVisible(true)]
public static IConstructionReturnMessage CreateConstructionReturnMessage(IConstructionCallMessage ctorMsg, MarshalByRefObject retObj)
{
return new ConstructionResponse(retObj, null, ctorMsg);
}
/// <summary>Switches a COM Callable Wrapper (CCW) from one instance of a class to another instance of the same class.</summary>
/// <param name="oldcp">A proxy that represents the old instance of a class that is referenced by a CCW. </param>
/// <param name="newcp">A proxy that represents the new instance of a class that is referenced by a CCW. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, Infrastructure" />
/// </PermissionSet>
// Token: 0x060029A8 RID: 10664 RVA: 0x00085F84 File Offset: 0x00084184
[MonoTODO]
public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp)
{
throw new NotSupportedException();
}
/// <summary>Wraps the specified IUnknown COM interface with a Runtime Callable Wrapper (RCW).</summary>
/// <returns>The RCW where the specified IUnknown is wrapped.</returns>
/// <param name="punk">A pointer to the IUnknown COM interface to wrap. </param>
/// <exception cref="T:System.Security.SecurityException">The immediate caller does not have UnmanagedCode permission. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, Infrastructure" />
/// </PermissionSet>
// Token: 0x060029A9 RID: 10665 RVA: 0x00085F8C File Offset: 0x0008418C
[MonoTODO]
public static object WrapIUnknownWithComObject(IntPtr punk)
{
throw new NotSupportedException();
}
}
}
@@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace System.Runtime.Remoting.Services
{
/// <summary>Indicates that the implementing object must be notified of marshaling, unmarshaling, and disconnection of objects and proxies by the remoting infrastructure.</summary>
// Token: 0x02000436 RID: 1078
[ComVisible(true)]
public interface ITrackingHandler
{
/// <summary>Notifies the current instance that an object has been disconnected from its proxy.</summary>
/// <param name="obj">The disconnected object. </param>
// Token: 0x060029AA RID: 10666
void DisconnectedObject(object obj);
/// <summary>Notifies the current instance that an object has been marshaled.</summary>
/// <param name="obj">The object that has been marshaled. </param>
/// <param name="or">The <see cref="T:System.Runtime.Remoting.ObjRef" /> that results from marshaling and represents the specified object. </param>
// Token: 0x060029AB RID: 10667
void MarshaledObject(object obj, ObjRef or);
/// <summary>Notifies the current instance that an object has been unmarshaled.</summary>
/// <param name="obj">The unmarshaled object. </param>
/// <param name="or">The <see cref="T:System.Runtime.Remoting.ObjRef" /> that represents the specified object. </param>
// Token: 0x060029AC RID: 10668
void UnmarshaledObject(object obj, ObjRef or);
}
}
@@ -0,0 +1,153 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace System.Runtime.Remoting.Services
{
/// <summary>Provides a way to register, unregister, and obtain a list of tracking handlers.</summary>
// Token: 0x02000437 RID: 1079
[ComVisible(true)]
public class TrackingServices
{
/// <summary>Registers a new tracking handler with the <see cref="T:System.Runtime.Remoting.Services.TrackingServices" />.</summary>
/// <param name="handler">The tracking handler to register. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="handler" /> is null. </exception>
/// <exception cref="T:System.Runtime.Remoting.RemotingException">The handler that is indicated in the <paramref name="handler" /> parameter is already registered with <see cref="T:System.Runtime.Remoting.Services.TrackingServices" />. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029AF RID: 10671 RVA: 0x00085FA8 File Offset: 0x000841A8
public static void RegisterTrackingHandler(ITrackingHandler handler)
{
if (handler == null)
{
throw new ArgumentNullException("handler");
}
object syncRoot = TrackingServices._handlers.SyncRoot;
lock (syncRoot)
{
if (TrackingServices._handlers.IndexOf(handler) != -1)
{
throw new RemotingException("handler already registered");
}
TrackingServices._handlers.Add(handler);
}
}
/// <summary>Unregisters the specified tracking handler from <see cref="T:System.Runtime.Remoting.Services.TrackingServices" />.</summary>
/// <param name="handler">The handler to unregister. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="handler" /> is null. </exception>
/// <exception cref="T:System.Runtime.Remoting.RemotingException">The handler that is indicated in the <paramref name="handler" /> parameter is not registered with <see cref="T:System.Runtime.Remoting.Services.TrackingServices" />. </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x060029B0 RID: 10672 RVA: 0x00086028 File Offset: 0x00084228
public static void UnregisterTrackingHandler(ITrackingHandler handler)
{
if (handler == null)
{
throw new ArgumentNullException("handler");
}
object syncRoot = TrackingServices._handlers.SyncRoot;
lock (syncRoot)
{
int num = TrackingServices._handlers.IndexOf(handler);
if (num == -1)
{
throw new RemotingException("handler is not registered");
}
TrackingServices._handlers.RemoveAt(num);
}
}
/// <summary>Gets an array of the tracking handlers that are currently registered with <see cref="T:System.Runtime.Remoting.Services.TrackingServices" /> in the current <see cref="T:System.AppDomain" />.</summary>
/// <returns>An array of the tracking handlers that are currently registered with <see cref="T:System.Runtime.Remoting.Services.TrackingServices" /> in the current <see cref="T:System.AppDomain" />.</returns>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
/// </PermissionSet>
// Token: 0x1700083F RID: 2111
// (get) Token: 0x060029B1 RID: 10673 RVA: 0x000860A8 File Offset: 0x000842A8
public static ITrackingHandler[] RegisteredHandlers
{
get
{
object syncRoot = TrackingServices._handlers.SyncRoot;
ITrackingHandler[] array;
lock (syncRoot)
{
if (TrackingServices._handlers.Count == 0)
{
array = new ITrackingHandler[0];
}
else
{
array = (ITrackingHandler[])TrackingServices._handlers.ToArray(typeof(ITrackingHandler));
}
}
return array;
}
}
// Token: 0x060029B2 RID: 10674 RVA: 0x0008612C File Offset: 0x0008432C
internal static void NotifyMarshaledObject(object obj, ObjRef or)
{
object syncRoot = TrackingServices._handlers.SyncRoot;
ITrackingHandler[] array;
lock (syncRoot)
{
if (TrackingServices._handlers.Count == 0)
{
return;
}
array = (ITrackingHandler[])TrackingServices._handlers.ToArray(typeof(ITrackingHandler));
}
for (int i = 0; i < array.Length; i++)
{
array[i].MarshaledObject(obj, or);
}
}
// Token: 0x060029B3 RID: 10675 RVA: 0x000861C0 File Offset: 0x000843C0
internal static void NotifyUnmarshaledObject(object obj, ObjRef or)
{
object syncRoot = TrackingServices._handlers.SyncRoot;
ITrackingHandler[] array;
lock (syncRoot)
{
if (TrackingServices._handlers.Count == 0)
{
return;
}
array = (ITrackingHandler[])TrackingServices._handlers.ToArray(typeof(ITrackingHandler));
}
for (int i = 0; i < array.Length; i++)
{
array[i].UnmarshaledObject(obj, or);
}
}
// Token: 0x060029B4 RID: 10676 RVA: 0x00086254 File Offset: 0x00084454
internal static void NotifyDisconnectedObject(object obj)
{
object syncRoot = TrackingServices._handlers.SyncRoot;
ITrackingHandler[] array;
lock (syncRoot)
{
if (TrackingServices._handlers.Count == 0)
{
return;
}
array = (ITrackingHandler[])TrackingServices._handlers.ToArray(typeof(ITrackingHandler));
}
for (int i = 0; i < array.Length; i++)
{
array[i].DisconnectedObject(obj);
}
}
// Token: 0x04001002 RID: 4098
private static ArrayList _handlers = new ArrayList();
}
}