Menu

#2248 commctrl.h: NMPGSCROLL.fwKeys uses wrong type

WSL
closed
None
Bug
fixed
IINR_-_Include_In_Next_Release
False
2018-12-12
2015-01-03
dkl
No

In commctrl.h, structure NMPGSCROLL, the field fwKeys is declared with type BOOL (4 bytes) as documented on MSDN, but it seems this is wrong. According to the Windows SDK and MinGW-w64 headers this field uses WORD type (2 bytes).

Discussion

  • Keith Marshall

    Keith Marshall - 2017-02-14
    • status: unread --> pending
    • Type: Bug --> Support
     
  • Keith Marshall

    Keith Marshall - 2017-02-14

    If MSDN says that the type is BOOL, then we must take their word for it, unless you can point us to an alternative free documentation resource, or can provide an irrefutable test case which depends exclusively on free software tools, (in the strict sense of free, as defined by the FSF), to demonstrate that it must be otherwise.
    Note that Windows SDK is not a free documentation resource, and since the mingw-w64 project is notorious for plagiarizing such non-free sources, we cannot accept their word for it either.

     
  • dkl

    dkl - 2017-02-15

    Ok, I've attached a test case demonstrating a pager control whose scrolling mechanism only works after changing the fwKeys field to WORD and packing the whole NMPGSCROLL structure (just change #if 0 to #if 1).

    As another reference, I looked at Wine 2.1's commctrl.h: It uses the "good" version (WORD and packed).

     
  • Keith Marshall

    Keith Marshall - 2018-11-23
    • status: pending --> closed
    • assigned_to: Keith Marshall
    • Type: Support --> Bug
    • Resolution: none --> fixed
    • Category: Unknown --> IINR_-_Include_In_Next_Release
     
  • Keith Marshall

    Keith Marshall - 2018-11-23

    Thanks for the test case. I will not look at Microsoft headers; nor will I look at equivalent mingw-w64 or wine headers, because both projects are notorious for their blatant disregard for Microsoft's EULA. However, on the basis of the evidence of your test case, I will take your word for it: thus, I've committed https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/commits/2dcc5878a9edc9a84837638af134f4398a2730d9

    BTW, there is a bug in your test case, which causes it to fail with a "Failed to create pager" diagnostic, when I try to run it on WinXP; the problem is that you've neglected to call InitCommonControlsEx() to register the ICC_PAGESCROLLER_CLASS — a mandatory requirement, according to Microsoft's current online docs. I've no idea why this bug isn't caught on Win7.

     
    👍
    1
  • Keith Marshall

    Keith Marshall - 2018-12-12

    FWIW, after a protracted disappearance — yielding HTTP error 404 — of MSDN documentation for the NMPGSCROLL structured data type, it has now reappeared on docs.microsoft.com, with the fwKeys field now documented to be of type WORD. There now seems to be no doubt that this was the correct resolution.