Commit Graph

1605 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
Katayama Hirofumi MZ
0566a0f699 [NTGDI][GDI32][FREETYPE] Rewrite GetGlyphIndicesA/W (#8747)
JIRA issue: CORE-20505
- NtGdiGetGlyphIndicesW function simply calls
  NtGdiGetGlyphIndicesWInternal function.
- NtGdiGetGlyphIndicesWInternal allocates buffer
  and calls GreGetGlyphIndicesW function.
- Add GreGetGlyphIndicesW definition in freetype.c.
- Modify GetGlyphIndicesA function.
2026-03-23 12:05:19 +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
Katayama Hirofumi MZ
e6328fbf1e [NTGDI][FREETYPE][SDK] Rewrite NtGdiGetCharABCWidthsW (#8704)
Refactor and improve readability.
JIRA issue: CORE-20505
- Add GreGetCharABCWidthsW helper function.
- Rewrite NtGdiGetCharABCWidthsW by using
  GreGetCharABCWidthsW.
2026-03-13 18:24:26 +09: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
Hermès Bélusca-Maïto
03b1e240bf [VIDEOPRT] Deduplicate the IntIsVgaSaveDriver(Name) functionality (#8718)
- Initialize the device extension `IsVgaDriver` field with a single
  `IntIsVgaSaveDriver()` call when the video device extension is first
  initialized in `IntVideoPortCreateAdapterDeviceObject()`.

- The `IsVgaDriver` field can then be used wherever we previously
  invoked `IntIsVgaSaveDriver()` (see e.g. in resource.c)

NOTE: It may be possible to move the `IsVgaDriver` field to the driver
extension structure instead, if it's not possible for miniport drivers
to influence this during calls `VideoPortInitialize()` with a custom-made
registry path (2nd parameter) containing a "\\VgaSave" substring...
(To be investigated.)

Addendum to commits 08a6834075 and 0511e9d869.
2026-03-08 17:24:20 +01:00
Hermès Bélusca-Maïto
1de8b4f0ce [DDK][VIDEOPRT] VideoPortDebugPrint(): Fix the debug filter being used; update SAL annotations (#8718)
- Use the `DPFLTR_VIDEO_ID` debug filter ID, which is the same as what
  Windows' videoprt.sys uses, so that tools and people who debug can
  easily interoperate between the two.
  Addendum to commits 11c95f7b5d (r19801) and 5b799176ba (r31477).

- Use SAL2 annotations.
2026-03-08 15:25:09 +01:00
Hermès Bélusca-Maïto
e6f7e89ccd [VIDEOPRT] Fix a debug print newline (#8718) 2026-03-08 15:24:55 +01:00
Hermès Bélusca-Maïto
f4786c1b91 [VIDEOPRT] Fix INT10h support initialization (#8717)
This problem was noticed by Zombiedeth.

Addendum to commit 89d5a3dbb8 (PR #8451).

There exist buggy 3rd-party miniport drivers, like those for the NVIDIA GeForce
8400 GS card (`nv4_mini.sys` from `181.22_geforce_winxp_32bit_english_whql.exe`)
that invoke the VideoPort Int10 routines (either `VideoPortInt10()`, or the
INT10 interface via `VideoPortQueryServices()`) from their `HwFindAdapter()`
callback (invoked via `VideoPortInitialize()`) or from their `DriverEntry()`.

However, at this point, the VideoPort Int10 services are not fully initialized:
on the x86 port, the VDM memory isn't mapped until later, when the `\Device\VideoX`
is opened by Win32k as part of its initialization in the context of the CSRSS process.

Additionally on the x86 ReactOS port since commit 89d5a3dbb8 (PR #8451), the
X86 emulator is used by default, unless either a registry setting is set to
disable the emulator, or the HAL (e.g. the NT5.x HAL) doesn't export the X86
emulator routines; in these cases the VDM is employed instead.
In the NT5.x builds VideoPort imports the HAL X86 emulator routines at runtime,
since it has to handle their possible absence. However, this importing was
previously delayed up until VideoPort initialized the Int10 services (when
`\Device\VideoX` is opened the first time by Win32k from CSRSS), meaning,
these services and the X86 emulator imports weren't initialized until then.
When booting ReactOS in these conditions with the NVIDIA driver installed,
its too-early `VideoPortInt10()` call was invoking the X86 emulator with no
imports set up, which resulted in the invocation of a NULL function pointer,
leading to a BSOD.

## Proposed changes

- Make the existing `IntInitializeInt10()` function support two invocations:
  * When invoked the first time, it initializes the X86 emulator support, by
    importing the HAL emulator routines, if applicable.
  * When invoked the second+ time, it maps the VDM memory space (done when
    `Device\VideoX` is opened by Win32k/CSRSS initialization).

- Actually perform the first `IntInitializeInt10()` invocation in the
  `if (!FirstInitialization)` block of `VideoPortInitialize()`.

- Set a `VDMAddressSpaceInitialized` flag to TRUE only when the VDM memory
  space is mapped (during the second `IntInitializeInt10()` invocation).
  Check this flag in both `IntInt10CallBiosV86()` and `IntInt10CallBiosEmu()`
  (x86 build only).

- Adjust two returned status values in `IntInitializeVideoAddressSpace()`.
2026-03-08 15:13:54 +01:00
Katayama Hirofumi MZ
06ae7ec211 [FREETYPE][NTGDI][GDI32][GDI32_APITEST] Rewrite GetCharWidth etc. (#8690)
Refactoring and improve readability.
JIRA issue: CORE-20505
- Add GreGetCharWidthW helper
  function.
- Rewrite NtGdiGetCharWidthW
  using GreGetCharWidthW.
- Refactor NtGdiGetGlyphIndicesW.
- Improve sanity check of
  GetCharWidthA/W/I,
  GetCharWidth32A/W, and
  GetCharWidthFloatA/W.
- Add GetCharWidth testcase to
  gdi32_apitest.
2026-03-01 20:12:45 +09: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
Katayama Hirofumi MZ
0c4091cd04 [FREETYPE][NTGDI] Update FreeType from 2.10.0 to 2.10.4 (#8671)
Modernize modules.
JIRA issue: CORE-17390
- Update FreeType to 2.10.4.
- Delete ChangeLog.
- Delete sdk/lib/3rdparty/freetype/src/gxvalid
  (useless for us).
- Delete sdk/lib/3rdparty/freetype/src/otvalid
  (useless for us).
- Keep ReactOS hacks on FreeType.
- Adapt ntgdi/freetype.c to new FreeType.
2026-02-26 09:32:57 +09:00
Katayama Hirofumi MZ
f7ef944dca [NTGDI][FREETYPE] Refactor NtGdiGetGlyphIndicesW (#8682)
Make code faster and improve readability.
JIRA issue: N/A
- Avoid buffer allocation by using
  stack variables if possible.
- Add IntGetFontDefaultChar helper
  function and use it.
2026-02-26 08:56:02 +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
Katayama Hirofumi MZ
f9c7221a1e [NTGDI][FREETYPE] Follow-up of #8641 (#8658)
Follow-up of #8641. Reduce freetype.c lines.
JIRA issue: CORE-19898
- Follow @HBelusca's review in #8641.
- Move some codes in freetype.c into utils.c.
2026-02-07 08:08:30 +09: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
9d5c0bff36 [NTGDI][FREETYPE] Introduce font look-up cache (#8641)
Text rendering speed is justice! Font
search is heavy operation. Adding
cache to it is rational.
JIRA issue: CORE-19898
- Define FONT_LOOKUP_CACHE
  structure.
- Add s_FontLookupCacheList
  global variable to save cache.
- Use cache in FontLink_PrepareFontInfo
  and TextIntRealizeFont.
2026-02-02 09:45:06 +09:00
Adam Słaboń
4a7d370d93 [VIDEOPRT] VideoPortVerifyAccessRanges: Fix use after free (#8648)
Fixes a crash when booting with special pool enabled
Addendum to 0511e9d869
2026-02-01 14:02:06 +01: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
Justin Miller
bc690cfe43 [VIDEOPRT] Allow later nvidia cards to load (#8646)
Clear out the miniport owned extension and assign the slot iD properly
2026-01-30 11:23:00 +00: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
Justin Miller
a30ed15ceb [WIN32SS:NTGDI] Handle AMD GPUs being dumb when they do a double restore (#8644)
According to the kerestorefloatingpointstate msdn article shouldn't be on the kernel's responsibility to handle. for the life of me i couldn't figure out why this specific driver does this until finally I tried this on Windows and low and behold on checked builds of windows it actually tells you it does the exact same thing. Investigating deeper I realized win32k just has some extra handling for this dumb case.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Co-authored-by: Timo Kreuzer <timo.kreuzer@reactos.org>
2026-01-29 23:17:33 +00:00
Timo Kreuzer
07de64139a [GCC_SSP] Turn the GCC stack protector lib into a normal library
Stop pointless target_sources(xxx PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>). The only effect it has is to force the object file into the target, which was already done by specifying the libraries as OBJECT libraries, which is also pointless, and only leads to problems.
2026-01-29 17:13:40 +02:00
Justin Miller
c990b725b4 [WIN32SS] Remove NATIVE_REACTX check - reenable Oleg's code (#8554)
* [REACTX] Simple Non-AGP ddraw allocator
* [WIN32SS] remove NATIVE_REACTX check - reenable oleg's code
JIRA issue: CORE-19142

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2026-01-29 06:28:43 +00:00
Justin Miller
a08d639b22 [WIN32SS:NTGDI][VIDEOPRT] Multimonitor on RealHW fixes (#8638)
This commit attempts to resolve two regressions and improve realhw behavior
A PNP_DETECTED_FATAL_ERROR bug check caused by the monitor device instance being duplicated.
https://jira.reactos.org/browse/CORE-20410
this is mostly due to ChildID being overwritten with the same bus/slot when 2 monitors are attached to one GPU
And video drivers failing to startup after calling VideoPortCreateSecondaryDisplay

Co-authored-by: Dmitry Borisov <di.sean@protonmail.com>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2026-01-29 04:29:55 +00:00
Hermès Bélusca-Maïto
fc75870f1c [WIN32SS:NTGDI] Addendum to commit 108db5b356 (PR #8536)
- In the `if (!psurf)` code path, unlock in the reverse locking order.
- Move the `SafeInData == NULL` check outside of `_SEH2_TRY` and just
  after the `ExAllocatePoolWithTag` call.
- Removing trailing whitespace.
2026-01-20 19:52:47 +01:00
Justin Miller
108db5b356 [NTGDI] Minimal pass of fixing ExtEscape (#8536)
* [WIN32SS] Minimal pass of fixing ExtEscape
Resolves issues with the AMD/ATI GPU Driver and the Intel OpenGL ICD when used in fullscreen mode.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2026-01-20 17:56:03 +00:00
Timo Kreuzer
49f633517f [WIN32K:NTGDI] Fix last error for NtGdiMaskBlt 2026-01-20 12:35:55 +02: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
Timo Kreuzer
bb7a218367 [WIN32K:ENG] Implement EXLATEOBJ_vInitXlateFromDCsEx
This version allows to pass a background color.
2026-01-20 12:35:55 +02:00
Timo Kreuzer
3e7009a08e [WIN32K:NTGDI] Mark DIB palettes with PAL_DIBSECTION flag
This is needed, because color translation works differently for DIB sections.
2026-01-20 12:35:55 +02:00
Timo Kreuzer
11c276109c [WIN32K:NTGDI] Mark 2-color indexed palettes as monochrome
This is mostly an optimization, as translation from RGB to mono are much faster than generic indexed palettes.
It exposes a broken RGB-to-mono translation though, which previously was hidden for DIB sections, which didn't mark the palette as mono, therefore taking the slow index path, which worked correctly.
2026-01-20 12:35:55 +02:00
Timo Kreuzer
ce8329f862 [WIN32K:ENG] Rewrite monochrome color translation
- Handle DIB sections
- Use DC's background / foreground colors as appropriate
- Optimize translation functions
2026-01-20 12:35:55 +02:00