[PATCH] win32u: Create a dummy bitmap for display device contexts.

Alexandre Julliard julliard at winehq.org
Fri May 27 16:27:30 CDT 2022


Zhiyi Zhang <zzhang at codeweavers.com> writes:

> 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 at codeweavers.com>
> ---
>  dlls/gdi32/tests/bitmap.c |  1 -
>  dlls/win32u/dc.c          | 13 +++++++++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)

This is causing test failures here:

tools/runtest -q -P wine -T . -M user32.dll -p dlls/user32/tests/user32_test.exe monitor && touch dlls/user32/tests/monitor.ok
monitor.c:1976: Tests skipped: DisplayConfigSetDeviceInfo() is unavailable.
monitor.c:2213: Test failed: GetObjectA failed, error 6.
monitor.c:2299: Tests skipped: bpp 24: 24-bit display mode not found.
monitor.c:2299: Tests skipped: bpp 4: 4-bit display mode not found.
monitor.c:2299: Tests skipped: bpp 1: 1-bit display mode not found.
monitor.c:2364: Test failed: GetObjectA failed, error 6.
monitor.c:2445: Test failed: GetObjectA failed, error 6.
monitor.c:2468: Test failed: GetObjectA failed, error 6.
monitor.c:2483: Test failed: GetObjectA failed, error 6.
make: *** [Makefile:120414: dlls/user32/tests/monitor.ok] Error 5

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list