I finally tracked down what was causing the stack corruption when loading a Rust VST in a C++ host on Windows. When I debugged it in Visual Studio I got:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
So I found out that the VST SDK specifies cdecl as the calling convention to use..
And when I changed it, it finally worked..
I finally tracked down what was causing the stack corruption when loading a Rust VST in a C++ host on Windows. When I debugged it in Visual Studio I got:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
So I found out that the VST SDK specifies cdecl as the calling convention to use.. And when I changed it, it finally worked..Btw, I debugged it by compiling building this in debug mode: https://github.com/teragonaudio/MrsWatson And then it crashed on this line: https://github.com/teragonaudio/MrsWatson/blob/master/source/plugin/PluginVst2xWindows.cpp#L105
(Btw, I made the bit flags public to be compatible with bitflags 0.5.0)