Ignore:
Timestamp:
Aug 9, 2011, 11:11:56 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: xsystray: Fixed duplicate mouse click notifications.

This was due to the fact that the pointer to the notification data
passed to the client was not fixed up after making a local copy of
this data. As a result it would still point to the shared data cell
that could get already overwritten with a different notificaiton
message by the time it got processed in the client.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/os2/xsystray/apilib/xsystray.c

    r951 r952  
    223223        PVOID pvMemoryPool = (PVOID)pQmsg->mp2;
    224224
    225         // copy NOTIFYDATA and free it
     225        // 1) create a local copy of NOTIFYDATA
    226226        NOTIFYDATA NotifyData = *pNotifyData;
     227        // 2) fix the mp2 pointer in it (which is always to one of u's structs)
     228        NotifyData.mp2 -= (ULONG)pNotifyData;
     229        NotifyData.mp2 += (ULONG)&NotifyData;
     230        // 3) free the original to let it be reused by other processes ASAP
    227231        FreeNotifyDataPtr(pvMemoryPool, pQmsg->hwnd, pNotifyData);
    228232
Note: See TracChangeset for help on using the changeset viewer.