Commit Graph
1646 Commits
Author SHA1 Message Date
Ahmed Arif 6e95a132bd [WIN32SS:ENG/NTUSER] Use shared locks for display list lookups (#9090)
- Use shared locks for the display device and PDEV lookup paths.
  These functions only walk existing lists and take references, while list updates
  and mode-switch paths still use exclusive locking.
  This avoids serializing read-only display queries unnecessarily.

- Use shared locks for other read-only NtUser calls.
2026-06-26 14:07:15 +02:00
Ahmed Arif a45e91cb3d [WIN32SS:NTUSER] Use shared locks for read-only queries (#9088)
Some win32k syscalls were still taking the exclusive user lock even though they only read existing state.

This switches a few simple query paths to the shared user lock instead: foreground window lookup, IME hotkey/context queries, layered window attributes, and title bar info.

The goal is to avoid taking the writer lock for read-only work while keeping the same behavior.
2026-06-26 13:51:48 +02:00
Ahmed Arif f17d904d2d [WIN32SS:NTUSER] Return NO_SELECTED_ITEM from NtUserMenuItemFromPoint() when no item is hit (#9121)
Fix the bug, where `NtUserMenuItemFromPoint()` returned `cItems` instead of `NO_SELECTED_ITEM`
when no item is under the point (`mi` is never NULL on a miss), so `MenuItemFromPoint()` callers
could have indexed one past the menu array.
2026-06-25 18:22:15 +02:00
Ahmed Arif ae0e4ee305 [WIN32K:DIB] Fix some bugs in DIB_8BPP_BitBltSrcCopy (#9119)
- Fix destination row stride;
- Fix source stride and double translation in the flip path.

Related to CORE-2965
2026-06-25 18:03:00 +02:00
Katayama Hirofumi MZ a4013255d7 [IMM32] Fix C4334 and C4267 warnings (#9211)
Kill the warnings.
JIRA issue: CORE-19268
Add type casts to DWORD.
2026-06-25 10:36:36 +09:00
Hermès Bélusca-Maïto 2eb28656da [WIN32SS:NTUSER] Improve initialization of window station and desktop objects
As soon as `ObCreateObject()` is successfully invoked, zero-out the winsta
and desktop object buffers and assign them the current process session ID
(into their first `dwSessionId` member). Only then, continue with regular
initialization.

It's done in this systematic way in order to ensure that, in case the
regular initialization of these objects fails and `ObDereferenceObject()`
is invoked, the `nt!ExpWin32SessionCallout()` routine (in `ntoskrnl/ex/win32k.c`)
that is executed as part of the Win32 "delete" object callback registered
by win32k.sys with the Object Manager, correctly finds a valid initialized
`SessionId` value in the "common header" of either the window station
or the desktop object being deleted.

As a side-result, other parts of win32k can directly refer to
`pdesk->dwSessionId` instead of `pdesk->rpwinstaParent->dwSessionId`
for a given desktop.
2026-06-23 21:28:10 +02:00
Hermès Bélusca-Maïto 1968202840 [WIN32SS:NTUSER] winsta.c: Improve UserCreateWinstaDirectory()
- Don't use `NtCurrentPeb()` to retrieve the current process session ID,
  but `PsGetCurrentProcessSessionId()` instead that doesn't require a PEB.

- Turn the purposely-leaking local `hWinstaDir` variable into a global
  `ghWinStaDir` variable, so that when win32k.sys unloading support will
  be implemented, one could close `ghWinStaDir` so as to delete the per-
  session window-station object directory.
  (It isn't created as an `OBJ_PERMANENT` object for this reason.
  See comment https://github.com/reactos/reactos/pull/621#discussion_r196303521
  in PR #621.)
2026-06-23 21:23:06 +02:00
Hermès Bélusca-Maïto 9d287f3c5a [WIN32SS:NTUSER] IntCreateWindow(): Remove the last hack for "win32csr/desktopbg.c"
This hack was introduced in commit 89d0892531 (r6908) to automatically
assign, on kernel-side, the created window as the "current" desktop window,
when it was the first one to be created for the given desktop.
This was necessary back when Win32 desktop windows were managed on
CSRSS side (via the ReactOS-specific `win32csr/desktopbg.c` module).

Since the introduction of the `winsrv` module, and the move of desktop
windows management into Win32k in commit 765f09416d (r57632), see also
CORE-6723, this hack isn't needed anymore because the same sequence
of actions is done by `IntCreateDesktop()`, just after creating the
desktop window.
2026-06-23 20:54:41 +02:00
Hermès Bélusca-Maïto 5d21953233 [WIN32SS:NTUSER] desktop.c!DesktopWindowProc(): Reenable the default window procedure call
The call to `IntDefWindowProc()` in the desktop window procedure
`default` case, was disabled in commit ff31610bfb (r68908), because
of a supposed "painting message regression", probably related at
that time to a previous commit 6dfa71c487 (r68904) and CORE-7797.
This isn't relevant anymore.
2026-06-23 20:54:40 +02:00
Hermès Bélusca-Maïto 479debeea3 [WIN32SS:NTUSER] desktop.c: Cleanup DesktopWindowProc()
- Move local variables in their corresponding case-blocks;
- Remove an unused trace.
2026-06-23 20:54:39 +02:00
Ahmed Arif 7f79e1c948 [NTUSER] IntNotifyWinEvent(): Fix 4th argument copypasta (#9138)
The caret EVENT_OBJECT_SHOW notification passed OBJID_CARET as idChild,
while the other four caret events in the file correctly pass CHILDID_SELF.
2026-06-11 16:24:26 +03:00
Ahmed Arif 529f3c618d [NTUSER] Return the correct value for SPI_GETLOWPOWERACTIVE (#9135) 2026-06-11 00:32:35 +02:00
Katayama Hirofumi MZ 19b19ec305 [USER32][COMCTL32] Edit control: Fix alignment mask (#9115)
Based on JIRA user I_Kill_Bug's "Edit Alignment.patch".
JIRA issue: CORE-20631
- Add (ES_LEFT | ES_RIGHT | ES_CENTER) flags to
  style_change_mask variable.
2026-06-09 13:52:46 +09:00
Ahmed Arif 2dddf48071 [NTUSER] Use MOUSEEVENTF_XDOWN/XUP in the X-button flush checks (#9122)
This fixes the mismatch, where the flush checks wrongly tested `mi.dwFlags` (`MOUSEEVENTF_XDOWN/XUP`) against the raw `MOUSE_BUTTON_4/5` bits, so the combined button-4+5 events were flushed in the wrong block or were dropped.
2026-06-08 23:59:52 +02:00
Ahmed Arif 3511472586 [NTUSER] Fix XBUTTON1 reported as XBUTTON2 on WM_XBUTTONUP (#9120)
Bug was introduced in https://github.com/reactos/reactos/commit/9e2f17bd8e32da6c9c3bfd029927fb9d44971773 (r54227).
2026-06-08 22:24:13 +03:00
Ahmed Arif d3ed29ef06 [NTGDI][POLYTEST] Use newx1 as the lower bound in polyfill line-touch test (#9118)
Bug/typo was introduced in https://github.com/reactos/reactos/commit/5b6d43ab50b88d2ab8fd3d7ebf434173c5768065 (r5619).
2026-06-08 16:42:33 +03:00
Ahmed Arif a94352ba48 [WIN32SS:ENG] Fix copy direction in overlapping EngTransparentBlt (#9117)
The brackets were around the wrong part, so the < checked the left edge against the picked direction instead of against the other left edge.

Bug was introduced in https://github.com/reactos/reactos/commit/5424a511074933c1b7874cdfce28fd1e06125b12 (r8988), then improved in https://github.com/reactos/reactos/commit/07a533fe02d9f3affaa33d004159ae846cbf1eb5 (r40380), however the obvious braces issue was not noticed.
2026-06-08 14:20:41 +03:00
Ahmed Arif 984657bdf0 [WIN32SS:ENG] Fix Y coordinate of the software pointer exclude rectangle (#9116)
Crazy that this typo survived two decades, but here we are, that might fix some GDI test.

Bug was introduced in https://github.com/reactos/reactos/commit/50b193239bd9554a4e7cf671a001dc12ec726454 (r12035).
2026-06-08 13:48:12 +03:00
Katayama Hirofumi MZ 3ebf95acaa [IMM32] softkbd.c: Fix warnings (#9061)
JIRA issue: N/A
- Erase "pT1 = pT1;" self-assignment.
- Add SOFTKBDDATAEX structure as
  an extension of SOFTKBDDATA.
- Fix array-bounds warning, by using
  SOFTKBDDATAEX.
2026-05-28 23:09:44 +09:00
Timo Kreuzer 7f459b49f0 [WIN32K:NTGDI] Fix brush origin for pattern painting
Use pdc->ptlFillOrigin (which is adjusted by the Window origin already) instead of pdc->pdcattr->ptlBrushOrigin.
Fixes several gdiplus_winetest:brush tests
2026-05-22 18:23:42 +00:00
Katayama Hirofumi MZ df7c1fbc6b [NTGDI][FREETYPE] Remove dead parameters (#9022)
Improve simplicity for future.
JIRA issue: CORE-8466
- Remove the 1st parameter (PDC) of
  TextIntUpdateSize function.
- Remove the 1st parameter (PDC) of
  IntRequestFontSize function.
2026-05-17 09:58:56 +09:00
Katayama Hirofumi MZ 713888355b [NTGDI][FREETYPE] 2-line fix: Changing DPRINT1 to DPRINT
to avoid unnecessary log spam. @KRosUser suggests.
JIRA issue: N/A
2026-05-14 21:31:44 +09:00
Thomas Anderson b2b166c565 [USERSRV] Fix cut off text in all dialog translations (#8945)
CORE-19470
2026-05-14 13:36:25 +03:00
Timo Kreuzer f85e19ecfb [GDI32] Relax an ASSERT
This prevents an assertion failure in gdi32_winetest
2026-05-08 19:30:33 +00:00
Timo Kreuzer 1cf31524d5 [REACTOS] Stop using non-conforming swprintf / vswprintf
Use the underscored versions instead.
2026-05-07 06:27:58 +00:00
Doug LyonsandJose Carlos Jesus 1dc2e6de72 [USER32][COMCTL32] EDIT control: Fix vertical scrolling past line number 32767 (#8930)
CORE-19305

Change how WM_VSCROLL is handled to allow higher line counts to be passed to EDIT_WM_VScroll.
Use the GetScrollInfo() function to determine vertical scroll position and pass this to EDIT_WM_VScroll.
---------
Co-authored-by: Jose Carlos Jesus <[email protected]>
2026-05-06 19:11:58 -05:00
Doug Lyons 049085f106 [GDI32] Fix pptviewer '97 and calls to PolylineTo and PolyBezierTo (#8902)
CORE-20553

Fix PolylineTo and PolyBezierTo based on Wine 10.0.
Include starting point in the "POINTS" variable being passed to PolylineTo and PolyBezierTo.
Handle the starting point as the origin for drawing the lines.
2026-05-04 20:53:32 -05:00
Katayama Hirofumi MZ 5ab1ff188c [NTUSER][ENG] Remove needless comments (#8896)
JIRA issue: N/A
2026-04-24 07:02:23 +09:00
Katayama Hirofumi MZ eb9a73c975 [NTUSER] IntImmProcessKey: Use KF_... flags (#8897)
A tiny refactoring for code readability.
JIRA issue: CORE-19268
Use HIWORD macro and KF_...
constants.
2026-04-23 22:53:36 +09:00
Timo Kreuzer 9d1418fcb6 [NDK][NTDLL][KERNEL32] Improve tick count to ms calculation
Use an inline function to do the calculation (optimized for 32/64 bit).
2026-04-23 11:58:15 +00:00
Katayama Hirofumi MZ 40252ff735 [KERNEL32][CONSRV][SDK] Implement ConsoleIMERoutine (#8862)
Preparing for Console IME.
JIRA issue: CORE-18923
- Add IntRegQueryValue,
  IntPathQuoteSpacesW, and
  GetConsoleIMECommandLine helper
  functions.
- Add ConsoleIMERoutine function.
- Modify ConnectInfo.ImeRoutine in
  ConDllInitialize function.
- Modify kernel32.spec to add
  ConsoleIMERoutine.
- Add ConsoleIMERoutine prototype
  to <wincon_undoc.h>.
- Connect ImeRoutine in
  ConSrvConnect function.
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]>
2026-04-21 17:52:19 +09:00
Katayama Hirofumi MZ 9533ad790a [WINSRV] ConioWriteConsole: Modify update rect for CJK (#8859)
Correctly displaying Asian characters
on Asian Console.
JIRA issue: CORE-18972
Modify the update rectangle for Chinese,
Japanese, and Korean.
2026-04-17 00:59:34 +09:00
Katayama Hirofumi MZ 747b3c0cc0 [IMM32] Implement WINNLSTranslateMessage (#8852)
Completing the IME messaging framework.
JIRA issue: CORE-19268
- Fix corner cases at ImmGenerateMessage and
  ImmTranslateMessage functions.
- Implement WINNLSTranslateMessage function.
2026-04-14 11:23:18 +09:00
Max Korostil feb9febaae [WIN32KNT_APITEST][NTUSER] Fix NtUserConvertMemHandle BSOD (#7878)
Fix NtUserConvertMemHandle BSOD.

JIRA issue: CORE-18121
2026-04-12 19:10:34 -05:00
Katayama Hirofumi MZ 215d409f52 [IMM32][NTUSER][SDK] Implement ImmSendIMEMessageExA/W (#8850)
Supporting Win3.x IMM.
JIRA issue: CORE-19268
- Move <wine/ime.h> to psdk <ime.h>.
- Add some constants to
  <imm32_undoc.h>.
- Implement ImmSendIMEMessageExA
  and ImmSendIMEMessageExW
  functions.
2026-04-11 09:45:38 +09:00
Katayama Hirofumi MZ 61fb4db34c [SDK][IMM32][NTUSER] Delete <jpnvkeys.h> and use <wine/ime.h> instead (#8847)
Follow-up of #8846. Now <jpnvkeys.h>
is useless. Minor refactoring and
standardation.
JIRA issue: CORE-19268
- Replace <jpnvkeys.h> usage with
  <wine/ime.h> and fix
  VK_DBE_ENTERIMECONFIGMODE
  naming.
- Remove duplicated
  WM_IME_REPORT/IR_* and
  UNDETERMINESTRUCT definitions
  now provided by wine/ime.h.
- Introduce win3send.c half-
  implementing
  ImmSendIMEMessageExA/W.
- Add CMake option
  IMM_WIN3_SUPPORT (default: ON).
2026-04-10 08:30:56 +09:00
Katayama Hirofumi MZ ce73ba4426 [IMM32][SDK] ImmGetCompositionString: Support GCS_PRIVATE (#8844)
Prepare for CTF IME support.
JIRA issue: CORE-19268
- Add GCS_PRIVATE (0x8000) constant,
  COMPSTR_PRIVATE structure, and
  CtfImmIsGuidMapEnable prototype
  to <imm32_undoc.h>.
- Implement GCS_PRIVATE index in
  ImmGetCompositionStringA/W.
2026-04-10 07:10:11 +09:00
Katayama Hirofumi MZ 4671b481a3 [NTGDI][FREETYPE] FontLink: Request sub-font sizes (#8806)
A bug fix of FontLink'ed glyph size.
JIRA issue: CORE-20470
- Add FONTLINK_ENTRY structure
  and g_FontLinkEntries variable.
- Delete font-link cache mechanism.
- Don't access the registry while
  rendering is in progress.
- Request sub-font sizes while
  drawing FontLink text.
2026-04-07 14:06:50 +09:00
Katayama Hirofumi MZ 45a4f95b04 [NTGDI][FREETYPE] Revert 'font look-up cache #8641' (#8816)
#8641 introduced some bugs. We revert it.
JIRA issue: CORE-20538
- Delete FONT_LOOKUP_CACHE and
  s_FontLookupCacheList.
- Delete FontLookUp_... functions.
- Revert FontLink_PrepareFontInfo and
  TextIntRealizeFont functions.
2026-04-01 19:23:17 +09:00
Katayama Hirofumi MZ 863203030f [IMM32][SDK] Rename CLIENTIMC_UNKNOWN2 as CLIENTIMC_LOCKED (#8807)
Improve code readability.
JIRA issue: CORE-19268
- Rename CLIENTIMC_UNKNOWN2
  flag as CLIENTIMC_LOCKED.
- Delete unused
  CLIENTIMC_UNKNOWN4 flag.
- Fix the return value of
  Imm32AssignNewLayout function.
2026-03-30 04:39:26 +09:00
Katayama Hirofumi MZ 75e1d78fe9 [IMM32][SDK] imemenu.c: Rewrite IME Menu feature (#8769)
There were some design difference
comparing to Windows. Improve
IME Menu compatibility.
JIRA issue: CORE-20142
- Re-implement IME Menu.
- Modify
  ImmPutImeMenuItemsIntoMappedFile
  prototype.
2026-03-29 11:33:23 +09:00
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