Skip to content

Commit

Permalink
Fix accsessibility for 64bit Windows applications
Browse files Browse the repository at this point in the history
  • Loading branch information
crsib committed Jun 17, 2021
1 parent 6e53bf2 commit e42d7f7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/msw/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3559,10 +3559,14 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
#if wxUSE_ACCESSIBILITY
case WM_GETOBJECT:
{
//WPARAM dwFlags = (WPARAM) (DWORD) wParam;
LPARAM dwObjId = (LPARAM) (DWORD) lParam;

if (dwObjId == (LPARAM)OBJID_CLIENT && GetOrCreateAccessible())
// As per MSDN example - the correct way to compare this values
// is to cast them both to DWORD
// https://docs.microsoft.com/en-us/windows/win32/winauto/reuse-existing-pointers-to-objects
// For the lParam - sign extension happens, as LPARM is a signed integer.
// OBJID_CLIENT is defined as ((LONG)0xFFFFFFFC), we cast it DWORD so no warning is generated
// In the original code, however, it was sign extended as well, as we were comparing againg signed

This comment has been minimized.

Copy link
@Paul-Licameli

Paul-Licameli Jun 17, 2021

against

// 64-bit value.
if ((DWORD)lParam == (DWORD)OBJID_CLIENT && GetOrCreateAccessible())
{
processed = true;
rc.result = LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());
Expand Down

0 comments on commit e42d7f7

Please sign in to comment.