Commit graph

1372 commits

Author SHA1 Message Date
Doug Lyons
fb87f0f88c
[NTUSER] Fix popup menu position when menu item is half off the left side of the screen (#7108)
[CORE-16729](https://jira.reactos.org/browse/CORE-16729)
2024-07-16 14:36:45 -05:00
Andrei Miloiu
fc7bc3bbbd
[LOCALMON] Update Romanian (ro-RO) translation (#6877) 2024-07-16 21:20:16 +02:00
George Bișoc
4093d0e164
[NTUSER] Estabilish power callouts and invoke the cleanup procedure when unloading Win32k 2024-07-13 11:30:19 +02:00
George Bișoc
181b666fc4
[NTUSER] Stubplement the Win32 power manager
In order for the NT power manager to interact with the Win32 subsystem (thus the whole rest of the system), the Win32 kernel-mode subsystem provides a mechanism that communicates with the kernel power manager via power callouts (aka power requests as per Windows' PDB symbols).
Such mechanism enters in action as soon as Win32 callout routines are estabilished with the PsEstablishWin32Callouts() function.

The NT power manager, the power policy manager respectively, invokes a power callout to denote an exceptional phenomena as a result of power policies or capabilities changes, turning ON/OFF the display, a system time change has occurred, etc.
Such scenarios are described as power events of which the NT power manager sends a WIN32_POWEREVENT_PARAMETERS packet to Win32k via the estabilished "PowerEventCallout" pointer function callout.
For other callouts that inform the Win32 subsystem of impeding power state changes across the system or devices, these are sent as WIN32_POWERSTATE_PARAMETERS packets with its own separate callout.

The purpose of such mechanism is to give Win32k the opportunity to do power related tasks and alert every application of such power events in accordance with what it gets notified by the NT power manager.
Currently this patch stubplements this mechanism in ROS, it is only just the barebones for now. The development of the Win32 power manager will go in parallel with the kernel power manager development (expand, improve, fix the code of issues that whatever may arise).
So far only the PsW32SystemTime power event is implemented for the moment being. This work was decoupled from PR #5719 to avoid clobbering it too much.

=== TODO ===

- Implement power states management communication with the kernel power manager
- Implement the rest of the power events in IntHandlePowerEventWorker
- Implement power event handling in CSRSS (or WinSrv?) which handles any of the events that could not be handled by Win32k otherwise
- Estabilish the power state callout in PsEstablishWin32Callouts() (currently there is no a pointer function that gets assigned to such callout)

CORE-18969
2024-07-13 11:30:19 +02:00
George Bișoc
560428e250
[WIN32K] Add debug switch for the Win32 power manager 2024-07-13 11:30:07 +02:00
Oleg Dubinskiy
04f04efc96
[NTGDI] FontLink: avoid invalid font name buffer freeing (#7131)
Don't free the linked font name if it's already NULL. Since it is allocated only once (when loading the font name from Registry), it should be freed only once too. All subsequent freeing attempts will result in invalid pool freeing.
This fixes the 0xC2 BAD_POOL_CALLER bugcheck when trying to resize window (and draw more text) from soundcloud.com in K-Meleon 76.5.4 Goanna engine and when switching between channels (during redrawing the text) in DiscordMessenger v1.06 Beta.
Addendum to 0f9e889736.
CORE-19681
2024-07-11 14:27:26 +02:00
Hermès Bélusca-Maïto
c02289a08a
[UXTHEME][NTUSER] Check class style for CS_NOCLOSE instead of window style (#7130)
CORE-11569, CORE-19684

Addendum to commit 71bed0f5f8 (PR #7123).

The problem in uxtheme was introduced in commit 685084b63c (as part
of a fix for CORE-17203), because it was a copy-paste and adaptation
of the corresponding code in `ntuser/nonclient.c!NC_DoButton()`.

The bugs in `win32ss/user/ntuser/defwnd.c` (and `nonclient.c` as fixed by
the previous commit) were in turn introduced from the migration of menu
and related code from user32 to win32k, see commit 6dfa71c487 (r68904).
2024-07-10 19:49:09 +02:00
Doug Lyons
71bed0f5f8
[NTUSER] Check class style for CS_NOCLOSE instead of window style (#7123)
Change 'pWnd->style' to 'pWnd->pcls->style' to check for CS_NOCLOSE.
Incorrect struct field was used for checking previously.

Fixes a bug with Ad Muncher that did not close when clicking on the window
title "X" button while being used with a Classic window style theme.
Patch by I_Kill_Bugs. CORE-11569
2024-07-10 13:30:53 +03:00
Katayama Hirofumi MZ
ef3e27e2c9
[NTUSER] Improve NtUserSetWindowPlacement (#7096)
Splitted from #7082. Correct behavior of
NtUserSetWindowPlacement function.
JIRA issue: N/A
- Check gptiCurrent->dwExpWinVer in
  NtUserSetWindowPlacement function.
- Fix the last error.
2024-07-09 07:42:56 +09:00
Katayama Hirofumi MZ
6c74e69d12
[NTUSER][USER32] Populate dwExpWinVer (#7095)
This value is needed for
SetWindowPlacement and IMM.
JIRA issue: CORE-19675
JIRA issue: CORE-19268
- Add RtlGetExpWinVer function
  into win32ss/user/rtl/image.c.
- Add RtlGetExpWinVer prototype
  into win32ss/include/ntuser.h.
- Delete RtlGetExpWinVer
  definition in
  win32ss/user/user32/windows/window.c.
- Populate THREADINFO.dwExpWinVer
  and CLIENTINFO.dwExpWinVer
  by using RtlGetExpWinVer in
  InitThreadCallback function.
2024-07-09 04:22:14 +09:00
Tomáš Veselý
a9bdd62d84
[GDI32] SetBkMode: Avoid invalid input. CORE-19656 (#7089)
Fixes a bug in Midori 0.5.11 installer which caused bad rendering
that was making the text hard to read (no background).
In Windows it's visible as FillRect(0x89011a1f, 0x0019f87c, 0xabababab),
and in ReactOS as SetBkMode(0xb5010fce, -1546139919).

After a number of attempts to get the same behavior, I haven't found a way
to fix it without a hack to make the installer look identical to Windows.

At least I added handling for the incorrect value in SetBkMode.
This shouldn't matter anywhere. It may not look the same as on Windows,
but the text will at least be readable.
2024-07-08 21:34:36 +03:00
Katayama Hirofumi MZ
efe42074cc
[USER32][USER32_APITEST] CopyImage: Check flags (#7075)
JIRA issue: N/A
- Check CopyImage flags.
- If there is any invalid flag, then set ERROR_INVALID_PARAMETER
  and return NULL.
- Add CopyImage testcase.
2024-07-08 19:24:15 +09:00
Katayama Hirofumi MZ
0cfd7bde9b
[USER32] TileWindows: Adjust timeout of QuerySizeFix (#7081)
Since my machine performance
became lower, we have to adjust
timeout to get correct pattern of
user32!TileWindows function.
JIRA issue: CORE-19674
Adjust timeout value in QuerySizeFix
function.
2024-07-07 06:48:36 +09:00
Jose Carlos Jesus
c3a45b679d
Fix return value from GetObject gdi32_apitest (#7046) 2024-07-06 22:55:06 +02:00
Katayama Hirofumi MZ
61cdd02d1c
[NTGDI] Fix MaskBlt error code and check pattern usage (#7083)
Follow-up to #7074. Fix MaskBlt behaviour.
JIRA issue: CORE-13133
- Fix MaskBlt error code.
- Fix MaskBlt pattern usage check.
2024-07-06 13:28:26 +09:00
Katayama Hirofumi MZ
80c170d7bc
[IMM32][NTUSER] Reduce a little IMM spams (#7077)
Reduce log spams that @julenuri reported.
JIRA issue: CORE-19268
- Use Imm32IsCrossThreadAccess
  instead of IS_CROSS_THREAD_HIMC in
  ImmSetCompositionWindow function.
- Reduce ERR logging in
  NtUserQueryInputContext function.
2024-07-05 05:07:49 +09:00
Oleg Dubinskiy
1a1025011f
[REACTOS] Fix LoadCursorW() incorrect usage cases (#7053)
Fix wrong MAKEINTRESOURCEW() macro usage cases in LoadCursorW() system-wide.
MSDN documentation for this function states we need to use MAKEINTRESOURCEW() macro only for internal application-defined cursors (loaded from the app instance specified by hInstance parameter), but not for system-defined cursors (those begin with IDC_* prefix), in case when hInstance is NULL.
So get rid from MAKEINTRESOURCEW() macro usage for all cases when hInstance parameter is NULL. And on the contrary, when hInstance is valid and points to the application instance, then use it for the resource identifier.
2024-07-01 18:05:46 +02:00
Katayama Hirofumi MZ
a207a3c931
[NTGDI][FREETYPE] Fix FontLink freeze (#7063)
#7009 introduced unexpected freezing on gdi* bot tests.
JIRA issue: CORE-19667
Fix the locking-related assertions by adding/removing
lock/unlock.
2024-07-01 22:34:59 +09:00
Katayama Hirofumi MZ
0f9e889736
[NTGDI][FREETYPE][SETUP][INF] Support FontLink (#7009)
If East Asian people were unable
to see the Latin characters, it
becomes a barrier to mutual
understanding.
FontLink will break that barrier.
JIRA issue: CORE-9616
JIRA issue: CORE-15480
- Modify font substitutes.
- Unify the lock variables.
- Add FONTLINK and
  FONTLINK_CHAIN structures.
- Add FontLink_Create and
  FontLink_Destroy functions.
- Add FontLink_Chain_Init,
  FontLink_Chain_Free,
  FontLink_Chain_LoadReg,
  FontLink_Chain_Populate, and
  FontLink_Chain_FindGlyph
  functions.
- Implement FontLink.
- Add font file DroidSansFallback.ttf
  for LiveCD.
2024-06-30 22:15:34 +09:00
Doug Lyons
cd88a97115
[NTUSER] Fix popup menu positioning for Miranda IM (#6981)
CORE-17838
2024-06-19 18:55:12 -05:00
Doug Lyons
6190a97df4
[NTGDI][FREETYPE] Multiple indirect Font Substitutes fix for Factusol (#7020)
Fixes double use of Font Substitutes "Helv" -> "MS Sans Serif" -> "Tahoma".
2024-06-15 17:08:59 -05:00
Gabriele Lo Re
ae27ffcddc
[TRANSLATION] Improve Italian (it-IT) translation (#6820)
I have edited some traslation files for the italian language, as the text
looked robotic in the way senteces were written, or in some cases it used
not-really-fitting synonymous or incorrect spelling. The edited strings
are from varius areas of ReactOS. I hope this contribution makes italian
language less strange to native speakers.

- [ACCESS] Improve Italian (it-IT) translation
- [DESK] Improve Italian (it-IT) translation
- [JOY] Improve Italian (it-IT) translation
- [MAIN] Improve Italian (it-IT) translation
- [SYSDM] Improve Italian (it-IT) translation
- [TIMEDATE] Improve Italian (it-IT) translation
- [ACPPAGE] Improve Italian (it-IT) translation
- [DESKADP] Improve Italian (it-IT) translation
- [DEVCPUX] Add Italian (it-IT) translation
- [FONTEXT] Improve Italian (it-IT) translation
- [ZIPFLDR] Improve Italian (it-IT) translation
- [BROWSEUI] Improve Italian (it-IT) translation
- [USER32] Improve Italian (it-IT) translation
- [CONSRV] Improve Italian (it-IT) translation
- [USERSRV] Improve Italian (it-IT) translation

Reviewed-by: Joachim Henze <joachim.henze@reactos.org>
Reviewed-by: Simone Mario Lombardo <me@simonelombardo.com>
2024-06-10 13:45:00 +03:00
Carl J. Bialorucki
ad73e17418
[USER32] Introduce user32_vista and stubplement GetDpiForWindow() (#6208)
Add user32_vista.dll to introduce new NT6+ User32 features without changing the existing User32.dll when compiled as NT5.x. Also implements a stub for GetDpiForWindow(). The GetDpiForWindow() function will be required to Wine-sync common controls to modern Wine versions.

Changes:
Expose GetDpiForWindow() function and USER_DEFAULT_SCREEN_DPI to appropriate versions in winuser.h
Introduce a basic user32_vista library that can be expanded as needed.
2024-06-04 10:19:32 -06:00
Katayama Hirofumi MZ
890b9c0b93
[NTGDI][FREETYPE] Simplify get_glyph_index_flagged (#6977)
Simplify code.
JIRA issue: CORE-9616
- Reduce one parameter of get_glyph_index_flagged function.
2024-06-03 09:28:52 +09:00
Katayama Hirofumi MZ
a541a468ba
[NTGDI][FREETYPE] Unload font engine on system shut-down (#6955)
Check system integrity by explicitly
releasing the font engine.
JIRA issue: CORE-9616
- Use RTL_STATIC_LIST_HEAD against
  g_FontListHead and
  g_FontCacheListHead variables and
  omit initialization of them.
- Implement FreeFontSupport function.
- Call FreeFontSupport in win32k!
  DriverUnload function.
- Fix some usages of
  CONTAINING_RECORD macro.
2024-05-29 09:41:39 +09:00
Katayama Hirofumi MZ
817f89466d
[BOOTDATA][IMM32][NTUSER] Follow-up to #6961 (#6962)
JIRA issue: CORE-19320
- Delete "(brain-dead)".
- Fix "despite of" as "despite".
- Use "%S" instead of debugstr_w.
2024-05-29 01:14:52 +09:00
Katayama Hirofumi MZ
c8a3c919e5 [BOOTDATA][IMM32][NTUSER] Set "LoadIMM" to zero
We set "LoadIMM" to zero in order to disable Cicero.
The name of "LoadIMM" is a brain-dead name. This name
means Cicero despite of its name (brain-dead).
They use a human-confusing name intentionally.

JIRA issue: CORE-19320

- Set HKLM\SOFTWARE\Microsoft\Windows NT\
  CurrentVersion\IMM:LoadIMM to 0.
- Add warning comments to the brain-dead name "LoadIMM".
2024-05-28 23:17:22 +09:00
Katayama Hirofumi MZ
4225717dc9 [IMM32][NTUSER] Fix NtUserGetThreadState call of Imm32InquireIme
There was a mistake of parameter value for NtUserGetThreadState
call in Imm32InquireIme function. This affected the logon process.

JIRA issue: CORE-19320

- Replace THREADSTATE_ISWINLOGON2 with THREADSTATE_ISWINLOGON in
  NtUserGetThreadState call in Imm32InquireIme function.
- Rename THREADSTATE_ISWINLOGON2 as THREADSTATE_UNKNOWN_0x10.
- Adapt NtUserGetThreadState to this change.
2024-05-28 23:17:22 +09:00
Doug Lyons
6338913f26
[NTUSER] menu.c position fix to not obscure 'Close' (#6923)
CORE-19579

When IS_SYSTEM_MENU was redefined in https://github.com/reactos/reactos/commit/3ae0ccdcc,
this broke the logic here. So now we restore the correctly working logic.
2024-05-24 19:15:07 -05:00
Oleg Dubinskiy
96acfcb3dc
[NTGDI] AlphaBlend/TransparentBlt: check whether the source DC is an INFO DC too (#6885)
Improve checks in AlphaBlend and TransparentBlt functions: check whether DCSrc is of DCTYPE_INFO also, to fail in that case properly too.
Spotted by PVS-Studio analysis.
Reference: https://pvs-studio.com/en/blog/posts/cpp/1122/.
2024-05-14 19:08:37 +02:00
Andrei Miloiu
3b99e294f5
[USER32] Update Romanian (ro-RO) translation (#6704) 2024-05-10 21:34:05 +02:00
Doug Lyons
cf9f7548d5
[NTUSER] Fix double click on title bar icon not closing window (#6697)
Patch by @I_Kill_Bugs

* [NTUSER] Fix double click on title bar icon not closing window

Improve MENU_TrackMenu handling.

Guilty commit:0.4.15-dev-7750-gc17a654 c17a6542ac

CORE-19492
2024-05-07 09:52:57 -05:00
Doug Lyons
0c0062ac9a
[NTUSER] Fix Skype and other programs installer windows not able to be moved with mouse by clicking on title bar (#6819)
Patch by @I_Kill_Bugs

Add condition into msgqueue along with filter testing to reject messages that are "NotForUs".
Also, do not set AcceptMessage to FALSE, but just keep msgDblClk and idSysPeek values and continue.

CORE-19487
CORE-19538
2024-05-07 09:10:11 -05:00
Katayama Hirofumi MZ
5a287473fd
[NTGDI][FREETYPE] Initial support of Surrogate Pairs and emojis (#6851)
Support emoji characters and minor characters.
JIRA issue: CORE-19030
NOTE: Not every emoji is supported yet (No ZWJ support). Surrogate pairs only.
NOTE: This feature only works if the appropriate font is selected.
- Add IS_HIGH_SURROGATE and
  IS_LOW_SURROGATE macros.
- Add Utf32FromSurrogatePair helper function
  to convert a surrogate pair to a UTF-32 code
  point.
- Convert the surrogate pairs in the text in
  TextIntGetTextExtentPoint, IntGetTextDisposition,
  and IntExtTextOutW functions.
2024-05-07 15:24:34 +09:00
Katayama Hirofumi MZ
d076146f4e
[NTGDI][FREETYPE] Check 'No transformation' for performance (#6850)
Slight performance improvement.
JIRA issue: CORE-15554
- Add bNoTransform variable.
- Check whether mat is identity matrix.
- If so, then don't do FT_Vector_Transform.
2024-05-07 11:14:16 +09:00
Timo Kreuzer
e8e770fd14 [WIN32K:NTUSER] Fix NULL pointer dereference in MENU_HideSubPopups
Fixes CORE-19367.
2024-05-06 15:47:30 +02:00
Katayama Hirofumi MZ
521eb0c7c0
[NTGDI][FREETYPE] Increase STACK_TEXT_BUFFER_SIZE (#6847)
Slight performance improvement. STACK_TEXT_BUFFER_SIZE = 100 was too small
for long text. This PR can reduce unnecessary buffer allocations in NtGdiExtTextOutW
function.
JIRA issue: CORE-15554
- Change STACK_TEXT_BUFFER_SIZE to 512.
2024-05-06 20:39:26 +09:00
Katayama Hirofumi MZ
0056313e15
[NTGDI][FREETYPE] Simplify code around bold/italic glyph caches (#6846)
Simplify and reduce font code.
JIRA issue: CORE-15554
- Don't treat bold/italic glyphs specially in font cache.
- Delete useless IntGetBitmapGlyphNoCache function.
2024-05-06 19:17:09 +09:00
Doug Lyons
29235147e2
[NTUSER] Remove some extra repaints/redraws (#6827)
Reposition logic and add Flags testing for RgnType == NULLREGION.
This was suggested by @HBelusca and approved by @I_Kill_Bugs
2024-05-04 07:35:53 -05:00
Joachim Henze
a69532ec4a [USER32] defwnd.c only formatting, no functional change
For preparing a backport I do slightly improve the formatting:
- for the 2 SetScrollInfo() calls, that I do intend to port back
- fix last place where we had mixed space and tab indentation in this file at the DefWindowProc signatures
- strip some exclamation marks in some dbg-prints
- improve the header
- strip a space at some rather long lines NtUserMessageCall()
2024-05-04 12:30:43 +02:00
Doug Lyons
515f998f0d
[NTUSER] Fix co_IntSetParent when calling on itself (#6365)
* Patch by @I_Kill_Bugs.

* Provide explanation for change.
CORE-9386
2024-05-02 03:43:41 -05:00
Doug Lyons
116c0cd9a5
[USER32] Fix resource display of MSVC BI_BITFIELD 32-bit bitmaps. (#5942)
This specifically fixes Wordpad's Open and SaveAs dialog toolbars.

* Fix 16 bpp BI_BITFIELDS like 32 bpp was done.
* Add BI_BITFIELDS byte count into bitmap_info_size return value.
* Account for GCC's windres.exe incorrect omission for BI_BITFIELDS DWORD's when processing 32-bpp bitmaps.
* Account for GCC's windres.exe failing with bitmaps with BI_BITFIELDS and bits per plane is 16
* Fix WARN message to show error on either 16-bpp or 32-bpp
* Correct comment regarding GCC compiled bitmaps with compression of BI_BITFIELD's to add 16 bits per plane

CORE-17005
2024-04-27 14:38:06 -05:00
Thamatip Chitpong
018264f38f
[NTUSER] Release modifier keys when deactivating message queue (#6754)
CORE-14768
2024-04-26 07:12:02 +07:00
Serge Gautherie
fd331f1494 [NTUSER] UserSetCursorPos(): Use an early return
Addendum to 76290a6 (0.4.15-dev-7889).
2024-04-20 13:57:35 -06:00
Justin Miller
2a2556c5d0
[WIN32SS] Introduce the NATIVE_REACTX define and disable some Dx calls (#6025)
The code itself isn't wrong but we're entirely missing the logic needed
to make it work. This leads to spontaneous crashes with video drivers and
various unity games.
2024-04-17 21:47:49 -07:00
Doug Lyons
76290a6696
[NTUSER] Avoid sending superfluous WM_MOUSEMOVE messages (#6397)
Add a check so that mouse move messages are not generated unless
the mouse cursor X or Y position is changed.

This fixes extra mouse moves generated when clicking.
Patch by I_Kill_Bugs.

CORE-8394 CORE-18529 CORE-19422 CORE-19423
2024-04-12 23:58:52 +03:00
Katayama Hirofumi MZ
de5c472033
[WIN32SS][USER32] Refactor USER32 callbacks (#6619)
Refactoring kernel-to-USER32 callback code.
Localize USER32 callback entry definitions.
JIRA issue: N/A
- Add header file win32ss/include/u32cb.h and use it to define the
  USER32 callback entries.
2024-03-20 09:45:04 +09:00
Doug Lyons
f132020d8b
[NTUSER] Fix sticky mouse buttons (#6426)
Fix Mouse Buttons Sticking Down causing unexpected window dragging.
This is a patch supplied by @I_Kill_Bugs and seems to work well as tested by @julenuri.

JIRA issue: CORE-11775 'GIMP 2.6.12: Sticky issue when dragging with the mouse'
JIRA issue: CORE-14998 'Google Chrome 40.0.2214.115, when moving window position by dragging at the titlebar, the drag-end is not detected, the window may stick with the mouse pointer'
Improves JIRA issue: CORE-18511

Proposed changes
Add extra code into nonclient.c procedure DefWndDoSizeMove to drop tracking.
If we get a mouse move with the mouse left button down, then break out of testing.
2024-03-13 07:16:02 +01:00
Doug Lyons
afd39cbc06
[USER32] Show Debug Log Message when unhandled PNG found in ICO file. (#5566)
Detect the PNG data in ICO files and print an appropriate message to the debug log.
JIRA issue: CORE-19107
2024-03-12 16:45:22 +09:00
Doug Lyons
c17a6542ac
[NTUSER] Fix PeekMessageA for MsgFilterLow/High mouse clicks (#6427)
Fix MSO and Word Viewer not closing when "X" on title bar is clicked.
This is another @I_Kill_Bugs patch.

CORE-14436 , CORE-16985
2024-03-11 14:34:34 +01:00