P / Invoke to fix Win32 DLL version?

I have a P / Invoke code that calls DBGHELP.DLL. I will add signatures to pinvoke.net later.

The version of DBGHELP.DLL that ships with Windows 2003 is too old and my code requires the version of DBGHELP.DLL that ships with "Debugging Tools for Windows" version 6.9.

How do you do one of the following?

  • Make sure DllImport requires the minimum version.
  • Find out which DLL will be loaded and then get the version number. I need to use FileVersionInfo, but how do I know the search order that P / Invoke will use?

Nonetheless: does anyone have any reliable code that uses FileVersionInfo to check for minimum version information?

0


source to share


2 answers


P / Call the LoadLibrary call with the explicit DBGHELP path you want, this way when you go to make your actual P / Invoke the DLL will already be loaded.



+1


source


Isn't it easier to import (but not call) a function that is only present in DbgHelp.DLL version 6.9 and higher?



0


source







All Articles