title: Is there a way to get function pointer for extern method in C#
body: <p>I want to get the function pointer (ie <code>IntPtr</code>) for an <code>extern</code> method such as:</p>
  
  <pre><code>[DllImport("DbgHelp.dll")]
  static extern void SymFunctionTableAccess64(IntPtr process, ulong addrBase);
  </code></pre>
  
  <p>which, then also be used as a parameter for an <code>extern</code> method such as:</p>
  
  <pre><code>[DllImport("DbgHelp.dll")]
  static extern int StackWalk64(......., IntPtr FunctionTableAccessRoutine, ....);
  </code></pre>
  
  <p>I know I can use <code>LoadLibrary</code> and then <code>GetProcAddress</code>, or wrap the function in a C# method and then use <code>Marshal.GetFunctionPointerForDelegate</code> 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 <code>DllImport</code>. Just to note, my problem is not specific to <code>StackWalk64</code> or any DbgHelp.dll functions.</p>