[Wine-patches] Fwd: [eter-2.1 2/5] winspool.drv: If DEVMODE doesn't specify what we need - use sane defaults. (eterbug #8330)

Roman Dadkov romand на etersoft.ru
Пт Янв 25 15:03:08 MSK 2013



-------- Исходное сообщение --------
Тема: [Wine-patches] [eter-2.1 2/5] winspool.drv: If DEVMODE doesn't 
specify what we need - use sane defaults. (eterbug #8330)
Дата: 25.01.2013 09:49
От: Dmitry Timoshkov <dtimoshkov на etersoft.ru>
Кому: wine-patches на lists.etersoft.ru
Ответить: wine-devel на lists.etersoft.ru

(cherry picked from commit 9cc76b727012b8a877196159ffe8752fe239c7ce)
---
  dlls/winspool.drv/info.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 2ca4d9a..7746805 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -8458,8 +8458,13 @@ static void prepare_destination_string(HANDLE 
hPrinter, DWORD JobId, LPWSTR outp

      GetJobW(hPrinter, JobId, 2, NULL, 0, &needed);
      ji2 = HeapAlloc(GetProcessHeap(), 0, needed);
-    GetJobW(hPrinter, JobId, 2, (LPBYTE)ji2, needed, &needed);
+    if (!GetJobW(hPrinter, JobId, 2, (LPBYTE)ji2, needed, &needed))
+        ERR("GetJobW failed\n");
      dm = ji2->pDevMode;
+    /* if DEVMODE doesn't specify what we need - set sane defaults */
+    if (!(dm->dmFields & DM_COPIES)) dm->u1.s1.dmCopies = 1;
+    if (!(dm->dmFields & DM_DUPLEX)) dm->dmDuplex = DMDUP_SIMPLEX;
+    if (!(dm->dmFields & DM_COLLATE)) dm->dmCollate = DMCOLLATE_FALSE;
      docname = ji2->pDocument;

      switch (dm->dmDuplex)
@@ -8480,8 +8485,9 @@ static void prepare_destination_string(HANDLE 
hPrinter, DWORD JobId, LPWSTR outp
          option_sides = sidesnoDuplex;
          option_duplex = noDuplex;
          ERR("Unexpected value of dmDuplex field\n");
+        break;
      }
-
+
      if (eterprinting_method() == PM_SIDES)
          option_duplex = option_sides;
      sprintfW(output, comstr, 
ji2->pPrinterName,lstrlenW(docname)?docname:defaultname,
-- 
1.8.0.2

_______________________________________________
Wine-patches mailing list
Wine-patches на lists.etersoft.ru
http://lists.etersoft.ru/mailman/listinfo/wine-patches



Подробная информация о списке рассылки Wine-patches