in reply to Re^8: Correct call for dll with Win32::API
in thread Correct call for dll with Win32::API

The lack of preceding underscores on the exported names is a strong indication that the __cdecl calling convention wasn't used. It's not definitive as it could still be __fastcall, but if you follow the link to the translated PDF, you'll see that the prototypes are all similar to int WINAPI HCE300_Open (int ComPort);


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^10: Correct call for dll with Win32::API
by ikegami (Patriarch) on Dec 05, 2008 at 14:14 UTC

    Of __stdcall, Microsoft says

    An underscore (_) is prefixed to the name. The name is followed by the at sign (@) followed by the number of bytes (in decimal) in the argument list. Therefore, the function declared as int func( int a, double b ) is decorated as follows: _func@12

      You are correct. Thankyou.

      I reversed the meaning of the underscore in my mind (and the presence of the WINAPI in the docs stopped any alarm bell from ringing).

      I've updated the post above accordingly.


      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.
        But dumpbin doesn't list leading underscores for the functions in kernel32.dll either.
        ... 1 0 0000A6D4 ActivateActCtx 2 1 00035505 AddAtomA 3 2 000326D9 AddAtomW 4 3 00071CDF AddConsoleAliasA 5 4 00071CA1 AddConsoleAliasW 6 5 00059382 AddLocalAlternateComputerNameA 7 6 00059266 AddLocalAlternateComputerNameW 8 7 0002BEF9 AddRefActCtx 9 8 AddVectoredExceptionHandler (forwarded to NT +DLL.RtlAddVectoredExceptionHandler) 10 9 00072331 AllocConsole ...