feat(modloader): pdb mapping, dynamic invoke, mixins

This commit is contained in:
Jacobwasbeast
2026-03-10 17:45:25 -05:00
parent 70dbff3fac
commit be327befa4
34 changed files with 2535 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
namespace WeaveLoader.API.Native;
internal static class NativeInvoker
{
internal static bool TryInvoke(string fullName, nint thisPtr, bool hasThis, NativeType retType, NativeArg[] args, out NativeRet ret)
{
ret = new NativeRet { Type = retType };
nint fn = NativeSymbol.Find(fullName);
if (fn == 0)
return false;
int ok = NativeInterop.native_invoke(fn, thisPtr, hasThis ? 1 : 0, args, args.Length, ref ret);
return ok != 0;
}
internal static bool TryInvoke(nint fn, nint thisPtr, bool hasThis, NativeType retType, NativeArg[] args, out NativeRet ret)
{
ret = new NativeRet { Type = retType };
if (fn == 0)
return false;
int ok = NativeInterop.native_invoke(fn, thisPtr, hasThis ? 1 : 0, args, args.Length, ref ret);
return ok != 0;
}
}