https://bugs.winehq.org/show_bug.cgi?id=53766
--- Comment #5 from Jason Millard jsm174@gmail.com --- This is the method that ultimately gets called: (which has worked for the past 20 years)
STDMETHODIMP ScriptGlobalTable::GetBalls(LPSAFEARRAY *pVal) { if (!pVal || !g_pplayer) return E_POINTER;
CComSafeArray<VARIANT> balls((ULONG)g_pplayer->m_vball.size());
for (size_t i = 0; i < g_pplayer->m_vball.size(); ++i) { BallEx *pballex = g_pplayer->m_vball[i]->m_pballex;
if (!pballex) return E_POINTER;
CComVariant v = static_cast<IDispatch*>(pballex); v.Detach(&balls[(int)i]); }
*pVal = balls.Detach();
return S_OK; }