From 75bec8093ddba779001a4a0ba4b68ab3057c1258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Mon, 28 Mar 2011 09:58:28 +0200 Subject: [PATCH] Fixed regression where AT client did not always announce stuff properly. This fixes a regression that was created by 75e478abdf336bbdc1b00e2ca4f5293d5455a0cb. That broke accessibility on 64 bit windows, since lParam can both be 0x00000000fffffffc and 0xfffffffffffffffc. However, MSDN explicitly says that lParam should be casted to a DWORD, which would result in (an unsigned) 0xfffffffc in both cases. This can then be compared to OBJID_CLIENT (defined to ((LONG)0xFFFFFFFC). Reviewed-by: Prasanth Ullattil (cherry picked from commit 504941bc50234c225f162192491815bc4d6c38cf) --- src/gui/kernel/qapplication_win.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 72a05afbd0..63e2319b3e 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -2372,8 +2372,13 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa #ifndef QT_NO_ACCESSIBILITY case WM_GETOBJECT: { + /* On Win64, lParam can be 0x00000000fffffffc or 0xfffffffffffffffc (!), + but MSDN says that lParam should be converted to a DWORD + before its compared against OBJID_CLIENT + */ + const DWORD dwObjId = (DWORD)lParam; // Ignoring all requests while starting up - if (QApplication::startingUp() || QApplication::closingDown() || lParam != (LPARAM)OBJID_CLIENT) { + if (QApplication::startingUp() || QApplication::closingDown() || dwObjId != OBJID_CLIENT) { result = false; break; }