Commit graph

138 commits

Author SHA1 Message Date
Joachim Henze 3b78fdde21 [0.4.9][NTUSER] co_UserDestroyWindow: Validate window before destroying it (#5054)
Prevent the window from being destroyed twice
fixes CORE-18821 'WIN32K BSOD 0x1E when opening Build menu in AVR Studio 4.19'
port of 0.4.15-dev-5938-g 77d4653164

And port back also some unrelated formatting improvements,
and kill a block of code that was commented out in all branches,
and was not x64 compatible in 0.4.7/0.4.8, and therefore was a diff already anyway.
2023-06-10 12:40:38 +02:00
Joachim Henze c13c6e1713 [0.4.9][REACTOS] Backport "http://www.reactos" -> "https://reactos" and readme.txt
by porting back:
0.4.15-dev-5669-g 09dde2cff9 [REACTOS] "http://www.reactos" -> "https://reactos" (#5043)
0.4.15-dev-3250-g da4d0545eb [BOOTDATA] readme.txt: Trivial correction Seven->7 (#4014)
0.4.15-dev-2940-g a559d830b5 [BOOTDATA] Update readme.txt
0.4.14-dev-1550-g b7503df6ed [BOOTDATA] readme.txt: Update now-redirected 'www.reactos.org' URLs (#2633)
2023-03-19 12:41:27 +01:00
Joachim Henze fa46dac201 [0.4.9] Update Scrollbar code to state of master 2023-March-12
by porting back:
0.4.15-dev-5784-g 2aea4ab945 [NTUSER] Scrollbar.c pure whitespace fixes
0.4.15-dev-5680-g 5ad5737370 CORE-18050 [NTUSER] Delete temporary workarounds in co_IntSetScrollInfo() (#4985)
0.4.15-dev-5355-g 0484beb04b CORE-18593 [NTUSER] Don't redraw scrollbar if it is hidden command prompt (#4849)
0.4.15-dev-4492-g 03422451b3 Add '\n' to debug logs (partially, only the scrollbar.c part)
0.4.15-dev-3875-g 977c129f33 CORE-18048 [USER32] SetScrollPos should not bypass UserApiHook (#4372)
0.4.15-dev-3849-g fd28a69de6 CORE-17780 [WIN32SS] Store the scrollbar theming enabled flag in the scrollbar (#4367)
0.4.15-dev-3175-g 222acf5a3e CORE-17777 [NTUSER] Scrollbar.c, Avoid potential out-of-bounds-accesses in co_IntSetScrollInfo()
0.4.15-dev-3174-g dda9c3979e CORE-17769 'Rapps Listview manual resize may erroneously not draw the triangles sometimes'
0.4.15-dev-3147-g 3bf7e3ac13 CORE-17754 and CORE-17755 [NTUSER] Improve Themed Scrollbars by Minimizing Updates (#3953)
0.4.15-dev-3086-g 236649c626 CORE-16375 [UXTHEME][NTUSER] Fix flashing of scrollbar when scrolling (#3868)
0.4.15-dev-2375-g ffea5152e6 [WIN32SS][NTUSER] Fix an integer underflow within scrollbar info setting
0.4.14-dev-1134-g 00adb1a3f9 [WIN32SS] Improve Drawing Scrollbars
- CORE-14755 fixed, flashing scrollbar triangles (we know 131 affected apps just from rapps!)
- CORE-13931 fixed, FamiTracker invisible about-dlg
- CORE-14685 improves a bit, but is not entirely fixed
- CORE-11561 'Notepad scrollbars problem' fixed

This will also speed up NSIS installers that display their file-copy-progress by
a self-scrolling listview.
2023-03-12 11:04:25 +01:00
Joachim Henze 9047554362 [0.4.9][NTUSER] Port back minor improvements
0.4.15-dev-3341-g 4bc95812fd defwnd.c Mark default as unreachable.
0.4.15-dev-316-g 938df97b54 nonclient.c NC_IconForWindow(): Remove redundant if() (#2842)
and:
-defwnd.c: delete a malformed TRACE() which had a format string, but no argument.
-sysparams.c: A single line from 0.4.14-dev-676-g 9ce12f0b4c avoiding a wcslen() call in SpiLoadTimeOut()
2023-02-25 03:43:11 +01:00
Joachim Henze 96db0cd726 [0.4.9][NTGDI] Check if face->charmap is not zero before accessing its encoding (#4390)
Prevents a BSOD 0x1E upon dereference.
CORE-18091 CORE-18558

By partially porting back:
0.4.15-dev-5587-ga999c43 a999c43746
and take also some cosmetic changes from master head, like EOL-whitespace-removal.
2023-01-21 15:01:29 +01:00
Joachim Henze f438d026fa [0.4.9][NTUSER] Fix zombie window created by CTRL+ALT+DEL (#4935) CORE-18258
Based on patch by I_Kill_Bugs.
Fixes the regression which was introduced to master by 0.4.15-dev-1126-g 58b0558f94

fix picked from 0.4.15-dev-5532-g ca9ded7af8
2022-12-26 01:46:49 +01:00
Joachim Henze 87ce8a9a83 [0.4.9][NTUSER][USER32][OSK] Initial support of WS_EX_NOACTIVATE flag (#4731)
WS_EX_NOACTIVATE flag forbids the window to be activated
fix picked from 0.4.15-dev-5137-g 826bd41d88 (1 of 3 commits for CORE-18417)
My reason for picking it is that it fixes CORE-13257 'Reboot leaving Evernote 5.9.8 in tray causes WIN32K BSOD 0x50'
I also had to pick together with it the
0.4.15-dev-5491-g 1fbed1710e to prevent it from introducing (+2 failures in user32:msg_focus) unittests.
----------------
The above patch allows/encourages us to pick then also:
0.4.15-dev-5492-g 47f3a4e144 [OSK] Delete WS_EX_NOACTIVATE workaround code
(which referenced CORE-18528, but is not fixing this minor GUI glitch yet, it just removes workaround-code that is no longer needed,
I just mention the ticket here, because the commit on master did that as well)
----------------
----------------
The following 2 things were small *unrelated* improvements nearby, and I decided to take them with me:
0.4.15-dev-4323-g 9f5cde9cbe [WIN32K:NTUSER] window.c Remove broken assert in NtUserCreateWindowEx. CORE-18123 fixed
and
a tiny part of 0.4.15-dev-3476-g 55a1c29341 [WIN32K] appswitch.c: delete unused func DWORD wtodw(const WCHAR *psz)
----------------
and also backport a few whitespace improvements in the files touched.
2022-12-24 02:46:18 +01:00
Joachim Henze 2a30910de8 [0.4.9][NTUSER] Fix Toolbar re-painting when Rebar parent has been altered (#4380) CORE-12342
Fixes:
CORE-12342 '7zip is not drawing some of its controls until forcing a repaint'
CORE-8734 '[WIN32SS] dxdiag exposes a tabsheet redraw problem'
...
and many other duplicates in JIRA.

If a Rebar window is altered by calling either ShowWindow() or UpdateWindow()
then we were only updating the parent and omitting their children windows.

This is closer to the behavior of the very very old SVN r27394 == git f1a7f30887 .
And therefore intentionally excludes parts of SVN r27403 == git e2651a0dbc .

The bots have no complaints about it:
KVM https://reactos.org/testman/compare.php?ids=81266,81290
VBox https://reactos.org/testman/compare.php?ids=81267,81291

fix picked from 0.4.15-dev-3885-g ea7c14919e
2022-12-07 02:14:01 +01:00
Joachim Henze c9ddd05570 [0.4.9][NTGDI] Commit minimized Flip_Fix_9.patch
flip_fix_9.patch fixes:
CORE-16984 " 'SPINA Thrulg' / 'SPINA Thyr' / 'Sim Thyr' have images flipped"
CORE-17194 "StretchDIBits test" isn't work correctly"
           "Output of 'Project 3 Test'"
CORE-14701 "DVDStyler 3.0.4 transparent toolbars"
CORE-14701 "DVDStyler 3.0.4 erroneously black around icons of welcome-dlg"
CORE-14671 "'Peazip' shows icons in buttons and menubar vertically flipped"
           "Double Commander shoes icons flipped in buttons, menubar, listview and the treeview"
CORE-13273 "Welcome to Lazarus" icon shows flipped
CORE-13026 "'CudaText app' icon shows flipped"
CORE-18653 The dibobj.c part also fixes a BSOD 0x1E nullptr deref in Win32K when running the setup of 'Auslogics Disk Defrag Pro 4.9.4.0' in releases/0.4.7 to releases/0.4.13

Not all of those are duplicates, although they appear to be at first glance.
It affects different controls and some of those tickets do have different 'guilty revs' than others.

The patch does consist of 2 parts:

1.) win32ss/gdi/ntgdi/dibobj.c
This one is the most clean part of it, that addresses most of the flipping issues now, and the BSOD 0x1E.

2.) The hack in comctl32.h redefining the version:
We used that in the past to appease some, but not all of the issues listed above.
But it does hide additional issues, e.g. in DvDStyler, therefore we seem to still need that appeasement even today.
Most likely it would make sense to aim to avoid this part in the future.
part 2.) was committed as first appeasement on its own already into
0.4.14-RC-24-g 198b61e
0.4.13-RC-7-g 67211fa
0.4.12-RC-5-g 8449527
0.4.11-RC-16-g b906163
0.4.10-RC-7-g f1e80fe
0.4.9-RC-34-g 9d758ae
Interestingly this part is not needed for releases/0.4.7.
It became necessary for all newer releases with the COMCTL32 Winesyncs during 0.4.8-dev' and 0.4.9-dev'ing and their massive button.c-changes.

We also created a summary of manual test-results:
https://jira.reactos.org/browse/CORE-17415?focusedCommentId=126668&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-126668

If you read this comment via git blame and your goal is to get rid of the hack in comctl32.h, I would highly recommend
to redo the tests of that testing table, and if that is asked too much, then please test at least the following cases:
CORE-14701 "DVDStyler 3.0.4 transparent toolbars"
CORE-14701 "DVDStyler 3.0.4 erroneously black around icons of welcome-dlg"
           "DVDStyler 3.0.4 erroneously black/transparent within comboboxes of properties of VMGM menu"
and try to add what might be needed to fix them, and double-check again:
           "DoubleCommander optionsDlg the most complex testcase, contains flip-prone icons in treeview, listview, menubar, buttons, statics". Only some of its flipped icons were impacted by the comctl32.h change before.

fix is a squashed pick from
0.4.15-dev-1603-g 232c45fcd7
0.4.15-dev-5396-g 9c5bb096bc [COMCTL32] partial revert of the upper commit
2022-11-22 16:20:37 +01:00
Joachim Henze 10b4abf5a8 [0.4.9][WIN32SS] Fix RLE4 bitmap decoding (#1188) CORE-10553
fix picked from 0.4.12-dev-189-g 968c8f37f1

It fixes:
CORE-10553 'WinRar SFX have corrupted image'
CORE-11399 'Microsoft paint (from XPSP3) does not show bitmaps on the tools'

Please note, that MS mspaint.exe does not start in all older rls-branches yet for unrelated reasons,
it did start and render properly in releases/0.4.11, but does not start in releases/0.4.7 yet.
Still I marked the ticket CORE-11399 as resolved in all of them as that has nothing to do with the RLE stuff.
The WinRAR SFX worked properly in all of them.
2022-10-26 11:45:14 +02:00
Joachim Henze 92390a4c4a [0.4.9][NTUSER] Fix taskbar panes activation (#2046) (#3294) (#3697) (#3700), [SHELL32] (#4800)
This is a squashed backport of the following commits:
0.4.13-RC-53-g 4f628f6b16 (partial pick of shell32-changes for Miranda CORE-14439 & Winamp CORE-13584, explorer left out)
0.4.14-dev-369-g 141cf04239 (#2046) NTUSER
0.4.15-dev-1126-g 58b0558f94 (#3294) NTUSER
0.4.15-dev-2618-g 32b0cf6fc6 (#3697) NTUSER
0.4.15-dev-2621-g 59d4c11203 (#3700) NTUSER
0.4.15-dev-5242-g e6fb0e0c25 (#4800) Cleanup

brings us closer to releases/0.4.14

In the older branches it will fix the following bugs (or prevents introducing them):
CORE-13584 'Winamp 5.666 erroneously has a secret tab shown in taskbar'
CORE-14380 'Effective File Search 6.8.1 when you open up the app via desktop link there is no pane in taskbar'
CORE-14439 'Miranda IM 0.10.21 snap-to-monitor-border-feature brings ros to halt'
CORE-15655 'Click-N-Type Virtual Keyboard 3.03.0412 has no taskbar pane'
CORE-15669 'DVD Write Now 1.5.12 SP2 setup has no taskbar pane'
CORE-15716 'Photofiltr 7.2.1 has no taskbar pane'
CORE-15731 'Java JRE 6u45 setup, last page of setup has no taskbar pane'
CORE-16030 'Moo0 Audio Recorder - the taskbar icon does not appear'
(CORE-17330 Regression, many installers that should have only 1 taskbar pane, now have 2 of them erroneously)
2022-10-22 22:32:28 +02:00
Joachim Henze cc27dfd4bc [0.4.9][NTGDI] 'otm' is always non-NULL in epilogue CORE-16993
is a small optimization picked from 0.4.14-dev-108-g 1bf982ff88
otm is checked for NULL already a few lines before in that function, and is not touched
anymore in between the two locations. Tiny bit shorter+smaller now,
and might satisfy also some static code-analysis.
The origin of checking it twice for NULL dates back into the pre-0.4.7-era of ros.
2022-10-10 02:34:14 +02:00
Joachim Henze efaef5832c [0.4.9][WIN32SS][RTL] Fix regression CORE-16769 + BSOD 0x50 CORE-13907
The main motivation to port all that back is to get rid of Win32K-BSODs 0x50 like CORE-13907
that could be triggered by user-mode-applications.
Technical reason was CORE-14857 "RtlImageNtHeaderEx needs SEH" and issues with hooks+callbacks.
All other tickets mentioned in here were regressions that we experienced on the long
journey towards perfecting the fixes on master head, and those were not happening yet in the older builds,
so they are mentioned in here only to allow tracking where that code went into.

Thanks to Jim Tabor, Mark Jansen & Thomas Faber
By squashed backmerge of the following commits:
0.4.15-dev-3440-g a89844f740
0.4.15-dev-3430-g 9cff384c22
0.4.14-dev-1287-g 568b6d0558
0.4.14-dev-1255-g 177ae91bf6
0.4.14-dev-1241-g 915a5764a9
0.4.14-dev-1240-g d8add40e89
0.4.14-dev-1002-g feb7df42b4

JIRA-tickets: CORE-13907, CORE-16769, CORE-14857, CORE-17856, CORE-17857, partially CORE-13019.
We also had some more dupes of CORE-13907 in JIRA, but I linked all of them (transitively)
towards the initial report, and resolved them without setting a fixVer for them.

In more detail:
--------------
[USER32] Fix BSOD 0x50 in 'WineVDM + Castle Of Winds' CORE-17856 CORE-17857

CORE-17856 BSOD 0x50 when starting Castle of the Winds second time, with WineVDM
CORE-17857 BSOD 0x50 on shutdown after closing Castle of the Winds with WineVDM

0.4.15-dev-3430-g 9cff384c22
0.4.15-dev-3440-g a89844f740
--------------
[NTUSER] Fix Strings and Format to Hooks

Allocate heap instead of data segment to be used for callbacks on user side.
Move and correct initial hook call out setup. Use it in more than one hook call.

This fixes issues with strings out of alignment and use of kernel pointers.

See CORE-13907 (HXD-portable BSOD) and CORE-16769 (HXD-portable exception)

Small wow update.

cherry picked from commit 0.4.14-dev-1287-g 568b6d0558
--------------
[RTL] Introduce RtlpImageNtHeader,
which implements the required functionality.
ntdll and ntoskrnl now have a wrapper for this, with SEH.
This protects the function against malformed / bad images,
whilst still being able to use the code in freeldr et al.
Idea from Thomas.
CORE-14857

cherry picked from commit 0.4.14-dev-1255-g 177ae91bf6
--------------
[WIN32SS] Form Sanity to Hook Callbacks

Fix WH_CALLWNDPROC/RET data to user hook calls.
Helps with CORE-13907 "(HXD-portable BSOD)"
Fixes the logging of "(win32ss/user/ntuser/callback.c:748) err: Failure to make Callback! Status 0xc00000fd" within CORE-13019, but not the whole ticket.

cherry picked from commit 0.4.14-dev-1241-g 915a5764a9
--------------
[USER32] Fix null return.

See CORE-16769 "HxD 1.7.7.0 portable unhandled exception"

cherry picked from commit 0.4.14-dev-1240-g d8add40e89
--------------
[WIN32SS] Fix a typo in dbg print

cherry picked from commit 0.4.14-dev-1002-g feb7df42b4
2022-03-17 14:02:17 +01:00
Joachim Henze 1711b13f21 [0.4.9][USER32][NTUSER][3DTEXT] Squashed backport
[USER32] GetQueueStatus() should not return 0 when passing QS_ALLINPUT flag that includes QS_RAWINPUT (#4115)

GTK applications call GetQueueStatus(QS_ALLINPUT), where QS_ALLINPUT
specifies the QS_RAWINPUT flag as well, when these are compiled for
Windows XP+, and they expect the call to succeed on this platform.

On one side, ReactOS does not currently support this flag at all, but
since it claims to be XP/2003-compatible, applications may implicitly
expect the flag to be supported by GetQueueStatus() and the function
*NOT* failing when this flag is set.
(Later GTK apps don't care and just call GetQueueStatus(QS_ALLINPUT)
that includes QS_RAWINPUT, and therefore would fail as well on e.g.
Windows 2000...)

Otherwise, an observable effect is that some versions of libgdk-win32-2.0.0.dll
enter into an infinite loop when calling GetQueueStatus(QS_ALLINPUT),
since this call always failed on ReactOS.

On the other side, however, we should honour our winetests that handle
the presence of the QS_RAWINPUT flag and behave differently accordingly.
But since we do not support QS_RAWINPUT yet, we should keep their old
behaviour where QS_RAWINPUT is unused.

Thus, in order to accomodate both sides, we don't fail the GetQueueStatus()
call, but just set the ERROR_INVALID_FLAGS last error and continue it.

This fixes:
'All user32:TrackMouseEvent tests'
CORE-15686: Gimp 2.8.22 from rapps hangs after startup with 90%-100% CPU usage
and many dupes of that ticket like:
CORE-17551: Ardour hangs at the first start (GTK2 issue)
CORE-15151: newer "Inkscape 0.92.3" is unusable due to WIN32SS message queue lockup
CORE-14086: RawTherapee 5.0-r1-gtk2 fails to start (using 100% CPU)
CORE-11850: Geany 1.28 hangs with endless MsqSendMessage timed out
CORE-8475: Wireshark hangs after launch

It will also slightly appease, but not entirely fix:
CORE-8217: 3D Text ScreenSaver freezes system

Fix picked from 0.4.15-dev-3407-g 9c4397afdf
---------------------
[NTUSER] Do not remove message from the Msg Queue if it is not for us. (#4129)

CORE-8217 This part of the fix keeps the buttons working (Cancel/Ok/top-Right-X) even under high CPU-load
Patch from 'I_Kill_Bugs' contributor.

Fix picked from 0.4.15-dev-3499-g 7d1b50394b
---------------------
[3DTEXT] Fix 3dtext.scr using near 100% CPU (#4125) CORE-17866, CORE-8217

Fix picked from 0.4.15-dev-3443-g 5c9fdcb1de
2022-02-08 13:05:35 +01:00
Joachim Henze 21d7f30efc [0.4.9][WIN32SS] Remove an ambiguous assert entirely CORE-16738
It popped up very reliably when performing git-clone of the ros sources
while having the taskmgr open in the processes-tab.
Or when building 'ninja bootcd -j1' while having the taskmgr open in the processes-tab.

It is always possible to ignore it and then continue using ros for days without
noticing any side effects.
James Tabor judged the assert to have a "questionable logic".
Giannis who once added it, was also ok with commenting it.

His words:
This assertion isn't something fatal,
the worst thing that can happen from continuing on it would be
to make the thread get awake more times than it should.

The assert was once added by SVN r63880 == git 9ad857369a

Fix picked from:
0.4.14-dev-1519-g 87f6c82d85 commenting 2020-04-21
0.4.15-dev-3780-g bf16435303 removal 2022-02-05
2022-02-05 01:58:16 +01:00
Joachim Henze c48df9a9f5 [0.4.9][WIN32SS] Fix Mask for Draw Frame States CORE-8808
Fixes drawing of caption bar buttons (min/max/close in Mozilla Firefox titlebar when its menubar is disabled).
See CORE-8808.

The fix is a partial port of 0.4.14-dev-1314-g acf135d16d
I left out all changes to the logging and took only the essence of this patch.
2022-01-30 22:50:18 +01:00
Joachim Henze 4532e1cd5e [0.4.9][PROGMAN][USER32][SHELL32] Do not use LoadLibraryEx() NT6+ flags (#3152) CORE-12004
LOAD_LIBRARY_AS_IMAGE_RESOURCE and LOAD_LIBRARY_SEARCH_SYSTEM32 are Vista+

This fixes some blurry icons in systray when 2k3sp2 kernel32.dll is used in ros CORE-12004
That part in user32 was a regression of SVN r71609 == git a44dfe6c76
While we are at it we do fix some other modules as well, that used those NT6+flags.

The fix was picked from 0.4.15-dev-788-g a04831677e
--------
That second part in SHELL32 regressed even earlier by
SVN r51768 == git 6ced137ce2
and was fixed on master by chance when the PickIconDlg() was overhauled entirely via
git 0.4.10-dev-106-g 222534a5a2 . But that is not the solution I ported back today.
2022-01-15 12:50:02 +01:00
Joachim Henze af3e03aeef [0.4.9][WIN32K] Revert NtGdiStretchDIBitsInternal to Previous Logic (#3774)
Fixes gdi32:dib / gdi32:bitmap tests and

CORE-16236 "SIMS graphics", which regressed by
SVN 51005 == git 2bbd8711a7

Thanks to the patches author Doug Lyons.

It also fixed
CORE-16621 Kompozer 0.7.10 from rapps, exe does not show an icon, but does on 2k3sp2

fix picked from 0.4.15-dev-2850-g 847b037fe9
--------------
By taking the above, we also have to pick its addendum
[WIN32K] Fix 'use after free' in NtGdiStretchDIBitsInternal #4122 CORE-17861

0.4.15-dev-3420-g b538b9abb8
to avoid introducing another bug:
CORE-17861 MS Visual Studio 2010 Pro Fatal System Error 0x00000050
--------------
[WIN32K] Don't trust the BITMAPINFOHEADER size

This is not entirely correct yet, but less wrong than before and fixes
CORE-16031 Moo0 Audio Recorder - ReactOS icons are not displayed in the system tray
fix picked from 0.4.14-dev-848-g 53c9a6deaa
2022-01-15 01:30:38 +01:00
Joachim Henze e2de354688 [0.4.9][WIN32K] Revert incorrect part of R50928 for RealizePalette. (#3678)
Revert part of SVN R50928 that causes Durak card suites to have wrong colors.
SVN r50928 == git 5de8339cd1

JIRA issue: CORE-13748 <= Durak Example
JIRA issue: CORE-16510 <= GDIProg Example

The idea was picked from 0.4.15-dev-2735-g c7954134d0
but I was too shy to port the recurrently spamming and slowing DPRINT1 back that far.
Spamming on master should be enough to improve here later.
2022-01-12 06:01:01 +01:00
Joachim Henze 175fa27755 [0.4.9][NTUSER][USER32] Tracking menu CORE-17338 (#4048), [EXPLORER] Send WM_POPUPSYSTEMMENU asynchronously (#4047) CORE-16353
This prevents the tracking menu from erroneously closing itself right after it was opened in some cases.
Fixes CORE-17338 which got unhidden by 0.4.15-dev-1126-g 58b0558f94
And fixes CORE-15760 which got unhidden by SVN r74972 == git 19dd22d422

Since both symptoms look very similar but the unhiding revisions did differ,
that could mean we do have some kind of race condition here.
I guess this fix is more like a workaround.

2 Fixes picked:
0.4.15-dev-3313-g 6417b2323d [NTUSER][USER32] Workaround tracking menu on CORE-17338 CORE-15760 (#4048)
to prevent the menu from auto-closing

and
0.4.15-dev-3297-g 037c744eb1 [EXPLORER] Send WM_POPUPSYSTEMMENU asynchronously CORE-16353 (#4047)
to make the taskbar button turn into pressed state when the menu opens
2022-01-10 07:18:41 +01:00
Joachim Henze 33ebdeff91 [0.4.9][NTGDI] Fix potential BSOD 0x1E CORE-17626
in CreateDIBPalette() when passing invalid arguments to CreateDIBSection.
This could be triggered by using the broken test-application "GDIProg".

After this patch not only the BSOD is fixed but also the app does
properly start up, like it is the case on 2k3sp2.

The problem was unhidden by the innocent and unrelated 0.4.12-dev-266-g 8ab3652c01
I was not able to trigger the bug in releases older than 0.4.12,
but it is rather obvious that the mentioned revision is not really 'guilty', which
is why I will port the fix back further into releases even older than 0.4.12 as well.

Thanks to the patches author Doug Lyons.

a squashed port of:
0.4.15-dev-2734-g 514147776a (fixes the BSOD)
0.4.15-dev-2775-g c596fd3ef6 (improvement #3758)
0.4.15-dev-2776-g 4130f0b1c5 (compilation fix)
and some white-space tweaking that was committed after those.
2021-11-15 12:08:14 +01:00
Joachim Henze fab997520e [0.4.9][WIN32SS] Fix BSOD 0x1E nullptr deref via Git-bash CORE-16586
Thanks to the patches author Doug Lyons!

fix picked from 0.4.15-dev-1457-g 870aa1254f
and the whitespace addendum 0.4.15-dev-1458-g 449a341786
2021-01-16 14:23:49 +01:00
Joachim Henze 9be0765be1 [0.4.9][WIN32SS] Fix regression CORE-15558 Font enumeration
Fixes CORE-15558 "AbiWord font listbox should display a specific font only once, but displays each of them many times instead"
which regressed by SVN r75491 == 0.4.7-dev-32-g d10c0ec112

by porting back the commits:
0.4.12-dev-320-g 6e4e5a004c
and
0.4.13-dev-107-g ae8417fd90 to prevent introducing another regression CORE_15785 with the initial fix.
and some more addendums to prevent introducing regression CORE_15755

I verified afterwards that all 3 issues: CORE-15558, CORE_15785 and CORE_15755 are in fixed state.

Actually I don't really like the resulting code due to the qsort() that it introduces into
win32ss/gdi/gdi32/objects/font.c
We did not need that at all before 0.4.7-dev-32-g d10c0ec112
In case that qsort() would ever reveal any new trouble like reduced performance or stack overflow,
we should structurally revert all that context to 0.4.7-dev-31 instead.
IntEnumFontFamilies() is called immediately upon process initialization for many applications and the qsorted-list is *huge*,
so this indeed could be relevant for performance.
2020-12-31 22:10:01 +01:00
Joachim Henze 743f12cdc8 [0.4.9][WIN32K:NTUSER] Properly fix IntSendChildNCPaint() & IntLinkWindow()
Hack has been introduced in IntSendChildNCPaint() in r73532 == 6d7fcc4
to attempt to pseudo-fix CORE-12071 and CORE-12085 while breaking other stuff,
amongst which CORE-14763 is one of the latest manifestations, and re-enable the correct original code.

This fixes painting hangs under diverse situations,
while CORE-12071 and CORE-12085 remain fixed.

When it was hanging like CORE-14763, we could not even ACPI shutdown anymore.

by porting back:
0.4.10-dev-324-g 25004bb5b4
0.4.10-dev-323-g ee0511b49d
0.4.10-dev-322-g 4d057cf626
2020-12-23 02:21:19 +01:00
Joachim Henze 1c107f80cf [0.4.9][WIN32K][NTUSER] Tiny codestyle fix to NtUserLockWindowUpdate (#1066)
Fix indentation (inconsistent with the rest of the file) and return actual BOOL.
picked from 0.4.11-dev-838-g 62ec69278d
2020-12-21 10:13:09 +01:00
Joachim Henze 0758a5d2c2 [0.4.9][NTUSER] Silence a noisy trace
picked just that part of 0.4.12-dev-121-g3ec7b16
2020-12-21 10:01:16 +01:00
Joachim Henze 8bfb16ba0f [0.4.9][WIN32K] Fix DBG_PRINT macro.
picked from 0.4.10-dev-215-g 9d3d5e464d
2020-12-21 09:25:04 +01:00
Joachim Henze 16f9af86b5 [0.4.9][NTOS][USERSRV] Silence noisy debug output.
picked from 0.4.13-dev-82-g f5471b7b4b
2020-12-21 08:52:41 +01:00
Joachim Henze 6cfc934c20 [0.4.9][COMCTL32][WIN32SS] Fix multiple scrollbar redraw issues
This fixes:
- CORE-15911 "Scrollbars do not disappear when Maximizing and not needed"
- CORE-10617 "ListView corrupt scrollbar upon resizing the column-header"

and fixes regressions:
- CORE-15429 "Uninitialized scrollbars in 'My Computer' permanently drawn"
- CORE-16466 "Uninitialized scrollbars in 'My Computer' do still flash up for a fraction of a second before getting overpainted"
both unhidden by SVN r75735 == git 0.4.7-dev-168-g 6af37fd54e

by porting back the commits:
0.4.14-dev-312-g b931f643e3
0.4.13-dev-535-g 1158c24194
2020-12-20 06:42:31 +01:00
Joachim Henze c0995eebd5 [0.4.9][WIN32SS] Improve many apps not starting with active taskbar pane (#2396)
Many thanks to the patches author JIRA-user "blueghost"
tibor.fuzi@gmail.com

The patch fixes regression CORE-16703, which was unhidden by explorer commit
8ad0eae687 == SVN r74968
although the root-cause was missing functionality in WIN32SS.

The patch also fixes CORE-16705 and CORE-16706.
fix picked from 0.4.14-dev-1137-g 848d7ec633
----------
And while touching winpos.c I decided to also port back the
fix for the format-string-glitch from #1893 authored by Stanislav Motylkov.
fix picked from 0.4.13-dev-1079-g b16ca9cd65
2020-12-19 20:50:12 +01:00
Joachim Henze 1667ebbb22 [0.4.9][WIN32SS] Fix assert with Winamp 5.666 CORE-10774
Fixes CORE-10774 "Winamp asserts upon startup when Bentoo skin is selected"

Reference:
Alexandre Julliard : Ignore empty rectangles in ExtCreateRegion.
8ac61c5a1e

fix picked from 0.4.12-dev-979-g 2f5c0ee0a9
2020-12-11 04:06:30 +01:00
Joachim Henze 7c969a1e23 [0.4.9][WIN32SS] Fix BSOD CORE-15433 and repeatedly hit assert CORE-14755
CORE-15433 "Fix assertless BSOD when Opera 12.18 browses duckduckgo.com"
fix ported from 0.4.12-dev-20-g 43e2089 (I ported it back earlier into 0.4.11-RC-7-g 7d0eadd already)

CORE-14775 Allow NULL, Fix repeatedly hit assert when Opera 12.18 browses www.palemoon.org style_name==NULL
by taking parts only of the fix from 0.4.10-dev-284-g ae8762e . I left the verbosed debug-prints aside, as that is not performance-neutral.

They are both related. Actually style_name == NULL is ok, that assert was not correct.
but some of the code was just not handling it properly and dereferenced it.
2020-12-11 01:05:58 +01:00
Joachim Henze 3e63d1b811 [0.4.9][WIN32SS] State of the art for positioning popups, menus and submenus
This is the hard work of Mark Jansen, and in sum reflects the state of 0.4.13-rls-0
when leaving out all work of Jim Tabor and Katayama in this file.
I picked only one unrelated single-line-commit of Timo Kreuzer additionally.

In sum it fixes the following tickets: CORE-16306, CORE-16297, CORE-15863, CORE-15001, CORE-16298.

And is a backport of the following master-commits:
0.4.14-dev-40-g e1984d0 CORE-16306 "Regression, UltraISO shows Languages popup menu at wrong position" (ported back earlier into 0.4.13-RC-12-g 609f2ae)
0.4.13-dev-815-g 6948764 CORE-16297 "Regression, The popup menus position is not perfect for systray icons context menu of Abyss webserver"
0.4.13-dev-814-g 84e263c CORE-16297 "Regression, The popup menus position is not perfect for systray icons context menu of Abyss webserver"
0.4.13-dev-813-g 1c8cdaa CORE-16297 "Regression, The popup menus position is not perfect for systray icons context menu of Abyss webserver"
0.4.13-dev-793-g b5c6af4 CORE-15863 "Regression, popup-menus that expand a sub-popup-menu may erroneously overlay itself"
0.4.13-dev-792-g 7c45a64 CORE-15863 "Regression, popup-menus that expand a sub-popup-menu may erroneously overlay itself"
0.4.13-dev-791-g a59df38 CORE-15863 "Regression, popup-menus that expand a sub-popup-menu may erroneously overlay itself"
0.4.13-dev-713-g 08c6d21 just fixes a compiler warning, unrelated one-liner, only commit of Timo in here
0.4.12-dev-369-g 007ec03 CORE-15001 "Wrong placement of the context menu in systray leads to autoselection, e.g. Abyss WebServer"
0.4.12-dev-346-g d2626f0 CORE-15001 "Wrong placement of the context menu in systray leads to autoselection, e.g. Abyss WebServer"
CORE-16298 "Window system menu does not appear where expected" which is a dupe of one of the tickets above, don't ask me which exactly

There is only one ticket in this context that will NOT get fixed in the final state, but we do accept that,
as it is minor and also MS Windows is not really deterministic in all cases for that:
CORE-15733 "[Win32SS?] dropdown-menu position may be wrong, when the window overflows the screen-borders"

This patch supersedes / is a better replacement for the safe-intermediate-state-fixes that I committed earlier into:
0.4.12-RC-49-g d52cac4 & 0.4.12-RC-48-g 3113d13
0.4.11-RC-35-g a9be77c & 0.4.11-RC-30-g 83e4a61 & 0.4.11-RC-27-g 1d47cfd
2020-12-08 18:11:29 +01:00
Joachim Henze 2b96692387 [0.4.9][WIN32K:NTUSER] Acquire the user lock exclusively in NtUserGetSystemMenu CORE-15512
It is rare, but I have seen this crash happening as well
when interacting with the taskbar quickly after the boot.

fix picked from 0.4.12-dev-203-g c526f94
2020-12-03 02:11:14 +01:00
Joachim Henze d15f8a6646 [0.4.9][WIN32K:NTUSER] Fix WIN32K BSOD mentioned in CORE-15027
Fixes accessing nullptr / invalid handle in Window->SystemMenu
I could trigger this occasionally when moving Opera 12.18 window
in front of Spotify 1.0.29.92 window.

Fix was:
authored by Thomas Faber (Thank you!)
tested by me
reviewed by James Tabor

fix picked from 0.4.11-dev-195-g ef016bfe0a
2020-12-03 01:01:33 +01:00
Joachim Henze ee7bb6ebf5 [0.4.9][WIN32SS] Fix RIGHT-expansion-arrow in submenus being drawn too large CORE-13211
A squashed port of
0.4.13-dev-702-g 1e91a1690d
0.4.13-dev-809-g 65e4efd475
0.4.14-dev-186-g b3033b81a4
which in sum brings us to the nice state of 0.4.13-release-0-g4ee3778a4ed2d80c96e7a0f7a1e52e78d3a6568e
where I used the same trio successfully already.

CORE-13211 "RIGHT-expansion-arrow in submenus being drawn too large"
did affect many apps, e.g: UltraISO and Abiword
It was fixed by 0.4.13-dev-702-g 1e91a1690d (#1752)
but on its own it did introduce 2 regressions:

The first was that the
"upwards scrolling arrow in language selection submenu of UltraISO was now drawn much too large"
(discussion and pics also in CORE-13211)
That was fixed by the addendum 0.4.13-dev-809-g 65e4efd475 (#1753)

But we had still another regression from the first commit to solve:
CORE-16470 "The checkmarks in Abiwords menubar became black boxes"
That last regression was fixed by 0.4.14-dev-186-g b3033b81a4 (#2009)
2020-12-02 16:08:53 +01:00
Joachim Henze e187d8d998 [0.4.9][WIN32SS] Fix scrollbar bug CORE-15557 & CORE-13986
Fixes CORE-13986 "Wise Installer draws scrollbars enabled while they should be drawn disabled"
by porting back 0.4.11-dev-586-g 929a2c6 (the mentioned CORE-ID in that commit was wrong due to typo)

which requires to pick also 0.4.14-dev-1167-g 8bb9434 to prevent the first fix introducing regression
CORE-16721 "Scrolling by pressing the scrollbar arrows does not draw the arrows as pressed"

and finally port back 0.4.14-dev-243-g 19fbdda to fix
CORE-15557 "disabled scrollbars being clickable"

In sum this brings the scrollbar code to the state of 0.4.13-release-0-g 4ee3778
2020-12-01 16:42:32 +01:00
Mark Jansen 55da9b9c07 [0.4.9][FONT][WIN32SS] Include the style name in the registry key CORE-14044
CORE-14044 Symptom "Installing MS Tahoma did not longer replace Tahoma.ttf, just Tahomabd.ttf"

It regressed by SVN r73900 == git
d5f4f99b0e

Thanks to Doug Lyons for pinpointing the issue.

fix picked from commit 0.4.11-dev-311-g
3d44f79e3e
2020-11-13 14:20:22 +01:00
Joachim Henze 144976843a [0.4.9][WIN32SS] Fix last user visible parts of regression CORE-10855
When Themesvc was disabled, some Window titlebar
frames were drawn too thin until the window
was actively resized in y by the user.

That and similar symptoms started to show up after SVN r68904 ==
6dfa71c487

Many thanks to patches author Doug Lyons.

fix picked from commit 0.4.14-dev-121-g
9e14a762d5
2020-11-09 23:14:17 +01:00
Joachim Henze 64ccae4b26 [0.4.9][WIN32SS] Fix maximized window positioning and 2 addendum commits
Fix CORE-5177 "TaskMgr and ProcExp positioning when maximized."

which regressed by SVN r47264 == git
0ac861114e

fix cherry picked from commit 0.4.12-dev-954-g
1f619b2781
-----------
but since above commit did introduce a new regression CORE-15893
symptom "Most of maximized windows have extra row of pixels around"
I had to port back those 2 follow-up-master-commits as well:
0.4.12-dev-956-g
197c4f875d3332dbc4656a6360e3c7e9def2ed5
and 0.4.13-dev-397-g
3cc50cedaf

Side-note: This results in the same final state as 0.4.12rls0, because
I ported 0.4.13-dev-397-g3cc50ce into 0.4.12-RC-29-gab7f77a earlier.
2020-11-09 19:41:30 +01:00
Joachim Henze 763e08ed5e [0.4.9][WIN32SS:NTGDI] Fix missing text in labels and buttons for .NET apps.
Fixes CORE-15000 "Totally Broken/messed up text in many .NET applications"
and its duplicates
CORE-14679 "Missing fonts in Reg Organizer 8.16"
CORE-15398 "Messed fonts in Microsoft SQL Server 2005 Express Edition"
CORE-15611 "Word 2003: Organization Chart has corrupted display"

There was a missing break statement in ftGdiGetGlyphOutline().
Found by JIRA contributor 'I_Kill_Bugs' :-)

Add also brackets around 'case's to make code navigation easier.

Fix picked from 0.4.12-dev-865-g
0e56ec8892
2020-11-03 14:17:07 +01:00
Joachim Henze bf8cbe2769 [0.4.9][WIN32K:NTUSER] Fix CORE-12243 OS-freezing when closing nLite
This fixes CORE-12243 and allows .NET applications like nLite 1.4.9.3
to exit properly without freezing the whole OS.

The actual fix was picked from 0.4.11-dev-78-g
4d48b88bfb
"[WIN32K:NTUSER] co_UserDestroyWindow(): Simplify the destruction of the owned windows."

but it made sense to also pick the related 0.4.11-dev-77-g
e286c4c520
"[WIN32K:NTUSER] Optimize IntWinListOwnedPopups() a little bit. Improve a trace."

and 0.4.11-dev-76-g
f644a50cd7
"[WIN32K:NTUSER] Code formatting only."
2020-11-03 03:54:16 +01:00
Joachim Henze 2a9249b546 [0.4.9][WIN32SS] Require at least the amount of extra memory, not exact amount
Fixes 3 application crashes:
CORE-15576 "Civilization II Multiplayer Gold Edition crashes when trying to open a map"
CORE-13924 "Click-n-type Virtual Keyboard 3.03.4012 from rapps crash when opening program preferences"
CORE-8790 "IceChat crashes with OutofMemory"

It regressed around SVN r56947, r56948, r56949.

cherry picked from commit 0.4.12-dev-417-g
e022d8d7cb
2020-11-01 02:13:21 +01:00
Thomas Faber 65c7d4a17b [0.4.9][WIN32K:NTUSER] Reference menus owned by a popup menu. CORE-15504
Fixes a BSOD mentioned in CORE-15504

cherry picked from commit 0.4.12-dev-218-g
e3c8002dfc
2020-10-22 20:55:56 +02:00
Joachim Henze 995d69c8d7 [0.4.9][WIN32K:NTUSER] Avoid dereferencing a null pointer in NC_DoNCPaint.
Fixes BSODs CORE-15569, CORE-12963, CORE-13410

For non-technicians:
Author Thomas Faber just imprisons the BSODs into an artificial cage
made of curly-braces. The BSODs can't h(a)unt any users anymore
and inevitably starve therefore.

cherry picked from commit 0.4.12-dev-338-g
b2dcb8e0d8
2020-10-12 23:06:29 +02:00
Joachim Henze d351b32bdb [0.4.9][NTUSER] Fix regression CORE-11828
Fixes symptom "mouse pointer vanishes when closing
applications via x in title-bar"

The bug in WIN32SS was unhidden by SVN r65496 == git
5c1a8109c8
, when we introduced explorer_new. The old explorer
had a workaround built within.

Many thanks to patches author James Tabor.
cherry picked from commit 0.4.14-dev-1012-g
820dbfccd0
2020-10-11 23:46:39 +02:00
Joachim Henze e8cc477de5 [0.4.9][WIN32K:ENG] Fix fullscreen switch regressions CORE-15325 & CORE-14684 PR#1659
In PDEVOBJ_vRefreshModeList, find a proper match for the current
display mode instead of assuming a constant index.

Both tickets CORE-15325 & CORE-14684 regressed by SVN r74404
384affe098

fix cherry picked from commit 0.4.13-dev-456-g
00e882c2b1
Many thanks to the patches author Thomas Faber.

With this commit we sync PDEVOBJ_vRefreshModeList() to the state I used in 0.4.12rls and 0.4.13rls.

This patch does fix:
- regression CORE-15325 "Pocket Tanks 1.6 not filling the whole screen because it does not switch its resolution when coming from desktop res 1024x768 32bpp"
- regression CORE-14684 "Fall 0.1.3 opens just a white window instead of content when started with desktop resolution 1024x768 32bpp"
- regression "Globulation 2 0.9.4.4 not filling the whole screen when configured to use fullscreen and running it from desktop resolution 1024x768 32bpp"

but also helps to fix the last app that was still affected by CORE-14363 "systray icons do flash through now when an app is running in fullscreen".
CORE-14363 actually was fixed for >95% of the apps already by my last commit into the releases, but there was an outlier that does require Thomas patch additionally, that was:
- "Pengupop 2.2.3 when being run from desktop with 1024x768 32 bpp"

I committed it beforehand:
- for master:    0.4.13-dev-456-g00e882c
- for 0.4.12rls: 0.4.12-RC-34-gec3cc13
- for 0.4.11rls: 0.4.11-release-4-g11e0b0b
- for 0.4.10rls: 0.4.10-release-6-g58f9e1e
2020-10-08 17:53:51 +02:00
Joachim Henze 9f4fee83ab [0.4.9][WIN32SS] Fix many regressions of fullscreen switching, all caused by SVN r75407
CORE-16393 'switching to fullscreen via Alt+Enter in cmd now leaves the taskbar visible'
CORE-15477 'TileWorld 1.3.2 when started in fullscreen mode it now leaves the taskbar visible'
CORE-14979 'It depends on the desktop color-depth bpp whether taskbar is hidden in fullscreen of Anno 1602'
CORE-15599 'Rocks&Diamonds 3.3.1.2 from rapps leaves its taskbar visible when switching into fullscreen via alt+enter'
CORE-15600 'LGeneral from rapps leaves the taskbar visible when selecting fullscreen from context menu'
CORE-15654 'Exiting "Bound Around Demo" from fullscreen leaves black borders around the desktop'

All those cases regressed by SVN r75407 == git
09ab5ea7ed

To date I am not aware of more that broke by that historic commit, but we still have some cases that still
do not work as intended, they are linked as blocker against the EPIC CORE-11242.
But at least no regressions known anymore to date by that specific commit into display.c.

In sum this brings us in the context of this regression in this file
for the functions UserChangeDisplaySettings() & NtUserChangeDisplaySettings()
to the state of
- for master:    0.4.14-dev-38-g96ef605
- for 0.4.13rls: 0.4.13-RC-11-g0a03b36
- for 0.4.12rls: 0.4.12-release-4-g8c5e349
- for 0.4.11rls: 0.4.11-release-3-g29e0b55
- for 0.4.10rls: 0.4.10-release-5-g679a66f
2020-10-07 02:46:20 +02:00
Thomas Faber d46570474a [0.4.9] cherry-pick [WIN32SS] Mask WndProc exceptions to hide all tickets linked to CORE-11915
e.g. this allows using MsDepends

(cherry picked from commit 9274859438)
cherry-picked by Joachim Henze
2018-05-20 21:31:53 +02:00
Hermès Bélusca-Maïto a55d7c692b
[WIN32K] Implement UOI_FLAGS in NtUserGetObjectInformation(). Based from a patch by Jérôme Gardou.
CORE-13447 CORE-14422

This fixes closing nLite 1.4.9.3 (.NET2) application, as well as any
other program that expects that the interactive window station is
reported as being visible. I thank Mark Jansen and Joachim Henze for
help and testing.
2018-04-22 23:00:55 +02:00