https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.marshal.getfunctionpointerfordelegate?view=netframework-4.8.1&redirectedfrom=MSDN
Marshal.GetFunctionPointerForDelegate Method (System.Runtime.InteropServices) | Microsoft Learn
Converts a delegate into a function pointer that is callable from unmanaged code.
marshalmethodsystemruntimemicrosoft