I have come across another problem.
https://gitlab.com/vrresto/il2ge/-/blob/master/core_wrapper/sfs/sfs.cpp#L64
I'm using my own SFS_openf wrapper (which wraps around the SAS wrapper).
See reply #1176.
My Merge Request includes a new version of the wrapped method, which dynamically calls either the "routing" method or the plain old __cdecl one, depending on availability of a "routing" method in wrapper.dll.
That way IL-2 GE will work with any 4.x Selector Version (no routing method included) and with any 5.1+ version (routing method available). Only 5.0 would cause crashes, but that version has been superseded meanwhile and never made it into any other modpack but UP 3.4 P2 HF 11, which in turn is superseded by HF 12 so we've got that covered, too.
Is there a good way to query the version via C++ code?
You mean a way to find out whether an exported method is __cdelc or __stdcall?
No way.
Even the highest sophisticated decompilers (IDA Pro anyone?) are just doing guesswork.
Even myself is doing guesswork here, based on the first few things done in assembler code at method start.
Ideally wrapper.dll would export a method like bool is_SFS_openf_stdcall().
That method would not exist in old wrapper.dll versions so you'd be back at square one.
For now, starting with Selector 5.1 we have "__SAS_openf@12" which is a "routing" method with __stdcall declaration, and if that method exists, you can always call it and it will take care of further mangling calling conventions if required - internally inside wrapper.dll.
That's what my Merge request was all about.
Check for presence of that method and use it if it exists, otherwise fall back to calling the good old __cdecl "__SAS_openf" from Selector 4.x wrapper.dll.
It's not legacy but optional.
Okay so we should just not bother about the Exception caused then.
![Cheers ]cheers[](https://www.sas1946.com/main/Smileys/akyhne/occasion14.gif)
Mike