Commit Graph

950 Commits

Author SHA1 Message Date
Alex Mendoza
d5697b231c [IMM32] Ensure minimum size in Imm32CreateInputContext (#8791)
Ensure minimum size of hPrivate
in Imm32CreateInputContext, just
like Imm32SelectInputContext does
2026-03-28 19:41:40 +09:00
Katayama Hirofumi MZ
b7510137d9 [IMM32] Fix Imm32AssignNewLayout (#8764)
Fix behavior of IME installation.
JIRA issue: CORE-19268
Rewrite Imm32AssignNewLayout function.
2026-03-28 09:11:13 +09:00
Alex Mendoza
f76ed0625b [IMM32] ImmEnumInputContext: Add IS_IMM_MODE check (#8768) 2026-03-25 16:51:13 +09:00
Katayama Hirofumi MZ
ed0b44f3b9 [IMM32] ImmGetDescriptionW: Check IS_IME_HKL (#8762)
Tougher system.
JIRA issue: CORE-19268
2026-03-25 09:36:59 +09:00
Katayama Hirofumi MZ
4ca47af13f Revert "[IMM32] ImmInstallIMEW: Use uppercase filename" (#8767)
Reverts #8763.
We should consider case-sensitive
file-systems we have.
2026-03-24 09:45:11 +09:00
Katayama Hirofumi MZ
8b3663d2b6 [IMM32] ImmGetGuideLineAW: Fix return value for error (#8766)
The function has to return zero on error.
JIRA issue: CORE-19268
Return zero on error (in GGL_STRING and GGL_PRIVATE).
2026-03-24 06:50:16 +09:00
Katayama Hirofumi MZ
0c7d3f20fa [IMM32] Fix Imm32ReconvertWideFromAnsi (#8758)
Fix recoversion feature.
JIRA issue: CORE-19268
- Replace pSrc with pDest in
  Imm32ReconvertWideFromAnsi.
2026-03-23 23:34:00 +09:00
Katayama Hirofumi MZ
35d30ec5fe [IMM32] ImmSetConversionStatus: Check IS_CICERO_COMPAT_DISABLED (#8760)
Improve IME compatibility.
JIRA issue: CORE-19268
- Check IS_CICERO_COMPAT_DISABLED's
  value.
- Initialize dwOldConversion and
  dwOldSentence variables.
2026-03-23 23:28:58 +09:00
Katayama Hirofumi MZ
e2ef2c9923 [IMM32] ImmEnumInputContext: Validate hIMC (#8761)
Tougher system.
JIRA issue: CORE-19268
Check hIMC and gpsi in
ImmEnumInputContext function.
2026-03-23 22:43:33 +09:00
Katayama Hirofumi MZ
cad71d733f [IMM32] Fix Imm32IsSystemJapaneseOrKorean (#8757)
The if-condition for Japanese or
Korean was wrong.
JIRA issue: CORE-19268
Replace logical operator || with
operator &&.
2026-03-23 22:33:51 +09:00
Katayama Hirofumi MZ
3b619baeb5 [IMM32] ImmGenerateMessage: Always use SendMessageW (#8765)
SendMessageA for IME message
won't work in some situations.
JIRA issue: CORE-19268
Always use SendMessageW instead of
SendMessageA in ImmGenerateMessage.
2026-03-23 22:23:47 +09:00
Katayama Hirofumi MZ
d47c613c26 [IMM32] ImmInstallIMEW: Use uppercase filename (#8763)
Avoid data inconsistencies in
interoperability.
JIRA issue: CORE-19268
Call CharUpperW in ImmInstallIMEW
function.
2026-03-23 22:16:51 +09:00
Doug Lyons
16a65a0df2 [NTUSER][COMCTL32] Fix ListBox background color setting (#8665)
CORE-20433

The brush returned from WM_CTLCOLORLISTBOX message is ignored when painting the background. This bug can be found at https://bugs.winehq.org/show_bug.cgi?id=2948

Fixed by handling backgound painting in LISTBOX_PaintItem and LISTBOX_Paint functions.

Patch by @I_Kill_Bugs
2026-03-22 22:38:36 +01:00
Ahmed Arif
057d978fcb [USER32] button.c Fix extra-byte layout on x64 (#8733)
One visible case is the setup LiveCD error dialog, where the message box button can appear with a wrong bold/garbled look instead of the normal default-pushbutton appearance.

## Root cause

`win32ss/user/user32/controls/button.c` stores button state with  `GetWindowLongPtrW` / `SetWindowLongPtrW`, but the control extra-byte layout was still defined as if the first slot were only `sizeof(LONG)` 

On 64-bit builds, that causes the stored state to overlap the cached font, image, and UI-state fields.
2026-03-16 13:01:44 +01:00
Ratin Gao
36ffee8ea3 [WIN32SS:NTUSER] Implement SharedUserData->LastSystemRITEventTickCount (#8537)
This field was introduced in NT5.1, records the tick count of the last user input
(system-wide), updated at most once per minute (or once per second since NT6.0).

Unlike `GetLastInputInfo` which is designed for providing session-specific
user input information, `SharedUserData->LastSystemRITEventTickCount` provides
system-wide time, used by:
- [Task Schedule (TASK_EVENT_TRIGGER_ON_IDLE)](https://learn.microsoft.com/en-us/windows/win32/taskschd/i)
- [Inactivity Monitoring](https://learn.microsoft.com/en-us/windows/win32/devnotes/inactivity-monitoring)
- Maybe some places I don't know...

See also:
- [KUSER_SHARED_DATA - Geoff Chappell](https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntexapi_x/kuser_shared_data/index.htm)
- [TASK_TRIGGER_TYPE enumeration - Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/mstask/ne-mstask-task_trigger_type)
- [Task Scheduler: idle conditions](https://learn.microsoft.com/en-us/windows/win32/taskschd/i)
- [GetLastInputInfo function - Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getlastinputinfo)
- [Inactivity Monitoring](https://learn.microsoft.com/en-us/windows/win32/devnotes/inactivity-monitoring)

## Proposed changes

Before this PR, `SharedUserData->LastSystemRITEventTickCount` is never used
and always 0, `gpsi->dwLastSystemRITEventTickCountUpdate` is never used too.
After this PR, `SharedUserData->LastSystemRITEventTickCount` updates correctly
by using `gpsi->dwLastSystemRITEventTickCountUpdate` to record previous update
time, the behavior is the same as on Windows.
2026-03-08 18:58:37 +01:00
Hermès Bélusca-Maïto
e22f447467 [WIN32SS:NTUSER] Implement EnableHexNumpad support (#8680)
Supplements commit cac013abef (PR #8104).
CORE-5680

The `EnableHexNumpad` string value is specified in the
`HKEY_CURRENT_USER\Control Panel\Input Method` registry key.

When enabled, the user can enter codepoints in hexadecimal form, using:
- `Alt .xxx` ('dot' prefix), for current ANSI codepage (ACP) codepoints;
- `Alt +xxx` ('plus' prefix), for Unicode codepoints.

These two modes complement the known `Alt xxx` and `Alt 0xxx` decimal forms
for entering codepoints in the current OEM or ACP codepage, respectively.
2026-03-08 18:35:37 +01:00
Katayama Hirofumi MZ
80bd460836 [SDK][KBSWITCH][CONIME][IMM32][NTUSER][MSCTFIME][MSUTB] Define LANGID_... (#8691)
Follow-up of #8678. Commonize the definition of
LANGID_... values.
JIRA issue: CORE-20243
- Define LANGID_... values for CJK in <cjkcode.h> and
  use it.
2026-02-27 10:02:23 +09:00
Hermès Bélusca-Maïto
1aab8a87c4 [SHELL32][NTUSER] Fix "accessability" typo 2026-02-21 17:32:32 +01:00
Hermès Bélusca-Maïto
7a505166b9 [WIN32SS:NTUSER] Validate the gpsi pointer when getting/setting the caret blink time 2026-02-21 17:32:32 +01:00
Petru Răzvan
cac013abef [NTUSER] Implement inserting characters with the Alt+Numpad method (#8104)
Implement the Alt+Numpad method for inserting characters with their
OEM (Alt+xxx) or their current ANSI codepage (Alt+0xxx) codes.

CORE-5680

For reference, see:
- https://en.wikipedia.org/wiki/Alt_code
- https://devblogs.microsoft.com/oldnewthing/20240702-00/?p=109951

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2026-02-17 21:35:54 +01:00
Max Korostil
c65740eeb3 [WIN32KNT_APITEST][NTUSER] Fix NtUserCreateAcceleratorTable memory corruption (#7888)
CORE-18122

- Check if `EntriesCount` can overflow the required memory size.
- Add an apitest for `NtUserCreateAcceleratorTable`.
2026-02-16 14:19:30 +01:00
Nathan Giovannini
4f15235d89 [NTUSER] Fix assertion failure in UserDerefObjectCo (#8659)
Ensure we dereference the same parent window object after a user-mode callback. We cache spwndParent in a local before sending messages so a parent change during the callback no longer trips the LIFO reference check.

- Capture the parent window in a local in IntDefWindowProc (WM_APPCOMMAND) and IntSendParentNotify.
- Use the local for UserRefObjectCo, co_IntSendMessage, and UserDerefObjectCo to prevent object mismatches when the parent changes mid-callback.

CORE-17331
2026-02-05 12:50:37 +03:00
Katayama Hirofumi MZ
026a53c076 [USER32][COMCTL32] EDIT control: Use ImmIsIME instead of IS_IME_HKL (#8652)
Prepare to support CTF IMEs.
The IS_IME_HKL macro cannot
detect CTF IME.
JIRA issue: CORE-1926
- Use ImmIsIME instead of
  IS_IME_HKL to check whether
  the keyboard is IME.
2026-02-01 18:51:37 +09:00
Katayama Hirofumi MZ
abd201bfa2 [USER32][COMCTL32] ComboBox: Don't check owner window on creation (#8647)
Reduce imm32:himc failures.
JIRA issue: CORE-19268
- Don't check lphc->owner nor
  WS_VISIBLE on ComboBox creation.
2026-02-01 07:24:27 +09:00
Doug Lyons
076699bff6 [USER32] Fix GSView 5.0 "Espanol" background color (Retry of PR #4015) (#8588)
CORE-13935

Improve "is_dib_monochrome" function in win32ss/user/user32/windows/cursoricon.c
so that it returns TRUE on a monochrome color table with WHITE first and BLACK second.
2026-01-30 01:50:39 -06:00
Timo Kreuzer
4799c8a21c [WIN32K][GDI32] Handle crBackColor in NtGdiMaskBlt and NtGdiStretchBlt
Pass it to EXLATEOBJ_vInitXlateFromDCsEx, which uses it (or, if it's CLR_INVALID, the source DC's background color) to initialize the EXLATEOBJ.
Adjust all callers to pass CLR_INVALID instead of 0.
2026-01-20 12:35:55 +02:00
Katayama Hirofumi MZ
44200f9142 [BOOTDATA][NTUSER] Enable LoadIMM setting (#8602)
Enable IMM mode and reduce
imm32_apitest failures.
JIRA issue: CORE-19268
- Enable LoadIMM registry setting.
NOTE: We have already DontLoadCTFIME
setting to avoid loading CTF IME.
Supporting CTF IME will be future work.
2026-01-18 11:17:56 +09:00
Doug Lyons
c77e0e5124 [NTUSER] co_WinPosSetWindowPos(): Fix missing redraw (#8572)
Fixes missing outline and garbage in the shell search combo box
when the separator is moved.

CORE-19912, CORE-19147
2026-01-10 23:20:17 +03:00
Hervé Poussineau
d1b0a76146 Revert "[WIN32SS:USER] Add 'DISPLAY' as an alternate name for global display"
This reverts commit 4da4648092.
2026-01-08 22:45:56 +01:00
Katayama Hirofumi MZ
5c6fcfbf62 [WIN32SS][SDK] ImmGetHotKey's 4th parameter is optional (#8557)
Fix SAL2 annotations of the IME hot-key functions.
JIRA issue: N/A
- Add ImmGetHotKey and ImmSetHotKey prototypes
  into <imm32_undoc.h>.
- Fix CliImmSetHotKey annotation in user32 and
  <undocuser.h>.
- Also fixes ImmSetHotKey, NtUserGetImeHotKey and
  NtUserSetImeHotKey annotations.
2026-01-04 07:57:21 +09:00
Max Korostil
472cf2fd13 [NTUSER][WIN32U_APITEST] Fix NtUserGetCursorInfo BSOD, add tests (#8473)
Probe structure pointer before reading its cbSize.
Also move the TRACE debug print outside the user critical region.

CORE-18125
2025-12-31 15:00:38 +03:00
Timo Kreuzer
eba2bbd177 [CRT] Remove ftol2_sse 2025-12-12 12:21:53 +02:00
Mikhail Tyukin
0172338964 [USER32] Fix pointer truncation (#8421)
Fix `UnregisterDeviceNotification()` crash on x64 due to pointer truncation.
Change signature of `CMP_REGNOTIFY` and `CMP_UNREGNOTIFY` to be correct (use `HDEVNOTIFY` instead of `ULONG`).
2025-10-10 20:43:34 +02:00
Hermès Bélusca-Maïto
c6fecdda65 [NTUSER] NtUserSetLogonNotifyWindow(): Lock-protect access to global data (#8369)
Like with all the other win32k NtUser* functions, acquire on entry and
release on exit the global lock, since the function is reading/writing
to global variables.

Also, set the last-error to ERROR_ACCESS_DENIED if the caller isn't the
registered logon process.
2025-09-04 11:43:30 +02:00
Hermès Bélusca-Maïto
10d57cb8b2 [NTUSER] IntLanguageToggle(): Guard against NULL pFocusQueue (#8368)
Addendum to commit 25b7447818 (PR #5839)
2025-09-04 11:42:06 +02:00
Hermès Bélusca-Maïto
6a6ed54495 [NTUSER] Some lifting for the Int/UserGet[Active|Capture|Foreground|ThreadFocus]Window() functions 2025-09-04 11:41:57 +02:00
Hervé Poussineau
4da4648092 [WIN32SS:USER] Add 'DISPLAY' as an alternate name for global display
CORE-20303
2025-08-20 19:33:17 +02:00
Hervé Poussineau
45c8cf7efd [WIN32SS:USER] UserEnumDisplayDevices: correctly report monitor device ids
desk.cpl can now open Monitor properties.
2025-08-20 19:33:17 +02:00
Doug Lyons
8e6fbe0c90 [NTUSER][COMCTL32] Fix garbage displayed at bottom of listbox.c (#8316)
CORE-20062
@I_Kill_Bugs fix for rect.bottom in LISTBOX_Paint function.
2025-08-20 11:34:44 -05:00
Serge Gautherie
ea41cfe290 [USER32] .spec: Fix GetDpiForMonitorInternal() param type (#8302)
Use ptr for handles.
2025-08-08 23:36:35 +02:00
Carl J. Bialorucki
c9842e5aad Move /sdk/include/reactos/wine to /sdk/include/wine, reorder global includes, remove unneeded includes (#8258)
- Move sdk\include\reactos\wine to sdk\include\wine
- Reorder the directories in include_directories() to be closer to alphabetical. This should make it easier to determine what global include directories can be removed in the future.
2025-07-29 13:57:12 -06:00
Katayama Hirofumi MZ
915b771037 [EXPLORER][NTUSER] Notify ABN_FULLSCREENAPP and fix monitor code (#8254)
Enable ABN_FULLSCREENAPP notification.
Fix some monitor functions.
JIRA issue: CORE-7237
- Improve NtUserMonitorFromRect and
  NtUserMonitorFromWindow functions.
- Remove if-statement in
  OnWindowActivated function.
- Don't check WS_EX_TOOLWINDOW in
  IntIsWindowFullscreen function.
- Add IntGetMonitorFromRect helper
  function to commonize some code in
  monitor functions.
2025-07-28 17:58:59 +09:00
Katayama Hirofumi MZ
d958a24678 [NTUSER][USER32_APITEST] Support ShowWindow.SW_FORCEMINIMIZE (#8261)
One more step to support ghost windows.
JIRA issue: CORE-19671
- Add IntForceMinimizeWindow helper
  function.
- Use IntForceMinimizeWindow in
  co_WinPosShowWindow function.
- Enhance ShowWindow testcase in
  user32_apitest.
- Add mask to the return value of
  GetWindowLong.
2025-07-20 13:14:01 +09:00
Katayama Hirofumi MZ
e7358c5930 [NTUSER][USER32] Fix IME UI exception (#8227)
Fix BSoD when toggling visibility of the IME status
window (IME Toolbar).
JIRA issue: CORE-20261
- Add IntGetImeUIFromWnd helper function.
- Fix exception in IntNotifyImeShowStatus function.
- Fix initialization of IME UI in ImeWndProc_common
  function.
- Delete RegisterIMEClass function.
2025-07-09 08:16:26 +09:00
Whindmar Saksit
c0ea1c0e9f [USER32][APITESTS] Use the correct user32 icon resource ids (#7807) 2025-07-06 15:24:25 +02:00
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