Commit graph

1507 commits

Author SHA1 Message Date
Serge Gautherie
4164b8a053
[NTUSER] menu.c: Tiny optimizations (#8111)
A bit clearer code. A bit faster execution.
- NtUserGetTitleBarInfo(): Add/Use early returns.
  Addendum to
3b4c9ded42 (r33657).
- NtUserTrackPopupMenuEx():
  Check flags a bit earlier.
  Addendum to
3c35117f97
  (0.4.16-dev-1275).
- NtUserThunkedMenuItemInfo():
  Sort out code and comments
- menu.c: Move UserLeave() a bit earlier.
2025-06-25 21:15:28 +09:00
Timo Kreuzer
c36d8c9271 [WIN32K] Fix a possible NULL pointer dereference in co_IntGetScrollBarInfo
The following code in user32_winetest scroll.c was causing it:

    ret = EnableScrollBar( mainwnd, SB_CTL, ESB_ENABLE_BOTH );
    ok( !ret, "EnableScrollBar should fail.\n" );
2025-06-22 17:35:15 +00:00
Katayama Hirofumi MZ
3a96c90c54
[NTUSER][USER32] Re-implement WM_POPUPSYSTEMMENU message (#8144)
This PR resolves a bug of #8094. #8094
correctly validates the flags. TPM_SYSTEM_MENU is an internal flag
and not a valid flag for TrackPopupMenu.
Thus, calling TrackPopupMenu.TPM_SYSTEM_MENU
in User32DefWindowProc was wrong.
This caused failure of taskbar context
menu.

JIRA issue: CORE-20238

- Move WM_POPUPSYSTEMMENU
  message handling of user32 into
  win32k.sys!IntDefWindowProc.
- Use win32k.sys!IntTrackPopupMenuEx
  instead of user32!TrackPopupMenu
  in handling of WM_POPUPSYSTEMMENU.
2025-06-19 22:59:27 +09:00
Katayama Hirofumi MZ
62ad2403a0
[USER32][COMCTL32] Edit: Optimize EDIT_SetCaretPos for speed (#8113)
The caret move on IME was slow until this PR.
JIRA issue: CORE-19268
- Don't use ImmIsIME but use IS_IME_HKL(hKL) in
  EDIT_SetCaretPos function. This change improves
  the caret speed.
- Prohibit display of composition window for Korean
  in the handling of WM_IME_SETCONTEXT and
  WM_IME_STARTCOMPOSITION, because Korean
  doesn't want it.
2025-06-14 20:26:05 +09:00
Katayama Hirofumi MZ
d809cd0f7f
[BOOTDATA][NTUSER] Add DontLoadCTFIME and use it (#8110)
Improve CTF IME customization.
Use the proper names for CTF IME.
JIRA issue: CORE-19268
- In the registry key "HKLM\SOFTWARE\Microsoft\
  Windows NT\CurrentVersion\IMM", add
  DontLoadCTFIME value and set it to 1.
- Delete LoadCTFIME value to avoid user
  confusing.
- Rename UserIsCiceroEnabled function
  as UserIsCTFIMEEnabled.
- Rename SRVINFO_CICERO_ENABLED
  flag as SRVINFO_CTFIME_ENABLED.
2025-06-12 13:55:49 +09:00
Katayama Hirofumi MZ
3c35117f97
[NTUSER][USER32_APITEST] TrackPopupMenuEx: Check flags (#8094)
Validate flags.
JIRA issue: CORE-3247
- In NtUserTrackPopupMenuEx function, validate the flags.
- If validation failed, then set last error and return FALSE.
- Add SAL annotations to NtUserTrackPopupMenuEx.
- Keep reference to menu in the function.
- Add TrackPopupMenuEx testcase to user32_apitest.
2025-06-10 21:25:14 +09:00
Katayama Hirofumi MZ
4cf350a716
[IMM32] Use ANSI_NULL and UNICODE_NULL (#8109)
Coding style fix.
JIRA issue: CORE-19268
- Use ANSI_NULL for '\0'.
- Use UNICODE_NULL for L'\0'.
2025-06-10 20:45:23 +09:00
Katayama Hirofumi MZ
87f4b28b99 [NTUSER][FORMATTING] NtUserTrackPopupMenuEx: Just formatting
for #8094. CORE-3247
2025-06-08 07:48:41 +09:00
Katayama Hirofumi MZ
2335229c32
[USER32][IMM32][SDK] Support WM_IME_SYSTEM.0x1D (#8088)
Splitted from #8080. The message
handling of WM_IME_SYSTEM.0x1D
is needed for IME menu handling.
JIRA issue: CORE-20142
- Define IMS_IMEMENUITEMSELECTED
  (0x1D) in <immdev.h>.
- Add WM_IME_SYSTEM.0x1D handling
  in ImeWnd_OnImeSystem function.
- Rename and extend
  User32GetImmFileName function as
  User32GetSystemFilePath, with
  adding a filename parameter.
2025-06-07 06:51:46 +09:00
Katayama Hirofumi MZ
5b4d1dbd4b
[NTUSER] IntTrackPopupMenuEx: Check TPMPARAMS.cbSize (#8092)
Validate structure size.
JIRA issue: CORE-3247
- In IntTrackPopupMenuEx function,
  if lpTpm was non-NULL, then
  validate lpTpm->cbSize.
- If validation failed, then set last
  error and return FALSE.
2025-06-06 22:37:27 +09:00
Hermès Bélusca-Maïto
273b4c8702
[WIN32SS:NTUSER] Minor code cleanup in hotkey code (#8084)
- Remove duplicated code in NtUserRegisterHotKey() and in
  NtUserUnregisterHotKey() by directly calling UserRegisterHotKey()
  and UserUnregisterHotKey() after the usual user-validation steps.

- In UserRegisterHotKey(), ignore hotkeys with virtual key VK_PACKET
  since this is not a real keyboard input, but is instead used in
  conjunction with unicode characters to simulate keystrokes for
  non-keyboard input methods.

- s/StartDebugHotKeys/SetDebugHotKeys/

- Remove duplicate code between NtUserCallMsgFilter() and IntCallMsgFilter().
2025-06-04 14:26:34 +02:00
Katayama Hirofumi MZ
67a4cf93be
[NTUSER] ime.c: Add SAL2 annotations and tracing (#8070)
Refactoring and improving trace.
JIRA issue: CORE-19455
- Add SAL2 annotations to
  function parameters.
- Add and improve tracing
  (TRACE and ERR) for easier
  debugging.
2025-06-04 05:47:54 +09:00
Katayama Hirofumi MZ
d80fdbe146
[IMM32][SDK] Refactor IMM32 and fix annotations (#8071)
Fix annotations' mistakes. Improve debug output.
JIRA issue: CORE-19268
- Fix some SAL annotations.
- Use debugstr_a and debugstr_w for tracing
  strings.
- Add static to some functions.
- Remove APIENTRY of some functions.
- Fix code formatting.
2025-06-03 11:09:36 +09:00
Katayama Hirofumi MZ
2543e2179c
[USER32] Alt+Tab: Don't switch to IME-related window (#8061)
The application switcher (Alt+Tab) shouldn't switch to IME-related (CS_IME) windows.
JIRA issue: CORE-19268
2025-06-03 06:53:51 +09:00
Serge Gautherie
bc03c010b3
[WIN32K:DIB] USE_DIBLIB: Use new DIB_16BPP_AlphaBlend() (#4568)
* [WIN32K:DIB] Fix 'DIB_16BPP_AlphaBlend' copypasta in a DPRINT()

Addendum to 684c3d3 (r49275).

* [WIN32K:DIB] USE_DIBLIB: Use new DIB_16BPP_AlphaBlend()

Addendum to 7540c2e (r64953).
2025-05-28 22:06:41 -05:00
Hervé Poussineau
72dcb3a11f [WIN32SS:ENG] Initialize pdo variable before using it 2025-05-28 23:37:28 +02:00
Hervé Poussineau
9f21cc3e98 [WIN32SS:ENG] Do not allocate 0 bytes if no monitor is reported
Addendum to 2f00ca4663
2025-05-28 18:26:23 +02:00
Hervé Poussineau
4534537036 [WIN32SS:USER] Remove useless assignations of pdo variable
Addendum to 30a7d19d84
2025-05-28 18:26:23 +02:00
Katayama Hirofumi MZ
b4e471c87d
[IMM32][SDK] Add install.c and move some code (#8032)
Splitting IME installation code for code readability.
JIRA issue: CORE-19268
- Add win32ss/user/imm32/install.c.
- Move some code to install.c.
- Add SAL annotations. Use debugstr_a/_w macro.
- Modify <imm32_undoc.h>.
- Don't CharUpperW for IME pathname due to
  security reason.
2025-05-28 16:08:51 +09:00
Hermès Bélusca-Maïto
2a0d98c2bc
[DOSKEY][USETUP][KERNEL32][NTVDM][CONSRV][REGEXPL] Fix build (#8019)
Fix build after the move and update of private console API
definitions to wincon_undoc.h
2025-05-27 20:52:20 +02:00
Hermès Bélusca-Maïto
6696d40cfc
[SDK] Introduce winbase_undoc.h for undocumented exported kernel32 definitions (#8019)
This header is based on the following files from the official
Windows 10.0.10240.0 PSDK, a copy of which can be found at:
- https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/winbasep.h
- https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/wbasek.h
2025-05-27 20:52:17 +02:00
Hervé Poussineau
30a7d19d84 [WIN32SS:USER] Rework UserEnumDisplayDevices to correctly report monitors
desk.cpl now returns the correct monitor name.
2025-05-27 20:34:37 +02:00
Hervé Poussineau
29b5003455 [VIDEOPRT] Implement IOCTL_VIDEO_ENUM_MONITOR_PDO 2025-05-27 20:34:37 +02:00
Hervé Poussineau
2f00ca4663 [WIN32SS:ENG] Retrieve and store list of associated monitors for each video adapter device 2025-05-27 20:34:37 +02:00
Katayama Hirofumi MZ
17577d2581
[IMM32][SDK] Support ImmIMPQueryIMEA/W and ImmIMPSetIMEA/W (#8033)
Implementing missing features...
These functions are given for IME
program handling.
JIRA issue: CORE-19268
- Implement ImmIMPQueryIMEA
  and ImmIMPQueryIMEW functions.
- Implement ImmIMPSetIMEA and
  ImmIMPSetIMEW functions.
- Add prototypes to <imm32_undoc.h>.
2025-05-27 20:10:25 +09:00
Hervé Poussineau
0743ceefa2 [WIN32SS:ENG] Fix check to enable panning driver
If ldevtype is not LDEV_DEVICE_DISPLAY, pdm is really a PMDEVOBJ structure.
So, we must not read the dmFields value.
2025-05-25 20:24:00 +02:00
Katayama Hirofumi MZ
8a913baed8 [CONSRV] Improve Japanese (ja-JP) translation
CORE-18706
2025-05-25 19:36:12 +09:00
Katayama Hirofumi MZ
2041f3c7a1
[IMM32][GITHUB] Move dll/win32/imm32 to win32ss/user/imm32 (#8024)
imm32 and win32ss have common
interface. This move will improve
grep-ability.
JIRA issue: N/A
- Move dll/win32/imm32 to
  win32ss/user/imm32.
- Adapt CMakeLists.txt to this move.
- No code content change except
  CMakeLists.txt and .github\labeler.yml.
2025-05-24 13:44:47 +09:00
Whindmar Saksit
5299f047e4
[NTUSER][PSDK] Implement Snap DockMoving setting (#8020)
SPI_SETDOCKMOVING allows you to turn off window snapping when moving a window with the mouse. The Win keys can still snap unless you turn everything off with SPI_SETWINARRANGING.
2025-05-23 13:45:25 +02:00
Katayama Hirofumi MZ
c876fe350d
[IMM32][NTUSER] Strictly check Cicero IME (#8009)
This PR enhances Cicero IME support.
JIRA issue: CORE-19268
- Add null checks for the functions
  of Cicero IMEs in Imm32LoadIME
  function.
- Add and use
  IS_CICERO_COMPAT_DISABLED
  macro in win32ss/include/ntuser.h.
- Fix ImmGetImeInfoEx,
  Imm32LoadImeDpi,
  ImmGetDescriptionA,
  ImmGetDescriptionW,
  ImmGetIMEFileNameA,
  ImmGetIMEFileNameW, and
  ImmGetProperty functions for
  Cicero IME support.
- Set last error in NtUserGetImeInfoEx.
2025-05-20 07:34:46 +09:00
Katayama Hirofumi MZ
9e1f2b035f
[NTUSER][USER32] Rewrite GetAncestor (#7978)
JIRA issue: N/A
- Set the last error.
- Check message window.
- Modify user32.spec.
2025-05-16 19:41:01 +09:00
Hervé Poussineau
49427c48c5 [WIN32SS:USER] If default display driver doesn't work, try with VGA
CORE-7728, CORE-16002, CORE-16009, CORE-19224, CORE-19951
2025-05-12 18:24:58 +02:00
Hervé Poussineau
dca369cf41 [WIN32SS:ENG] Rework EngpUpdateGraphicsDeviceList
- choose VGA adapter outside of driver initialization loop
- choose primary adapter outside of driver initialization loop
- link VGA adapter to primary adapter at the end
- only set DISPLAY_DEVICE_PRIMARY_DEVICE in this function

Also mark VgaSave driver as SystemStart instead of Disabled,
so it is available if main display driver doesn't work.
2025-05-12 18:24:55 +02:00
Hervé Poussineau
3729b96625 [WIN32SS:ENG] In case of error, display the name of the problematic file 2025-05-08 21:48:14 +02:00
Hervé Poussineau
a8abe1d677 [WIN32SS:ENG] Move debug log to the right place
Display number of prepared modes after preparing them, not at device creation
where this number is always 0.
2025-05-08 21:48:14 +02:00
Hervé Poussineau
a36bf31a0d [VGAMP] Correctly initialize interface before calling VideoPortInitialize 2025-05-08 21:48:14 +02:00
Katayama Hirofumi MZ
0ca6002b4f
[GDI32][NTGDI][SDK] Font/Text: Fix SAL2 annotations and const-ness (#7865)
I want to work in correct type info.
JIRA issue: CORE-17684
- Add and fix SAL2 annotations.
- Fix const-ness of function
  parameters.
- Delete needless type casts.
2025-05-06 15:13:04 +09:00
Katayama Hirofumi MZ
530d26a1f4
[NTGDI][NTUSER] Initial support of NtGdiRemoveFontResourceW (#7877)
Enable the users to delete fonts.
JIRA issue: CORE-17684
- Add IntDeleteRegFontEntry helper function.
- Add RegDeleteValueW and RegEnumValueW helper
  functions in win32ss/user/ntuser/misc/registry.c.
- Add some code to IntGdiRemoveFontResourceSingle
  function.
2025-05-06 12:38:54 +09:00
Whindmar Saksit
6829350af9
[SHELL32][NTUSER] Implement the SEE_MASK_HOTKEY/ICON/HMONITOR flags (#7947) 2025-05-03 16:08:58 +02:00
Doug Lyons
e98bba2535
[NTGDI:FREETYPE] Fix Fonts broken by opening VLC About (Retry of PR #4579) (#7952)
* Check is FontGDI->OriginalWeight > FontGDI->RequestWeight and if so, then return original weight.
* Do not handle FontGDI->OriginalWeight as a boolean. Use 'FontGDI->OriginalWeight = FW_DONTCARE;'.

CORE-17011
2025-05-01 17:44:10 -05:00
Katayama Hirofumi MZ
d722e70817
[SDK][USER32] Implement WM_IME_SYSTEM.IMS_SOFTKBDONOFF (#7950)
Supporting soft keyboard will improve IME
usability.
JIRA issue: CORE-19268
- Define IMS_SOFTKBDONOFF constant as
  0x13 in <immdev.h>.
- Implement
  WM_IME_SYSTEM.IMS_SOFTKBDONOFF
  message handling in ImeWnd_OnImeSystem.
2025-05-01 11:20:18 +09:00
Doug Lyons
85afe48c3e
[GDI32] Fix MSVC warning in SetDIBitsToDevice and simplify code. (#7919)
This is a very small revert of PR #5227 to simplify the code and eliminate an MSVC warning.
It was pointed out by Timo Kreuzer as probably not doing what I intended and he was correct.
I added this code in PR #5227 to try and correct some return values from SetDIBitsToDevice.
After testing with this new PR, there was no difference in the regression tests for either
1) gdi32:bitmap or 2) gdi32:SetDIBitsToDevice after deleting the code here and the MSVC warning was fixed.
2025-04-24 21:04:36 -05:00
Whindmar Saksit
7eb8535edf
[STOBJECT][NTUSER][ACCESS] Don't use a systray timer when not needed (#7917) 2025-04-24 21:27:36 +02:00
Whindmar Saksit
78e04c07b8
[USER32] Read the CoolSwitch settings from the registry (#7920) 2025-04-24 15:22:43 +02:00
Katayama Hirofumi MZ
94fc56c038
[COMCTL32][USER32] Edit: Don't unlock if unlocked on EM_SETHANDLE (#7886)
JIRA issue: CORE-18944
EDIT_EM_GetHandle unlocks the handle,
so the next EM_SETHANDLE handler
shouldn't unlock the unlocked text.
Don't unlock the handle when es->text
was NULL on EM_SETHANDLE
message handling.
2025-04-24 19:21:22 +09:00
Whindmar Saksit
5a10ec60be
[EXPLORER][BROWSEUI][SHLWAPI][BOOTDATA][WIN32K] Support AppKeys and more WM_APPCOMMANDs (#7879)
Implements a couple of extra commands in IShellBrowser and adds support for the AppKeys fallback registry key (used when the foreground application does not handle the command).
2025-04-18 18:35:30 +02:00
Timo Kreuzer
18fc5a1391 [USER32] Fix use of uninitialized variable 2025-04-11 07:24:44 +00:00
Hermès Bélusca-Maïto
111c8cc62a
[REACTOS] Usage improvements for some RtlFindMessage invocations (#6023)
Use `RT_MESSAGETABLE` and `MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)`
instead of hardcoding their values.
2025-04-08 20:19:54 +02:00
Katayama Hirofumi MZ
1e6e5529c6
[FREETYPE][FTFD][DOC] Update FreeType to 2.10.0 from 2.9 (#7786)
Modernize font engine modules.
JIRA issue: CORE-16084
- Update FreeType to 2.10.0 from 2.9.
- Delete useless files.
- Add technical notes (TechNote.txt) on freetype.
- DbgPrint became FT_Message.
2025-04-04 20:50:25 +09:00
Katayama Hirofumi MZ
7efab12e6f
[CMAKE] Introduce set_wine_module (Retry) (#7860)
Re-trial of #7800. Deleting __WINESRC__
hacks.
JIRA issue: CORE-5743
- Add sdk/cmake/set_wine_module.cmake.
- Load set_wine_module.cmake at
  top-level CMakeLists.txt.
- Use set_wine_module cmake function
  and delete __WINESRC__ as possible.
- Delete many include_directories.
2025-04-04 20:44:38 +09:00