1660 Commits
Author SHA1 Message Date
Alex Mendoza 7658029392 [VBEMP] Return NO_ERROR in VBESetPowerState (#9350)
Fix incorrect status code returned by VBESetPowerState()
in the VBE miniport driver.

- VBESetPowerState() returned `VBE_SUCCESS` (`0x4F`, raw VESA BIOS AL
  success code) instead of `NO_ERROR` on success, so callers checking for
  `NO_ERROR` would treat every successful DPMS power-state change
  as a failure. Change it to `NO_ERROR`.
- Change annotations to SAL2 in the source and header.
2026-07-28 22:52:45 +03:00
Katayama Hirofumi MZ 3b241f5e8e [IMM32] ImmGetRegisterWordStyleA: Change MB_PRECOMPOSED to zero (#9286)
The parameter was wrong.
JIRA issue: CORE-20683
- Don't use MB_PRECOMPOSED flag
  for WideCharToMultiByte.
2026-07-13 20:18:41 +09:00
Timo Kreuzer 020b5b7b0a [USER32] Fix GetDisplayConfigBufferSizes
Fixes crash in user32_winetest on NT6 builds.
2026-07-12 07:42:40 +00:00
Oleg Dubinskiy f729134316 [USER32] Implement IsServerSideWindow() (undocumented) (#9229)
CORE-19946
Adapted from PR #7577

Implement the undocumented `IsServerSideWindow()` function in user32.
It checks whether a window has a window procedure that resides in kernel
mode, and returns a boolean condition based on the appropriate internal
window state flag (`WNDS_SERVERSIDEWINDOWPROC`).

This function is not officially documented by Microsoft, but there exists
unofficial documentation[^1] for it.

It is required and used internally by uxtheme.dll from Windows XP/2003/Vista/7/etc.
The log spams with it a lot, when using uxtheme.dll from Windows in ReactOS.

[^1]: https://undoc.airesoft.co.uk/user32.dll/IsServerSideWindow.php
2026-07-06 18:01:29 +02:00
Mohammad Amin Mollazadeh 64f1cf3b6d [WIN32SS:NTUSER] Fix DrawText ellipsification bug (#9240)
CORE-20581

Fix DrawText ellipsification rendering bug when `DT_WORD_ELLIPSIS` / `DT_PATH_ELLIPSIS` is used.

Import patch from Wine 11.3: wine-mirror/wine@5909e90 (https://gitlab.winehq.org/wine/wine/-/merge_requests/11298)
```
user32: Fix lastSlash handling in TEXT_PathEllipsify.

Set lastSlash to end of string when no path separator is found.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59727

wine commit id 5909e9070f2fba8f6231e6a2b1459dadce524b4b by Maotong Zhang <[email protected]>
```
2026-07-04 20:25:18 +02:00
Timo Kreuzer 5e76d075f1 [WIN32K:ENG] Relax surface parameter validation
If no bitmap buffer size is provided (e.g. allocation path from EngCreateBitmap), do not validate that the size calculation is valid. Should fix some display drivers, like Radeon IGP 320M.
See CORE-13036, CORE-11676
2026-07-04 07:55:24 +00:00
Mohammad Amin MollazadehandSimone Mario Lombardo 6d8a5fa0bb [WIN32SS:NTGDI] Allow calling NtGdiCreateHalftonePalette with a NULL hDC (#9217)
CORE-20231

Tests show this is allowed on Windows and even Wine. Also, official MS
Windows SDK headers indicate that the `CreateHalftonePalette()` `hDC`
parameter is optional, and so can be NULL.

Not allowing a NULL `hDC` caused compatibility issues, breaking applications
like Internet Explorer 8.0 and Microsoft Encarta.

Make `NtGdiCreateHalftonePalette()` accept a NULL `hDC`, fixing its crash
in this case, and only locking it when it's not NULL. Simplify also the
function execution path.

Co-authored-by: Simone Mario Lombardo <[email protected]>
2026-07-02 20:19:33 +02:00
Ahmed Arif cf47094103 [NTUSER] Preserve WM_QUIT in move/size modal loop (#9087)
Dragging the first-boot install/status window could make setup stall,
and the shell never started after that.

The problem is that the move/size modal loop can remove a posted `WM_QUIT`
while setup is tearing the thread down. That quit message then does not
reach the outer `GetMessage()` loop, so the setup thread keeps waiting
instead of exiting.

This fix keeps the `WM_QUIT` message alive by re-posting it and leaving
the move/size loop.

See also: https://devblogs.microsoft.com/oldnewthing/20050222-00/?p=36393

## How to test

Boot to first-boot setup, drag the install/status window while it is finishing,
and check that setup continues and Explorer starts instead of hanging.
2026-06-29 21:20:26 +02:00
Ahmed Arif b82e2884fc [NTUSER] Report fresh scrollbar state in co_IntGetScrollBarInfo (#9137)
`co_IntGetScrollBarInfo()` computed the `rgstate` bits into the output buffer
and then immediately overwrote them with the cached copy, so callers always
got stale state.

Fix this by copying the cached info before computing `rgstate`.

This also exposed an inverted `WS_DISABLED` test (per wine, disabled `SB_CTL`
should report `UNAVAILABLE`, not enabled ones), which is now fixed as well.
2026-06-29 21:10:41 +02:00
Jose Carlos Jesus ae0f8d52ac [CONSRV] Add Portuguese (pt-PT) translation (#9158) 2026-06-28 20:31:02 +02:00
Ahmed Arif b38db9dd23 [NTUSER] Clip the non-client update region to the dirty region (#9126)
Remove the excessive repainting of the non-client window area (title caption/buttons and borders) whenever other windows are being dragged over.

CORE-5877, CORE-16672
2026-06-28 20:24:50 +02:00
Ahmed Arif c0f18d059a [WIN32SS:GDI] Fix an off-by-one error in the StretchBlt mask bounds check (#9136)
The mask bounds check in `DIB_XXBPP_StretchBlt` allowed `sx == cx` (and similar for `sy`),
reading one pixel past the end of the mask bitmap.
On the contrary, the source-surface check a few lines below already does it right.
2026-06-27 17:03:48 +02:00
Katayama Hirofumi MZ d47cdbbdff [GDI32][GDI32_APITEST][SDK] Support GetGlyphOutlineWow (#9210)
Add 16-bit support and refactor.
JIRA issue: CORE-8466
- Refactor GetGlyphOutlineA/W.
- Implement GetGlyphOutlineWow.
- Modify gdi32.spec.
- Add prototype into <undocgdi.h>.
- Enhance GetGlyphOutline testcase.
2026-06-27 11:36:36 +09:00
Ahmed Arif aaab5f0198 [WIN32SS:NTGDI] IntGdiCreateDisplayDC: Directly invoke GreCreateCompatibleDC (#9164)
Call the internal GreCreateCompatibleDC instead of the NtGdi syscall stub.
2026-06-26 14:28:42 +02:00
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