Details
-
Bug
-
Resolution: Fixed
-
Critical
-
1.5.100
-
None
Description
<p>After switching to net4 environment, VS2010 debug mode starts to show "PInvokeStackImbalance" exception related to unmanaged code for some third party imported dlls.</p><p>According to MS those errors should not be ignored as they can lead to application instabillity or security issues.That same problem will exist when you run MP outside the debugger, but the checks are too costly to perform in anytime other than debugging.</p><p>Fix can be applied either in C++ part of dll or in C# by adding <span class="comment-copy">CallingConvention = CallingConvention.Cdecl on dll import.</span></p><p><span class="comment-copy">Sample fix:</span></p><p><strong><span style="color:#0000ff;">[DllImport("dll file name", CallingConvention = CallingConvention.Cdecl)]</span></strong></p><p><br /></p><p><span class="comment-copy">For now, problematic dlls are (add founded ones here):</span></p><p><strong><span style="color:#ff0000;"><span class="comment-copy">sqlite.dll</span></span></strong></p><p><strong><span style="color:#ff0000;">mpviz.dll</span></strong></p><p><strong><span style="color:#ff0000;">fontEngine.dll</span></strong></p><p><br /></p><p><br /></p>