Thank you for the info, I actually know about what that function does and what it's used for. I was giving this just as an example, as even when the library compiles without multithreaded support it still crashes. Haven't found the time to debug this other case though, to see what exactly happens. Like I said, the function fails on a memory allocation routine, prior to calling the critical selection function.
Finally I decided to compile the dll which worked "out of the box" and that's what one would expect. Not that I would expect to have a library used in an unusual way working right from the first try, but some things (like having one dll less) are not worth more then 4-5 days trying to figure it out. I have less and less masochistic capacity as the years pass, sadly.
These were my fruitless tries
- compiling with VC++ 6.0 (as C code which supposedly even shouldn't mangle function names) with the option which explicitly keeps the names demangled on
- using Pelles c with various settings, among them the "don't demangle names" active
- in the meantime I tried to change the code and use various function declarations (I really don't have much C/C++ experience), even though MASM can really work with both C and stdcall function calls. I have also ran into a few bugs with MASM IDE when some peculiar conditions are met which made me wander aimlessly for the better part of a day
- using an utility which supposedly demangles names on already compiled .obj files
Nothing actually worked and only this one case produced me a linkable lib which, well, crashes
timovjl, thanks for the link, I'll check it out.