Commit graph

3029 commits

Author SHA1 Message Date
Paul Gofman c4073d5abf win32u: Set DEVPKEY_Device_RemovalPolicy for GPUs. 2023-04-06 17:02:18 +02:00
Paul Gofman bee387dc8a win32u: Set DEVPKEY_Device_BusNumber for GPUs. 2023-04-06 17:02:18 +02:00
Paul Gofman 80910517d7 win32u: Set DEVPKEY_Device_MatchingDeviceId for GPUs. 2023-04-06 17:02:18 +02:00
Piotr Caban 273f40b6c4 gdi32: Let SetDIBits handle DIB_PAL_INDICES color usage in PlayEnhMetaFileRecord. 2023-04-06 14:32:32 +02:00
Piotr Caban 8ada95cec4 gdi32: Rename DIB_PAL_MONO to DIB_PAL_INDICES. 2023-04-06 14:32:32 +02:00
Piotr Caban 3f051d3b1e win32u: Add support for undocummented DIB_PAL_INDICES color usage in SetDIBits. 2023-04-06 14:32:32 +02:00
Piotr Caban 065fbd206d gdi32: Improve EMR_CREATEDIBPATTERNBRUSHPT playback.
It makes the lbHatch data available after PlayEnhMetaFileRecord returns.
2023-03-09 18:11:28 +01:00
Francois Gouget 9d6a9909c3 gdi32/tests: Fix the SetDeviceGammaRamp() tests on Windows 10 1909.
SetDeviceGammaRamp() checks the specified ramp to prevent applications
from setting malicious gamma ramps (e.g. hiding text by remapping its
color to match the background).
But Windows 10 1909 has fewer checks than later Windows 10 versions.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54593
2023-02-27 16:36:22 +01:00
Francois Gouget 267f612604 gdi32/tests: Make the gamma ramp failures more unique.
Otherwise the only way to identify which failure happened is to check
its line number which is not practical across versions.
2023-02-27 16:36:22 +01:00
Francois Gouget 390ed160ef gdi32/tests: Simplify setting up the non uniform gamma ramps. 2023-02-27 16:36:22 +01:00
Ivan Chikish 907b1b4a36 gdi32/tests: Check last error on ' '. 2023-02-24 22:23:12 +01:00
Francois Gouget 2436964d56 gdi32/tests: Mark a couple other D3DKMTCheckOcclusion() tests as flaky.
They also happen randomly on Windows (see commit 2d19baa6b5).

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51313
2023-02-20 23:00:34 +01:00
Hans Leidekker a744265c1e gdi32/tests: Mark another D3DKMTCheckOcclusion() test as flaky.
It shows the same behavior as the one marked by commit 2d19baa6b5.

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51313
2023-01-30 18:54:29 +01:00
Piotr Caban b6204639ba gdi32: NULL terminate output string in CreateDCW. 2022-11-29 19:11:19 +01:00
Piotr Caban 1cf1412a12 gdi32: Get printer output file name in StartDoc. 2022-11-22 18:27:30 +01:00
Piotr Caban 4e527045d5 gdi32: Don't crash in StartDoc on NULL DOCINFO. 2022-11-22 18:27:30 +01:00
Alexandre Julliard a1c8232b33 include: Remove custom/undocumented language identifiers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-11-16 21:24:18 +01:00
Tarcísio Ladeia de Oliveira 61f566260b gdi32/tests: Fix assertion message. 2022-11-07 21:13:32 +01:00
Ziqing Hui b558c87c50 gdi32/uniscribe: Add fallback font for Kana and CJK script.
This fixes Chinese and Japanese text display issue for
Sins of a Solar Empire: Rebellion.
2022-11-04 19:23:55 +01:00
Mark Jansen 4312be1646 gdi32: Fix possible overflow.
According to the documentation of ScriptShape function, the psva argument should have the number of elements indicated by cMaxGlyphs.
2022-10-11 20:54:18 +02:00
Francois Gouget 2d19baa6b5 gdi32/tests: Mark tests failing randomly on Windows as flaky.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51313
2022-10-11 17:13:36 +02:00
Alexandre Julliard 7ab46c4f21 unicode: Update to Unicode 15.0.0. 2022-09-14 22:38:34 +02:00
Alexandre Julliard 3e3caf1efd gdi32/tests: Mark some tests that fail without Vulkan as todo. 2022-09-13 22:07:22 +02:00
Alexandre Julliard 24da06789e unicode: Add data for high Unicode planes to the bidi direction table. 2022-09-05 18:41:47 +02:00
Alexandre Julliard ba58338b21 unicode: Add data for high Unicode planes to the linebreak table. 2022-09-05 18:41:47 +02:00
Zhiyi Zhang 58b477d158 win32u: Choose a smaller ppem to avoid exceeding the requested font height.
When height > 0, CreateFontA/W() should not return a font face exceeding the requested height.
For instance, Tahoma has 2049 units of ascent, 423 units of descent and its units per EM square is
2048. When requesting a font 20 pixels in height, ppem = units_per_EM * requested_height / (ascent + descent)
= 2048 * 20 / (2049 + 423) = 16.57 ~= 17. When getting the resulting height back from the ppem,
resulting_height = (ascent + descent) * ppem / units_per_EM = (2049.0 + 423) * 17 / 2048 = 20.52
~=21. So it ends up getting a larger font than requested and violates the spec.

Fix Nancy Drew: Legend of the Crystal Skull crash at start.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
2022-08-19 22:45:18 +02:00
Zhiyi Zhang 821b36e00b gdi32/tests: Add more tests for GetTextMetrics().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
2022-08-19 22:45:18 +02:00
Jacek Caban 2b6647cdd5 win32u: Use platform-independent layout for DC_ATTR. 2022-08-09 15:55:43 +02:00
Zhiyi Zhang 546cbdc250 win32u: Create a dummy bitmap for display device contexts.
On Windows 7 and older versions of Windows, calling GetCurrentObject(hdc, OBJ_BITMAP) for a display
device context will return a valid handle. However, this handle will fail for GetObject(). On newer
versions of Windows, GetCurrentObject(hdc, OBJ_BITMAP) for display device contexts returns a bitmap
of virtual screen size and its size changes after display mode changes. This behavior is tested in
the _check_display_dc() function in user32/tests/monitor.c.

The screen shot function of WeChat depends on GetObject() to either return failure or a valid size
for the bitmap from display device contexts. Since Wine currently report Windows 7 as default and to
save memory, the Windows 7 behavior is implemented.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
2022-05-30 22:07:42 +02:00
Huw Davies 6a9a80679d gdi32: Free the client-side emf dc info.
Signed-off-by: Huw Davies <huw@codeweavers.com>
2022-05-24 17:34:59 +02:00
Huw Davies 0c8a076e78 gdi32: Remove second initialization of emf->dc_attr.
Signed-off-by: Huw Davies <huw@codeweavers.com>
2022-05-24 17:34:59 +02:00
Zhiyi Zhang 8bc0c8d646 gdi32: Implement D3DKMTQueryVideoMemoryInfo().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 17:50:43 +02:00
Zhiyi Zhang 37b74e644a gdi32/tests: Add D3DKMTQueryVideoMemoryInfo() tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 17:50:30 +02:00
Francois Gouget 0519aec310 gdi32/tests: Trace the invalid height in test_max_height().
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-27 16:14:25 +02:00
Alexandre Julliard 7500fc1ce9 gdi32: Support UTF-8 codepage in TranslateCharsetInfo().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52847
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-22 13:06:15 +02:00
Nikolay Sivov f534e3f499 gdi32: Use NtUserGetSysColor() directly.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-19 17:35:33 +02:00
Jacek Caban cfb6f9a1e8 win32u: Introduce inline helpers for NtUserCallHwndParam calls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:13:28 +02:00
Jacek Caban 7f64eead50 win32u: Introduce inline helpers for NtUserCallOneParam calls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:13:06 +02:00
Jacek Caban dcca04606e win32u: Use NtUserCallHwndParam for MirrorRgn implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:12:59 +02:00
Eric Pouech 5c637c228f gdi32/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 10:31:43 +01:00
Jacek Caban 2353ef9bd5 gdi32: Link directly to user32.
On Windows, loading gdi32.dll causes user32.dll to be loaded. It's
important for win32u, which is not fully functional until user32 sets
KernelCallbackTable.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-17 22:16:03 +01:00
Eric Pouech b31225da21 gdi32: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-10 18:09:46 +01:00
Eric Pouech b072f01e13 win32u: Change NtGdiPolyPolyDraw parameter to ULONG.
As suggested by Nikolay Sivov.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:19 +01:00
Fabian Maurer 86d36aefc8 gdi32/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-28 09:55:04 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Alex Henrie ec72025cff gdi32/tests: Drop font test workarounds for Windows <= 2000.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-12 13:21:04 +01:00
Alex Henrie 524dbe4bef gdi32/tests: Mark a GetTextExtentPointW test as broken on Windows 10.
Fixes a testbot failure.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-12 13:21:01 +01:00
Jacek Caban 2aba4c5839 win32u: Use NtUserCallTwoParam for MirrorRgn implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:24:38 +01:00
Zhiyi Zhang 1febcf692f gdi32/tests: Test deleting the bitmap used for pattern brush creation.
Test that the bitmap for pattern brush creation can be deleted after CreatePatternBrush() and the
created brush will still function normally. However, the bitmap object can not be retrieved from
LOGBRUSH.lbHatch if the bitmap is deleted.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 12:21:50 +01:00
Jacek Caban f359c7f60c win32u: Use NtUserSelectPalette instead of GDISelectPalette.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-03 16:56:08 +01:00