From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/wgl.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 7de0d1b1dba..e24327af15b 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -29,6 +29,7 @@ #include "winbase.h" #include "winreg.h" #include "ntuser.h" +#include "ntgdi.h" #include "malloc.h"
#include "unixlib.h" @@ -314,6 +315,7 @@ static struct wgl_pixel_format *get_pixel_formats( HDC hdc, UINT *num_formats, struct get_pixel_formats_params args = { .teb = NtCurrentTeb(), .hdc = hdc }; PVOID *glReserved = NtCurrentTeb()->glReserved1; NTSTATUS status; + DWORD is_memdc;
if (glReserved[WINE_GL_RESERVED_FORMATS_HDC] == hdc) { @@ -329,6 +331,9 @@ static struct wgl_pixel_format *get_pixel_formats( HDC hdc, UINT *num_formats, args.max_formats = args.num_formats; if ((status = UNIX_CALL( get_pixel_formats, &args ))) goto error;
+ if (NtGdiGetDCDword( hdc, NtGdiIsMemDC, &is_memdc ) && is_memdc) + args.num_onscreen_formats = args.num_formats; + *num_formats = args.num_formats; *num_onscreen_formats = args.num_onscreen_formats;