Module: wine Branch: master Commit: 01fab4c4098f0e974f38448a44815747df691128 URL: https://gitlab.winehq.org/wine/wine/-/commit/01fab4c4098f0e974f38448a4481574...
Author: Piotr Caban piotr@codeweavers.com Date: Thu Oct 5 14:32:37 2023 +0200
gdi32: Update printer DEVMODE in ResetDCW.
---
dlls/gdi32/dc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 3185fb273ba..02c6a8c84cd 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -524,7 +524,18 @@ HDC WINAPI ResetDCW( HDC hdc, const DEVMODEW *devmode ) print = get_dc_print( dc_attr ); if (print && print->flags & CALL_END_PAGE) return 0; if (!NtGdiResetDC( hdc, devmode, NULL, NULL, NULL )) return 0; - if (print && !print_copy_devmode( print, devmode )) return 0; + if (print) + { + PRINTER_DEFAULTSW prn_defaults = + { + .pDatatype = NULL, + .pDevMode = (DEVMODEW *)devmode, + .DesiredAccess = PRINTER_ACCESS_USE + }; + + if (!print_copy_devmode( print, devmode )) return 0; + ResetPrinterW( print->printer, &prn_defaults ); + } return hdc; }