diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-11-28 20:12:12 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-12-02 13:18:03 +0100 |
commit | db214684057e3ff2fa32d57c00507309dd6c24d6 (patch) | |
tree | db8a093c35d69d157e170840d0e7ce6a45e9f660 /vcl | |
parent | fefacbd92f4e3355ecd04841b8eacc75a4a67223 (diff) |
vcl: fix crashes when retrieving objects for MSAA
The ImplHandleGetObject() function modifies the Application Settings and
must take the SolarMutex for this; otherwise we get crashes when another
thread calls StyleSettings::GetPersonaHeader() during some unoapi test.
Also fix another HWND to long cast; use LRESULT which is Win32 for intptr_t.
Change-Id: I5580f88ed0a8e9955697655ace94584e2307982d
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 8ee2cae0a3c4..913d53967681 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5484,7 +5484,8 @@ static void ImplHandleIMENotify( HWND hWnd, WPARAM wParam ) // ----------------------------------------------------------------------- -static bool ImplHandleGetObject( HWND hWnd, LPARAM lParam, WPARAM wParam, long &nRet ) +static bool +ImplHandleGetObject(HWND hWnd, LPARAM lParam, WPARAM wParam, LRESULT & nRet) { // IA2 should be enabled automatically AllSettings aSettings = Application::GetSettings(); @@ -5514,7 +5515,8 @@ static bool ImplHandleGetObject( HWND hWnd, LPARAM lParam, WPARAM wParam, long & // mhOnSetTitleWnd not set to reasonable value anywhere... if ( lParam == OBJID_CLIENT ) { - nRet = xMSAA->getAccObjectPtr( (long)hWnd, lParam, wParam ); + nRet = xMSAA->getAccObjectPtr( + reinterpret_cast<sal_Int64>(hWnd), lParam, wParam); if( nRet != 0 ) return true; } @@ -6053,12 +6055,12 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP break; case WM_GETOBJECT: - long nRet; + ImplSalYieldMutexAcquireWithWait(); if ( ImplHandleGetObject( hWnd, lParam, wParam, nRet ) ) { rDef = false; - return (HRESULT) nRet; } + ImplSalYieldMutexRelease(); break; case WM_APPCOMMAND: |