x86 Proc WH_MOUSE Mouse Data Incorrect After First To CallNextHook

Discussion in 'Windows 64 Bit' started by Ryan H. Kawicki, May 5, 2010.

  1. We have a 32 bit process that uses several thread only WH_MOUSE callbacks.
    We are in the process of testing the application under 64 bit versions of
    Windows. The issue we are seeing has to do with the mouse data value not
    being correct after the first call to CallNextHookEx.

    Let me start from the beginning.
    There are three thread only WH_MOUSE callbacks installed by the application.
    When the first callback is notified of mouse activity, I check the lParam
    value in memory and notice that either 0x0078 (120) or 0xFF88 (-120) is at
    the end of the structure defined for WH_MOUSE callbacks. No modification is
    made to the structure of data, so CallNextHookEx is called, which in turn
    calls the next installed hook. The lParam is different but the data is the
    same, except for the last four bytes of data. It does not contain the wheel
    delta value. Same situation happens again when passing this value on through
    CallNextHookEx.

    I stepped through our application on a 32 bit version of Windows and noticed
    that the lParam is changing there as well, so I expect this behavior to
    correct, but I expect that the problem lies in what seems to be a copying of
    data between calls to CallNextHookEx.

    I'm not quite sure where the disconnect is at. So the first time
    CallNextHookEx is called in our application, the value is correct, but
    subsequent calls are incorrect. This doesn't seem to be the designed
    behavior for 32 bit application on 64 bit versions of Windows. Is there
    anything in the works to correct this issue? Is there something that we are
    doing wrong in our application? Thanks for any help provided.
     
    Ryan H. Kawicki, May 5, 2010
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.