-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'BepInEx:master' into master
- Loading branch information
Showing
7 changed files
with
138 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
Il2CppInterop.Runtime/Runtime/VersionSpecific/MethodInfo/MethodInfo_29_2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
namespace Il2CppInterop.Runtime.Runtime.VersionSpecific.MethodInfo | ||
{ | ||
[ApplicableToUnityVersionsSince("2023.2.0")] | ||
public unsafe class NativeMethodInfoStructHandler_29_2 : INativeMethodInfoStructHandler | ||
{ | ||
public int Size() => sizeof(Il2CppMethodInfo_29_2); | ||
public INativeMethodInfoStruct CreateNewStruct() | ||
{ | ||
IntPtr ptr = Marshal.AllocHGlobal(Size()); | ||
Il2CppMethodInfo_29_2* _ = (Il2CppMethodInfo_29_2*)ptr; | ||
*_ = default; | ||
return new NativeStructWrapper(ptr); | ||
} | ||
public INativeMethodInfoStruct Wrap(Il2CppMethodInfo* ptr) | ||
{ | ||
if (ptr == null) return null; | ||
return new NativeStructWrapper((IntPtr)ptr); | ||
} | ||
internal unsafe struct Il2CppMethodInfo_29_2 | ||
{ | ||
public void* methodPointer; | ||
public void* virtualMethodPointer; | ||
public void* invoker_method; | ||
public byte* name; | ||
public Il2CppClass* klass; | ||
public Il2CppTypeStruct* return_type; | ||
public Il2CppTypeStruct** parameters; | ||
public void* runtime_data; | ||
public void* generic_data; | ||
public uint token; | ||
public ushort flags; | ||
public ushort iflags; | ||
public ushort slot; | ||
public byte parameters_count; | ||
public Bitfield0 _bitfield0; | ||
internal enum Bitfield0 : byte | ||
{ | ||
BIT_is_generic = 0, | ||
is_generic = (1 << BIT_is_generic), | ||
BIT_is_inflated = 1, | ||
is_inflated = (1 << BIT_is_inflated), | ||
BIT_wrapper_type = 2, | ||
wrapper_type = (1 << BIT_wrapper_type), | ||
BIT_has_full_generic_sharing_signature = 3, | ||
has_full_generic_sharing_signature = (1 << BIT_has_full_generic_sharing_signature), | ||
BIT_is_unmanaged_callers_only = 4, | ||
is_unmanaged_callers_only = (1 << BIT_is_unmanaged_callers_only), | ||
} | ||
|
||
} | ||
|
||
internal class NativeStructWrapper : INativeMethodInfoStruct | ||
{ | ||
public NativeStructWrapper(IntPtr ptr) => Pointer = ptr; | ||
private static int _bitfield0offset = Marshal.OffsetOf<Il2CppMethodInfo_29_2>(nameof(Il2CppMethodInfo_29_2._bitfield0)).ToInt32(); | ||
public IntPtr Pointer { get; } | ||
private Il2CppMethodInfo_29_2* _ => (Il2CppMethodInfo_29_2*)Pointer; | ||
public Il2CppMethodInfo* MethodInfoPointer => (Il2CppMethodInfo*)Pointer; | ||
public ref IntPtr Name => ref *(IntPtr*)&_->name; | ||
public ref ushort Slot => ref _->slot; | ||
public ref IntPtr MethodPointer => ref *(IntPtr*)&_->methodPointer; | ||
public ref IntPtr VirtualMethodPointer => ref *(IntPtr*)&_->virtualMethodPointer; | ||
public ref Il2CppClass* Class => ref _->klass; | ||
public ref IntPtr InvokerMethod => ref *(IntPtr*)&_->invoker_method; | ||
public ref Il2CppTypeStruct* ReturnType => ref _->return_type; | ||
public ref Il2CppMethodFlags Flags => ref *(Il2CppMethodFlags*)&_->flags; | ||
public ref byte ParametersCount => ref _->parameters_count; | ||
public ref Il2CppParameterInfo* Parameters => ref *(Il2CppParameterInfo**)&_->parameters; | ||
public ref uint Token => ref _->token; | ||
public bool IsGeneric | ||
{ | ||
get => this.CheckBit(_bitfield0offset, (int)Il2CppMethodInfo_29_2.Bitfield0.BIT_is_generic); | ||
set => this.SetBit(_bitfield0offset, (int)Il2CppMethodInfo_29_2.Bitfield0.BIT_is_generic, value); | ||
} | ||
public bool IsInflated | ||
{ | ||
get => this.CheckBit(_bitfield0offset, (int)Il2CppMethodInfo_29_2.Bitfield0.BIT_is_inflated); | ||
set => this.SetBit(_bitfield0offset, (int)Il2CppMethodInfo_29_2.Bitfield0.BIT_is_inflated, value); | ||
} | ||
public bool IsMarshalledFromNative | ||
{ | ||
get => false; | ||
set { } | ||
} | ||
} | ||
|
||
} | ||
|
||
} |