109 lines
5.9 KiB
C#
109 lines
5.9 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Reflection.Emit
|
|
{
|
|
/// <summary>Provides a fast way to swap method body implementation given a method of a class.</summary>
|
|
// Token: 0x02000205 RID: 517
|
|
[ComVisible(true)]
|
|
[ClassInterface(ClassInterfaceType.None)]
|
|
[ComDefaultInterface(typeof(_MethodRental))]
|
|
public sealed class MethodRental : _MethodRental
|
|
{
|
|
// Token: 0x06001B50 RID: 6992 RVA: 0x000667D8 File Offset: 0x000649D8
|
|
private MethodRental()
|
|
{
|
|
}
|
|
|
|
/// <summary>Maps a set of names to a corresponding set of dispatch identifiers.</summary>
|
|
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
|
|
/// <param name="rgszNames">Passed-in array of names to be mapped.</param>
|
|
/// <param name="cNames">Count of the names to be mapped.</param>
|
|
/// <param name="lcid">The locale context in which to interpret the names.</param>
|
|
/// <param name="rgDispId">Caller-allocated array which receives the IDs corresponding to the names.</param>
|
|
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
|
|
// Token: 0x06001B51 RID: 6993 RVA: 0x000667E0 File Offset: 0x000649E0
|
|
void _MethodRental.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Retrieves the type information for an object, which can then be used to get the type information for an interface.</summary>
|
|
/// <param name="iTInfo">The type information to return.</param>
|
|
/// <param name="lcid">The locale identifier for the type information.</param>
|
|
/// <param name="ppTInfo">Receives a pointer to the requested type information object.</param>
|
|
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
|
|
// Token: 0x06001B52 RID: 6994 RVA: 0x000667E8 File Offset: 0x000649E8
|
|
void _MethodRental.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Retrieves the number of type information interfaces that an object provides (either 0 or 1).</summary>
|
|
/// <param name="pcTInfo">Points to a location that receives the number of type information interfaces provided by the object.</param>
|
|
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
|
|
// Token: 0x06001B53 RID: 6995 RVA: 0x000667F0 File Offset: 0x000649F0
|
|
void _MethodRental.GetTypeInfoCount(out uint pcTInfo)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Provides access to properties and methods exposed by an object.</summary>
|
|
/// <param name="dispIdMember">Identifies the member.</param>
|
|
/// <param name="riid">Reserved for future use. Must be IID_NULL.</param>
|
|
/// <param name="lcid">The locale context in which to interpret arguments.</param>
|
|
/// <param name="wFlags">Flags describing the context of the call.</param>
|
|
/// <param name="pDispParams">Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.</param>
|
|
/// <param name="pVarResult">Pointer to the location where the result is to be stored.</param>
|
|
/// <param name="pExcepInfo">Pointer to a structure that contains exception information.</param>
|
|
/// <param name="puArgErr">The index of the first argument that has an error.</param>
|
|
/// <exception cref="T:System.NotImplementedException">The method is called late-bound using the COM IDispatch interface.</exception>
|
|
// Token: 0x06001B54 RID: 6996 RVA: 0x000667F8 File Offset: 0x000649F8
|
|
void _MethodRental.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Swaps the body of a method.</summary>
|
|
/// <param name="cls">The class containing the method. </param>
|
|
/// <param name="methodtoken">The token for the method. </param>
|
|
/// <param name="rgIL">A pointer to the method. This should include the method header. </param>
|
|
/// <param name="methodSize">The size of the new method body in bytes. </param>
|
|
/// <param name="flags">Flags that control the swapping. See the definitions of the constants. </param>
|
|
/// <exception cref="T:System.ArgumentNullException">
|
|
/// <paramref name="cls" /> is null. </exception>
|
|
/// <exception cref="T:System.NotSupportedException">The type <paramref name="cls" /> is not complete. </exception>
|
|
/// <exception cref="T:System.ArgumentException">
|
|
/// <paramref name="methodSize" /> is less than one or greater than 4128767 (3effff hex).</exception>
|
|
/// <PermissionSet>
|
|
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode" />
|
|
/// </PermissionSet>
|
|
// Token: 0x06001B55 RID: 6997 RVA: 0x00066800 File Offset: 0x00064A00
|
|
[MonoTODO]
|
|
public static void SwapMethodBody(Type cls, int methodtoken, IntPtr rgIL, int methodSize, int flags)
|
|
{
|
|
if (methodSize <= 0 || methodSize >= 4128768)
|
|
{
|
|
throw new ArgumentException("Data size must be > 0 and < 0x3f0000", "methodSize");
|
|
}
|
|
if (cls == null)
|
|
{
|
|
throw new ArgumentNullException("cls");
|
|
}
|
|
if (cls is TypeBuilder && !((TypeBuilder)cls).is_created)
|
|
{
|
|
throw new NotSupportedException("Type '" + cls + "' is not yet created.");
|
|
}
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>Specifies that the method should be just-in-time (JIT) compiled immediately.</summary>
|
|
// Token: 0x0400082E RID: 2094
|
|
public const int JitImmediate = 1;
|
|
|
|
/// <summary>Specifies that the method should be just-in-time (JIT) compiled when needed.</summary>
|
|
// Token: 0x0400082F RID: 2095
|
|
public const int JitOnDemand = 0;
|
|
}
|
|
}
|