summaryrefslogtreecommitdiff
path: root/vcl/win/source/window
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-11-28 20:12:12 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-03 20:40:59 +0100
commitffc77f555aee05d5abde16be0265fac877cc6ca3 (patch)
tree93421113da682200c59a459043b4429adc64a34f /vcl/win/source/window
parentdf51860c26dcc6cf8fa24d2795be05e903d22127 (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 (cherry picked from commit db214684057e3ff2fa32d57c00507309dd6c24d6)
Diffstat (limited to 'vcl/win/source/window')
-rw-r--r--vcl/win/source/window/salframe.cxx10
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: