Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113645

QWindowsTheme::queryHighContrast: incorrect parameters passed to SystemParametersInfo for SPI_GETHIGHCONTRAST

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.15.9, 6.4.3, 6.5.0
    • QPA: Windows
    • None
    • Windows
    • e5c136c17 (dev), 443a9fa2b (6.6), 7615efae8 (6.5)

      The QWindowsTheme::queryHighContrast function incorrectly calls booleanSystemParametersInfo(SPI_GETHIGHCONTRAST, false). SPI_GETHIGHCONTRAST does not expect a BOOL, it expects a HIGHCONTRAST.

      I guess this call is probably just always failing and queryHighContrast probably just always returns false because uiParam is wrong (0 instead of sizeof(HIGHCONTRAST)) and HIGHCONTRAST.cbSize is full of stack garbage instead of sizeof(HIGHCONTRAST), but this is based on a static analysis so I do not know what is really happening. I would guess that if Win32 were not failing the call then there would be stack corruption and presumably some complaints about random crashes.

      Documentation for SPI_GETHIGHCONTRAST:
      https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow#spi_gethighcontrast

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            owolff Oliver Wolff
            csnover C S
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes