Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-18022

SystemParametersInfo SPI_GETNONCLIENTMETRICS fails when sizeof(NONCLIENTMETRICS) exceeds 340

    XMLWordPrintable

Details

    • Bug
    • Resolution: Postponed
    • Major
    • None
    • None
    • None

    Description

      The function SystemParametersInfo with suboption SPI_GETNONCLIENTMETRICS will fail when the cbSize parameter and uiParam exceed 340.  These parameters are usually set to sizeof(NONCLIENTMETRICS) which equals to 340 when WINVER < 0x0600 (Vista).  On applications compiled with WINVER > 0x0600 (the default is 0x0A00 in newer MSVC versions) the NONCLIENTMETRICS structure gains an additional 4 bytes due to the newly added iPaddedBorderWidth member needed to support Aero themes.  This causes ReactOS to reject these application's SPI_GETNONCLIENTMETRICS requests, returning FALSE (failure) regardless if the applications use the new field.

      The proposed fix would be to whitelist the Vista+ sizeof(NONCLIENTMETRICS) which is 344 and set the iPaddedBorderWidth value to 0 by default and 4 for Vista+ compatibility profiles.

      Related MSDN page: https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-nonclientmetricsa

      Attachments

        1. 0001-USER32-Hack-to-make-SystemParametersInfoA-not-fail-o.patch
          2 kB
          hbelusca

        Issue Links

          Activity

            People

              Unassigned Unassigned
              -Tom- -Tom-
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: