I want to get the function pointer (ie IntPtr) for an extern method such as:
[DllImport("DbgHelp.dll")]
static extern void SymFunctionTableAccess64(IntPtr process, ulong addrBase);
which, then also be used as a parameter for an extern method such as:
[DllImport("DbgHelp.dll")]
static extern int StackWalk64(......., IntPtr FunctionTableAccessRoutine, ....);
I know I can use LoadLibrary and then GetProcAddress, or wrap the function in a C# method and then use Marshal.GetFunctionPointerForDelegate for a function pointer. I wonder if we can retrieve the function pointer directly from P/Invoke mechanism, because, during runtime, functions will already be loaded via DllImport. Just to note, my problem is not specific to StackWalk64 or any DbgHelp.dll functions.