Huw Davies : wineps: Set the printer's devmode using SetPrinter.
Module: wine Branch: master Commit: 43cffa0888d643d77f11eedfd14ad4ebeae8a642 URL: http://source.winehq.org/git/wine.git/?a=commit;h=43cffa0888d643d77f11eedfd1... Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Apr 11 12:36:20 2012 +0100 wineps: Set the printer's devmode using SetPrinter. --- dlls/wineps.drv/init.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index cc950e3..4af6ca9 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -113,7 +113,6 @@ static const LOGFONTA DefaultLogFont = { DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" }; -static const CHAR default_devmodeA[] = "Default DevMode"; static const struct gdi_dc_funcs psdrv_funcs; /********************************************************************* @@ -610,6 +609,14 @@ static PSDRV_DEVMODEA *get_devmode( HANDLE printer, const char *nameA, BOOL *is_ return dm; } +static BOOL set_devmode( HANDLE printer, PSDRV_DEVMODEA *dm ) +{ + PRINTER_INFO_9A info; + info.pDevMode = &dm->dmPublic; + + return SetPrinterA( printer, 9, (BYTE *)&info, 0 ); +} + static struct list printer_list = LIST_INIT( printer_list ); /********************************************************************** @@ -761,8 +768,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name) PSDRV_MergeDevmodes(pi->Devmode, &dm, pi); } - SetPrinterDataExA(hPrinter, NULL, default_devmodeA, REG_BINARY, - (LPBYTE)pi->Devmode, sizeof(DefaultDevmode)); + set_devmode( hPrinter, pi->Devmode ); } if(pi->ppd->DefaultPageSize) { /* We'll let the ppd override the devmode */
participants (1)
-
Alexandre Julliard