SendMessageA for IME message
won't work in some situations.
JIRA issue: CORE-19268
Always use SendMessageW instead of
SendMessageA in ImmGenerateMessage.
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
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.
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.
- 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.
- 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.
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()`.
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.
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.
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.
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
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.
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.
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.
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>
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.
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>
- 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.
* [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>
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.
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.