http://bugs.winehq.org/show_bug.cgi?id=20711
--- Comment #10 from Markus mst@collogia.de 2010-03-21 16:17:20 --- Hm,
please ignore the solution of my last answer. To be more specific: In my initial Crazy Taxi error analysis I thought it was very strange for DirectInput8Create to call a function that could already have been called by the application before. So the idea of the fix was to call the UnInitialize function only if Initialize really succeded (was called by us). Now we have a dilemma in DirectInput8Create:
1. According to Microsoft documentation: ... A thread must call CoUninitialize once for each successful call it has made to the CoInitialize or CoInitializeEx function, including any call that returns S_FALSE ...
2. Crazy Taxi: CoUninitialize must not be called if CoInitialize returned RPC_E_CHANGED_MODE. Otherwise we "close" the applications Initialize call. This conforms to the documentation
3. Flatout Demo: CoUnintialize must be called although CoInitialize returned something else than S_OK or S_FALSE.
Two questions arise:
1. What was the result of CoInitialize?
2. The application depends on our internal UnInitialize call. Do we have other unbalanced calls of Init/CoUnInit in that app?
Best regards.
Markus