Menu

#562 TOWLEXTDll::GetOWLEXTVersion fails to initialize in 32-bit build mode

8
pending
1
2023-09-27
2023-09-27
No

TOWLEXTDll expects an undecorated function name "GetOWLEXTVersion" in the DLL API. However, GetOWLEXTVersion is declared with the WINAPI calling convention. In the 32-bit WINAPI (__stdcall) convention, function names are decorated with leading underscore and trailing at-sign (@), followed by the number of bytes taken by any parameters.

The original code has a DEF file (source/owlext/intel/owlext.def) that can be used to perform function name mapping, but it only assigns an ordinal and assumes the function name is already undecorated. It does not map the actual decorated name (_GetOWLEXTVersion@0).

EXPORTS
  GetOWLEXTVersion  @1

To map the decorated function to the desired undecorated name, the DEF file would need to look like this:

EXPORTS
    _GetOWLEXTVersion@0 = GetOWLEXTVersion @1

Interestingly, the 64-bit WINAPI convention uses undecorated names, so this issue does not occur in the 64-bit build mode.

Related

Feature Requests: #29
Wiki: OWLNext_Roadmap_and_Prereleases

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2023-09-27
    • status: open --> pending
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-09-27

    This issue has been fixed on the trunk [r6660].

    Resolution: Added a pragma to map the decorated name (_GetOWLEXTVersion@...) to the desired undecorated name in 32-bit build mode. Removed the DEF file, which was not performing the necessary name mapping. Note that an ordinal is no longer assigned, but this should not affect modern code, which links by name, not by ordinals.

     

    Related

    Commit: [r6660]


Log in to post a comment.