From f310dc1b8b82c2ab3b68f5f1930840fce43ca4d4 Mon Sep 17 00:00:00 2001
From: tatyana <tatyana@etersoft.ru>
Date: Tue, 15 Jan 2013 14:04:45 +0400
Subject: [eter-2.0.0 1/2] Revert "winspool.drv: Get default DEVMODEW if fMode
 not equal DM_IN_BUFFER(eterbug #8821)"

This reverts commit 73fd9b57f8126dbd96aa8537a3734f3a54a393ce.
---
 dlls/winspool.drv/info.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 191bfff..5597823 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -1737,7 +1737,7 @@ LONG WINAPI DocumentPropertiesA(HWND hWnd,HANDLE hPrinter,
 	hWnd,hPrinter,pDeviceName,pDevModeOutput,pDevModeInput,fMode
     );
 
-    if(!pDeviceName || !strcmp(pDeviceName,"")) {
+    if(!pDeviceName) {
         LPCWSTR lpNameW = get_opened_printer_name(hPrinter);
         if(!lpNameW) {
 		ERR("no name from hPrinter?\n");
@@ -1777,22 +1777,9 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
 {
 
     LPSTR pDeviceNameA = strdupWtoA(pDeviceName);
-    LPDEVMODEA pDevModeInputA;
+    LPDEVMODEA pDevModeInputA = DEVMODEdupWtoA(pDevModeInput);
     LPDEVMODEA pDevModeOutputA = NULL;
     LONG ret;
-    DWORD size;
-    DWORD buflen = sizeof(DEVMODEW);
-    LPBYTE ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen);
-
-    if(!(fMode&DM_IN_BUFFER))
-    {
-        WINSPOOL_GetDefaultDevMode(ptr, buflen, &size);
-        if(!pDevModeInput)
-            pDevModeInput = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
-        memcpy(pDevModeInput, ptr, size);
-    }
-
-    pDevModeInputA = DEVMODEdupWtoA(pDevModeInput);
 
     TRACE("(%p,%p,%s,%p,%p,%d)\n",
           hWnd,hPrinter,debugstr_w(pDeviceName),pDevModeOutput,pDevModeInput,
@@ -1812,7 +1799,6 @@ LONG WINAPI DocumentPropertiesW(HWND hWnd, HANDLE hPrinter,
         ret += (CCHDEVICENAME + CCHFORMNAME);
     HeapFree(GetProcessHeap(),0,pDevModeInputA);
     HeapFree(GetProcessHeap(),0,pDeviceNameA);
-    HeapFree(GetProcessHeap(),0,ptr);
     return ret;
 }
 
@@ -3350,7 +3336,7 @@ static BOOL WINSPOOL_GetStringFromReg(HKEY hkey, LPCWSTR ValueName, LPBYTE ptr,
  * FIXME - use ppd.
  */
 
-void WINSPOOL_GetDefaultDevMode(
+static void WINSPOOL_GetDefaultDevMode(
 	LPBYTE ptr,
 	DWORD buflen, DWORD *needed)
 {
-- 
1.8.0.3
