http://bugs.winehq.org/show_bug.cgi?id=30839
--- Comment #5 from Dmitry Timoshkov dmitry@baikal.ru 2012-06-13 11:07:29 CDT --- (In reply to comment #4)
str1 = SysAllocStringLen(..., 20); str2 = SysAllocStringLen(..., 20); SysFreeString(str1); SysFreeString(str2);
DoSomethingNotAllocatingNewBSTRsWithStrings(str1, str2);
is something guaranteed to work. Obviously it's a trivial example, but if your app really works reasonably well on Windows, it must follow another pattern that happens to work. Without understanding it, I don't see how we can fix the problem.
I'll give it another try and see if I can gather more details on what is going on.