in reply to Re: On Yaks and the Shaving Thereof - finding exported symbols of a C library
in thread On Yaks and the Shaving Thereof - finding exported symbols of a C library

You can. See GetProcAddress(), and the references to "ordinal". But that only allows you to access the addresses of the exported routines, not their names.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: On Yaks and the Shaving Thereof - finding exported symbols of a C library

Replies are listed 'Best First'.
Re^3: On Yaks and the Shaving Thereof - finding exported symbols of a C library
by vkon (Curate) on Mar 23, 2011 at 10:19 UTC
    Aha...

    As long as GetProcAddress is in the core, you even can use it from Perl...
    but - beware: perldoc win32

    Win32::GetProcAddress(INSTANCE, PROCNAME) Returns the address of a function inside a loaded library. The information about what you can do with this address has been l +ost in the mist of time. Use the Win32::API module instead of this deprecated function.

    anyway, you could do this in XS, then, but still - I would prefer parsing output of 'dumpbin' command...

    update still no way to have function name by ordinal, BTW...
    :(

      Yes - my current list of preferences is

      1. See how ExtUtils::CChecker fares, especially concerning speed per checked symbol and the compatibility wishes of Maddingue. Currently Net::Pcap claims to be compatible back to Perl 5.004, and this build prerequisite will likely break that.
      2. See whether I can coax DynaLoader into providing a list of symbols. On Win32, DynaLoader is basically LoadLibrary() and GetProcAddress() anyway.
      3. Parse the output of nm or dumpbin.exe to get at the list of exported symbols. This has the attractive feature of allowing to find the symbols not only of DLLs but also of .a and .o files.